@fkn/lib 0.9.41 → 0.9.43
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 → account-generation-B-6Pn0b5.cjs} +1 -1
- package/{account-generation-D7TpIoKt.js → account-generation-XNWOvLea.js} +5 -5
- package/account.cjs +1 -1
- package/account.js +6 -6
- package/api--LOXTOpv.cjs +3 -0
- package/{api-Dp-2AT3u.js → api-DIgTslNb.js} +154 -114
- package/{api-Cbty0JUM.d.ts → api-H1TzWitc.d.ts} +24 -2
- package/api.cjs +1 -1
- package/api.d.ts +3 -3
- package/api.js +2 -2
- package/attach-policy.cjs +1 -1
- package/attach-policy.js +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud-Bx64HSkQ.cjs +1 -0
- package/cloud-D-vDUzzx.js +552 -0
- package/{cloud-4t1WoEZn.d.ts → cloud-Y0FzWpFT.d.ts} +5 -3
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-BRc2ptdC.d.ts → contract-DJxGa8lb.d.ts} +141 -7
- package/contract.d.ts +3 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-DMU-CwMw.d.ts → extension-BtDg-F2g.d.ts} +40 -4
- package/extension-CzZn0bY2.js +94 -0
- package/extension-DvFf7uoG.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-q7Kg51hq.js → fs-CVnmXRf7.js} +1 -1
- package/{fs-BTyRnUPI.cjs → fs-p0bOOj5n.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{hosts-9dYv63ud.cjs → hosts-GNBhZO3-.cjs} +1 -1
- package/{hosts-BzbzOhG8.js → hosts-t7CKGTRz.js} +4 -1
- package/http.d.ts +1 -1
- package/{index-D2CA-NX5.d.ts → index-Cgnfjh9o.d.ts} +530 -51
- package/index.cjs +1 -1
- package/index.d.ts +16 -16
- package/index.js +56 -53
- package/{lib-C4Eeg9eM.js → lib-C3UwxjVs.js} +755 -501
- package/lib-fqQfEPk6.cjs +53 -0
- package/{net-CcEZP6Bb.d.ts → net-BOswhyfE.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +14 -14
- package/{proxy-DjoPtJH9.cjs → proxy-CFK-KiwE.cjs} +1 -1
- package/{proxy-DMTdQ4dN.js → proxy-Dixbk1WL.js} +1 -1
- package/{proxy-D6YtsO1g.d.ts → proxy-ylK5lpw8.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +11 -11
- package/{storage-BS5WMO4f.cjs → storage-D2cUJlVH.cjs} +1 -1
- package/{storage-BWmGrO6a.js → storage-Dn1gTLSZ.js} +2 -2
- package/api-jOTOA-5n.cjs +0 -3
- package/cloud-BLv19j-W.js +0 -480
- package/cloud-D7aQY4GH.cjs +0 -1
- package/extension-B9v933cT.js +0 -89
- package/extension-D2zMdc2f.cjs +0 -1
- package/lib-BfAg9mHD.cjs +0 -53
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-fqQfEPk6.cjs"),n=require("./extension-DvFf7uoG.cjs"),r=require("./api--LOXTOpv.cjs"),i=require("./busy-Dv8wzE5M.cjs"),a=require("./cloud-Bx64HSkQ.cjs"),o=require("./dns.cjs"),s=require("./net.cjs"),c=require("./dgram.cjs"),l=require("./http.cjs"),u=require("./desktop.cjs"),d=require("./fs-p0bOOj5n.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.et())return e(!0);let n,r=setTimeout(()=>i(t.et()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.et()),y)},o=new MutationObserver(()=>{t.et()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.et()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{let{kind:n,cookies:r}=t.o(e);if(n===`window`){let n=e;return r===`native`?t.a(n):a.i(n)}let i=e;return r===`native`?S(i):a.i(i)}),S=async e=>(a.a(e),await b(),t.a(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 n=await r.f;if(!n)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);r.d();let a=i.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=n.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(n,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await r.o).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:r.o.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=r.c();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`&&r.u(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`&&r.u(()=>{let e=r.c();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=()=>i.n(),W=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.BACKGROUND_STOPPED=n.a,exports.CATEGORIES=t.w,exports.EXTENSION_ABI=t.it,exports.ExtensionOperationUnsupportedError=t.at,exports.ExtensionOutdatedError=t.ot,exports.FORGEABLE_HEADERS=t.Y,exports.FrameWindowBlockedError=t.g,exports.FrameWindowRefusedError=t._,exports.LOCATOR_DENIED=t.k,exports.LOCATOR_ERROR=t.P,exports.LOCATOR_INVALID=t.I,exports.LOCATOR_UNSUPPORTED=t.E,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.st,exports.TimeoutError=t.T,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.H,exports.assertForgeableHeaders=t.X,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.Z,exports.attachFrame=x,exports.attachFramePermission=t.v,exports.box=t.ut,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return a.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.B,exports.createFrame=t.y,exports.createVideoElementHandle=t.dt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return n.t}}),exports.fetch=n.n,exports.fetchCredentialedPermission=t.W,exports.fetchLocalPermission=t.G,exports.fetchPermission=t.K,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.b,exports.handleRevivableModules=t.lt,exports.hasForgedCookie=t.Q,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return l.t}}),exports.isBackgroundStopped=n.o,exports.isBlockedFetchUrl=t.q,exports.isBlockedFrameUrl=t.C,exports.isExtensionExposed=t.et,exports.isLocalNetworkUrl=t.J,exports.isLocatorDenied=t.F,exports.isLocatorInvalid=t.j,exports.isLocatorUnsupported=t.D,exports.isPermissionDenied=t.n,exports.isTerminalError=t.N,exports.isType=t.ft,exports.modifyRequestHeadersPermission=t.L,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return s.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=n.i,exports.promptRelay=E,exports.readCookiePermission=t.V,exports.readExtensionHandshake=t.tt,exports.relayWorker=w,exports.removeRequestHeaderRule=t.R,exports.revive=t.pt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.nt,exports.setRequestHeaderRule=t.z,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.ct,exports.type=t.mt,exports.waitForExtensionExposure=t.rt;
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
2
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-Cgnfjh9o.js";
|
|
3
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-BtDg-F2g.js";
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-Y0FzWpFT.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
|
-
import { s as net_d_exports } from "./net-
|
|
6
|
+
import { s as net_d_exports } from "./net-BOswhyfE.js";
|
|
7
7
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
8
8
|
import { t as http_d_exports } from "./http.js";
|
|
9
9
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
@@ -14,19 +14,19 @@ import { t as rooms_d_exports } from "./rooms.js";
|
|
|
14
14
|
import { t as connectButtonUrl } from "./connect-button-Cp0NS95-.js";
|
|
15
15
|
//#region src/frame.d.ts
|
|
16
16
|
/**
|
|
17
|
-
* Attaches FKN to an iframe the app mounted,
|
|
18
|
-
*
|
|
17
|
+
* Attaches FKN to an iframe the app mounted, or with `{ window }` opens the attachment in a window
|
|
18
|
+
* of its own. `cookies` picks the jar and with it the backend (`AttachCookies`): `'persistent'`, the
|
|
19
|
+
* default, and `'ephemeral'` run on the cloud render proxy whatever is installed, and never wait for
|
|
20
|
+
* the extension; `'native'` runs on the extension, waiting for it to expose itself while the page
|
|
21
|
+
* loads (at most 10000 ms) and showing the install prompt when it does not. A `blank` attach is the
|
|
22
|
+
* cloud render proxy's alone, so beside `'native'` it is a TypeError. `frame.backend()` says which
|
|
23
|
+
* backend serves an attachment.
|
|
19
24
|
*
|
|
20
25
|
* A window opens before the first await, so call this directly in the click or key handler whose
|
|
21
|
-
* activation opens it.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* is refused at once with `ExtensionOperationUnsupportedError` (operation `'attachWindow'`), before
|
|
26
|
-
* anything opens or is waited for, so the same click can still open one with
|
|
27
|
-
* `cloud.attachFrame({ window })`. That window runs on this app's cloud cookie jar, not on the
|
|
28
|
-
* extension's: a sign-in made in it reaches this app's cloud frames, never an iframe attached
|
|
29
|
-
* through the extension.
|
|
26
|
+
* activation opens it. On `'persistent'` or `'ephemeral'` it opens on the cloud, extension or not. On
|
|
27
|
+
* `'native'` it is refused at once with `ExtensionOperationUnsupportedError` (operation
|
|
28
|
+
* `'attachWindow'`), before anything opens or is waited for, so the same click can still open one on
|
|
29
|
+
* another value.
|
|
30
30
|
*/
|
|
31
31
|
export declare const attachFrame: AttachFrameFunction;
|
|
32
32
|
//#endregion
|
|
@@ -129,4 +129,4 @@ declare const busyReasons: () => string[];
|
|
|
129
129
|
*/
|
|
130
130
|
declare const applyUpdate: () => Promise<boolean>;
|
|
131
131
|
//#endregion
|
|
132
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
|
132
|
+
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
package/index.js
CHANGED
|
@@ -1,87 +1,90 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { u as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { relay as
|
|
2
|
+
import { B as t, C as n, D as r, E as i, F as a, G as o, H as ee, I as te, J as ne, K as s, L as re, N as ie, P as ae, Q as c, R as l, S as oe, T as se, V as ce, W as le, X as ue, Y as de, Z as u, _ as d, a as f, at as p, b as m, ct as h, dt as g, et as _, ft as v, g as y, i as b, it as x, j as S, k as C, lt as w, mt as T, n as E, nt as D, o as O, ot as k, pt as A, q as j, r as M, rt as N, st as P, t as F, tt as I, ut as L, v as R, w as z, x as B, y as V, z as H } from "./lib-C3UwxjVs.js";
|
|
3
|
+
import { a as fe, i as pe, n as me, o as he, t as ge } from "./extension-CzZn0bY2.js";
|
|
4
|
+
import { c as U, d as _e, f as ve, o as W, u as G } from "./api-DIgTslNb.js";
|
|
5
|
+
import { n as ye, t as be } from "./busy-B189uX--.js";
|
|
6
|
+
import { a as xe, i as K, n as Se } from "./cloud-D-vDUzzx.js";
|
|
7
|
+
import { t as Ce } from "./dns.js";
|
|
8
|
+
import { t as we } from "./net.js";
|
|
9
|
+
import { t as Te } from "./dgram.js";
|
|
10
|
+
import { t as Ee } from "./http.js";
|
|
11
|
+
import { t as De } from "./desktop.js";
|
|
12
|
+
import { u as Oe } from "./fs-CVnmXRf7.js";
|
|
13
|
+
import { t as ke } from "./opfs.js";
|
|
14
|
+
import { t as Ae } from "./packages.js";
|
|
15
|
+
import { t as je } from "./rooms.js";
|
|
16
|
+
import { t as Me } from "./account.js";
|
|
17
|
+
import { t as Ne } from "./connect-button-DtsN3X1J.js";
|
|
18
|
+
import { relay as Pe } from "osra";
|
|
19
19
|
//#region src/frame.ts
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
let t, n = setTimeout(() => r(
|
|
20
|
+
var Fe = 1e4, Ie = 150, Le = () => new Promise((e) => {
|
|
21
|
+
if (_()) return e(!0);
|
|
22
|
+
let t, n = setTimeout(() => r(_()), Fe), 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(_()), Ie);
|
|
26
26
|
}, a = new MutationObserver(() => {
|
|
27
|
-
|
|
27
|
+
_() && r(!0);
|
|
28
28
|
}), o = () => {
|
|
29
|
-
document.readyState === "complete" && !
|
|
29
|
+
document.readyState === "complete" && !_() && 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
|
-
}),
|
|
36
|
-
|
|
35
|
+
}), Re = (async (e) => {
|
|
36
|
+
let { kind: t, cookies: n } = O(e);
|
|
37
|
+
if (t === "window") {
|
|
37
38
|
let t = e;
|
|
38
|
-
return
|
|
39
|
+
return n === "native" ? f(t) : K(t);
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
let r = e;
|
|
42
|
+
return n === "native" ? ze(r) : K(r);
|
|
43
|
+
}), ze = async (e) => (xe(e), await Le(), f(e)), Be = "https://fkn.app", Ve = async (e, t) => {
|
|
42
44
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
43
|
-
let n = await
|
|
45
|
+
let n = await ve;
|
|
44
46
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
45
|
-
|
|
47
|
+
_e();
|
|
48
|
+
let r = be("relayed worker");
|
|
46
49
|
t?.unregisterSignal?.aborted ? r() : t?.unregisterSignal?.addEventListener("abort", r, { once: !0 });
|
|
47
50
|
let i = n.emit instanceof MessagePort ? {} : {
|
|
48
|
-
originA: t?.originA ??
|
|
51
|
+
originA: t?.originA ?? Be,
|
|
49
52
|
originB: t?.originB ?? "*"
|
|
50
53
|
};
|
|
51
|
-
|
|
54
|
+
Pe(n, e, {
|
|
52
55
|
key: "fkn-api",
|
|
53
56
|
...i,
|
|
54
57
|
unregisterSignal: t?.unregisterSignal
|
|
55
58
|
});
|
|
56
|
-
},
|
|
59
|
+
}, He = async () => typeof window > "u" ? !1 : (await W).connect.prompt(location.origin).catch(() => !1), Ue = async () => typeof window > "u" ? null : (await W).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), We = (e) => (q.add(e), () => {
|
|
57
60
|
q.delete(e);
|
|
58
|
-
}),
|
|
61
|
+
}), Ge = () => {
|
|
59
62
|
if (q.size === 0) return !1;
|
|
60
63
|
for (let e of [...q]) try {
|
|
61
64
|
e();
|
|
62
65
|
} catch {}
|
|
63
66
|
return !0;
|
|
64
|
-
},
|
|
67
|
+
}, Ke = (e, t) => {
|
|
65
68
|
if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
|
|
66
|
-
},
|
|
67
|
-
applyUpdate: () =>
|
|
68
|
-
busyReasons: () =>
|
|
69
|
-
onUpdate: () =>
|
|
70
|
-
onUpdateTaken: () =>
|
|
71
|
-
updateReady: () =>
|
|
72
|
-
}),
|
|
69
|
+
}, qe = /* @__PURE__ */ e({
|
|
70
|
+
applyUpdate: () => et,
|
|
71
|
+
busyReasons: () => $e,
|
|
72
|
+
onUpdate: () => Xe,
|
|
73
|
+
onUpdateTaken: () => Ze,
|
|
74
|
+
updateReady: () => Je
|
|
75
|
+
}), Je = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, Ye = () => {
|
|
73
76
|
Y = !0;
|
|
74
77
|
for (let e of [...J]) try {
|
|
75
78
|
e();
|
|
76
79
|
} catch {}
|
|
77
80
|
}, X = 0, Z = () => {
|
|
78
|
-
let e =
|
|
79
|
-
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(
|
|
81
|
+
let e = U();
|
|
82
|
+
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(Ye)).catch(() => {
|
|
80
83
|
X === e.epoch && (X = 0);
|
|
81
84
|
}));
|
|
82
85
|
};
|
|
83
|
-
typeof window < "u" &&
|
|
84
|
-
var
|
|
86
|
+
typeof window < "u" && G(Z);
|
|
87
|
+
var Xe = async (e) => {
|
|
85
88
|
if (typeof window > "u") return () => {};
|
|
86
89
|
if (J.add(e), Y) try {
|
|
87
90
|
e();
|
|
@@ -89,19 +92,19 @@ var Ge = async (e) => {
|
|
|
89
92
|
return Z(), () => {
|
|
90
93
|
J.delete(e);
|
|
91
94
|
};
|
|
92
|
-
},
|
|
93
|
-
if (!
|
|
95
|
+
}, Ze = (e) => typeof window > "u" ? () => {} : We(e), Q = 0, $ = !1, Qe = () => {
|
|
96
|
+
if (!Ge() && !$) {
|
|
94
97
|
$ = !0;
|
|
95
98
|
try {
|
|
96
99
|
location.reload();
|
|
97
100
|
} catch {}
|
|
98
101
|
}
|
|
99
102
|
};
|
|
100
|
-
typeof window < "u" &&
|
|
101
|
-
let e =
|
|
103
|
+
typeof window < "u" && G(() => {
|
|
104
|
+
let e = U();
|
|
102
105
|
if (!e || Q === e.epoch) return;
|
|
103
106
|
Q = e.epoch;
|
|
104
|
-
let t =
|
|
107
|
+
let t = Ke(e.remote.shell, Qe);
|
|
105
108
|
if (!t) {
|
|
106
109
|
Q = 0;
|
|
107
110
|
return;
|
|
@@ -110,6 +113,6 @@ typeof window < "u" && V(() => {
|
|
|
110
113
|
Q === e.epoch && (Q = 0);
|
|
111
114
|
});
|
|
112
115
|
});
|
|
113
|
-
var
|
|
116
|
+
var $e = () => ye(), et = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
114
117
|
//#endregion
|
|
115
|
-
export {
|
|
118
|
+
export { b as ATTACH_FRAME_EVENT_KEY, fe as BACKGROUND_STOPPED, z as CATEGORIES, x as EXTENSION_ABI, p as ExtensionOperationUnsupportedError, k as ExtensionOutdatedError, de as FORGEABLE_HEADERS, y as FrameWindowBlockedError, d as FrameWindowRefusedError, C as LOCATOR_DENIED, ae as LOCATOR_ERROR, te as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, F as PERMISSION_DENIED, P as REQUIRED_EXTENSION_ABI, se as TimeoutError, Me as account, B as assertAttachableFrameUrl, ee as assertFetchableUrl, ue as assertForgeableHeaders, oe as assertLockdownApplicable, u as assertOneCookieIdentity, Re as attachFrame, R as attachFramePermission, L as box, Se as cloud, He as connect, Ne as connectButtonUrl, t as cookies, V as createFrame, g as createVideoElementHandle, De as desktop, Te as dgram, Ce as dns, ge as extension, me as fetch, le as fetchCredentialedPermission, o as fetchLocalPermission, s as fetchPermission, Oe as fs, m as gotoPermission, w as handleRevivableModules, c as hasForgedCookie, Ee as http, he as isBackgroundStopped, j as isBlockedFetchUrl, n as isBlockedFrameUrl, _ as isExtensionExposed, ne as isLocalNetworkUrl, a as isLocatorDenied, S as isLocatorInvalid, r as isLocatorUnsupported, E as isPermissionDenied, ie as isTerminalError, v as isType, re as modifyRequestHeadersPermission, we as net, ke as opfs, Ae as packages, M as permissions, pe as promptInstall, Ue as promptRelay, ce as readCookiePermission, I as readExtensionHandshake, Ve as relayWorker, l as removeRequestHeaderRule, A as revive, je as rooms, D as setMissingExtensionHandler, H as setRequestHeaderRule, qe as shell, h as supportsOperation, T as type, N as waitForExtensionExposure };
|