@banou/stub 0.0.46 → 0.0.47
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/build/assets/{embed-BSfHdWDm.js → embed-fVMcAFMB.js} +39 -39
- package/build/assets/{embed-title-glP3xA0i.js → embed-title-DEy3PowC.js} +1 -1
- package/build/assets/{index-uuiiUU3P.js → index-CxRMB2DU.js} +212 -244
- package/build/assets/{lib-worker-BsxFF1Cm.js → lib-worker-DpCBS-qg.js} +1 -1
- package/build/assets/{lib-worker-index-CBZBPhZm.js → lib-worker-index-BSQQbA5a.js} +212 -244
- package/build/assets/{lib-worker-DOqynLhk.js → lib-worker-sJHT65D9.js} +1 -1
- package/build/assets/{login-window-Ceh8mJXR.js → login-window-BR4bdEsn.js} +1 -1
- package/build/assets/main-Bj-wlYXb.js +4276 -0
- package/build/assets/{worker-D0R4jFi3.js → worker-B7dGYIF7.js} +1 -1
- package/build/assets/{worker-BUw9_QQ0.js → worker-BDU5mBuU.js} +1 -1
- package/build/embed.html +3 -3
- package/build/index.html +4 -4
- package/build/index.js +4046 -4870
- package/fkn.json +1 -1
- package/package.json +1 -1
- package/build/assets/main-BW3rFe16.js +0 -4416
|
@@ -10672,7 +10672,7 @@ typeof window < "u" && _(() => {
|
|
|
10672
10672
|
//#endregion
|
|
10673
10673
|
//#region src/worker/index.ts?worker
|
|
10674
10674
|
function pm(e) {
|
|
10675
|
-
return new Worker(new URL("lib-worker-index-
|
|
10675
|
+
return new Worker(new URL("lib-worker-index-BSQQbA5a.js", import.meta.url).href, {
|
|
10676
10676
|
type: "module",
|
|
10677
10677
|
name: e?.name
|
|
10678
10678
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./api-CXwRN66S.js","./api-DIgTslNb-Cs0uqWX1.js","./build-mcPaLDi_.js","./account-QzTt80xa.js","./account-B2ETje0Z.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{gt as e,ht as t,mt as n,pt as r}from"./embed-title-glP3xA0i.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./build-mcPaLDi_.js";import{c as u,l as d,o as f,s as p}from"./account-B2ETje0Z.js";import{a as m,c as h,d as g,f as _,n as v,o as y,r as b,s as x,t as S,u as C}from"./api-DIgTslNb-Cs0uqWX1.js";var w={scope:`read.text`,category:`storage`,severity:1,chip:`read text`,title:`Read text from the page`,description:`Lets the app see the text shown on this page.`},T={scope:`read.info`,category:`storage`,severity:1,chip:`read details`,title:`Read info from the page`,description:`Lets the app read a detail of a part of the page.`},E={scope:`read.visible`,category:`storage`,severity:0,title:`See what’s visible on the page`,description:`Lets the app check which elements are currently on screen.`},D={scope:`read.check`,category:`storage`,severity:0,title:`Check if something is on the page`,description:`Lets the app test whether a specific element exists.`},O={scope:`read.count`,category:`storage`,severity:0,title:`Count items on the page`,description:`Lets the app count how many matching elements are present.`},k={scope:`act.click`,category:`interaction`,severity:3,chip:`click`,title:`Click on the page`,description:`Lets the app press buttons or links for you.`},A={scope:`act.type`,category:`interaction`,severity:1,chip:`type`,title:`Type into a text field`,description:`Lets the app fill in form fields on your behalf.`},j={scope:`act.hover`,category:`interaction`,severity:1,chip:`hover`,title:`Hover over the page`,description:`Lets the app point at things to reveal menus or tooltips.`},M={scope:`media.video`,category:`interaction`,severity:0,title:`Control video playback`,description:`Lets the app play, pause, seek, and read the video on the page.`},ee={scope:`media.appear`,category:`interaction`,severity:0,title:`Change page appearance`,description:`Lets the app restyle parts of the page (safely filtered).`},N={scope:`media.appearU`,category:`evaluation`,severity:2,chip:`unfiltered styles`,unsafe:!0,title:`Change page appearance (unsafe)`,description:`Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.`},P={scope:`frame.evaluate`,category:`evaluation`,severity:3,chip:`run code`,unsafe:!0,title:`Run the app’s code on this site`,description:`Lets the app run its own script inside this site, with full access to the page and the data it shows.`},F={scope:`frame.message`,category:`evaluation`,severity:3,chip:`message the page`,unsafe:!0,title:`Send messages to this site`,description:`Lets the app send messages and open channels into this site, which its scripts receive as their own.`},te=e=>e?.noSanitize?N:ee,ne={scope:`frame.fetchRead`,category:`network`,severity:3,chip:`load`,unsafe:!0,title:`Read your account data on this site`,description:`Lets the app read pages and data from this site as you, using the session in the frame.`},re={scope:`frame.fetchWrite`,category:`network`,severity:3,chip:`send`,unsafe:!0,title:`Change your account data on this site`,description:`Lets the app send changes to this site as you, using the session in the frame.`},I=new Set([`GET`,`HEAD`,`OPTIONS`]),L=(e,t)=>I.has((t?.method??`GET`).toUpperCase())?ne:re,ie={click:k,fill:A,hover:j,textContent:w,getAttribute:T,isVisible:E,count:O,exists:D,videoElement:M,addStyleTag:te,fetch:L,evaluate:P},ae={postMessage:F,addScriptTag:P};[w,T,E,D,O,k,A,j,M,ee,N,ne,re,P,F].map(e=>e.scope);var oe={...ie,...ae},se=(e,t)=>{let n=oe[e];return n?(typeof n==`function`?n(...t):n).scope:null},ce=(e,t)=>{try{return new URL(e,t)}catch{return}},le=e=>{let t=ce(e,`https://s.invalid/`),n=ce(e,`http://s.invalid/`);if(!t||!n)return{kind:`invalid`};let r=ce(e);return!r||r.href!==t.href||r.href!==n.href?{kind:`relative`}:r.protocol!==`https:`&&r.protocol!==`http:`?{kind:`unsupported`,protocol:r.protocol}:{kind:`absolute`,host:r.hostname,protocol:r.protocol}},ue=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/,de=/^\[[0-9a-f:.]+\]$/,fe=e=>{try{return new URL(`http://${e}/`).hostname}catch{return}},R=(e,{ipv6:t=!1}={})=>{let n=[];for(let r of e){let e=r.trim().toLowerCase();if(!e||e.length>253)continue;let i=ue.test(e)?e:t&&de.test(e)?fe(e):void 0;i&&!n.includes(i)&&n.push(i)}return n},pe=(e,t)=>{let n=new EventTarget,r=new Map,i=EventTarget.prototype.addEventListener.bind(n),a=EventTarget.prototype.removeEventListener.bind(n);return Object.defineProperty(n,"addEventListener",{configurable:!0,value:(a,o,s)=>{if(o!==null){if(!r.has(a)){let i=r=>{n.dispatchEvent(new CustomEvent(a,{detail:t(r,e),bubbles:r.bubbles,cancelable:r.cancelable,composed:r.composed}))};e.addEventListener(a,i),r.set(a,i)}i(a,o,s)}}}),Object.defineProperty(n,"removeEventListener",{configurable:!0,value:(t,n,i)=>{if(n===null)return;a(t,n,i);let o=r.get(t);o&&(e.removeEventListener(t,o),r.delete(t))}}),n},me=e=>typeof e==`boolean`?+!!e:+!!e?.capture,he=e=>{let t=new WeakMap;return{addEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${me(i)}`,o=t.get(r);if(o||(o=new Map,t.set(r,o)),o.has(a))return;let s=typeof i==`object`&&!!i&&!!i.once,c=t=>{s&&o.delete(a);let i=e.unenrich(t,n);typeof r==`function`?r.call(e.target,i):r.handleEvent(i)};o.set(a,c),e.remoteEvents.addEventListener(n,c,i)},removeEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${me(i)}`,o=t.get(r),s=o?.get(a);s&&(e.remoteEvents.removeEventListener(n,s,i),o.delete(a))},dispatchEvent:t=>e.remoteEvents.dispatchEvent(t)}},ge=d({box:()=>Pe,createVideoElementHandle:()=>Me,isType:()=>Ne,revive:()=>Fe,type:()=>_e}),_e=`videoElement`,ve=[`currentTime`,`volume`,`muted`,`playbackRate`,`src`,`loop`,`autoplay`,`preload`,`poster`,`disableRemotePlayback`],ye=[`duration`,`paused`,`ended`,`seeking`,`readyState`,`currentSrc`],be=[`buffered`,`seekable`],xe=Symbol.for(`fkn.remoteVideoElement`),Se=Symbol.for(`fkn.remoteVideoElement.state`),Ce=Symbol.for(`fkn.remoteVideoElement.controller`),we=e=>e?Array.from({length:e.length},(t,n)=>[e.start(n),e.end(n)]):[],Te=e=>{let t={};for(let n of[...ve,...ye])t[n]=e[n];for(let n of be)t[n]=we(e[n]);return t.error=e.error?{code:e.error.code,message:e.error.message}:null,t},Ee=e=>{let t=t=>{if(!Number.isInteger(t)||t<0||t>=e.length)throw new DOMException(`Index or size is negative or greater than the allowed amount`,`IndexSizeError`)};return{get length(){return e.length},start(n){return t(n),e[n][0]},end(n){return t(n),e[n][1]}}},De=e=>e?{code:e.code,message:e.message,MEDIA_ERR_ABORTED:1,MEDIA_ERR_NETWORK:2,MEDIA_ERR_DECODE:3,MEDIA_ERR_SRC_NOT_SUPPORTED:4}:null,Oe=e=>pe(e,(e,t)=>({originalDetail:e instanceof CustomEvent?e.detail:null,snapshot:Te(t)})),ke=async(e,t)=>{switch(t){case`play`:return await e.play(),null;case`pause`:return e.pause(),null;case`load`:return e.load(),null;case`requestPictureInPicture`:if(typeof e.requestPictureInPicture!=`function`)throw Error(`requestPictureInPicture is not supported in this environment`);return await e.requestPictureInPicture(),null;case`exitPictureInPicture`:{let t=e.ownerDocument;if(typeof t?.exitPictureInPicture!=`function`)throw Error(`exitPictureInPicture is not supported in this environment`);return await t.exitPictureInPicture(),null}default:throw Error(`videoElement: unknown method "${t}"`)}},Ae=e=>({call:async t=>ke(e,t),set:async(t,n)=>{try{e[t]=n}catch{}return Te(e)},events:Oe(e)}),je=(e,t)=>{let n=new EventTarget;Object.defineProperty(n,xe,{value:!0}),Object.defineProperty(n,Se,{value:e}),Object.defineProperty(n,Ce,{value:t});let r=he({target:n,remoteEvents:t.events,unenrich:(t,n)=>{if(!(t instanceof CustomEvent))return t;let r=t.detail;if(!r||!(`snapshot`in r))return t;Object.assign(e,r.snapshot);let i={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed};return r.originalDetail===null?new Event(n,i):new CustomEvent(n,{...i,detail:r.originalDetail})}}),i={addEventListener:{configurable:!0,value:r.addEventListener},removeEventListener:{configurable:!0,value:r.removeEventListener},dispatchEvent:{configurable:!0,value:r.dispatchEvent},error:{configurable:!0,enumerable:!0,get(){return De(e.error)}},play:{configurable:!0,value:()=>t.call(`play`,[])},pause:{configurable:!0,value:()=>{t.call(`pause`,[]).catch(()=>{})}},load:{configurable:!0,value:()=>{t.call(`load`,[]).catch(()=>{})}},requestPictureInPicture:{configurable:!0,value:()=>t.call(`requestPictureInPicture`,[])},exitPictureInPicture:{configurable:!0,value:()=>t.call(`exitPictureInPicture`,[])},HAVE_FUTURE_DATA:{enumerable:!0,value:3},HAVE_ENOUGH_DATA:{enumerable:!0,value:4}};for(let n of ve)i[n]={configurable:!0,enumerable:!0,get(){return e[n]},set(r){e[n]=r,t.set(n,r).then(t=>{Object.assign(e,t)},()=>{})}};for(let t of ye)i[t]={configurable:!0,enumerable:!0,get(){return e[t]}};for(let t of be)i[t]={configurable:!0,enumerable:!0,get(){return Ee(e[t])}};return Object.defineProperties(n,i),n},Me=e=>je(Te(e),Ae(e)),Ne=e=>typeof e==`object`&&!!e&&e[xe]===!0,Pe=(e,t)=>{let n=e;return{...c,type:_e,initialState:n[Se],controller:a(n[Ce],t)}},Fe=(e,t)=>{let n=l(e.controller,t);return je({...e.initialState},n)},Ie=e=>[ge,...e],Le=`fknExtension`,Re=`fknExtensionAbi`,ze=`fknExtensionOps`,Be=[`data-fkn-extension`,`data-fkn-extension-abi`,`data-fkn-extension-ops`],Ve=e=>{if(e===void 0)return 0;let t=Number(e);return Number.isInteger(t)&&t>=0?t:0},He=e=>e===void 0?null:e.split(`,`).map(e=>e.trim()).filter(Boolean),Ue=(e,t=0)=>{if(e.fknExtension!==`true`)return{status:`absent`};let n=Ve(e[Re]),r=He(e[ze]);return n<t?{status:`outdated`,abi:n,required:t,operations:r}:{status:`ok`,abi:n,operations:r}},We=(e,t)=>e.status===`ok`&&e.operations!==null&&e.operations.includes(t),Ge=class extends Error{abi;required;name=`ExtensionOutdatedError`;constructor(e,t){super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`),this.abi=e,this.required=t}},Ke=class extends Error{operation;abi;name=`ExtensionOperationUnsupportedError`;constructor(e,t,n){super(n??`The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`),this.operation=e,this.abi=t}},qe=`FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY`,Je=Le,Ye=o();typeof document<`u`&&document.addEventListener(qe,()=>{Ye.dispatchEvent(new CustomEvent(`statuschange`,{detail:{enabled:Xe()}}))});var Xe=()=>typeof document>`u`?!1:document.documentElement.dataset[Je]===`true`,Ze=()=>typeof document>`u`?{status:`absent`}:Ue(document.documentElement.dataset),Qe=null,$e=e=>{Qe=e},et=150,tt=(e=1e3)=>new Promise((t,n)=>{let r=()=>Ze().status===`ok`;if(r())return t();let i,a=e=>{clearTimeout(i),c.disconnect(),document.removeEventListener(`readystatechange`,l),e()},o=()=>a(async()=>{let e=Ze();if(e.status===`outdated`)return n(new Ge(e.abi,e.required));if(Qe){if(await Qe().catch(()=>{}),r())return t();let e=Ze();if(e.status===`outdated`)return n(new Ge(e.abi,e.required))}n(Error(`The FKN WebExtension is not installed, enabled or not exposed on this page.`))}),s=()=>{clearTimeout(i),i=setTimeout(()=>r()?a(t):o(),et)},c=new MutationObserver(()=>{r()&&a(t)}),l=()=>{document.readyState===`complete`&&!r()&&s()};if(i=setTimeout(o,e),c.observe(document.documentElement,{attributes:!0,attributeFilter:[...Be]}),document.addEventListener(`readystatechange`,l),document.readyState===`complete`)return s();r()&&a(t)}),nt,rt=new Proxy({},{get:(e,t)=>async(...e)=>{await tt(),nt??=i({},{transport:window,revivableModules:Ie});let n=(await nt)[t];return n(...e)}}),it=[`fkn.app`,`fkn.dev`,`sdbx.app`],at=e=>e.replace(/\.+$/,``),ot=e=>{let t=at(e);return it.some(e=>t===e||t.endsWith(`.${e}`))},st={scope:`network.fetch`,category:`network`,severity:0,title:`Fetch data from other sites`,description:`Lets the app download public data from other websites directly, past the usual cross-origin limits.`},ct={scope:`network.fetchCredentialed`,category:`network`,severity:3,chip:`load as you`,unsafe:!0,title:`Fetch from other sites, signed in as you`,description:`Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.`},lt={scope:`network.fetchLocal`,category:`network`,severity:3,chip:`local network`,unsafe:!0,title:`Access devices on your local network`,description:`Lets the app reach devices and services on your home or work network, which websites normally cannot touch.`},ut={scope:`network.readCookie`,category:`network`,severity:3,chip:`read cookie`,unsafe:!0,title:`Read a site’s cookie`,description:`Lets the app read a named cookie from another site, which can include the login token only that site should see.`},dt={scope:`network.modifyRequestHeaders`,category:`network`,severity:2,chip:`rewrite headers`,unsafe:!0,title:`Rewrite request headers to other sites`,description:`Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.`},ft=class extends Error{reason;filename;line;column;source;constructor(e,t,n,r,i){super(`${e}:${n}:${r}: ${t}`),this.reason=t,this.filename=e,this.line=n,this.column=r,this.source=i}},pt=class{start;end;source;constructor(e,t,n){this.start=e,this.end=t,this.source=n}},z;(function(e){e.stylesheet=`stylesheet`,e.rule=`rule`,e.declaration=`declaration`,e.comment=`comment`,e.atRule=`at-rule`,e.container=`container`,e.charset=`charset`,e.counterStyle=`counter-style`,e.document=`document`,e.customMedia=`custom-media`,e.fontFace=`font-face`,e.fontFeatureValues=`font-feature-values`,e.host=`host`,e.import=`import`,e.keyframes=`keyframes`,e.keyframe=`keyframe`,e.layer=`layer`,e.media=`media`,e.namespace=`namespace`,e.page=`page`,e.pageMarginBox=`page-margin-box`,e.positionTry=`position-try`,e.property=`property`,e.scope=`scope`,e.startingStyle=`starting-style`,e.supports=`supports`,e.viewTransition=`view-transition`})(z||={});var mt=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);if(e[o]!==`\\`)return o;r=o+2,i--}while(i>0);throw Error(`Too many escaping`)},ht=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`(`,r)),n.push(e.indexOf(`"`,r)),n.push(e.indexOf(`'`,r)),n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);switch(e[o]){case`\\`:r=o+2;break;case`(`:{let t=ht(e,[`)`],o+1);if(t===-1)return-1;r=t+1}break;case`"`:{let t=mt(e,[`"`],o+1);if(t===-1)return-1;r=t+1}break;case`'`:{let t=mt(e,[`'`],o+1);if(t===-1)return-1;r=t+1}break;default:return o}i--}while(i>0);throw Error(`Too many escaping`)},gt=/\/\*[^]*?(?:\*\/|$)/g;function B(e){return e?e.trim():``}function _t(e,t){let n=e&&typeof e.type==`string`,r=n?e:t;for(let t in e){let n=e[t];Array.isArray(n)?n.forEach(e=>{_t(e,r)}):n&&typeof n==`object`&&_t(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var vt=class{level=0;indentation=` `;compress=!1;constructor(e){typeof e?.indent==`string`&&(this.indentation=e?.indent),e?.compress&&(this.compress=!0)}emit(e,t){return e}indent(e){return this.level=this.level||1,e?(this.level+=e,``):Array(this.level).join(this.indentation)}visit(e){switch(e.type){case z.stylesheet:return this.stylesheet(e);case z.rule:return this.rule(e);case z.declaration:return this.declaration(e);case z.comment:return this.comment(e);case z.container:return this.container(e);case z.charset:return this.charset(e);case z.counterStyle:return this.counterStyle(e);case z.document:return this.document(e);case z.customMedia:return this.customMedia(e);case z.fontFace:return this.fontFace(e);case z.fontFeatureValues:return this.fontFeatureValues(e);case z.host:return this.host(e);case z.import:return this.import(e);case z.keyframes:return this.keyframes(e);case z.keyframe:return this.keyframe(e);case z.layer:return this.layer(e);case z.media:return this.media(e);case z.namespace:return this.namespace(e);case z.page:return this.page(e);case z.pageMarginBox:return this.pageMarginBox(e);case z.positionTry:return this.positionTry(e);case z.property:return this.property(e);case z.scope:return this.scope(e);case z.startingStyle:return this.startingStyle(e);case z.supports:return this.supports(e);case z.viewTransition:return this.viewTransition(e);case z.atRule:return this.genericAtRule(e)}}mapVisit(e,t){let n=``;t||=``;for(let r=0,i=e.length;r<i;r++)n+=this.visit(e[r]),t&&r<i-1&&(n+=this.emit(t));return n}compile(e){return this.compress?e.stylesheet.rules.map(this.visit,this).join(``):this.stylesheet(e)}stylesheet(e){return this.mapVisit(e.stylesheet.rules,`
|
|
2
|
+
import{_t as e,gt as t,ht as n,mt as r}from"./embed-title-DEy3PowC.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./build-mcPaLDi_.js";import{c as u,l as d,o as f,s as p}from"./account-B2ETje0Z.js";import{a as m,c as h,d as g,f as _,n as v,o as y,r as b,s as x,t as S,u as C}from"./api-DIgTslNb-Cs0uqWX1.js";var w={scope:`read.text`,category:`storage`,severity:1,chip:`read text`,title:`Read text from the page`,description:`Lets the app see the text shown on this page.`},T={scope:`read.info`,category:`storage`,severity:1,chip:`read details`,title:`Read info from the page`,description:`Lets the app read a detail of a part of the page.`},E={scope:`read.visible`,category:`storage`,severity:0,title:`See what’s visible on the page`,description:`Lets the app check which elements are currently on screen.`},D={scope:`read.check`,category:`storage`,severity:0,title:`Check if something is on the page`,description:`Lets the app test whether a specific element exists.`},O={scope:`read.count`,category:`storage`,severity:0,title:`Count items on the page`,description:`Lets the app count how many matching elements are present.`},k={scope:`act.click`,category:`interaction`,severity:3,chip:`click`,title:`Click on the page`,description:`Lets the app press buttons or links for you.`},A={scope:`act.type`,category:`interaction`,severity:1,chip:`type`,title:`Type into a text field`,description:`Lets the app fill in form fields on your behalf.`},j={scope:`act.hover`,category:`interaction`,severity:1,chip:`hover`,title:`Hover over the page`,description:`Lets the app point at things to reveal menus or tooltips.`},M={scope:`media.video`,category:`interaction`,severity:0,title:`Control video playback`,description:`Lets the app play, pause, seek, and read the video on the page.`},ee={scope:`media.appear`,category:`interaction`,severity:0,title:`Change page appearance`,description:`Lets the app restyle parts of the page (safely filtered).`},N={scope:`media.appearU`,category:`evaluation`,severity:2,chip:`unfiltered styles`,unsafe:!0,title:`Change page appearance (unsafe)`,description:`Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.`},P={scope:`frame.evaluate`,category:`evaluation`,severity:3,chip:`run code`,unsafe:!0,title:`Run the app’s code on this site`,description:`Lets the app run its own script inside this site, with full access to the page and the data it shows.`},F={scope:`frame.message`,category:`evaluation`,severity:3,chip:`message the page`,unsafe:!0,title:`Send messages to this site`,description:`Lets the app send messages and open channels into this site, which its scripts receive as their own.`},te=e=>e?.noSanitize?N:ee,ne={scope:`frame.fetchRead`,category:`network`,severity:3,chip:`load`,unsafe:!0,title:`Read your account data on this site`,description:`Lets the app read pages and data from this site as you, using the session in the frame.`},re={scope:`frame.fetchWrite`,category:`network`,severity:3,chip:`send`,unsafe:!0,title:`Change your account data on this site`,description:`Lets the app send changes to this site as you, using the session in the frame.`},I=new Set([`GET`,`HEAD`,`OPTIONS`]),L=(e,t)=>I.has((t?.method??`GET`).toUpperCase())?ne:re,ie={click:k,fill:A,hover:j,textContent:w,getAttribute:T,isVisible:E,count:O,exists:D,videoElement:M,addStyleTag:te,fetch:L,evaluate:P},ae={postMessage:F,addScriptTag:P};[w,T,E,D,O,k,A,j,M,ee,N,ne,re,P,F].map(e=>e.scope);var oe={...ie,...ae},se=(e,t)=>{let n=oe[e];return n?(typeof n==`function`?n(...t):n).scope:null},ce=(e,t)=>{try{return new URL(e,t)}catch{return}},le=e=>{let t=ce(e,`https://s.invalid/`),n=ce(e,`http://s.invalid/`);if(!t||!n)return{kind:`invalid`};let r=ce(e);return!r||r.href!==t.href||r.href!==n.href?{kind:`relative`}:r.protocol!==`https:`&&r.protocol!==`http:`?{kind:`unsupported`,protocol:r.protocol}:{kind:`absolute`,host:r.hostname,protocol:r.protocol}},ue=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/,de=/^\[[0-9a-f:.]+\]$/,fe=e=>{try{return new URL(`http://${e}/`).hostname}catch{return}},R=(e,{ipv6:t=!1}={})=>{let n=[];for(let r of e){let e=r.trim().toLowerCase();if(!e||e.length>253)continue;let i=ue.test(e)?e:t&&de.test(e)?fe(e):void 0;i&&!n.includes(i)&&n.push(i)}return n},pe=(e,t)=>{let n=new EventTarget,r=new Map,i=EventTarget.prototype.addEventListener.bind(n),a=EventTarget.prototype.removeEventListener.bind(n);return Object.defineProperty(n,"addEventListener",{configurable:!0,value:(a,o,s)=>{if(o!==null){if(!r.has(a)){let i=r=>{n.dispatchEvent(new CustomEvent(a,{detail:t(r,e),bubbles:r.bubbles,cancelable:r.cancelable,composed:r.composed}))};e.addEventListener(a,i),r.set(a,i)}i(a,o,s)}}}),Object.defineProperty(n,"removeEventListener",{configurable:!0,value:(t,n,i)=>{if(n===null)return;a(t,n,i);let o=r.get(t);o&&(e.removeEventListener(t,o),r.delete(t))}}),n},me=e=>typeof e==`boolean`?+!!e:+!!e?.capture,he=e=>{let t=new WeakMap;return{addEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${me(i)}`,o=t.get(r);if(o||(o=new Map,t.set(r,o)),o.has(a))return;let s=typeof i==`object`&&!!i&&!!i.once,c=t=>{s&&o.delete(a);let i=e.unenrich(t,n);typeof r==`function`?r.call(e.target,i):r.handleEvent(i)};o.set(a,c),e.remoteEvents.addEventListener(n,c,i)},removeEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${me(i)}`,o=t.get(r),s=o?.get(a);s&&(e.remoteEvents.removeEventListener(n,s,i),o.delete(a))},dispatchEvent:t=>e.remoteEvents.dispatchEvent(t)}},ge=d({box:()=>Pe,createVideoElementHandle:()=>Me,isType:()=>Ne,revive:()=>Fe,type:()=>_e}),_e=`videoElement`,ve=[`currentTime`,`volume`,`muted`,`playbackRate`,`src`,`loop`,`autoplay`,`preload`,`poster`,`disableRemotePlayback`],ye=[`duration`,`paused`,`ended`,`seeking`,`readyState`,`currentSrc`],be=[`buffered`,`seekable`],xe=Symbol.for(`fkn.remoteVideoElement`),Se=Symbol.for(`fkn.remoteVideoElement.state`),Ce=Symbol.for(`fkn.remoteVideoElement.controller`),we=e=>e?Array.from({length:e.length},(t,n)=>[e.start(n),e.end(n)]):[],Te=e=>{let t={};for(let n of[...ve,...ye])t[n]=e[n];for(let n of be)t[n]=we(e[n]);return t.error=e.error?{code:e.error.code,message:e.error.message}:null,t},Ee=e=>{let t=t=>{if(!Number.isInteger(t)||t<0||t>=e.length)throw new DOMException(`Index or size is negative or greater than the allowed amount`,`IndexSizeError`)};return{get length(){return e.length},start(n){return t(n),e[n][0]},end(n){return t(n),e[n][1]}}},De=e=>e?{code:e.code,message:e.message,MEDIA_ERR_ABORTED:1,MEDIA_ERR_NETWORK:2,MEDIA_ERR_DECODE:3,MEDIA_ERR_SRC_NOT_SUPPORTED:4}:null,Oe=e=>pe(e,(e,t)=>({originalDetail:e instanceof CustomEvent?e.detail:null,snapshot:Te(t)})),ke=async(e,t)=>{switch(t){case`play`:return await e.play(),null;case`pause`:return e.pause(),null;case`load`:return e.load(),null;case`requestPictureInPicture`:if(typeof e.requestPictureInPicture!=`function`)throw Error(`requestPictureInPicture is not supported in this environment`);return await e.requestPictureInPicture(),null;case`exitPictureInPicture`:{let t=e.ownerDocument;if(typeof t?.exitPictureInPicture!=`function`)throw Error(`exitPictureInPicture is not supported in this environment`);return await t.exitPictureInPicture(),null}default:throw Error(`videoElement: unknown method "${t}"`)}},Ae=e=>({call:async t=>ke(e,t),set:async(t,n)=>{try{e[t]=n}catch{}return Te(e)},events:Oe(e)}),je=(e,t)=>{let n=new EventTarget;Object.defineProperty(n,xe,{value:!0}),Object.defineProperty(n,Se,{value:e}),Object.defineProperty(n,Ce,{value:t});let r=he({target:n,remoteEvents:t.events,unenrich:(t,n)=>{if(!(t instanceof CustomEvent))return t;let r=t.detail;if(!r||!(`snapshot`in r))return t;Object.assign(e,r.snapshot);let i={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed};return r.originalDetail===null?new Event(n,i):new CustomEvent(n,{...i,detail:r.originalDetail})}}),i={addEventListener:{configurable:!0,value:r.addEventListener},removeEventListener:{configurable:!0,value:r.removeEventListener},dispatchEvent:{configurable:!0,value:r.dispatchEvent},error:{configurable:!0,enumerable:!0,get(){return De(e.error)}},play:{configurable:!0,value:()=>t.call(`play`,[])},pause:{configurable:!0,value:()=>{t.call(`pause`,[]).catch(()=>{})}},load:{configurable:!0,value:()=>{t.call(`load`,[]).catch(()=>{})}},requestPictureInPicture:{configurable:!0,value:()=>t.call(`requestPictureInPicture`,[])},exitPictureInPicture:{configurable:!0,value:()=>t.call(`exitPictureInPicture`,[])},HAVE_FUTURE_DATA:{enumerable:!0,value:3},HAVE_ENOUGH_DATA:{enumerable:!0,value:4}};for(let n of ve)i[n]={configurable:!0,enumerable:!0,get(){return e[n]},set(r){e[n]=r,t.set(n,r).then(t=>{Object.assign(e,t)},()=>{})}};for(let t of ye)i[t]={configurable:!0,enumerable:!0,get(){return e[t]}};for(let t of be)i[t]={configurable:!0,enumerable:!0,get(){return Ee(e[t])}};return Object.defineProperties(n,i),n},Me=e=>je(Te(e),Ae(e)),Ne=e=>typeof e==`object`&&!!e&&e[xe]===!0,Pe=(e,t)=>{let n=e;return{...c,type:_e,initialState:n[Se],controller:a(n[Ce],t)}},Fe=(e,t)=>{let n=l(e.controller,t);return je({...e.initialState},n)},Ie=e=>[ge,...e],Le=`fknExtension`,Re=`fknExtensionAbi`,ze=`fknExtensionOps`,Be=[`data-fkn-extension`,`data-fkn-extension-abi`,`data-fkn-extension-ops`],Ve=e=>{if(e===void 0)return 0;let t=Number(e);return Number.isInteger(t)&&t>=0?t:0},He=e=>e===void 0?null:e.split(`,`).map(e=>e.trim()).filter(Boolean),Ue=(e,t=0)=>{if(e.fknExtension!==`true`)return{status:`absent`};let n=Ve(e[Re]),r=He(e[ze]);return n<t?{status:`outdated`,abi:n,required:t,operations:r}:{status:`ok`,abi:n,operations:r}},We=(e,t)=>e.status===`ok`&&e.operations!==null&&e.operations.includes(t),Ge=class extends Error{abi;required;name=`ExtensionOutdatedError`;constructor(e,t){super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`),this.abi=e,this.required=t}},Ke=class extends Error{operation;abi;name=`ExtensionOperationUnsupportedError`;constructor(e,t,n){super(n??`The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`),this.operation=e,this.abi=t}},qe=`FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY`,Je=Le,Ye=o();typeof document<`u`&&document.addEventListener(qe,()=>{Ye.dispatchEvent(new CustomEvent(`statuschange`,{detail:{enabled:Xe()}}))});var Xe=()=>typeof document>`u`?!1:document.documentElement.dataset[Je]===`true`,Ze=()=>typeof document>`u`?{status:`absent`}:Ue(document.documentElement.dataset),Qe=null,$e=e=>{Qe=e},et=150,tt=(e=1e3)=>new Promise((t,n)=>{let r=()=>Ze().status===`ok`;if(r())return t();let i,a=e=>{clearTimeout(i),c.disconnect(),document.removeEventListener(`readystatechange`,l),e()},o=()=>a(async()=>{let e=Ze();if(e.status===`outdated`)return n(new Ge(e.abi,e.required));if(Qe){if(await Qe().catch(()=>{}),r())return t();let e=Ze();if(e.status===`outdated`)return n(new Ge(e.abi,e.required))}n(Error(`The FKN WebExtension is not installed, enabled or not exposed on this page.`))}),s=()=>{clearTimeout(i),i=setTimeout(()=>r()?a(t):o(),et)},c=new MutationObserver(()=>{r()&&a(t)}),l=()=>{document.readyState===`complete`&&!r()&&s()};if(i=setTimeout(o,e),c.observe(document.documentElement,{attributes:!0,attributeFilter:[...Be]}),document.addEventListener(`readystatechange`,l),document.readyState===`complete`)return s();r()&&a(t)}),nt,rt=new Proxy({},{get:(e,t)=>async(...e)=>{await tt(),nt??=i({},{transport:window,revivableModules:Ie});let n=(await nt)[t];return n(...e)}}),it=[`fkn.app`,`fkn.dev`,`sdbx.app`],at=e=>e.replace(/\.+$/,``),ot=e=>{let t=at(e);return it.some(e=>t===e||t.endsWith(`.${e}`))},st={scope:`network.fetch`,category:`network`,severity:0,title:`Fetch data from other sites`,description:`Lets the app download public data from other websites directly, past the usual cross-origin limits.`},ct={scope:`network.fetchCredentialed`,category:`network`,severity:3,chip:`load as you`,unsafe:!0,title:`Fetch from other sites, signed in as you`,description:`Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.`},lt={scope:`network.fetchLocal`,category:`network`,severity:3,chip:`local network`,unsafe:!0,title:`Access devices on your local network`,description:`Lets the app reach devices and services on your home or work network, which websites normally cannot touch.`},ut={scope:`network.readCookie`,category:`network`,severity:3,chip:`read cookie`,unsafe:!0,title:`Read a site’s cookie`,description:`Lets the app read a named cookie from another site, which can include the login token only that site should see.`},dt={scope:`network.modifyRequestHeaders`,category:`network`,severity:2,chip:`rewrite headers`,unsafe:!0,title:`Rewrite request headers to other sites`,description:`Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.`},ft=class extends Error{reason;filename;line;column;source;constructor(e,t,n,r,i){super(`${e}:${n}:${r}: ${t}`),this.reason=t,this.filename=e,this.line=n,this.column=r,this.source=i}},pt=class{start;end;source;constructor(e,t,n){this.start=e,this.end=t,this.source=n}},z;(function(e){e.stylesheet=`stylesheet`,e.rule=`rule`,e.declaration=`declaration`,e.comment=`comment`,e.atRule=`at-rule`,e.container=`container`,e.charset=`charset`,e.counterStyle=`counter-style`,e.document=`document`,e.customMedia=`custom-media`,e.fontFace=`font-face`,e.fontFeatureValues=`font-feature-values`,e.host=`host`,e.import=`import`,e.keyframes=`keyframes`,e.keyframe=`keyframe`,e.layer=`layer`,e.media=`media`,e.namespace=`namespace`,e.page=`page`,e.pageMarginBox=`page-margin-box`,e.positionTry=`position-try`,e.property=`property`,e.scope=`scope`,e.startingStyle=`starting-style`,e.supports=`supports`,e.viewTransition=`view-transition`})(z||={});var mt=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);if(e[o]!==`\\`)return o;r=o+2,i--}while(i>0);throw Error(`Too many escaping`)},ht=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`(`,r)),n.push(e.indexOf(`"`,r)),n.push(e.indexOf(`'`,r)),n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);switch(e[o]){case`\\`:r=o+2;break;case`(`:{let t=ht(e,[`)`],o+1);if(t===-1)return-1;r=t+1}break;case`"`:{let t=mt(e,[`"`],o+1);if(t===-1)return-1;r=t+1}break;case`'`:{let t=mt(e,[`'`],o+1);if(t===-1)return-1;r=t+1}break;default:return o}i--}while(i>0);throw Error(`Too many escaping`)},gt=/\/\*[^]*?(?:\*\/|$)/g;function B(e){return e?e.trim():``}function _t(e,t){let n=e&&typeof e.type==`string`,r=n?e:t;for(let t in e){let n=e[t];Array.isArray(n)?n.forEach(e=>{_t(e,r)}):n&&typeof n==`object`&&_t(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var vt=class{level=0;indentation=` `;compress=!1;constructor(e){typeof e?.indent==`string`&&(this.indentation=e?.indent),e?.compress&&(this.compress=!0)}emit(e,t){return e}indent(e){return this.level=this.level||1,e?(this.level+=e,``):Array(this.level).join(this.indentation)}visit(e){switch(e.type){case z.stylesheet:return this.stylesheet(e);case z.rule:return this.rule(e);case z.declaration:return this.declaration(e);case z.comment:return this.comment(e);case z.container:return this.container(e);case z.charset:return this.charset(e);case z.counterStyle:return this.counterStyle(e);case z.document:return this.document(e);case z.customMedia:return this.customMedia(e);case z.fontFace:return this.fontFace(e);case z.fontFeatureValues:return this.fontFeatureValues(e);case z.host:return this.host(e);case z.import:return this.import(e);case z.keyframes:return this.keyframes(e);case z.keyframe:return this.keyframe(e);case z.layer:return this.layer(e);case z.media:return this.media(e);case z.namespace:return this.namespace(e);case z.page:return this.page(e);case z.pageMarginBox:return this.pageMarginBox(e);case z.positionTry:return this.positionTry(e);case z.property:return this.property(e);case z.scope:return this.scope(e);case z.startingStyle:return this.startingStyle(e);case z.supports:return this.supports(e);case z.viewTransition:return this.viewTransition(e);case z.atRule:return this.genericAtRule(e)}}mapVisit(e,t){let n=``;t||=``;for(let r=0,i=e.length;r<i;r++)n+=this.visit(e[r]),t&&r<i-1&&(n+=this.emit(t));return n}compile(e){return this.compress?e.stylesheet.rules.map(this.visit,this).join(``):this.stylesheet(e)}stylesheet(e){return this.mapVisit(e.stylesheet.rules,`
|
|
3
3
|
|
|
4
4
|
`)}comment(e){return this.compress?this.emit(``,e.position):this.emit(`${this.indent()}/*${e.comment}*/`,e.position)}container(e){return this.compress?this.emit(`@container ${e.container}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@container ${e.container}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
5
5
|
|