expo-dev-menu
Version:
Expo/React Native module with the developer menu.
14 lines • 1.54 MB
JavaScript
var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=globalThis.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production";
!(function(e){"use strict";e.__r=i,e[`${__METRO_GLOBAL_PREFIX__}__d`]=function(e,n,o){if(r.has(n))return;var i={dependencyMap:o,factory:e,hasError:!1,importedAll:t,importedDefault:t,isInitialized:!1,publicModule:{exports:{}}};r.set(n,i)},e.__c=o,e.__registerSegment=function(e,t,n){f[e]=t,n&&n.forEach((function(t){r.has(t)||p.has(t)||p.set(t,e)}))};var r=o(),t={},n={}.hasOwnProperty;function o(){return r=new Map}function i(e){var t=e,n=r.get(t);return n&&n.isInitialized?n.publicModule.exports:d(t,n)}function l(e){var n=e,o=r.get(n);if(o&&o.importedDefault!==t)return o.importedDefault;var l=i(n),a=l&&l.__esModule?l.default:l;return r.get(n).importedDefault=a}function a(e){var o=e,l=r.get(o);if(l&&l.importedAll!==t)return l.importedAll;var a,u=i(o);if(u&&u.__esModule)a=u;else{if(a={},u)for(var d in u)n.call(u,d)&&(a[d]=u[d]);a.default=u}return r.get(o).importedAll=a}i.importDefault=l,i.importAll=a,i.context=function(){throw new Error("The experimental Metro feature `require.context` is not enabled in your project.")},i.resolveWeak=function(){throw new Error("require.resolveWeak cannot be called dynamically.")};var u=!1;function d(r,t){if(!u&&e.ErrorUtils){var n;u=!0;try{n=s(r,t)}catch(r){e.ErrorUtils.reportFatalError(r)}return u=!1,n}return s(r,t)}function c(e){return{segmentId:e>>>16,localId:65535&e}}i.unpackModuleId=c,i.packModuleId=function(e){return(e.segmentId<<16)+e.localId};var f=[],p=new Map;function s(t,n){if(!n&&f.length>0){var o,u=null!=(o=p.get(t))?o:0,d=f[u];null!=d&&(d(t),n=r.get(t),p.delete(t))}var s=e.nativeRequire;if(!n&&s){var v=c(t),h=v.segmentId;s(v.localId,h),n=r.get(t)}if(!n)throw Error('Requiring unknown module "'+t+'".');if(n.hasError)throw n.error;n.isInitialized=!0;var g=n,_=g.factory,m=g.dependencyMap;try{var w=n.publicModule;return w.id=t,_(e,i,l,a,w,w.exports,m),n.factory=void 0,n.dependencyMap=void 0,w.exports}catch(e){throw n.hasError=!0,n.error=e,n.isInitialized=!1,n.publicModule.exports=void 0,e}}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
!(function(n){var e=(function(){function n(n,e){return n}function e(n){var e={};return n.forEach((function(n,r){e[n]=!0})),e}function r(n,r,u){if(n.formatValueCalls++,n.formatValueCalls>200)return`[TOO BIG formatValueCalls ${n.formatValueCalls} exceeded limit of 200]`;var c=t(n,r);if(c)return c;var f=Object.keys(r),s=e(f);if(d(r)&&(f.indexOf('message')>=0||f.indexOf('description')>=0))return o(r);if(0===f.length){if(v(r)){var g=r.name?': '+r.name:'';return n.stylize('[Function'+g+']','special')}if(p(r))return n.stylize(RegExp.prototype.toString.call(r),'regexp');if(y(r))return n.stylize(Date.prototype.toString.call(r),'date');if(d(r))return o(r)}var h,m,b='',j=!1,O=['{','}'];(h=r,Array.isArray(h)&&(j=!0,O=['[',']']),v(r))&&(b=' [Function'+(r.name?': '+r.name:'')+']');return p(r)&&(b=' '+RegExp.prototype.toString.call(r)),y(r)&&(b=' '+Date.prototype.toUTCString.call(r)),d(r)&&(b=' '+o(r)),0!==f.length||j&&0!=r.length?u<0?p(r)?n.stylize(RegExp.prototype.toString.call(r),'regexp'):n.stylize('[Object]','special'):(n.seen.push(r),m=j?i(n,r,u,s,f):f.map((function(e){return a(n,r,u,s,e,j)})),n.seen.pop(),l(m,b,O)):O[0]+b+O[1]}function t(n,e){if(s(e))return n.stylize('undefined','undefined');if('string'==typeof e){var r="'"+JSON.stringify(e).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(r,'string')}return f(e)?n.stylize(''+e,'number'):u(e)?n.stylize(''+e,'boolean'):c(e)?n.stylize('null','null'):void 0}function o(n){return'['+Error.prototype.toString.call(n)+']'}function i(n,e,r,t,o){for(var i=[],l=0,u=e.length;l<u;++l)m(e,String(l))?i.push(a(n,e,r,t,String(l),!0)):i.push('');return o.forEach((function(o){o.match(/^\d+$/)||i.push(a(n,e,r,t,o,!0))})),i}function a(n,e,t,o,i,a){var l,u,f;if((f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=f.set?n.stylize('[Getter/Setter]','special'):n.stylize('[Getter]','special'):f.set&&(u=n.stylize('[Setter]','special')),m(o,i)||(l='['+i+']'),u||(n.seen.indexOf(f.value)<0?(u=c(t)?r(n,f.value,null):r(n,f.value,t-1)).indexOf('\n')>-1&&(u=a?u.split('\n').map((function(n){return' '+n})).join('\n').slice(2):'\n'+u.split('\n').map((function(n){return' '+n})).join('\n')):u=n.stylize('[Circular]','special')),s(l)){if(a&&i.match(/^\d+$/))return u;(l=JSON.stringify(''+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(l=l.slice(1,l.length-1),l=n.stylize(l,'name')):(l=l.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),l=n.stylize(l,'string'))}return l+': '+u}function l(n,e,r){return n.reduce((function(n,e){return e.indexOf('\n')>=0&&0,n+e.replace(/\u001b\[\d\d?m/g,'').length+1}),0)>60?r[0]+(''===e?'':e+'\n ')+' '+n.join(',\n ')+' '+r[1]:r[0]+e+' '+n.join(', ')+' '+r[1]}function u(n){return'boolean'==typeof n}function c(n){return null===n}function f(n){return'number'==typeof n}function s(n){return void 0===n}function p(n){return g(n)&&'[object RegExp]'===h(n)}function g(n){return'object'==typeof n&&null!==n}function y(n){return g(n)&&'[object Date]'===h(n)}function d(n){return g(n)&&('[object Error]'===h(n)||n instanceof Error)}function v(n){return'function'==typeof n}function h(n){return Object.prototype.toString.call(n)}function m(n,e){return Object.prototype.hasOwnProperty.call(n,e)}return function(e,t){return r({seen:[],formatValueCalls:0,stylize:n},e,t.depth)}})(),r='(index)',t=0,o=1,i=2,a=3;function l(r){return function(){var t;t=1===arguments.length&&'string'==typeof arguments[0]?arguments[0]:Array.prototype.map.call(arguments,(function(n){return e(n,{depth:10})})).join(', ');var o=arguments[0],l=r;'string'==typeof o&&'Warning: '===o.slice(0,9)&&l>=a&&(l=i),f.length&&(t=s('',t)),n.nativeLoggingHook(t,l)}}function u(n,e){return Array.apply(null,Array(e)).map((function(){return n}))}function c(n,e){if(e===r)return n[e];if(n.hasOwnProperty(e)){var t=n[e];switch(typeof t){case'function':return'\u0192';case'string':return"'"+t+"'";case'object':return null==t?'null':'{\u2026}'}return String(t)}return''}var f=[];function s(n,e){return f.join('')+n+' '+(e||'')}if(n.nativeLoggingHook){var p=n.console;if(n.console=Object.assign({},null!=p?p:{},{error:l(a),info:l(o),log:l(o),warn:l(i),trace:l(t),debug:l(t),table:function(e,t){var i;if(Array.isArray(e))i=e.map((function(n,e){var t={};return t[r]=String(e),Object.assign(t,n),t}));else for(var a in i=[],e)if(e.hasOwnProperty(a)){var l={};l[r]=a,Object.assign(l,e[a]),i.push(l)}if(0!==i.length){t=Array.isArray(t)?[r].concat(t):Array.from(i.reduce((function(n,e){return Object.keys(e).forEach((function(e){return n.add(e)})),n}),new Set));var f=[],s=[];t.forEach((function(n,e){s[e]=n.length;for(var r=0;r<i.length;r++){var t=c(i[r],n);f[r]=f[r]||[],f[r][e]=t,s[e]=Math.max(s[e],t.length)}}));for(var p=d(s.map((function(n){return u('-',n).join('')}))),g=[d(t),p],y=0;y<i.length;y++)g.push(d(f[y]));n.nativeLoggingHook('\n'+g.join('\n'),o)}else n.nativeLoggingHook('',o);function d(n,e){var r=n.map((function(n,e){return n+u(' ',s[e]-n.length).join('')}));return e=e||' ','| '+r.join(e+'|'+e)+' |'}},group:function(e){n.nativeLoggingHook(s("\u2510",e),o),f.push("\u2502")},groupEnd:function(){f.pop(),n.nativeLoggingHook(s("\u2518"),o)},groupCollapsed:function(e){n.nativeLoggingHook(s("\u2518",e),o),f.push("\u2502")},assert:function(e,r){e||n.nativeLoggingHook('Assertion failed: '+r,a)}}),!0===n.RN$useAlwaysAvailableJSErrorHandling){var g=function(n){return e(n,{depth:10}).replace(/\n\s*/g,' ')},y=console.error;console.reportErrorsAsExceptions=!0,console.error=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(y.apply(this,r),console.reportErrorsAsExceptions&&(null==n.RN$inExceptionHandler||!n.RN$inExceptionHandler())){var o,i=r[0];if(null!=i&&i.stack)o=i;else{if('string'==typeof i&&i.startsWith('Warning: '))return;var a=r.map((function(n){return'string'==typeof n?n:g(n)})).join(' ');(o=new Error(a)).name='console.error'}var l=!1,u=!1;n.RN$handleException(o,l,u)}}}Object.defineProperty(console,'_isPolyfilled',{value:!0,enumerable:!1})}else if(!n.console){var d=function(){},v=n.print||d;n.console={debug:v,error:v,info:v,log:v,trace:v,warn:v,assert:function(n,e){n||v('Assertion failed: '+e)},clear:d,dir:d,dirxml:d,group:d,groupCollapsed:d,groupEnd:d,profile:d,profileEnd:d,table:d},Object.defineProperty(console,'_isPolyfilled',{value:!0,enumerable:!1})}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
!(function(n){var r=0,t=!0===n.RN$useAlwaysAvailableJSErrorHandling?n.RN$handleException:function(n,r){throw n},l={setGlobalHandler:function(n){t=n},getGlobalHandler:function(){return t},reportError:function(n){t&&t(n,!1)},reportFatalError:function(n){t&&t(n,!0)},applyWithGuard:function(n,t,u,a,e){try{return r++,n.apply(t,u)}catch(n){l.reportError(n)}finally{r--}return null},applyWithGuardIfNeeded:function(n,r,t){return l.inGuard()?n.apply(r,t):(l.applyWithGuard(n,r,t),null)},inGuard:function(){return!!r},guard:function(n,r,t){var u;if('function'!=typeof n)return console.warn('A function must be passed to ErrorUtils.guard, got ',n),null;var a=null!=(u=null!=r?r:n.name)?u:'<generated guard>';return function(){for(var r=arguments.length,u=new Array(r),e=0;e<r;e++)u[e]=arguments[e];return l.applyWithGuard(n,null!=t?t:this,u,null,a)}}};n.ErrorUtils=l})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
!(function(e){try{e.$$require_external="undefined"==typeof expo?require:function(e){throw new Error(`Node.js standard library module ${e} is not available in this JavaScript environment`)}}catch(n){e.$$require_external=function(e){throw new Error(`Node.js standard library module ${e} is not available in this JavaScript environment`)}}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
'undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window&&window;
!(function(e){function r(e,r,n){return(r=t(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function t(e){var r=n(e,"string");return"symbol"==typeof r?r:r+""}function n(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}
/**
* @license
* web-streams-polyfill v4.1.0
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
*/function o(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function i(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function a(e,r,t){return r&&i(e.prototype,r),t&&i(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var r=l(e,"string");return"symbol"==typeof r?r:r+""}function l(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}!(function(){"use strict";function t(){}function n(e){return"object"==typeof e&&null!==e||"function"==typeof e}var i=t;function u(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch(e){}}var l=Promise,s=Promise.resolve.bind(l),c=Promise.prototype.then,f=Promise.reject.bind(l),d=s;function h(e){return new l(e)}function b(e){return h((function(r){return r(e)}))}function v(e){return f(e)}function _(e,r,t){return c.call(e,r,t)}function p(e,r,t){_(_(e,r,t),void 0,i)}function m(e,r){p(e,r)}function y(e,r){p(e,void 0,r)}function g(e,r,t){return _(e,r,t)}function w(e){_(e,void 0,i)}var S=function(e){if("function"==typeof queueMicrotask)S=queueMicrotask;else{var r=b(void 0);S=function(e){return _(r,e)}}return S(e)};function T(e,r,t){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function R(e,r,t){try{return b(T(e,r,t))}catch(e){return v(e)}}var P=a((function e(){o(this,e),this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}),[{key:"length",get:function(){return this._size}},{key:"push",value:function(e){var r=this._back,t=r;16383===r._elements.length&&(t={_elements:[],_next:void 0}),r._elements.push(e),t!==r&&(this._back=t,r._next=t),++this._size}},{key:"shift",value:function(){var e=this._front,r=e,t=this._cursor,n=t+1,o=e._elements,i=o[t];return 16384===n&&(r=e._next,n=0),--this._size,this._cursor=n,e!==r&&(this._front=r),o[t]=void 0,i}},{key:"forEach",value:function(e){for(var r=this._cursor,t=this._front,n=t._elements;!(r===n.length&&void 0===t._next||r===n.length&&(t=t._next,n=t._elements,r=0,0===n.length));)e(n[r]),++r}},{key:"peek",value:function(){var e=this._front,r=this._cursor;return e._elements[r]}}]),k=Symbol("[[AbortSteps]]"),q=Symbol("[[ErrorSteps]]"),C=Symbol("[[CancelSteps]]"),E=Symbol("[[PullSteps]]"),j=Symbol("[[ReleaseSteps]]");function O(e,r){e._ownerReadableStream=r,r._reader=e,"readable"===r._state?B(e):"closed"===r._state?(function(e){B(e),L(e)})(e):F(e,r._storedError)}function W(e,r){return Mt(e._ownerReadableStream,r)}function A(e){var r=e._ownerReadableStream;"readable"===r._state?I(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):(function(e,r){F(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))})(e),r._readableStreamController[j](),r._reader=void 0,e._ownerReadableStream=void 0}function z(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function B(e){e._closedPromise=h((function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t}))}function F(e,r){B(e),I(e,r)}function I(e,r){void 0!==e._closedPromise_reject&&(w(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function L(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var $=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},M=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function D(e,r){if(void 0!==e&&"object"!=typeof(t=e)&&"function"!=typeof t)throw new TypeError(`${r} is not an object.`);var t}function x(e,r){if("function"!=typeof e)throw new TypeError(`${r} is not a function.`)}function N(e,r){if(!(function(e){return"object"==typeof e&&null!==e||"function"==typeof e})(e))throw new TypeError(`${r} is not an object.`)}function Q(e,r,t){if(void 0===e)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function Y(e,r,t){if(void 0===e)throw new TypeError(`${r} is required in '${t}'.`)}function H(e){return Number(e)}function V(e){return 0===e?0:e}function U(e,r){var t=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=V(n),!$(n))throw new TypeError(`${r} is not a finite number`);if(n=(function(e){return V(M(e))})(n),n<0||n>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return $(n)&&0!==n?n:0}function G(e,r){if(!Lt(e))throw new TypeError(`${r} is not a ReadableStream.`)}function X(e){return new oe(e)}function J(e,r){e._reader._readRequests.push(r)}function K(e,r,t){var n=e._reader._readRequests.shift();t?n._closeSteps():n._chunkSteps(r)}function Z(e){return e._reader._readRequests.length}function ee(e){var r=e._reader;return void 0!==r&&!!ie(r)}var re,te,ne,oe=a((function e(r){if(o(this,e),Q(r,1,"ReadableStreamDefaultReader"),G(r,"First parameter"),$t(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");O(this,r),this._readRequests=new P}),[{key:"closed",get:function(){return ie(this)?this._closedPromise:v(le("closed"))}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return ie(this)?void 0===this._ownerReadableStream?v(z("cancel")):W(this,e):v(le("cancel"))}},{key:"read",value:function(){if(!ie(this))return v(le("read"));if(void 0===this._ownerReadableStream)return v(z("read from"));var e,r,t=h((function(t,n){e=t,r=n}));return ae(this,{_chunkSteps:function(r){return e({value:r,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return r(e)}}),t}},{key:"releaseLock",value:function(){if(!ie(this))throw le("releaseLock");void 0!==this._ownerReadableStream&&(function(e){A(e),ue(e,new TypeError("Reader was released"))})(this)}}]);function ie(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof oe}function ae(e,r){var t=e._ownerReadableStream;t._disturbed=!0,"closed"===t._state?r._closeSteps():"errored"===t._state?r._errorSteps(t._storedError):t._readableStreamController[E](r)}function ue(e,r){var t=e._readRequests;e._readRequests=new P,t.forEach((function(e){e._errorSteps(r)}))}function le(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}function se(e){return e.slice()}function ce(e,r,t,n,o){new Uint8Array(e).set(new Uint8Array(t,n,o),r)}Object.defineProperties(oe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),u(oe.prototype.cancel,"cancel"),u(oe.prototype.read,"read"),u(oe.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(oe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var fe=function(e){return fe="function"==typeof e.transfer?function(e){return e.transfer()}:"function"==typeof structuredClone?function(e){return structuredClone(e,{transfer:[e]})}:function(e){return e},fe(e)},de=function(e){return de="boolean"==typeof e.detached?function(e){return e.detached}:function(e){return 0===e.byteLength},de(e)};function he(e,r,t){if(e.slice)return e.slice(r,t);var n=t-r,o=new ArrayBuffer(n);return ce(o,0,e,r,n),o}function be(e,r){var t=e[r];if(null!=t){if("function"!=typeof t)throw new TypeError(`${String(r)} is not a function`);return t}}function ve(e){try{var r=e.done,t=e.value;return _(d(t),(function(e){return{done:r,value:e}}))}catch(e){return v(e)}}var _e=null!==(ne=null!==(re=Symbol.asyncIterator)&&void 0!==re?re:null===(te=Symbol.for)||void 0===te?void 0:te.call(Symbol,"Symbol.asyncIterator"))&&void 0!==ne?ne:"@@asyncIterator";function pe(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sync",t=arguments.length>2?arguments[2]:void 0;if(void 0===t)if("async"===r){if(void 0===(t=be(e,_e)))return(function(e){var r={next:function(){var r;try{r=me(e)}catch(e){return v(e)}return ve(r)},return:function(r){var t;try{var o=be(e.iterator,"return");if(void 0===o)return b({done:!0,value:r});t=T(o,e.iterator,[r])}catch(e){return v(e)}return n(t)?ve(t):v(new TypeError("The iterator.return() method must return an object"))}};return{iterator:r,nextMethod:r.next,done:!1}})(pe(e,"sync",be(e,Symbol.iterator)))}else t=be(e,Symbol.iterator);if(void 0===t)throw new TypeError("The object is not iterable");var o=T(t,e,[]);if(!n(o))throw new TypeError("The iterator method must return an object");return{iterator:o,nextMethod:o.next,done:!1}}function me(e){var r=T(e.nextMethod,e.iterator,[]);if(!n(r))throw new TypeError("The iterator.next() method must return an object");return r}var ye=a((function e(r,t){o(this,e),this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=t}),[{key:"next",value:function(){var e=this,r=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?g(this._ongoingPromise,r,r):r(),this._ongoingPromise}},{key:"return",value:function(e){var r=this,t=function(){return r._returnSteps(e)};return this._ongoingPromise=this._ongoingPromise?g(this._ongoingPromise,t,t):t(),this._ongoingPromise}},{key:"_nextSteps",value:function(){var e=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var r,t,n=this._reader,o=h((function(e,n){r=e,t=n}));return ae(n,{_chunkSteps:function(t){e._ongoingPromise=void 0,S((function(){return r({value:t,done:!1})}))},_closeSteps:function(){e._ongoingPromise=void 0,e._isFinished=!0,A(n),r({value:void 0,done:!0})},_errorSteps:function(r){e._ongoingPromise=void 0,e._isFinished=!0,A(n),t(r)}}),o}},{key:"_returnSteps",value:function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var r=this._reader;if(!this._preventCancel){var t=W(r,e);return A(r),g(t,(function(){return{value:e,done:!0}}))}return A(r),b({value:e,done:!0})}}]),ge=r({next:function(){return we(this)?this._asyncIteratorImpl.next():v(Se("next"))},return:function(e){return we(this)?this._asyncIteratorImpl.return(e):v(Se("return"))}},_e,(function(){return this}));function we(e){if(!n(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof ye}catch(e){return!1}}function Se(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(ge,_e,{enumerable:!1});var Te=Number.isNaN||function(e){return e!=e};function Re(e){var r=he(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Pe(e){var r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function ke(e,r,t){if("number"!=typeof(n=t)||Te(n)||n<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function qe(e){e._queue=new P,e._queueTotalSize=0}function Ce(e){return e===DataView}var Ee=a((function e(){throw o(this,e),new TypeError("Illegal constructor")}),[{key:"view",get:function(){if(!We(this))throw or("view");return this._view}},{key:"respond",value:function(e){if(!We(this))throw or("respond");if(Q(e,1,"respond"),e=U(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(de(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");rr(this._associatedReadableByteStreamController,e)}},{key:"respondWithNewView",value:function(e){if(!We(this))throw or("respondWithNewView");if(Q(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(de(e.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");tr(this._associatedReadableByteStreamController,e)}}]);Object.defineProperties(Ee.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),u(Ee.prototype.respond,"respond"),u(Ee.prototype.respondWithNewView,"respondWithNewView"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ee.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var je=a((function e(){throw o(this,e),new TypeError("Illegal constructor")}),[{key:"byobRequest",get:function(){if(!Oe(this))throw ir("byobRequest");return Ze(this)}},{key:"desiredSize",get:function(){if(!Oe(this))throw ir("desiredSize");return er(this)}},{key:"close",value:function(){if(!Oe(this))throw ir("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Ge(this)}},{key:"enqueue",value:function(e){if(!Oe(this))throw ir("enqueue");if(Q(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var r=this._controlledReadableByteStream._state;if("readable"!==r)throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);Xe(this,e)}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!Oe(this))throw ir("error");Je(this,e)}},{key:C,value:function(e){ze(this),qe(this);var r=this._cancelAlgorithm(e);return Ue(this),r}},{key:E,value:function(e){var r=this._controlledReadableByteStream;if(this._queueTotalSize>0)Ke(this,e);else{var t=this._autoAllocateChunkSize;if(void 0!==t){var n;try{n=new ArrayBuffer(t)}catch(r){return void e._errorSteps(r)}var o={buffer:n,bufferByteLength:t,byteOffset:0,byteLength:t,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}J(r,e),Ae(this)}}},{key:j,value:function(){if(this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new P,this._pendingPullIntos.push(e)}}}]);function Oe(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof je}function We(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof Ee}function Ae(e){var r=(function(e){var r=e._controlledReadableByteStream;return"readable"===r._state&&(!e._closeRequested&&(!!e._started&&(!!(ee(r)&&Z(r)>0)||(!!(cr(r)&&sr(r)>0)||er(e)>0))))})(e);r&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,p(e._pullAlgorithm(),(function(){return e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Ae(e)),null}),(function(r){return Je(e,r),null}))))}function ze(e){Qe(e),e._pendingPullIntos=new P}function Be(e,r){var t=!1;"closed"===e._state&&(t=!0);var n=Ie(r);"default"===r.readerType?K(e,n,t):(function(e,r,t){var n=e._reader._readIntoRequests.shift();t?n._closeSteps(r):n._chunkSteps(r)})(e,n,t)}function Fe(e,r){for(var t=0;t<r.length;++t)Be(e,r[t])}function Ie(e){var r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Le(e,r,t,n){e._queue.push({buffer:r,byteOffset:t,byteLength:n}),e._queueTotalSize+=n}function $e(e,r,t,n){var o;try{o=he(r,t,t+n)}catch(r){throw Je(e,r),r}Le(e,o,0,n)}function Me(e,r){r.bytesFilled>0&&$e(e,r.buffer,r.byteOffset,r.bytesFilled),Ve(e)}function De(e,r){var t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),n=r.bytesFilled+t,o=t,i=!1,a=n-n%r.elementSize;a>=r.minimumFill&&(o=a-r.bytesFilled,i=!0);for(var u=e._queue;o>0;){var l=u.peek(),s=Math.min(o,l.byteLength),c=r.byteOffset+r.bytesFilled;ce(r.buffer,c,l.buffer,l.byteOffset,s),l.byteLength===s?u.shift():(l.byteOffset+=s,l.byteLength-=s),e._queueTotalSize-=s,xe(e,s,r),o-=s}return i}function xe(e,r,t){t.bytesFilled+=r}function Ne(e){0===e._queueTotalSize&&e._closeRequested?(Ue(e),Dt(e._controlledReadableByteStream)):Ae(e)}function Qe(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Ye(e){for(var r=[];e._pendingPullIntos.length>0&&0!==e._queueTotalSize;){var t=e._pendingPullIntos.peek();De(e,t)&&(Ve(e),r.push(t))}return r}function He(e,r){var t=e._pendingPullIntos.peek();Qe(e),"closed"===e._controlledReadableByteStream._state?(function(e,r){"none"===r.readerType&&Ve(e);var t=e._controlledReadableByteStream;if(cr(t)){for(var n=[],o=0;o<sr(t);++o)n.push(Ve(e));Fe(t,n)}})(e,t):(function(e,r,t){if(xe(0,r,t),"none"!==t.readerType){if(!(t.bytesFilled<t.minimumFill)){Ve(e);var n=t.bytesFilled%t.elementSize;if(n>0){var o=t.byteOffset+t.bytesFilled;$e(e,t.buffer,o-n,n)}t.bytesFilled-=n;var i=Ye(e);Be(e._controlledReadableByteStream,t),Fe(e._controlledReadableByteStream,i)}}else{Me(e,t);var a=Ye(e);Fe(e._controlledReadableByteStream,a)}})(e,r,t),Ae(e)}function Ve(e){return e._pendingPullIntos.shift()}function Ue(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ge(e){var r=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===r._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){var t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){var n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Je(e,n),n}}Ue(e),Dt(r)}}function Xe(e,r){var t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state){var n=r.buffer,o=r.byteOffset,i=r.byteLength;if(de(n))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");var a=fe(n);if(e._pendingPullIntos.length>0){var u=e._pendingPullIntos.peek();if(de(u.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Qe(e),u.buffer=fe(u.buffer),"none"===u.readerType&&Me(e,u)}if(ee(t))(function(e){for(var r=e._controlledReadableByteStream._reader;r._readRequests.length>0;){if(0===e._queueTotalSize)return;Ke(e,r._readRequests.shift())}})(e),0===Z(t)?Le(e,a,o,i):(e._pendingPullIntos.length>0&&Ve(e),K(t,new Uint8Array(a,o,i),!1));else if(cr(t)){Le(e,a,o,i);var l=Ye(e);Fe(e._controlledReadableByteStream,l)}else Le(e,a,o,i);Ae(e)}}function Je(e,r){var t=e._controlledReadableByteStream;"readable"===t._state&&(ze(e),qe(e),Ue(e),xt(t,r))}function Ke(e,r){var t=e._queue.shift();e._queueTotalSize-=t.byteLength,Ne(e);var n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(n)}function Ze(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){var r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),n=Object.create(Ee.prototype);!(function(e,r,t){e._associatedReadableByteStreamController=r,e._view=t})(n,e,t),e._byobRequest=n}return e._byobRequest}function er(e){var r=e._controlledReadableByteStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function rr(e,r){var t=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==r)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===r)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=fe(t.buffer),He(e,r)}function tr(e,r){var t=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==r.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===r.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var n=r.byteLength;t.buffer=fe(r.buffer),He(e,n)}function nr(e,r,t,n,o,i,a){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,qe(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=i,r._pullAlgorithm=n,r._cancelAlgorithm=o,r._autoAllocateChunkSize=a,r._pendingPullIntos=new P,e._readableStreamController=r,p(b(t()),(function(){return r._started=!0,Ae(r),null}),(function(e){return Je(r,e),null}))}function or(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function ir(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function ar(e,r){if("byob"!=(e=`${e}`))throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function ur(e){return new fr(e)}function lr(e,r){e._reader._readIntoRequests.push(r)}function sr(e){return e._reader._readIntoRequests.length}function cr(e){var r=e._reader;return void 0!==r&&!!dr(r)}Object.defineProperties(je.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),u(je.prototype.close,"close"),u(je.prototype.enqueue,"enqueue"),u(je.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var fr=a((function e(r){if(o(this,e),Q(r,1,"ReadableStreamBYOBReader"),G(r,"First parameter"),$t(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Oe(r._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");O(this,r),this._readIntoRequests=new P}),[{key:"closed",get:function(){return dr(this)?this._closedPromise:v(vr("closed"))}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return dr(this)?void 0===this._ownerReadableStream?v(z("cancel")):W(this,e):v(vr("cancel"))}},{key:"read",value:function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!dr(this))return v(vr("read"));if(!ArrayBuffer.isView(e))return v(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return v(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return v(new TypeError("view's buffer must have non-zero byteLength"));if(de(e.buffer))return v(new TypeError("view's buffer has been detached"));try{r=(function(e,r){var t;return D(e,r),{min:U(null!==(t=null==e?void 0:e.min)&&void 0!==t?t:1,`${r} has member 'min' that`)}})(t,"options")}catch(e){return v(e)}var n,o,i=r.min;if(0===i)return v(new TypeError("options.min must be greater than 0"));if((function(e){return Ce(e.constructor)})(e)){if(i>e.byteLength)return v(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(i>e.length)return v(new RangeError("options.min must be less than or equal to view's length"));if(void 0===this._ownerReadableStream)return v(z("read from"));var a=h((function(e,r){n=e,o=r}));return hr(this,e,i,{_chunkSteps:function(e){return n({value:e,done:!1})},_closeSteps:function(e){return n({value:e,done:!0})},_errorSteps:function(e){return o(e)}}),a}},{key:"releaseLock",value:function(){if(!dr(this))throw vr("releaseLock");void 0!==this._ownerReadableStream&&(function(e){A(e),br(e,new TypeError("Reader was released"))})(this)}}]);function dr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof fr}function hr(e,r,t,n){var o=e._ownerReadableStream;o._disturbed=!0,"errored"===o._state?n._errorSteps(o._storedError):(function(e,r,t,n){var o,i=e._controlledReadableByteStream,a=r.constructor,u=(function(e){return Ce(e)?1:e.BYTES_PER_ELEMENT})(a),l=r.byteOffset,s=r.byteLength,c=t*u;try{o=fe(r.buffer)}catch(e){return void n._errorSteps(e)}var f={buffer:o,bufferByteLength:o.byteLength,byteOffset:l,byteLength:s,bytesFilled:0,minimumFill:c,elementSize:u,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(f),void lr(i,n);if("closed"!==i._state){if(e._queueTotalSize>0){if(De(e,f)){var d=Ie(f);return Ne(e),void n._chunkSteps(d)}if(e._closeRequested){var h=new TypeError("Insufficient bytes to fill elements in the given buffer");return Je(e,h),void n._errorSteps(h)}}e._pendingPullIntos.push(f),lr(i,n),Ae(e)}else{var b=new a(f.buffer,f.byteOffset,0);n._closeSteps(b)}})(o._readableStreamController,r,t,n)}function br(e,r){var t=e._readIntoRequests;e._readIntoRequests=new P,t.forEach((function(e){e._errorSteps(r)}))}function vr(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function _r(e,r){var t=e.highWaterMark;if(void 0===t)return r;if(Te(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function pr(e){return e.size||function(){return 1}}function mr(e,r){D(e,r);var t=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===t?void 0:H(t),size:void 0===n?void 0:yr(n,`${r} has member 'size' that`)}}function yr(e,r){return x(e,r),function(r){return H(e(r))}}function gr(e,r,t){return x(e,t),function(t){return R(e,r,[t])}}function wr(e,r,t){return x(e,t),function(){return R(e,r,[])}}function Sr(e,r,t){return x(e,t),function(t){return T(e,r,[t])}}function Tr(e,r,t){return x(e,t),function(t,n){return R(e,r,[t,n])}}function Rr(e,r){if(!Cr(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(fr.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),u(fr.prototype.cancel,"cancel"),u(fr.prototype.read,"read"),u(fr.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(fr.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var Pr=a((function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),void 0===r?r=null:N(r,"First parameter");var n=mr(t,"Second parameter"),i=(function(e,r){D(e,r);var t=null==e?void 0:e.abort,n=null==e?void 0:e.close,o=null==e?void 0:e.start,i=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===t?void 0:gr(t,e,`${r} has member 'abort' that`),close:void 0===n?void 0:wr(n,e,`${r} has member 'close' that`),start:void 0===o?void 0:Sr(o,e,`${r} has member 'start' that`),write:void 0===a?void 0:Tr(a,e,`${r} has member 'write' that`),type:i}})(r,"First parameter");if(qr(this),void 0!==i.type)throw new RangeError("Invalid type is specified");var a=pr(n);!(function(e,r,t,n){var o,i,a,u,l=Object.create(Yr.prototype);o=void 0!==r.start?function(){return r.start(l)}:function(){},i=void 0!==r.write?function(e){return r.write(e,l)}:function(){return b(void 0)},a=void 0!==r.close?function(){return r.close()}:function(){return b(void 0)},u=void 0!==r.abort?function(e){return r.abort(e)}:function(){return b(void 0)},Vr(e,l,o,i,a,u,t,n)})(this,i,_r(n,1),a)}),[{key:"locked",get:function(){if(!Cr(this))throw et("locked");return Er(this)}},{key:"abort",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return Cr(this)?Er(this)?v(new TypeError("Cannot abort a stream that already has a writer")):jr(this,e):v(et("abort"))}},{key:"close",value:function(){return Cr(this)?Er(this)?v(new TypeError("Cannot close a stream that already has a writer")):Br(this)?v(new TypeError("Cannot close an already-closing stream")):Or(this):v(et("close"))}},{key:"getWriter",value:function(){if(!Cr(this))throw et("getWriter");return kr(this)}}]);function kr(e){return new Lr(e)}function qr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new P,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function Cr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Pr}function Er(e){return void 0!==e._writer}function jr(e,r){var t;if("closed"===e._state||"errored"===e._state)return b(void 0);e._writableStreamController._abortReason=r,null===(t=e._writableStreamController._abortController)||void 0===t||t.abort(r);var n=e._state;if("closed"===n||"errored"===n)return b(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var o=!1;"erroring"===n&&(o=!0,r=void 0);var i=h((function(t,n){e._pendingAbortRequest={_promise:void 0,_resolve:t,_reject:n,_reason:r,_wasAlreadyErroring:o}}));return e._pendingAbortRequest._promise=i,o||Ar(e,r),i}function Or(e){var r=e._state;if("closed"===r||"errored"===r)return v(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));var t,n=h((function(r,t){var n={_resolve:r,_reject:t};e._closeRequest=n})),o=e._writer;return void 0!==o&&e._backpressure&&"writable"===r&&dt(o),ke(t=e._writableStreamController,Qr,0),Xr(t),n}function Wr(e,r){"writable"!==e._state?zr(e):Ar(e,r)}function Ar(e,r){var t=e._writableStreamController;e._state="erroring",e._storedError=r;var n=e._writer;void 0!==n&&Dr(n,r),!(function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest})(e)&&t._started&&zr(e)}function zr(e){e._state="errored",e._writableStreamController[q]();var r=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(r)})),e._writeRequests=new P,void 0!==e._pendingAbortRequest){var t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Fr(e);p(e._writableStreamController[k](t._reason),(function(){return t._resolve(),Fr(e),null}),(function(r){return t._reject(r),Fr(e),null}))}else Fr(e)}function Br(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Fr(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var r=e._writer;void 0!==r&&at(r,e._storedError)}function Ir(e,r){var t=e._writer;void 0!==t&&r!==e._backpressure&&(r?(function(e){lt(e)})(t):dt(t)),e._backpressure=r}Object.defineProperties(Pr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),u(Pr.prototype.abort,"abort"),u(Pr.prototype.close,"close"),u(Pr.prototype.getWriter,"getWriter"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Pr.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Lr=a((function e(r){if(o(this,e),Q(r,1,"WritableStreamDefaultWriter"),Rr(r,"First parameter"),Er(r))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;var t=r._state;if("writable"===t)!Br(r)&&r._backpressure?lt(this):ct(this),ot(this);else if("erroring"===t)st(this,r._storedError),ot(this);else if("closed"===t)ct(this),ot(this),ut(this);else{var n=r._storedError;st(this,n),it(this,n)}}),[{key:"closed",get:function(){return $r(this)?this._closedPromise:v(tt("closed"))}},{key:"desiredSize",get:function(){if(!$r(this))throw tt("desiredSize");if(void 0===this._ownerWritableStream)throw nt("desiredSize");return(function(e){var r=e._ownerWritableStream,t=r._state;return"errored"===t||"erroring"===t?null:"closed"===t?0:Gr(r._writableStreamController)})(this)}},{key:"ready",get:function(){return $r(this)?this._readyPromise:v(tt("ready"))}},{key:"abort",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return $r(this)?void 0===this._ownerWritableStream?v(nt("abort")):(function(e,r){return jr(e._ownerWritableStream,r)})(this,e):v(tt("abort"))}},{key:"close",value:function(){if(!$r(this))return v(tt("close"));var e=this._ownerWritableStream;return void 0===e?v(nt("close")):Br(e)?v(new TypeError("Cannot close an already-closing stream")):Mr(this)}},{key:"releaseLock",value:function(){if(!$r(this))throw tt("releaseLock");void 0!==this._ownerWritableStream&&xr(this)}},{key:"write",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return $r(this)?void 0===this._ownerWritableStream?v(nt("write to")):Nr(this,e):v(tt("write"))}}]);function $r(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Lr}function Mr(e){return Or(e._ownerWritableStream)}function Dr(e,r){"pending"===e._readyPromiseState?ft(e,r):(function(e,r){st(e,r)})(e,r)}function xr(e){var r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Dr(e,t),(function(e,r){"pending"===e._closedPromiseState?at(e,r):(function(e,r){it(e,r)})(e,r)})(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function Nr(e,r){var t=e._ownerWritableStream,n=t._writableStreamController,o=(function(e,r){if(void 0===e._strategySizeAlgorithm)return 1;try{return e._strategySizeAlgorithm(r)}catch(r){return Jr(e,r),1}})(n,r);if(t!==e._ownerWritableStream)return v(nt("write to"));var i=t._state;if("errored"===i)return v(t._storedError);if(Br(t)||"closed"===i)return v(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return v(t._storedError);var a=(function(e){return h((function(r,t){var n={_resolve:r,_reject:t};e._writeRequests.push(n)}))})(t);return(function(e,r,t){try{ke(e,r,t)}catch(r){return void Jr(e,r)}var n=e._controlledWritableStream;Br(n)||"writable"!==n._state||Ir(n,Kr(e)),Xr(e)})(n,r,o),a}Object.defineProperties(Lr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),u(Lr.prototype.abort,"abort"),u(Lr.prototype.close,"close"),u(Lr.prototype.releaseLock,"releaseLock"),u(Lr.prototype.write,"write"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Lr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Qr={},Yr=a((function e(){throw o(this,e),new TypeError("Illegal constructor")}),[{key:"abortReason",get:function(){if(!Hr(this))throw rt("abortReason");return this._abortReason}},{key:"signal",get:function(){if(!Hr(this))throw rt("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!Hr(this))throw rt("error");"writable"===this._controlledWritableStream._state&&Zr(this,e)}},{key:k,value:function(e){var r=this._abortAlgorithm(e);return Ur(this),r}},{key:q,value:function(){qe(this)}}]);function Hr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Yr}function Vr(e,r,t,n,o,i,a,u){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,qe(r),r._abortReason=void 0,r._abortController=(function(){if("function"==typeof AbortController)return new AbortController})(),r._started=!1,r._strategySizeAlgorithm=u,r._strategyHWM=a,r._writeAlgorithm=n,r._closeAlgorithm=o,r._abortAlgorithm=i;var l=Kr(r);Ir(e,l),p(b(t()),(function(){return r._started=!0,Xr(r),null}),(function(t){return r._started=!0,Wr(e,t),null}))}function Ur(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Gr(e){return e._strategyHWM-e._queueTotalSize}function Xr(e){var r=e._controlledWritableStream;if(e._started&&void 0===r._inFlightWriteRequest)if("erroring"!==r._state){if(0!==e._queue.length){var t=e._queue.peek().value;t===Qr?(function(e){var r=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(r),Pe(e);var t=e._closeAlgorithm();Ur(e),p(t,(function(){return(function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var r=e._writer;void 0!==r&&ut(r)})(r),null}),(function(e){return(function(e,r){e._inFlightCloseRequest._reject(r),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(r),e._pendingAbortRequest=void 0),Wr(e,r)})(r,e),null}))})(e):(function(e,r){var t=e._controlledWritableStream;!(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(t),p(e._writeAlgorithm(r),(function(){!(function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0})(t);var r=t._state;if(Pe(e),!Br(t)&&"writable"===r){var n=Kr(e);Ir(t,n)}return Xr(e),null}),(function(r){return"writable"===t._state&&Ur(e),(function(e,r){e._inFlightWriteRequest._reject(r),e._inFlightWriteRequest=void 0,Wr(e,r)})(t,r),null}))})(e,t)}}else zr(r)}function Jr(e,r){"writable"===e._controlledWritableStream._state&&Zr(e,r)}function Kr(e){return Gr(e)<=0}function Zr(e,r){var t=e._controlledWritableStream;Ur(e),Ar(t,r)}function et(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function rt(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function tt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function nt(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function ot(e){e._closedPromise=h((function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"}))}function it(e,r){ot(e),at(e,r)}function at(e,r){void 0!==e._closedPromise_reject&&(w(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ut(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function lt(e){e._readyPromise=h((function(r,t){e._readyPromise_resolve=r,e._readyPromise_r