@fkn/lib 0.9.72 → 0.9.74
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-Czik26yc.js → account-CTOhAc2x.js} +2 -2
- package/{account-CZYGFU5m.cjs → account-DO7KokEs.cjs} +1 -1
- package/{account-generation-BTxZWNQz.cjs → account-generation-6F54U_B3.cjs} +1 -1
- package/{account-generation-D2hoQYXp.js → account-generation-Cq_xRcUr.js} +1 -1
- package/{account-CXUwroRM.d.ts → account-kRplShh-.d.ts} +1 -1
- package/{account-storage-DcbJCOvI.js → account-storage-DQryXWDZ.js} +2 -2
- package/{account-storage-CIfiAHa1.cjs → account-storage-f0HN_zgo.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.d.ts +2 -2
- package/account.js +1 -1
- package/{api-DhwJz0vo.d.ts → api-CXvE64Jr.d.ts} +26 -2
- package/{api-e82hhULK.js → api-DR6y3Q0Y.js} +153 -136
- package/api-RuHgAkxf.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/{broker-frame-BClLp2ZV.js → broker-frame-AQDD3D9E.js} +1 -1
- package/{broker-frame-BKHtDSjv.cjs → broker-frame-cVEhez7A.cjs} +1 -1
- package/broker-frame.cjs +1 -1
- package/broker-frame.js +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.d.ts +1 -1
- package/cloud/dgram.js +1 -1
- package/cloud/dns.cjs +1 -1
- package/cloud/dns.d.ts +2 -2
- package/cloud/dns.js +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.cjs +1 -1
- package/cloud/fs/promises.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +2 -2
- package/cloud/http.cjs +1 -1
- package/cloud/http.d.ts +1 -1
- package/cloud/http.js +1 -1
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +1 -1
- package/{cloud-DRfcPLdB.d.ts → cloud-C9alQ9TA.d.ts} +5 -5
- package/{cloud-BV96BYFR.js → cloud-Cn27x6RK.js} +9 -9
- package/{cloud-6ddOLS37.cjs → cloud-CrKxBmgy.cjs} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.d.ts +6 -6
- package/cloud.js +7 -7
- package/{contract-CDdIE_Es.d.ts → contract-B-iUk1mJ.d.ts} +36 -2
- package/contract.cjs +1 -1
- package/contract.d.ts +3 -3
- package/contract.js +2 -2
- package/{dgram-CTcHo7BL.js → dgram-Cj1vkCE9.js} +1 -1
- package/{dgram-wTKAuRI3.cjs → dgram-D7I5nP9w.cjs} +1 -1
- package/{dgram-CPQqam5Z.d.ts → dgram-D9DiXmhU.d.ts} +4 -4
- package/dgram.cjs +1 -1
- package/dgram.d.ts +1 -1
- package/dgram.js +1 -1
- package/{dns-Cdmp7tw4.js → dns-43gybmwY.js} +1 -1
- package/{dns-_NCe2YLS.d.ts → dns-CfUsfETG.d.ts} +1 -1
- package/{dns-OXiS-nXH.cjs → dns-D8cfGYaF.cjs} +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +2 -2
- package/dns.js +1 -1
- package/{extension-eA0r72hp.cjs → extension-D8Kj6rRT.cjs} +1 -1
- package/{extension-DlPOuZum.js → extension-DFeaP0Ou.js} +4 -4
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-BHfRf_xt.js → fs-BnCWJ-jg.js} +1 -1
- package/{fs-CLvS_YSq.cjs → fs-COtIapGm.cjs} +1 -1
- package/{fs-9LWii1mp.js → fs-DXz_TgC8.js} +3 -3
- package/{fs-CiZZf0ne.cjs → fs-Dp_8uaZe.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{http-KKqCypOh.cjs → http-B72t08kn.cjs} +2 -2
- package/{http-rzQOrCmq.d.ts → http-D1qvoYf6.d.ts} +1 -1
- package/{http-Cg5aK6Jn.js → http-DLMUTBb4.js} +2 -2
- package/http.cjs +1 -1
- package/http.d.ts +1 -1
- package/http.js +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +13 -14
- package/index.js +32 -38
- package/{lib-B895LZTn.js → lib-DIxvhbhf.js} +1 -1
- package/{lib-BJzKHh4X.cjs → lib-uND2BvAa.cjs} +1 -1
- package/{net-B4IqLeN8.d.ts → net-B0N6hTWu.d.ts} +4 -4
- package/net-D7oBrZbA.cjs +1 -0
- package/{net-BUeelrnH.js → net-wirsgKVa.js} +26 -25
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +6 -1
- package/{packages-C27FhPmh.js → packages-BAc5K4BQ.js} +1 -1
- package/{packages-SwO4CxMl.d.ts → packages-DTs-fy67.d.ts} +1 -1
- package/{packages-Bw1OE9Ra.cjs → packages-DkKru6li.cjs} +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +2 -2
- package/packages.js +1 -1
- package/{proxy-CzP07me0.d.ts → proxy-1E6vjFKx.d.ts} +2 -2
- package/{proxy-BET3xNJw.js → proxy-BmptuWKa.js} +2 -2
- package/{proxy-khQQJbGw.cjs → proxy-CLsTNt40.cjs} +1 -1
- package/{relay-choice-DB1F7bcn.d.ts → relay-choice-BeNCw3ba.d.ts} +1 -1
- package/{rooms-3XplwXzb.d.ts → rooms-APVrHbvL.d.ts} +1 -1
- package/{rooms-C8FW4mDY.cjs → rooms-BJ5MQq-S.cjs} +1 -1
- package/{rooms-r09iUhIA.js → rooms-a1_jHEhL.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +2 -2
- package/rooms.js +1 -1
- package/{storage-CFk2AT4V.js → storage-ChE9vSDe.js} +3 -3
- package/{storage-BINUKDl1.cjs → storage-D9_L4Coi.cjs} +1 -1
- package/{storage-C38adB-z.d.ts → storage-YQNVOwp8.d.ts} +1 -1
- package/storage.cjs +1 -1
- package/storage.d.ts +2 -2
- package/storage.js +1 -1
- package/websocket.cjs +1 -0
- package/websocket.d.ts +48 -0
- package/websocket.js +179 -0
- package/{wire-DhmLnYEU.d.ts → wire-Cddfpu2U.d.ts} +12 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +6 -2
- package/api-oE2v5tpj.cjs +0 -3
- package/net-i4BzwpoN.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { l as t, o as n } from "./api-
|
|
3
|
-
import { i as r } from "./account-generation-
|
|
2
|
+
import { l as t, o as n } from "./api-DR6y3Q0Y.js";
|
|
3
|
+
import { i as r } from "./account-generation-Cq_xRcUr.js";
|
|
4
4
|
// src/account.ts
|
|
5
5
|
var i = /* @__PURE__ */ e({
|
|
6
6
|
info: () => s,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-RuHgAkxf.cjs"),n=require("./account-generation-6F54U_B3.cjs");var r=e.t({info:()=>o,login:()=>i,logout:()=>a,onChange:()=>s}),i=async()=>typeof window>`u`?!1:(await t.o).account.login(location.origin).catch(()=>!1),a=async()=>{typeof window<`u`&&await(await t.o).account.logout().catch(()=>{})},o=async()=>{if(typeof window>`u`)return null;let e=await t.o.then(e=>e.account.info()).catch(()=>null);return e?{name:e.name,image:e.image,premium:e.premium,premiumUntil:e.premiumUntil?Date.parse(e.premiumUntil):null}:null},s=async e=>t.l?n.i(e):()=>{};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./api-
|
|
1
|
+
const e=require("./api-RuHgAkxf.cjs");var t=0,n=new Set,r=2e3,i=null,a=e=>{let r=e?.switched!==!1;r&&(t+=1,i&&=(clearTimeout(i.timer),null));for(let e of[...n])try{e({switched:r})}catch{}},o=!1,s=0,c=()=>{let t=e.c();t&&s!==t.epoch&&(s=t.epoch,Promise.resolve(t.remote.account.onChange(a)).catch(()=>{s===t.epoch&&(s=0)}))},l=()=>{!o&&e.l&&(o=!0,e.u(c))},u=()=>t,d=e=>(n.add(e),l(),()=>{n.delete(e)}),f=e=>{if(e!==t||i?.generation===e)return;let n=setTimeout(()=>{i?.timer===n&&(i=null,t===e&&a({switched:!0}))},r);i={generation:e,timer:n}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-DR6y3Q0Y.js";
|
|
3
3
|
import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "./messages.js";
|
|
4
|
-
import { n as a, r as o, t as s } from "./account-generation-
|
|
4
|
+
import { n as a, r as o, t as s } from "./account-generation-Cq_xRcUr.js";
|
|
5
5
|
// src/account-storage.ts
|
|
6
6
|
var c = /* @__PURE__ */ e({
|
|
7
7
|
StorageAccountChangedError: () => f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-RuHgAkxf.cjs"),n=require("./messages.cjs"),r=require("./account-generation-6F54U_B3.cjs");var i=e.t({StorageAccountChangedError:()=>c,StorageAccountPinUnsupportedError:()=>l,StorageLockedError:()=>a,StorageNotFoundError:()=>o,availability:()=>k,available:()=>w,captureAccount:()=>p,encryption:()=>L,isAccountChanged:()=>u,isInvalidPin:()=>d,isNotFound:()=>s,knownPin:()=>y,list:()=>A,pinFor:()=>b,quota:()=>j,readFile:()=>M,readFileSealed:()=>P,remove:()=>I,unlock:()=>R,writeFile:()=>F}),a=class extends Error{code=`FKN_E2E_LOCKED`;constructor(){super(`storage locked: connect the app again to open encrypted data`)}},o=class extends Error{code=n.STORAGE_NOT_FOUND;constructor(e=`storage: no object at that path`){super(e)}},s=e=>e?.code===n.STORAGE_NOT_FOUND,c=class extends Error{code=n.STORAGE_ACCOUNT_CHANGED;constructor(e=`storage: the signed-in account changed, so this call was not made`){super(e)}},l=class extends Error{code=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED;constructor(e=`storage: the FKN broker cannot pin calls to an account yet, so nothing was sent`){super(e)}},u=e=>e?.code===`FKN_ACCOUNT_CHANGED`||e instanceof Error&&e.message.startsWith(`fkn:account-changed`),d=e=>e instanceof Error&&e.message.startsWith(`fkn:account-pin-invalid`),f=e=>{throw e instanceof Error&&e.message.startsWith(`fkn:e2e-locked`)?new a:s(e)?new o(e.message):u(e)?new c:e instanceof Error&&e.message.startsWith(`fkn:account-pin-unsupported`)?new l:e instanceof Error&&(/^not found$/i.test(e.message)||/\(404\)$/.test(e.message))?new o(e.message):e},p=()=>(r.n(),{generation:r.t()}),m=new Map,h=null,g=e=>typeof e?.accountPin==`function`,_=(e,t)=>{let n=Promise.resolve(t.accountPin()).then(t=>{if(typeof t!=`string`||!t)throw Error(`storage: the broker answered no account pin`);return r.t()===e&&m.set(e,t),t});return h={generation:e,pin:n},n.catch(()=>{h?.pin===n&&(h=null)}),n},v=async(e,t)=>{let n=m.get(e.generation);if(n!==void 0)return n;if(e.generation!==r.t())throw new c;let i=await(h?.generation===e.generation?h.pin:_(e.generation,t)).catch(f);if(e.generation!==r.t())throw new c;return i},y=e=>m.get(e.generation),b=async e=>{let n=(await t.o).cloud.fs;if(!g(n))throw new l;return v(e,n)},x=e=>{for(let[t,n]of m)if(n===e)return t},S=e=>e?.pin??p(),C=async(e,n)=>{let i=(await t.o).cloud.fs;if(!g(i))throw new l;let a=`pin`in e?e.pin:await v(e,i);if(!g(i))throw new l;return n(i,{accountPin:a}).catch(t=>{if(u(t)){let t=`generation`in e?e.generation:x(a);t!==void 0&&r.r(t)}return f(t)})},w=()=>t.o.then(e=>e.cloud.fs.available()).catch(()=>!1),T=8e3,E=1e3,D=!1,O=async()=>{let e=(await t.o).cloud.fs;return typeof e.availability==`function`?e.availability():await e.available()?`connected`:`disconnected`},k=async()=>{let e=D?E:T,t=await new Promise(t=>{let n=setTimeout(()=>t(`timeout`),e);O().then(e=>{clearTimeout(n),t(e)},()=>{clearTimeout(n),t(`unknown`)})});return t===`timeout`?(D=!0,`unknown`):(D=!1,t)},A=e=>C(S(e),(e,t)=>e.list(t)),j=()=>t.o.then(e=>e.cloud.fs.quota()),M=async(e,t)=>{let n=await C(S(t),(t,n)=>t.readFile(e,n));return new Blob([n])},N=e=>{if(e===null||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()},P=async(e,t)=>C(S(t),async(t,n)=>{let r=t;if(typeof r.readFileSealed!=`function`)return{data:await t.readFile(e,n),sealedAt:null};let i=await r.readFileSealed(e,n);return{data:i.bytes,sealedAt:N(i.sealedAt)}}),F=async(e,t,n)=>{let r=S(n),i=t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t;await C(r,(t,r)=>t.writeFile(e,i,n?.contentType??null,r))},I=async(e,t)=>{await C(S(t),(t,n)=>t.remove(e,n))},L=()=>t.o.then(e=>e.cloud.fs.encryption()),R=()=>t.o.then(e=>e.cloud.fs.unlock());Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return R}});
|
package/account.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./account-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./account-DO7KokEs.cjs");exports.info=e.n,exports.login=e.r,exports.logout=e.i,exports.onChange=e.a;
|
package/account.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as AccountChange } from "./contract-
|
|
2
|
-
import { a as logout, i as login, o as onChange, r as info, t as AccountInfo } from "./account-
|
|
1
|
+
import { a as AccountChange } from "./contract-B-iUk1mJ.js";
|
|
2
|
+
import { a as logout, i as login, o as onChange, r as info, t as AccountInfo } from "./account-kRplShh-.js";
|
|
3
3
|
export { type AccountChange, AccountInfo, info, login, logout, onChange };
|
package/account.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as info, r as login, i as logout, a as onChange } from "./account-
|
|
1
|
+
export { n as info, r as login, i as logout, a as onChange } from "./account-CTOhAc2x.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as RelayChoice } from "./index-HMfzm6dF.js";
|
|
2
|
-
import { D as IpFamily,
|
|
3
|
-
import {
|
|
2
|
+
import { B as PickOptions, D as IpFamily, Ft as StoragePutWire, Gt as UdpDatagram, I as PackageQuery, Kt as UdpSocketOptions, N as OverlayState, Q as Resolvers, Qt as WebSocketOptions, R as PackagesErrorCode, T as InstallOptions, U as ProxyFetchInit, Ut as TcpSocketOptions, V as Placement, Vt as TcpSocketListenerOptions, W as ProxyFetchInput, _t as RoomsErrorCode, a as AccountChange, at as RoomEvent, b as FrameConsentAnswer, c as AdoptRequest, d as ConflictRequest, et as RoomClaimOptions, ft as RoomOpenOptions, gt as RoomType, jt as StorageErrorCode, l as AdoptState, lt as RoomMailbox, m as ConnectOptions, o as AccountPinOptions, p as ConnectAvailability, pt as RoomPermission, st as RoomJoinOptions, tn as WriteData, u as ConflictChoice, x as FrameConsentRequest } from "./contract-B-iUk1mJ.js";
|
|
3
|
+
import { S as UdpSocketOption, s as TcpSocketOption } from "./wire-Cddfpu2U.js";
|
|
4
4
|
import { Remote } from "osra";
|
|
5
5
|
type EpochListener<T> = (remote: T, epoch: number) => void;
|
|
6
6
|
declare const hasTransport: boolean;
|
|
@@ -166,6 +166,18 @@ declare const onApiEpoch: (listener: EpochListener<{
|
|
|
166
166
|
relay?: string;
|
|
167
167
|
}>;
|
|
168
168
|
};
|
|
169
|
+
websocket: (options: WebSocketOptions) => Promise<{
|
|
170
|
+
protocol: string;
|
|
171
|
+
readable: ReadableStream<string | ArrayBuffer>;
|
|
172
|
+
writable: WritableStream<string | ArrayBuffer | Blob>;
|
|
173
|
+
close: (code?: number | undefined, reason?: string | undefined) => Promise<void>;
|
|
174
|
+
closed: Promise<{
|
|
175
|
+
code: number;
|
|
176
|
+
reason: string;
|
|
177
|
+
wasClean: boolean;
|
|
178
|
+
error: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
}>;
|
|
169
181
|
};
|
|
170
182
|
overlay: {
|
|
171
183
|
setHost: (push: (state: OverlayState) => unknown, options?: {
|
|
@@ -1567,6 +1579,18 @@ declare const currentApiEpoch: () => {
|
|
|
1567
1579
|
relay?: string;
|
|
1568
1580
|
}>;
|
|
1569
1581
|
};
|
|
1582
|
+
websocket: (options: WebSocketOptions) => Promise<{
|
|
1583
|
+
protocol: string;
|
|
1584
|
+
readable: ReadableStream<string | ArrayBuffer>;
|
|
1585
|
+
writable: WritableStream<string | ArrayBuffer | Blob>;
|
|
1586
|
+
close: (code?: number | undefined, reason?: string | undefined) => Promise<void>;
|
|
1587
|
+
closed: Promise<{
|
|
1588
|
+
code: number;
|
|
1589
|
+
reason: string;
|
|
1590
|
+
wasClean: boolean;
|
|
1591
|
+
error: boolean;
|
|
1592
|
+
}>;
|
|
1593
|
+
}>;
|
|
1570
1594
|
};
|
|
1571
1595
|
overlay: {
|
|
1572
1596
|
setHost: (push: (state: OverlayState) => unknown, options?: {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
// src/
|
|
4
|
-
var i =
|
|
1
|
+
import { a as e, n as t } from "./broker-frame-AQDD3D9E.js";
|
|
2
|
+
import { expose as n, registerOsraMessageListener as r } from "osra";
|
|
3
|
+
// src/keep-listening.ts
|
|
4
|
+
var i = (e, t, n, r) => {
|
|
5
|
+
let i = () => e.addEventListener(t, n, r);
|
|
6
|
+
i();
|
|
7
|
+
let a = new MutationObserver(i);
|
|
8
|
+
return a.observe(e.document, { childList: !0 }), () => {
|
|
9
|
+
a.disconnect(), e.removeEventListener(t, n, r);
|
|
10
|
+
};
|
|
11
|
+
}, a = 1e4, o = 16, s = (e) => {
|
|
5
12
|
let t;
|
|
6
13
|
try {
|
|
7
14
|
t = e.contentWindow;
|
|
@@ -15,58 +22,66 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
15
22
|
} catch {
|
|
16
23
|
return !0;
|
|
17
24
|
}
|
|
18
|
-
},
|
|
19
|
-
if (
|
|
25
|
+
}, c = (e, t = a) => new Promise((n) => {
|
|
26
|
+
if (s(e)) return n();
|
|
20
27
|
let r = () => {
|
|
21
|
-
clearInterval(i), clearTimeout(
|
|
28
|
+
clearInterval(i), clearTimeout(a), e.removeEventListener("load", r), n();
|
|
22
29
|
}, i = setInterval(() => {
|
|
23
|
-
|
|
24
|
-
},
|
|
30
|
+
s(e) && r();
|
|
31
|
+
}, o), a = setTimeout(r, t);
|
|
25
32
|
e.addEventListener("load", r);
|
|
26
|
-
}),
|
|
27
|
-
let r = 1,
|
|
28
|
-
clearTimeout(
|
|
29
|
-
},
|
|
33
|
+
}), l = 5e3, u = 9e4, d = (e, t, n) => {
|
|
34
|
+
let r = 1, o, c = e.ownerDocument.defaultView, d = () => {
|
|
35
|
+
clearTimeout(o), h?.(), e.removeEventListener("load", m);
|
|
36
|
+
}, f = () => {
|
|
30
37
|
if (e.isConnected) {
|
|
31
|
-
if (r >= 4) return
|
|
32
|
-
r += 1, e.contentWindow?.location.replace(t),
|
|
38
|
+
if (r >= 4) return d(), console.error(`FKN @fkn/lib: ${t} did not load in ${r} tries; reload the page`);
|
|
39
|
+
r += 1, e.contentWindow?.location.replace(t), p(u);
|
|
33
40
|
}
|
|
34
|
-
},
|
|
35
|
-
clearTimeout(
|
|
36
|
-
},
|
|
37
|
-
t.source === e.contentWindow && t.origin === n &&
|
|
38
|
-
};
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
},
|
|
41
|
+
}, p = (e) => {
|
|
42
|
+
clearTimeout(o), o = setTimeout(f, e);
|
|
43
|
+
}, m = () => p(l), h = c ? i(c, "message", (t) => {
|
|
44
|
+
t.source === e.contentWindow && t.origin === n && d();
|
|
45
|
+
}) : void 0;
|
|
46
|
+
if (e.addEventListener("load", m), s(e)) return p(l);
|
|
47
|
+
o = setTimeout(() => s(e) ? p(8e4) : f(), a);
|
|
48
|
+
}, f = (e, t) => ({
|
|
49
|
+
receive: (n) => i(e.ownerDocument.defaultView, "message", (e) => {
|
|
50
|
+
e.origin === t && n(e.data, {
|
|
51
|
+
source: e.source,
|
|
52
|
+
origin: t
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
emit: (n, r) => e.contentWindow?.postMessage(n, t, r)
|
|
56
|
+
}), p = 32, m = 8, h = 120, g = typeof CSS < "u" && CSS.supports("clip-path", "path('M0 0H1V1H0Z')"), ee = typeof CSS < "u" && CSS.supports("clip-path", "polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)"), te = "light dark", ne = (e) => {
|
|
42
57
|
let t = e.style;
|
|
43
|
-
t.setProperty("display", "block", "important"), t.setProperty("position", "fixed", "important"), t.setProperty("top", "0", "important"), t.setProperty("left", "0", "important"), t.setProperty("width", "100%", "important"), t.setProperty("height", "100%", "important"), t.setProperty("border", "none", "important"), t.setProperty("padding", "0", "important"), t.setProperty("box-sizing", "border-box", "important"), t.setProperty("clip-path", "inset(100%)", "important"), t.setProperty("background", "transparent"), t.setProperty("color-scheme",
|
|
44
|
-
},
|
|
58
|
+
t.setProperty("display", "block", "important"), t.setProperty("position", "fixed", "important"), t.setProperty("top", "0", "important"), t.setProperty("left", "0", "important"), t.setProperty("width", "100%", "important"), t.setProperty("height", "100%", "important"), t.setProperty("border", "none", "important"), t.setProperty("padding", "0", "important"), t.setProperty("box-sizing", "border-box", "important"), t.setProperty("clip-path", "inset(100%)", "important"), t.setProperty("background", "transparent"), t.setProperty("color-scheme", te), t.setProperty("z-index", "2147483647"), e.setAttribute("title", "FKN");
|
|
59
|
+
}, re = ({ x: e, y: t, width: n, height: r, radius: i }) => {
|
|
45
60
|
if (!i) return `M${e} ${t}h${n}v${r}h${-n}Z`;
|
|
46
61
|
let a = Math.min(n, r) / 2, [o, s, c, l] = i.map((e) => Math.max(0, Math.min(e, a)));
|
|
47
62
|
return `M${e + o} ${t}h${n - o - s}a${s} ${s} 0 0 1 ${s} ${s}v${r - s - c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n - c - l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r - l - o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`;
|
|
48
|
-
},
|
|
63
|
+
}, ie = () => g && ee, _ = ({ x: e, y: t, width: n, height: r }) => [
|
|
49
64
|
[e, t],
|
|
50
65
|
[e + n, t],
|
|
51
66
|
[e + n, t + r],
|
|
52
67
|
[e, t + r],
|
|
53
68
|
[e, t]
|
|
54
|
-
],
|
|
69
|
+
], ae = (e) => {
|
|
55
70
|
let t = e[0];
|
|
56
71
|
if (!t) return [];
|
|
57
72
|
let n = _(t)[0], r = [];
|
|
58
73
|
return e.forEach((t, i) => {
|
|
59
74
|
r.push(..._(t)), i > 0 && i < e.length - 1 && r.push(n);
|
|
60
75
|
}), r;
|
|
61
|
-
},
|
|
76
|
+
}, oe = (e) => `polygon(nonzero, ${ae(e).map(([e, t]) => `${e}px ${t}px`).join(", ")})`, se = ({ x: e, y: t, width: n, height: r, radius: i }, a) => {
|
|
62
77
|
let o = `${t}px ${a.width - e - n}px ${a.height - t - r}px ${e}px`;
|
|
63
78
|
return i ? `inset(${o} round ${i.map((e) => `${e}px`).join(" ")})` : `inset(${o})`;
|
|
64
|
-
},
|
|
79
|
+
}, ce = (e, t, n) => {
|
|
65
80
|
if (t) return "none";
|
|
66
81
|
if (e.length === 0) return "inset(100%)";
|
|
67
82
|
let r = e.length === 1 ? e[0] : void 0;
|
|
68
|
-
return r ?
|
|
69
|
-
},
|
|
83
|
+
return r ? se(r, n) : ee && e.length <= 5 && !e.some((e) => e.radius) ? oe(e) : `path('${e.map(re).join("")}')`;
|
|
84
|
+
}, le = (e) => {
|
|
70
85
|
if (e.length < 2) return null;
|
|
71
86
|
let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y));
|
|
72
87
|
return {
|
|
@@ -75,14 +90,14 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
75
90
|
width: Math.max(...e.map((e) => e.x + e.width)) - t,
|
|
76
91
|
height: Math.max(...e.map((e) => e.y + e.height)) - n
|
|
77
92
|
};
|
|
78
|
-
},
|
|
93
|
+
}, ue = (e, t, n) => t >= e.x && t < e.x + e.width && n >= e.y && n < e.y + e.height, de = 16, v = (e, t, n) => t === 1 ? e * de : t === 2 ? e * n : e, y = (e, t, n, r, i) => {
|
|
79
94
|
let a = t ? r : 0, o = n ? i : 0;
|
|
80
95
|
return a || o ? {
|
|
81
96
|
target: e,
|
|
82
97
|
left: a,
|
|
83
98
|
top: o
|
|
84
99
|
} : null;
|
|
85
|
-
},
|
|
100
|
+
}, fe = (e, t, n) => {
|
|
86
101
|
let r = document.documentElement, i = getComputedStyle(r), a = i.overflowX === "visible" && i.overflowY === "visible" && document.body ? document.body : r;
|
|
87
102
|
for (let r = e; r && r !== a; r = r.parentElement) {
|
|
88
103
|
let e = getComputedStyle(r), i = /auto|scroll/.test(e.overflowX) && r.scrollWidth > r.clientWidth, a = /auto|scroll/.test(e.overflowY) && r.scrollHeight > r.clientHeight, o = y(r, i, a, t, n);
|
|
@@ -93,48 +108,48 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
93
108
|
}, b = null, x = null, S = (e) => ({
|
|
94
109
|
width: e.offsetWidth || window.innerWidth,
|
|
95
110
|
height: e.offsetHeight || window.innerHeight
|
|
96
|
-
}),
|
|
97
|
-
if (!x || !b || !
|
|
111
|
+
}), pe = (e) => {
|
|
112
|
+
if (!x || !b || !ue(x, e.clientX, e.clientY)) return;
|
|
98
113
|
let t = document.fullscreenElement;
|
|
99
114
|
if (t && !t.contains(b)) return;
|
|
100
115
|
let n = document.elementFromPoint(e.clientX, e.clientY);
|
|
101
116
|
if (!n || n === b) return;
|
|
102
117
|
let r = n.closest(":is(:modal, :popover-open)");
|
|
103
118
|
if (r && !r.contains(b)) return;
|
|
104
|
-
let i =
|
|
119
|
+
let i = fe(n, v(e.deltaX, e.deltaMode, window.innerWidth), v(e.deltaY, e.deltaMode, window.innerHeight));
|
|
105
120
|
i && (i.target.scrollBy({
|
|
106
121
|
left: i.left,
|
|
107
122
|
top: i.top,
|
|
108
123
|
behavior: "instant"
|
|
109
124
|
}), e.cancelable && e.preventDefault());
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
x = e, t !== (e !== null) && (e ? window.addEventListener("wheel", C, {
|
|
125
|
+
}, C, me = (e) => {
|
|
126
|
+
x = e, e ? C ??= i(window, "wheel", pe, {
|
|
113
127
|
capture: !0,
|
|
114
128
|
passive: !1
|
|
115
|
-
}) :
|
|
116
|
-
}, w = 0,
|
|
117
|
-
|
|
118
|
-
w
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
}) : (C?.(), C = void 0);
|
|
130
|
+
}, w = 0, T = null, he = (e) => {
|
|
131
|
+
let t = document.documentElement;
|
|
132
|
+
if (!t || e === w && (e === 0 || t === T)) return;
|
|
133
|
+
w = e, T = t;
|
|
134
|
+
let n = t.style;
|
|
135
|
+
e > 0 ? (n.setProperty("margin-top", `${e}px`, "important"), n.setProperty("--fkn-inset-top", `${e}px`)) : (n.removeProperty("margin-top"), n.removeProperty("--fkn-inset-top"));
|
|
136
|
+
}, E = (e, t) => {
|
|
122
137
|
t ? (e.removeAttribute("tabindex"), e.removeAttribute("aria-hidden")) : (e.setAttribute("tabindex", "-1"), e.setAttribute("aria-hidden", "true"));
|
|
123
|
-
},
|
|
124
|
-
if (
|
|
138
|
+
}, D = (e, { modal: t, rects: n, inset: r }, i) => {
|
|
139
|
+
if (he(r), !g) {
|
|
125
140
|
let r = t || n.length > 0;
|
|
126
|
-
|
|
141
|
+
E(e, r), e.style.setProperty("pointer-events", r ? "auto" : "none", "important"), e.style.setProperty("visibility", r ? "visible" : "hidden", "important");
|
|
127
142
|
return;
|
|
128
143
|
}
|
|
129
|
-
let a =
|
|
130
|
-
e.style.setProperty("clip-path", o, "important"),
|
|
131
|
-
},
|
|
144
|
+
let a = ce(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
|
|
145
|
+
e.style.setProperty("clip-path", o, "important"), E(e, o !== "inset(100%)"), me(t || o !== a ? null : le(n));
|
|
146
|
+
}, ge = (e) => {
|
|
132
147
|
if (typeof e != "object" || !e) return 0;
|
|
133
148
|
let { top: t } = e;
|
|
134
|
-
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t),
|
|
135
|
-
},
|
|
149
|
+
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t), h);
|
|
150
|
+
}, _e = (e) => {
|
|
136
151
|
if (Array.isArray(e) && e.length === 4 && e.every((e) => typeof e == "number" && Number.isFinite(e) && e >= 0)) return e.some((e) => e > 0) ? e : void 0;
|
|
137
|
-
},
|
|
152
|
+
}, ve = (e, t) => {
|
|
138
153
|
if (typeof e != "object" || !e) return null;
|
|
139
154
|
let { x: n, y: r, width: i, height: a } = e;
|
|
140
155
|
if (![
|
|
@@ -143,7 +158,7 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
143
158
|
i,
|
|
144
159
|
a
|
|
145
160
|
].every((e) => typeof e == "number" && Number.isFinite(e))) return null;
|
|
146
|
-
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f =
|
|
161
|
+
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f = _e(e.radius);
|
|
147
162
|
return {
|
|
148
163
|
x: c,
|
|
149
164
|
y: l,
|
|
@@ -151,49 +166,49 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
151
166
|
height: d - l,
|
|
152
167
|
...f ? { radius: f } : {}
|
|
153
168
|
};
|
|
154
|
-
},
|
|
169
|
+
}, O = {
|
|
155
170
|
"not-rendered": "this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout",
|
|
156
171
|
clipped: "it is clipped away or positioned outside the viewport",
|
|
157
172
|
"not-shown": "it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter"
|
|
158
|
-
},
|
|
173
|
+
}, ye = (e) => Array.isArray(e) ? e.slice(0, m).flatMap((e) => {
|
|
159
174
|
if (typeof e != "object" || !e) return [];
|
|
160
175
|
let { kind: t, cause: n, level: r } = e;
|
|
161
|
-
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in
|
|
176
|
+
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in O) || r !== "full" && r !== "liveness" ? [] : [{
|
|
162
177
|
kind: t,
|
|
163
178
|
cause: n,
|
|
164
179
|
level: r
|
|
165
180
|
}];
|
|
166
|
-
}) : [],
|
|
167
|
-
for (let { kind: t, cause: n, level: r } of e)
|
|
181
|
+
}) : [], k = /* @__PURE__ */ new Set(), be = (e) => {
|
|
182
|
+
for (let { kind: t, cause: n, level: r } of e) k.has(t) || (k.add(t), console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${O[n]}. Nobody using this page can see or answer it.
|
|
168
183
|
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.` + (r === "liveness" ? "\nThis browser reports limited detail, so the cause above is a best guess." : "")));
|
|
169
|
-
},
|
|
184
|
+
}, A = (e, t) => {
|
|
170
185
|
if (typeof e != "object" || !e) return null;
|
|
171
|
-
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0,
|
|
186
|
+
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, p) : []).map((e) => ve(e, t)).filter((e) => e !== null && e.width > 0 && e.height > 0);
|
|
172
187
|
return {
|
|
173
188
|
modal: n.modal === !0,
|
|
174
189
|
rects: r,
|
|
175
|
-
hidden:
|
|
176
|
-
inset:
|
|
190
|
+
hidden: ye(n.hidden),
|
|
191
|
+
inset: ge(n.inset)
|
|
177
192
|
};
|
|
178
|
-
},
|
|
179
|
-
if (!b ||
|
|
180
|
-
let e = S(b), t =
|
|
181
|
-
t &&
|
|
182
|
-
},
|
|
183
|
-
typeof ResizeObserver < "u" && (
|
|
184
|
-
},
|
|
185
|
-
|
|
193
|
+
}, xe = () => b !== null, j = null, M = null, Se = () => {
|
|
194
|
+
if (!b || j === null) return;
|
|
195
|
+
let e = S(b), t = A(j, e);
|
|
196
|
+
t && D(b, t, e);
|
|
197
|
+
}, Ce = (e) => {
|
|
198
|
+
typeof ResizeObserver < "u" && (M ??= new ResizeObserver(Se), M.disconnect(), M.observe(e));
|
|
199
|
+
}, we = (e) => {
|
|
200
|
+
ne(e), D(e, {
|
|
186
201
|
modal: !1,
|
|
187
202
|
rects: [],
|
|
188
203
|
hidden: [],
|
|
189
204
|
inset: 0
|
|
190
|
-
}, S(e)), b = e,
|
|
191
|
-
},
|
|
205
|
+
}, S(e)), b = e, Ce(e);
|
|
206
|
+
}, Te = (e) => {
|
|
192
207
|
if (!b) return;
|
|
193
|
-
let t = S(b), n =
|
|
194
|
-
n && (
|
|
195
|
-
},
|
|
196
|
-
if (!
|
|
208
|
+
let t = S(b), n = A(e, t);
|
|
209
|
+
n && (j = e, D(b, n, t), be(n.hidden));
|
|
210
|
+
}, N = "https://fkn.app", P = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, F = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, I = t(F), Ee = "fkn-api-port", De = "fkn-api-port-ack", Oe = 2e3, ke = () => {
|
|
211
|
+
if (!P || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
|
|
197
212
|
let e;
|
|
198
213
|
try {
|
|
199
214
|
e = window.parent;
|
|
@@ -208,37 +223,34 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
208
223
|
} catch {}
|
|
209
224
|
n(e);
|
|
210
225
|
}, i = (e) => {
|
|
211
|
-
e.data?.type ===
|
|
212
|
-
}, a = setTimeout(() => r(void 0),
|
|
226
|
+
e.data?.type === De && r(t.port1);
|
|
227
|
+
}, a = setTimeout(() => r(void 0), Oe);
|
|
213
228
|
t.port1.addEventListener("message", i), t.port1.start();
|
|
214
229
|
try {
|
|
215
|
-
e.postMessage({ type:
|
|
230
|
+
e.postMessage({ type: Ee }, N, [t.port2]);
|
|
216
231
|
} catch {
|
|
217
232
|
r(void 0);
|
|
218
233
|
}
|
|
219
234
|
});
|
|
220
|
-
},
|
|
221
|
-
if (
|
|
222
|
-
let t =
|
|
223
|
-
if (t)
|
|
235
|
+
}, L, Ae = () => {
|
|
236
|
+
if (L || !P) return L;
|
|
237
|
+
let t = P.querySelector(`iframe[src="${I}"]`);
|
|
238
|
+
if (t) L = t;
|
|
224
239
|
else {
|
|
225
|
-
let t =
|
|
226
|
-
t.setAttribute("allow", e(
|
|
240
|
+
let t = P.createElement("iframe");
|
|
241
|
+
t.setAttribute("allow", e(F)), t.src = I, P.body.appendChild(t), L = t;
|
|
227
242
|
}
|
|
228
|
-
return
|
|
229
|
-
},
|
|
230
|
-
if (!
|
|
231
|
-
let e = await
|
|
243
|
+
return d(L, I, N), we(L), L;
|
|
244
|
+
}, R = (async () => {
|
|
245
|
+
if (!P) return;
|
|
246
|
+
let e = await ke();
|
|
232
247
|
if (e) return {
|
|
233
248
|
receive: e,
|
|
234
249
|
emit: e
|
|
235
250
|
};
|
|
236
|
-
let t =
|
|
237
|
-
if (t
|
|
238
|
-
|
|
239
|
-
emit: (e, n) => t.contentWindow?.postMessage(e, M, n)
|
|
240
|
-
};
|
|
241
|
-
})(), Oe = (e, { boundRetired: t = (e) => e } = {}) => {
|
|
251
|
+
let t = Ae();
|
|
252
|
+
if (t) return await c(t), t.contentWindow ? f(t, N) : void 0;
|
|
253
|
+
})(), je = (e, { boundRetired: t = (e) => e } = {}) => {
|
|
242
254
|
let n, r = 0, i = !1, a = () => {}, o = () => new Promise((e) => {
|
|
243
255
|
a = e;
|
|
244
256
|
}), s = o(), c = s, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = 0, f = 0, p = () => {
|
|
@@ -314,52 +326,57 @@ var i = 1e4, a = 16, o = (e) => {
|
|
|
314
326
|
i = !0, n = void 0, p();
|
|
315
327
|
}
|
|
316
328
|
};
|
|
317
|
-
},
|
|
318
|
-
if (!
|
|
319
|
-
|
|
320
|
-
for (let e of [...
|
|
329
|
+
}, z = !1, B = /* @__PURE__ */ new Set(), V = () => z, Me = () => {
|
|
330
|
+
if (!z) {
|
|
331
|
+
z = !0;
|
|
332
|
+
for (let e of [...B]) try {
|
|
321
333
|
e();
|
|
322
334
|
} catch {}
|
|
323
|
-
|
|
335
|
+
B.clear();
|
|
324
336
|
}
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
if (typeof window < "u") return
|
|
337
|
+
}, H = (e) => {
|
|
338
|
+
z ? e() : B.add(e);
|
|
339
|
+
}, Ne = typeof window < "u" || typeof self < "u", U = async () => {
|
|
340
|
+
if (typeof window < "u") return R;
|
|
329
341
|
if (typeof self < "u") return {
|
|
330
342
|
receive: self,
|
|
331
343
|
emit: self
|
|
332
344
|
};
|
|
333
|
-
},
|
|
334
|
-
let e = await
|
|
345
|
+
}, W = "fkn-api", Pe = "fkn-api-window", Fe = { async *[Symbol.asyncIterator]() {
|
|
346
|
+
let e = await U();
|
|
335
347
|
if (!e) await new Promise(() => {});
|
|
336
348
|
else {
|
|
337
|
-
if (!
|
|
349
|
+
if (!V()) {
|
|
338
350
|
let t = new AbortController();
|
|
339
|
-
|
|
340
|
-
for await (let
|
|
341
|
-
key:
|
|
351
|
+
H(() => t.abort());
|
|
352
|
+
for await (let r of n({}, {
|
|
353
|
+
key: W,
|
|
342
354
|
transport: e,
|
|
343
355
|
unregisterSignal: t.signal
|
|
344
356
|
})) {
|
|
345
357
|
if (t.signal.aborted) break;
|
|
346
|
-
yield
|
|
358
|
+
yield r;
|
|
347
359
|
}
|
|
348
360
|
}
|
|
349
|
-
yield*
|
|
350
|
-
key:
|
|
361
|
+
yield* n({}, {
|
|
362
|
+
key: Pe,
|
|
351
363
|
transport: e
|
|
352
364
|
});
|
|
353
365
|
}
|
|
354
|
-
} },
|
|
366
|
+
} }, G = !1, K = U().then((e) => new Promise((t) => {
|
|
355
367
|
if (!e) return;
|
|
356
|
-
let
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
368
|
+
let n = new AbortController();
|
|
369
|
+
r({
|
|
370
|
+
transport: e,
|
|
371
|
+
key: W,
|
|
372
|
+
unregisterSignal: n.signal,
|
|
373
|
+
listener: () => {
|
|
374
|
+
n.abort(), G = !0, t();
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
})), q = je(Fe, { boundRetired: (e) => Promise.race([e, K.then(() => Q(e, () => new Z()))]) });
|
|
378
|
+
H(() => q.retire());
|
|
379
|
+
var J = Promise.race([q.first, new Promise((e) => H(e))]).then(() => q.facade), Y = 8e3, Ie = 1e3, Le = !1, X = class extends Error {
|
|
363
380
|
constructor(e, t) {
|
|
364
381
|
super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`), this.name = "BrokerUnreachableError";
|
|
365
382
|
}
|
|
@@ -368,22 +385,22 @@ var q = Promise.race([K.first, new Promise((e) => V(e))]).then(() => K.facade),
|
|
|
368
385
|
super("FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload"), this.name = "OwnChannelUnavailableError";
|
|
369
386
|
}
|
|
370
387
|
}, Q = (e, t) => {
|
|
371
|
-
let n =
|
|
388
|
+
let n = Le ? Ie : Y;
|
|
372
389
|
return Promise.race([e, new Promise((e, r) => setTimeout(() => {
|
|
373
|
-
|
|
390
|
+
Le = !0, r(t(n));
|
|
374
391
|
}, n))]);
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
let e = setTimeout(() => console.error(new Z()),
|
|
379
|
-
|
|
392
|
+
}, Re = (e) => V() ? Q(q.routable().then(() => q.facade), (t) => G ? new Z() : new X(e, t)) : Q(J, (t) => new X(e, t));
|
|
393
|
+
H(() => {
|
|
394
|
+
K.then(() => {
|
|
395
|
+
let e = setTimeout(() => console.error(new Z()), Y);
|
|
396
|
+
q.routable().then(() => clearTimeout(e));
|
|
380
397
|
});
|
|
381
398
|
});
|
|
382
|
-
var $ =
|
|
399
|
+
var $ = q.onEpoch, ze = q.current, Be = q.lastCall, Ve = q.inFlight;
|
|
383
400
|
$((e) => {
|
|
384
|
-
|
|
385
|
-
exactClips:
|
|
386
|
-
colorScheme:
|
|
401
|
+
xe() && e.overlay.setHost(Te, {
|
|
402
|
+
exactClips: ie(),
|
|
403
|
+
colorScheme: te
|
|
387
404
|
}).catch(() => {});
|
|
388
405
|
});
|
|
389
|
-
export {
|
|
406
|
+
export { Be as a, ze as c, Me as d, R as f, Ve as i, Ne as l, X as n, J as o, Z as r, Re as s, Y as t, $ as u };
|