@tryghost/activitypub 3.0.6 → 3.0.8
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.
- package/dist/activitypub.js +6 -3
- package/dist/at-sign-Fsk3x72r.mjs +15 -0
- package/dist/at-sign-Fsk3x72r.mjs.map +1 -0
- package/dist/avatar-flipboard-C10JfFS_.mjs +19 -0
- package/dist/avatar-flipboard-C10JfFS_.mjs.map +1 -0
- package/dist/bluesky-sharing-C1xeGSL6.mjs +150 -0
- package/dist/bluesky-sharing-C1xeGSL6.mjs.map +1 -0
- package/dist/copy-C1fElSkQ.mjs +15 -0
- package/dist/copy-C1fElSkQ.mjs.map +1 -0
- package/dist/deleted-feed-item-Bun4tY2_.mjs +133 -0
- package/dist/deleted-feed-item-Bun4tY2_.mjs.map +1 -0
- package/dist/edit-profile-CYh00FZ7.mjs +3741 -0
- package/dist/edit-profile-CYh00FZ7.mjs.map +1 -0
- package/dist/feed-BxUqmcN9.mjs +207 -0
- package/dist/feed-BxUqmcN9.mjs.map +1 -0
- package/dist/hash-CNgwAx-U.mjs +17 -0
- package/dist/hash-CNgwAx-U.mjs.map +1 -0
- package/dist/inbox-DqNqII4a.mjs +21 -0
- package/dist/inbox-DqNqII4a.mjs.map +1 -0
- package/dist/index--Q6orQkb.mjs +26429 -0
- package/dist/index--Q6orQkb.mjs.map +1 -0
- package/dist/index-BueIufRq.mjs +6120 -0
- package/dist/index-BueIufRq.mjs.map +1 -0
- package/dist/index-C3KJXzZE.mjs +688 -0
- package/dist/index-C3KJXzZE.mjs.map +1 -0
- package/dist/index-C9pnotJK.mjs +4994 -0
- package/dist/index-C9pnotJK.mjs.map +1 -0
- package/dist/index-CJJXnqq1.mjs +138 -0
- package/dist/index-CJJXnqq1.mjs.map +1 -0
- package/dist/index-CONoLlDU.mjs +219 -0
- package/dist/index-CONoLlDU.mjs.map +1 -0
- package/dist/index-Dvh9q3jy.mjs +367 -0
- package/dist/index-Dvh9q3jy.mjs.map +1 -0
- package/dist/{index-CFmbpqlr.mjs → index-jhjmoHwu.mjs} +34 -34
- package/dist/{index-CFmbpqlr.mjs.map → index-jhjmoHwu.mjs.map} +1 -1
- package/dist/moderation-CYhwUFi2.mjs +113 -0
- package/dist/moderation-CYhwUFi2.mjs.map +1 -0
- package/dist/note-COVa8CMw.mjs +249 -0
- package/dist/note-COVa8CMw.mjs.map +1 -0
- package/dist/reply-BHpKVBxx.mjs +15 -0
- package/dist/reply-BHpKVBxx.mjs.map +1 -0
- package/dist/separator-DP7q5sFH.mjs +116 -0
- package/dist/separator-DP7q5sFH.mjs.map +1 -0
- package/dist/settings-3n7zo_3K.mjs +79 -0
- package/dist/settings-3n7zo_3K.mjs.map +1 -0
- package/dist/step-1-BmUukywZ.mjs +73 -0
- package/dist/step-1-BmUukywZ.mjs.map +1 -0
- package/dist/step-2-C--I3xxp.mjs +143 -0
- package/dist/step-2-C--I3xxp.mjs.map +1 -0
- package/dist/step-3-0Deh5N9c.mjs +345 -0
- package/dist/step-3-0Deh5N9c.mjs.map +1 -0
- package/dist/tabs-D_vmoLBo.mjs +1096 -0
- package/dist/tabs-D_vmoLBo.mjs.map +1 -0
- package/dist/topic-filter-DJMrhH-c.mjs +39 -0
- package/dist/topic-filter-DJMrhH-c.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/index-BJKUA7bK.mjs +0 -46030
- package/dist/index-BJKUA7bK.mjs.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { a6 as v, a7 as y, u as b, d as j, a8 as k, e as F, j as e, L as P, H as B, B as E, a9 as M, R as T, k as L, Q as A, P as C, A as H, S as u, aa as I, ab as S, ac as U } from "./index--Q6orQkb.mjs";
|
|
2
|
+
import { T as _ } from "./topic-filter-DJMrhH-c.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* @license lucide-react v0.553.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the ISC license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
const z = [
|
|
10
|
+
[
|
|
11
|
+
"path",
|
|
12
|
+
{
|
|
13
|
+
d: "M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3",
|
|
14
|
+
key: "139s4v"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
["path", { d: "M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4", key: "1dlkgp" }],
|
|
18
|
+
["path", { d: "M5 21h14", key: "11awu3" }]
|
|
19
|
+
], Q = v("sprout", z), f = ({ profile: s, update: n, isLoading: t, onOpenChange: l }) => {
|
|
20
|
+
const c = A("index", "me"), { data: r } = c, i = s.handle === (r == null ? void 0 : r.handle), o = () => {
|
|
21
|
+
n(s.id, {
|
|
22
|
+
followedByMe: !0
|
|
23
|
+
});
|
|
24
|
+
}, d = () => {
|
|
25
|
+
n(s.id, {
|
|
26
|
+
followedByMe: !1
|
|
27
|
+
});
|
|
28
|
+
}, x = j();
|
|
29
|
+
return /* @__PURE__ */ e.jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: "flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none",
|
|
33
|
+
onClick: () => {
|
|
34
|
+
x(`/profile/${s.handle}`);
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950", children: [
|
|
37
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
38
|
+
/* @__PURE__ */ e.jsx(C, { actor: s, isCurrentUser: i, children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-3", children: [
|
|
39
|
+
/* @__PURE__ */ e.jsx(H, { author: {
|
|
40
|
+
icon: {
|
|
41
|
+
url: s.avatarUrl
|
|
42
|
+
},
|
|
43
|
+
name: s.name,
|
|
44
|
+
handle: s.handle
|
|
45
|
+
}, onClick: () => l == null ? void 0 : l(!1) }),
|
|
46
|
+
/* @__PURE__ */ e.jsxs("div", { className: "-mt-0.5 flex grow flex-col break-anywhere", children: [
|
|
47
|
+
/* @__PURE__ */ e.jsx("span", { className: "line-clamp-1 font-semibold text-black dark:text-white", children: t ? /* @__PURE__ */ e.jsx(u, { className: "w-full max-w-48" }) : s.name }),
|
|
48
|
+
/* @__PURE__ */ e.jsx("span", { className: "line-clamp-1 text-md text-gray-700 dark:text-gray-600", children: t ? /* @__PURE__ */ e.jsx(u, { className: "w-32" }) : s.handle })
|
|
49
|
+
] })
|
|
50
|
+
] }) }),
|
|
51
|
+
t ? /* @__PURE__ */ e.jsx("div", { className: "inline-flex items-center", children: /* @__PURE__ */ e.jsx(u, { className: "w-24" }) }) : i ? null : /* @__PURE__ */ e.jsx(
|
|
52
|
+
I,
|
|
53
|
+
{
|
|
54
|
+
className: "ml-auto",
|
|
55
|
+
following: s.followedByMe,
|
|
56
|
+
handle: s.handle,
|
|
57
|
+
type: "primary",
|
|
58
|
+
onFollow: o,
|
|
59
|
+
onUnfollow: d
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ e.jsx("div", { className: "pl-[52px]", children: t ? /* @__PURE__ */ e.jsx(u, { className: "w-full max-w-96" }) : s.bio && /* @__PURE__ */ e.jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
dangerouslySetInnerHTML: { __html: S(U(s.bio, ["a", "br"])) },
|
|
67
|
+
className: "ap-profile-content pointer-events-none mt-0 line-clamp-2 max-w-[460px] break-anywhere"
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
70
|
+
] })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}, V = () => {
|
|
74
|
+
const { isExplainerClosed: s, setExplainerClosed: n } = y(), t = b(), l = j(), c = t.topic || "top", { exploreProfilesQuery: r, updateExploreProfile: i } = k("index", c), { data: o, isLoading: d, fetchNextPage: x, hasNextPage: h, isFetchingNextPage: p } = r, w = Array(10).fill(null).map((a, m) => ({
|
|
75
|
+
id: `skeleton-${m}`,
|
|
76
|
+
name: "",
|
|
77
|
+
handle: "",
|
|
78
|
+
avatarUrl: "",
|
|
79
|
+
bio: "",
|
|
80
|
+
url: "",
|
|
81
|
+
followedByMe: !1
|
|
82
|
+
})), g = (o == null ? void 0 : o.pages.flatMap((a) => a.accounts)) || [];
|
|
83
|
+
return F(() => {
|
|
84
|
+
const a = document.querySelector(".load-more-trigger");
|
|
85
|
+
if (!a)
|
|
86
|
+
return;
|
|
87
|
+
const m = new IntersectionObserver(
|
|
88
|
+
(N) => {
|
|
89
|
+
N[0].isIntersecting && h && !p && x();
|
|
90
|
+
},
|
|
91
|
+
{ threshold: 0.1 }
|
|
92
|
+
);
|
|
93
|
+
return m.observe(a), () => m.disconnect();
|
|
94
|
+
}, [h, p, x]), /* @__PURE__ */ e.jsxs(P, { children: [
|
|
95
|
+
!s && /* @__PURE__ */ 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: [
|
|
96
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-w-[46px]", children: /* @__PURE__ */ e.jsx(Q, { className: "text-purple", size: 46, strokeWidth: 0.75 }) }),
|
|
97
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-1 flex flex-col gap-[2px]", children: [
|
|
98
|
+
/* @__PURE__ */ e.jsx(B, { className: "text-pretty", children: "The fastest way to grow your followers, is to follow others!" }),
|
|
99
|
+
/* @__PURE__ */ 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." })
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ e.jsx(E, { className: "absolute right-4 top-[17px] size-6 opacity-40", variant: "link", onClick: () => n(!0), children: /* @__PURE__ */ e.jsx(M, { size: 20 }) })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ e.jsx(
|
|
104
|
+
_,
|
|
105
|
+
{
|
|
106
|
+
currentTopic: c,
|
|
107
|
+
excludeTopics: ["following"],
|
|
108
|
+
onTopicChange: (a) => {
|
|
109
|
+
a === "top" ? l("/explore", { replace: !0 }) : l(`/explore/${a}`, { replace: !0 });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-12 flex flex-col gap-12 pb-20 max-md:mt-5", children: d ? /* @__PURE__ */ e.jsx("div", { children: w.map((a) => /* @__PURE__ */ e.jsx("div", { className: "mx-auto w-full max-w-[640px]", children: /* @__PURE__ */ e.jsx(
|
|
114
|
+
f,
|
|
115
|
+
{
|
|
116
|
+
isLoading: d,
|
|
117
|
+
profile: a,
|
|
118
|
+
update: () => {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
) }, a.id)) }) : /* @__PURE__ */ e.jsxs("div", { className: "mx-auto flex w-full max-w-[640px] flex-col items-center", children: [
|
|
122
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full", children: g.map((a) => /* @__PURE__ */ e.jsx(T.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
123
|
+
f,
|
|
124
|
+
{
|
|
125
|
+
isLoading: !1,
|
|
126
|
+
profile: a,
|
|
127
|
+
update: i
|
|
128
|
+
}
|
|
129
|
+
) }, a.id)) }),
|
|
130
|
+
/* @__PURE__ */ e.jsx("div", { className: "load-more-trigger h-4 w-full" }),
|
|
131
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "mt-2 flex w-full justify-center", children: /* @__PURE__ */ e.jsx(L, { size: "sm" }) })
|
|
132
|
+
] }) })
|
|
133
|
+
] });
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
V as default
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=index-CJJXnqq1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CJJXnqq1.mjs","sources":["../../../node_modules/lucide-react/dist/esm/icons/sprout.js","../src/views/explore/explore.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.553.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3\",\n key: \"139s4v\"\n }\n ],\n [\"path\", { d: \"M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4\", key: \"1dlkgp\" }],\n [\"path\", { d: \"M5 21h14\", key: \"11awu3\" }]\n];\nconst Sprout = createLucideIcon(\"sprout\", __iconNode);\n\nexport { __iconNode, Sprout as default };\n//# sourceMappingURL=sprout.js.map\n","import APAvatar from '@src/components/global/ap-avatar';\nimport FollowButton from '@src/components/global/follow-button';\nimport Layout from '@components/layout';\nimport ProfilePreviewHoverCard from '@components/global/profile-preview-hover-card';\nimport React, {useEffect} from 'react';\nimport TopicFilter, {type Topic} from '@src/components/topic-filter';\nimport {type Account, type ExploreAccount} from '@src/api/activitypub';\nimport {Button, H4, LoadingIndicator, LucideIcon, Skeleton} from '@tryghost/shade';\nimport {openLinksInNewTab, stripHtml} from '@src/utils/content-formatters';\nimport {useAccountForUser, useExploreProfilesForUserByTopic} from '@hooks/use-activity-pub-queries';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\nimport {useOnboardingStatus} from '@src/components/layout/onboarding';\nimport {useParams} from '@tryghost/admin-x-framework';\n\ninterface ExploreProfileProps {\n profile: ExploreAccount;\n update: (id: string, updated: Partial<Account>) => void;\n isLoading: boolean;\n}\n\nexport const ExploreProfile: React.FC<ExploreProfileProps & {\n onOpenChange?: (open: boolean) => void;\n}> = ({profile, update, isLoading, onOpenChange}) => {\n const currentAccountQuery = useAccountForUser('index', 'me');\n const {data: currentUser} = currentAccountQuery;\n const isCurrentUser = profile.handle === currentUser?.handle;\n\n const onFollow = () => {\n update(profile.id, {\n followedByMe: true\n });\n };\n\n const onUnfollow = () => {\n update(profile.id, {\n followedByMe: false\n });\n };\n\n const navigate = useNavigateWithBasePath();\n\n return (\n <div\n className='flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none'\n onClick={() => {\n navigate(`/profile/${profile.handle}`);\n }}\n >\n <div className='flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950'>\n <div className='flex items-center justify-between gap-3'>\n <ProfilePreviewHoverCard actor={profile as Account} isCurrentUser={isCurrentUser}>\n <div className='flex gap-3'>\n <APAvatar author={\n {\n icon: {\n url: profile.avatarUrl\n },\n name: profile.name,\n handle: profile.handle\n }\n } onClick={() => onOpenChange?.(false)} />\n <div className='-mt-0.5 flex grow flex-col break-anywhere'>\n <span className='line-clamp-1 font-semibold text-black dark:text-white'>{!isLoading ? profile.name : <Skeleton className='w-full max-w-48' />}</span>\n <span className='line-clamp-1 text-md text-gray-700 dark:text-gray-600'>{!isLoading ? profile.handle : <Skeleton className='w-32' />}</span>\n </div>\n </div>\n </ProfilePreviewHoverCard>\n {!isLoading ? (\n !isCurrentUser ? (\n <FollowButton\n className='ml-auto'\n following={profile.followedByMe}\n handle={profile.handle}\n type='primary'\n onFollow={onFollow}\n onUnfollow={onUnfollow}\n />\n ) : null\n ) : (\n <div className='inline-flex items-center'>\n <Skeleton className='w-24' />\n </div>\n )}\n </div>\n <div className='pl-[52px]'>\n {isLoading ?\n <Skeleton className='w-full max-w-96' />\n :\n profile.bio &&\n <div\n dangerouslySetInnerHTML={{__html: openLinksInNewTab(stripHtml(profile.bio, ['a', 'br']))}}\n className='ap-profile-content pointer-events-none mt-0 line-clamp-2 max-w-[460px] break-anywhere'\n />\n }\n </div>\n </div>\n </div>\n );\n};\n\nconst Explore: React.FC = () => {\n const {isExplainerClosed, setExplainerClosed} = useOnboardingStatus();\n const params = useParams<{topic?: string}>();\n const navigate = useNavigateWithBasePath();\n\n const topic: Topic = (params.topic as Topic) || 'top';\n\n const {exploreProfilesQuery, updateExploreProfile} = useExploreProfilesForUserByTopic('index', topic);\n const {data: exploreProfilesData, isLoading: isLoadingExploreProfiles, fetchNextPage, hasNextPage, isFetchingNextPage} = exploreProfilesQuery;\n\n const emptyProfiles = Array(10).fill(null).map((_, i) => ({\n id: `skeleton-${i}`,\n name: '',\n handle: '',\n avatarUrl: '',\n bio: '',\n url: '',\n followedByMe: false\n }));\n\n const profiles = exploreProfilesData?.pages.flatMap(page => page.accounts) || [];\n\n useEffect(() => {\n const node = document.querySelector('.load-more-trigger');\n if (!node) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting && hasNextPage && !isFetchingNextPage) {\n fetchNextPage();\n }\n },\n {threshold: 0.1}\n );\n\n observer.observe(node);\n return () => observer.disconnect();\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n return (\n <Layout>\n {!isExplainerClosed &&\n <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]'>\n <div className='min-w-[46px]'>\n <LucideIcon.Sprout className='text-purple' size={46} strokeWidth={0.75} />\n </div>\n <div className='mt-1 flex flex-col gap-[2px]'>\n <H4 className='text-pretty'>The fastest way to grow your followers, is to follow others!</H4>\n <p className='2xl:text-pretty text-balance text-sm text-black/60 dark:text-white/60'>Here are some recommendations to get you started, from Ghost publishers and other great accounts from around the social web.</p>\n </div>\n <Button className='absolute right-4 top-[17px] size-6 opacity-40' variant='link' onClick={() => setExplainerClosed(true)}><LucideIcon.X size={20} /></Button>\n </div>\n }\n <TopicFilter\n currentTopic={topic}\n excludeTopics={['following']}\n onTopicChange={(newTopic) => {\n if (newTopic === 'top') {\n navigate('/explore', {replace: true});\n } else {\n navigate(`/explore/${newTopic}`, {replace: true});\n }\n }}\n />\n <div className='mt-12 flex flex-col gap-12 pb-20 max-md:mt-5'>\n {isLoadingExploreProfiles ? (\n <div>\n {emptyProfiles.map(profile => (\n <div key={profile.id} className='mx-auto w-full max-w-[640px]'>\n <ExploreProfile\n isLoading={isLoadingExploreProfiles}\n profile={profile}\n update={() => {}}\n />\n </div>\n ))}\n </div>\n ) : (\n <div className='mx-auto flex w-full max-w-[640px] flex-col items-center'>\n <div className='w-full'>\n {profiles.map(profile => (\n <React.Fragment key={profile.id}>\n <ExploreProfile\n isLoading={false}\n profile={profile}\n update={updateExploreProfile}\n />\n </React.Fragment>\n ))}\n </div>\n <div className='load-more-trigger h-4 w-full' />\n {isFetchingNextPage && (\n <div className='mt-2 flex w-full justify-center'>\n <LoadingIndicator size='sm' />\n </div>\n )}\n </div>\n )}\n </div>\n </Layout>\n );\n};\n\nexport default Explore;\n"],"names":["__iconNode","Sprout","createLucideIcon","ExploreProfile","profile","update","isLoading","onOpenChange","currentAccountQuery","useAccountForUser","currentUser","isCurrentUser","onFollow","onUnfollow","navigate","useNavigateWithBasePath","jsx","jsxs","ProfilePreviewHoverCard","APAvatar","Skeleton","FollowButton","openLinksInNewTab","stripHtml","Explore","isExplainerClosed","setExplainerClosed","useOnboardingStatus","params","useParams","topic","exploreProfilesQuery","updateExploreProfile","useExploreProfilesForUserByTopic","exploreProfilesData","isLoadingExploreProfiles","fetchNextPage","hasNextPage","isFetchingNextPage","emptyProfiles","_","i","profiles","page","useEffect","node","observer","entries","Layout","LucideIcon.Sprout","H4","Button","LucideIcon.X","TopicFilter","newTopic","React","LoadingIndicator"],"mappings":";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,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S,IAAI,CAAAtC,MACVY,gBAAAA,EAAAA,IAACuC,EAAM,UAAN,EACG,UAAAvC,gBAAAA,EAAAA;AAAAA,QAACb;AAAA,QAAA;AAAA,UACG,WAAW;AAAA,UACX,SAAAC;AAAA,UACA,QAAQ4B;AAAA,QAAA;AAAA,MAAA,EACZ,GALiB5B,EAAQ,EAM7B,CACH,GACL;AAAA,MACAY,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,+BAAA,CAA+B;AAAA,MAC7CsB,2BACI,OAAA,EAAI,WAAU,mCACX,UAAAtB,gBAAAA,EAAAA,IAACwC,GAAA,EAAiB,MAAK,KAAA,CAAK,EAAA,CAChC;AAAA,IAAA,EAAA,CAER,EAAA,CAER;AAAA,EAAA,GACJ;AAER;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { ad as U, R as g, ae as D, j as d, af as G, ag as X, ah as Z, ai as P, aj as ee, e as k, ak as B, al as x, c as L, am as te, b as K, an as oe, W as y } from "./index--Q6orQkb.mjs";
|
|
2
|
+
function ne(e) {
|
|
3
|
+
const o = e + "CollectionProvider", [i, r] = U(o), [w, I] = i(
|
|
4
|
+
o,
|
|
5
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
6
|
+
), p = (l) => {
|
|
7
|
+
const { scope: t, children: a } = l, f = g.useRef(null), n = g.useRef(/* @__PURE__ */ new Map()).current;
|
|
8
|
+
return /* @__PURE__ */ d.jsx(w, { scope: t, itemMap: n, collectionRef: f, children: a });
|
|
9
|
+
};
|
|
10
|
+
p.displayName = o;
|
|
11
|
+
const v = e + "CollectionSlot", A = G(v), m = g.forwardRef(
|
|
12
|
+
(l, t) => {
|
|
13
|
+
const { scope: a, children: f } = l, n = I(v, a), c = D(t, n.collectionRef);
|
|
14
|
+
return /* @__PURE__ */ d.jsx(A, { ref: c, children: f });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
m.displayName = v;
|
|
18
|
+
const s = e + "CollectionItemSlot", R = "data-radix-collection-item", S = G(s), C = g.forwardRef(
|
|
19
|
+
(l, t) => {
|
|
20
|
+
const { scope: a, children: f, ...n } = l, c = g.useRef(null), E = D(t, c), T = I(s, a);
|
|
21
|
+
return g.useEffect(() => (T.itemMap.set(c, { ref: c, ...n }), () => void T.itemMap.delete(c))), /* @__PURE__ */ d.jsx(S, { [R]: "", ref: E, children: f });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
C.displayName = s;
|
|
25
|
+
function F(l) {
|
|
26
|
+
const t = I(e + "CollectionConsumer", l);
|
|
27
|
+
return g.useCallback(() => {
|
|
28
|
+
const f = t.collectionRef.current;
|
|
29
|
+
if (!f) return [];
|
|
30
|
+
const n = Array.from(f.querySelectorAll(`[${R}]`));
|
|
31
|
+
return Array.from(t.itemMap.values()).sort(
|
|
32
|
+
(T, h) => n.indexOf(T.ref.current) - n.indexOf(h.ref.current)
|
|
33
|
+
);
|
|
34
|
+
}, [t.collectionRef, t.itemMap]);
|
|
35
|
+
}
|
|
36
|
+
return [
|
|
37
|
+
{ Provider: p, Slot: m, ItemSlot: C },
|
|
38
|
+
F,
|
|
39
|
+
r
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
var re = Z(void 0);
|
|
43
|
+
function ce(e) {
|
|
44
|
+
const o = X(re);
|
|
45
|
+
return e || o || "ltr";
|
|
46
|
+
}
|
|
47
|
+
var N = "rovingFocusGroup.onEntryFocus", se = { bubbles: !1, cancelable: !0 }, _ = "RovingFocusGroup", [O, V, ae] = ne(_), [ie, Ce] = U(
|
|
48
|
+
_,
|
|
49
|
+
[ae]
|
|
50
|
+
), [ue, le] = ie(_), Y = P(
|
|
51
|
+
(e, o) => /* @__PURE__ */ d.jsx(O.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(O.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(fe, { ...e, ref: o }) }) })
|
|
52
|
+
);
|
|
53
|
+
Y.displayName = _;
|
|
54
|
+
var fe = P((e, o) => {
|
|
55
|
+
const {
|
|
56
|
+
__scopeRovingFocusGroup: i,
|
|
57
|
+
orientation: r,
|
|
58
|
+
loop: w = !1,
|
|
59
|
+
dir: I,
|
|
60
|
+
currentTabStopId: p,
|
|
61
|
+
defaultCurrentTabStopId: v,
|
|
62
|
+
onCurrentTabStopIdChange: A,
|
|
63
|
+
onEntryFocus: m,
|
|
64
|
+
preventScrollOnEntryFocus: s = !1,
|
|
65
|
+
...R
|
|
66
|
+
} = e, S = L(null), C = D(o, S), F = ce(I), [l, t] = te({
|
|
67
|
+
prop: p,
|
|
68
|
+
defaultProp: v ?? null,
|
|
69
|
+
onChange: A,
|
|
70
|
+
caller: _
|
|
71
|
+
}), [a, f] = K(!1), n = oe(m), c = V(i), E = L(!1), [T, h] = K(0);
|
|
72
|
+
return k(() => {
|
|
73
|
+
const u = S.current;
|
|
74
|
+
if (u)
|
|
75
|
+
return u.addEventListener(N, n), () => u.removeEventListener(N, n);
|
|
76
|
+
}, [n]), /* @__PURE__ */ d.jsx(
|
|
77
|
+
ue,
|
|
78
|
+
{
|
|
79
|
+
scope: i,
|
|
80
|
+
orientation: r,
|
|
81
|
+
dir: F,
|
|
82
|
+
loop: w,
|
|
83
|
+
currentTabStopId: l,
|
|
84
|
+
onItemFocus: y(
|
|
85
|
+
(u) => t(u),
|
|
86
|
+
[t]
|
|
87
|
+
),
|
|
88
|
+
onItemShiftTab: y(() => f(!0), []),
|
|
89
|
+
onFocusableItemAdd: y(
|
|
90
|
+
() => h((u) => u + 1),
|
|
91
|
+
[]
|
|
92
|
+
),
|
|
93
|
+
onFocusableItemRemove: y(
|
|
94
|
+
() => h((u) => u - 1),
|
|
95
|
+
[]
|
|
96
|
+
),
|
|
97
|
+
children: /* @__PURE__ */ d.jsx(
|
|
98
|
+
B.div,
|
|
99
|
+
{
|
|
100
|
+
tabIndex: a || T === 0 ? -1 : 0,
|
|
101
|
+
"data-orientation": r,
|
|
102
|
+
...R,
|
|
103
|
+
ref: C,
|
|
104
|
+
style: { outline: "none", ...e.style },
|
|
105
|
+
onMouseDown: x(e.onMouseDown, () => {
|
|
106
|
+
E.current = !0;
|
|
107
|
+
}),
|
|
108
|
+
onFocus: x(e.onFocus, (u) => {
|
|
109
|
+
const W = !E.current;
|
|
110
|
+
if (u.target === u.currentTarget && W && !a) {
|
|
111
|
+
const j = new CustomEvent(N, se);
|
|
112
|
+
if (u.currentTarget.dispatchEvent(j), !j.defaultPrevented) {
|
|
113
|
+
const M = c().filter((b) => b.focusable), $ = M.find((b) => b.active), J = M.find((b) => b.id === l), Q = [$, J, ...M].filter(
|
|
114
|
+
Boolean
|
|
115
|
+
).map((b) => b.ref.current);
|
|
116
|
+
z(Q, s);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
E.current = !1;
|
|
120
|
+
}),
|
|
121
|
+
onBlur: x(e.onBlur, () => f(!1))
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}), H = "RovingFocusGroupItem", q = P(
|
|
127
|
+
(e, o) => {
|
|
128
|
+
const {
|
|
129
|
+
__scopeRovingFocusGroup: i,
|
|
130
|
+
focusable: r = !0,
|
|
131
|
+
active: w = !1,
|
|
132
|
+
tabStopId: I,
|
|
133
|
+
children: p,
|
|
134
|
+
...v
|
|
135
|
+
} = e, A = ee(), m = I || A, s = le(H, i), R = s.currentTabStopId === m, S = V(i), { onFocusableItemAdd: C, onFocusableItemRemove: F, currentTabStopId: l } = s;
|
|
136
|
+
return k(() => {
|
|
137
|
+
if (r)
|
|
138
|
+
return C(), () => F();
|
|
139
|
+
}, [r, C, F]), /* @__PURE__ */ d.jsx(
|
|
140
|
+
O.ItemSlot,
|
|
141
|
+
{
|
|
142
|
+
scope: i,
|
|
143
|
+
id: m,
|
|
144
|
+
focusable: r,
|
|
145
|
+
active: w,
|
|
146
|
+
children: /* @__PURE__ */ d.jsx(
|
|
147
|
+
B.span,
|
|
148
|
+
{
|
|
149
|
+
tabIndex: R ? 0 : -1,
|
|
150
|
+
"data-orientation": s.orientation,
|
|
151
|
+
...v,
|
|
152
|
+
ref: o,
|
|
153
|
+
onMouseDown: x(e.onMouseDown, (t) => {
|
|
154
|
+
r ? s.onItemFocus(m) : t.preventDefault();
|
|
155
|
+
}),
|
|
156
|
+
onFocus: x(e.onFocus, () => s.onItemFocus(m)),
|
|
157
|
+
onKeyDown: x(e.onKeyDown, (t) => {
|
|
158
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
159
|
+
s.onItemShiftTab();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (t.target !== t.currentTarget) return;
|
|
163
|
+
const a = pe(t, s.orientation, s.dir);
|
|
164
|
+
if (a !== void 0) {
|
|
165
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
166
|
+
t.preventDefault();
|
|
167
|
+
let n = S().filter((c) => c.focusable).map((c) => c.ref.current);
|
|
168
|
+
if (a === "last") n.reverse();
|
|
169
|
+
else if (a === "prev" || a === "next") {
|
|
170
|
+
a === "prev" && n.reverse();
|
|
171
|
+
const c = n.indexOf(t.currentTarget);
|
|
172
|
+
n = s.loop ? Ie(n, c + 1) : n.slice(c + 1);
|
|
173
|
+
}
|
|
174
|
+
setTimeout(() => z(n));
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
children: typeof p == "function" ? p({ isCurrentTabStop: R, hasTabStop: l != null }) : p
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
q.displayName = H;
|
|
185
|
+
var de = {
|
|
186
|
+
ArrowLeft: "prev",
|
|
187
|
+
ArrowUp: "prev",
|
|
188
|
+
ArrowRight: "next",
|
|
189
|
+
ArrowDown: "next",
|
|
190
|
+
PageUp: "first",
|
|
191
|
+
Home: "first",
|
|
192
|
+
PageDown: "last",
|
|
193
|
+
End: "last"
|
|
194
|
+
};
|
|
195
|
+
function me(e, o) {
|
|
196
|
+
return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
197
|
+
}
|
|
198
|
+
function pe(e, o, i) {
|
|
199
|
+
const r = me(e.key, i);
|
|
200
|
+
if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
|
|
201
|
+
return de[r];
|
|
202
|
+
}
|
|
203
|
+
function z(e, o = !1) {
|
|
204
|
+
const i = document.activeElement;
|
|
205
|
+
for (const r of e)
|
|
206
|
+
if (r === i || (r.focus({ preventScroll: o }), document.activeElement !== i)) return;
|
|
207
|
+
}
|
|
208
|
+
function Ie(e, o) {
|
|
209
|
+
return e.map((i, r) => e[(o + r) % e.length]);
|
|
210
|
+
}
|
|
211
|
+
var be = Y, ge = q;
|
|
212
|
+
export {
|
|
213
|
+
ge as I,
|
|
214
|
+
be as R,
|
|
215
|
+
ne as a,
|
|
216
|
+
Ce as c,
|
|
217
|
+
ce as u
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=index-CONoLlDU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CONoLlDU.mjs","sources":["../../../node_modules/@radix-ui/react-collection/dist/index.mjs","../../../node_modules/@radix-ui/react-direction/dist/index.mjs","../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b","DirectionContext","React.createContext","useDirection","localDir","globalDir","React.useContext","ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","createRovingFocusGroupContext","createRovingFocusGroupScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React.forwardRef","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","React.useRef","direction","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","React.useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","React.useEffect","node","React.useCallback","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","itemProps","autoId","useId","id","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item"],"mappings":";AAQA,SAASA,GAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAG,EAAE;AAAA,EAC1E,GACQM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAAA,IAAIT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACrG;AACA,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAqBC,EAAWF,CAAoB,GACpDG,IAAiBN,EAAM;AAAA,IAC3B,CAACJ,GAAOW,MAAiB;AACvB,YAAM,EAAE,OAAAV,GAAO,UAAAC,EAAQ,IAAKF,GACtBY,IAAUd,EAAqBS,GAAsBN,CAAK,GAC1DY,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBN,gBAAAA,EAAAA,IAAIE,GAAoB,EAAE,KAAKK,GAAc,UAAAX,EAAQ,CAAE;AAAA,IAChF;AAAA,EACJ;AACE,EAAAQ,EAAe,cAAcH;AAC7B,QAAMQ,IAAiBvB,IAAO,sBACxBwB,IAAiB,8BACjBC,IAAyBR,EAAWM,CAAc,GAClDG,IAAqBd,EAAM;AAAA,IAC/B,CAACJ,GAAOW,MAAiB;AACvB,YAAM,EAAE,OAAAV,GAAO,UAAAC,GAAU,GAAGiB,EA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