@fkn/lib 0.9.49 → 0.9.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -0
- package/{cloud-BmwojOb5.cjs → cloud-CAN_iu2o.cjs} +1 -1
- package/{cloud-B4_qsdaE.js → cloud-JXQKSDrW.js} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.js +1 -1
- package/{extension-hOZN6A1U.js → extension-1Je_RJ6_.js} +1 -1
- package/{extension-uAlpUogG.cjs → extension-4koB6bS6.cjs} +1 -1
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/{lib-5z-jA7ND.cjs → lib-35d-3W0p.cjs} +1 -1
- package/{lib-Dhq4W2V8.js → lib-B2cML3Tq.js} +12 -10
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2026 Horion Corporation. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This package is proprietary. It is not open source.
|
|
4
|
+
|
|
5
|
+
You may install and use this package, unmodified, to build, test and
|
|
6
|
+
distribute applications that use the FKN platform, and you may include it
|
|
7
|
+
in those applications as built output. You may not modify it, publish it on
|
|
8
|
+
its own, or use it to build a product that replaces FKN.
|
|
9
|
+
|
|
10
|
+
It is provided "as is", without warranty of any kind. To the extent the law
|
|
11
|
+
allows, Horion Corporation is not liable for any damages arising from its
|
|
12
|
+
use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-5z-jA7ND.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-DMnVye0K.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-BfkfFsNI.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,b=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),b=()=>n.t([...c,...v(f)]),x=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.O(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.O(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.O(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.O(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.O(`frame: navigate the frame before fetch`,`fetch`);if(await x(r,{category:`network`,hosts:p})===!1)throw t.O(y(`fetch`,`network`,u||null),`fetch`);return}let S=await g();if(!S)throw t.O(`frame: navigate the frame before ${e}`,e);if(!b().includes(S))throw t.O(h,e);let C=t.m(_);if(C===void 0||C===`evaluation`&&S===m()&&await u?.()||v===`critical`&&p.has(`${_} ${S}`))return;let{request:w}=await a();if(!w)return;let T=n.t([S,...c]),E=await x(w,v===`critical`?{key:_,hosts:T,attach:i}:{category:C,hosts:T});if(E===!1)throw t.O(y(e,C,null),e);if(E===`once`&&l!==`ensure`)for(let e of T)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:e,critical:t,category:n})=>t?{key:e,hosts:s,attach:i}:{category:n,hosts:s}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:b}},x=e=>e,S=5e3,C=new Set([]),w=()=>`https://fkn.app`,T=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,E=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.T(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},D=e=>Object.assign(Error(e),{name:t.E}),O=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,k=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,A=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,j=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,M=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,N=3e4,P=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,F=2e4,I=async(e,n)=>{if(typeof e.seed!=`function`)throw t.M(P,`storageState`,`cloud`);try{await E(e.seed(n),F,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.D(e)?t.M(P,`storageState`,`cloud`):e}},L=`frame.clearCookies: the render proxy did not answer within ${N}ms; the cookies may or may not be gone, and calling it again is safe`,ee=e=>t.D(e)&&e.message===t.A(`addScriptTag`).message,R=!1,te=()=>{R||(R=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},z=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},B=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:x}=b({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>C.has(r)?Promise.reject(t.A(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n,r],phase:`execute`}),E(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await E(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,A)}catch(e){throw ee(e)?t.M(k,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.M(j,`clearCookies`,`cloud`);if(x().length===0)throw t.O(M,`clearCookies`);await E(l(()=>e.clearCookies(n)),N,L)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.M(O,`postMessage`,`cloud`);if(r!==`*`&&!x().includes(new URL(r).hostname))throw t.O(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await E(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+S,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,V=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},H=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},de=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>D(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>D(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),fe=()=>D(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>D(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=w(),m=crypto.randomUUID(),h=T(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?H(f,m):null,y=window.open(V({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,S=!1,C=null,D=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&de(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?D(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&D(S?U():fe()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>D(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&D(S?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let L=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await L(E((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:x(t.lt)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));S=!0,clearInterval(P);let n=0,r=setInterval(()=>{E(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&D(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await L(E(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await L(I(e,a)),i.r(`attached frame`,b.signal);let o=B({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:z({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await E(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}D(U())})(),closed:k});return a!==void 0&&l&&await L(d.goto(l)),c?.length&&await L(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw D(n),n}},he=2e4,G=65e3,K=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,q=e=>e.split(`#`)[0]??``,J=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!K(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Te())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,w());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>D(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],Y=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},X=async(e,n)=>{let r=typeof e.blank==`function`?await E(e.blank(),G,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||q(r)!==q(n))throw t.M(ge,`blank`,`cloud`)},we=async(e,a,o)=>{let c=J(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(K(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,w());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=T(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let S=new AbortController,C=l.referrerPolicy,D=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await E((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:w(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:S.signal,revivableModules:x(t.lt)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await E(e.ready(),G,`cloud.attachFrame: the render proxy never became ready`),c&&await X(e,c),o!==void 0&&await I(e,o),(g||c)&&Y(l),ye(l,()=>S.abort()),i.r(`attached frame`,S.signal);let n=l.contentWindow,r=B({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(S.signal.aborted||!l.isConnected||l.contentWindow!==n)throw S.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>Y(l),relay:z({from:()=>n,origin:w(),attach:O,signal:S.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw S.abort(),l.referrerPolicy=C,l.allow=D,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):we(e,r,i)}),Te=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},Ee=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-35d-3W0p.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-DMnVye0K.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-BfkfFsNI.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,b=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),b=()=>n.t([...c,...v(f)]),x=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.O(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.O(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.O(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.O(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.O(`frame: navigate the frame before fetch`,`fetch`);if(await x(r,{category:`network`,hosts:p})===!1)throw t.O(y(`fetch`,`network`,u||null),`fetch`);return}let S=await g();if(!S)throw t.O(`frame: navigate the frame before ${e}`,e);if(!b().includes(S))throw t.O(h,e);let C=t.m(_);if(C===void 0||C===`evaluation`&&S===m()&&await u?.()||v===`critical`&&p.has(`${_} ${S}`))return;let{request:w}=await a();if(!w)return;let T=n.t([S,...c]),E=await x(w,v===`critical`?{key:_,hosts:T,attach:i}:{category:C,hosts:T});if(E===!1)throw t.O(y(e,C,null),e);if(E===`once`&&l!==`ensure`)for(let e of T)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:e,critical:t,category:n})=>t?{key:e,hosts:s,attach:i}:{category:n,hosts:s}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:b}},x=e=>e,S=5e3,C=new Set([]),w=()=>`https://fkn.app`,T=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,E=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.T(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},D=e=>Object.assign(Error(e),{name:t.E}),O=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,k=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,A=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,j=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,M=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,N=3e4,P=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,F=2e4,I=async(e,n)=>{if(typeof e.seed!=`function`)throw t.M(P,`storageState`,`cloud`);try{await E(e.seed(n),F,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.D(e)?t.M(P,`storageState`,`cloud`):e}},L=`frame.clearCookies: the render proxy did not answer within ${N}ms; the cookies may or may not be gone, and calling it again is safe`,ee=e=>t.D(e)&&e.message===t.A(`addScriptTag`).message,R=!1,te=()=>{R||(R=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},z=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},B=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:x}=b({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>C.has(r)?Promise.reject(t.A(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n,r],phase:`execute`}),E(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await E(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,A)}catch(e){throw ee(e)?t.M(k,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.M(j,`clearCookies`,`cloud`);if(x().length===0)throw t.O(M,`clearCookies`);await E(l(()=>e.clearCookies(n)),N,L)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.M(O,`postMessage`,`cloud`);if(r!==`*`&&!x().includes(new URL(r).hostname))throw t.O(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await E(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+S,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,V=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},H=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},de=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>D(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>D(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),fe=()=>D(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>D(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=w(),m=crypto.randomUUID(),h=T(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?H(f,m):null,y=window.open(V({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,S=!1,C=null,D=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&de(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?D(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&D(S?U():fe()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>D(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&D(S?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let L=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await L(E((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:x(t.lt)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));S=!0,clearInterval(P);let n=0,r=setInterval(()=>{E(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&D(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await L(E(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await L(I(e,a)),i.r(`attached frame`,b.signal);let o=B({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:z({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await E(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}D(U())})(),closed:k});return a!==void 0&&l&&await L(d.goto(l)),c?.length&&await L(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw D(n),n}},he=2e4,G=65e3,K=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,q=e=>e.split(`#`)[0]??``,J=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!K(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Te())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,w());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>D(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],Y=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},X=async(e,n)=>{let r=typeof e.blank==`function`?await E(e.blank(),G,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||q(r)!==q(n))throw t.M(ge,`blank`,`cloud`)},we=async(e,a,o)=>{let c=J(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(K(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,w());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=T(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let S=new AbortController,C=l.referrerPolicy,D=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await E((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:w(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:S.signal,revivableModules:x(t.lt)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await E(e.ready(),G,`cloud.attachFrame: the render proxy never became ready`),c&&await X(e,c),o!==void 0&&await I(e,o),(g||c)&&Y(l),ye(l,()=>S.abort()),i.r(`attached frame`,S.signal);let n=l.contentWindow,r=B({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(S.signal.aborted||!l.isConnected||l.contentWindow!==n)throw S.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>Y(l),relay:z({from:()=>n,origin:w(),attach:O,signal:S.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw S.abort(),l.referrerPolicy=C,l.allow=D,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):we(e,r,i)}),Te=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},Ee=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { A as t, D as n, E as r, M as i, O as a, T as o, _ as s, c, f as l, g as u, h as d, l as f, lt as p, m, o as h, p as g, s as _, u as v, x as y, y as b } from "./lib-
|
|
2
|
+
import { A as t, D as n, E as r, M as i, O as a, T as o, _ as s, c, f as l, g as u, h as d, l as f, lt as p, m, o as h, p as g, s as _, u as v, x as y, y as b } from "./lib-B2cML3Tq.js";
|
|
3
3
|
import { c as x, m as S, t as C } from "./hosts-t7CKGTRz.js";
|
|
4
4
|
import { l as w, m as T, n as E, o as D, s as O } from "./api-ySazPAwN.js";
|
|
5
5
|
import { r as k } from "./busy-DsMWrSzc.js";
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-BfkfFsNI.cjs"),t=require("./cloud-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-BfkfFsNI.cjs"),t=require("./cloud-CAN_iu2o.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
|
package/cloud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./proxy-BXkxwBxK.js";
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-JXQKSDrW.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
5
|
import { t as o } from "./net.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, B as n, C as r, D as i, E as a, F as o, G as ee, H as te, I as ne, J as s, K as c, L as l, N as u, P as d, Q as re, R as ie, S as f, T as p, U as m, V as h, W as g, X as _, Y as v, Z as y, _ as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, i as A, j, k as M, lt as N, mt as P, n as ae, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, ut as U, v as W, w as G, x as K, y as q, z as J } from "./lib-
|
|
2
|
+
import { $ as t, B as n, C as r, D as i, E as a, F as o, G as ee, H as te, I as ne, J as s, K as c, L as l, N as u, P as d, Q as re, R as ie, S as f, T as p, U as m, V as h, W as g, X as _, Y as v, Z as y, _ as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, i as A, j, k as M, lt as N, mt as P, n as ae, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, ut as U, v as W, w as G, x as K, y as q, z as J } from "./lib-B2cML3Tq.js";
|
|
3
3
|
import { o as oe, p as se } from "./api-ySazPAwN.js";
|
|
4
4
|
import { t as ce } from "./proxy-BXkxwBxK.js";
|
|
5
5
|
import { available as le, fetch as ue } from "./desktop.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-35d-3W0p.cjs"),n=require("./api-DMnVye0K.cjs"),r=require("./proxy-BfkfFsNI.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(typeof window>`u`)return!1;if(t.et())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.et()&&e(!0)},t.$.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.$.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.nt(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.et(),u=async(e,a)=>{if(n.p(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.U(e,a)}return l()?t.U(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},d=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>a,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>5,ExtensionOperationUnsupportedError:()=>t.at,ExtensionOutdatedError:()=>t.ot,FORGEABLE_HEADERS:()=>t.Y,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.k,LOCATOR_ERROR:()=>t.P,LOCATOR_INVALID:()=>t.I,LOCATOR_UNSUPPORTED:()=>t.E,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.T,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.H,assertForgeableHeaders:()=>t.X,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.Z,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.ut,cookies:()=>t.B,createFrame:()=>t.y,createVideoElementHandle:()=>t.dt,events:()=>t.$,extension:()=>t.$,fetch:()=>t.U,fetchCredentialedPermission:()=>t.W,fetchLocalPermission:()=>t.G,fetchPermission:()=>t.K,gotoPermission:()=>t.b,handleRevivableModules:()=>t.lt,hasForgedCookie:()=>t.Q,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.q,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.et,isLocalNetworkUrl:()=>t.J,isLocatorDenied:()=>t.F,isLocatorInvalid:()=>t.j,isLocatorUnsupported:()=>t.D,isPermissionDenied:()=>t.n,isTerminalError:()=>t.N,isType:()=>t.ft,modifyRequestHeadersPermission:()=>t.L,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.V,readExtensionHandshake:()=>t.tt,removeRequestHeaderRule:()=>t.R,revive:()=>t.pt,setMissingExtensionHandler:()=>t.nt,setRequestHeaderRule:()=>t.z,supportsOperation:()=>t.ct,type:()=>t.mt,waitForExtensionExposure:()=>t.rt});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-35d-3W0p.cjs"),t=require("./extension-4koB6bS6.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.it,exports.ExtensionOperationUnsupportedError=e.at,exports.ExtensionOutdatedError=e.ot,exports.FORGEABLE_HEADERS=e.Y,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.k,exports.LOCATOR_ERROR=e.P,exports.LOCATOR_INVALID=e.I,exports.LOCATOR_UNSUPPORTED=e.E,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.st,exports.TimeoutError=e.T,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.H,exports.assertForgeableHeaders=e.X,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.Z,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.ut,exports.cookies=e.B,exports.createFrame=e.y,exports.createVideoElementHandle=e.dt,exports.events=e.$,exports.extension=e.$,exports.fetch=e.U,exports.fetchCredentialedPermission=e.W,exports.fetchLocalPermission=e.G,exports.fetchPermission=e.K,exports.gotoPermission=e.b,exports.handleRevivableModules=e.lt,exports.hasForgedCookie=e.Q,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.q,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.et,exports.isLocalNetworkUrl=e.J,exports.isLocatorDenied=e.F,exports.isLocatorInvalid=e.j,exports.isLocatorUnsupported=e.D,exports.isPermissionDenied=e.n,exports.isTerminalError=e.N,exports.isType=e.ft,exports.modifyRequestHeadersPermission=e.L,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.V,exports.readExtensionHandshake=e.tt,exports.removeRequestHeaderRule=e.R,exports.revive=e.pt,exports.setMissingExtensionHandler=e.nt,exports.setRequestHeaderRule=e.z,exports.supportsOperation=e.ct,exports.type=e.mt,exports.waitForExtensionExposure=e.rt;
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-
|
|
2
|
-
import { a as te, i as ne, o as re, r as ie } from "./extension-
|
|
1
|
+
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-B2cML3Tq.js";
|
|
2
|
+
import { a as te, i as ne, o as re, r as ie } from "./extension-1Je_RJ6_.js";
|
|
3
3
|
export { N as ATTACH_FRAME_EVENT_KEY, te as BACKGROUND_STOPPED, Z as CATEGORIES, P as EXTENSION_ABI, E as ExtensionOperationUnsupportedError, V as ExtensionOutdatedError, S as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, I as LOCATOR_DENIED, p as LOCATOR_ERROR, c as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, q as PERMISSION_DENIED, K as REQUIRED_EXTENSION_ABI, _ as TimeoutError, Q as assertAttachableFrameUrl, s as assertFetchableUrl, x as assertForgeableHeaders, g as assertLockdownApplicable, C as assertOneCookieIdentity, T as attachFrame, X as attachFramePermission, ie as available, Y as box, t as cookies, $ as createFrame, k as createVideoElementHandle, e as events, e as extension, v as fetch, b as fetchCredentialedPermission, o as fetchLocalPermission, u as fetchPermission, D as gotoPermission, L as handleRevivableModules, m as hasForgedCookie, re as isBackgroundStopped, U as isBlockedFetchUrl, n as isBlockedFrameUrl, A as isExtensionExposed, l as isLocalNetworkUrl, a as isLocatorDenied, F as isLocatorInvalid, r as isLocatorUnsupported, z as isPermissionDenied, f as isTerminalError, j as isType, d as modifyRequestHeadersPermission, W as permissions, ne as promptInstall, y as readCookiePermission, J as readExtensionHandshake, h as removeRequestHeaderRule, H as revive, B as setMissingExtensionHandler, ee as setRequestHeaderRule, O as supportsOperation, R as type, G as waitForExtensionExposure };
|
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-35d-3W0p.cjs"),n=require("./extension-4koB6bS6.cjs"),r=require("./api-DMnVye0K.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./cloud-CAN_iu2o.cjs"),o=require("./dns.cjs"),s=require("./net.cjs"),c=require("./dgram.cjs"),l=require("./http.cjs"),u=require("./desktop.cjs"),d=require("./account.cjs"),f=require("./fs-zERmcLRS.cjs"),p=require("./opfs.cjs"),m=require("./packages.cjs"),h=require("./rooms.cjs"),g=require("./storage.cjs"),_=require("./connect-button-BpXDs7tw.cjs");let v=require("osra");var y=1e4,b=150,x=()=>new Promise(e=>{if(t.et())return e(!0);let n,r=setTimeout(()=>i(t.et()),y),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.et()),b)},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()}),S=(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`?C(i):a.i(i)}),C=async e=>(a.a(e),await x(),t.a(e)),w=`https://fkn.app`,T=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(),i.r(`relayed worker`,t?.unregisterSignal);let a=n.emit instanceof MessagePort?{}:{originA:t?.originA??w,originB:t?.originB??`*`};(0,v.relay)(n,e,{key:`fkn-api`,...a,unregisterSignal:t?.unregisterSignal})},E=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),D=async()=>typeof window>`u`?null:(await r.o).relay.prompt().catch(()=>null),O=new Set,k=e=>(O.add(e),()=>{O.delete(e)}),A=()=>{if(O.size===0)return!1;for(let e of[...O])try{e()}catch{}return!0},j=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},M=e.t({applyUpdate:()=>G,busyReasons:()=>W,onUpdate:()=>z,onUpdateTaken:()=>B,updateReady:()=>N}),N=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),P=new Set,F=!1,I=()=>{F=!0;for(let e of[...P])try{e()}catch{}},L=0,R=()=>{let e=r.c();e&&P.size!==0&&L!==e.epoch&&(L=e.epoch,F=!1,Promise.resolve(e.remote.shell?.onUpdate(I)).catch(()=>{L===e.epoch&&(L=0)}))};typeof window<`u`&&r.u(R);var z=async e=>{if(typeof window>`u`)return()=>{};if(P.add(e),F)try{e()}catch{}return R(),()=>{P.delete(e)}},B=e=>typeof window>`u`?()=>{}:k(e),V=0,H=!1,U=()=>{if(!A()&&!H){H=!0;try{location.reload()}catch{}}};typeof window<`u`&&r.u(()=>{let e=r.c();if(!e||V===e.epoch)return;V=e.epoch;let t=j(e.remote.shell,U);if(!t){V=0;return}t.catch(()=>{V===e.epoch&&(V=0)})});var W=()=>i.n(),G=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 d.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.H,exports.assertForgeableHeaders=t.X,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.Z,exports.attachFrame=S,exports.attachFramePermission=t.v,exports.box=t.ut,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return a.n}}),exports.connect=E,exports.connectButtonUrl=_.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 f.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 p.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return m.t}}),exports.permissions=t.r,exports.promptInstall=n.i,exports.promptRelay=D,exports.readCookiePermission=t.V,exports.readExtensionHandshake=t.tt,exports.relayWorker=T,exports.removeRequestHeaderRule=t.R,exports.revive=t.pt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return h.t}}),exports.setMissingExtensionHandler=t.nt,exports.setRequestHeaderRule=t.z,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"storage",{enumerable:!0,get:function(){return g.t}}),exports.supportsOperation=t.ct,exports.type=t.mt,exports.waitForExtensionExposure=t.rt;
|
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as ee, K as te, L as ne, N as re, P as ie, Q as ae, R as oe, S as se, T as ce, V as le, W as ue, X as de, Y as fe, Z as l, _ as u, a as d, at as f, b as p, ct as m, dt as h, et as g, ft as _, g as v, i as y, it as b, j as x, k as S, lt as C, mt as w, n as T, nt as E, o as D, ot as O, pt as k, q as A, r as j, rt as M, st as N, t as P, tt as F, ut as I, v as L, w as R, x as z, y as B, z as V } from "./lib-
|
|
3
|
-
import { a as pe, i as me, n as he, o as ge, t as _e } from "./extension-
|
|
2
|
+
import { B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as ee, K as te, L as ne, N as re, P as ie, Q as ae, R as oe, S as se, T as ce, V as le, W as ue, X as de, Y as fe, Z as l, _ as u, a as d, at as f, b as p, ct as m, dt as h, et as g, ft as _, g as v, i as y, it as b, j as x, k as S, lt as C, mt as w, n as T, nt as E, o as D, ot as O, pt as k, q as A, r as j, rt as M, st as N, t as P, tt as F, ut as I, v as L, w as R, x as z, y as B, z as V } from "./lib-B2cML3Tq.js";
|
|
3
|
+
import { a as pe, i as me, n as he, o as ge, t as _e } from "./extension-1Je_RJ6_.js";
|
|
4
4
|
import { c as H, d as ve, f as ye, o as U, u as W } from "./api-ySazPAwN.js";
|
|
5
5
|
import { n as be, r as xe } from "./busy-DsMWrSzc.js";
|
|
6
|
-
import { a as Se, i as G, n as Ce } from "./cloud-
|
|
6
|
+
import { a as Se, i as G, n as Ce } from "./cloud-JXQKSDrW.js";
|
|
7
7
|
import { t as we } from "./dns.js";
|
|
8
8
|
import { t as Te } from "./net.js";
|
|
9
9
|
import { t as Ee } from "./dgram.js";
|
|
@@ -50,4 +50,4 @@ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./hosts-GNBhZO3-.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(`;`)}},ot=(e,t)=>{t||={};let n=1,r=1;function i(){let e={line:n,column:r};return i=>(i.position=new nt(e,{line:n,column:r},t?.source||``),u(),i)}let a=[];function o(i){let o=new tt(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:N.comment,comment:n[0].slice(2,-2)})):o(`End of comment missing`)}function p(){let t=P(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=P(e,t,r);if(i===-1)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(I(n).replace(F,``),[`,`]).map(e=>I(e))}function m(){let t=i(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;l(n);let r=I(n[0]),a=/^:\s*/.exec(e);if(!a)return o(`property missing ':'`);l(a);let s=``,c=P(e,[`;`,`}`]);c!==-1&&(s=e.substring(0,c),l([s]),s=I(s).replace(F,``));let u=t({type:N.declaration,property:r.replace(F,``),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=P(e,[`{`]);if(t===-1)return!1;let n=P(e,[`;`]),r=P(e,[`}`]);return!(n!==-1&&n<t)&&!(r!==-1&&r<t)}function _(){let n=[];if(!s())return o(`missing '{'`);for(d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=S();if(e){n.push(e),d(n);continue}}if(g()){let e=C();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 v(){let n=[];for(u(),d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=S();if(e){n.push(e),d(n);continue}}if(g()){let e=C();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 y(){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:N.keyframe,values:t,declarations:h()||[]})}let ee=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*`),te=x(`import`),b=x(`charset`),ne=x(`namespace`);function x(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 S(){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=y();for(;p;)f.push(p),f=f.concat(d()),p=y();return c()?t({type:N.keyframes,name:u,vendor:r,keyframes:f}):o(`@keyframes missing '}'`)}()||function(){let t=i(),n=/^@media *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@media missing '{'`);let a=v();return c()?t({type:N.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:N.customMedia,name:I(r[1]),media:I(r[2])})}()||function(){let t=i(),n=/^@supports *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@supports missing '{'`);let a=v();return c()?t({type:N.supports,supports:r,rules:a}):o(`@supports missing '}'`)}()||te()||b()||ne()||function(){let t=i(),n=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!n)return;let r=l(n),a=I(r[1]),u=I(r[2]);if(!s())return o(`@document missing '{'`);let d=v();return c()?t({type:N.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=S();if(e){a.push(e),d(a);continue}}let t=m();if(!t)break;a.push(t),d(a)}return c()?t({type:N.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=v();return c()?t({type:N.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:N.fontFace,declarations:r}):o(`@font-face missing '}'`)}()||function(){let t=i(),n=/^@font-feature-values\s+([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@font-feature-values missing '{'`);let a=v();return c()?t({type:N.fontFeatureValues,fontFamily:r,rules:a}):o(`@font-feature-values missing '}'`)}()||function(){let t=i(),n=/^@container *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@container missing '{'`);let a=v();return c()?t({type:N.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=v();return c()?t({type:N.startingStyle,rules:r}):o(`@starting-style missing '}'`)}()||function(){let t=i(),n=/^@layer *([^{;@]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s()){let n=/^[;\s]*/.exec(e);return n&&l(n),t({type:N.layer,layer:r})}let a=v();return c()?t({type:N.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:N.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:N.counterStyle,name:r,declarations:a}):o(`@counter-style missing '}'`)}()||function(){let t=i(),n=/^@scope\s*([^{]*)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@scope missing '{'`);let a=v();return c()?t({type:N.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:N.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:N.positionTry,name:r,declarations:a}):o(`@position-try missing '}'`)}()||function(){let t=i(),n=ee.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:N.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=P(e,[`{`,`;`]);if(u!==-1&&u>0&&(a=I(e.substring(0,u)),l([e.substring(0,u)])),s()){let e=v();return c()?t({type:N.atRule,name:r,prelude:a,rules:e}):o(`@${r} missing '}'`)}let d=/^[;\s]*/.exec(e);return d&&l(d),t({type:N.atRule,name:r,prelude:a})}()}function C(){let e=i(),t=p();return t?(d(),e({type:N.rule,selectors:t,declarations:_()||[]})):o(`selector missing`)}return it(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=S()||C(),!n){if(t?.silent){l([e.charAt(0)]),u(),d(r);continue}break}r.push(n),d(r)}return r}();return{type:N.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}}())},st=(e,t)=>new at(t||{}).compile(e),ct=Object.defineProperty,lt=(e,t)=>{let n={};for(var r in e)ct(n,r,{get:e[r],enumerable:!0});return t||ct(n,Symbol.toStringTag,{value:`Module`}),n},ut=`LocatorError`,dt=`LocatorUnsupportedError`,ft=`LocatorDeniedError`,pt=`LocatorInvalidError`,mt=e=>typeof e==`object`&&e?e.name:void 0,L=e=>Object.assign(Error(e),{name:ut}),R=(e,t=``,n)=>Object.assign(Error(e),{name:dt,operation:t,backend:n}),ht=(e,t)=>R(`Locator operation not supported${t?` on the ${t} backend`:``}: ${e}`,e,t),z=(e,t)=>Object.assign(Error(e),{name:ft,operation:t}),gt=(e,t)=>Object.assign(Error(e),{name:pt,operation:t}),B=class extends Error{name=`TimeoutError`;constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause})}},_t=e=>mt(e)===dt,vt=e=>mt(e)===ft,yt=e=>mt(e)===pt,bt=e=>vt(e)||_t(e)||yt(e),V=e=>{let t=(e.ownerDocument??e).defaultView;if(!t)throw L(`the resolved element belongs to a document with no window`);return t},xt=(e,t)=>{let n=e?.[t];return typeof n==`function`?n:null},St=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=(()=>{try{return xt(V(e),t)}catch{return null}})();if(n&&e instanceof n)return n;let r=xt(globalThis,t);return r&&e instanceof r?r:null},H=(e,t)=>St(e,t)!==null,U=e=>{if(e.length===0)throw L(`No elements found`);if(e.length>1)throw L(`Strict mode violation: locator resolved to ${e.length} elements`);return e[0]},Ct=(e,t)=>{if(!H(e,t))throw L(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);return e},wt=e=>e.tagName.toLowerCase(),Tt=new Set,Et=e=>{Tt.add(e)},Dt=/(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i,Ot=e=>e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\(.)/g,`$1`),kt=e=>!Dt.test(Ot(e.value)),At=new Set([N.import,N.fontFace,N.namespace,N.charset,N.document,N.comment]),jt=e=>{if(At.has(e.type))return null;if(e.type===N.declaration)return kt(e)?e:null;let t=e,n={...t};for(let e of[`declarations`,`rules`,`keyframes`]){let r=t[e];Array.isArray(r)&&(n[e]=Mt(r))}return n},Mt=e=>e.map(e=>jt(e)).filter(e=>e!==null),Nt=e=>{let t;try{t=ot(e,{silent:!0})}catch{return``}return t.stylesheet.rules=Mt(t.stylesheet.rules),st(t)},Pt=(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)},Ft={resolve:(e,t)=>{let n=e.document.createElement(`style`);n.textContent=t.noSanitize?t.content:Nt(t.content);try{Pt(e.document,n)}catch(e){console.error(e)}Et(n)}},It=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},W={kind:`frame`,ensureArgs:e=>[void 0,e],resolve:async(e,t,n={})=>{if(typeof t!=`string`)throw gt(`fetch: url must be a string`,`fetch`);let r=V(e.document),i;try{i=new r.URL(t,e.document.baseURI).href}catch{throw gt(`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:It(a.headers),body:await a.arrayBuffer()}}},G=lt({click:()=>Rt,count:()=>Kt,exists:()=>qt,fill:()=>Ht,getAttribute:()=>Wt,hover:()=>zt,isVisible:()=>Gt,textContent:()=>Ut}),Lt=(e,t)=>{let n=e.getBoundingClientRect();return{clientX:n.left+n.width*(t?.x??.5),clientY:n.top+n.height*(t?.y??.5)}},Rt={resolve:(e,t={})=>{let n=U(e.elements),r=V(n),i={bubbles:!0,cancelable:!0,composed:!0,...Lt(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}))}},zt={resolve:(e,t={})=>{let n=U(e.elements),r=V(n),i={bubbles:!0,cancelable:!0,composed:!0,...Lt(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=(St(e,`HTMLTextAreaElement`)??St(e,`HTMLInputElement`))?.prototype,r=n&&Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t},Vt=(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}}},Ht={resolve:(e,t,n={})=>{let r=U(e.elements),i=V(r),a=H(r,`HTMLInputElement`);if(a||H(r,`HTMLTextAreaElement`)){let e=r,n=a?Vt(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(H(r,`HTMLElement`)&&r.isContentEditable){r.textContent=t,r.dispatchEvent(new i.Event(`input`,{bubbles:!0}));return}throw Error(`fill: element <${wt(r)}> is not fillable`)}},Ut={resolve:(e,t={})=>U(e.elements).textContent},Wt={resolve:(e,t,n={})=>U(e.elements).getAttribute(t)},Gt={resolve:(e,t={})=>{let n=U(e.elements);if(!H(n,`HTMLElement`))return!0;let r=V(n).getComputedStyle(n);if(r?.display===`none`||r?.visibility===`hidden`)return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0}},Kt={resolve:(e,t={})=>e.elements.length},qt={resolve:(e,t={})=>e.elements.length>0},K=(e,t)=>(e.topLevel?[e.document]:e.elements).flatMap(e=>[...e.querySelectorAll(t)]),Jt=e=>e.replaceAll(`"`,`\\"`),Yt={to:`element`,css:!0,resolve:(e,t)=>K(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`descend`})},Xt={to:`frame`,css:!0,barrier:`down`,resolve:(e,t)=>K(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`down`})},Zt={element:{selectors:{locator:Yt,frameLocator:Xt,getByRole:{to:`element`,resolve:(e,t)=>K(e,`[role="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[role="${Jt(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("${Jt(e)}")`:`:has-text(...)`})},getByTestId:{to:`element`,resolve:(e,t)=>K(e,`[data-testid="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[data-testid="${Jt(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:Rt,fill:Ht,hover:zt,textContent:Ut,getAttribute:Wt,isVisible:Gt,count:Kt,exists:qt}},frame:{selectors:{locator:Yt,frameLocator:Xt,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:Ft,fetch:W}}},Qt=(e,t=Zt)=>({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}}}),$t=3e4,en=50,tn=e=>{let t=e[e.length-1];return typeof t==`object`&&t?t:void 0},nn=e=>{let t=tn(e)?.timeout;return typeof t==`number`?t:$t},rn=({executor:e,parts:t})=>({highlight:n=>e.highlight(t,n).then(()=>{},()=>{})}),an=async e=>{let t={parts:e.parts,operation:e.operation,args:e.args,phase:`ensure`};await e.gate?.(t,rn(e))},on=(e,t)=>{if(t!==void 0&&typeof t==`number`&&!(Number.isFinite(t)&&t>0))throw TypeError(`${e}: timeout must be a positive number of milliseconds, not ${t}; every call ends at its deadline, so 0 does not turn it off`)},sn=e=>typeof e==`object`&&e&&typeof e.message==`string`?e.message:String(e),cn=async e=>{let{executor:t,gate:n,parts:r,operation:i,args:a}=e;on(i,tn(a)?.timeout),n&&await n({parts:r,operation:i,args:a,phase:`execute`},rn(e));let o=nn(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(bt(e))throw e;f=e;let t=s-Date.now();if(t<=0)break;await new Promise(e=>setTimeout(e,Math.min(en,t)))}}finally{clearTimeout(d)}throw f===c?new B(c.message):new B(sn(f),{cause:f})},ln=(e,t,n,r,i)=>{let a={};for(let[o,s]of Object.entries(t[r].selectors))a[o]=(...a)=>ln(e,t,n,s.to,[...i,{kind:r,name:o,args:a}]);for(let[n,o]of Object.entries(t[r].operations))a[n]=async(...t)=>cn({...e,parts:i,operation:n,args:o.send?o.send(...t):t});for(let[o,{to:s,rewrite:c}]of Object.entries(n[r]??{}))a[o]=(...r)=>ln(e,t,n,s,c(i,...r));return a.ensure=(n,a={})=>{let o=t[r].operations[n]?.ensureArgs;return an({...e,parts:i,operation:n,args:o?.(a)??[a]})},a},un=e=>ln(e,e.modules??Zt,e.rewrites??{},`frame`,[]),dn=()=>{let e=D();return e.status===`ok`&&e.abi>=2},fn=async()=>{await O();let e=D();if(e.status===`ok`&&e.abi<2)throw new T(e.abi,2)},pn=e=>`Read the text, links and details ${e} shows.`,mn=e=>`Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`,hn=[{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:pn,cloudTitle:e=>`Read what's on ${e}`,cloudDescription:pn},{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:mn,cloudTitle:e=>`Run its own code on ${e}`,cloudDescription:mn}],gn=e=>t=>{if(typeof t!=`object`||!t)return t===void 0?[]:[t];if(t.position!==void 0)throw TypeError(`${e}: position is Playwright's offset in pixels, which no backend serves yet; pass relativePosition, a 0..1 fraction of the box`);let{relativePosition:n,...r}=t;return[n===void 0?r:{...r,position:n}]},_n=async(e,t,n)=>{try{return await W.resolve(e,t,n)}catch(e){throw bt(e)?e:z(`frame.fetch: ${e instanceof Error?`${e.name}: ${e.message}`:String(e)}; not retried, since the request may already have been sent`,`fetch`)}},vn=Qt({element:{operations:{click:{resolve:(e,t={})=>G.click.resolve(e,t),send:gn(`click`)},hover:{resolve:(e,t={})=>G.hover.resolve(e,t),send:gn(`hover`)},fill:{resolve:(e,t,n={})=>G.fill.resolve(e,t,n)},textContent:{resolve:(e,t={})=>G.textContent.resolve(e)},getAttribute:{resolve:(e,t,n={})=>G.getAttribute.resolve(e,t)},isVisible:{resolve:(e,t={})=>G.isVisible.resolve(e)},count:{resolve:(e,t={})=>G.count.resolve(e)},exists:{resolve:(e,t={})=>G.exists.resolve(e)},videoElement:{resolve:(e,t={})=>b(Ct(U(e.elements),`HTMLVideoElement`))}}},frame:{operations:{addStyleTag:{resolve:(e,t)=>Ft.resolve(e,t)},fetch:{resolve:(e,t,n={})=>_n(e,t,n),kind:W.kind,ensureArgs:W.ensureArgs},evaluate:{kind:`frame`,typed:!1,resolve:(e,t,n)=>{throw ht(`evaluate`,`this realm`)}}}}}),yn=e=>e[e.length-1],bn={element:{last:{to:`element`,rewrite:e=>[...e,{kind:`element`,name:`nth`,args:[-1]}]},contentFrame:{to:`frame`,rewrite:e=>{let t=yn(e);if(t?.name!==`locator`)throw TypeError(`locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)`);return[...e.slice(0,-1),{...t,name:`frameLocator`}]}}},frame:{owner:{to:`element`,rewrite:e=>{let t=yn(e);if(t?.name!==`frameLocator`)throw TypeError(`frameLocator.owner: this frame was not entered through frameLocator(selector)`);return[...e.slice(0,-1),{...t,name:`locator`}]}},getByTestId:{to:`element`,rewrite:(e,t)=>[...e,{kind:`element`,name:`getByTestId`,args:[t]}]}}},xn=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:`&&j(t.hostname)},q=e=>{if(xn(e))throw Error(`attachFrame: refusing to target the extension's own pages or an FKN platform origin`)},Sn=({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`)},Cn={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.`},wn={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.`},Tn=[`load`,`commit`],En=e=>{if(`timeoutMs`in e)throw TypeError(`frame.goto: pass timeout, in milliseconds; timeoutMs is not an option`);let{waitUntil:t,timeout:n}=e;if(t!==void 0&&!Tn.includes(t))throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);if(n!==void 0&&typeof n!=`number`)throw TypeError(`frame.goto: timeout must be a number of milliseconds`);on(`frame.goto`,n)},Dn=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`)}},On=new Set([`jar-unreachable`,`bad-url`,`opaque-opener`]),kn=class extends Error{name=`FrameWindowRefusedError`;reason;constructor(e){let t=On.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}},An=[`message`,`document`],jn=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},Mn=(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:jn(r),transfer:i===void 0?[]:[...i]}},Nn=[`url`,`path`,`type`],Pn=[`content`,`sourceUrl`],Fn=/[\n\r\u2028\u2029]/,In=e=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`frame.addScriptTag: options must be an object { content }`);let t=Object.keys(e),n=t.find(e=>Nn.includes(e));if(n!==void 0)throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);let r=t.find(e=>!Pn.includes(e));if(r!==void 0)throw TypeError(`frame.addScriptTag: unknown option "${r}"`);let{content:i,sourceUrl:a}=e;if(typeof i!=`string`)throw TypeError(`frame.addScriptTag: content must be a string`);if(a!==void 0&&(typeof a!=`string`||a===``||Fn.test(a)))throw TypeError(`frame.addScriptTag: sourceUrl must be a non-empty string with no line break`);return a===void 0?{content:i}:{content:i,sourceUrl:a}},Ln=[`name`,`domain`,`path`],Rn=e=>e instanceof RegExp||Object.prototype.toString.call(e)===`[object RegExp]`,zn=e=>{if(e===void 0)return{};if(Object.prototype.toString.call(e)!==`[object Object]`)throw TypeError(`frame.clearCookies: options must be an object`);let t=e,n=Object.keys(t).find(e=>!Ln.includes(e));if(n!==void 0)throw TypeError(`frame.clearCookies: unknown option "${n}"`);let r=Ln.flatMap(e=>{let n=t[e];return n===void 0?[]:[{key:e,value:n}]}),i=r.find(({value:e})=>Rn(e));if(i!==void 0)throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);let a=r.find(({value:e})=>typeof e!=`string`);if(a!==void 0)throw TypeError(`frame.clearCookies: ${a.key} must be a string`);let o=r.find(({value:e})=>e===``);if(o!==void 0)throw TypeError(`frame.clearCookies: ${o.key} must not be empty; leave it out to match every ${o.key}`);let s={};for(let{key:e,value:t}of r)s[e]={equals:t};return s},Bn=e=>{typeof globalThis.reportError==`function`?globalThis.reportError(e):console.error(e)},Vn=e=>{let{owner:t,...n}=un({executor:e.executor,modules:vn,rewrites:bn,gate:e.gate}),r=async(t,n={})=>(q(t),En(n),e.goto(t,n)),i=()=>e.url(),a=async t=>{let n=e.requestPermissions;if(!n)throw Error(`frame.requestPermissions: this backend cannot ask for permission categories`);return n(t)},o=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,structuredClone(n))},s=async t=>{let{content:n,...r}=In(t),i=e.addScriptTag;if(!i)throw Error(`frame.addScriptTag: this backend cannot run scripts in the attached frame`);await i(n,r)},c=async t=>{let n=zn(t),r=e.clearCookies;if(!r)throw Error(`frame.clearCookies: this backend cannot clear cookies`);await r(n)},l=((t,n,r)=>{try{let i=e.postMessage;if(!i)throw Error(`frame.postMessage: this backend cannot message the attached frame`);let a=Mn(n,r);return i(t,a.targetOrigin,a.transfer)}catch(e){return Promise.reject(e)}}),u={message:new Set,document:new Set},d=null,f=(e,t)=>{if(!An.includes(e))throw TypeError(`frame.${t}: the event type must be ${An.map(e=>`'${e}'`).join(` or `)}, not ${JSON.stringify(e)}`);return u[e]},p=e=>{let t=e.type===`message`?Object.freeze({type:`message`,data:e.data,origin:e.origin,ports:Object.freeze([...e.ports]),source:_}):Object.freeze({type:`document`,origin:e.origin});for(let n of[...u[e.type]])try{n(t)}catch(e){Bn(e)}},m=(e,t)=>{if(f(e,`off`).delete(t),d!==null&&!u.message.size&&!u.document.size){let e=d;d=null,e()}},h=(t,n,r={})=>{let i=f(t,`on`);if(typeof n!=`function`)throw TypeError(`frame.on: the listener must be a function`);let{signal:a}=r;if(!(a?.aborted||i.has(n))){if(d===null){let t=e.listen;if(!t)throw Error(`frame.on: this backend cannot relay the page's messages`);d=t(p)}i.add(n),a?.addEventListener(`abort`,()=>m(t,n),{once:!0})}},g=()=>e.backend,_={...n,goto:r,url:i,backend:g,requestPermissions:a,evaluate:o,addScriptTag:s,clearCookies:c,postMessage:l,on:h,off:m};return _},Hn=[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,Cn,wn,t.u,t.d,Fe,Ie,Le,Xe,Qe],Un=hn.map(e=>e.id),Wn={interaction:`act.click`,storage:`read.text`,network:`network.fetchCredentialed`,evaluation:`media.appearU`},Gn=e=>e===0?`auto`:e===4?`critical`:`bundled`,Kn=Hn,J=new Map,qn={};(()=>{J=new Map(Kn.map(e=>[e.scope,e])),qn=Object.fromEntries(J),Kn.filter(e=>e.severity===4).map(e=>e.scope);let e=e=>Kn.filter(t=>t.category===e&&Gn(t.severity)===`bundled`);Object.fromEntries(Un.map(t=>[t,Math.max(0,...e(t).map(e=>e.severity))])),Object.fromEntries(Un.map(t=>[t,e(t).some(e=>e.unsafe===!0)]))})();var Jn=e=>J.get(e)?.category,Yn=e=>{let t=J.get(e);return t&&Gn(t.severity)},Xn=e=>{let t=J.get(e);if(t)return Gn(t.severity)===`critical`?t.scope:t.category},Zn=e=>Wn[e],Qn=({category:e,key:t})=>{let n=t??(e&&Zn(e));return n!==void 0&&Jn(n)!==void 0?n:void 0},$n=(e,t)=>{for(let{category:n,key:r}of t)if(Qn({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}"`)},er=(e,t={})=>{let n=[],r=e.map(e=>{let r=Qn(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&&Yn(r)===`critical`?r:void 0,category:r===void 0?e.category??`interaction`:qn[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)}))}},tr=e=>typeof e==`object`&&!!e,nr=typeof chrome<`u`&&!!chrome.runtime?.id,rr=e=>tr(e)&&e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY===!0&&typeof e.frameId==`string`&&typeof e.document==`string`,ir=new WeakMap,ar=new WeakMap,or=new WeakMap,sr=new Set;typeof window<`u`&&nr&&window.addEventListener(`message`,e=>{if(!rr(e.data))return;e.stopImmediatePropagation();let t=e.source;if(!t||typeof t!=`object`)return;let n=t,r=ir.get(n),i=e.data.frameId,a=e.data.document;if(ir.set(n,i),ar.set(n,a),r)for(let e of sr)e(r);let o=or.get(n);if(o){for(let e of[...o])(e.notDocument===void 0||e.notDocument!==a)&&(o.delete(e),e.resolve(i));o.size||or.delete(n)}},{capture:!0});var cr=3e4,lr=`frame.evaluate: the code did not settle within ${cr}ms`,ur=()=>new B(lr),dr=e=>yt(e)&&e.message===lr?ur():e,fr=[/^frame load timed out after \d+ms for /,/^frame goto: documentstart timed out$/,/^navigation to .+ did not commit a document within \d+ms$/s],pr=e=>{if(e instanceof B)return e;let t=typeof e?.message==`string`?e.message:``;return fr.some(e=>e.test(t))?new B(t):e},mr=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(t.blank!==void 0)throw TypeError(`attachFrame: blank does not apply to a window`);if(typeof t.window!=`object`||t.window===null)throw TypeError(`attachFrame: window must be an object`);return`window`},hr=(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)},gr=({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:hr(t,500,`width`),height:hr(n,700,`height`)}},_r=`attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'`,vr=1e11,yr=[`name`,`value`,`domain`,`path`,`expires`,`httpOnly`,`secure`,`sameSite`],br=[`Strict`,`Lax`,`None`],Y=/[;\x00-\x1f\x7f]/,X=(e,t)=>TypeError(`attachFrame: storageState${e} ${t}`),Z=e=>Object.prototype.toString.call(e)===`[object Object]`,xr=e=>{let t=e.startsWith(`.`)?e.slice(1):e;if(t===``)return null;try{return new URL(`http://${t}/`).hostname===t.toLowerCase()?t.toLowerCase():null}catch{return null}},Sr=(e,t)=>{if(!Z(e))throw X(t,`must be an object`);let n=Object.keys(e).find(e=>!yr.includes(e));if(n!==void 0)throw X(`${t}.${n}`,`is not a cookie field`);let{name:r,value:i,domain:a,path:o,expires:s,httpOnly:c,secure:l,sameSite:u}=e;if(typeof r!=`string`||r===``||r.includes(`=`)||Y.test(r))throw X(`${t}.name`,`must be a non-empty string with no "=", ";" or control character`);if(typeof i!=`string`||Y.test(i))throw X(`${t}.value`,`must be a string with no ";" or control character`);if(typeof a!=`string`||xr(a)===null)throw X(`${t}.domain`,`must be a host: ".youtube.com" for a cookie its subdomains also receive, "www.youtube.com" for a host-only one`);if(o!==void 0&&(typeof o!=`string`||!o.startsWith(`/`)||Y.test(o)))throw X(`${t}.path`,`must be a string starting with "/"`);if(s!==void 0&&(typeof s!=`number`||!Number.isFinite(s)||s<=0&&s!==-1))throw X(`${t}.expires`,`must be -1 for a session cookie, or milliseconds since the epoch`);if(c!==void 0&&typeof c!=`boolean`)throw X(`${t}.httpOnly`,`must be a boolean`);if(l!==void 0&&typeof l!=`boolean`)throw X(`${t}.secure`,`must be a boolean`);if(u!==void 0&&!br.includes(u))throw X(`${t}.sameSite`,`must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);let d=r.toLowerCase();if(u===`None`&&l!==!0)throw X(t,`is SameSite=None, which needs secure: true`);if(d.startsWith(`__secure-`)&&l!==!0)throw X(t,`is a __Secure- cookie, which needs secure: true`);if(d.startsWith(`__host-`)&&(l!==!0||a.startsWith(`.`)||(o??`/`)!==`/`))throw X(t,`is a __Host- cookie, which needs secure: true, a host-only domain and path "/"`);let f={name:r,value:i,domain:a};return o!==void 0&&(f.path=o),s!==void 0&&(f.expires=s),c!==void 0&&(f.httpOnly=c),l!==void 0&&(f.secure=l),u!==void 0&&(f.sameSite=u),f},Cr=(e,t)=>{if(!Z(e))throw X(t,`must be an object { origin, localStorage }`);let n=Object.keys(e).find(e=>e!==`origin`&&e!==`localStorage`);if(n!==void 0)throw X(`${t}.${n}`,`is not an origin field`);let{origin:r,localStorage:i}=e,a=(()=>{try{return typeof r==`string`?new URL(r):null}catch{return null}})();if(a===null||a.protocol!==`http:`&&a.protocol!==`https:`||a.origin!==r)throw X(`${t}.origin`,`must be an absolute http or https origin, not ${JSON.stringify(r)}`);if(!Array.isArray(i))throw X(`${t}.localStorage`,`must be an array`);return{origin:r,localStorage:i.map((e,n)=>{let{name:r,value:i}=Z(e)&&Object.keys(e).every(e=>e===`name`||e===`value`)?e:{};if(typeof r!=`string`||typeof i!=`string`)throw X(`${t}.localStorage[${n}]`,`must be { name, value } strings`);return{name:r,value:i}})}},wr=e=>{if(!Z(e))throw X(``,`must be an object { cookies?, origins? }`);let t=Object.keys(e).find(e=>e!==`cookies`&&e!==`origins`);if(t!==void 0)throw X(`.${t}`,`is not a storageState key; it takes cookies and origins`);let{cookies:n=[],origins:r=[]}=e;if(!Array.isArray(n))throw X(`.cookies`,`must be an array`);if(!Array.isArray(r))throw X(`.origins`,`must be an array`);let i=n.map((e,t)=>Sr(e,`.cookies[${t}]`)),a=r.map((e,t)=>Cr(e,`.origins[${t}]`));return i.forEach(({expires:e},t)=>{if(e!==void 0&&e>0&&e<vr)throw X(`.cookies[${t}].expires`,`is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`)}),{cookies:i,origins:a}},Tr=[`persistent`,`ephemeral`,`native`],Er=`attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'`,Dr=e=>{if(`syncCookies`in e)throw TypeError(Er);let{cookies:t=`persistent`}=e;if(!Tr.includes(t))throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);if(e.storageState!==void 0&&t!==`ephemeral`)throw TypeError(_r);let n=e.storageState===void 0?void 0:wr(e.storageState),r=mr(e);if(r===`iframe`&&e.lockdown&&t!==`native`)throw TypeError(`attachFrame: lockdown runs on the extension, which serves only cookies: 'native'`);return n===void 0?{kind:r,cookies:t}:{kind:r,cookies:t,storageState:n}},Or=`FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY`,kr=!1,Ar=()=>{kr||(kr=!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.`))},jr=`frame: this frame no longer holds the document the app attached it to`,Mr=`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`,Nr=()=>{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.`)},Q=e=>{try{return new URL(e,location.href).hostname}catch{return``}},$=()=>{let e=D();return e.status===`absent`?0:e.abi},Pr=`attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame`,Fr=`frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame`,Ir=`frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar`,Lr=({executeLocator:e,highlightLocator:n,ensureLocatorPermission:r,requestCategories:i,evaluateFrame:a,goto:o},{hosts:s,url:c,page:l,unreachable:u,documents:d,navigated:f})=>{let p=new Set(t.t(s,{ipv6:!0})),m=e=>p.has(t.t([Ye(e)],{ipv6:!0})[0]??``);return Vn({backend:`extension`,executor:{execute:e,highlight:n},gate:e=>r(e.parts,e.operation,e.args),requestPermissions:async e=>($n(`frame.requestPermissions`,e),await fn(),i(e)),evaluate:async(e,t)=>{if(!ve(D(),`evaluate`)){let e=D();throw new E(`evaluate`,e.status===`ok`?e.abi:0)}return a({source:e,arg:t}).catch(e=>{throw dr(e)})},addScriptTag:async()=>{throw new E(`addScriptTag`,$(),Fr)},clearCookies:async()=>{throw new E(`clearCookies`,$(),Ir)},postMessage:(e,t,n)=>{if(t===`*`)throw R(Mr,`postMessage`,`extension`);if(!m(t))throw z(jr,`postMessage`);let r=u();if(r)throw r;return l().postMessage(e,t,n),Promise.resolve()},listen:e=>{let t=t=>{t.source!==null&&t.source===l()&&!rr(t.data)&&m(t.origin)&&e({type:`message`,data:t.data,origin:t.origin,ports:t.ports})};window.addEventListener(`message`,t);let n=d(()=>e({type:`document`,origin:``}));return()=>{window.removeEventListener(`message`,t),n()}},goto:(e,{waitUntil:n,timeout:r,...i}={})=>{M(`frame.goto`,[Q(e),...i.domains??[]]);for(let n of t.t([Q(e)],{ipv6:!0}))p.add(n);return f?.(e),o({url:e,...i,...n===void 0?{}:{waitUntil:n===`commit`?`documentstart`:n},...r===void 0?{}:{timeoutMs:r}}).catch(e=>{throw pr(e)})},url:c})},Rr=async({iframe:e,domains:t=[],lockdown:n=!1,permissions:r,blank:i})=>{if(i!==void 0)throw new E(`blank`,$(),Pr);let a=crypto.randomUUID();if(q(e.src),Sn({src:e.src,domains:t,lockdown:n}),M(`attachFrame`,t),await O(),n&&Nr(),!e.isConnected)throw Error(`attachFrame: the iframe must be connected to the document before attaching`);e.dispatchEvent(new CustomEvent(Or,{detail:a}));let o=Lr(await k.attachFrame({marker:a,domains:t,syncCookies:!0,lockdown:n}),{hosts:[...t,Q(e.src)],url:()=>e.src,page:()=>e.contentWindow,unreachable:()=>e.contentWindow===null?z(`frame: navigate the frame before postMessage`,`postMessage`):void 0,documents:t=>(e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t))});return r?.length&&(dn()?await o.requestPermissions(r):Ar()),o},zr=`attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page`,Br=`frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it`,Vr=`extension.attachFrame: the attached window closed; attach a fresh window`,Hr=e=>`attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`,Ur=async e=>{let{domains:t=[],permissions:n}=e,{url:r,width:i,height:a}=gr(e.window);M(`attachFrame`,t);let o=D();if(!ve(o,`attachWindow`))throw o.status===`absent`?new E(`attachWindow`,0,zr):new E(`attachWindow`,o.abi);let s=window.open(r||`about:blank`,`_blank`,`popup,width=${i},height=${a}`);if(!s)throw new Dn;let c;try{c=await k.attachWindow({url:r,domains:t})}catch(e){try{s.close()}catch{}throw e}let l=new Promise(e=>window.addEventListener(`pagehide`,()=>e(),{once:!0})),u=!1,d=Promise.race([c.closed,l]).then(()=>{u=!0},()=>{u=!0}),f=r,p=Lr(c,{hosts:r?[...t,Q(r)]:t,url:()=>f,page:()=>s,unreachable:()=>u?R(Vr,`postMessage`,`extension`):s.closed?z(Br,`postMessage`):void 0,documents:e=>{let t=!0;return(async()=>{let n=await c.documentsAfter(-1);for(;t;){let r=await c.documentsAfter(n);for(;t&&n<r;n++)e()}})().catch(()=>{}),()=>{t=!1}},navigated:e=>{try{f=new URL(e,location.href).href}catch{}}}),m,h=()=>m??=c.close().then(()=>d,()=>{}).then(()=>{u=!0;try{s.close()}catch{}}),g=Object.assign(p,{close:h,closed:d});try{n?.length&&await g.requestPermissions(n)}catch(e){throw await h(),e}return g},Wr=(async e=>{let{kind:t,cookies:n}=Dr(e);if(n!==`native`)throw new E(`cookies`,$(),Hr(n));return t===`window`?Ur(e):Rr(e)}),Gr=`permissions.request: pass hosts, the sites the grant applies to`,Kr={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(Gr);return Je(`permissions.request`,s),{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 fn();let{items:i,answer:a}=er(r),o=n.flatMap(e=>`legacy`in e?[e.legacy]:[]),s=[...i,...o],c=s.length?await k.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++])}},qr=`PermissionDeniedError`,Jr=e=>e instanceof Error?e.name===qr:tr(e)&&e.name===`PermissionDeniedError`;Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return $e}});
|
|
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:N.comment,comment:n[0].slice(2,-2)})):o(`End of comment missing`)}function p(){let t=P(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=P(e,t,r);if(i===-1)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(I(n).replace(F,``),[`,`]).map(e=>I(e))}function m(){let t=i(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;l(n);let r=I(n[0]),a=/^:\s*/.exec(e);if(!a)return o(`property missing ':'`);l(a);let s=``,c=P(e,[`;`,`}`]);c!==-1&&(s=e.substring(0,c),l([s]),s=I(s).replace(F,``));let u=t({type:N.declaration,property:r.replace(F,``),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=P(e,[`{`]);if(t===-1)return!1;let n=P(e,[`;`]),r=P(e,[`}`]);return!(n!==-1&&n<t)&&!(r!==-1&&r<t)}function _(){let n=[];if(!s())return o(`missing '{'`);for(d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=S();if(e){n.push(e),d(n);continue}}if(g()){let e=C();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 v(){let n=[];for(u(),d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=S();if(e){n.push(e),d(n);continue}}if(g()){let e=C();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 y(){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:N.keyframe,values:t,declarations:h()||[]})}let ee=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*`),te=x(`import`),b=x(`charset`),ne=x(`namespace`);function x(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 S(){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=y();for(;p;)f.push(p),f=f.concat(d()),p=y();return c()?t({type:N.keyframes,name:u,vendor:r,keyframes:f}):o(`@keyframes missing '}'`)}()||function(){let t=i(),n=/^@media *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@media missing '{'`);let a=v();return c()?t({type:N.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:N.customMedia,name:I(r[1]),media:I(r[2])})}()||function(){let t=i(),n=/^@supports *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@supports missing '{'`);let a=v();return c()?t({type:N.supports,supports:r,rules:a}):o(`@supports missing '}'`)}()||te()||b()||ne()||function(){let t=i(),n=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!n)return;let r=l(n),a=I(r[1]),u=I(r[2]);if(!s())return o(`@document missing '{'`);let d=v();return c()?t({type:N.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=S();if(e){a.push(e),d(a);continue}}let t=m();if(!t)break;a.push(t),d(a)}return c()?t({type:N.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=v();return c()?t({type:N.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:N.fontFace,declarations:r}):o(`@font-face missing '}'`)}()||function(){let t=i(),n=/^@font-feature-values\s+([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@font-feature-values missing '{'`);let a=v();return c()?t({type:N.fontFeatureValues,fontFamily:r,rules:a}):o(`@font-feature-values missing '}'`)}()||function(){let t=i(),n=/^@container *([^{]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@container missing '{'`);let a=v();return c()?t({type:N.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=v();return c()?t({type:N.startingStyle,rules:r}):o(`@starting-style missing '}'`)}()||function(){let t=i(),n=/^@layer *([^{;@]+)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s()){let n=/^[;\s]*/.exec(e);return n&&l(n),t({type:N.layer,layer:r})}let a=v();return c()?t({type:N.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:N.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:N.counterStyle,name:r,declarations:a}):o(`@counter-style missing '}'`)}()||function(){let t=i(),n=/^@scope\s*([^{]*)/.exec(e);if(!n)return;let r=I(l(n)[1]);if(!s())return o(`@scope missing '{'`);let a=v();return c()?t({type:N.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:N.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:N.positionTry,name:r,declarations:a}):o(`@position-try missing '}'`)}()||function(){let t=i(),n=ee.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:N.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=P(e,[`{`,`;`]);if(u!==-1&&u>0&&(a=I(e.substring(0,u)),l([e.substring(0,u)])),s()){let e=v();return c()?t({type:N.atRule,name:r,prelude:a,rules:e}):o(`@${r} missing '}'`)}let d=/^[;\s]*/.exec(e);return d&&l(d),t({type:N.atRule,name:r,prelude:a})}()}function C(){let e=i(),t=p();return t?(d(),e({type:N.rule,selectors:t,declarations:_()||[]})):o(`selector missing`)}return it(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=S()||C(),!n){if(t?.silent){l([e.charAt(0)]),u(),d(r);continue}break}r.push(n),d(r)}return r}();return{type:N.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}}())},st=(e,t)=>new at(t||{}).compile(e),ct=Object.defineProperty,lt=(e,t)=>{let n={};for(var r in e)ct(n,r,{get:e[r],enumerable:!0});return t||ct(n,Symbol.toStringTag,{value:`Module`}),n},ut=`LocatorError`,dt=`LocatorUnsupportedError`,ft=`LocatorDeniedError`,pt=`LocatorInvalidError`,mt=e=>typeof e==`object`&&e?e.name:void 0,L=e=>Object.assign(Error(e),{name:ut}),R=(e,t=``,n)=>Object.assign(Error(e),{name:dt,operation:t,backend:n}),ht=(e,t)=>R(`Locator operation not supported${t?` on the ${t} backend`:``}: ${e}`,e,t),z=(e,t)=>Object.assign(Error(e),{name:ft,operation:t}),gt=(e,t)=>Object.assign(Error(e),{name:pt,operation:t}),B=class extends Error{name=`TimeoutError`;constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause})}},_t=e=>mt(e)===dt,vt=e=>mt(e)===ft,yt=e=>mt(e)===pt,bt=e=>vt(e)||_t(e)||yt(e),V=e=>{let t=(e.ownerDocument??e).defaultView;if(!t)throw L(`the resolved element belongs to a document with no window`);return t},xt=(e,t)=>{let n=e?.[t];return typeof n==`function`?n:null},St=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=(()=>{try{return xt(V(e),t)}catch{return null}})();if(n&&e instanceof n)return n;let r=xt(globalThis,t);return r&&e instanceof r?r:null},H=(e,t)=>St(e,t)!==null,U=e=>{if(e.length===0)throw L(`No elements found`);if(e.length>1)throw L(`Strict mode violation: locator resolved to ${e.length} elements`);return e[0]},Ct=(e,t)=>{if(!H(e,t))throw L(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);return e},wt=e=>e.tagName.toLowerCase(),Tt=new Set,Et=e=>{Tt.add(e)},Dt=/(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i,Ot=e=>e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\(.)/g,`$1`),kt=e=>!Dt.test(Ot(e.value)),At=new Set([N.import,N.fontFace,N.namespace,N.charset,N.document,N.comment]),jt=e=>{if(At.has(e.type))return null;if(e.type===N.declaration)return kt(e)?e:null;let t=e,n={...t};for(let e of[`declarations`,`rules`,`keyframes`]){let r=t[e];Array.isArray(r)&&(n[e]=Mt(r))}return n},Mt=e=>e.map(e=>jt(e)).filter(e=>e!==null),Nt=e=>{let t;try{t=ot(e,{silent:!0})}catch{return``}return t.stylesheet.rules=Mt(t.stylesheet.rules),st(t)},Pt=(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)},Ft={resolve:(e,t)=>{let n=e.document.createElement(`style`);n.textContent=t.noSanitize?t.content:Nt(t.content);try{Pt(e.document,n)}catch(e){console.error(e)}Et(n)}},It=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},W={kind:`frame`,ensureArgs:e=>[void 0,e],resolve:async(e,t,n={})=>{if(typeof t!=`string`)throw gt(`fetch: url must be a string`,`fetch`);let r=V(e.document),i;try{i=new r.URL(t,e.document.baseURI).href}catch{throw gt(`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:It(a.headers),body:await a.arrayBuffer()}}},G=lt({click:()=>Rt,count:()=>Kt,exists:()=>qt,fill:()=>Ht,getAttribute:()=>Wt,hover:()=>zt,isVisible:()=>Gt,textContent:()=>Ut}),Lt=(e,t)=>{let n=e.getBoundingClientRect();return{clientX:n.left+n.width*(t?.x??.5),clientY:n.top+n.height*(t?.y??.5)}},Rt={resolve:(e,t={})=>{let n=U(e.elements),r=V(n),i={bubbles:!0,cancelable:!0,composed:!0,...Lt(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}))}},zt={resolve:(e,t={})=>{let n=U(e.elements),r=V(n),i={bubbles:!0,cancelable:!0,composed:!0,...Lt(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=(St(e,`HTMLTextAreaElement`)??St(e,`HTMLInputElement`))?.prototype,r=n&&Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t},Vt=(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}}},Ht={resolve:(e,t,n={})=>{let r=U(e.elements),i=V(r),a=H(r,`HTMLInputElement`);if(a||H(r,`HTMLTextAreaElement`)){let e=r,n=a?Vt(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(H(r,`HTMLElement`)&&r.isContentEditable){r.textContent=t,r.dispatchEvent(new i.Event(`input`,{bubbles:!0}));return}throw Error(`fill: element <${wt(r)}> is not fillable`)}},Ut={resolve:(e,t={})=>U(e.elements).textContent},Wt={resolve:(e,t,n={})=>U(e.elements).getAttribute(t)},Gt={resolve:(e,t={})=>{let n=U(e.elements);if(!H(n,`HTMLElement`))return!0;let r=V(n).getComputedStyle(n);if(r?.display===`none`||r?.visibility===`hidden`)return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0}},Kt={resolve:(e,t={})=>e.elements.length},qt={resolve:(e,t={})=>e.elements.length>0},K=(e,t)=>(e.topLevel?[e.document]:e.elements).flatMap(e=>[...e.querySelectorAll(t)]),Jt=e=>e.replaceAll(`"`,`\\"`),Yt={to:`element`,css:!0,resolve:(e,t)=>K(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`descend`})},Xt={to:`frame`,css:!0,barrier:`down`,resolve:(e,t)=>K(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`down`})},Zt={element:{selectors:{locator:Yt,frameLocator:Xt,getByRole:{to:`element`,resolve:(e,t)=>K(e,`[role="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[role="${Jt(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("${Jt(e)}")`:`:has-text(...)`})},getByTestId:{to:`element`,resolve:(e,t)=>K(e,`[data-testid="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[data-testid="${Jt(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:Rt,fill:Ht,hover:zt,textContent:Ut,getAttribute:Wt,isVisible:Gt,count:Kt,exists:qt}},frame:{selectors:{locator:Yt,frameLocator:Xt,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:Ft,fetch:W}}},Qt=(e,t=Zt)=>({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}}}),$t=3e4,en=50,tn=e=>{let t=e[e.length-1];return typeof t==`object`&&t?t:void 0},nn=e=>{let t=tn(e)?.timeout;return typeof t==`number`?t:$t},rn=({executor:e,parts:t})=>({highlight:n=>e.highlight(t,n).then(()=>{},()=>{})}),an=async e=>{let t={parts:e.parts,operation:e.operation,args:e.args,phase:`ensure`};await e.gate?.(t,rn(e))},on=(e,t)=>{if(t!==void 0&&typeof t==`number`&&!(Number.isFinite(t)&&t>0))throw TypeError(`${e}: timeout must be a positive number of milliseconds, not ${t}; every call ends at its deadline, so 0 does not turn it off`)},sn=e=>typeof e==`object`&&e&&typeof e.message==`string`?e.message:String(e),cn=async e=>{let{executor:t,gate:n,parts:r,operation:i,args:a}=e;on(i,tn(a)?.timeout),n&&await n({parts:r,operation:i,args:a,phase:`execute`},rn(e));let o=nn(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{do try{return await Promise.race([t.execute(r,i,a),l])}catch(e){if(e===c)break;if(bt(e))throw e;f=e;let t=s-Date.now();if(t<=0)break;await new Promise(e=>setTimeout(e,Math.min(en,t)))}while(Date.now()<s)}finally{clearTimeout(d)}throw f===c?new B(c.message):new B(sn(f),{cause:f})},ln=(e,t,n,r,i)=>{let a={};for(let[o,s]of Object.entries(t[r].selectors))a[o]=(...a)=>ln(e,t,n,s.to,[...i,{kind:r,name:o,args:a}]);for(let[n,o]of Object.entries(t[r].operations))a[n]=async(...t)=>cn({...e,parts:i,operation:n,args:o.send?o.send(...t):t});for(let[o,{to:s,rewrite:c}]of Object.entries(n[r]??{}))a[o]=(...r)=>ln(e,t,n,s,c(i,...r));return a.ensure=(n,a={})=>{let o=t[r].operations[n]?.ensureArgs;return an({...e,parts:i,operation:n,args:o?.(a)??[a]})},a},un=e=>ln(e,e.modules??Zt,e.rewrites??{},`frame`,[]),dn=()=>{let e=D();return e.status===`ok`&&e.abi>=2},fn=async()=>{await O();let e=D();if(e.status===`ok`&&e.abi<2)throw new T(e.abi,2)},pn=e=>`Read the text, links and details ${e} shows.`,mn=e=>`Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`,hn=[{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:pn,cloudTitle:e=>`Read what's on ${e}`,cloudDescription:pn},{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:mn,cloudTitle:e=>`Run its own code on ${e}`,cloudDescription:mn}],gn=e=>t=>{if(typeof t!=`object`||!t)return t===void 0?[]:[t];if(t.position!==void 0)throw TypeError(`${e}: position is Playwright's offset in pixels, which no backend serves yet; pass relativePosition, a 0..1 fraction of the box`);let{relativePosition:n,...r}=t;return[n===void 0?r:{...r,position:n}]},_n=async(e,t,n)=>{try{return await W.resolve(e,t,n)}catch(e){throw bt(e)?e:z(`frame.fetch: ${e instanceof Error?`${e.name}: ${e.message}`:String(e)}; not retried, since the request may already have been sent`,`fetch`)}},vn=Qt({element:{operations:{click:{resolve:(e,t={})=>G.click.resolve(e,t),send:gn(`click`)},hover:{resolve:(e,t={})=>G.hover.resolve(e,t),send:gn(`hover`)},fill:{resolve:(e,t,n={})=>G.fill.resolve(e,t,n)},textContent:{resolve:(e,t={})=>G.textContent.resolve(e)},getAttribute:{resolve:(e,t,n={})=>G.getAttribute.resolve(e,t)},isVisible:{resolve:(e,t={})=>G.isVisible.resolve(e)},count:{resolve:(e,t={})=>G.count.resolve(e)},exists:{resolve:(e,t={})=>G.exists.resolve(e)},videoElement:{resolve:(e,t={})=>b(Ct(U(e.elements),`HTMLVideoElement`))}}},frame:{operations:{addStyleTag:{resolve:(e,t)=>Ft.resolve(e,t)},fetch:{resolve:(e,t,n={})=>_n(e,t,n),kind:W.kind,ensureArgs:W.ensureArgs},evaluate:{kind:`frame`,typed:!1,resolve:(e,t,n)=>{throw ht(`evaluate`,`this realm`)}}}}}),yn=e=>e[e.length-1],bn={element:{last:{to:`element`,rewrite:e=>[...e,{kind:`element`,name:`nth`,args:[-1]}]},contentFrame:{to:`frame`,rewrite:e=>{let t=yn(e);if(t?.name!==`locator`)throw TypeError(`locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)`);return[...e.slice(0,-1),{...t,name:`frameLocator`}]}}},frame:{owner:{to:`element`,rewrite:e=>{let t=yn(e);if(t?.name!==`frameLocator`)throw TypeError(`frameLocator.owner: this frame was not entered through frameLocator(selector)`);return[...e.slice(0,-1),{...t,name:`locator`}]}},getByTestId:{to:`element`,rewrite:(e,t)=>[...e,{kind:`element`,name:`getByTestId`,args:[t]}]}}},xn=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:`&&j(t.hostname)},q=e=>{if(xn(e))throw Error(`attachFrame: refusing to target the extension's own pages or an FKN platform origin`)},Sn=({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`)},Cn={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.`},wn={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.`},Tn=[`load`,`commit`],En=e=>{if(`timeoutMs`in e)throw TypeError(`frame.goto: pass timeout, in milliseconds; timeoutMs is not an option`);let{waitUntil:t,timeout:n}=e;if(t!==void 0&&!Tn.includes(t))throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);if(n!==void 0&&typeof n!=`number`)throw TypeError(`frame.goto: timeout must be a number of milliseconds`);on(`frame.goto`,n)},Dn=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`)}},On=new Set([`jar-unreachable`,`bad-url`,`opaque-opener`]),kn=class extends Error{name=`FrameWindowRefusedError`;reason;constructor(e){let t=On.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}},An=[`message`,`document`],jn=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},Mn=(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:jn(r),transfer:i===void 0?[]:[...i]}},Nn=[`url`,`path`,`type`],Pn=[`content`,`sourceUrl`],Fn=/[\n\r\u2028\u2029]/,In=e=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`frame.addScriptTag: options must be an object { content }`);let t=Object.keys(e),n=t.find(e=>Nn.includes(e));if(n!==void 0)throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);let r=t.find(e=>!Pn.includes(e));if(r!==void 0)throw TypeError(`frame.addScriptTag: unknown option "${r}"`);let{content:i,sourceUrl:a}=e;if(typeof i!=`string`)throw TypeError(`frame.addScriptTag: content must be a string`);if(a!==void 0&&(typeof a!=`string`||a===``||Fn.test(a)))throw TypeError(`frame.addScriptTag: sourceUrl must be a non-empty string with no line break`);return a===void 0?{content:i}:{content:i,sourceUrl:a}},Ln=[`name`,`domain`,`path`],Rn=e=>e instanceof RegExp||Object.prototype.toString.call(e)===`[object RegExp]`,zn=e=>{if(e===void 0)return{};if(Object.prototype.toString.call(e)!==`[object Object]`)throw TypeError(`frame.clearCookies: options must be an object`);let t=e,n=Object.keys(t).find(e=>!Ln.includes(e));if(n!==void 0)throw TypeError(`frame.clearCookies: unknown option "${n}"`);let r=Ln.flatMap(e=>{let n=t[e];return n===void 0?[]:[{key:e,value:n}]}),i=r.find(({value:e})=>Rn(e));if(i!==void 0)throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);let a=r.find(({value:e})=>typeof e!=`string`);if(a!==void 0)throw TypeError(`frame.clearCookies: ${a.key} must be a string`);let o=r.find(({value:e})=>e===``);if(o!==void 0)throw TypeError(`frame.clearCookies: ${o.key} must not be empty; leave it out to match every ${o.key}`);let s={};for(let{key:e,value:t}of r)s[e]={equals:t};return s},Bn=e=>{typeof globalThis.reportError==`function`?globalThis.reportError(e):console.error(e)},Vn=e=>{let{owner:t,...n}=un({executor:e.executor,modules:vn,rewrites:bn,gate:e.gate}),r=async(t,n={})=>(q(t),En(n),e.goto(t,n)),i=()=>e.url(),a=async t=>{let n=e.requestPermissions;if(!n)throw Error(`frame.requestPermissions: this backend cannot ask for permission categories`);return n(t)},o=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,structuredClone(n))},s=async t=>{let{content:n,...r}=In(t),i=e.addScriptTag;if(!i)throw Error(`frame.addScriptTag: this backend cannot run scripts in the attached frame`);await i(n,r)},c=async t=>{let n=zn(t),r=e.clearCookies;if(!r)throw Error(`frame.clearCookies: this backend cannot clear cookies`);await r(n)},l=((t,n,r)=>{try{let i=e.postMessage;if(!i)throw Error(`frame.postMessage: this backend cannot message the attached frame`);let a=Mn(n,r);return i(t,a.targetOrigin,a.transfer)}catch(e){return Promise.reject(e)}}),u={message:new Set,document:new Set},d=null,f=(e,t)=>{if(!An.includes(e))throw TypeError(`frame.${t}: the event type must be ${An.map(e=>`'${e}'`).join(` or `)}, not ${JSON.stringify(e)}`);return u[e]},p=e=>{let t=e.type===`message`?Object.freeze({type:`message`,data:e.data,origin:e.origin,ports:Object.freeze([...e.ports]),source:_}):Object.freeze({type:`document`,origin:e.origin});for(let n of[...u[e.type]])try{n(t)}catch(e){Bn(e)}},m=(e,t)=>{if(f(e,`off`).delete(t),d!==null&&!u.message.size&&!u.document.size){let e=d;d=null,e()}},h=(t,n,r={})=>{let i=f(t,`on`);if(typeof n!=`function`)throw TypeError(`frame.on: the listener must be a function`);let{signal:a}=r;if(!(a?.aborted||i.has(n))){if(d===null){let t=e.listen;if(!t)throw Error(`frame.on: this backend cannot relay the page's messages`);d=t(p)}i.add(n),a?.addEventListener(`abort`,()=>m(t,n),{once:!0})}},g=()=>e.backend,_={...n,goto:r,url:i,backend:g,requestPermissions:a,evaluate:o,addScriptTag:s,clearCookies:c,postMessage:l,on:h,off:m};return _},Hn=[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,Cn,wn,t.u,t.d,Fe,Ie,Le,Xe,Qe],Un=hn.map(e=>e.id),Wn={interaction:`act.click`,storage:`read.text`,network:`network.fetchCredentialed`,evaluation:`media.appearU`},Gn=e=>e===0?`auto`:e===4?`critical`:`bundled`,Kn=Hn,J=new Map,qn={};(()=>{J=new Map(Kn.map(e=>[e.scope,e])),qn=Object.fromEntries(J),Kn.filter(e=>e.severity===4).map(e=>e.scope);let e=e=>Kn.filter(t=>t.category===e&&Gn(t.severity)===`bundled`);Object.fromEntries(Un.map(t=>[t,Math.max(0,...e(t).map(e=>e.severity))])),Object.fromEntries(Un.map(t=>[t,e(t).some(e=>e.unsafe===!0)]))})();var Jn=e=>J.get(e)?.category,Yn=e=>{let t=J.get(e);return t&&Gn(t.severity)},Xn=e=>{let t=J.get(e);if(t)return Gn(t.severity)===`critical`?t.scope:t.category},Zn=e=>Wn[e],Qn=({category:e,key:t})=>{let n=t??(e&&Zn(e));return n!==void 0&&Jn(n)!==void 0?n:void 0},$n=(e,t)=>{for(let{category:n,key:r}of t)if(Qn({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}"`)},er=(e,t={})=>{let n=[],r=e.map(e=>{let r=Qn(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&&Yn(r)===`critical`?r:void 0,category:r===void 0?e.category??`interaction`:qn[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)}))}},tr=e=>typeof e==`object`&&!!e,nr=typeof chrome<`u`&&!!chrome.runtime?.id,rr=e=>tr(e)&&e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY===!0&&typeof e.frameId==`string`&&typeof e.document==`string`,ir=new WeakMap,ar=new WeakMap,or=new WeakMap,sr=new Set;typeof window<`u`&&nr&&window.addEventListener(`message`,e=>{if(!rr(e.data))return;e.stopImmediatePropagation();let t=e.source;if(!t||typeof t!=`object`)return;let n=t,r=ir.get(n),i=e.data.frameId,a=e.data.document;if(ir.set(n,i),ar.set(n,a),r)for(let e of sr)e(r);let o=or.get(n);if(o){for(let e of[...o])(e.notDocument===void 0||e.notDocument!==a)&&(o.delete(e),e.resolve(i));o.size||or.delete(n)}},{capture:!0});var cr=3e4,lr=`frame.evaluate: the code did not settle within ${cr}ms`,ur=()=>new B(lr),dr=e=>yt(e)&&e.message===lr?ur():e,fr=[/^frame load timed out after \d+ms for /,/^frame goto: documentstart timed out$/,/^navigation to .+ did not commit a document within \d+ms$/s],pr=e=>{if(e instanceof B)return e;let t=typeof e?.message==`string`?e.message:``;return fr.some(e=>e.test(t))?new B(t):e},mr=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(t.blank!==void 0)throw TypeError(`attachFrame: blank does not apply to a window`);if(typeof t.window!=`object`||t.window===null)throw TypeError(`attachFrame: window must be an object`);return`window`},hr=(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)},gr=({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:hr(t,500,`width`),height:hr(n,700,`height`)}},_r=`attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'`,vr=1e11,yr=[`name`,`value`,`domain`,`path`,`expires`,`httpOnly`,`secure`,`sameSite`],br=[`Strict`,`Lax`,`None`],Y=/[;\x00-\x1f\x7f]/,X=(e,t)=>TypeError(`attachFrame: storageState${e} ${t}`),Z=e=>Object.prototype.toString.call(e)===`[object Object]`,xr=e=>{let t=e.startsWith(`.`)?e.slice(1):e;if(t===``)return null;try{return new URL(`http://${t}/`).hostname===t.toLowerCase()?t.toLowerCase():null}catch{return null}},Sr=(e,t)=>{if(!Z(e))throw X(t,`must be an object`);let n=Object.keys(e).find(e=>!yr.includes(e));if(n!==void 0)throw X(`${t}.${n}`,`is not a cookie field`);let{name:r,value:i,domain:a,path:o,expires:s,httpOnly:c,secure:l,sameSite:u}=e;if(typeof r!=`string`||r===``||r.includes(`=`)||Y.test(r))throw X(`${t}.name`,`must be a non-empty string with no "=", ";" or control character`);if(typeof i!=`string`||Y.test(i))throw X(`${t}.value`,`must be a string with no ";" or control character`);if(typeof a!=`string`||xr(a)===null)throw X(`${t}.domain`,`must be a host: ".youtube.com" for a cookie its subdomains also receive, "www.youtube.com" for a host-only one`);if(o!==void 0&&(typeof o!=`string`||!o.startsWith(`/`)||Y.test(o)))throw X(`${t}.path`,`must be a string starting with "/"`);if(s!==void 0&&(typeof s!=`number`||!Number.isFinite(s)||s<=0&&s!==-1))throw X(`${t}.expires`,`must be -1 for a session cookie, or milliseconds since the epoch`);if(c!==void 0&&typeof c!=`boolean`)throw X(`${t}.httpOnly`,`must be a boolean`);if(l!==void 0&&typeof l!=`boolean`)throw X(`${t}.secure`,`must be a boolean`);if(u!==void 0&&!br.includes(u))throw X(`${t}.sameSite`,`must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);let d=r.toLowerCase();if(u===`None`&&l!==!0)throw X(t,`is SameSite=None, which needs secure: true`);if(d.startsWith(`__secure-`)&&l!==!0)throw X(t,`is a __Secure- cookie, which needs secure: true`);if(d.startsWith(`__host-`)&&(l!==!0||a.startsWith(`.`)||(o??`/`)!==`/`))throw X(t,`is a __Host- cookie, which needs secure: true, a host-only domain and path "/"`);let f={name:r,value:i,domain:a};return o!==void 0&&(f.path=o),s!==void 0&&(f.expires=s),c!==void 0&&(f.httpOnly=c),l!==void 0&&(f.secure=l),u!==void 0&&(f.sameSite=u),f},Cr=(e,t)=>{if(!Z(e))throw X(t,`must be an object { origin, localStorage }`);let n=Object.keys(e).find(e=>e!==`origin`&&e!==`localStorage`);if(n!==void 0)throw X(`${t}.${n}`,`is not an origin field`);let{origin:r,localStorage:i}=e,a=(()=>{try{return typeof r==`string`?new URL(r):null}catch{return null}})();if(a===null||a.protocol!==`http:`&&a.protocol!==`https:`||a.origin!==r)throw X(`${t}.origin`,`must be an absolute http or https origin, not ${JSON.stringify(r)}`);if(!Array.isArray(i))throw X(`${t}.localStorage`,`must be an array`);return{origin:r,localStorage:i.map((e,n)=>{let{name:r,value:i}=Z(e)&&Object.keys(e).every(e=>e===`name`||e===`value`)?e:{};if(typeof r!=`string`||typeof i!=`string`)throw X(`${t}.localStorage[${n}]`,`must be { name, value } strings`);return{name:r,value:i}})}},wr=e=>{if(!Z(e))throw X(``,`must be an object { cookies?, origins? }`);let t=Object.keys(e).find(e=>e!==`cookies`&&e!==`origins`);if(t!==void 0)throw X(`.${t}`,`is not a storageState key; it takes cookies and origins`);let{cookies:n=[],origins:r=[]}=e;if(!Array.isArray(n))throw X(`.cookies`,`must be an array`);if(!Array.isArray(r))throw X(`.origins`,`must be an array`);let i=n.map((e,t)=>Sr(e,`.cookies[${t}]`)),a=r.map((e,t)=>Cr(e,`.origins[${t}]`));return i.forEach(({expires:e},t)=>{if(e!==void 0&&e>0&&e<vr)throw X(`.cookies[${t}].expires`,`is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`)}),{cookies:i,origins:a}},Tr=[`persistent`,`ephemeral`,`native`],Er=`attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'`,Dr=e=>{if(`syncCookies`in e)throw TypeError(Er);let{cookies:t=`persistent`}=e;if(!Tr.includes(t))throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);if(e.storageState!==void 0&&t!==`ephemeral`)throw TypeError(_r);let n=e.storageState===void 0?void 0:wr(e.storageState),r=mr(e);if(r===`iframe`&&e.lockdown&&t!==`native`)throw TypeError(`attachFrame: lockdown runs on the extension, which serves only cookies: 'native'`);return n===void 0?{kind:r,cookies:t}:{kind:r,cookies:t,storageState:n}},Or=`FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY`,kr=!1,Ar=()=>{kr||(kr=!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.`))},jr=`frame: this frame no longer holds the document the app attached it to`,Mr=`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`,Nr=()=>{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.`)},Q=e=>{try{return new URL(e,location.href).hostname}catch{return``}},$=()=>{let e=D();return e.status===`absent`?0:e.abi},Pr=`attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame`,Fr=`frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame`,Ir=`frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar`,Lr=({executeLocator:e,highlightLocator:n,ensureLocatorPermission:r,requestCategories:i,evaluateFrame:a,goto:o},{hosts:s,url:c,page:l,unreachable:u,documents:d,navigated:f})=>{let p=new Set(t.t(s,{ipv6:!0})),m=e=>p.has(t.t([Ye(e)],{ipv6:!0})[0]??``);return Vn({backend:`extension`,executor:{execute:e,highlight:n},gate:e=>r(e.parts,e.operation,e.args),requestPermissions:async e=>($n(`frame.requestPermissions`,e),await fn(),i(e)),evaluate:async(e,t)=>{if(!ve(D(),`evaluate`)){let e=D();throw new E(`evaluate`,e.status===`ok`?e.abi:0)}return a({source:e,arg:t}).catch(e=>{throw dr(e)})},addScriptTag:async()=>{throw new E(`addScriptTag`,$(),Fr)},clearCookies:async()=>{throw new E(`clearCookies`,$(),Ir)},postMessage:(e,t,n)=>{if(t===`*`)throw R(Mr,`postMessage`,`extension`);if(!m(t))throw z(jr,`postMessage`);let r=u();if(r)throw r;return l().postMessage(e,t,n),Promise.resolve()},listen:e=>{let t=t=>{t.source!==null&&t.source===l()&&!rr(t.data)&&m(t.origin)&&e({type:`message`,data:t.data,origin:t.origin,ports:t.ports})};window.addEventListener(`message`,t);let n=d(()=>e({type:`document`,origin:``}));return()=>{window.removeEventListener(`message`,t),n()}},goto:(e,{waitUntil:n,timeout:r,...i}={})=>{M(`frame.goto`,[Q(e),...i.domains??[]]);for(let n of t.t([Q(e)],{ipv6:!0}))p.add(n);return f?.(e),o({url:e,...i,...n===void 0?{}:{waitUntil:n===`commit`?`documentstart`:n},...r===void 0?{}:{timeoutMs:r}}).catch(e=>{throw pr(e)})},url:c})},Rr=async({iframe:e,domains:t=[],lockdown:n=!1,permissions:r,blank:i})=>{if(i!==void 0)throw new E(`blank`,$(),Pr);let a=crypto.randomUUID();if(q(e.src),Sn({src:e.src,domains:t,lockdown:n}),M(`attachFrame`,t),await O(),n&&Nr(),!e.isConnected)throw Error(`attachFrame: the iframe must be connected to the document before attaching`);e.dispatchEvent(new CustomEvent(Or,{detail:a}));let o=Lr(await k.attachFrame({marker:a,domains:t,syncCookies:!0,lockdown:n}),{hosts:[...t,Q(e.src)],url:()=>e.src,page:()=>e.contentWindow,unreachable:()=>e.contentWindow===null?z(`frame: navigate the frame before postMessage`,`postMessage`):void 0,documents:t=>(e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t))});return r?.length&&(dn()?await o.requestPermissions(r):Ar()),o},zr=`attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page`,Br=`frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it`,Vr=`extension.attachFrame: the attached window closed; attach a fresh window`,Hr=e=>`attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`,Ur=async e=>{let{domains:t=[],permissions:n}=e,{url:r,width:i,height:a}=gr(e.window);M(`attachFrame`,t);let o=D();if(!ve(o,`attachWindow`))throw o.status===`absent`?new E(`attachWindow`,0,zr):new E(`attachWindow`,o.abi);let s=window.open(r||`about:blank`,`_blank`,`popup,width=${i},height=${a}`);if(!s)throw new Dn;let c;try{c=await k.attachWindow({url:r,domains:t})}catch(e){try{s.close()}catch{}throw e}let l=new Promise(e=>window.addEventListener(`pagehide`,()=>e(),{once:!0})),u=!1,d=Promise.race([c.closed,l]).then(()=>{u=!0},()=>{u=!0}),f=r,p=Lr(c,{hosts:r?[...t,Q(r)]:t,url:()=>f,page:()=>s,unreachable:()=>u?R(Vr,`postMessage`,`extension`):s.closed?z(Br,`postMessage`):void 0,documents:e=>{let t=!0;return(async()=>{let n=await c.documentsAfter(-1);for(;t;){let r=await c.documentsAfter(n);for(;t&&n<r;n++)e()}})().catch(()=>{}),()=>{t=!1}},navigated:e=>{try{f=new URL(e,location.href).href}catch{}}}),m,h=()=>m??=c.close().then(()=>d,()=>{}).then(()=>{u=!0;try{s.close()}catch{}}),g=Object.assign(p,{close:h,closed:d});try{n?.length&&await g.requestPermissions(n)}catch(e){throw await h(),e}return g},Wr=(async e=>{let{kind:t,cookies:n}=Dr(e);if(n!==`native`)throw new E(`cookies`,$(),Hr(n));return t===`window`?Ur(e):Rr(e)}),Gr=`permissions.request: pass hosts, the sites the grant applies to`,Kr={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(Gr);return Je(`permissions.request`,s),{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 fn();let{items:i,answer:a}=er(r),o=n.flatMap(e=>`legacy`in e?[e.legacy]:[]),s=[...i,...o],c=s.length?await k.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++])}},qr=`PermissionDeniedError`,Jr=e=>e instanceof Error?e.name===qr:tr(e)&&e.name===`PermissionDeniedError`;Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return $e}});
|
|
@@ -1659,16 +1659,18 @@ var Et = class {
|
|
|
1659
1659
|
l.catch(() => {});
|
|
1660
1660
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1661
1661
|
try {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1662
|
+
do
|
|
1663
|
+
try {
|
|
1664
|
+
return await Promise.race([t.execute(r, i, a), l]);
|
|
1665
|
+
} catch (e) {
|
|
1666
|
+
if (e === c) break;
|
|
1667
|
+
if (B(e)) throw e;
|
|
1668
|
+
f = e;
|
|
1669
|
+
let t = s - Date.now();
|
|
1670
|
+
if (t <= 0) break;
|
|
1671
|
+
await new Promise((e) => setTimeout(e, Math.min(yn, t)));
|
|
1672
|
+
}
|
|
1673
|
+
while (Date.now() < s);
|
|
1672
1674
|
} finally {
|
|
1673
1675
|
clearTimeout(d);
|
|
1674
1676
|
}
|