vendor: 13,396 bytes, lines 1-3
1var ne=Object.defineProperty;var s=(e,t)=>ne(e,"name",{value:t,configurable:!0}),k=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var W=(()=>{for(var e=new Uint8Array(128),t=0;t<64;t++)e[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return r=>{for(var i=r.length,a=new Uint8Array((i-(r[i-1]=="=")-(r[i-2]=="="))*3/4|0),n=0,o=0;n<i;){var c=e[r.charCodeAt(n++)],l=e[r.charCodeAt(n++)],d=e[r.charCodeAt(n++)],u=e[r.charCodeAt(n++)];a[o++]=c<<2|l>>4,a[o++]=l<<4|d>>2,a[o++]=d<<6|u}return a}})();function re(e){return!isNaN(parseFloat(e))&&isFinite(e)}s(re,"_isNumber");function S(e){return e.charAt(0).toUpperCase()+e.substring(1)}s(S,"_capitalize");function O(e){return function(){return this[e]}}s(O,"_getter");var E=["isConstructor","isEval","isNative","isToplevel"],P=["columnNumber","lineNumber"],N=["fileName","functionName","source"],ie=["args"],oe=["evalOrigin"],R=E.concat(P,N,ie,oe);function m(e){if(e)for(var t=0;t<R.length;t++)e[R[t]]!==void 0&&this["set"+S(R[t])](e[R[t]])}s(m,"StackFrame");m.prototype={getArgs:s(function(){return this.args},"getArgs"),setArgs:s(function(e){if(Object.prototype.toString.call(e)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=e},"setArgs"),getEvalOrigin:s(function(){return this.evalOrigin},"getEvalOrigin"),setEvalOrigin:s(function(e){if(e instanceof m)this.evalOrigin=e;else if(e instanceof Object)this.evalOrigin=new m(e);else throw new TypeError("Eval Origin must be an Object or StackFrame")},"setEvalOrigin"),toString:s(function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",i=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:i?i+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r},"toString")};m.fromString=s(function(t){var r=t.indexOf("("),i=t.lastIndexOf(")"),a=t.substring(0,r),n=t.substring(r+1,i).split(","),o=t.substring(i+1);if(o.indexOf("@")===0)var c=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),l=c[1],d=c[2],u=c[3];return new m({functionName:a,args:n||void 0,fileName:l,lineNumber:d||void 0,columnNumber:u||void 0})},"StackFrame$$fromString");for(b=0;b<E.length;b++)m.prototype["get"+S(E[b])]=O(E[b]),m.prototype["set"+S(E[b])]=function(e){return function(t){this[e]=!!t}}(E[b]);var b;for(v=0;v<P.length;v++)m.prototype["get"+S(P[v])]=O(P[v]),m.prototype["set"+S(P[v])]=function(e){return function(t){if(!re(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(P[v]);var v;for(h=0;h<N.length;h++)m.prototype["get"+S(N[h])]=O(N[h]),m.prototype["set"+S(N[h])]=function(e){return function(t){this[e]=String(t)}}(N[h]);var h,A=m;function se(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:s(function(i){if(i.stack&&i.stack.match(e))return this.parseV8OrIE(i);if(i.stack)return this.parseFFOrSafari(i);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:s(function(i){if(i.indexOf(":")===-1)return[i];var a=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=a.exec(i.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:s(function(i){var a=i.stack.split(` 2`).filter(function(n){return!!n.match(e)},this);return a.map(function(n){n.indexOf("(eval ")>-1&&(n=n.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var o=n.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),c=o.match(/ (\(.+\)$)/);o=c?o.replace(c[0],""):o;var l=this.extractLocation(c?c[1]:o),d=c&&o||void 0,u=["eval","<anonymous>"].indexOf(l[0])>-1?void 0:l[0];return new A({functionName:d,fileName:u,lineNumber:l[1],columnNumber:l[2],source:n})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:s(function(i){var a=i.stack.split(` 3`).filter(function(n){return!n.match(t)},this);return a.map(function(n){if(n.indexOf(" > eval")>-1&&(n=n.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),n.indexOf("@")===-1&&n.indexOf(":")===-1)return new A({functionName:n});var o=/((.*".+"[^@]*)?[^@]*)(?:@)/,c=n.match(o),l=c&&c[1]?c[1]:void 0,d=this.extractLocation(n.replace(o,""));return new A({functionName:l,fileName:d[0],lineNumber:d[1],columnNumber:d[2],source:n})},this)},"ErrorStackParser$$parseFFOrSafari")}}s(se,"ErrorStackParser");var ae=new se;var $=ae;var y=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!process.browser,L=y&&typeof module<"u"&&typeof module.exports<"u"&&typeof k<"u"&&typeof __dirname<"u",B=y&&!L,Ae=typeof globalThis.Bun<"u",ce=typeof Deno<"u",j=!y&&!ce,H=j&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof importScripts!="function",V=j&&typeof importScripts=="function"&&typeof self=="object",Oe=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1,F=typeof read=="function"&&typeof load=="function";var q,T,J,z,D;async function U(){if(!y||(q=(await import("node:url")).default,z=await import("node:fs"),D=await import("node:fs/promises"),J=(await import("node:vm")).default,T=await import("node:path"),C=T.sep,typeof k<"u"))return;let e=z,t=await import("node:crypto"),r=await import("ws"),i=await import("node:child_process"),a={fs:e,crypto:t,ws:r,child_process:i};globalThis.require=function(n){return a[n]}}s(U,"initNodeModules");function le(e,t){return T.resolve(t||".",e)}s(le,"node_resolvePath");function de(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}s(de,"browser_resolvePath");var x;y?x=le:F?x=s(e=>e,"resolvePath"):x=de;var C;y||(C="/");function ue(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:D.readFile(e).then(r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}}s(ue,"node_getBinaryResponse");function fe(e,t){if(e.startsWith("file://")&&(e=e.slice(7)),e.includes("://"))throw new Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(e)))}}s(fe,"shell_getBinaryResponse");function me(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}s(me,"browser_getBinaryResponse");var _;y?_=ue:F?_=fe:_=me;async function Y(e,t){let{response:r,binary:i}=_(e,t);if(i)return i;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}s(Y,"loadBinaryFile");var I;if(H)I=s(async e=>await import(e),"loadScript");else if(V)I=s(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},"loadScript");else if(y)I=pe;else if(F)I=load;else throw new Error("Cannot determine runtime environment");async function pe(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?J.runInThisContext(await(await fetch(e)).text()):await import(q.pathToFileURL(e).href)}s(pe,"nodeLoadScript");async function K(e){if(y){await U();let t=await D.readFile(e,{encoding:"utf8"});return JSON.parse(t)}else if(F){let t=read(e);return JSON.parse(t)}else return await(await fetch(e)).json()}s(K,"loadLockFile");async function G(){if(L)return __dirname;let e;try{throw new Error}catch(i){e=i}let t=$.parse(e)[0].fileName;if(y&&!t.startsWith("file://")&&(t=`file://${t}`),B){let i=await import("node:path");return(await import("node:url")).fileURLToPath(i.dirname(t))}let r=t.lastIndexOf(C);if(r===-1)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}s(G,"calculateDirname");function X(e){let t=e.FS,r=e.FS.filesystems.MEMFS,i=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:s(function(n){if(!n.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},"mount"),syncfs:s(async(n,o,c)=>{try{let l=a.getLocalSet(n),d=await a.getRemoteSet(n),u=o?d:l,p=o?l:d;await a.reconcile(n,u,p),c(null)}catch(l){c(l)}},"syncfs"),getLocalSet:s(n=>{let o=Object.create(null);function c(u){return u!=="."&&u!==".."}s(c,"isRealDir");function l(u){return p=>i.join2(u,p)}s(l,"toAbsolute");let d=t.readdir(n.mountpoint).filter(c).map(l(n.mountpoint));for(;d.length;){let u=d.pop(),p=t.stat(u);t.isDir(p.mode)&&d.push.apply(d,t.readdir(u).filter(c).map(l(u))),o[u]={timestamp:p.mtime,mode:p.mode}}return{type:"local",entries:o}},"getLocalSet"),getRemoteSet:s(async n=>{let o=Object.create(null),c=await ye(n.opts.fileSystemHandle);for(let[l,d]of c)l!=="."&&(o[i.join2(n.mountpoint,l)]={timestamp:d.kind==="file"?new Date((await d.getFile()).lastModified):new Date,mode:d.kind==="file"?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:o,handles:c}},"getRemoteSet"),loadLocalEntry:s(n=>{let c=t.lookupPath(n).node,l=t.stat(n);if(t.isDir(l.mode))return{timestamp:l.mtime,mode:l.mode};if(t.isFile(l.mode))return c.contents=r.getFileDataAsTypedArray(c),{timestamp:l.mtime,mode:l.mode,contents:c.contents};throw new Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:s((n,o)=>{if(t.isDir(o.mode))t.mkdirTree(n,o.mode);else if(t.isFile(o.mode))t.writeFile(n,o.contents,{canOwn:!0});else throw new Error("node type not supported");t.chmod(n,o.mode),t.utime(n,o.timestamp,o.timestamp)},"storeLocalEntry"),removeLocalEntry:s(n=>{var o=t.stat(n);t.isDir(o.mode)?t.rmdir(n):t.isFile(o.mode)&&t.unlink(n)},"removeLocalEntry"),loadRemoteEntry:s(async n=>{if(n.kind==="file"){let o=await n.getFile();return{contents:new Uint8Array(await o.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(o.lastModified)}}else{if(n.kind==="directory")return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+n.kind)}},"loadRemoteEntry"),storeRemoteEntry:s(async(n,o,c)=>{let l=n.get(i.dirname(o)),d=t.isFile(c.mode)?await l.getFileHandle(i.basename(o),{create:!0}):await l.getDirectoryHandle(i.basename(o),{create:!0});if(d.kind==="file"){let u=await d.createWritable();await u.write(c.contents),await u.close()}n.set(o,d)},"storeRemoteEntry"),removeRemoteEntry:s(async(n,o)=>{await n.get(i.dirname(o)).removeEntry(i.basename(o)),n.delete(o)},"removeRemoteEntry"),reconcile:s(async(n,o,c)=>{let l=0,d=[];Object.keys(o.entries).forEach(function(f){let g=o.entries[f],w=c.entries[f];(!w||t.isFile(g.mode)&&g.timestamp.getTime()>w.timestamp.getTime())&&(d.push(f),l++)}),d.sort();let u=[];if(Object.keys(c.entries).forEach(function(f){o.entries[f]||(u.push(f),l++)}),u.sort().reverse(),!l)return;let p=o.type==="remote"?o.handles:c.handles;for(let f of d){let g=i.normalize(f.replace(n.mountpoint,"/")).substring(1);if(c.type==="local"){let w=p.get(g),te=await a.loadRemoteEntry(w);a.storeLocalEntry(f,te)}else{let w=a.loadLocalEntry(f);await a.storeRemoteEntry(p,g,w)}}for(let f of u)if(c.type==="local")a.removeLocalEntry(f);else{let g=i.normalize(f.replace(n.mountpoint,"/")).substring(1);await a.removeRemoteEntry(p,g)}},"reconcile")};e.FS.filesystems.NATIVEFS_ASYNC=a}s(X,"initializeNativeFS");var ye=s(async e=>{let t=[];async function r(a){for await(let n of a.values())t.push(n),n.kind==="directory"&&await r(n)}s(r,"collect"),await r(e);let i=new Map;i.set(".",e);for(let a of t){let n=(await e.resolve(a)).join("/");i.set(n,a)}return i},"getFsHandles");var Q=W("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs=");var be=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1))){return;try{let t=await WebAssembly.compile(Q);return await WebAssembly.instantiate(t)}catch(t){if(t instanceof WebAssembly.CompileError)return;throw t}}}();async function Z(){let e=await be;if(e)return e.exports;let t=Symbol("error marker");return{create_sentinel:s(()=>t,"create_sentinel"),is_sentinel:s(r=>r===t,"is_sentinel")}}s(Z,"getSentinelImport");function ee(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Pe(e),print:e.stdout,printErr:e.stderr,onExit(r){t.exitCode=r},thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:s(r=>e.indexURL+r,"locateFile"),instantiateWasm:Ne(e.indexURL)};return t}s(ee,"createSettings");function ve(e){return function(t){let r="/";try{t.FS.mkdirTree(e)}catch(i){console.error(`Error occurred while making a home directory '${e}':`),console.error(i),console.error(`Using '${r}' for a home directory instead`),e=r}t.FS.chdir(e)}}s(ve,"createHomeDirectory");function he(e){return function(t){Object.assign(t.ENV,e)}}s(he,"setEnvironment");function Se(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}s(Se,"callFsInitHook");function we(e){let t=e.HEAPU32[e._Py_Version>>>2],r=t>>>24&255,i=t>>>16&255,a=t>>>8&255;return[r,i,a]}s(we,"computeVersionTuple");function Ee(e){let t=Y(e);return async r=>{r.API.pyVersionTuple=we(r);let[i,a]=r.API.pyVersionTuple;r.FS.mkdirTree("/lib"),r.API.sitePackages=`/lib/python${i}.${a}/site-packages`,r.FS.mkdirTree(r.API.sitePackages),r.addRunDependency("install-stdlib");try{let n=await t;r.FS.writeFile(`/lib/python${i}${a}.zip`,n)}catch(n){console.error("Error occurred while installing the standard library:"),
3console.error(n)}finally{r.removeRunDependency("install-stdlib")}}}s(Ee,"installStdlib");function Pe(e){let t;return e.stdLibURL!=null?t=e.stdLibURL:t=e.indexURL+"python_stdlib.zip",[Ee(t),ve(e.env.HOME),he(e.env),X,...Se(e.fsInit)]}s(Pe,"getFileSystemInitializationFuncs");function Ne(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=_(e+"pyodide.asm.wasm"),i=Z();return function(a,n){return async function(){a.sentinel=await i;try{let o;r?o=await WebAssembly.instantiateStreaming(r,a):o=await WebAssembly.instantiate(await t,a);let{instance:c,module:l}=o;n(c,l)}catch(o){console.warn("wasm instantiation failed!"),console.warn(o)}}(),{}}}s(Ne,"getInstantiateWasmFunc");var M="0.28.0";async function tt(e={}){await U();let t=e.indexURL||await G();t=x(t),t.endsWith("/")||(t+="/"),e.indexURL=t;let r={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:t+"pyodide-lock.json",args:[],env:{},packages:[],enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"aca77914b08e1d99774d24f0b7c9b8f9068e2c62cf4696d7e95d8c3b72139f2d"},i=Object.assign(r,e);i.env.HOME??="/home/pyodide",i.env.PYTHONINSPECT??="1";let a=ee(i),n=a.API;if(n.lockFilePromise=K(i.lockFileURL),typeof _createPyodideModule!="function"){let u=`${i.indexURL}pyodide.asm.js`;await I(u)}let o;if(e._loadSnapshot){let u=await e._loadSnapshot;ArrayBuffer.isView(u)?o=u:o=new Uint8Array(u),a.noInitialRun=!0,a.INITIAL_MEMORY=o.length}let c=await _createPyodideModule(a);if(a.exitCode!==void 0)throw new c.ExitStatus(a.exitCode);if(e.pyproxyToStringRepr&&n.setPyProxyToStringMethod(!0),e.convertNullToNone&&n.setCompatNullToNone(!0),n.version!==M&&i.checkAPIVersion)throw new Error(`Pyodide version does not match: '${M}' <==> '${n.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);c.locateFile=u=>{throw u.endsWith(".so")?new Error(`Failed to find dynamic library "${u}"`):new Error(`Unexpected call to locateFile("${u}")`)};let l;o&&(l=n.restoreSnapshot(o));let d=n.finalizeBootstrap(l,e._snapshotDeserializer);return n.sys.path.insert(0,""),d.version.includes("dev")||n.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${d.version}/full/`),n._pyodide.set_excepthook(),await n.packageIndexReady,n.initializeStreams(i.stdin,i.stdout,i.stderr),d}s(tt,"loadPyodide");export{tt as loadPyodide,M as version}; 4//# sourceMappingURL=pyodide.mjs.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.