5 lines
40 KiB
JavaScript
5 lines
40 KiB
JavaScript
|
//! Licensed to the .NET Foundation under one or more agreements.
|
||
|
//! The .NET Foundation licenses this file to you under the MIT license.
|
||
|
var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),o=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),n=Symbol.for("wasm promise_control");function r(e,t){let o=null;const r=new Promise((function(n,r){o={isDone:!1,promise:null,resolve:t=>{o.isDone||(o.isDone=!0,n(t),e&&e())},reject:e=>{o.isDone||(o.isDone=!0,r(e),t&&t())}}}));o.promise=r;const i=r;return i[n]=o,{promise:i,promise_control:o}}function i(e){return e[n]}function s(e){e&&function(e){return void 0!==e[n]}(e)||Ke(!1,"Promise is not controllable")}const a="__mono_message__",l=["debug","log","trace","warn","info","error"],c="MONO_WASM: ";let u,d,f,m;function g(e){m=e}function h(e){if(qe.diagnosticTracing){const t="function"==typeof e?e():e;console.debug(c+t)}}function p(e,...t){console.info(c+e,...t)}function b(e,...t){console.info(e,...t)}function w(e,...t){console.warn(c+e,...t)}function y(e,...t){if(t&&t.length>0&&t[0]&&"object"==typeof t[0]){if(t[0].silent)return;if(t[0].toString)return void console.error(c+e,t[0].toString())}console.error(c+e,...t)}function v(e,t,o){return function(...n){try{let r=n[0];if(void 0===r)r="undefined";else if(null===r)r="null";else if("function"==typeof r)r=r.toString();else if("string"!=typeof r)try{r=JSON.stringify(r)}catch(e){r=r.toString()}t(o?JSON.stringify({method:e,payload:r,arguments:n.slice(1)}):[e+r,...n.slice(1)])}catch(e){f.error(`proxyConsole failed: ${e}`)}}}function _(e,t,o){d=t,m=e,f={...t};const n=`${o}/console`.replace("https://","wss://").replace("http://","ws://");u=new WebSocket(n),u.addEventListener("error",R),u.addEventListener("close",j),function(){for(const e of l)d[e]=v(`console.${e}`,T,!0)}()}function E(e){let t=30;const o=()=>{u?0==u.bufferedAmount||0==t?(e&&b(e),function(){for(const e of l)d[e]=v(`console.${e}`,f.log,!1)}(),u.removeEventListener("error",R),u.removeEventListener("close",j),u.close(1e3,e),u=void 0):(t--,globalThis.setTimeout(o,100)):e&&f&&f.log(e)};o()}function T(e){u&&u.readyState===WebSocket.OPEN?u.send(e):f.log(e)}function R(e){f.error(`[${m}] proxy console websocket error: ${e}`,e)}function j(e){f.debug(`[${m}] proxy console websocket closed: ${e}`,e)}(new Date).valueOf();const x={},A={},S={};let O,D,k;function C(){const e=Object.values(S),t=Object.values(A),o=L(e),n=L(t),r=o+n;if(0===r)return;const i=We?"%c":"",s=We?["background: purple; color: white; padding: 1px 3px; border-radius: 3px;","font-weight: bold;","font-weight: normal;"]:[],a=qe.config.linkerEnabled?"":"\nThis application was built with linking (tree shaking) disabled. \nPublished applications will be significantly smaller if you install wasm-tools workload. \nSee also https://aka.ms/dotnet-wasm-features";console.groupCollapsed(`${i}dotnet${i} Loaded ${U(r)} resources${i}${a}`,...s),e.length&&(console.groupCollapsed(`Loaded ${U(o)} resources from cache`),console.table(S),console.groupEnd()),t.length&&(console.groupCollapsed(`Loaded ${U(n)} resources from network`),console.table(A),console.groupEnd()),console.groupEnd()}async function I(){const e=O;if(e){const t=(await e.keys()).map((async t=>{t.url in x||await e.delete(t)}));await Promise.all(t)}}function M(e){return`${e.resolvedUrl}.${e.hash}`}async function P(){O=await async function(e){if(!qe.config.cacheBootResources||void 0===globalThis.caches||void 0===globalThis.document)return null;if(!1===globalThis.isSecureContext)return null;const t=`dotnet-resources-${globalThis.document.baseURI.substring(globalThis.document.location.origin.length)}`;try{return await caches.open(t)||null}catch(e){return null}}()}function L(e){return e.reduce(((e,t)=>e+(t.responseBytes||0)),0)}function U(e){return`${(e/1048576).toFixed(2)} MB`}function $(){qe.preferredIcuAsset=N(qe.config);let e="invariant"==qe.config.globalizationMode;if(!e)if(qe.preferredIcuAsset)qe.diagnosticTracing&&h("ICU data archive(s) available, disabling invariant mode");else{if("custom"===qe.config.globalizationMode||"all"===qe.config.globalizationMode||"
|
||
|
//# sourceMappingURL=dotnet.js.map
|