@fkn/lib 0.9.33 → 0.9.34
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/account.cjs +1 -1
- package/account.js +1 -1
- package/{api-BlAtp6lc.js → api-BdTgLphT.js} +61 -46
- package/{api-Cc5qxCHP.d.ts → api-Bgsg9t9D.d.ts} +3 -1
- package/api-MW-Lm0u8.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/attach-policy.cjs +1 -1
- package/attach-policy.d.ts +30 -5
- package/attach-policy.js +16 -18
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-D0Ebu5bX.d.ts → cloud-C40YCPuv.d.ts} +4 -4
- package/cloud-DBNeXS9R.js +272 -0
- package/cloud-DHuqVKrl.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-CahPObYc.d.ts → contract-Gd543I6m.d.ts} +21 -1
- package/contract.d.ts +2 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-DNkuFy1Y.d.ts → extension-Bm-PwsD6.d.ts} +23 -147
- package/extension-DALH11b4.js +87 -0
- package/extension-lR-cSs2P.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-DxDxbvRS.cjs → fs-Bv3aFjqA.cjs} +1 -1
- package/{fs-BSsWw8HM.js → fs-O2bp9J0x.js} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/hosts-C4-8lWwz.js +161 -0
- package/hosts-DD4rDeQH.cjs +1 -0
- package/http.d.ts +1 -1
- package/{index-DH3_12nU.d.ts → index-DIK21kfh.d.ts} +278 -5
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +62 -62
- package/{lib-duLPF_WZ.js → lib-C3f3XmGZ.js} +544 -393
- package/lib-WiHTYaNP.cjs +53 -0
- package/{net-BXPEJToS.d.ts → net-BBtYFEzu.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +1 -1
- package/{proxy-DxiJU5Y_.d.ts → proxy-XeHtHIdZ.d.ts} +2 -2
- package/proxy-_m6Sqcr6.cjs +1 -0
- package/proxy-fXckOcRn.js +60 -0
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +1 -1
- package/{storage-Bo01npo9.js → storage-C6Cd4J5E.js} +1 -1
- package/{storage-DEjjVCT2.cjs → storage-D2eBifiu.cjs} +1 -1
- package/api-Beky02FK.cjs +0 -3
- package/cloud-BZmduWyX.cjs +0 -1
- package/cloud-DaVb11IV.js +0 -174
- package/extension-D70dtUvW.cjs +0 -1
- package/extension-DdXNlt9_.js +0 -84
- package/lib-DLM2M3_i.cjs +0 -53
- package/proxy-DexG-Wmk.cjs +0 -1
- package/proxy-VY0HRl2E.js +0 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as OperationRequest, S as
|
|
1
|
+
import { A as Gate, C as VideoElementState, D as revive, E as isType, M as OperationRequest, N as SelectorPart, O as type, S as RemoteVideoElement, T as createVideoElementHandle, _ as CATEGORIES, a as FrameBackend, b as handleRevivableModules, c as attachFramePermission, d as CategoryGrant, f as CategoryRequest, g as permissions, h as PermissionRequest, i as Frame, j as GateTools, k as Executor, l as createFrame, m as PermissionGrant, n as attachFrame, o as GotoOptions, p as LegacyPermissionRequest, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as CategoryMeta, w as box, x as BoxedVideoElement, y as PermissionCategory } from "./index-DIK21kfh.js";
|
|
2
2
|
//#region ../web-extension/lib/lib/forgeable-headers.d.ts
|
|
3
3
|
declare const FORGEABLE_HEADERS: string[];
|
|
4
4
|
declare const hasForgedCookie: (unsafeHeaders: [string, string][] | undefined) => boolean;
|
|
@@ -17,6 +17,7 @@ declare const fetchCredentialedPermission: {
|
|
|
17
17
|
readonly scope: 'network.fetchCredentialed';
|
|
18
18
|
readonly category: 'network';
|
|
19
19
|
readonly severity: 3;
|
|
20
|
+
readonly chip: 'load as you';
|
|
20
21
|
readonly unsafe: true;
|
|
21
22
|
readonly title: 'Fetch from other sites, signed in as you';
|
|
22
23
|
readonly description: 'Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.';
|
|
@@ -25,6 +26,7 @@ declare const fetchLocalPermission: {
|
|
|
25
26
|
readonly scope: 'network.fetchLocal';
|
|
26
27
|
readonly category: 'network';
|
|
27
28
|
readonly severity: 3;
|
|
29
|
+
readonly chip: 'local network';
|
|
28
30
|
readonly unsafe: true;
|
|
29
31
|
readonly title: 'Access devices on your local network';
|
|
30
32
|
readonly description: 'Lets the app reach devices and services on your home or work network, which websites normally cannot touch.';
|
|
@@ -53,6 +55,7 @@ declare const readCookiePermission: {
|
|
|
53
55
|
readonly scope: 'network.readCookie';
|
|
54
56
|
readonly category: 'network';
|
|
55
57
|
readonly severity: 3;
|
|
58
|
+
readonly chip: 'read cookie';
|
|
56
59
|
readonly unsafe: true;
|
|
57
60
|
readonly title: 'Read a site’s cookie';
|
|
58
61
|
readonly description: 'Lets the app read a named cookie from another site, which can include the login token only that site should see.';
|
|
@@ -74,6 +77,7 @@ declare const modifyRequestHeadersPermission: {
|
|
|
74
77
|
readonly scope: 'network.modifyRequestHeaders';
|
|
75
78
|
readonly category: 'network';
|
|
76
79
|
readonly severity: 2;
|
|
80
|
+
readonly chip: 'rewrite headers';
|
|
77
81
|
readonly unsafe: true;
|
|
78
82
|
readonly title: 'Rewrite request headers to other sites';
|
|
79
83
|
readonly description: 'Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.';
|
|
@@ -110,151 +114,23 @@ declare const assertLockdownApplicable: ({ src, domains, lockdown }: {
|
|
|
110
114
|
lockdown: boolean;
|
|
111
115
|
}) => void;
|
|
112
116
|
//#endregion
|
|
113
|
-
//#region ../web-extension/lib/permission/shared/
|
|
114
|
-
declare const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
readonly severity: 1;
|
|
124
|
-
readonly title: 'Read info from the page';
|
|
125
|
-
readonly description: 'Lets the app read the href value from a part of the page.';
|
|
126
|
-
}, {
|
|
127
|
-
readonly scope: 'read.visible';
|
|
128
|
-
readonly category: 'read';
|
|
129
|
-
readonly severity: 0;
|
|
130
|
-
readonly title: 'See what’s visible on the page';
|
|
131
|
-
readonly description: 'Lets the app check which elements are currently on screen.';
|
|
132
|
-
}, {
|
|
133
|
-
readonly scope: 'read.check';
|
|
134
|
-
readonly category: 'read';
|
|
135
|
-
readonly severity: 0;
|
|
136
|
-
readonly title: 'Check if something is on the page';
|
|
137
|
-
readonly description: 'Lets the app test whether a specific element exists.';
|
|
138
|
-
}, {
|
|
139
|
-
readonly scope: 'read.count';
|
|
140
|
-
readonly category: 'read';
|
|
141
|
-
readonly severity: 0;
|
|
142
|
-
readonly title: 'Count items on the page';
|
|
143
|
-
readonly description: 'Lets the app count how many matching elements are present.';
|
|
144
|
-
}, {
|
|
145
|
-
readonly scope: 'act.click';
|
|
146
|
-
readonly category: 'act';
|
|
147
|
-
readonly severity: 3;
|
|
148
|
-
readonly title: 'Click on the page';
|
|
149
|
-
readonly description: 'Lets the app press buttons or links for you.';
|
|
150
|
-
}, {
|
|
151
|
-
readonly scope: 'act.type';
|
|
152
|
-
readonly category: 'act';
|
|
153
|
-
readonly severity: 1;
|
|
154
|
-
readonly title: 'Type into a text field';
|
|
155
|
-
readonly description: 'Lets the app fill in form fields on your behalf.';
|
|
156
|
-
}, {
|
|
157
|
-
readonly scope: 'act.hover';
|
|
158
|
-
readonly category: 'act';
|
|
159
|
-
readonly severity: 1;
|
|
160
|
-
readonly title: 'Hover over the page';
|
|
161
|
-
readonly description: 'Lets the app point at things to reveal menus or tooltips.';
|
|
162
|
-
}, {
|
|
163
|
-
readonly scope: 'media.video';
|
|
164
|
-
readonly category: 'media';
|
|
165
|
-
readonly severity: 0;
|
|
166
|
-
readonly title: 'Control video playback';
|
|
167
|
-
readonly description: 'Lets the app play, pause, seek, and read the video on the page.';
|
|
168
|
-
}, {
|
|
169
|
-
readonly scope: 'media.appear';
|
|
170
|
-
readonly category: 'media';
|
|
171
|
-
readonly severity: 0;
|
|
172
|
-
readonly title: 'Change page appearance';
|
|
173
|
-
readonly description: 'Lets the app restyle parts of the page (safely filtered).';
|
|
174
|
-
}, {
|
|
175
|
-
readonly scope: 'media.appearU';
|
|
176
|
-
readonly category: 'media';
|
|
177
|
-
readonly severity: 2;
|
|
178
|
-
readonly unsafe: true;
|
|
179
|
-
readonly title: 'Change page appearance (unsafe)';
|
|
180
|
-
readonly description: 'Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.';
|
|
181
|
-
}, {
|
|
182
|
-
readonly scope: 'embed.iframe';
|
|
183
|
-
readonly category: 'embed';
|
|
184
|
-
readonly severity: 0;
|
|
185
|
-
readonly title: 'Load another website inside this app';
|
|
186
|
-
readonly description: 'Lets the app embed external pages directly inside its own view.';
|
|
187
|
-
}, {
|
|
188
|
-
readonly scope: 'embed.open';
|
|
189
|
-
readonly category: 'embed';
|
|
190
|
-
readonly severity: 0;
|
|
191
|
-
readonly title: 'Open a website inside this app';
|
|
192
|
-
readonly description: 'Lets the app navigate to another site without leaving its window.';
|
|
193
|
-
}, {
|
|
194
|
-
readonly scope: 'frame.fetchRead';
|
|
195
|
-
readonly category: 'network';
|
|
196
|
-
readonly severity: 3;
|
|
197
|
-
readonly unsafe: true;
|
|
198
|
-
readonly title: 'Read your account data on this site';
|
|
199
|
-
readonly description: 'Lets the app read pages and data from this site as you, using the session in the frame.';
|
|
200
|
-
}, {
|
|
201
|
-
readonly scope: 'frame.fetchWrite';
|
|
202
|
-
readonly category: 'network';
|
|
203
|
-
readonly severity: 3;
|
|
204
|
-
readonly unsafe: true;
|
|
205
|
-
readonly title: 'Change your account data on this site';
|
|
206
|
-
readonly description: 'Lets the app send changes to this site as you, using the session in the frame.';
|
|
207
|
-
}, {
|
|
208
|
-
readonly scope: 'network.fetch';
|
|
209
|
-
readonly category: 'network';
|
|
210
|
-
readonly severity: 0;
|
|
211
|
-
readonly title: 'Fetch data from other sites';
|
|
212
|
-
readonly description: 'Lets the app download public data from other websites directly, past the usual cross-origin limits.';
|
|
213
|
-
}, {
|
|
214
|
-
readonly scope: 'network.fetchCredentialed';
|
|
215
|
-
readonly category: 'network';
|
|
216
|
-
readonly severity: 3;
|
|
217
|
-
readonly unsafe: true;
|
|
218
|
-
readonly title: 'Fetch from other sites, signed in as you';
|
|
219
|
-
readonly description: 'Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.';
|
|
220
|
-
}, {
|
|
221
|
-
readonly scope: 'network.fetchLocal';
|
|
222
|
-
readonly category: 'network';
|
|
223
|
-
readonly severity: 3;
|
|
224
|
-
readonly unsafe: true;
|
|
225
|
-
readonly title: 'Access devices on your local network';
|
|
226
|
-
readonly description: 'Lets the app reach devices and services on your home or work network, which websites normally cannot touch.';
|
|
227
|
-
}, {
|
|
228
|
-
readonly scope: 'network.readCookie';
|
|
229
|
-
readonly category: 'network';
|
|
230
|
-
readonly severity: 3;
|
|
231
|
-
readonly unsafe: true;
|
|
232
|
-
readonly title: 'Read a site’s cookie';
|
|
233
|
-
readonly description: 'Lets the app read a named cookie from another site, which can include the login token only that site should see.';
|
|
234
|
-
}, {
|
|
235
|
-
readonly scope: 'network.modifyRequestHeaders';
|
|
236
|
-
readonly category: 'network';
|
|
237
|
-
readonly severity: 2;
|
|
238
|
-
readonly unsafe: true;
|
|
239
|
-
readonly title: 'Rewrite request headers to other sites';
|
|
240
|
-
readonly description: 'Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.';
|
|
241
|
-
}];
|
|
242
|
-
type PermissionScope = (typeof PERMISSIONS)[number]['scope'];
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region ../web-extension/lib/lib/permissions.d.ts
|
|
245
|
-
type PermissionRequest = {
|
|
246
|
-
key: PermissionScope;
|
|
247
|
-
scope?: string;
|
|
248
|
-
reason?: string;
|
|
249
|
-
};
|
|
250
|
-
type PermissionGrant = {
|
|
251
|
-
key: PermissionScope;
|
|
117
|
+
//#region ../web-extension/lib/permission/shared/error.d.ts
|
|
118
|
+
declare const PERMISSION_DENIED = "PermissionDeniedError";
|
|
119
|
+
/**
|
|
120
|
+
* Everything the refusal names. `permissionKey` and `scope` are the CONCRETE operation and its
|
|
121
|
+
* target, which is what the app wrote; `grantKey`, `category`, `site` and `hosts` are the row the
|
|
122
|
+
* user would have had to accept, which is what they would have to change.
|
|
123
|
+
*/
|
|
124
|
+
type PermissionDeniedError = Error & {
|
|
125
|
+
name: typeof PERMISSION_DENIED;
|
|
126
|
+
permissionKey: string;
|
|
252
127
|
scope: string;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
128
|
+
grantKey: string;
|
|
129
|
+
category?: PermissionCategory;
|
|
130
|
+
site: string;
|
|
131
|
+
hosts: string[];
|
|
257
132
|
};
|
|
133
|
+
declare const isPermissionDenied: (error: unknown) => boolean;
|
|
258
134
|
//#endregion
|
|
259
135
|
//#region ../web-extension/lib/utils/extension-abi.d.ts
|
|
260
136
|
/**
|
|
@@ -265,7 +141,7 @@ declare const permissions: {
|
|
|
265
141
|
* nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
|
|
266
142
|
* to them would make every release look like a protocol change.
|
|
267
143
|
*/
|
|
268
|
-
declare const EXTENSION_ABI =
|
|
144
|
+
declare const EXTENSION_ABI = 2;
|
|
269
145
|
/**
|
|
270
146
|
* The oldest extension the page half will talk to. Raise it ONLY when the page half starts depending
|
|
271
147
|
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved: an added
|
|
@@ -355,7 +231,7 @@ declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
|
|
|
355
231
|
spread?: boolean;
|
|
356
232
|
}) => Promise<Response>;
|
|
357
233
|
declare namespace extension_d_exports {
|
|
358
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
234
|
+
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, Executor, ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, OperationRequest, PERMISSION_DENIED, PermissionCategory, PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
359
235
|
}
|
|
360
236
|
//#endregion
|
|
361
|
-
export { modifyRequestHeadersPermission as A, fetch$1 as B, LOCATOR_ERROR as C, isTerminalError as D, isLocatorUnsupported as E, cookies as F, isLocalNetworkUrl as G, fetchLocalPermission as H, readCookiePermission as I, assertOneCookieIdentity as J, FORGEABLE_HEADERS as K, FetchInit as L, setRequestHeaderRule as M, CookieDetails as N, HeaderOperation as O, SiteCookie as P, ProxyFetchRequest as R, LOCATOR_DENIED as S, isLocatorDenied as T, fetchPermission as U, fetchCredentialedPermission as V, isBlockedFetchUrl as W, hasForgedCookie as Y,
|
|
237
|
+
export { modifyRequestHeadersPermission as A, fetch$1 as B, LOCATOR_ERROR as C, isTerminalError as D, isLocatorUnsupported as E, cookies as F, isLocalNetworkUrl as G, fetchLocalPermission as H, readCookiePermission as I, assertOneCookieIdentity as J, FORGEABLE_HEADERS as K, FetchInit as L, setRequestHeaderRule as M, CookieDetails as N, HeaderOperation as O, SiteCookie as P, ProxyFetchRequest as R, LOCATOR_DENIED as S, isLocatorDenied as T, fetchPermission as U, fetchCredentialedPermission as V, isBlockedFetchUrl as W, hasForgedCookie as Y, PermissionDeniedError as _, extension as a, assertLockdownApplicable as b, setMissingExtensionHandler as c, ExtensionHandshake as d, ExtensionOperationUnsupportedError as f, PERMISSION_DENIED as g, supportsOperation as h, promptInstall as i, removeRequestHeaderRule as j, RequestHeaderRule as k, waitForExtensionExposure as l, REQUIRED_EXTENSION_ABI as m, fetch as n, isExtensionExposed as o, ExtensionOutdatedError as p, assertForgeableHeaders as q, isExtensionAvailable as r, readExtensionHandshake as s, extension_d_exports as t, EXTENSION_ABI as u, isPermissionDenied as v, LOCATOR_UNSUPPORTED as w, isBlockedFrameUrl as x, assertAttachableFrameUrl as y, assertFetchableUrl as z };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, H as c, I as l, K as u, L as ee, M as te, N as d, O as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, a as w, d as T, et as E, f as D, g as O, h as k, i as A, j as ne, k as j, l as M, m as N, n as P, p as F, q as I, r as L, t as R, tt as z, u as B, v as V, w as H, x as U, y as W, z as G } from "./lib-C3f3XmGZ.js";
|
|
3
|
+
import { a as K, d as q } from "./api-BdTgLphT.js";
|
|
4
|
+
import { t as J } from "./proxy-fXckOcRn.js";
|
|
5
|
+
import { available as Y, fetch as X } from "./desktop.js";
|
|
6
|
+
//#region src/extension-prompt.ts
|
|
7
|
+
var Z = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (y()) return !0;
|
|
10
|
+
let t = await K, n = null, i = new Promise((e) => {
|
|
11
|
+
n = () => {
|
|
12
|
+
y() && e(!0);
|
|
13
|
+
}, r.addEventListener("statuschange", n);
|
|
14
|
+
}), a = t.installPrompt.show(e).then(() => !1), o = await Promise.race([i, a]);
|
|
15
|
+
return n && r.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), o;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
v(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && y(), re = async (e, t) => {
|
|
23
|
+
if (q(e), t?.credentials === "include") {
|
|
24
|
+
if (typeof document > "u") throw Error("fetch with credentials needs the FKN extension, which only exists in window realms");
|
|
25
|
+
return n(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? n(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : Y() ? X(e, t) : J(e, t);
|
|
31
|
+
}, ie = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
CATEGORIES: () => i,
|
|
34
|
+
EXTENSION_ABI: () => 2,
|
|
35
|
+
ExtensionOperationUnsupportedError: () => u,
|
|
36
|
+
ExtensionOutdatedError: () => I,
|
|
37
|
+
FORGEABLE_HEADERS: () => l,
|
|
38
|
+
LOCATOR_DENIED: () => W,
|
|
39
|
+
LOCATOR_ERROR: () => g,
|
|
40
|
+
LOCATOR_UNSUPPORTED: () => O,
|
|
41
|
+
PERMISSION_DENIED: () => R,
|
|
42
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
43
|
+
assertAttachableFrameUrl: () => D,
|
|
44
|
+
assertFetchableUrl: () => j,
|
|
45
|
+
assertForgeableHeaders: () => ee,
|
|
46
|
+
assertLockdownApplicable: () => F,
|
|
47
|
+
assertOneCookieIdentity: () => h,
|
|
48
|
+
attachFrame: () => w,
|
|
49
|
+
attachFramePermission: () => M,
|
|
50
|
+
available: () => $,
|
|
51
|
+
box: () => C,
|
|
52
|
+
cookies: () => a,
|
|
53
|
+
createFrame: () => B,
|
|
54
|
+
createVideoElementHandle: () => m,
|
|
55
|
+
events: () => r,
|
|
56
|
+
extension: () => r,
|
|
57
|
+
fetch: () => n,
|
|
58
|
+
fetchCredentialedPermission: () => ne,
|
|
59
|
+
fetchLocalPermission: () => te,
|
|
60
|
+
fetchPermission: () => d,
|
|
61
|
+
gotoPermission: () => T,
|
|
62
|
+
handleRevivableModules: () => x,
|
|
63
|
+
hasForgedCookie: () => G,
|
|
64
|
+
isBlockedFetchUrl: () => p,
|
|
65
|
+
isBlockedFrameUrl: () => N,
|
|
66
|
+
isExtensionExposed: () => y,
|
|
67
|
+
isLocalNetworkUrl: () => s,
|
|
68
|
+
isLocatorDenied: () => k,
|
|
69
|
+
isLocatorUnsupported: () => V,
|
|
70
|
+
isPermissionDenied: () => P,
|
|
71
|
+
isTerminalError: () => U,
|
|
72
|
+
isType: () => t,
|
|
73
|
+
modifyRequestHeadersPermission: () => H,
|
|
74
|
+
permissions: () => L,
|
|
75
|
+
promptInstall: () => Z,
|
|
76
|
+
readCookiePermission: () => f,
|
|
77
|
+
readExtensionHandshake: () => c,
|
|
78
|
+
removeRequestHeaderRule: () => _,
|
|
79
|
+
revive: () => E,
|
|
80
|
+
setMissingExtensionHandler: () => v,
|
|
81
|
+
setRequestHeaderRule: () => o,
|
|
82
|
+
supportsOperation: () => S,
|
|
83
|
+
type: () => z,
|
|
84
|
+
waitForExtensionExposure: () => b
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Z as i, re as n, $ as r, ie as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-WiHTYaNP.cjs"),n=require("./api-MW-Lm0u8.cjs"),r=require("./proxy-_m6Sqcr6.cjs"),i=require("./desktop.cjs");var a=async e=>{if(typeof window>`u`)return!1;if(t.V())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.V()&&e(!0)},t.B.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.B.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.U(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.V(),c=async(e,a)=>{if(n.d(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.A(e,a)}return s()?t.A(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},l=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,CATEGORIES:()=>t.C,EXTENSION_ABI:()=>2,ExtensionOperationUnsupportedError:()=>t.K,ExtensionOutdatedError:()=>t.q,FORGEABLE_HEADERS:()=>t.I,LOCATOR_DENIED:()=>t.y,LOCATOR_ERROR:()=>t.S,LOCATOR_UNSUPPORTED:()=>t.g,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t.f,assertFetchableUrl:()=>t.k,assertForgeableHeaders:()=>t.L,assertLockdownApplicable:()=>t.p,assertOneCookieIdentity:()=>t.R,attachFrame:()=>t.a,attachFramePermission:()=>t.l,available:()=>s,box:()=>t.Z,cookies:()=>t.D,createFrame:()=>t.u,createVideoElementHandle:()=>t.Q,events:()=>t.B,extension:()=>t.B,fetch:()=>t.A,fetchCredentialedPermission:()=>t.j,fetchLocalPermission:()=>t.M,fetchPermission:()=>t.N,gotoPermission:()=>t.d,handleRevivableModules:()=>t.X,hasForgedCookie:()=>t.z,isBlockedFetchUrl:()=>t.P,isBlockedFrameUrl:()=>t.m,isExtensionExposed:()=>t.V,isLocalNetworkUrl:()=>t.F,isLocatorDenied:()=>t.h,isLocatorUnsupported:()=>t.v,isPermissionDenied:()=>t.n,isTerminalError:()=>t.x,isType:()=>t.$,modifyRequestHeadersPermission:()=>t.w,permissions:()=>t.r,promptInstall:()=>a,readCookiePermission:()=>t.O,readExtensionHandshake:()=>t.H,removeRequestHeaderRule:()=>t.T,revive:()=>t.et,setMissingExtensionHandler:()=>t.U,setRequestHeaderRule:()=>t.E,supportsOperation:()=>t.Y,type:()=>t.tt,waitForExtensionExposure:()=>t.W});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-WiHTYaNP.cjs"),t=require("./extension-lR-cSs2P.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.CATEGORIES=e.C,exports.EXTENSION_ABI=e.G,exports.ExtensionOperationUnsupportedError=e.K,exports.ExtensionOutdatedError=e.q,exports.FORGEABLE_HEADERS=e.I,exports.LOCATOR_DENIED=e.y,exports.LOCATOR_ERROR=e.S,exports.LOCATOR_UNSUPPORTED=e.g,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.J,exports.assertAttachableFrameUrl=e.f,exports.assertFetchableUrl=e.k,exports.assertForgeableHeaders=e.L,exports.assertLockdownApplicable=e.p,exports.assertOneCookieIdentity=e.R,exports.attachFrame=e.a,exports.attachFramePermission=e.l,exports.available=t.r,exports.box=e.Z,exports.cookies=e.D,exports.createFrame=e.u,exports.createVideoElementHandle=e.Q,exports.events=e.B,exports.extension=e.B,exports.fetch=e.A,exports.fetchCredentialedPermission=e.j,exports.fetchLocalPermission=e.M,exports.fetchPermission=e.N,exports.gotoPermission=e.d,exports.handleRevivableModules=e.X,exports.hasForgedCookie=e.z,exports.isBlockedFetchUrl=e.P,exports.isBlockedFrameUrl=e.m,exports.isExtensionExposed=e.V,exports.isLocalNetworkUrl=e.F,exports.isLocatorDenied=e.h,exports.isLocatorUnsupported=e.v,exports.isPermissionDenied=e.n,exports.isTerminalError=e.x,exports.isType=e.$,exports.modifyRequestHeadersPermission=e.w,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.O,exports.readExtensionHandshake=e.H,exports.removeRequestHeaderRule=e.T,exports.revive=e.et,exports.setMissingExtensionHandler=e.U,exports.setRequestHeaderRule=e.E,exports.supportsOperation=e.Y,exports.type=e.tt,exports.waitForExtensionExposure=e.W;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as modifyRequestHeadersPermission, B as fetch, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as
|
|
2
|
-
import { C as OperationRequest, S as
|
|
3
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
|
1
|
+
import { A as modifyRequestHeadersPermission, B as fetch, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as removeRequestHeaderRule, k as RequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as assertForgeableHeaders, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as LOCATOR_UNSUPPORTED, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as assertFetchableUrl } from "./extension-Bm-PwsD6.js";
|
|
2
|
+
import { A as Gate, C as VideoElementState, D as revive, E as isType, M as OperationRequest, N as SelectorPart, O as type, S as RemoteVideoElement, T as createVideoElementHandle, _ as CATEGORIES, a as FrameBackend, b as handleRevivableModules, c as attachFramePermission, d as CategoryGrant, f as CategoryRequest, g as permissions, h as PermissionRequest, i as Frame, j as GateTools, k as Executor, l as createFrame, m as PermissionGrant, n as attachFrame, o as GotoOptions, p as LegacyPermissionRequest, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as CategoryMeta, w as box, x as BoxedVideoElement, y as PermissionCategory } from "./index-DIK21kfh.js";
|
|
3
|
+
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
export {
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, a as D, d as O, et as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, p as z, q as B, r as V, t as H, tt as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./lib-C3f3XmGZ.js";
|
|
2
|
+
import { i as X, r as Z } from "./extension-DALH11b4.js";
|
|
3
|
+
export { N as ATTACH_FRAME_EVENT_KEY, r as CATEGORIES, s as EXTENSION_ABI, d as ExtensionOperationUnsupportedError, B as ExtensionOutdatedError, l as FORGEABLE_HEADERS, J as LOCATOR_DENIED, y as LOCATOR_ERROR, j as LOCATOR_UNSUPPORTED, H as PERMISSION_DENIED, u as REQUIRED_EXTENSION_ABI, A as assertAttachableFrameUrl, F as assertFetchableUrl, f as assertForgeableHeaders, z as assertLockdownApplicable, v as assertOneCookieIdentity, D as attachFrame, I as attachFramePermission, Z as available, E as box, i as cookies, W as createFrame, _ as createVideoElementHandle, n as events, n as extension, t as fetch, P as fetchCredentialedPermission, p as fetchLocalPermission, m as fetchPermission, O as gotoPermission, w as handleRevivableModules, Y as hasForgedCookie, g as isBlockedFetchUrl, L as isBlockedFrameUrl, S as isExtensionExposed, o as isLocalNetworkUrl, M as isLocatorDenied, G as isLocatorUnsupported, R as isPermissionDenied, q as isTerminalError, e as isType, K as modifyRequestHeadersPermission, V as permissions, X as promptInstall, h as readCookiePermission, c as readExtensionHandshake, b as removeRequestHeaderRule, k as revive, x as setMissingExtensionHandler, a as setRequestHeaderRule, T as supportsOperation, U as type, C as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-Bv3aFjqA.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-O2bp9J0x.js";
|
|
2
2
|
//#region src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-DZPGCYWg.cjs"),r=require("./storage-DEjjVCT2.cjs"),i=require("./opfs-CXMESVLc.cjs");var a=e.t({adopt:()=>I,adoptable:()=>L,available:()=>u,list:()=>re,onConflict:()=>le,pending:()=>C,pendingDeletes:()=>w,pull:()=>ce,readFile:()=>ie,readFileSealed:()=>ae,remove:()=>se,replicating:()=>T,writeFile:()=>oe}),o,s=async()=>await(o??=i.t().catch(()=>!1))?!0:(o=void 0,!1),c=()=>r.r().catch(()=>`unknown`),l=async()=>await c()===`connected`,u=async()=>await s()||await l(),d=`fkn:fs:pending`,f=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,h=new Map,g=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},_=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},v=()=>g(d),y=(e,t)=>{let n=v();e in n||(n[e]=t===void 0?h.get(e)??null:t,_(d,n))},b=e=>{let t=v();e in t&&(delete t[e],_(d,t),D()||(k=O))},x=()=>g(f),ee=e=>{let t=x();e in t||(t[e]=h.get(e)??null,_(f,t))},S=e=>{let t=x();e in t&&(delete t[e],_(f,t),D()||(k=O))},C=()=>Object.keys(v()),w=()=>Object.keys(x()),T=()=>m,E=null;t.r(`storage replication`,()=>E!==null||R!==null);var D=()=>Object.keys(v()).length>0||Object.keys(x()).length>0,O=6e4,te=6e5,k=O,A=null,j=()=>{A||typeof window>`u`||!D()||(A=setTimeout(()=>{A=null,M()},k),k=Math.min(k*2,te))},M=()=>{E||!D()||(E=F(!1).then(e=>{if(!D()){k=O;return}e.failed.length&&j()}).catch(()=>{j()}).finally(()=>{E=null}))},ne=null,N=()=>ne??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),re=async()=>{U();let e=await c(),t=e===`connected`,[n,a]=await Promise.all([s().then(e=>e?i.n():[]).catch(()=>[]),t?r.o().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(m=a.ok),a.ok&&e!==`unknown`&&(h=new Map(a.entries.map(e=>[e.path,e.updatedAt])));let o=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=o.get(e.path);(!t||l(e)>=l(t))&&o.set(e.path,e)};for(let e of n)u(e);for(let e of a.entries)u(e);return a.ok&&t&&(me(n,a.entries).catch(()=>{}),D()?M():z({local:n,remote:a.entries}).catch(()=>{})),[...o.values()]},ie=async e=>{if(await s())try{return await i.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await r.c(e);return await s()&&i.o(e,t).catch(()=>{}),t},ae=async e=>{if(await s())try{let t=await i.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return r.l(e)},oe=async(e,t,n)=>{let a=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await s()){await i.o(e,a,n),U();let t=h.get(e)??null,o=await c();if(o===`disconnected`)return;if(o===`unknown`||!m){y(e,t),j();return}r.p(e,a,n).then(()=>b(e)).catch(n=>{y(e,t),j(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let o=await c();if(o===`connected`)return r.p(e,a,n);throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},se=async e=>{U();let t=[];await s()&&t.push(i.a(e).catch(()=>{}));let n=await c();if(n===`connected`?t.push(r.u(e).then(()=>S(e)).catch(t=>{ee(e),j(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&h.has(e)&&(ee(e),j()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);b(e),await Promise.all(t)},ce=async e=>{let t=await r.c(e);return await s()&&await i.o(e,t),t},P=null,le=e=>(P=e,()=>{P===e&&(P=null)}),ue=async e=>{let t=await(await N()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},de=async e=>{if(P)try{return await P(e)}catch{return null}return ue(e)},F=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await c();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let a=await s(),[o,l]=await Promise.all([a?i.n():Promise.resolve([]),r.o()]),u=new Map(l.map(e=>[e.path,e])),d=v();if(a)for(let e of Object.keys(d))o.some(t=>t.path===e)||b(e);for(let[e,n]of Object.entries(x())){let i=u.get(e);if(!i){S(e);continue}if(o.some(t=>t.path===e)){S(e);continue}if(i.updatedAt!==n){S(e);continue}try{await r.u(e),S(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of o){let a=u.get(n.path),o=n.path in d;if(!o&&(a||!e)){a&&t.kept.push(n.path);continue}if(o&&a&&a.updatedAt!==d[n.path]){let e=null,o=null,s=await de({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:a.size,updatedAt:a.updatedAt},readLocal:()=>e??=i.i(n.path),readCloud:()=>o??=r.c(n.path)});if(s==null){t.unresolved.push(n.path);continue}try{let a=e!==null&&s===await e,c=o!==null&&s===await o;c||await r.p(n.path,s,n.contentType?{contentType:n.contentType}:void 0),a||await i.o(n.path,s),b(n.path),t.resolved.push({path:n.path,choice:a?`local`:c?`cloud`:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await i.i(n.path);await r.p(n.path,e,n.contentType?{contentType:n.contentType}:void 0),b(n.path),t.uploaded.push(n.path)}catch(e){if(y(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},I=async()=>{for(;E;)await E;let e=F(!0);E=e.then(()=>{},()=>{});try{return await e}finally{E=null}},L=async()=>{if(!await l()||!await s())return{paths:[],bytes:0};let[e,t]=await Promise.all([i.n(),r.o()]),n=new Set(t.map(e=>e.path)),a=e.filter(e=>!n.has(e.path));return{paths:a.map(e=>e.path),bytes:a.reduce((e,t)=>e+t.size,0)}},fe=()=>new Set(Object.keys(g(p))),pe=e=>{let t=g(p);for(let n of e)t[n]=null;_(p,t)},R=null,z=e=>R||(R=(async()=>{if(!await l())return;let t=e??(await s()?{local:await i.n(),remote:await r.o()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),a=fe(),o=t.local.filter(e=>!n.has(e.path)&&!a.has(e.path));if(!o.length)return;let c=await N(),u=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:u}).catch(()=>!1)){pe(o.map(e=>e.path));return}await I()})().catch(()=>{}).finally(()=>{R=null}),R),B=null,V=!1,me=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await N(),a=async()=>{await I().catch(()=>{});let e=await L().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};B=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},V||(V=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&B?.()})).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},H=!1,U=()=>{H||typeof window>`u`||(H=!0,window.addEventListener(`online`,()=>{M()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{z().catch(()=>{}),M()})).catch(()=>{}))},he=e.t({adopt:()=>q,adoptable:()=>J,appendFile:()=>je,appendFileSync:()=>be,available:()=>_e,default:()=>$,exists:()=>Re,existsSync:()=>xe,flush:()=>Ve,lstatSync:()=>Ce,mkdir:()=>Pe,mkdirSync:()=>we,mount:()=>Be,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>ze,pull:()=>G,readFile:()=>ke,readFileSealed:()=>K,readFileSync:()=>ve,readdir:()=>Ne,readdirSync:()=>W,remount:()=>He,rename:()=>Le,renameSync:()=>Oe,replicating:()=>Z,rm:()=>Fe,rmSync:()=>Te,rmdirSync:()=>Ee,stat:()=>Me,statSync:()=>Se,unlink:()=>Ie,unlinkSync:()=>De,writeFile:()=>Ae,writeFileSync:()=>ye}),ge=n.t(a,{memfs:!0}),{available:_e,readFileSync:ve,writeFileSync:ye,appendFileSync:be,existsSync:xe,statSync:Se,lstatSync:Ce,readdirSync:W,mkdirSync:we,rmSync:Te,rmdirSync:Ee,unlinkSync:De,renameSync:Oe,readFile:ke,writeFile:Ae,appendFile:je,stat:Me,readdir:Ne,mkdir:Pe,rm:Fe,unlink:Ie,rename:Le,exists:Re,promises:ze,mount:Be,flush:Ve,remount:He}=ge,G=ce,K=ae,q=I,J=L,Y=C,X=w,Z=T,Q=le,$={...ge,pull:G,readFileSealed:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./busy-Dv8wzE5M.cjs"),n=require("./node-fs-DZPGCYWg.cjs"),r=require("./storage-D2eBifiu.cjs"),i=require("./opfs-CXMESVLc.cjs");var a=e.t({adopt:()=>I,adoptable:()=>L,available:()=>u,list:()=>re,onConflict:()=>le,pending:()=>C,pendingDeletes:()=>w,pull:()=>ce,readFile:()=>ie,readFileSealed:()=>ae,remove:()=>se,replicating:()=>T,writeFile:()=>oe}),o,s=async()=>await(o??=i.t().catch(()=>!1))?!0:(o=void 0,!1),c=()=>r.r().catch(()=>`unknown`),l=async()=>await c()===`connected`,u=async()=>await s()||await l(),d=`fkn:fs:pending`,f=`fkn:fs:pending-delete`,p=`fkn:fs:adopt-declined`,m=!0,h=new Map,g=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},_=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},v=()=>g(d),y=(e,t)=>{let n=v();e in n||(n[e]=t===void 0?h.get(e)??null:t,_(d,n))},b=e=>{let t=v();e in t&&(delete t[e],_(d,t),D()||(k=O))},x=()=>g(f),ee=e=>{let t=x();e in t||(t[e]=h.get(e)??null,_(f,t))},S=e=>{let t=x();e in t&&(delete t[e],_(f,t),D()||(k=O))},C=()=>Object.keys(v()),w=()=>Object.keys(x()),T=()=>m,E=null;t.r(`storage replication`,()=>E!==null||R!==null);var D=()=>Object.keys(v()).length>0||Object.keys(x()).length>0,O=6e4,te=6e5,k=O,A=null,j=()=>{A||typeof window>`u`||!D()||(A=setTimeout(()=>{A=null,M()},k),k=Math.min(k*2,te))},M=()=>{E||!D()||(E=F(!1).then(e=>{if(!D()){k=O;return}e.failed.length&&j()}).catch(()=>{j()}).finally(()=>{E=null}))},ne=null,N=()=>ne??=Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.apiPromise),re=async()=>{U();let e=await c(),t=e===`connected`,[n,a]=await Promise.all([s().then(e=>e?i.n():[]).catch(()=>[]),t?r.o().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(m=a.ok),a.ok&&e!==`unknown`&&(h=new Map(a.entries.map(e=>[e.path,e.updatedAt])));let o=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=o.get(e.path);(!t||l(e)>=l(t))&&o.set(e.path,e)};for(let e of n)u(e);for(let e of a.entries)u(e);return a.ok&&t&&(me(n,a.entries).catch(()=>{}),D()?M():z({local:n,remote:a.entries}).catch(()=>{})),[...o.values()]},ie=async e=>{if(await s())try{return await i.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await r.c(e);return await s()&&i.o(e,t).catch(()=>{}),t},ae=async e=>{if(await s())try{let t=await i.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return r.l(e)},oe=async(e,t,n)=>{let a=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await s()){await i.o(e,a,n),U();let t=h.get(e)??null,o=await c();if(o===`disconnected`)return;if(o===`unknown`||!m){y(e,t),j();return}r.p(e,a,n).then(()=>b(e)).catch(n=>{y(e,t),j(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let o=await c();if(o===`connected`)return r.p(e,a,n);throw Error(o===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},se=async e=>{U();let t=[];await s()&&t.push(i.a(e).catch(()=>{}));let n=await c();if(n===`connected`?t.push(r.u(e).then(()=>S(e)).catch(t=>{ee(e),j(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&h.has(e)&&(ee(e),j()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);b(e),await Promise.all(t)},ce=async e=>{let t=await r.c(e);return await s()&&await i.o(e,t),t},P=null,le=e=>(P=e,()=>{P===e&&(P=null)}),ue=async e=>{let t=await(await N()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},de=async e=>{if(P)try{return await P(e)}catch{return null}return ue(e)},F=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await c();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let a=await s(),[o,l]=await Promise.all([a?i.n():Promise.resolve([]),r.o()]),u=new Map(l.map(e=>[e.path,e])),d=v();if(a)for(let e of Object.keys(d))o.some(t=>t.path===e)||b(e);for(let[e,n]of Object.entries(x())){let i=u.get(e);if(!i){S(e);continue}if(o.some(t=>t.path===e)){S(e);continue}if(i.updatedAt!==n){S(e);continue}try{await r.u(e),S(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of o){let a=u.get(n.path),o=n.path in d;if(!o&&(a||!e)){a&&t.kept.push(n.path);continue}if(o&&a&&a.updatedAt!==d[n.path]){let e=null,o=null,s=await de({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:a.size,updatedAt:a.updatedAt},readLocal:()=>e??=i.i(n.path),readCloud:()=>o??=r.c(n.path)});if(s==null){t.unresolved.push(n.path);continue}try{let a=e!==null&&s===await e,c=o!==null&&s===await o;c||await r.p(n.path,s,n.contentType?{contentType:n.contentType}:void 0),a||await i.o(n.path,s),b(n.path),t.resolved.push({path:n.path,choice:a?`local`:c?`cloud`:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await i.i(n.path);await r.p(n.path,e,n.contentType?{contentType:n.contentType}:void 0),b(n.path),t.uploaded.push(n.path)}catch(e){if(y(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},I=async()=>{for(;E;)await E;let e=F(!0);E=e.then(()=>{},()=>{});try{return await e}finally{E=null}},L=async()=>{if(!await l()||!await s())return{paths:[],bytes:0};let[e,t]=await Promise.all([i.n(),r.o()]),n=new Set(t.map(e=>e.path)),a=e.filter(e=>!n.has(e.path));return{paths:a.map(e=>e.path),bytes:a.reduce((e,t)=>e+t.size,0)}},fe=()=>new Set(Object.keys(g(p))),pe=e=>{let t=g(p);for(let n of e)t[n]=null;_(p,t)},R=null,z=e=>R||(R=(async()=>{if(!await l())return;let t=e??(await s()?{local:await i.n(),remote:await r.o()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),a=fe(),o=t.local.filter(e=>!n.has(e.path)&&!a.has(e.path));if(!o.length)return;let c=await N(),u=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:u}).catch(()=>!1)){pe(o.map(e=>e.path));return}await I()})().catch(()=>{}).finally(()=>{R=null}),R),B=null,V=!1,me=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await N(),a=async()=>{await I().catch(()=>{});let e=await L().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};B=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},V||(V=!0,Promise.resolve().then(()=>require("./api.cjs")).then(e=>e.onApiEpoch((e,t)=>{t>1&&B?.()})).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},H=!1,U=()=>{H||typeof window>`u`||(H=!0,window.addEventListener(`online`,()=>{M()}),Promise.resolve().then(()=>require("./account.cjs")).then(e=>e.onChange(()=>{z().catch(()=>{}),M()})).catch(()=>{}))},he=e.t({adopt:()=>q,adoptable:()=>J,appendFile:()=>je,appendFileSync:()=>be,available:()=>_e,default:()=>$,exists:()=>Re,existsSync:()=>xe,flush:()=>Ve,lstatSync:()=>Ce,mkdir:()=>Pe,mkdirSync:()=>we,mount:()=>Be,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>ze,pull:()=>G,readFile:()=>ke,readFileSealed:()=>K,readFileSync:()=>ve,readdir:()=>Ne,readdirSync:()=>W,remount:()=>He,rename:()=>Le,renameSync:()=>Oe,replicating:()=>Z,rm:()=>Fe,rmSync:()=>Te,rmdirSync:()=>Ee,stat:()=>Me,statSync:()=>Se,unlink:()=>Ie,unlinkSync:()=>De,writeFile:()=>Ae,writeFileSync:()=>ye}),ge=n.t(a,{memfs:!0}),{available:_e,readFileSync:ve,writeFileSync:ye,appendFileSync:be,existsSync:xe,statSync:Se,lstatSync:Ce,readdirSync:W,mkdirSync:we,rmSync:Te,rmdirSync:Ee,unlinkSync:De,renameSync:Oe,readFile:ke,writeFile:Ae,appendFile:je,stat:Me,readdir:Ne,mkdir:Pe,rm:Fe,unlink:Ie,rename:Le,exists:Re,promises:ze,mount:Be,flush:Ve,remount:He}=ge,G=ce,K=ae,q=I,J=L,Y=C,X=w,Z=T,Q=le,$={...ge,pull:G,readFileSealed:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { r as t } from "./busy-B189uX--.js";
|
|
3
3
|
import { t as n } from "./node-fs-C9ECR_9H.js";
|
|
4
|
-
import { c as r, l as i, o as a, p as o, r as s, u as c } from "./storage-
|
|
4
|
+
import { c as r, l as i, o as a, p as o, r as s, u as c } from "./storage-C6Cd4J5E.js";
|
|
5
5
|
import { a as l, i as u, n as d, o as f, t as p } from "./opfs-D0goLAQW.js";
|
|
6
6
|
//#region src/fs/hybrid.ts
|
|
7
7
|
var m = /* @__PURE__ */ e({
|
package/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./fs-Bv3aFjqA.cjs");exports.adopt=e.t,exports.adoptable=e.n,exports.appendFile=e.r,exports.appendFileSync=e.i,exports.available=e.a,exports.default=e.l,exports.exists=e.o,exports.existsSync=e.s,exports.flush=e.c,exports.lstatSync=e.d,exports.mkdir=e.f,exports.mkdirSync=e.p,exports.mount=e.m,exports.onConflict=e.h,exports.pending=e.g,exports.pendingDeletes=e._,exports.promises=e.v,exports.pull=e.y,exports.readFile=e.b,exports.readFileSealed=e.x,exports.readFileSync=e.S,exports.readdir=e.C,exports.readdirSync=e.w,exports.remount=e.T,exports.rename=e.E,exports.renameSync=e.D,exports.replicating=e.O,exports.rm=e.k,exports.rmSync=e.A,exports.rmdirSync=e.j,exports.stat=e.M,exports.statSync=e.N,exports.unlink=e.P,exports.unlinkSync=e.F,exports.writeFile=e.I,exports.writeFileSync=e.L;
|
package/fs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, v as M, w as N, x as P, y as F } from "./fs-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, v as M, w as N, x as P, y as F } from "./fs-O2bp9J0x.js";
|
|
2
2
|
export { j as adopt, E as adoptable, k as appendFile, x as appendFileSync, m as available, w as default, D as exists, A as existsSync, g as flush, _ as lstatSync, v as mkdir, O as mkdirSync, T as mount, b as onConflict, y as pending, p as pendingDeletes, M as promises, F as pull, h as readFile, P as readFileSealed, d as readFileSync, t as readdir, N as readdirSync, f as remount, r as rename, n as renameSync, l as replicating, C as rm, e as rmSync, S as rmdirSync, s as stat, c as statSync, u as unlink, i as unlinkSync, a as writeFile, o as writeFileSync };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region ../web-extension/lib/lib/locator-permissions.js
|
|
2
|
+
var e = {
|
|
3
|
+
scope: "read.text",
|
|
4
|
+
category: "storage",
|
|
5
|
+
severity: 1,
|
|
6
|
+
chip: "read text",
|
|
7
|
+
title: "Read text from the page",
|
|
8
|
+
description: "Lets the app see the text shown on this page."
|
|
9
|
+
}, t = {
|
|
10
|
+
scope: "read.info",
|
|
11
|
+
category: "storage",
|
|
12
|
+
severity: 1,
|
|
13
|
+
chip: "read details",
|
|
14
|
+
title: "Read info from the page",
|
|
15
|
+
description: "Lets the app read a detail of a part of the page."
|
|
16
|
+
}, n = {
|
|
17
|
+
scope: "read.visible",
|
|
18
|
+
category: "storage",
|
|
19
|
+
severity: 0,
|
|
20
|
+
title: "See what’s visible on the page",
|
|
21
|
+
description: "Lets the app check which elements are currently on screen."
|
|
22
|
+
}, r = {
|
|
23
|
+
scope: "read.check",
|
|
24
|
+
category: "storage",
|
|
25
|
+
severity: 0,
|
|
26
|
+
title: "Check if something is on the page",
|
|
27
|
+
description: "Lets the app test whether a specific element exists."
|
|
28
|
+
}, i = {
|
|
29
|
+
scope: "read.count",
|
|
30
|
+
category: "storage",
|
|
31
|
+
severity: 0,
|
|
32
|
+
title: "Count items on the page",
|
|
33
|
+
description: "Lets the app count how many matching elements are present."
|
|
34
|
+
}, a = {
|
|
35
|
+
scope: "act.click",
|
|
36
|
+
category: "interaction",
|
|
37
|
+
severity: 3,
|
|
38
|
+
chip: "click",
|
|
39
|
+
title: "Click on the page",
|
|
40
|
+
description: "Lets the app press buttons or links for you."
|
|
41
|
+
}, o = {
|
|
42
|
+
scope: "act.type",
|
|
43
|
+
category: "interaction",
|
|
44
|
+
severity: 1,
|
|
45
|
+
chip: "type",
|
|
46
|
+
title: "Type into a text field",
|
|
47
|
+
description: "Lets the app fill in form fields on your behalf."
|
|
48
|
+
}, s = {
|
|
49
|
+
scope: "act.hover",
|
|
50
|
+
category: "interaction",
|
|
51
|
+
severity: 1,
|
|
52
|
+
chip: "hover",
|
|
53
|
+
title: "Hover over the page",
|
|
54
|
+
description: "Lets the app point at things to reveal menus or tooltips."
|
|
55
|
+
}, c = {
|
|
56
|
+
scope: "media.video",
|
|
57
|
+
category: "interaction",
|
|
58
|
+
severity: 0,
|
|
59
|
+
title: "Control video playback",
|
|
60
|
+
description: "Lets the app play, pause, seek, and read the video on the page."
|
|
61
|
+
}, l = {
|
|
62
|
+
scope: "media.appear",
|
|
63
|
+
category: "interaction",
|
|
64
|
+
severity: 0,
|
|
65
|
+
title: "Change page appearance",
|
|
66
|
+
description: "Lets the app restyle parts of the page (safely filtered)."
|
|
67
|
+
}, u = {
|
|
68
|
+
scope: "media.appearU",
|
|
69
|
+
category: "evaluation",
|
|
70
|
+
severity: 2,
|
|
71
|
+
chip: "unfiltered styles",
|
|
72
|
+
unsafe: !0,
|
|
73
|
+
title: "Change page appearance (unsafe)",
|
|
74
|
+
description: "Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network."
|
|
75
|
+
}, d = (e) => e?.noSanitize ? u : l, f = {
|
|
76
|
+
scope: "frame.fetchRead",
|
|
77
|
+
category: "network",
|
|
78
|
+
severity: 3,
|
|
79
|
+
chip: "load",
|
|
80
|
+
unsafe: !0,
|
|
81
|
+
title: "Read your account data on this site",
|
|
82
|
+
description: "Lets the app read pages and data from this site as you, using the session in the frame."
|
|
83
|
+
}, p = {
|
|
84
|
+
scope: "frame.fetchWrite",
|
|
85
|
+
category: "network",
|
|
86
|
+
severity: 3,
|
|
87
|
+
chip: "send",
|
|
88
|
+
unsafe: !0,
|
|
89
|
+
title: "Change your account data on this site",
|
|
90
|
+
description: "Lets the app send changes to this site as you, using the session in the frame."
|
|
91
|
+
}, m = /* @__PURE__ */ new Set([
|
|
92
|
+
"GET",
|
|
93
|
+
"HEAD",
|
|
94
|
+
"OPTIONS"
|
|
95
|
+
]), h = (e, t) => m.has((t?.method ?? "GET").toUpperCase()) ? f : p, g = {
|
|
96
|
+
click: a,
|
|
97
|
+
fill: o,
|
|
98
|
+
hover: s,
|
|
99
|
+
textContent: e,
|
|
100
|
+
getAttribute: t,
|
|
101
|
+
isVisible: n,
|
|
102
|
+
count: i,
|
|
103
|
+
exists: r,
|
|
104
|
+
videoElement: c,
|
|
105
|
+
addStyleTag: d,
|
|
106
|
+
fetch: h
|
|
107
|
+
};
|
|
108
|
+
[
|
|
109
|
+
e,
|
|
110
|
+
t,
|
|
111
|
+
n,
|
|
112
|
+
r,
|
|
113
|
+
i,
|
|
114
|
+
a,
|
|
115
|
+
o,
|
|
116
|
+
s,
|
|
117
|
+
c,
|
|
118
|
+
l,
|
|
119
|
+
u,
|
|
120
|
+
f,
|
|
121
|
+
p
|
|
122
|
+
].map((e) => e.scope);
|
|
123
|
+
var _ = g, v = (e, t) => {
|
|
124
|
+
let n = _[e];
|
|
125
|
+
return n ? (typeof n == "function" ? n(...t) : n).scope : null;
|
|
126
|
+
}, y = (e, t) => {
|
|
127
|
+
try {
|
|
128
|
+
return new URL(e, t);
|
|
129
|
+
} catch {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
}, b = (e) => {
|
|
133
|
+
let t = y(e, "https://s.invalid/"), n = y(e, "http://s.invalid/");
|
|
134
|
+
if (!t || !n) return { kind: "invalid" };
|
|
135
|
+
let r = y(e);
|
|
136
|
+
return !r || r.href !== t.href || r.href !== n.href ? { kind: "relative" } : r.protocol !== "https:" && r.protocol !== "http:" ? {
|
|
137
|
+
kind: "unsupported",
|
|
138
|
+
protocol: r.protocol
|
|
139
|
+
} : {
|
|
140
|
+
kind: "absolute",
|
|
141
|
+
host: r.hostname,
|
|
142
|
+
protocol: r.protocol
|
|
143
|
+
};
|
|
144
|
+
}, x = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/, S = /^\[[0-9a-f:.]+\]$/, C = (e) => {
|
|
145
|
+
try {
|
|
146
|
+
return new URL(`http://${e}/`).hostname;
|
|
147
|
+
} catch {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
}, w = (e, { ipv6: t = !1 } = {}) => {
|
|
151
|
+
let n = [];
|
|
152
|
+
for (let r of e) {
|
|
153
|
+
let e = r.trim().toLowerCase();
|
|
154
|
+
if (!e || e.length > 253) continue;
|
|
155
|
+
let i = x.test(e) ? e : t && S.test(e) ? C(e) : void 0;
|
|
156
|
+
i && !n.includes(i) && n.push(i);
|
|
157
|
+
}
|
|
158
|
+
return n;
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
export { n as _, l as a, b as c, c as d, v as f, e as g, t as h, o as i, f as l, i as m, a as n, u as o, r as p, s as r, h as s, w as t, p as u };
|