@fkn/lib 0.9.39 → 0.9.41
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-generation-CSnZiN18.cjs +1 -0
- package/account-generation-D7TpIoKt.js +28 -0
- package/account.cjs +1 -1
- package/account.d.ts +11 -0
- package/account.js +5 -17
- package/{api-BxXnHxbd.d.ts → api-Cbty0JUM.d.ts} +15 -13
- package/api.d.ts +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +4 -4
- package/cloud/fs.js +31 -24
- package/cloud/net.d.ts +1 -1
- package/{cloud-B8QYSmW3.d.ts → cloud-4t1WoEZn.d.ts} +3 -3
- package/{cloud-oMACx7NL.js → cloud-BLv19j-W.js} +200 -196
- package/cloud-D7aQY4GH.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +1 -1
- package/{contract-sDmsw-9f.d.ts → contract-BRc2ptdC.d.ts} +33 -10
- package/contract.d.ts +2 -2
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/extension-B9v933cT.js +89 -0
- package/extension-D2zMdc2f.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BTyRnUPI.cjs +1 -0
- package/{fs--NhtUyYa.d.ts → fs-D0MMRnHC.d.ts} +8 -4
- package/fs-q7Kg51hq.js +513 -0
- package/fs.cjs +1 -1
- package/fs.d.ts +4 -3
- package/fs.js +4 -2
- package/http.d.ts +1 -1
- package/{index-kuPqkS_-.d.ts → index-D2lvaQDs.d.ts} +28 -38
- package/index.cjs +1 -1
- package/index.d.ts +3 -3
- package/index.js +13 -13
- package/{lib-tQKlXzhv.cjs → lib-BfAg9mHD.cjs} +1 -1
- package/{lib-BlyFPeSv.js → lib-C4Eeg9eM.js} +2 -2
- package/{messages-C66ghz_A.d.ts → messages-CRcziTuC.d.ts} +17 -1
- package/messages.cjs +1 -1
- package/messages.d.ts +2 -2
- package/messages.js +2 -2
- package/{net-Qmt9L_7t.d.ts → net-CcEZP6Bb.d.ts} +2 -2
- package/net.d.ts +1 -1
- package/{node-fs-BZy9bzKd.js → node-fs-CK2wWIYS.js} +140 -137
- package/node-fs-nfX7wisL.cjs +1 -0
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-CxRQLGNG.d.ts → proxy-D6YtsO1g.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- package/storage-BS5WMO4f.cjs +1 -0
- package/storage-BVr2Rb-d.d.ts +167 -0
- package/storage-BWmGrO6a.js +123 -0
- package/cloud-BZIJFvPF.cjs +0 -1
- package/extension-Bl5ZNj0d.cjs +0 -1
- package/extension-ChZyZgAL.js +0 -89
- package/fs-CaQFRiIT.cjs +0 -1
- package/fs-D3IsGdnN.js +0 -360
- package/node-fs-BNTPsX5c.cjs +0 -1
- package/storage-BJd-mWHE.cjs +0 -1
- package/storage-DSvL-t80.js +0 -67
- package/storage-ZrY4Y4L5.d.ts +0 -88
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
import { a as WriteData
|
|
2
|
-
import { d as storage_d_exports,
|
|
3
|
-
|
|
4
|
-
type FileEntry = {
|
|
5
|
-
path: string;
|
|
6
|
-
size: number;
|
|
7
|
-
contentType: string | null;
|
|
8
|
-
updatedAt: string | null;
|
|
9
|
-
};
|
|
10
|
-
type WriteData = Blob | ArrayBuffer | Uint8Array | string;
|
|
11
|
-
type FileSystem = {
|
|
12
|
-
available: () => Promise<boolean>;
|
|
13
|
-
list: () => Promise<FileEntry[]>;
|
|
14
|
-
readFile: (path: string) => Promise<Blob>;
|
|
15
|
-
writeFile: (path: string, data: WriteData, opts?: {
|
|
16
|
-
contentType?: string;
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
remove: (path: string) => Promise<void>;
|
|
19
|
-
};
|
|
1
|
+
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions, t as Callback } from "./index-BQgZVQl7.js";
|
|
2
|
+
import { a as StorageAccountChangedError, b as PinOptions, d as captureAccount$1, g as storage_d_exports, i as SealedRead, o as StorageAccountPinUnsupportedError, p as isAccountChanged, v as FileEntry, x as WriteData$1, y as FileSystem } from "./storage-BVr2Rb-d.js";
|
|
3
|
+
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED } from "./messages-CRcziTuC.js";
|
|
20
4
|
declare namespace hybrid_d_exports {
|
|
21
|
-
export { AdoptSummary, ConflictResolution, ConflictResolver, ConflictSide, FileConflict, FileEntry, FileSystem, WriteData, adopt$1 as adopt, adoptable$1 as adoptable, available$1 as available, list, onConflict$1 as onConflict, pending$1 as pending, pendingDeletes$1 as pendingDeletes, pull$1 as pull, readFile$1 as readFile, readFileSealed$1 as readFileSealed, remove, replicating$1 as replicating, writeFile$1 as writeFile };
|
|
5
|
+
export { AdoptSummary, ConflictResolution, ConflictResolver, ConflictSide, FileConflict, FileEntry, FileSystem, WriteData$1 as WriteData, adopt$1 as adopt, adoptable$1 as adoptable, available$1 as available, captureAccount, list, onConflict$1 as onConflict, pending$1 as pending, pendingDeletes$1 as pendingDeletes, pull$1 as pull, readFile$1 as readFile, readFileSealed$1 as readFileSealed, remove, replicating$1 as replicating, writeFile$1 as writeFile };
|
|
22
6
|
}
|
|
7
|
+
declare const captureAccount: typeof captureAccount$1;
|
|
23
8
|
declare const available$1: () => Promise<boolean>;
|
|
24
9
|
declare const pending$1: () => string[];
|
|
25
10
|
declare const pendingDeletes$1: () => string[];
|
|
26
11
|
declare const replicating$1: () => boolean;
|
|
27
|
-
declare const list: () => Promise<FileEntry[]>;
|
|
28
|
-
declare const readFile$1: (path: string) => Promise<Blob>;
|
|
29
|
-
declare const readFileSealed$1: (path: string) => Promise<SealedRead>;
|
|
30
|
-
declare const writeFile$1: (path: string, data: WriteData, opts?: {
|
|
12
|
+
declare const list: (opts?: PinOptions) => Promise<FileEntry[]>;
|
|
13
|
+
declare const readFile$1: (path: string, opts?: PinOptions) => Promise<Blob>;
|
|
14
|
+
declare const readFileSealed$1: (path: string, opts?: PinOptions) => Promise<SealedRead>;
|
|
15
|
+
declare const writeFile$1: (path: string, data: WriteData$1, opts?: {
|
|
31
16
|
contentType?: string;
|
|
32
|
-
}) => Promise<void>;
|
|
33
|
-
declare const remove: (path: string) => Promise<void>;
|
|
17
|
+
} & PinOptions) => Promise<void>;
|
|
18
|
+
declare const remove: (path: string, opts?: PinOptions) => Promise<void>;
|
|
34
19
|
declare const pull$1: (path: string) => Promise<Blob>;
|
|
35
20
|
type AdoptSummary = {
|
|
36
21
|
uploaded: string[];
|
|
@@ -71,29 +56,34 @@ type FileConflict = {
|
|
|
71
56
|
* pins against a real channel. So a resolver whose answer ever crossed a realm would simply read as a
|
|
72
57
|
* merge: one redundant write, never a wrong file.
|
|
73
58
|
*/
|
|
74
|
-
type ConflictResolution = WriteData | null;
|
|
59
|
+
type ConflictResolution = WriteData$1 | null;
|
|
75
60
|
type ConflictResolver = (conflict: FileConflict) => Promise<ConflictResolution> | ConflictResolution;
|
|
76
61
|
declare const onConflict$1: (next: ConflictResolver) => (() => void);
|
|
62
|
+
/**
|
|
63
|
+
* Pushes the local files the account lacks, after what replication owes. It acts for the account
|
|
64
|
+
* this page is on when it is called: an entry queued for another account is skipped and stays queued
|
|
65
|
+
* for it, and a switch while it runs refuses the rest with `StorageAccountChangedError`.
|
|
66
|
+
*/
|
|
77
67
|
declare const adopt$1: () => Promise<AdoptSummary>;
|
|
78
68
|
declare const adoptable$1: () => Promise<{
|
|
79
69
|
paths: string[];
|
|
80
70
|
bytes: number;
|
|
81
71
|
}>;
|
|
82
72
|
declare namespace index_d_exports {
|
|
83
|
-
export { AdoptSummary, ConflictResolution, ConflictResolver, ConflictSide, FileConflict, SealedRead, Stats, adopt, adoptable, appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, lstatSync, mkdir, mkdirSync, mount, onConflict, pending, pendingDeletes, promises, pull, readFile, readFileSealed, readFileSync, readdir, readdirSync, remount, rename, renameSync, replicating, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
|
73
|
+
export { AdoptSummary, ConflictResolution, ConflictResolver, ConflictSide, FileConflict, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, SealedRead, Stats, StorageAccountChangedError, StorageAccountPinUnsupportedError, adopt, adoptable, appendFile, appendFileSync, available, _default as default, exists, existsSync, flush, isAccountChanged, lstatSync, mkdir, mkdirSync, mount, onConflict, pending, pendingDeletes, promises, pull, readFile, readFileSealed, readFileSync, readdir, readdirSync, remount, rename, renameSync, replicating, rm, rmSync, rmdirSync, stat, statSync, unlink, unlinkSync, writeFile, writeFileSync };
|
|
84
74
|
}
|
|
85
|
-
declare const available: () => Promise<boolean>, readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string, writeFileSync: (path: import("node:fs").PathLike, data: WriteData
|
|
75
|
+
declare const available: () => Promise<boolean>, readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string, writeFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void, appendFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void, existsSync: (path: import("node:fs").PathLike) => boolean, statSync: (path: import("node:fs").PathLike) => Stats, lstatSync: (path: import("node:fs").PathLike) => Stats, readdirSync: (path: import("node:fs").PathLike) => string[], mkdirSync: (path: import("node:fs").PathLike, options?: MakeOptions) => void, rmSync: (path: import("node:fs").PathLike, options?: {
|
|
86
76
|
recursive?: boolean;
|
|
87
77
|
force?: boolean;
|
|
88
78
|
}) => void, rmdirSync: (path: import("node:fs").PathLike, options?: {
|
|
89
79
|
recursive?: boolean;
|
|
90
|
-
}) => void, unlinkSync: (path: import("node:fs").PathLike) => void, renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void, readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: WriteData
|
|
80
|
+
}) => void, unlinkSync: (path: import("node:fs").PathLike) => void, renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void, readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void, writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, appendFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void, stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void, readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void, mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void, rm: (path: import("node:fs").PathLike, a: {
|
|
91
81
|
recursive?: boolean;
|
|
92
82
|
force?: boolean;
|
|
93
83
|
} | Callback<void>, b?: Callback<void>) => void, unlink: (path: import("node:fs").PathLike, callback: Callback<void>) => void, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike, callback: Callback<void>) => void, exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void, promises: {
|
|
94
84
|
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
95
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData
|
|
96
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData
|
|
85
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
86
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
97
87
|
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
98
88
|
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
99
89
|
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
|
@@ -120,8 +110,8 @@ declare const onConflict: typeof onConflict$1;
|
|
|
120
110
|
declare const _default: {
|
|
121
111
|
available: () => Promise<boolean>;
|
|
122
112
|
readFileSync: (path: import("node:fs").PathLike, options?: ReadOptions) => Buffer | string;
|
|
123
|
-
writeFileSync: (path: import("node:fs").PathLike, data: WriteData
|
|
124
|
-
appendFileSync: (path: import("node:fs").PathLike, data: WriteData
|
|
113
|
+
writeFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
114
|
+
appendFileSync: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => void;
|
|
125
115
|
existsSync: (path: import("node:fs").PathLike) => boolean;
|
|
126
116
|
statSync: (path: import("node:fs").PathLike) => Stats;
|
|
127
117
|
lstatSync: (path: import("node:fs").PathLike) => Stats;
|
|
@@ -137,8 +127,8 @@ declare const _default: {
|
|
|
137
127
|
unlinkSync: (path: import("node:fs").PathLike) => void;
|
|
138
128
|
renameSync: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => void;
|
|
139
129
|
readFile: (path: import("node:fs").PathLike, a: ReadOptions | Callback<Buffer | string>, b?: Callback<Buffer | string>) => void;
|
|
140
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData
|
|
141
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData
|
|
130
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
131
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, a: WriteOptions | Callback<void>, b?: Callback<void>) => void;
|
|
142
132
|
stat: (path: import("node:fs").PathLike, callback: Callback<Stats>) => void;
|
|
143
133
|
readdir: (path: import("node:fs").PathLike, a: unknown, b?: Callback<string[]>) => void;
|
|
144
134
|
mkdir: (path: import("node:fs").PathLike, a: MakeOptions | Callback<void>, b?: Callback<void>) => void;
|
|
@@ -151,8 +141,8 @@ declare const _default: {
|
|
|
151
141
|
exists: (path: import("node:fs").PathLike, callback: (exists: boolean) => void) => void;
|
|
152
142
|
promises: {
|
|
153
143
|
readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>;
|
|
154
|
-
writeFile: (path: import("node:fs").PathLike, data: WriteData
|
|
155
|
-
appendFile: (path: import("node:fs").PathLike, data: WriteData
|
|
144
|
+
writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
145
|
+
appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>;
|
|
156
146
|
stat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
157
147
|
lstat: (path: import("node:fs").PathLike) => Promise<Stats>;
|
|
158
148
|
readdir: (path: import("node:fs").PathLike) => Promise<string[]>;
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BfAg9mHD.cjs"),n=require("./api-jOTOA-5n.cjs"),r=require("./busy-Dv8wzE5M.cjs"),i=require("./cloud-D7aQY4GH.cjs"),a=require("./dns.cjs"),o=require("./net.cjs"),s=require("./dgram.cjs"),c=require("./http.cjs"),l=require("./extension-D2zMdc2f.cjs"),u=require("./desktop.cjs"),d=require("./fs-BTyRnUPI.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.J())return e(!0);let n,r=setTimeout(()=>i(t.J()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.J()),y)},o=new MutationObserver(()=>{t.J()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.J()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{if(t.o(e)===`window`){let n=e;return l.r()?t.a(n):i.a()?i.i(n):t.a(n)}return S(e)}),S=async e=>l.r()||e.lockdown||!i.a()||await b()?t.a(e):i.i(e),C=`https://fkn.app`,w=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let i=await n.u;if(!i)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);let a=r.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=i.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(i,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await n.a).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await n.a).relay.prompt().catch(()=>null),D=new Set,O=e=>(D.add(e),()=>{D.delete(e)}),k=()=>{if(D.size===0)return!1;for(let e of[...D])try{e()}catch{}return!0},A=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},j=e.t({applyUpdate:()=>W,busyReasons:()=>U,onUpdate:()=>R,onUpdateTaken:()=>z,updateReady:()=>M}),M=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),N=new Set,P=!1,F=()=>{P=!0;for(let e of[...N])try{e()}catch{}},I=0,L=()=>{let e=n.s();e&&N.size!==0&&I!==e.epoch&&(I=e.epoch,P=!1,Promise.resolve(e.remote.shell?.onUpdate(F)).catch(()=>{I===e.epoch&&(I=0)}))};typeof window<`u`&&n.l(L);var R=async e=>{if(typeof window>`u`)return()=>{};if(N.add(e),P)try{e()}catch{}return L(),()=>{N.delete(e)}},z=e=>typeof window>`u`?()=>{}:O(e),B=0,V=!1,H=()=>{if(!k()&&!V){V=!0;try{location.reload()}catch{}}};typeof window<`u`&&n.l(()=>{let e=n.s();if(!e||B===e.epoch)return;B=e.epoch;let t=A(e.remote.shell,H);if(!t){B=0;return}t.catch(()=>{B===e.epoch&&(B=0)})});var U=()=>r.n(),W=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.CATEGORIES=t.b,exports.EXTENSION_ABI=t.Q,exports.ExtensionOperationUnsupportedError=t.$,exports.ExtensionOutdatedError=t.et,exports.FORGEABLE_HEADERS=t.U,exports.FrameWindowBlockedError=t.f,exports.FrameWindowRefusedError=t.p,exports.LOCATOR_DENIED=t.T,exports.LOCATOR_ERROR=t.k,exports.LOCATOR_UNSUPPORTED=t.x,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.tt,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t._,exports.assertFetchableUrl=t.I,exports.assertForgeableHeaders=t.W,exports.assertLockdownApplicable=t.v,exports.assertOneCookieIdentity=t.G,exports.attachFrame=x,exports.attachFramePermission=t.m,exports.box=t.it,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return i.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.P,exports.createFrame=t.h,exports.createVideoElementHandle=t.at,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return l.t}}),exports.fetch=l.n,exports.fetchCredentialedPermission=t.R,exports.fetchLocalPermission=t.z,exports.fetchPermission=t.B,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.g,exports.handleRevivableModules=t.rt,exports.hasForgedCookie=t.K,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return c.t}}),exports.isBlockedFetchUrl=t.V,exports.isBlockedFrameUrl=t.y,exports.isExtensionExposed=t.J,exports.isLocalNetworkUrl=t.H,exports.isLocatorDenied=t.A,exports.isLocatorUnsupported=t.S,exports.isPermissionDenied=t.n,exports.isTerminalError=t.O,exports.isType=t.ot,exports.modifyRequestHeadersPermission=t.j,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=l.i,exports.promptRelay=E,exports.readCookiePermission=t.F,exports.readExtensionHandshake=t.Y,exports.relayWorker=w,exports.removeRequestHeaderRule=t.M,exports.revive=t.st,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.X,exports.setRequestHeaderRule=t.N,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.nt,exports.type=t.ct,exports.waitForExtensionExposure=t.Z;
|
package/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
2
|
import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-D2CA-NX5.js";
|
|
3
3
|
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-DMU-CwMw.js";
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-4t1WoEZn.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
|
-
import {
|
|
7
|
-
import { s as net_d_exports } from "./net-Qmt9L_7t.js";
|
|
6
|
+
import { s as net_d_exports } from "./net-CcEZP6Bb.js";
|
|
8
7
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
9
8
|
import { t as http_d_exports } from "./http.js";
|
|
10
9
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
10
|
+
import { u as index_d_exports } from "./index-D2lvaQDs.js";
|
|
11
11
|
import { t as index_d_exports$1 } from "./opfs.js";
|
|
12
12
|
import { t as packages_d_exports } from "./packages.js";
|
|
13
13
|
import { t as rooms_d_exports } from "./rooms.js";
|
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, A as n, B as r,
|
|
2
|
+
import { $ as t, A as n, B as r, F as i, G as a, H as o, I as s, J as c, K as l, M as ee, N as te, O as ne, P as re, Q as ie, R as ae, S as oe, T as se, U as u, V as d, W as ce, X as le, Y as ue, Z as de, _ as f, a as p, at as m, b as h, ct as g, et as _, f as v, g as y, h as b, i as x, it as S, j as C, k as w, m as T, n as E, nt as D, o as O, ot as k, p as A, r as j, rt as M, st as N, t as P, tt as F, v as I, x as L, y as R, z } from "./lib-C4Eeg9eM.js";
|
|
3
3
|
import { a as B, l as V, s as H, u as fe } from "./api-Dp-2AT3u.js";
|
|
4
4
|
import { n as pe, t as me } from "./busy-B189uX--.js";
|
|
5
|
-
import { a as U, i as W, n as he } from "./cloud-
|
|
5
|
+
import { a as U, i as W, n as he } from "./cloud-BLv19j-W.js";
|
|
6
6
|
import { t as ge } from "./dns.js";
|
|
7
7
|
import { t as _e } from "./net.js";
|
|
8
8
|
import { t as ve } from "./dgram.js";
|
|
9
9
|
import { t as G } from "./http.js";
|
|
10
|
-
import { i as ye, n as be, r as K, t as xe } from "./extension-
|
|
10
|
+
import { i as ye, n as be, r as K, t as xe } from "./extension-B9v933cT.js";
|
|
11
11
|
import { t as Se } from "./desktop.js";
|
|
12
|
-
import { u as Ce } from "./fs-
|
|
12
|
+
import { u as Ce } from "./fs-q7Kg51hq.js";
|
|
13
13
|
import { t as we } from "./opfs.js";
|
|
14
14
|
import { t as Te } from "./packages.js";
|
|
15
15
|
import { t as Ee } from "./rooms.js";
|
|
@@ -18,27 +18,27 @@ import { t as Oe } from "./connect-button-DtsN3X1J.js";
|
|
|
18
18
|
import { relay as ke } from "osra";
|
|
19
19
|
//#region src/frame.ts
|
|
20
20
|
var Ae = 1e4, je = 150, Me = () => new Promise((e) => {
|
|
21
|
-
if (
|
|
22
|
-
let t, n = setTimeout(() => r(
|
|
21
|
+
if (c()) return e(!0);
|
|
22
|
+
let t, n = setTimeout(() => r(c()), Ae), r = (r) => {
|
|
23
23
|
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
|
|
24
24
|
}, i = () => {
|
|
25
|
-
clearTimeout(t), t = setTimeout(() => r(
|
|
25
|
+
clearTimeout(t), t = setTimeout(() => r(c()), je);
|
|
26
26
|
}, a = new MutationObserver(() => {
|
|
27
|
-
|
|
27
|
+
c() && r(!0);
|
|
28
28
|
}), o = () => {
|
|
29
|
-
document.readyState === "complete" && !
|
|
29
|
+
document.readyState === "complete" && !c() && i();
|
|
30
30
|
};
|
|
31
31
|
a.observe(document.documentElement, {
|
|
32
32
|
attributes: !0,
|
|
33
33
|
attributeFilter: ["data-fkn-extension"]
|
|
34
34
|
}), document.addEventListener("readystatechange", o), document.readyState === "complete" && i();
|
|
35
35
|
}), Ne = (async (e) => {
|
|
36
|
-
if (
|
|
36
|
+
if (O(e) === "window") {
|
|
37
37
|
let t = e;
|
|
38
|
-
return K() ?
|
|
38
|
+
return K() ? p(t) : U() ? W(t) : p(t);
|
|
39
39
|
}
|
|
40
40
|
return Pe(e);
|
|
41
|
-
}), Pe = async (e) => K() || e.lockdown || !U() || await Me() ?
|
|
41
|
+
}), Pe = async (e) => K() || e.lockdown || !U() || await Me() ? p(e) : W(e), Fe = "https://fkn.app", Ie = async (e, t) => {
|
|
42
42
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
43
43
|
let n = await fe;
|
|
44
44
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
@@ -112,4 +112,4 @@ typeof window < "u" && V(() => {
|
|
|
112
112
|
});
|
|
113
113
|
var Je = () => pe(), Ye = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
114
114
|
//#endregion
|
|
115
|
-
export {
|
|
115
|
+
export { x as ATTACH_FRAME_EVENT_KEY, h as CATEGORIES, ie as EXTENSION_ABI, t as ExtensionOperationUnsupportedError, _ as ExtensionOutdatedError, u as FORGEABLE_HEADERS, v as FrameWindowBlockedError, A as FrameWindowRefusedError, se as LOCATOR_DENIED, w as LOCATOR_ERROR, L as LOCATOR_UNSUPPORTED, P as PERMISSION_DENIED, F as REQUIRED_EXTENSION_ABI, De as account, f as assertAttachableFrameUrl, s as assertFetchableUrl, ce as assertForgeableHeaders, I as assertLockdownApplicable, a as assertOneCookieIdentity, Ne as attachFrame, T as attachFramePermission, S as box, he as cloud, Le as connect, Oe as connectButtonUrl, re as cookies, b as createFrame, m as createVideoElementHandle, Se as desktop, ve as dgram, ge as dns, xe as extension, be as fetch, ae as fetchCredentialedPermission, z as fetchLocalPermission, r as fetchPermission, Ce as fs, y as gotoPermission, M as handleRevivableModules, l as hasForgedCookie, G as http, d as isBlockedFetchUrl, R as isBlockedFrameUrl, c as isExtensionExposed, o as isLocalNetworkUrl, n as isLocatorDenied, oe as isLocatorUnsupported, E as isPermissionDenied, ne as isTerminalError, k as isType, C as modifyRequestHeadersPermission, _e as net, we as opfs, Te as packages, j as permissions, ye as promptInstall, Re as promptRelay, i as readCookiePermission, ue as readExtensionHandshake, Ie as relayWorker, ee as removeRequestHeaderRule, N as revive, Ee as rooms, le as setMissingExtensionHandler, te as setRequestHeaderRule, He as shell, D as supportsOperation, g as type, de as waitForExtensionExposure };
|
|
@@ -50,4 +50,4 @@ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./hosts-9dYv63ud.c
|
|
|
50
50
|
`)+this.emit(this.indent(-1))+this.emit(`\n${this.indent()}}`)}declaration(e){return this.compress?this.emit(`${e.property}:${e.value}`,e.position)+this.emit(`;`):e.property===`grid-template-areas`?this.emit(this.indent())+this.emit(e.property+`: `+e.value.split(`
|
|
51
51
|
`).join(`
|
|
52
52
|
`.padEnd(22)+this.indent()),e.position)+this.emit(`;`):this.emit(this.indent())+this.emit(`${e.property}: ${e.value}`,e.position)+this.emit(`;`)}},Ge=(e,t)=>{t||={};let n=1,r=1;function i(){let e={line:n,column:r};return i=>(i.position=new He(e,{line:n,column:r},t?.source||``),u(),i)}let a=[];function o(i){let o=new Ve(t?.source||``,i,n,r,e);if(!t?.silent)throw o;a.push(o)}function s(){let t=/^{\s*/.exec(e);return!!t&&(l(t),!0)}function c(){let t=/^}/.exec(e);return!!t&&(l(t),!0)}function l(t){let i=t[0];return function(e){let t=e.match(/\n/g);t&&(n+=t.length);let i=e.lastIndexOf(`
|
|
53
|
-
`);r=~i?e.length-i:r+e.length}(i),e=e.slice(i.length),t}function u(){let t=/^\s*/.exec(e);t&&l(t)}function d(e){e||=[];let t=f();for(;t;)e.push(t),t=f();return e}function f(){let t=i();if(e.charAt(0)!==`/`||e.charAt(1)!==`*`)return;let n=/^\/\*[^]*?\*\//.exec(e);return n?(l(n),t({type:M.comment,comment:n[0].slice(2,-2)})):o(`End of comment missing`)}function p(){let t=N(e,[`{`]);if(t===-1||t===0)return;let n=e.substring(0,t);return l([n]),((e,t)=>{let n=[],r=0;for(;r<e.length;){let i=N(e,t,r);if(i===-1)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(F(n).replace(P,``),[`,`]).map(e=>F(e))}function m(){let t=i(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;l(n);let r=F(n[0]),a=/^:\s*/.exec(e);if(!a)return o(`property missing ':'`);l(a);let s=``,c=N(e,[`;`,`}`]);c!==-1&&(s=e.substring(0,c),l([s]),s=F(s).replace(P,``));let u=t({type:M.declaration,property:r.replace(P,``),value:s}),d=/^[;\s]*/.exec(e);return d&&l(d),u}function h(){let n=[];if(!s())return o(`missing '{'`);d(n);let r=m();for(;r;)n.push(r),d(n),r=m();for(;t?.silent&&e.length&&e.charAt(0)!==`}`;){let t=e.indexOf(`;`),i=e.indexOf(`}`);if(t===-1||!(i===-1||t<i))break;for(l([e.substring(0,t+1)]),u(),d(n),r=m();r;)n.push(r),d(n),r=m()}return c()?n:o(`missing '}'`)}function g(){let t=N(e,[`{`]);if(t===-1)return!1;let n=N(e,[`;`]),r=N(e,[`}`]);return!(n!==-1&&n<t)&&!(r!==-1&&r<t)}function ee(){let n=[];if(!s())return o(`missing '{'`);for(d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){n.push(e),d(n);continue}}if(g()){let e=w();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return c()?n:o(`missing '}'`)}function _(){let n=[];for(u(),d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){n.push(e),d(n);continue}}if(g()){let e=w();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return n}function v(){let t=[],n=i(),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);for(;r;){let n=l(r);t.push(n[1]);let i=/^,\s*/.exec(e);i&&l(i),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e)}if(t.length)return n({type:M.keyframe,values:t,declarations:h()||[]})}let te=RegExp(`^@(${[`top-left-corner`,`top-left`,`top-center`,`top-right`,`top-right-corner`,`bottom-left-corner`,`bottom-left`,`bottom-center`,`bottom-right`,`bottom-right-corner`,`left-top`,`left-middle`,`left-bottom`,`right-top`,`right-middle`,`right-bottom`].join(`|`)})(?![\\w-])\\s*`),y=S(`import`),b=S(`charset`),x=S(`namespace`);function S(t){let n=RegExp(`^@`+t+`\\s*((?::?[^;'"]|"(?:\\\\"|[^"])*?"|'(?:\\\\'|[^'])*?')+)(?:;|$)`);return()=>{let r=i(),a=n.exec(e);if(!a)return;let o=l(a),s={type:t};return s[t]=o[1].trim(),r(s)}}function C(){if(e[0]===`@`)return function(){let t=i(),n=/^@([-\w]+)?keyframes\s*/.exec(e);if(!n)return;let r=l(n)[1],a=/^([-\w]+)\s*/.exec(e);if(!a)return o(`@keyframes missing name`);let u=l(a)[1];if(!s())return o(`@keyframes missing '{'`);let f=d(),p=v();for(;p;)f.push(p),f=f.concat(d()),p=v();return c()?t({type:M.keyframes,name:u,vendor:r,keyframes:f}):o(`@keyframes missing '}'`)}()||function(){let t=i(),n=/^@media *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@media missing '{'`);let a=_();return c()?t({type:M.media,media:r,rules:a}):o(`@media missing '}'`)}()||function(){let t=i(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!n)return;let r=l(n);return t({type:M.customMedia,name:F(r[1]),media:F(r[2])})}()||function(){let t=i(),n=/^@supports *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@supports missing '{'`);let a=_();return c()?t({type:M.supports,supports:r,rules:a}):o(`@supports missing '}'`)}()||y()||b()||x()||function(){let t=i(),n=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!n)return;let r=l(n),a=F(r[1]),u=F(r[2]);if(!s())return o(`@document missing '{'`);let d=_();return c()?t({type:M.document,document:u,vendor:a,rules:d}):o(`@document missing '}'`)}()||function(){let t=i(),n=/^@page */.exec(e);if(!n)return;l(n);let r=p()||[];if(!s())return o(`@page missing '{'`);let a=[];for(d(a);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){a.push(e),d(a);continue}}let t=m();if(!t)break;a.push(t),d(a)}return c()?t({type:M.page,selectors:r,declarations:a}):o(`@page missing '}'`)}()||function(){let t=i(),n=/^@host\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@host missing '{'`);let r=_();return c()?t({type:M.host,rules:r}):o(`@host missing '}'`)}()||function(){let t=i(),n=/^@font-face\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@font-face missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:M.fontFace,declarations:r}):o(`@font-face missing '}'`)}()||function(){let t=i(),n=/^@font-feature-values\s+([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@font-feature-values missing '{'`);let a=_();return c()?t({type:M.fontFeatureValues,fontFamily:r,rules:a}):o(`@font-feature-values missing '}'`)}()||function(){let t=i(),n=/^@container *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@container missing '{'`);let a=_();return c()?t({type:M.container,container:r,rules:a}):o(`@container missing '}'`)}()||function(){let t=i(),n=/^@starting-style\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@starting-style missing '{'`);let r=_();return c()?t({type:M.startingStyle,rules:r}):o(`@starting-style missing '}'`)}()||function(){let t=i(),n=/^@layer *([^{;@]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s()){let n=/^[;\s]*/.exec(e);return n&&l(n),t({type:M.layer,layer:r})}let a=_();return c()?t({type:M.layer,layer:r,rules:a}):o(`@layer missing '}'`)}()||function(){let t=i(),n=/^@property\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@property missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.property,name:r,declarations:a}):o(`@property missing '}'`)}()||function(){let t=i(),n=/^@counter-style\s+([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@counter-style missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.counterStyle,name:r,declarations:a}):o(`@counter-style missing '}'`)}()||function(){let t=i(),n=/^@scope\s*([^{]*)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@scope missing '{'`);let a=_();return c()?t({type:M.scope,scope:r,rules:a}):o(`@scope missing '}'`)}()||function(){let t=i(),n=/^@view-transition\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@view-transition missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:M.viewTransition,declarations:r}):o(`@view-transition missing '}'`)}()||function(){let t=i(),n=/^@position-try\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@position-try missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.positionTry,name:r,declarations:a}):o(`@position-try missing '}'`)}()||function(){let t=i(),n=te.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@${r} missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.pageMarginBox,name:r,declarations:a}):o(`@${r} missing '}'`)}()||function(){let t=i(),n=/^@([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1],a=``,u=N(e,[`{`,`;`]);if(u!==-1&&u>0&&(a=F(e.substring(0,u)),l([e.substring(0,u)])),s()){let e=_();return c()?t({type:M.atRule,name:r,prelude:a,rules:e}):o(`@${r} missing '}'`)}let d=/^[;\s]*/.exec(e);return d&&l(d),t({type:M.atRule,name:r,prelude:a})}()}function w(){let e=i(),t=p();return t?(d(),e({type:M.rule,selectors:t,declarations:ee()||[]})):o(`selector missing`)}return I(function(){let n=function(){let n,r=[];for(u(),d(r);e.length;){if(e.charAt(0)===`}`){if(t?.silent){o(`extra '}'`),l([`}`]),u(),d(r);continue}break}if(n=C()||w(),!n){if(t?.silent){l([e.charAt(0)]),u(),d(r);continue}break}r.push(n),d(r)}return r}();return{type:M.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}}())},Ke=(e,t)=>new We(t||{}).compile(e),qe=Object.defineProperty,Je=(e,t)=>{let n={};for(var r in e)qe(n,r,{get:e[r],enumerable:!0});return t||qe(n,Symbol.toStringTag,{value:`Module`}),n},Ye=`LocatorError`,L=`LocatorUnsupportedError`,R=`LocatorDeniedError`,Xe=`LocatorInvalidError`,z=e=>typeof e==`object`&&e?e.name:void 0,B=e=>Object.assign(Error(e),{name:Ye}),V=(e,t=``,n)=>Object.assign(Error(e),{name:L,operation:t,backend:n}),Ze=(e,t)=>V(`Locator operation not supported${t?` on the ${t} backend`:``}: ${e}`,e,t),H=(e,t)=>Object.assign(Error(e),{name:R,operation:t}),U=(e,t)=>Object.assign(Error(e),{name:Xe,operation:t}),Qe=e=>z(e)===L,$e=e=>z(e)===R,et=e=>z(e)===Xe,tt=e=>$e(e)||Qe(e)||et(e),W=e=>{let t=(e.ownerDocument??e).defaultView;if(!t)throw B(`the resolved element belongs to a document with no window`);return t},nt=(e,t)=>{let n=e?.[t];return typeof n==`function`?n:null},G=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=(()=>{try{return nt(W(e),t)}catch{return null}})();if(n&&e instanceof n)return n;let r=nt(globalThis,t);return r&&e instanceof r?r:null},K=(e,t)=>G(e,t)!==null,q=e=>{if(e.length===0)throw B(`No elements found`);if(e.length>1)throw B(`Strict mode violation: locator resolved to ${e.length} elements`);return e[0]},rt=(e,t)=>{if(!K(e,t))throw B(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);return e},it=e=>e.tagName.toLowerCase(),at=new Set,ot=e=>{at.add(e)},st=/(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i,ct=e=>e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\(.)/g,`$1`),lt=e=>!st.test(ct(e.value)),ut=new Set([M.import,M.fontFace,M.namespace,M.charset,M.document,M.comment]),dt=e=>{if(ut.has(e.type))return null;if(e.type===M.declaration)return lt(e)?e:null;let t=e,n={...t};for(let e of[`declarations`,`rules`,`keyframes`]){let r=t[e];Array.isArray(r)&&(n[e]=ft(r))}return n},ft=e=>e.map(e=>dt(e)).filter(e=>e!==null),pt=e=>{let t;try{t=Ge(e,{silent:!0})}catch{return``}return t.stylesheet.rules=ft(t.stylesheet.rules),Ke(t)},mt=(e,t)=>{let n=()=>{t.parentNode||(e.head??e.documentElement).appendChild(t)};if(n(),e.readyState===`complete`)return;let r=new MutationObserver(e=>{for(let r of e)for(let e of r.removedNodes)if(e===t||e.contains?.(t)){n();return}});r.observe(e.documentElement,{childList:!0,subtree:!0});let i=()=>r.disconnect(),a=e.defaultView;a?a.addEventListener(`load`,i,{once:!0}):setTimeout(i,3e4)},ht={resolve:(e,t)=>{let n=e.document.createElement(`style`);n.textContent=t.noSanitize?t.content:pt(t.content);try{mt(e.document,n)}catch(e){console.error(e)}ot(n)}},gt=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},J={kind:`frame`,ensureArgs:e=>[void 0,e],resolve:async(e,t,n={})=>{if(typeof t!=`string`)throw U(`fetch: url must be a string`,`fetch`);let r=W(e.document),i;try{i=new r.URL(t,e.document.baseURI).href}catch{throw U(`fetch: not a valid url: ${t}`,`fetch`)}let a=await r.fetch(i,{method:n.method??`GET`,headers:n.headers,body:n.body??null,redirect:n.redirect??`follow`,credentials:n.credentials??`include`});return{status:a.status,statusText:a.statusText,ok:a.ok,url:a.url,redirected:a.redirected,type:a.type,headers:gt(a.headers),body:await a.arrayBuffer()}}},Y=Je({click:()=>vt,count:()=>Et,exists:()=>Dt,fill:()=>St,getAttribute:()=>wt,hover:()=>yt,isVisible:()=>Tt,textContent:()=>Ct}),_t=(e,t)=>{let n=e.getBoundingClientRect();return{clientX:n.left+n.width*(t?.x??.5),clientY:n.top+n.height*(t?.y??.5)}},vt={resolve:(e,t={})=>{let n=q(e.elements),r=W(n),i={bubbles:!0,cancelable:!0,composed:!0,..._t(n,t.position),button:0},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerdown`,{...a,buttons:1})),n.dispatchEvent(new r.MouseEvent(`mousedown`,{...i,buttons:1})),n.dispatchEvent(new r.PointerEvent(`pointerup`,{...a,buttons:0})),n.dispatchEvent(new r.MouseEvent(`mouseup`,{...i,buttons:0})),n.dispatchEvent(new r.MouseEvent(`click`,{...i,buttons:0}))}},yt={resolve:(e,t={})=>{let n=q(e.elements),r=W(n),i={bubbles:!0,cancelable:!0,composed:!0,..._t(n,t.position)},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerover`,a)),n.dispatchEvent(new r.PointerEvent(`pointerenter`,{...a,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseenter`,{...i,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseover`,i)),n.dispatchEvent(new r.PointerEvent(`pointermove`,a)),n.dispatchEvent(new r.MouseEvent(`mousemove`,i))}},bt=(e,t)=>{e._valueTracker?.setValue(``);let n=(G(e,`HTMLTextAreaElement`)??G(e,`HTMLInputElement`))?.prototype,r=n&&Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t},xt=(e,t)=>{if(e.type!==`range`)return null;let n=Number(e.min||0),r=Number(e.max||100);if(!Number.isFinite(n)||!Number.isFinite(r)||r<=n)return null;let i=Number(t);if(!Number.isFinite(i))return null;let a=Math.max(0,Math.min(1,(i-n)/(r-n))),o=e.getBoundingClientRect(),s={bubbles:!0,cancelable:!0,composed:!0,clientX:o.left+o.width*a,clientY:o.top+o.height/2,button:0},c={...s,pointerType:`mouse`,pointerId:1,isPrimary:!0};return{pointerDown:{...c,buttons:1},pointerUp:{...c,buttons:0},mouseDown:{...s,buttons:1},mouseUp:{...s,buttons:0}}},St={resolve:(e,t,n={})=>{let r=q(e.elements),i=W(r),a=K(r,`HTMLInputElement`);if(a||K(r,`HTMLTextAreaElement`)){let e=r,n=a?xt(e,t):null;n&&(r.dispatchEvent(new i.PointerEvent(`pointerdown`,n.pointerDown)),r.dispatchEvent(new i.MouseEvent(`mousedown`,n.mouseDown))),bt(e,t),r.dispatchEvent(new i.Event(`input`,{bubbles:!0})),n&&(r.dispatchEvent(new i.PointerEvent(`pointerup`,n.pointerUp)),r.dispatchEvent(new i.MouseEvent(`mouseup`,n.mouseUp))),r.dispatchEvent(new i.Event(`change`,{bubbles:!0}));return}if(K(r,`HTMLElement`)&&r.isContentEditable){r.textContent=t,r.dispatchEvent(new i.Event(`input`,{bubbles:!0}));return}throw Error(`fill: element <${it(r)}> is not fillable`)}},Ct={resolve:(e,t={})=>q(e.elements).textContent},wt={resolve:(e,t,n={})=>q(e.elements).getAttribute(t)},Tt={resolve:(e,t={})=>{let n=q(e.elements);if(!K(n,`HTMLElement`))return!0;let r=W(n).getComputedStyle(n);if(r?.display===`none`||r?.visibility===`hidden`)return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0}},Et={resolve:(e,t={})=>e.elements.length},Dt={resolve:(e,t={})=>e.elements.length>0},X=(e,t)=>e.elements.flatMap(e=>[...e.querySelectorAll(t)]),Z=e=>e.replaceAll(`"`,`\\"`),Ot={to:`element`,css:!0,resolve:(e,t)=>X(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`descend`})},kt={to:`frame`,css:!0,barrier:`down`,resolve:(e,t)=>X(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`down`})},At={element:{selectors:{locator:Ot,frameLocator:kt,getByRole:{to:`element`,resolve:(e,t)=>X(e,`[role="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[role="${Z(e)}"]`:`[role]`})},getByText:{to:`element`,resolve:(e,t)=>e.elements.flatMap(e=>[e,...e.querySelectorAll(`*`)]).filter(e=>e.textContent?.includes(t)),render:e=>({fragment:typeof e==`string`?`:has-text("${Z(e)}")`:`:has-text(...)`})},getByTestId:{to:`element`,resolve:(e,t)=>X(e,`[data-testid="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[data-testid="${Z(e)}"]`:`[data-testid]`})},first:{to:`element`,resolve:e=>e.elements.slice(0,1),render:()=>({fragment:`:first`})},nth:{to:`element`,resolve:(e,t)=>{let n=e.elements.at(t);return n?[n]:[]},render:e=>({fragment:typeof e==`number`?`:nth(${e})`:`:nth(?)`})}},operations:{click:vt,fill:St,hover:yt,textContent:Ct,getAttribute:wt,isVisible:Tt,count:Et,exists:Dt}},frame:{selectors:{locator:Ot,frameLocator:kt,owner:{to:`frame`,barrier:`up`,resolve:e=>{throw Error(`owner: must be processed by the executor as an upward pivot`)},render:()=>({fragment:``,separator:`up`})}},operations:{addStyleTag:ht,fetch:J}}},jt=(e,t=At)=>({element:{selectors:{...t.element.selectors,...e.element?.selectors},operations:{...t.element.operations,...e.element?.operations}},frame:{selectors:{...t.frame.selectors,...e.frame?.selectors},operations:{...t.frame.operations,...e.frame?.operations}}}),Mt=3e4,Nt=50,Pt=e=>{let t=e[e.length-1];return typeof t==`object`&&t?t:void 0},Ft=e=>{let t=Pt(e)?.timeout;return typeof t==`number`?t:Mt},It=({executor:e,parts:t})=>({highlight:n=>e.highlight(t,n).then(()=>{},()=>{})}),Lt=async e=>{let t={parts:e.parts,operation:e.operation,args:e.args,phase:`ensure`};await e.gate?.(t,It(e))},Rt=async e=>{let{executor:t,gate:n,parts:r,operation:i,args:a}=e;n&&await n({parts:r,operation:i,args:a,phase:`execute`},It(e));let o=Ft(a),s=Date.now()+o,c=Error(`Locator timeout (${o}ms): ${i}`),{promise:l,reject:u}=Promise.withResolvers();l.catch(()=>{});let d=setTimeout(()=>u(c),o),f=c;try{for(;Date.now()<s;)try{return await Promise.race([t.execute(r,i,a),l])}catch(e){if(e===c)break;if(tt(e))throw e;f=e;let t=s-Date.now();if(t<=0)break;await new Promise(e=>setTimeout(e,Math.min(Nt,t)))}}finally{clearTimeout(d)}throw f},zt=(e,t,n,r)=>{let i={};for(let[a,o]of Object.entries(t[n].selectors))i[a]=(...i)=>zt(e,t,o.to,[...r,{kind:n,name:a,args:i}]);for(let a of Object.keys(t[n].operations))i[a]=(...t)=>Rt({...e,parts:r,operation:a,args:t});return i.ensure=(i,a={})=>{let o=t[n].operations[i]?.ensureArgs;return Lt({...e,parts:r,operation:i,args:o?.(a)??[a]})},i},Bt=e=>zt(e,e.modules??At,`frame`,[]),Vt=()=>{let e=D();return e.status===`ok`&&e.abi>=2},Ht=async()=>{await k();let e=D();if(e.status===`ok`&&e.abi<2)throw new T(e.abi,2)},Ut=e=>`Read the text, links and details ${e} shows.`,Wt=e=>`Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`,Gt=[{id:`interaction`,heading:`Interaction`,summary:`Allow the app to interact with the website (clicks, type in text, etc.)`,title:e=>`Interact with ${e}`,description:(e,t)=>t?`Click, type and hover on ${e} for you. If you are signed in there, this happens as you.`:`Click, type and hover on ${e} for you, in a signed-out view.`,cloudTitle:e=>`Click and type on ${e}`,cloudDescription:e=>`Clicks, types and scrolls on ${e} for you.`},{id:`storage`,heading:`Site data`,summary:`Can read the website's data`,title:e=>`Read data from ${e}`,description:Ut,cloudTitle:e=>`Read what's on ${e}`,cloudDescription:Ut},{id:`network`,heading:`Network`,summary:`Make requests on behalf of the website (using your cookies, etc.)`,title:e=>`Make requests to ${e} as you`,description:e=>`Load pages and data from ${e} and send changes there with your signed-in session.`,cloudTitle:e=>`Load and send data on ${e}`,cloudDescription:e=>`Loads pages and data from ${e} and sends changes there.`},{id:`evaluation`,heading:`Evaluation`,summary:`Can execute arbitrary code on the website`,title:e=>`Run code on ${e}`,description:Wt,cloudTitle:e=>`Run its own code on ${e}`,cloudDescription:Wt}],Kt=jt({element:{operations:{click:{resolve:(e,t={})=>Y.click.resolve(e,t)},hover:{resolve:(e,t={})=>Y.hover.resolve(e,t)},fill:{resolve:(e,t,n={})=>Y.fill.resolve(e,t,n)},textContent:{resolve:(e,t={})=>Y.textContent.resolve(e)},getAttribute:{resolve:(e,t,n={})=>Y.getAttribute.resolve(e,t)},isVisible:{resolve:(e,t={})=>Y.isVisible.resolve(e)},count:{resolve:(e,t={})=>Y.count.resolve(e)},exists:{resolve:(e,t={})=>Y.exists.resolve(e)},videoElement:{resolve:(e,t={})=>b(rt(q(e.elements),`HTMLVideoElement`))}}},frame:{operations:{addStyleTag:{resolve:(e,t)=>ht.resolve(e,t)},fetch:{resolve:(e,t,n={})=>J.resolve(e,t,n),kind:J.kind,ensureArgs:J.ensureArgs},evaluate:{kind:`frame`,resolve:(e,t,n)=>{throw Ze(`evaluate`,`this realm`)}}}}}),qt=e=>{if(!e||e===`about:blank`)return!1;let t;try{t=new URL(e,location.href)}catch{return!1}return t.protocol===`chrome-extension:`||t.protocol===`moz-extension:`||t.protocol!==`about:`&&Ee(t.hostname)},Q=e=>{if(qt(e))throw Error(`attachFrame: refusing to target the extension's own pages or an FKN platform origin`)},Jt=({src:e,domains:t,lockdown:n})=>{if(n&&!t.length&&e&&e!==`about:blank`)throw Error(`attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto`)},Yt={scope:`embed.iframe`,category:`interaction`,severity:0,title:`Load another website inside this app`,description:`Lets the app embed external pages directly inside its own view.`},Xt={scope:`embed.open`,category:`interaction`,severity:0,title:`Open a website inside this app`,description:`Lets the app navigate to another site without leaving its window.`},Zt=class extends Error{name=`FrameWindowBlockedError`;constructor(){super(`attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page`)}},Qt=new Set([`jar-unreachable`,`bad-url`,`opaque-opener`]),$t=class extends Error{name=`FrameWindowRefusedError`;reason;constructor(e){let t=Qt.has(e)?e:`unknown`;super(t===`opaque-opener`?`attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened`:`attachFrame: the window refused to attach (${t}), and loaded nothing`),this.reason=t}},en=[`message`,`document`],tn=e=>{if(e===`*`)return`*`;let t=()=>TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);if(typeof e!=`string`)throw t();let n;try{n=new URL(e).origin}catch{throw t()}if(n===`null`)throw t();return n},nn=(e,t)=>{let n=typeof e==`object`&&!!e;if(n&&t!==void 0)throw TypeError(`frame.postMessage: pass transfer inside the options object, not after it`);let r=n?e.targetOrigin??`*`:e??`*`,i=n?e.transfer:t;if(i!==void 0&&!Array.isArray(i))throw TypeError(`frame.postMessage: transfer must be an array`);return{targetOrigin:tn(r),transfer:i===void 0?[]:[...i]}},rn=e=>{typeof globalThis.reportError==`function`?globalThis.reportError(e):console.error(e)},an=e=>{let t=Bt({executor:e.executor,modules:Kt,gate:e.gate}),n=(t,n={})=>(Q(t),e.goto(t,n)),r=()=>e.url(),i=async t=>{let n=e.request;if(!n)throw Error(`frame.request: this backend cannot ask for permission categories`);return n(t)},a=async(t,n)=>{let r=e.evaluate;if(!r)throw Error(`frame.evaluate: this backend cannot run code in the attached frame`);let i=typeof t==`function`?t.toString():t;if(typeof i!=`string`)throw TypeError(`frame.evaluate: pass a function or a source string`);return r(i,n)},o=((t,n,r)=>{try{let i=e.postMessage;if(!i)throw Error(`frame.postMessage: this backend cannot message the attached frame`);let a=nn(n,r);return i(t,a.targetOrigin,a.transfer)}catch(e){return Promise.reject(e)}}),s={message:new Set,document:new Set},c=null,l=(e,t)=>{if(!en.includes(e))throw TypeError(`frame.${t}: the event type must be ${en.map(e=>`'${e}'`).join(` or `)}, not ${JSON.stringify(e)}`);return s[e]},u=e=>{let t=e.type===`message`?Object.freeze({type:`message`,data:e.data,origin:e.origin,ports:Object.freeze([...e.ports]),source:p}):Object.freeze({type:`document`,origin:e.origin});for(let n of[...s[e.type]])try{n(t)}catch(e){rn(e)}},d=(e,t)=>{if(l(e,`removeEventListener`).delete(t),c!==null&&!s.message.size&&!s.document.size){let e=c;c=null,e()}},f=(t,n,r={})=>{let i=l(t,`addEventListener`);if(typeof n!=`function`)throw TypeError(`frame.addEventListener: the listener must be a function`);let{signal:a}=r;if(!(a?.aborted||i.has(n))){if(c===null){let t=e.listen;if(!t)throw Error(`frame.addEventListener: this backend cannot relay the page's messages`);c=t(u)}i.add(n),a?.addEventListener(`abort`,()=>d(t,n),{once:!0})}},p={...t,goto:n,url:r,request:i,evaluate:a,postMessage:o,addEventListener:f,removeEventListener:d};return p},on=[t.v,t._,t.y,t.h,t.g,t.n,t.i,t.r,t.f,t.a,t.o,t.s,t.p,Yt,Xt,t.u,t.d,De,Oe,ke,Ie,Re],sn=Gt.map(e=>e.id),cn={interaction:`act.click`,storage:`read.text`,network:`network.fetchCredentialed`,evaluation:`media.appearU`},ln=e=>e===0?`auto`:e===4?`critical`:`bundled`,un=on,$=new Map,dn={};(()=>{$=new Map(un.map(e=>[e.scope,e])),dn=Object.fromEntries($),un.filter(e=>e.severity===4).map(e=>e.scope);let e=e=>un.filter(t=>t.category===e&&ln(t.severity)===`bundled`);Object.fromEntries(sn.map(t=>[t,Math.max(0,...e(t).map(e=>e.severity))])),Object.fromEntries(sn.map(t=>[t,e(t).some(e=>e.unsafe===!0)]))})();var fn=e=>$.get(e)?.category,pn=e=>{let t=$.get(e);return t&&ln(t.severity)},mn=e=>{let t=$.get(e);if(t)return ln(t.severity)===`critical`?t.scope:t.category},hn=e=>cn[e],gn=({category:e,key:t})=>{let n=t??(e&&hn(e));return n!==void 0&&fn(n)!==void 0?n:void 0},_n=(e,t)=>{for(let{category:n,key:r}of t)if(gn({category:n,key:r})===void 0)throw TypeError(r===void 0?n===void 0?`${e}: name a category or a permission key`:`${e}: unknown permission category "${n}"`:`${e}: unknown permission key "${r}"`)},vn=(e,t={})=>{let n=[],r=e.map(e=>{let r=gn(e),i=[];if(r!==void 0)for(let a of e.hosts)i.push(n.length),n.push({...t,key:r,scope:``,site:a,hosts:e.hosts,reason:e.reason});return{key:r!==void 0&&pn(r)===`critical`?r:void 0,category:e.category??(r===void 0?`interaction`:dn[r].category),hosts:e.hosts,indexes:i}});return{items:n,answer:e=>r.map(({key:t,category:n,hosts:r,indexes:i})=>({category:n,...t===void 0?{}:{key:t},hosts:r,allow:i.length>0&&i.every(t=>e[t]?.allow===!0)}))}},yn=e=>typeof e==`object`&&!!e,bn=typeof chrome<`u`&&!!chrome.runtime?.id,xn=e=>yn(e)&&e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY===!0&&typeof e.frameId==`string`&&typeof e.document==`string`,Sn=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tn=new Set;typeof window<`u`&&bn&&window.addEventListener(`message`,e=>{if(!xn(e.data))return;e.stopImmediatePropagation();let t=e.source;if(!t||typeof t!=`object`)return;let n=t,r=Sn.get(n),i=e.data.frameId,a=e.data.document;if(Sn.set(n,i),Cn.set(n,a),r)for(let e of Tn)e(r);let o=wn.get(n);if(o){for(let e of[...o])(e.notDocument===void 0||e.notDocument!==a)&&(o.delete(e),e.resolve(i));o.size||wn.delete(n)}},{capture:!0});var En=e=>{let t=e;if(t.window===void 0)return`iframe`;if(t.iframe!==void 0)throw TypeError(`attachFrame: pass either iframe or window, not both`);if(t.lockdown)throw TypeError(`attachFrame: lockdown applies to an iframe, never to a window`);if(typeof t.window!=`object`||t.window===null)throw TypeError(`attachFrame: window must be an object`);return`window`},Dn=(e,t,n)=>{if(e===void 0)return t;if(typeof e!=`number`||!Number.isFinite(e)||e<=0)throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);return Math.round(e)},On=({url:e,width:t,height:n})=>{let r=(()=>{if(e===void 0||e===``||e===`about:blank`)return``;if(typeof e!=`string`)throw TypeError(`attachFrame: window.url must be a string`);let t=(()=>{try{return new URL(e,location.href)}catch{throw TypeError(`attachFrame: window.url is not a valid URL: ${e}`)}})();if(t.protocol!==`http:`&&t.protocol!==`https:`)throw TypeError(`attachFrame: window.url must be an http or https address`);return t.href})();return r&&Q(r),{url:r,width:Dn(t,500,`width`),height:Dn(n,700,`height`)}},kn=e=>{try{return new URL(e).hostname}catch{return``}},An=`FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY`,jn=!1,Mn=()=>{jn||(jn=!0,console.warn(`[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this.`))},Nn=`frame: this frame no longer holds the document the app attached it to`,Pn=`frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin`,Fn=()=>{let e=D();if(e.status===`ok`&&e.abi>=1)return;let t=e.status===`absent`?0:e.abi;throw new E(`lockdown`,t,`attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`)},In=e=>{try{return new URL(e,location.href).hostname}catch{return``}},Ln=async({iframe:e,domains:n=[],syncCookies:r=!0,lockdown:i=!1,permissions:a})=>{let o=crypto.randomUUID();if(Q(e.src),Jt({src:e.src,domains:n,lockdown:i}),await k(),i&&Fn(),!e.isConnected)throw Error(`attachFrame: the iframe must be connected to the document before attaching`);e.dispatchEvent(new CustomEvent(An,{detail:o}));let{executeLocator:s,highlightLocator:c,ensureLocatorPermission:l,requestCategories:u,evaluateFrame:d,goto:f}=await A.attachFrame({marker:o,domains:n,syncCookies:r,lockdown:i}),p=new Set(t.t([...n,In(e.src)],{ipv6:!0})),m=e=>p.has(t.t([kn(e)],{ipv6:!0})[0]??``),h=an({executor:{execute:s,highlight:c},gate:e=>l(e.parts,e.operation,e.args),request:async e=>(_n(`frame.request`,e),await Ht(),u(e)),evaluate:async(e,t)=>{if(!fe(D(),`evaluate`)){let e=D();throw new E(`evaluate`,e.status===`ok`?e.abi:0)}return d({source:e,arg:t})},postMessage:(t,n,r)=>{if(n===`*`)throw V(Pn,`postMessage`,`extension`);if(!m(n))throw H(Nn,`postMessage`);let i=e.contentWindow;if(i===null)throw H(`frame: navigate the frame before postMessage`,`postMessage`);return i.postMessage(t,n,r),Promise.resolve()},listen:t=>{let n=n=>{n.source!==null&&n.source===e.contentWindow&&!xn(n.data)&&m(n.origin)&&t({type:`message`,data:n.data,origin:n.origin,ports:n.ports})},r=()=>t({type:`document`,origin:``});return window.addEventListener(`message`,n),e.addEventListener(`load`,r),()=>{window.removeEventListener(`message`,n),e.removeEventListener(`load`,r)}},goto:(e,n={})=>{for(let n of t.t([In(e)],{ipv6:!0}))p.add(n);return f({url:e,...n})},url:()=>e.src});return a?.length&&(Vt()?await h.request(a):Mn()),h},Rn=`attachFrame: window mode is served by the cloud backend for now, whatever extension is installed. Use cloud.attachFrame({ window })`,zn=async e=>{if(On(e.window),e.syncCookies===!1)throw TypeError(`attachFrame: syncCookies false does not apply to an extension window, which is the site's own first-party tab`);let t=D();throw new E(`attachWindow`,t.status===`absent`?0:t.abi,Rn)},Bn=(async e=>En(e)===`window`?zn(e):Ln(e)),Vn=`permissions.request: pass hosts, the sites the grant applies to`,Hn={request:async e=>{let n=e.map(e=>{let{category:n,key:r,scope:i,reason:a,hosts:o}=e;if(!(`hosts`in e)&&!(`category`in e))return{legacy:{key:r,scope:i??``,reason:a}};let s=t.t(o??[],{ipv6:!0});if(!s.length)throw TypeError(Vn);return{ask:{category:n,key:r,reason:a,hosts:s}}}),r=n.flatMap(e=>`ask`in e?[e.ask]:[]);_n(`permissions.request`,r),r.length&&await Ht();let{items:i,answer:a}=vn(r),o=n.flatMap(e=>`legacy`in e?[e.legacy]:[]),s=[...i,...o],c=s.length?await A.requestPermissions(s):[],l=a(c.slice(0,i.length)),u=c.slice(i.length),d=0,f=0;return n.map(e=>`ask`in e?l[d++]:u[f++])}},Un=`PermissionDeniedError`,Wn=e=>e instanceof Error?e.name===Un:yn(e)&&e.name===`PermissionDeniedError`;Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return De}});
|
|
53
|
+
`);r=~i?e.length-i:r+e.length}(i),e=e.slice(i.length),t}function u(){let t=/^\s*/.exec(e);t&&l(t)}function d(e){e||=[];let t=f();for(;t;)e.push(t),t=f();return e}function f(){let t=i();if(e.charAt(0)!==`/`||e.charAt(1)!==`*`)return;let n=/^\/\*[^]*?\*\//.exec(e);return n?(l(n),t({type:M.comment,comment:n[0].slice(2,-2)})):o(`End of comment missing`)}function p(){let t=N(e,[`{`]);if(t===-1||t===0)return;let n=e.substring(0,t);return l([n]),((e,t)=>{let n=[],r=0;for(;r<e.length;){let i=N(e,t,r);if(i===-1)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(F(n).replace(P,``),[`,`]).map(e=>F(e))}function m(){let t=i(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;l(n);let r=F(n[0]),a=/^:\s*/.exec(e);if(!a)return o(`property missing ':'`);l(a);let s=``,c=N(e,[`;`,`}`]);c!==-1&&(s=e.substring(0,c),l([s]),s=F(s).replace(P,``));let u=t({type:M.declaration,property:r.replace(P,``),value:s}),d=/^[;\s]*/.exec(e);return d&&l(d),u}function h(){let n=[];if(!s())return o(`missing '{'`);d(n);let r=m();for(;r;)n.push(r),d(n),r=m();for(;t?.silent&&e.length&&e.charAt(0)!==`}`;){let t=e.indexOf(`;`),i=e.indexOf(`}`);if(t===-1||!(i===-1||t<i))break;for(l([e.substring(0,t+1)]),u(),d(n),r=m();r;)n.push(r),d(n),r=m()}return c()?n:o(`missing '}'`)}function g(){let t=N(e,[`{`]);if(t===-1)return!1;let n=N(e,[`;`]),r=N(e,[`}`]);return!(n!==-1&&n<t)&&!(r!==-1&&r<t)}function ee(){let n=[];if(!s())return o(`missing '{'`);for(d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){n.push(e),d(n);continue}}if(g()){let e=w();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return c()?n:o(`missing '}'`)}function _(){let n=[];for(u(),d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){n.push(e),d(n);continue}}if(g()){let e=w();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return n}function v(){let t=[],n=i(),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);for(;r;){let n=l(r);t.push(n[1]);let i=/^,\s*/.exec(e);i&&l(i),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e)}if(t.length)return n({type:M.keyframe,values:t,declarations:h()||[]})}let te=RegExp(`^@(${[`top-left-corner`,`top-left`,`top-center`,`top-right`,`top-right-corner`,`bottom-left-corner`,`bottom-left`,`bottom-center`,`bottom-right`,`bottom-right-corner`,`left-top`,`left-middle`,`left-bottom`,`right-top`,`right-middle`,`right-bottom`].join(`|`)})(?![\\w-])\\s*`),y=S(`import`),b=S(`charset`),x=S(`namespace`);function S(t){let n=RegExp(`^@`+t+`\\s*((?::?[^;'"]|"(?:\\\\"|[^"])*?"|'(?:\\\\'|[^'])*?')+)(?:;|$)`);return()=>{let r=i(),a=n.exec(e);if(!a)return;let o=l(a),s={type:t};return s[t]=o[1].trim(),r(s)}}function C(){if(e[0]===`@`)return function(){let t=i(),n=/^@([-\w]+)?keyframes\s*/.exec(e);if(!n)return;let r=l(n)[1],a=/^([-\w]+)\s*/.exec(e);if(!a)return o(`@keyframes missing name`);let u=l(a)[1];if(!s())return o(`@keyframes missing '{'`);let f=d(),p=v();for(;p;)f.push(p),f=f.concat(d()),p=v();return c()?t({type:M.keyframes,name:u,vendor:r,keyframes:f}):o(`@keyframes missing '}'`)}()||function(){let t=i(),n=/^@media *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@media missing '{'`);let a=_();return c()?t({type:M.media,media:r,rules:a}):o(`@media missing '}'`)}()||function(){let t=i(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!n)return;let r=l(n);return t({type:M.customMedia,name:F(r[1]),media:F(r[2])})}()||function(){let t=i(),n=/^@supports *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@supports missing '{'`);let a=_();return c()?t({type:M.supports,supports:r,rules:a}):o(`@supports missing '}'`)}()||y()||b()||x()||function(){let t=i(),n=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!n)return;let r=l(n),a=F(r[1]),u=F(r[2]);if(!s())return o(`@document missing '{'`);let d=_();return c()?t({type:M.document,document:u,vendor:a,rules:d}):o(`@document missing '}'`)}()||function(){let t=i(),n=/^@page */.exec(e);if(!n)return;l(n);let r=p()||[];if(!s())return o(`@page missing '{'`);let a=[];for(d(a);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=C();if(e){a.push(e),d(a);continue}}let t=m();if(!t)break;a.push(t),d(a)}return c()?t({type:M.page,selectors:r,declarations:a}):o(`@page missing '}'`)}()||function(){let t=i(),n=/^@host\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@host missing '{'`);let r=_();return c()?t({type:M.host,rules:r}):o(`@host missing '}'`)}()||function(){let t=i(),n=/^@font-face\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@font-face missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:M.fontFace,declarations:r}):o(`@font-face missing '}'`)}()||function(){let t=i(),n=/^@font-feature-values\s+([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@font-feature-values missing '{'`);let a=_();return c()?t({type:M.fontFeatureValues,fontFamily:r,rules:a}):o(`@font-feature-values missing '}'`)}()||function(){let t=i(),n=/^@container *([^{]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@container missing '{'`);let a=_();return c()?t({type:M.container,container:r,rules:a}):o(`@container missing '}'`)}()||function(){let t=i(),n=/^@starting-style\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@starting-style missing '{'`);let r=_();return c()?t({type:M.startingStyle,rules:r}):o(`@starting-style missing '}'`)}()||function(){let t=i(),n=/^@layer *([^{;@]+)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s()){let n=/^[;\s]*/.exec(e);return n&&l(n),t({type:M.layer,layer:r})}let a=_();return c()?t({type:M.layer,layer:r,rules:a}):o(`@layer missing '}'`)}()||function(){let t=i(),n=/^@property\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@property missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.property,name:r,declarations:a}):o(`@property missing '}'`)}()||function(){let t=i(),n=/^@counter-style\s+([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@counter-style missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.counterStyle,name:r,declarations:a}):o(`@counter-style missing '}'`)}()||function(){let t=i(),n=/^@scope\s*([^{]*)/.exec(e);if(!n)return;let r=F(l(n)[1]);if(!s())return o(`@scope missing '{'`);let a=_();return c()?t({type:M.scope,scope:r,rules:a}):o(`@scope missing '}'`)}()||function(){let t=i(),n=/^@view-transition\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@view-transition missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:M.viewTransition,declarations:r}):o(`@view-transition missing '}'`)}()||function(){let t=i(),n=/^@position-try\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@position-try missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.positionTry,name:r,declarations:a}):o(`@position-try missing '}'`)}()||function(){let t=i(),n=te.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@${r} missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:M.pageMarginBox,name:r,declarations:a}):o(`@${r} missing '}'`)}()||function(){let t=i(),n=/^@([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1],a=``,u=N(e,[`{`,`;`]);if(u!==-1&&u>0&&(a=F(e.substring(0,u)),l([e.substring(0,u)])),s()){let e=_();return c()?t({type:M.atRule,name:r,prelude:a,rules:e}):o(`@${r} missing '}'`)}let d=/^[;\s]*/.exec(e);return d&&l(d),t({type:M.atRule,name:r,prelude:a})}()}function w(){let e=i(),t=p();return t?(d(),e({type:M.rule,selectors:t,declarations:ee()||[]})):o(`selector missing`)}return I(function(){let n=function(){let n,r=[];for(u(),d(r);e.length;){if(e.charAt(0)===`}`){if(t?.silent){o(`extra '}'`),l([`}`]),u(),d(r);continue}break}if(n=C()||w(),!n){if(t?.silent){l([e.charAt(0)]),u(),d(r);continue}break}r.push(n),d(r)}return r}();return{type:M.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}}())},Ke=(e,t)=>new We(t||{}).compile(e),qe=Object.defineProperty,Je=(e,t)=>{let n={};for(var r in e)qe(n,r,{get:e[r],enumerable:!0});return t||qe(n,Symbol.toStringTag,{value:`Module`}),n},Ye=`LocatorError`,L=`LocatorUnsupportedError`,R=`LocatorDeniedError`,Xe=`LocatorInvalidError`,z=e=>typeof e==`object`&&e?e.name:void 0,B=e=>Object.assign(Error(e),{name:Ye}),V=(e,t=``,n)=>Object.assign(Error(e),{name:L,operation:t,backend:n}),Ze=(e,t)=>V(`Locator operation not supported${t?` on the ${t} backend`:``}: ${e}`,e,t),H=(e,t)=>Object.assign(Error(e),{name:R,operation:t}),U=(e,t)=>Object.assign(Error(e),{name:Xe,operation:t}),Qe=e=>z(e)===L,$e=e=>z(e)===R,et=e=>z(e)===Xe,tt=e=>$e(e)||Qe(e)||et(e),W=e=>{let t=(e.ownerDocument??e).defaultView;if(!t)throw B(`the resolved element belongs to a document with no window`);return t},nt=(e,t)=>{let n=e?.[t];return typeof n==`function`?n:null},G=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=(()=>{try{return nt(W(e),t)}catch{return null}})();if(n&&e instanceof n)return n;let r=nt(globalThis,t);return r&&e instanceof r?r:null},K=(e,t)=>G(e,t)!==null,q=e=>{if(e.length===0)throw B(`No elements found`);if(e.length>1)throw B(`Strict mode violation: locator resolved to ${e.length} elements`);return e[0]},rt=(e,t)=>{if(!K(e,t))throw B(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);return e},it=e=>e.tagName.toLowerCase(),at=new Set,ot=e=>{at.add(e)},st=/(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i,ct=e=>e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\(.)/g,`$1`),lt=e=>!st.test(ct(e.value)),ut=new Set([M.import,M.fontFace,M.namespace,M.charset,M.document,M.comment]),dt=e=>{if(ut.has(e.type))return null;if(e.type===M.declaration)return lt(e)?e:null;let t=e,n={...t};for(let e of[`declarations`,`rules`,`keyframes`]){let r=t[e];Array.isArray(r)&&(n[e]=ft(r))}return n},ft=e=>e.map(e=>dt(e)).filter(e=>e!==null),pt=e=>{let t;try{t=Ge(e,{silent:!0})}catch{return``}return t.stylesheet.rules=ft(t.stylesheet.rules),Ke(t)},mt=(e,t)=>{let n=()=>{t.parentNode||(e.head??e.documentElement).appendChild(t)};if(n(),e.readyState===`complete`)return;let r=new MutationObserver(e=>{for(let r of e)for(let e of r.removedNodes)if(e===t||e.contains?.(t)){n();return}});r.observe(e.documentElement,{childList:!0,subtree:!0});let i=()=>r.disconnect(),a=e.defaultView;a?a.addEventListener(`load`,i,{once:!0}):setTimeout(i,3e4)},ht={resolve:(e,t)=>{let n=e.document.createElement(`style`);n.textContent=t.noSanitize?t.content:pt(t.content);try{mt(e.document,n)}catch(e){console.error(e)}ot(n)}},gt=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},J={kind:`frame`,ensureArgs:e=>[void 0,e],resolve:async(e,t,n={})=>{if(typeof t!=`string`)throw U(`fetch: url must be a string`,`fetch`);let r=W(e.document),i;try{i=new r.URL(t,e.document.baseURI).href}catch{throw U(`fetch: not a valid url: ${t}`,`fetch`)}let a=await r.fetch(i,{method:n.method??`GET`,headers:n.headers,body:n.body??null,redirect:n.redirect??`follow`,credentials:n.credentials??`include`});return{status:a.status,statusText:a.statusText,ok:a.ok,url:a.url,redirected:a.redirected,type:a.type,headers:gt(a.headers),body:await a.arrayBuffer()}}},Y=Je({click:()=>vt,count:()=>Et,exists:()=>Dt,fill:()=>St,getAttribute:()=>wt,hover:()=>yt,isVisible:()=>Tt,textContent:()=>Ct}),_t=(e,t)=>{let n=e.getBoundingClientRect();return{clientX:n.left+n.width*(t?.x??.5),clientY:n.top+n.height*(t?.y??.5)}},vt={resolve:(e,t={})=>{let n=q(e.elements),r=W(n),i={bubbles:!0,cancelable:!0,composed:!0,..._t(n,t.position),button:0},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerdown`,{...a,buttons:1})),n.dispatchEvent(new r.MouseEvent(`mousedown`,{...i,buttons:1})),n.dispatchEvent(new r.PointerEvent(`pointerup`,{...a,buttons:0})),n.dispatchEvent(new r.MouseEvent(`mouseup`,{...i,buttons:0})),n.dispatchEvent(new r.MouseEvent(`click`,{...i,buttons:0}))}},yt={resolve:(e,t={})=>{let n=q(e.elements),r=W(n),i={bubbles:!0,cancelable:!0,composed:!0,..._t(n,t.position)},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerover`,a)),n.dispatchEvent(new r.PointerEvent(`pointerenter`,{...a,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseenter`,{...i,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseover`,i)),n.dispatchEvent(new r.PointerEvent(`pointermove`,a)),n.dispatchEvent(new r.MouseEvent(`mousemove`,i))}},bt=(e,t)=>{e._valueTracker?.setValue(``);let n=(G(e,`HTMLTextAreaElement`)??G(e,`HTMLInputElement`))?.prototype,r=n&&Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t},xt=(e,t)=>{if(e.type!==`range`)return null;let n=Number(e.min||0),r=Number(e.max||100);if(!Number.isFinite(n)||!Number.isFinite(r)||r<=n)return null;let i=Number(t);if(!Number.isFinite(i))return null;let a=Math.max(0,Math.min(1,(i-n)/(r-n))),o=e.getBoundingClientRect(),s={bubbles:!0,cancelable:!0,composed:!0,clientX:o.left+o.width*a,clientY:o.top+o.height/2,button:0},c={...s,pointerType:`mouse`,pointerId:1,isPrimary:!0};return{pointerDown:{...c,buttons:1},pointerUp:{...c,buttons:0},mouseDown:{...s,buttons:1},mouseUp:{...s,buttons:0}}},St={resolve:(e,t,n={})=>{let r=q(e.elements),i=W(r),a=K(r,`HTMLInputElement`);if(a||K(r,`HTMLTextAreaElement`)){let e=r,n=a?xt(e,t):null;n&&(r.dispatchEvent(new i.PointerEvent(`pointerdown`,n.pointerDown)),r.dispatchEvent(new i.MouseEvent(`mousedown`,n.mouseDown))),bt(e,t),r.dispatchEvent(new i.Event(`input`,{bubbles:!0})),n&&(r.dispatchEvent(new i.PointerEvent(`pointerup`,n.pointerUp)),r.dispatchEvent(new i.MouseEvent(`mouseup`,n.mouseUp))),r.dispatchEvent(new i.Event(`change`,{bubbles:!0}));return}if(K(r,`HTMLElement`)&&r.isContentEditable){r.textContent=t,r.dispatchEvent(new i.Event(`input`,{bubbles:!0}));return}throw Error(`fill: element <${it(r)}> is not fillable`)}},Ct={resolve:(e,t={})=>q(e.elements).textContent},wt={resolve:(e,t,n={})=>q(e.elements).getAttribute(t)},Tt={resolve:(e,t={})=>{let n=q(e.elements);if(!K(n,`HTMLElement`))return!0;let r=W(n).getComputedStyle(n);if(r?.display===`none`||r?.visibility===`hidden`)return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0}},Et={resolve:(e,t={})=>e.elements.length},Dt={resolve:(e,t={})=>e.elements.length>0},X=(e,t)=>e.elements.flatMap(e=>[...e.querySelectorAll(t)]),Z=e=>e.replaceAll(`"`,`\\"`),Ot={to:`element`,css:!0,resolve:(e,t)=>X(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`descend`})},kt={to:`frame`,css:!0,barrier:`down`,resolve:(e,t)=>X(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`down`})},At={element:{selectors:{locator:Ot,frameLocator:kt,getByRole:{to:`element`,resolve:(e,t)=>X(e,`[role="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[role="${Z(e)}"]`:`[role]`})},getByText:{to:`element`,resolve:(e,t)=>e.elements.flatMap(e=>[e,...e.querySelectorAll(`*`)]).filter(e=>e.textContent?.includes(t)),render:e=>({fragment:typeof e==`string`?`:has-text("${Z(e)}")`:`:has-text(...)`})},getByTestId:{to:`element`,resolve:(e,t)=>X(e,`[data-testid="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[data-testid="${Z(e)}"]`:`[data-testid]`})},first:{to:`element`,resolve:e=>e.elements.slice(0,1),render:()=>({fragment:`:first`})},nth:{to:`element`,resolve:(e,t)=>{let n=e.elements.at(t);return n?[n]:[]},render:e=>({fragment:typeof e==`number`?`:nth(${e})`:`:nth(?)`})}},operations:{click:vt,fill:St,hover:yt,textContent:Ct,getAttribute:wt,isVisible:Tt,count:Et,exists:Dt}},frame:{selectors:{locator:Ot,frameLocator:kt,owner:{to:`frame`,barrier:`up`,resolve:e=>{throw Error(`owner: must be processed by the executor as an upward pivot`)},render:()=>({fragment:``,separator:`up`})}},operations:{addStyleTag:ht,fetch:J}}},jt=(e,t=At)=>({element:{selectors:{...t.element.selectors,...e.element?.selectors},operations:{...t.element.operations,...e.element?.operations}},frame:{selectors:{...t.frame.selectors,...e.frame?.selectors},operations:{...t.frame.operations,...e.frame?.operations}}}),Mt=3e4,Nt=50,Pt=e=>{let t=e[e.length-1];return typeof t==`object`&&t?t:void 0},Ft=e=>{let t=Pt(e)?.timeout;return typeof t==`number`?t:Mt},It=({executor:e,parts:t})=>({highlight:n=>e.highlight(t,n).then(()=>{},()=>{})}),Lt=async e=>{let t={parts:e.parts,operation:e.operation,args:e.args,phase:`ensure`};await e.gate?.(t,It(e))},Rt=async e=>{let{executor:t,gate:n,parts:r,operation:i,args:a}=e;n&&await n({parts:r,operation:i,args:a,phase:`execute`},It(e));let o=Ft(a),s=Date.now()+o,c=Error(`Locator timeout (${o}ms): ${i}`),{promise:l,reject:u}=Promise.withResolvers();l.catch(()=>{});let d=setTimeout(()=>u(c),o),f=c;try{for(;Date.now()<s;)try{return await Promise.race([t.execute(r,i,a),l])}catch(e){if(e===c)break;if(tt(e))throw e;f=e;let t=s-Date.now();if(t<=0)break;await new Promise(e=>setTimeout(e,Math.min(Nt,t)))}}finally{clearTimeout(d)}throw f},zt=(e,t,n,r)=>{let i={};for(let[a,o]of Object.entries(t[n].selectors))i[a]=(...i)=>zt(e,t,o.to,[...r,{kind:n,name:a,args:i}]);for(let a of Object.keys(t[n].operations))i[a]=(...t)=>Rt({...e,parts:r,operation:a,args:t});return i.ensure=(i,a={})=>{let o=t[n].operations[i]?.ensureArgs;return Lt({...e,parts:r,operation:i,args:o?.(a)??[a]})},i},Bt=e=>zt(e,e.modules??At,`frame`,[]),Vt=()=>{let e=D();return e.status===`ok`&&e.abi>=2},Ht=async()=>{await k();let e=D();if(e.status===`ok`&&e.abi<2)throw new T(e.abi,2)},Ut=e=>`Read the text, links and details ${e} shows.`,Wt=e=>`Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`,Gt=[{id:`interaction`,heading:`Interaction`,summary:`Allow the app to interact with the website (clicks, type in text, etc.)`,title:e=>`Interact with ${e}`,description:(e,t)=>t?`Click, type and hover on ${e} for you. If you are signed in there, this happens as you.`:`Click, type and hover on ${e} for you, in a signed-out view.`,cloudTitle:e=>`Click and type on ${e}`,cloudDescription:e=>`Clicks, types and scrolls on ${e} for you.`},{id:`storage`,heading:`Site data`,summary:`Can read the website's data`,title:e=>`Read data from ${e}`,description:Ut,cloudTitle:e=>`Read what's on ${e}`,cloudDescription:Ut},{id:`network`,heading:`Network`,summary:`Make requests on behalf of the website (using your cookies, etc.)`,title:e=>`Make requests to ${e} as you`,description:e=>`Load pages and data from ${e} and send changes there with your signed-in session.`,cloudTitle:e=>`Load and send data on ${e}`,cloudDescription:e=>`Loads pages and data from ${e} and sends changes there.`},{id:`evaluation`,heading:`Evaluation`,summary:`Can execute arbitrary code on the website`,title:e=>`Run code on ${e}`,description:Wt,cloudTitle:e=>`Run its own code on ${e}`,cloudDescription:Wt}],Kt=jt({element:{operations:{click:{resolve:(e,t={})=>Y.click.resolve(e,t)},hover:{resolve:(e,t={})=>Y.hover.resolve(e,t)},fill:{resolve:(e,t,n={})=>Y.fill.resolve(e,t,n)},textContent:{resolve:(e,t={})=>Y.textContent.resolve(e)},getAttribute:{resolve:(e,t,n={})=>Y.getAttribute.resolve(e,t)},isVisible:{resolve:(e,t={})=>Y.isVisible.resolve(e)},count:{resolve:(e,t={})=>Y.count.resolve(e)},exists:{resolve:(e,t={})=>Y.exists.resolve(e)},videoElement:{resolve:(e,t={})=>b(rt(q(e.elements),`HTMLVideoElement`))}}},frame:{operations:{addStyleTag:{resolve:(e,t)=>ht.resolve(e,t)},fetch:{resolve:(e,t,n={})=>J.resolve(e,t,n),kind:J.kind,ensureArgs:J.ensureArgs},evaluate:{kind:`frame`,resolve:(e,t,n)=>{throw Ze(`evaluate`,`this realm`)}}}}}),qt=e=>{if(!e||e===`about:blank`)return!1;let t;try{t=new URL(e,location.href)}catch{return!1}return t.protocol===`chrome-extension:`||t.protocol===`moz-extension:`||t.protocol!==`about:`&&Ee(t.hostname)},Q=e=>{if(qt(e))throw Error(`attachFrame: refusing to target the extension's own pages or an FKN platform origin`)},Jt=({src:e,domains:t,lockdown:n})=>{if(n&&!t.length&&e&&e!==`about:blank`)throw Error(`attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto`)},Yt={scope:`embed.iframe`,category:`interaction`,severity:0,title:`Load another website inside this app`,description:`Lets the app embed external pages directly inside its own view.`},Xt={scope:`embed.open`,category:`interaction`,severity:0,title:`Open a website inside this app`,description:`Lets the app navigate to another site without leaving its window.`},Zt=class extends Error{name=`FrameWindowBlockedError`;constructor(){super(`attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page`)}},Qt=new Set([`jar-unreachable`,`bad-url`,`opaque-opener`]),$t=class extends Error{name=`FrameWindowRefusedError`;reason;constructor(e){let t=Qt.has(e)?e:`unknown`;super(t===`opaque-opener`?`attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened`:`attachFrame: the window refused to attach (${t}), and loaded nothing`),this.reason=t}},en=[`message`,`document`],tn=e=>{if(e===`*`)return`*`;let t=()=>TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);if(typeof e!=`string`)throw t();let n;try{n=new URL(e).origin}catch{throw t()}if(n===`null`)throw t();return n},nn=(e,t)=>{let n=typeof e==`object`&&!!e;if(n&&t!==void 0)throw TypeError(`frame.postMessage: pass transfer inside the options object, not after it`);let r=n?e.targetOrigin??`*`:e??`*`,i=n?e.transfer:t;if(i!==void 0&&!Array.isArray(i))throw TypeError(`frame.postMessage: transfer must be an array`);return{targetOrigin:tn(r),transfer:i===void 0?[]:[...i]}},rn=e=>{typeof globalThis.reportError==`function`?globalThis.reportError(e):console.error(e)},an=e=>{let t=Bt({executor:e.executor,modules:Kt,gate:e.gate}),n=(t,n={})=>(Q(t),e.goto(t,n)),r=()=>e.url(),i=async t=>{let n=e.request;if(!n)throw Error(`frame.request: this backend cannot ask for permission categories`);return n(t)},a=async(t,n)=>{let r=e.evaluate;if(!r)throw Error(`frame.evaluate: this backend cannot run code in the attached frame`);let i=typeof t==`function`?t.toString():t;if(typeof i!=`string`)throw TypeError(`frame.evaluate: pass a function or a source string`);return r(i,n)},o=((t,n,r)=>{try{let i=e.postMessage;if(!i)throw Error(`frame.postMessage: this backend cannot message the attached frame`);let a=nn(n,r);return i(t,a.targetOrigin,a.transfer)}catch(e){return Promise.reject(e)}}),s={message:new Set,document:new Set},c=null,l=(e,t)=>{if(!en.includes(e))throw TypeError(`frame.${t}: the event type must be ${en.map(e=>`'${e}'`).join(` or `)}, not ${JSON.stringify(e)}`);return s[e]},u=e=>{let t=e.type===`message`?Object.freeze({type:`message`,data:e.data,origin:e.origin,ports:Object.freeze([...e.ports]),source:p}):Object.freeze({type:`document`,origin:e.origin});for(let n of[...s[e.type]])try{n(t)}catch(e){rn(e)}},d=(e,t)=>{if(l(e,`removeEventListener`).delete(t),c!==null&&!s.message.size&&!s.document.size){let e=c;c=null,e()}},f=(t,n,r={})=>{let i=l(t,`addEventListener`);if(typeof n!=`function`)throw TypeError(`frame.addEventListener: the listener must be a function`);let{signal:a}=r;if(!(a?.aborted||i.has(n))){if(c===null){let t=e.listen;if(!t)throw Error(`frame.addEventListener: this backend cannot relay the page's messages`);c=t(u)}i.add(n),a?.addEventListener(`abort`,()=>d(t,n),{once:!0})}},p={...t,goto:n,url:r,request:i,evaluate:a,postMessage:o,addEventListener:f,removeEventListener:d};return p},on=[t.v,t._,t.y,t.h,t.g,t.n,t.i,t.r,t.f,t.a,t.o,t.s,t.p,Yt,Xt,t.u,t.d,De,Oe,ke,Ie,Re],sn=Gt.map(e=>e.id),cn={interaction:`act.click`,storage:`read.text`,network:`network.fetchCredentialed`,evaluation:`media.appearU`},ln=e=>e===0?`auto`:e===4?`critical`:`bundled`,un=on,$=new Map,dn={};(()=>{$=new Map(un.map(e=>[e.scope,e])),dn=Object.fromEntries($),un.filter(e=>e.severity===4).map(e=>e.scope);let e=e=>un.filter(t=>t.category===e&&ln(t.severity)===`bundled`);Object.fromEntries(sn.map(t=>[t,Math.max(0,...e(t).map(e=>e.severity))])),Object.fromEntries(sn.map(t=>[t,e(t).some(e=>e.unsafe===!0)]))})();var fn=e=>$.get(e)?.category,pn=e=>{let t=$.get(e);return t&&ln(t.severity)},mn=e=>{let t=$.get(e);if(t)return ln(t.severity)===`critical`?t.scope:t.category},hn=e=>cn[e],gn=({category:e,key:t})=>{let n=t??(e&&hn(e));return n!==void 0&&fn(n)!==void 0?n:void 0},_n=(e,t)=>{for(let{category:n,key:r}of t)if(gn({category:n,key:r})===void 0)throw TypeError(r===void 0?n===void 0?`${e}: name a category or a permission key`:`${e}: unknown permission category "${n}"`:`${e}: unknown permission key "${r}"`)},vn=(e,t={})=>{let n=[],r=e.map(e=>{let r=gn(e),i=[];if(r!==void 0)for(let a of e.hosts)i.push(n.length),n.push({...t,key:r,scope:``,site:a,hosts:e.hosts,reason:e.reason});return{key:r!==void 0&&pn(r)===`critical`?r:void 0,category:r===void 0?e.category??`interaction`:dn[r].category,hosts:e.hosts,indexes:i}});return{items:n,answer:e=>r.map(({key:t,category:n,hosts:r,indexes:i})=>({category:n,...t===void 0?{}:{key:t},hosts:r,allow:i.length>0&&i.every(t=>e[t]?.allow===!0)}))}},yn=e=>typeof e==`object`&&!!e,bn=typeof chrome<`u`&&!!chrome.runtime?.id,xn=e=>yn(e)&&e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY===!0&&typeof e.frameId==`string`&&typeof e.document==`string`,Sn=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tn=new Set;typeof window<`u`&&bn&&window.addEventListener(`message`,e=>{if(!xn(e.data))return;e.stopImmediatePropagation();let t=e.source;if(!t||typeof t!=`object`)return;let n=t,r=Sn.get(n),i=e.data.frameId,a=e.data.document;if(Sn.set(n,i),Cn.set(n,a),r)for(let e of Tn)e(r);let o=wn.get(n);if(o){for(let e of[...o])(e.notDocument===void 0||e.notDocument!==a)&&(o.delete(e),e.resolve(i));o.size||wn.delete(n)}},{capture:!0});var En=e=>{let t=e;if(t.window===void 0)return`iframe`;if(t.iframe!==void 0)throw TypeError(`attachFrame: pass either iframe or window, not both`);if(t.lockdown)throw TypeError(`attachFrame: lockdown applies to an iframe, never to a window`);if(typeof t.window!=`object`||t.window===null)throw TypeError(`attachFrame: window must be an object`);return`window`},Dn=(e,t,n)=>{if(e===void 0)return t;if(typeof e!=`number`||!Number.isFinite(e)||e<=0)throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);return Math.round(e)},On=({url:e,width:t,height:n})=>{let r=(()=>{if(e===void 0||e===``||e===`about:blank`)return``;if(typeof e!=`string`)throw TypeError(`attachFrame: window.url must be a string`);let t=(()=>{try{return new URL(e,location.href)}catch{throw TypeError(`attachFrame: window.url is not a valid URL: ${e}`)}})();if(t.protocol!==`http:`&&t.protocol!==`https:`)throw TypeError(`attachFrame: window.url must be an http or https address`);return t.href})();return r&&Q(r),{url:r,width:Dn(t,500,`width`),height:Dn(n,700,`height`)}},kn=e=>{try{return new URL(e).hostname}catch{return``}},An=`FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY`,jn=!1,Mn=()=>{jn||(jn=!0,console.warn(`[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this.`))},Nn=`frame: this frame no longer holds the document the app attached it to`,Pn=`frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin`,Fn=()=>{let e=D();if(e.status===`ok`&&e.abi>=1)return;let t=e.status===`absent`?0:e.abi;throw new E(`lockdown`,t,`attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`)},In=e=>{try{return new URL(e,location.href).hostname}catch{return``}},Ln=async({iframe:e,domains:n=[],syncCookies:r=!0,lockdown:i=!1,permissions:a})=>{let o=crypto.randomUUID();if(Q(e.src),Jt({src:e.src,domains:n,lockdown:i}),await k(),i&&Fn(),!e.isConnected)throw Error(`attachFrame: the iframe must be connected to the document before attaching`);e.dispatchEvent(new CustomEvent(An,{detail:o}));let{executeLocator:s,highlightLocator:c,ensureLocatorPermission:l,requestCategories:u,evaluateFrame:d,goto:f}=await A.attachFrame({marker:o,domains:n,syncCookies:r,lockdown:i}),p=new Set(t.t([...n,In(e.src)],{ipv6:!0})),m=e=>p.has(t.t([kn(e)],{ipv6:!0})[0]??``),h=an({executor:{execute:s,highlight:c},gate:e=>l(e.parts,e.operation,e.args),request:async e=>(_n(`frame.request`,e),await Ht(),u(e)),evaluate:async(e,t)=>{if(!fe(D(),`evaluate`)){let e=D();throw new E(`evaluate`,e.status===`ok`?e.abi:0)}return d({source:e,arg:t})},postMessage:(t,n,r)=>{if(n===`*`)throw V(Pn,`postMessage`,`extension`);if(!m(n))throw H(Nn,`postMessage`);let i=e.contentWindow;if(i===null)throw H(`frame: navigate the frame before postMessage`,`postMessage`);return i.postMessage(t,n,r),Promise.resolve()},listen:t=>{let n=n=>{n.source!==null&&n.source===e.contentWindow&&!xn(n.data)&&m(n.origin)&&t({type:`message`,data:n.data,origin:n.origin,ports:n.ports})},r=()=>t({type:`document`,origin:``});return window.addEventListener(`message`,n),e.addEventListener(`load`,r),()=>{window.removeEventListener(`message`,n),e.removeEventListener(`load`,r)}},goto:(e,n={})=>{for(let n of t.t([In(e)],{ipv6:!0}))p.add(n);return f({url:e,...n})},url:()=>e.src});return a?.length&&(Vt()?await h.request(a):Mn()),h},Rn=`attachFrame: window mode is served by the cloud backend for now, whatever extension is installed. Use cloud.attachFrame({ window })`,zn=async e=>{if(On(e.window),e.syncCookies===!1)throw TypeError(`attachFrame: syncCookies false does not apply to an extension window, which is the site's own first-party tab`);let t=D();throw new E(`attachWindow`,t.status===`absent`?0:t.abi,Rn)},Bn=(async e=>En(e)===`window`?zn(e):Ln(e)),Vn=`permissions.request: pass hosts, the sites the grant applies to`,Hn={request:async e=>{let n=e.map(e=>{let{category:n,key:r,scope:i,reason:a,hosts:o}=e;if(!(`hosts`in e)&&!(`category`in e))return{legacy:{key:r,scope:i??``,reason:a}};let s=t.t(o??[],{ipv6:!0});if(!s.length)throw TypeError(Vn);return{ask:{category:n,key:r,reason:a,hosts:s}}}),r=n.flatMap(e=>`ask`in e?[e.ask]:[]);_n(`permissions.request`,r),r.length&&await Ht();let{items:i,answer:a}=vn(r),o=n.flatMap(e=>`legacy`in e?[e.legacy]:[]),s=[...i,...o],c=s.length?await A.requestPermissions(s):[],l=a(c.slice(0,i.length)),u=c.slice(i.length),d=0,f=0;return n.map(e=>`ask`in e?l[d++]:u[f++])}},Un=`PermissionDeniedError`,Wn=e=>e instanceof Error?e.name===Un:yn(e)&&e.name===`PermissionDeniedError`;Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return ke}});
|
|
@@ -1838,7 +1838,7 @@ var jn = (e) => $.get(e)?.category, Mn = (e) => {
|
|
|
1838
1838
|
});
|
|
1839
1839
|
return {
|
|
1840
1840
|
key: r !== void 0 && Mn(r) === "critical" ? r : void 0,
|
|
1841
|
-
category:
|
|
1841
|
+
category: r === void 0 ? e.category ?? "interaction" : An[r].category,
|
|
1842
1842
|
hosts: e.hosts,
|
|
1843
1843
|
indexes: i
|
|
1844
1844
|
};
|
|
@@ -2006,4 +2006,4 @@ var Gn = (e) => {
|
|
|
2006
2006
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2007
2007
|
} }, cr = "PermissionDeniedError", lr = (e) => e instanceof Error ? e.name === cr : Rn(e) && e.name === "PermissionDeniedError";
|
|
2008
2008
|
//#endregion
|
|
2009
|
-
export {
|
|
2009
|
+
export { E as $, yt as A, qe as B, H as C, B as D, _t as E, nt as F, He as G, Ze as H, $e as I, Fe as J, Ve as K, tt as L, ot as M, at as N, xt as O, rt as P, xe as Q, Je as R, vt as S, L as T, A as U, Qe as V, Ue as W, Le as X, D as Y, O as Z, Z as _, ar as a, w as at, fn as b, In as c, S as ct, Mn as d, T as et, vn as f, _n as g, Tn as h, Yn as i, ve as it, it as j, ht as k, jn as l, gn as m, lr as n, Ae as nt, Gn as o, _e as ot, bn as p, Pe as q, sr as r, be as rt, qn as s, ye as st, cr as t, Se as tt, Nn as u, hn as v, V as w, I as x, mn as y, Ye as z };
|
|
@@ -26,5 +26,21 @@ declare const STORAGE_NOT_FOUND = "FKN_STORAGE_NOT_FOUND";
|
|
|
26
26
|
* same-realm callers, which is the cheaper test when it is available.
|
|
27
27
|
*/
|
|
28
28
|
declare const STORAGE_UNREACHABLE = "FKN_API_UNREACHABLE";
|
|
29
|
+
/**
|
|
30
|
+
* The account pin's refusals, as message prefixes the broker throws, for the same reason as the e2e
|
|
31
|
+
* messages above: osra keeps an Error's message and strips its code across the SharedWorker hop.
|
|
32
|
+
*
|
|
33
|
+
* `ACCOUNT_CHANGED_MESSAGE`: the api refused a call because the signed-in account is not the one its
|
|
34
|
+
* pin was taken under. `ACCOUNT_PIN_INVALID_MESSAGE`: the api could not read the pin at all.
|
|
35
|
+
* `ACCOUNT_PIN_UNSUPPORTED_MESSAGE`: some hop (the broker document or its shared worker) is older than
|
|
36
|
+
* the pin, so the call was refused rather than sent unpinned. None of the three is a sign-out.
|
|
37
|
+
*/
|
|
38
|
+
declare const ACCOUNT_CHANGED_MESSAGE = "fkn:account-changed";
|
|
39
|
+
declare const ACCOUNT_PIN_INVALID_MESSAGE = "fkn:account-pin-invalid";
|
|
40
|
+
declare const ACCOUNT_PIN_UNSUPPORTED_MESSAGE = "fkn:account-pin-unsupported";
|
|
41
|
+
/** The code of `StorageAccountChangedError`: a call made under one account was refused under another. */
|
|
42
|
+
declare const STORAGE_ACCOUNT_CHANGED = "FKN_ACCOUNT_CHANGED";
|
|
43
|
+
/** The code of `StorageAccountPinUnsupportedError`: the broker cannot pin calls, so none was sent. */
|
|
44
|
+
declare const STORAGE_ACCOUNT_PIN_UNSUPPORTED = "FKN_ACCOUNT_PIN_UNSUPPORTED";
|
|
29
45
|
//#endregion
|
|
30
|
-
export {
|
|
46
|
+
export { E2E_LOCKED_MESSAGE as a, STORAGE_ACCOUNT_CHANGED as c, STORAGE_UNREACHABLE as d, E2E_INTEGRITY_MESSAGE as i, STORAGE_ACCOUNT_PIN_UNSUPPORTED as l, ACCOUNT_PIN_INVALID_MESSAGE as n, E2E_RETIRED_FORMAT_MESSAGE as o, ACCOUNT_PIN_UNSUPPORTED_MESSAGE as r, E2E_STALE_EPOCH_MESSAGE as s, ACCOUNT_CHANGED_MESSAGE as t, STORAGE_NOT_FOUND as u };
|
package/messages.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn:e2e-locked`,t=`fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset`,n=`fkn:e2e-integrity: stored data failed its integrity check`,r=`fkn:e2e-retired-format: stored data is in a format this version no longer opens`,i=`FKN_STORAGE_NOT_FOUND`,a=`FKN_API_UNREACHABLE`;exports.E2E_INTEGRITY_MESSAGE=n,exports.E2E_LOCKED_MESSAGE=e,exports.E2E_RETIRED_FORMAT_MESSAGE=r,exports.E2E_STALE_EPOCH_MESSAGE=t,exports.STORAGE_NOT_FOUND=i,exports.STORAGE_UNREACHABLE=a;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn:e2e-locked`,t=`fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset`,n=`fkn:e2e-integrity: stored data failed its integrity check`,r=`fkn:e2e-retired-format: stored data is in a format this version no longer opens`,i=`FKN_STORAGE_NOT_FOUND`,a=`FKN_API_UNREACHABLE`,o=`fkn:account-changed`,s=`fkn:account-pin-invalid`,c=`fkn:account-pin-unsupported`,l=`FKN_ACCOUNT_CHANGED`,u=`FKN_ACCOUNT_PIN_UNSUPPORTED`;exports.ACCOUNT_CHANGED_MESSAGE=o,exports.ACCOUNT_PIN_INVALID_MESSAGE=s,exports.ACCOUNT_PIN_UNSUPPORTED_MESSAGE=c,exports.E2E_INTEGRITY_MESSAGE=n,exports.E2E_LOCKED_MESSAGE=e,exports.E2E_RETIRED_FORMAT_MESSAGE=r,exports.E2E_STALE_EPOCH_MESSAGE=t,exports.STORAGE_ACCOUNT_CHANGED=l,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=u,exports.STORAGE_NOT_FOUND=i,exports.STORAGE_UNREACHABLE=a;
|
package/messages.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { E2E_INTEGRITY_MESSAGE, E2E_LOCKED_MESSAGE, E2E_RETIRED_FORMAT_MESSAGE, E2E_STALE_EPOCH_MESSAGE, STORAGE_NOT_FOUND, STORAGE_UNREACHABLE };
|
|
1
|
+
import { a as E2E_LOCKED_MESSAGE, c as STORAGE_ACCOUNT_CHANGED, d as STORAGE_UNREACHABLE, i as E2E_INTEGRITY_MESSAGE, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, n as ACCOUNT_PIN_INVALID_MESSAGE, o as E2E_RETIRED_FORMAT_MESSAGE, r as ACCOUNT_PIN_UNSUPPORTED_MESSAGE, s as E2E_STALE_EPOCH_MESSAGE, t as ACCOUNT_CHANGED_MESSAGE, u as STORAGE_NOT_FOUND } from "./messages-CRcziTuC.js";
|
|
2
|
+
export { ACCOUNT_CHANGED_MESSAGE, ACCOUNT_PIN_INVALID_MESSAGE, ACCOUNT_PIN_UNSUPPORTED_MESSAGE, E2E_INTEGRITY_MESSAGE, E2E_LOCKED_MESSAGE, E2E_RETIRED_FORMAT_MESSAGE, E2E_STALE_EPOCH_MESSAGE, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, STORAGE_NOT_FOUND, STORAGE_UNREACHABLE };
|
package/messages.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/messages.ts
|
|
2
|
-
var e = "fkn:e2e-locked", t = "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset", n = "fkn:e2e-integrity: stored data failed its integrity check", r = "fkn:e2e-retired-format: stored data is in a format this version no longer opens", i = "FKN_STORAGE_NOT_FOUND", a = "FKN_API_UNREACHABLE";
|
|
2
|
+
var e = "fkn:e2e-locked", t = "fkn:e2e-stale-epoch: this file is encrypted under a previous key you reset", n = "fkn:e2e-integrity: stored data failed its integrity check", r = "fkn:e2e-retired-format: stored data is in a format this version no longer opens", i = "FKN_STORAGE_NOT_FOUND", a = "FKN_API_UNREACHABLE", o = "fkn:account-changed", s = "fkn:account-pin-invalid", c = "fkn:account-pin-unsupported", l = "FKN_ACCOUNT_CHANGED", u = "FKN_ACCOUNT_PIN_UNSUPPORTED";
|
|
3
3
|
//#endregion
|
|
4
|
-
export { n as E2E_INTEGRITY_MESSAGE, e as E2E_LOCKED_MESSAGE, r as E2E_RETIRED_FORMAT_MESSAGE, t as E2E_STALE_EPOCH_MESSAGE, i as STORAGE_NOT_FOUND, a as STORAGE_UNREACHABLE };
|
|
4
|
+
export { o as ACCOUNT_CHANGED_MESSAGE, s as ACCOUNT_PIN_INVALID_MESSAGE, c as ACCOUNT_PIN_UNSUPPORTED_MESSAGE, n as E2E_INTEGRITY_MESSAGE, e as E2E_LOCKED_MESSAGE, r as E2E_RETIRED_FORMAT_MESSAGE, t as E2E_STALE_EPOCH_MESSAGE, l as STORAGE_ACCOUNT_CHANGED, u as STORAGE_ACCOUNT_PIN_UNSUPPORTED, i as STORAGE_NOT_FOUND, a as STORAGE_UNREACHABLE };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as TcpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
2
|
+
import { G as Resolvers, St as TcpSocketListenerResult, wt as TcpSocketResult } from "./contract-BRc2ptdC.js";
|
|
3
|
+
import "./api-Cbty0JUM.js";
|
|
4
4
|
import { AddressInfo, ListenOptions, Server, ServerOpts, Socket, SocketConnectOpts, SocketConstructorOpts } from "net";
|
|
5
5
|
import { DuplexOptions, Stream } from "stream";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-CcEZP6Bb.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|