@banou/ftube 0.0.0-stage → 0.0.0
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/LICENSE +21 -0
- package/README.md +44 -2
- package/__yt_engine__/engine.html +9 -0
- package/app.webmanifest +31 -0
- package/assets/account-BL8Hv7lS.js +157 -0
- package/assets/account-By94iboj.js +1 -0
- package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
- package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
- package/assets/agent-source-E4g0cDzU.js +1 -0
- package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
- package/assets/binary-encoding-By5K7InN.js +1 -0
- package/assets/build-CNn3bm6X.js +1 -0
- package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
- package/assets/cards-Csel8naI.js +2334 -0
- package/assets/channel-B5f9YTIf.js +1160 -0
- package/assets/client-version-D9kIz6Gz.js +1 -0
- package/assets/comments-CJp9O808.js +612 -0
- package/assets/dislikes-DH5jCVEY.js +1 -0
- package/assets/dist-7VpLCl1k.js +1 -0
- package/assets/dist-BOrL1gYg.js +2 -0
- package/assets/downloads-CMXDjA_E.js +191 -0
- package/assets/egress.worker-DopXr5uP.js +104 -0
- package/assets/engine-B_kFyW7L.js +2 -0
- package/assets/feed-channels-Dg2mvF5x.js +251 -0
- package/assets/feed-groups-CnyR4sOO.js +160 -0
- package/assets/feed-history-BDAGG9N5.js +368 -0
- package/assets/feed-playlists-DcGR2AL6.js +167 -0
- package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
- package/assets/feed-you-lxbqknXX.js +110 -0
- package/assets/formats-CDwXfKnr.js +1 -0
- package/assets/frame-BrGNSf3s.js +2 -0
- package/assets/fs-CjRTQ7Nu.js +1 -0
- package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
- package/assets/fullscreen-view-BLgosU84.js +269 -0
- package/assets/group-C00s0aT7.js +183 -0
- package/assets/groups-button-CvVnqwlu.js +25 -0
- package/assets/hashtag-CCIhITaL.js +115 -0
- package/assets/icons-DKsqNLSs.js +1 -0
- package/assets/index-A5dHbptn.css +1 -0
- package/assets/index-DwsYJ-bu.js +1328 -0
- package/assets/lib-h0P14ZFl.js +70 -0
- package/assets/linkify-B6hdFhsL.js +1 -0
- package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
- package/assets/party-CUcxsJDF.js +180 -0
- package/assets/playlist-DF7wsidw.js +521 -0
- package/assets/playlist-card-Btoc7D8f.js +91 -0
- package/assets/playlist-panel-D97BwT1f.js +199 -0
- package/assets/post-CQ9mfVos.js +39 -0
- package/assets/post-card-ZUQixO1G.js +76 -0
- package/assets/privacy-hkbqXFeB.js +46 -0
- package/assets/protobuf-BXZ2dCCc.js +1 -0
- package/assets/read-more-BhddUSlS.js +20 -0
- package/assets/rich-text-07paR5O3.js +25 -0
- package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
- package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
- package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
- package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
- package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
- package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
- package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
- package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
- package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
- package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
- package/assets/rooms-B91zuirR.js +1 -0
- package/assets/save-menu-DF1WKqSE.js +462 -0
- package/assets/search-Cx5IpDtZ.js +1026 -0
- package/assets/settings-kESE_uBm.js +99 -0
- package/assets/shaka-BwT9pJcV.js +36 -0
- package/assets/share-dialog-Cp0BJ6bg.js +156 -0
- package/assets/shorts-BxDB7m0c.js +686 -0
- package/assets/shorts-grid-Bgbkl5dP.js +11 -0
- package/assets/sign-in-Bx3zmj-m.js +97 -0
- package/assets/signed-out-prompt-CEAx65kq.js +79 -0
- package/assets/signin-DkI8Ogzz.js +18 -0
- package/assets/social-bXt3vmd4.js +1 -0
- package/assets/video-card-compact-r-K4XyDb.js +190 -0
- package/assets/watch-CkxSP1IA.js +1802 -0
- package/assets/web-BNanCsH5.js +43 -0
- package/favicon.ico +0 -0
- package/favicon.svg +5 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-512.png +0 -0
- package/index-Bj-Q3X8Q.js +4120 -0
- package/index.html +32 -0
- package/package.json +45 -4
- package/store/background.webp +0 -0
- package/store/channel.webp +0 -0
- package/store/cover.webp +0 -0
- package/store/phone.webp +0 -0
- package/store/search.webp +0 -0
- package/store/watch.webp +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import{M as e,O as t,S as n,b as r,en as i,on as a,sn as o,tn as s,x as c}from"./icons-DKsqNLSs.js";import{C as l,c as u,ot as d,s as f,y as p}from"./sign-in-Bx3zmj-m.js";import{C as m,hn as h,in as g,k as _,w as v,x as y,xn as b,y as x}from"./cards-Csel8naI.js";o();var S=(e,t,n)=>_(e,{list:t,index:n+1}),C=e=>{v.shuffle=e},w=d`
|
|
2
|
+
flex: none;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
max-height: 48rem;
|
|
6
|
+
margin-bottom: 1.6rem;
|
|
7
|
+
border: 1px solid var(--border);
|
|
8
|
+
border-radius: 1.2rem;
|
|
9
|
+
background: var(--bg-subtle);
|
|
10
|
+
/* Clips the first and last rows to the rounded corners; the scrolling happens
|
|
11
|
+
one level down, in .items. */
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
|
|
14
|
+
/* Pinned above the list rather than position: sticky inside it. The list is
|
|
15
|
+
the scroll container, so the head is already fixed relative to what moves,
|
|
16
|
+
and a sticky head inside the same box would let the transport controls
|
|
17
|
+
scroll away under their own rows. */
|
|
18
|
+
.head {
|
|
19
|
+
flex: none;
|
|
20
|
+
padding: 1.2rem 1.6rem;
|
|
21
|
+
border-bottom: 1px solid var(--border);
|
|
22
|
+
background: var(--bg-elevated);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.head-top {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
gap: 1.2rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.head-text {
|
|
32
|
+
flex: 1;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.playlist-title {
|
|
37
|
+
font-size: 1.6rem;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
line-height: 2.2rem;
|
|
40
|
+
color: var(--text-primary);
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.playlist-meta {
|
|
47
|
+
margin-top: 0.4rem;
|
|
48
|
+
font-size: 1.2rem;
|
|
49
|
+
line-height: 1.8rem;
|
|
50
|
+
color: var(--text-secondary);
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.count {
|
|
57
|
+
flex: none;
|
|
58
|
+
font-size: 1.2rem;
|
|
59
|
+
line-height: 2.2rem;
|
|
60
|
+
color: var(--text-secondary);
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.controls {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 0.4rem;
|
|
68
|
+
margin-top: 0.8rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.control {
|
|
72
|
+
flex: none;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 3.2rem;
|
|
77
|
+
height: 3.2rem;
|
|
78
|
+
border: none;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
background: transparent;
|
|
81
|
+
color: var(--text-primary);
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.control:hover:not(:disabled) {
|
|
87
|
+
background: var(--bg-hover);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.control:disabled {
|
|
91
|
+
opacity: 0.5;
|
|
92
|
+
cursor: default;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* aria-pressed carries the state for assistive tech, so the styling reads off
|
|
96
|
+
the same attribute instead of a second class that could disagree with it. */
|
|
97
|
+
.control[aria-pressed='true'] {
|
|
98
|
+
color: var(--accent);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.items {
|
|
102
|
+
flex: 1;
|
|
103
|
+
min-height: 0;
|
|
104
|
+
/* offsetTop on a row is measured against this box, which is what the
|
|
105
|
+
scroll-into-view below relies on. */
|
|
106
|
+
position: relative;
|
|
107
|
+
margin: 0;
|
|
108
|
+
padding: 0.8rem 0;
|
|
109
|
+
list-style: none;
|
|
110
|
+
overflow-y: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.row {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: stretch;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.row-link {
|
|
119
|
+
flex: 1;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: 0.8rem;
|
|
124
|
+
padding: 0.4rem 0.8rem 0.4rem 0;
|
|
125
|
+
transition: background 0.15s ease;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.row-link:hover {
|
|
129
|
+
background: var(--bg-hover);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.row[data-current='true'] .row-link {
|
|
133
|
+
background: var(--bg-selected);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.position {
|
|
137
|
+
flex: none;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
width: 2.8rem;
|
|
142
|
+
font-size: 1.2rem;
|
|
143
|
+
color: var(--text-tertiary);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.row[data-current='true'] .position {
|
|
147
|
+
color: var(--text-primary);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.thumb {
|
|
151
|
+
position: relative;
|
|
152
|
+
flex: none;
|
|
153
|
+
display: block;
|
|
154
|
+
width: 10rem;
|
|
155
|
+
height: 5.6rem;
|
|
156
|
+
border-radius: 0.4rem;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
background: var(--bg-elevated);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.thumb img {
|
|
162
|
+
display: block;
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 100%;
|
|
165
|
+
object-fit: cover;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.badge {
|
|
169
|
+
position: absolute;
|
|
170
|
+
right: 0.4rem;
|
|
171
|
+
bottom: 0.4rem;
|
|
172
|
+
padding: 0.1rem 0.4rem;
|
|
173
|
+
border-radius: 0.4rem;
|
|
174
|
+
background: var(--bg-badge);
|
|
175
|
+
color: var(--text-on-media);
|
|
176
|
+
font-size: 1.2rem;
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
line-height: 1.6rem;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.row-title {
|
|
182
|
+
flex: 1;
|
|
183
|
+
min-width: 0;
|
|
184
|
+
font-size: 1.4rem;
|
|
185
|
+
font-weight: 400;
|
|
186
|
+
line-height: 2rem;
|
|
187
|
+
color: var(--text-primary);
|
|
188
|
+
display: -webkit-box;
|
|
189
|
+
-webkit-line-clamp: 2;
|
|
190
|
+
-webkit-box-orient: vertical;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.empty {
|
|
195
|
+
padding: 1.6rem;
|
|
196
|
+
font-size: 1.4rem;
|
|
197
|
+
color: var(--text-secondary);
|
|
198
|
+
}
|
|
199
|
+
`,T=({video:t,position:n,current:r,playlistId:i})=>{let a=h(t.id),o=b(t.durationSeconds);return f(`li`,{className:`row`,"data-current":r?`true`:void 0,...a,children:u(p,{href:S(t.id,i,n),className:`row-link`,"aria-current":r?`true`:void 0,children:[f(`span`,{className:`position`,children:r?f(e,{size:12,strokeWidth:1.5,fill:`currentColor`}):n+1}),u(`span`,{className:`thumb`,children:[t.thumbnail?f(g,{src:t.thumbnail}):void 0,o?f(`span`,{className:`badge`,children:o}):void 0]}),f(`span`,{className:`row-title`,children:t.title})]})})},E=({playlist:e})=>{let[,o]=l(),[d,p]=a(v.loop),[h,g]=a(v.shuffle),_=s(null),b=e.items,C=b.length,E=Math.min(Math.max(e.currentIndex??0,0),Math.max(C-1,0));i(()=>{let e=_.current,t=e?.querySelector(`[data-current="true"]`);e&&t&&(e.scrollTop=t.offsetTop-(e.clientHeight-t.clientHeight)/2)},[E,C,e.id]);let D=()=>{v.loop=!d,p(v.loop)},O=()=>{v.shuffle=!h,g(v.shuffle)},k=m(E,C,{loop:d}),A=x(E,C,{loop:d,shuffle:h}),j=t=>{if(t===void 0)return;let n=b[t];n&&o(S(n.id,e.id,t))},M=[e.author??void 0,e.isInfinite?`Mix`:void 0].filter(e=>e!==void 0).join(` • `);return u(`section`,{css:w,"aria-label":`Playlist queue`,children:[u(`div`,{className:`head`,children:[u(`div`,{className:`head-top`,children:[u(`div`,{className:`head-text`,children:[f(`div`,{className:`playlist-title`,children:e.title??`Playlist`}),M?f(`div`,{className:`playlist-meta`,children:M}):void 0]}),C>0?u(`div`,{className:`count`,children:[E+1,` / `,C]}):void 0]}),u(`div`,{className:`controls`,children:[f(`button`,{type:`button`,className:`control`,"aria-label":`Previous video`,disabled:k===void 0,onClick:()=>j(k),children:f(c,{size:20,strokeWidth:1.5})}),f(`button`,{type:`button`,className:`control`,"aria-label":`Next video`,disabled:!A,onClick:()=>j(y(E,C,{loop:d,shuffle:h})),children:f(r,{size:20,strokeWidth:1.5})}),f(`button`,{type:`button`,className:`control`,"aria-label":`Shuffle`,"aria-pressed":h,onClick:O,children:f(n,{size:20,strokeWidth:1.5})}),f(`button`,{type:`button`,className:`control`,"aria-label":`Loop playlist`,"aria-pressed":d,onClick:D,children:f(t,{size:20,strokeWidth:1.5})})]})]}),C>0?f(`ol`,{className:`items`,ref:_,children:b.map((t,n)=>f(T,{video:t,position:n,current:n===E,playlistId:e.id},`${n}:${t.id}`))}):f(`p`,{className:`empty`,children:`This playlist has no videos.`})]})};export{C as n,E as t};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{c as e,g as t,k as n,ot as r,s as i}from"./sign-in-Bx3zmj-m.js";import{En as a,Y as o}from"./cards-Csel8naI.js";import{n as s}from"../index-Bj-Q3X8Q.js";import{t as c}from"./comments-CJp9O808.js";import{t as l}from"./post-card-ZUQixO1G.js";var u=t(`
|
|
2
|
+
query PostView($id: ID!) {
|
|
3
|
+
post(id: $id) {
|
|
4
|
+
id
|
|
5
|
+
text
|
|
6
|
+
publishedText
|
|
7
|
+
voteCountText
|
|
8
|
+
attachedImage
|
|
9
|
+
author { id name avatar }
|
|
10
|
+
attachedVideo {
|
|
11
|
+
id
|
|
12
|
+
title
|
|
13
|
+
thumbnail
|
|
14
|
+
thumbnailSrcset
|
|
15
|
+
durationSeconds
|
|
16
|
+
viewCount
|
|
17
|
+
publishedText
|
|
18
|
+
channel { id name }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`),d=r`
|
|
23
|
+
width: max(min(100% - 3.2rem, 64.2rem), min(130.8rem, round(down, 100% - 4.8rem, 21.8rem)));
|
|
24
|
+
margin: 0 auto;
|
|
25
|
+
padding: 2.4rem 0;
|
|
26
|
+
|
|
27
|
+
.post {
|
|
28
|
+
max-width: 64.2rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.comments-column {
|
|
32
|
+
max-width: 85.2rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.status {
|
|
36
|
+
color: var(--text-secondary);
|
|
37
|
+
}
|
|
38
|
+
`,f=({params:t})=>{let[{data:r,error:f,fetching:p},m]=n({query:u,variables:{id:a(t.postId)}}),h=r?.post;return s(h?.text.split(`
|
|
39
|
+
`)[0]||`Post`),e(`main`,{css:d,children:[h?i(l,{post:h}):void 0,h?.author?i(`div`,{className:`comments-column`,children:i(c,{post:{id:h.id,channelId:h.author.id}},h.id)}):void 0,r&&!h?i(`p`,{className:`status`,children:`This post isn't available.`}):void 0,f&&!p?i(o,{error:f,reexecute:m}):void 0]})};export{f as PostPage,f as default};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import{G as e,f as t}from"./icons-DKsqNLSs.js";import{c as n,ot as r,s as i,y as a}from"./sign-in-Bx3zmj-m.js";import{t as o}from"./read-more-BhddUSlS.js";import{t as s}from"./video-card-compact-r-K4XyDb.js";var c=r`
|
|
2
|
+
padding: 1.6rem;
|
|
3
|
+
border: 1px solid var(--border-subtle);
|
|
4
|
+
border-radius: 1.2rem;
|
|
5
|
+
|
|
6
|
+
.post-head {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 0.8rem;
|
|
10
|
+
font-size: 1.3rem;
|
|
11
|
+
color: var(--text-secondary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.post-author {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.8rem;
|
|
18
|
+
color: var(--text-primary);
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.post-avatar {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 2.4rem;
|
|
27
|
+
height: 2.4rem;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
background: var(--bg-chip);
|
|
31
|
+
font-size: 1.1rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.post-text {
|
|
35
|
+
margin-top: 1.2rem;
|
|
36
|
+
font-size: 1.6rem;
|
|
37
|
+
line-height: 2.2rem;
|
|
38
|
+
color: var(--text-primary);
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.post-image {
|
|
43
|
+
display: block;
|
|
44
|
+
width: 100%;
|
|
45
|
+
margin-top: 1.2rem;
|
|
46
|
+
border-radius: 0.8rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.post-footer {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 1.6rem;
|
|
53
|
+
margin-top: 0.8rem;
|
|
54
|
+
font-size: 1.2rem;
|
|
55
|
+
color: var(--text-primary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.post-votes,
|
|
59
|
+
.post-comments {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 0.4rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.post-comments {
|
|
66
|
+
height: 3.2rem;
|
|
67
|
+
padding: 0 1.2rem;
|
|
68
|
+
border-radius: 1.6rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
transition: background 0.15s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.post-comments:hover {
|
|
74
|
+
background: var(--bg-hover);
|
|
75
|
+
}
|
|
76
|
+
`,l=({post:r,readMore:l=!0})=>n(`article`,{css:c,className:`post`,children:[n(`div`,{className:`post-head`,children:[r.author?n(a,{href:`/channel/${r.author.id}`,className:`post-author`,children:[r.author.avatar?i(`img`,{className:`post-avatar`,src:r.author.avatar,alt:``,loading:`lazy`}):i(`span`,{className:`post-avatar`,"aria-hidden":`true`,children:r.author.name.slice(0,1)}),i(`span`,{children:r.author.name})]}):void 0,r.publishedText?i(a,{href:`/post/${r.id}`,className:`post-date`,children:r.publishedText}):void 0]}),r.text?l?i(o,{className:`post-text`,text:r.text,children:r.text}):i(`p`,{className:`post-text`,children:r.text}):void 0,r.attachedImage?i(`img`,{className:`post-image`,src:r.attachedImage,alt:``,loading:`lazy`}):void 0,r.attachedVideo?i(s,{video:r.attachedVideo}):void 0,r.voteCountText||r.commentCountText?n(`div`,{className:`post-footer`,children:[r.voteCountText?n(`span`,{className:`post-votes`,children:[i(t,{size:18,strokeWidth:1.5}),r.voteCountText]}):void 0,r.commentCountText?n(a,{href:`/post/${r.id}`,className:`post-comments`,"aria-label":r.commentCountLabel??`${r.commentCountText} comments`,children:[i(e,{size:18,strokeWidth:1.5}),r.commentCountText]}):void 0]}):void 0]});export{l as t};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import{c as e,ot as t,s as n}from"./sign-in-Bx3zmj-m.js";import{g as r,n as i}from"../index-Bj-Q3X8Q.js";var a=[{domain:`www.youtube.com`,what:`YouTube's API while FTube is not signed in to YouTube, with your searches, what you open and your YouTube visitor ID, and captions, signed in or out`},{domain:`ytimg.com`,what:`Video thumbnails and preview frames`},{domain:`ggpht.com`,what:`Channel pictures, post images and channel emoji`},{domain:`googleusercontent.com`,what:`Channel pictures, banners and song covers`},{domain:`gstatic.com`,what:`Live chat emoji, the pictures of the products in a channel's store and the photos in search suggestions`},{domain:`returnyoutubedislikeapi.com`,what:`Dislike counts, and comments when YouTube comments are turned off, from Return YouTube Dislike, which gets the ID of each video you open`},{domain:`ajay.app`,what:`SponsorBlock's sponsor segments, asked for with the first 4 characters of a hash of the video's ID, which about 150 videos in SponsorBlock share`}],o=[`fkn.app`,`sdbx.app`],s=`https://fkn.app/privacy`,c=`https://fkn.app/extension/privacy`,l=[{title:`Settings`,what:`Your theme, autoplay, volume and mute, quality, speed, captions, their language, look and position, theater mode, ambient mode, whether to show dislike counts and skip sponsors, whether to hide Shorts, whether the guide is collapsed, whether to offer the FKN extension, and whether it was there on your last visit. Kept until you change them.`},{title:`Hidden recommendations`,what:`Up to 500 videos you marked "Not interested" and up to 500 channels you marked "Don't recommend channel", stored locally in this browser so they stay hidden across visits. Kept until you undo them or reset them in Settings.`},{title:`Download history`,what:`Up to 100 download records (video ID, title, channel name, thumbnail address, mode, container format, quality label, filename, file size, creation and completion times, status, and any error message) stored locally in this browser for the Downloads page. Kept until you remove them or choose Clear history on the Downloads page.`},{title:`Channel groups`,what:`Each group's name and emoji, when it was last changed, and the name, ID and picture address of each channel in it. Kept until you delete the group on the Groups page or, for groups from your FKN account, until you sign out of FKN. The ID of each group you delete, with when, stays until you sign out of FKN, so that a copy of the group on your FKN account does not bring it back. While FTube is signed in to FKN, also a random ID for your account's copy of the groups.`},{title:`Whether you are signed in`,what:`A yes or no, so the next visit opens your YouTube session. Removed when you sign out, or when YouTube says the session has ended.`},{title:`Your YouTube visitor ID`,what:`The ID YouTube gives this browser, and the YouTube video server it last used. Replaced when you sign in or sign out.`},{title:`Playback tokens`,what:`A token from YouTube's playback check for each video played, previews included, filed under the video's ID. Each lasts six hours at most and is removed the next time a token is saved after that. All of them go when you sign in or sign out.`},{title:`The channel you picked`,what:`YouTube's ID for the channel of your Google account that FTube uses, when you picked one other than the account's own. Removed when you sign in or out, when you pick the account's own channel, when YouTube says the session has ended, or when YouTube no longer accepts it.`},{title:`YouTube's session details and player code`,what:`Kept by youtubei.js, the library FTube reads YouTube with. The session details go when you sign in or sign out. The player code stays.`},{title:`Imported watch history`,what:`If you import it with the FKN extension: each video's ID, title, thumbnail, length, how much of it you watched, its channel and the day YouTube lists it under, when you imported it, and a digest of the youtube.com sign-in it was read with, never the cookie itself. Kept until you choose Delete imported history on the History page, or until that page finds this browser's youtube.com sign-in gone or changed.`},{title:`The version a tab loaded`,what:`Kept until the tab closes, so that an update reloads an open tab only once.`}],u=t`
|
|
2
|
+
max-width: 78rem;
|
|
3
|
+
padding: 2.4rem 1.6rem;
|
|
4
|
+
color: var(--text-primary);
|
|
5
|
+
font-size: 1.4rem;
|
|
6
|
+
line-height: 2.2rem;
|
|
7
|
+
|
|
8
|
+
.heading {
|
|
9
|
+
margin: 0 0 2.4rem;
|
|
10
|
+
font-size: 2.4rem;
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.section {
|
|
15
|
+
padding: 2.4rem 0;
|
|
16
|
+
border-top: 1px solid var(--border-subtle);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.section-title {
|
|
20
|
+
margin: 0 0 1.2rem;
|
|
21
|
+
font-size: 1.6rem;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
p {
|
|
26
|
+
margin: 0 0 1.2rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ul {
|
|
30
|
+
margin: 0 0 1.2rem;
|
|
31
|
+
padding-left: 2rem;
|
|
32
|
+
list-style: disc;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
li + li {
|
|
36
|
+
margin-top: 0.8rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.host {
|
|
40
|
+
color: var(--text-secondary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.link {
|
|
44
|
+
color: var(--accent);
|
|
45
|
+
}
|
|
46
|
+
`,d=()=>(i(`Privacy`),e(`main`,{css:u,children:[n(`h1`,{className:`heading`,children:`Privacy`}),n(`p`,{children:`FTube is a YouTube client that runs in your browser.`}),e(`section`,{className:`section`,children:[n(`h2`,{className:`section-title`,children:`What FTube keeps in this browser`}),n(`ul`,{children:l.map(t=>e(`li`,{children:[e(`strong`,{children:[t.title,`.`]}),` `,t.what]},t.title))}),n(`p`,{children:`Sign out of YouTube is in the account menu, and sign out of FKN in the More menu. Clearing this site's data in your browser removes everything above from this browser; groups on your FKN account stay there.`})]}),e(`section`,{className:`section`,children:[n(`h2`,{className:`section-title`,children:`What FTube keeps on your FKN account`}),n(`p`,{children:`FTube is signed in to FKN when you sign in from the More menu, and also, with nothing to click, when this browser is already signed in to FKN on fkn.app. It stays signed in until you sign out of FKN, in the More menu or on fkn.app.`}),n(`p`,{children:`While it is, your channel groups are also kept on your FKN account, in one file, so every browser signed in to that account shows the same groups. Your browser encrypts the file before FKN stores it: FKN sees that the file is FTube's, its name, its size and when it changes, but not what is in it. Groups you made before signing in are added to it, and the ID of each group you delete stays in it with the time, so your other browsers delete it too. Signing out of FKN takes your account's groups out of this browser and leaves them on your account. Deleting your FKN account deletes them.`})]}),e(`section`,{className:`section`,children:[n(`h2`,{className:`section-title`,children:`Where requests go`}),n(`p`,{children:`Without the FKN browser extension, FTube reaches YouTube's pages and video through FKN, the platform it runs on, so YouTube sees FKN's address there rather than yours. Your browser makes some requests itself instead, to the servers listed further down: YouTube's API while FTube is not signed in to YouTube, and captions, without your youtube.com cookies; thumbnails and pictures; and dislike counts and sponsor segments while they are on.`}),e(`ul`,{children:[n(`li`,{children:`Signed out, YouTube's pages and feeds go through the FKN relay, which makes each request for you, and so do its API and captions when your browser cannot reach them. The relay keeps answers in a cache so it can serve the same request again, for about an hour, less for an error. Each answer is sealed: it is encrypted with a key made from the whole request and filed under a digest of that request, a short fingerprint of it, not under who sent it. Only an identical request can find and open it.`}),n(`li`,{children:`Signed in, every request to youtube.com except caption files goes from a page FKN runs for FTube, which holds your YouTube session, through WebVPN or the extension. These requests and their answers do not go through the relay's cache.`}),n(`li`,{children:`Video, and the checks YouTube runs before playing it, go over WebVPN: your browser encrypts the connection to YouTube's servers end to end, so the WebVPN relay carrying it cannot read it. The relay sees which server and port it reaches and how much data passes.`}),n(`li`,{children:`Signing in happens in a window FKN opens on youtube.com and Google's sign-in page. Your YouTube and Google sign-in is then kept in FKN's cookie jar for fkn.app on this device, sealed, and not in FTube. Every fkn.app app you allow to run code on youtube.com uses that same sign-in, and signing out in FTube signs all of them out of YouTube and Google on this device. Google is not told, so the session stays valid at Google until it lapses.`})]}),n(`p`,{children:`With the FKN browser extension installed, the other requests to YouTube go from your browser too, through the extension when it can make them, so YouTube sees your IP address. Importing your watch history needs the extension: it reads your history with this browser's own youtube.com sign-in, through the extension and not through FKN.`}),n(`p`,{children:`When a video or a preview starts, FTube tells YouTube it started playing, with the report youtube.com sends at that point and your YouTube visitor ID. YouTube suggests videos on Home from these reports.`}),e(`p`,{children:[`Skip sponsors: Using `,n(`a`,{className:`link`,href:r,target:`_blank`,rel:`noreferrer`,children:`SponsorBlock`})]}),e(`p`,{children:[`What FKN keeps, in this browser and on its servers, is in the`,` `,n(`a`,{className:`link`,href:s,target:`_blank`,rel:`noreferrer`,children:`FKN privacy policy`}),`. What the extension keeps is in the`,` `,n(`a`,{className:`link`,href:c,target:`_blank`,rel:`noreferrer`,children:`extension privacy policy`}),`.`]})]}),e(`section`,{className:`section`,children:[n(`h2`,{className:`section-title`,children:`Servers your browser reaches itself`}),n(`p`,{children:`These load straight from your browser, not through FKN, so each of them sees your IP address and what it serves you. Each name includes its subdomains, such as i.ytimg.com.`}),n(`ul`,{"data-direct-hosts":``,children:a.map(t=>e(`li`,{children:[t.what,`: `,n(`span`,{className:`host`,children:t.domain})]},t.domain))}),e(`p`,{children:[`Your browser also reaches FKN's own servers (`,o.join(` and `),`), and loads FTube itself from youtube.fkn.app, which Cloudflare serves for FKN, so Cloudflare sees your IP address too.`]})]}),e(`section`,{className:`section`,children:[n(`h2`,{className:`section-title`,children:`What FTube does not do`}),e(`ul`,{children:[n(`li`,{children:`It has no account and no server of its own, and runs no analytics.`}),n(`li`,{children:`Nothing it keeps leaves this browser except in the requests to YouTube that need it, as above, and your encrypted channel groups on your FKN account.`}),n(`li`,{children:`Apart from the relay's sealed answers and your encrypted channel groups above, FKN keeps no copy of anything FTube keeps in this browser.`})]})]})]}));export{d as PrivacyPage,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./binary-encoding-By5K7InN.js";var n=(e,t)=>{let n=0,r=t;for(let t=0;;t+=7){let i=e[r++]??0;if(n+=(i&127)*2**t,i<128)return{value:n,at:r}}},r=(e,[t,...i])=>{let a,o=0;for(;o<e.length;){let r=n(e,o),i=r.value%8,s;if(i===0){let t=n(e,r.at);s=t.value,o=t.at}else if(i===2){let t=n(e,r.at);s=e.subarray(t.at,t.at+t.value),o=t.at+t.value}else if(i===1||i===5){o=r.at+(i===1?8:4);continue}else return;Math.floor(r.value/8)===t&&(a=s)}return i.length===0?a:a instanceof Uint8Array?r(a,i):void 0},i=e=>Uint8Array.from(atob(decodeURIComponent(e).replaceAll(` `,`+`).replaceAll(`-`,`+`).replaceAll(`_`,`/`)),e=>e.charCodeAt(0)),a=(n,r=`ALL`)=>{let i=new e().tag(93,t.LengthDelimited).fork().tag(1,t.LengthDelimited).string(n).tag(2,t.Varint).int32(0).tag(3,t.Varint).int32(r===`SHORTS`?3:1).join().finish(),a=``;for(let e of i)a+=String.fromCharCode(e);return encodeURIComponent(btoa(a))},o=(n,r=``)=>{let i=new e().tag(1,t.LengthDelimited).fork().tag(5,t.LengthDelimited).fork().tag(1,t.LengthDelimited).string(r).tag(2,t.LengthDelimited).string(n).join().join().tag(2,t.Varint).int32(1).tag(3,t.Varint).int32(4).finish(),a=``;for(let e of i)a+=String.fromCharCode(e);return btoa(encodeURIComponent(btoa(a)))};export{r as i,a as n,o as r,i as t};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{en as e,on as t,sn as n,tn as r}from"./icons-DKsqNLSs.js";import{c as i,ot as a,s as o}from"./sign-in-Bx3zmj-m.js";n();var s=a`
|
|
2
|
+
.clamped {
|
|
3
|
+
display: -webkit-box;
|
|
4
|
+
-webkit-line-clamp: 4;
|
|
5
|
+
-webkit-box-orient: vertical;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.read-more {
|
|
10
|
+
display: block;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: none;
|
|
13
|
+
background: transparent;
|
|
14
|
+
color: var(--text-secondary);
|
|
15
|
+
font-size: 1.4rem;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 2rem;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
`,c=({className:n,text:a,children:c})=>{let[l,u]=t(!1),[d,f]=t(!1),p=r(null);return e(()=>{let e=p.current;if(l||!e)return;let t=()=>f(e.scrollHeight>e.clientHeight+1);t(),document.fonts.ready.then(t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[l,a]),i(`div`,{css:s,children:[o(`div`,{ref:p,className:[n,l?void 0:`clamped`].filter(Boolean).join(` `),children:c}),l||d?o(`button`,{type:`button`,className:`read-more`,onClick:()=>u(e=>!e),children:l?`Show less`:`Read more`}):void 0]})};export{c as t};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{ot as e,s as t,y as n}from"./sign-in-Bx3zmj-m.js";import{k as r,p as i}from"./cards-Csel8naI.js";var a=e`
|
|
2
|
+
white-space: pre-wrap;
|
|
3
|
+
overflow-wrap: anywhere;
|
|
4
|
+
|
|
5
|
+
a,
|
|
6
|
+
.seek {
|
|
7
|
+
color: var(--accent);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* A seek reads as a link and has to look like one, but it is a button: it
|
|
11
|
+
acts on the page rather than navigating, so anchor semantics would promise
|
|
12
|
+
the wrong thing to a screen reader and to middle-click. */
|
|
13
|
+
.seek {
|
|
14
|
+
padding: 0;
|
|
15
|
+
border: none;
|
|
16
|
+
background: none;
|
|
17
|
+
font: inherit;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
a:hover,
|
|
22
|
+
.seek:hover {
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
`,o=e=>{let t=e.trim().replace(/^#/,``).toLowerCase();return t?`/hashtag/${encodeURIComponent(t)}`:void 0},s=(e,t)=>{if(e===`FEhashtag`){let e=t.trim();return e.startsWith(`#`)&&e.length>1?o(e):void 0}if(!e.startsWith(`FE`))return e.startsWith(`VL`)?e.length>2?`/playlist?${new URLSearchParams({list:e.slice(2)})}`:void 0:`/channel/${e}`},c=({runs:e,videoId:o,className:c,renderRun:l})=>t(`span`,{css:a,className:c,children:e.map((e,a)=>{let c=`${a}:${e.text}`,u=l?.(e,c);if(u!==void 0)return u;if(e.videoId){let a=e.startSeconds??void 0;return o!==void 0&&e.videoId===o&&a!==void 0?t(`button`,{type:`button`,className:`seek`,onClick:()=>{i(e.videoId,a)},children:e.text},c):t(n,{href:r(e.videoId),children:e.text},c)}if(e.browseId){let r=s(e.browseId,e.text);return r?t(n,{href:r,children:e.text},c):t(`span`,{children:e.text},c)}return e.url?t(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.text},c):t(`span`,{children:e.text},c)})});export{o as n,c as t};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,m as t,o as n,u as r}from"./api-1NDCtwel-CAaxX8P1.js";import{r as i}from"./busy-C1JPjoZ_-CJ0641jK.js";var a=`fkn-attach-frame`,o=`fkn-attach-window`,s={hello:`fkn-attach-window`,refused:`fkn-attach-window-refused`,gone:`fkn-attach-window-gone`,detach:`fkn-attach-window-detach`},c=6e4,l={default:6048e5,min:6e4,max:31536e6},u={notAFile:{code:`invalid`,message:`storage: the data is not a Blob or a ReadableStream`},badSize:{code:`invalid`,message:`storage: a stream needs the size it will deliver, a whole number of bytes`},shortStream:{code:`invalid`,message:`storage: the stream did not deliver the size it declared`},tooLarge:{code:`invalid`,message:`storage: the file is too large to store`},badKey:{code:`invalid`,message:`storage: the key is not 32 bytes base64url`},badUrl:{code:`invalid`,message:`storage: the url does not name a stored object`},badLimit:{code:`invalid`,message:`storage: the limit is out of range`},badCursor:{code:`invalid`,message:`storage: the cursor is not one list answered`},notFound:{code:`not-found`,message:`storage: no object at this url`},integrity:{code:`integrity`,message:`storage: the object does not match its key`},needsAccount:{code:`denied`,message:`storage: storing needs an account`},notCreator:{code:`denied`,message:`storage: only the app that stored the object can delete it`},quota:{code:`quota`,message:`storage: storage quota exceeded`},tooMany:{code:`too-many`,message:`storage: too many stored objects`},tooManyThisHour:{code:`too-many`,message:`storage: too many objects stored this hour, try again later`},accountChanged:{code:`account-changed`,message:`storage: the signed-in account changed`},unavailable:{code:`unavailable`,message:`storage: storage is unavailable`}},d=`fkn-relay`,f=`RelayUnavailableError`,p=`this FKN page cannot choose a relay; reload the app to load the current one`,m=t({available:()=>F,create:()=>R,join:()=>z,open:()=>L}),h={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,badDescription:`rooms: the description is not one a claim can carry`,notClaimer:`rooms: only the app that claimed the room can describe it`,notReleaser:`rooms: only the app that claimed the room can release it`,notClaimingApp:`rooms: only the app that claimed the room can change it`,badTemporary:`rooms: the temporary duration is not one a claim can carry`,notTemporaryClaimer:`rooms: only the app that claimed the room can set when it expires`,temporaryUnavailable:`rooms: temporary claims are not available`,mailboxUnavailable:`rooms: the mailbox switch is not available`,guestUnavailable:`rooms: guest joins are not available`,schemasUnavailable:`rooms: room schemas are not available`,bytesUnavailable:`rooms: binary messages are not available`,badSchema:`rooms: the schema is not one a room can take`,newerSchema:`rooms: the room holds a newer schema`,noSchema:`rooms: the room has no schema`,misfit:`rooms: the message does not fit the room's schema`,ownerSends:`rooms: only the owner sends this type`,accountSends:`rooms: sending this needs an account`,perAccount:`rooms: you have as many of these here as the room allows`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},g=(e,t)=>Object.assign(Error(t),{code:e}),_=e=>e instanceof Error&&typeof e.code==`string`,v={send:!0,receive:!0,maxMessageBytes:262144},y=2048,b=()=>({messages:0,bytes:0,cap:5e8,archived:!1}),x=async()=>{if(!r)return;let t=(await e(`a room`).catch(()=>void 0))?.rooms;return typeof t?.open==`function`?t:void 0},S=()=>{throw g(`unavailable`,h.unavailable)},C=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,w=e=>{if(e!==void 0&&e!==!1)return e===!0?l.default:typeof e!=`number`||!Number.isInteger(e)?null:e>=l.min&&e<=l.max?e:null},T=(e,t)=>{let n=t?e?.guest:e;return typeof n?.join==`function`?n:void 0},E=e=>{let t;try{t=JSON.stringify(e)}catch{}let n=t===void 0?void 0:JSON.parse(t),r=typeof n==`object`&&!!n&&!Array.isArray(n)&&typeof n.type==`string`;if(t===void 0||!r||t.length>y)throw g(`invalid`,h.misfit);return t},D=e=>{let t;try{t=JSON.parse(JSON.stringify(e))}catch{}if(typeof t!=`object`||!t||Array.isArray(t))throw g(`invalid`,h.badSchema);return t},O=e=>e?.schema===void 0?e:{...e,schema:D(e.schema)},k=e=>{if(e.schemas!==!0)throw g(`unavailable`,h.schemasUnavailable);return e},A=e=>{if(e.bytes!==!0)throw g(`unavailable`,h.bytesUnavailable);return e},j=e=>{if(typeof e==`string`)return e;try{return ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice():(Reflect.get(ArrayBuffer.prototype,`byteLength`,e),new Uint8Array(e).slice())}catch{throw g(`invalid`,h.malformed)}},M=(e,t,n)=>{let r=typeof t==`string`?e:A(e);return n===void 0?r:k(r)},N=e=>{let t=e?.guest;if(t!==void 0&&typeof t!=`boolean`)throw g(`invalid`,h.malformed);return t===!0},P=async(e,t)=>{let r=e.invite,a=e,o=0,s=e.self,c=e.owner,l=e.claimed,u=e.mailbox,d=0,f=await e.defaults().catch(()=>v),p=e.schemas===!0?await Promise.resolve(e.schema()).catch(()=>null):null,m=0,y=!1,x=new Set,S=new Set,O=i(`room`),A=()=>{},N=()=>{},P=new Promise(e=>{N=e}),F=e=>{let t=[...S];S.clear();for(let n of t)try{n(e)}catch{}},I=e=>{y||(y=!0,A(),x.clear(),O(),F(g(`closed`,h.ended)),N({reason:e}))},L=e=>{if(y)return;let t=e;if(t.type===`defaults`&&(f=t.defaults),t.type===`schema`&&(m+=1,p=t.schema),t.type===`message`||t.type===`edited`){let e={...t.message,envelope:t.message.envelope??null};t=t.type===`message`?{...t,message:e}:{type:`edited`,message:e}}if(t.type===`permissions`&&t.id===s.id&&(s={id:s.id,permissions:t.permissions,maxMessageBytes:t.maxMessageBytes}),t.type===`claim`){d+=1;let e=t.claimed&&t.mailbox!==!1;t={type:`claim`,claimed:t.claimed,owner:t.owner,mailbox:e},l=t.claimed,c=t.owner,u=e?b():null}for(let e of[...x])try{e(t)}catch{}},R=(e,t)=>{Promise.resolve(e.on(L)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===o&&I(e.reason)},()=>{})},z=async(e,n)=>{let i=T(e,t);if(!i)return I(`unavailable`);let d=await i.join(r).catch(()=>void 0);if(y||n!==o)return;if(!d)return I(`unavailable`);if(`error`in d)return I(C(d.error));if(d.self.id!==s.id)return Promise.resolve(d.leave()).catch(()=>{}),I(`unavailable`);a=d,s=d.self,c=d.owner,l=d.claimed,u=d.mailbox,R(d,n);let m=await d.defaults().catch(()=>void 0);if(m&&!y&&n===o&&(f=m),d.schemas!==!0)return;let h=await Promise.resolve(d.schema()).catch(()=>void 0);h!==void 0&&!y&&n===o&&(p=h)};A=n((e,t)=>{let n=o;o=t,!(y||n===0||n===t)&&(F(g(`unavailable`,h.unavailable)),z(e.rooms,t))}),R(e,o);let B=async e=>{if(y)throw g(`closed`,h.ended);let t=()=>{},n=new Promise((e,n)=>{t=n});S.add(t);try{return await Promise.race([Promise.resolve(e(a)),n])}catch(e){throw _(e)?e:g(`unavailable`,h.unavailable)}finally{S.delete(t)}},V=async e=>{let t=await B(e);if(`error`in t)throw g(t.error,t.message)},H=async e=>{let t=await B(e);if(typeof t==`object`&&t&&`error`in t)throw g(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:r,get self(){return s},get owner(){return c},get claimed(){return l},get mailbox(){return u},defaults:()=>f,members:()=>B(e=>e.members()),schema:()=>p,send:async(e,t)=>{let n=j(e);if(t===void 0)return V(e=>M(e,n,void 0).send(n));let r=E(t);return V(e=>M(e,n,r).send(n,r))},edit:async(e,t,n)=>{let r=j(t);if(n===void 0)return V(t=>M(t,r,void 0).edit(e,r));let i=E(n);return V(t=>M(t,r,i).edit(e,r,i))},setSchema:async e=>{let t=D(e),n=m;await V(e=>k(e).setSchema(t)),m===n&&(p=t)},delete:(e,t)=>V(n=>n.delete(e,t)),backlog:(e,t)=>H(n=>n.backlog(e,t)),setDefault:(e,t)=>V(n=>n.setDefault(e,t)),limit:(e,t)=>V(n=>n.limit(e,t)),grant:(e,t)=>V(n=>n.grant(e,t)),revoke:(e,t)=>V(n=>n.revoke(e,t)),remove:e=>V(t=>t.remove(e)),block:e=>V(t=>t.block(e)),unblock:e=>V(t=>t.unblock(e)),claim:async e=>{let t=e?.description;if(t!==void 0&&typeof t!=`string`)throw g(`invalid`,h.badDescription);let n=w(e?.temporary);if(n===null)throw g(`invalid`,h.badTemporary);let r=e?.mailbox;if(r!==void 0&&typeof r!=`boolean`)throw g(`invalid`,h.malformed);let i={...t===void 0?{}:{description:t},...n===void 0?{}:{temporary:n},...r===void 0?{}:{mailbox:r}};return Object.keys(i).length===0?V(e=>e.claim()):V(e=>{if(n!==void 0&&e.temporaryClaims!==!0)throw g(`unavailable`,h.temporaryUnavailable);if(r===!1&&e.mailboxSwitch!==!0)throw g(`unavailable`,h.mailboxUnavailable);return e.claim(i)})},setMailbox:async e=>{if(typeof e!=`boolean`)throw g(`invalid`,h.malformed);let t=d;await V(t=>{if(t.mailboxSwitch!==!0)throw g(`unavailable`,h.mailboxUnavailable);return t.setMailbox(e)}),d===t&&(e?u===null&&(u=b()):u=null)},release:()=>V(e=>e.release()),usage:async()=>{let e=await H(e=>e.usage());return u=e,e},on:async e=>y?()=>{}:(x.add(e),()=>{x.delete(e)}),leave:async()=>{await Promise.resolve(a.leave()).catch(()=>{}),I(`left`)},closed:P}},F=async()=>{let e=await x();return e?e.available().catch(()=>!1):!1},I=async(e,t,n)=>{let r=await x();if(!r)throw g(`unavailable`,h.unavailable);let i=T(r,e);if(!i)throw g(`unavailable`,h.guestUnavailable);let a=await n(i).catch(S);if(`error`in a)throw g(a.error,a.message);if(t?.schema!==void 0&&a.schemas!==!0)throw await Promise.resolve(a.leave()).catch(()=>{}),g(`unavailable`,h.schemasUnavailable);return P(a,e)},L=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw g(`invalid`,h.badName);let n=N(t),r=O(t);return I(n,r,t=>t.open(e,r))},R=async e=>{let t=N(e),n=O(e);return I(t,n,e=>e.create(n))},z=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw g(`invalid`,h.inviteNoKey);return I(N(t),void 0,n=>n.join(e,t))};export{m as a,d as c,o as d,f,L as i,s as l,F as n,p as o,u as p,z as r,c as s,R as t,a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./rooms-B-AvBY-c-FNDqRDHE.js";export{t as available,r as create,n as join,e as open};
|