|
- /**
- * Minified by jsDelivr using Terser v3.14.1.
- * Original file: /npm/web-streams-polyfill@2.0.2/dist/ponyfill.js
- *
- * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
- */
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).WebStreamsPolyfill={})}(this,function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};var t=Number.isNaN||function(e){return e!=e};function o(e){return"object"==typeof e&&null!==e||"function"==typeof e}function n(e){return e.slice()}function i(e){return!1!==function(e){if("number"!=typeof e)return!1;if(t(e))return!1;if(e<0)return!1;return!0}(e)&&e!==1/0}function a(e,r,t){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function s(e,r,t,o){var n=e[r];if(void 0!==n){if("function"!=typeof n)throw new TypeError(n+" is not a method");switch(t){case 0:return function(){return l(n,e,o)};case 1:return function(r){var t=[r].concat(o);return l(n,e,t)}}}return function(){return Promise.resolve()}}function u(e,r,t){var o=e[r];if(void 0!==o)return a(o,e,t)}function l(e,r,t){try{return Promise.resolve(a(e,r,t))}catch(e){return Promise.reject(e)}}function c(e){return e}function f(e){if(e=Number(e),t(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function d(e){if(void 0===e)return function(){return 1};if("function"!=typeof e)throw new TypeError("size property of a queuing strategy must be a function");return function(r){return e(r)}}function _(e,r,t){for(var o=!1,n=function(e){!1===o&&(o=!0,t(e))},i=0,a=0,s=e.length,u=new Array(s),l=function(e){var t=i;!function(e,r,t){Promise.prototype.then.call(e,r,t)}(e,function(e){u[t]=e,++a===s&&r(u)},n),++i},c=0,f=e;c<f.length;c++){l(f[c])}}var h=function(){},b=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.push=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},e.prototype.shift=function(){var e=this._front,r=e,t=this._cursor,o=t+1,n=e._elements,i=n[t];return 16384===o&&(r=e._next,o=0),--this._size,this._cursor=o,e!==r&&(this._front=r),n[t]=void 0,i},e.prototype.forEach=function(e){for(var r=this._cursor,t=this._front,o=t._elements;!(r===o.length&&void 0===t._next||r===o.length&&(r=0,0===(o=(t=t._next)._elements).length));)e(o[r]),++r},e.prototype.peek=function(){var e=this._front,r=this._cursor;return e._elements[r]},e}();function p(e){var r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function m(e,r,t){if(!i(t=Number(t)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function y(e){e._queue=new b,e._queueTotalSize=0}var v=r("[[AbortSteps]]"),w=r("[[ErrorSteps]]"),g=function(){function e(e,r){void 0===e&&(e={}),void 0===r&&(r={}),R(this);var t=r.size,o=r.highWaterMark;if(void 0!==e.type)throw new RangeError("Invalid type is specified");var n=d(t);void 0===o&&(o=1),function(e,r,t,o){var n=Object.create(x.prototype);var i=s(r,"write",1,[n]),a=s(r,"close",0,[]),l=s(r,"abort",1,[]);D(e,n,function(){return u(r,"start",[n])},i,a,l,t,o)}(this,e,o=f(o),n)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===P(this))throw G("locked");return T(this)},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===P(this)?Promise.reject(G("abort")):!0===T(this)?Promise.reject(new TypeError("Cannot abort a stream that already has a writer")):q(this,e)},e.prototype.getWriter=function(){if(!1===P(this))throw G("getWriter");return S(this)},e}();function S(e){return new k(e)}function R(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new b,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function P(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function T(e){return void 0!==e._writer}function q(e,r){var t=e._state;if("closed"===t||"errored"===t)return Promise.resolve(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var o=!1;"erroring"===t&&(o=!0,r=void 0);var n=new Promise(function(t,n){e._pendingAbortRequest={_promise:void 0,_resolve:t,_reject:n,_reason:r,_wasAlreadyErroring:o}});return e._pendingAbortRequest._promise=n,!1===o&&E(e,r),n}function j(e,r){"writable"!==e._state?C(e):E(e,r)}function E(e,r){var t=e._writableStreamController;e._state="erroring",e._storedError=r;var o=e._writer;void 0!==o&&F(o,r),!1===function(e){if(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)return!1;return!0}(e)&&!0===t._started&&C(e)}function C(e){e._state="errored",e._writableStreamController[w]();var r=e._storedError;if(e._writeRequests.forEach(function(e){e._reject(r)}),e._writeRequests=new b,void 0!==e._pendingAbortRequest){var t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,!0===t._wasAlreadyErroring)return t._reject(r),void O(e);e._writableStreamController[v](t._reason).then(function(){t._resolve(),O(e)},function(r){t._reject(r),O(e)})}else O(e)}function A(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function O(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var r=e._writer;void 0!==r&&$(r,e._storedError)}function W(e,r){var t=e._writer;void 0!==t&&r!==e._backpressure&&(!0===r?function(e){re(e)}(t):ie(t)),e._backpressure=r}var k=function(){function e(e){if(!1===P(e))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===T(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var r,t=e._state;if("writable"===t)!1===A(e)&&!0===e._backpressure?re(this):oe(this),X(this);else if("erroring"===t)te(this,e._storedError),X(this);else if("closed"===t)oe(this),X(r=this),ee(r);else{var o=e._storedError;te(this,o),Z(this,o)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return!1===z(this)?Promise.reject(J("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===z(this))throw J("desiredSize");if(void 0===this._ownerWritableStream)throw K("desiredSize");return function(e){var r=e._ownerWritableStream,t=r._state;if("errored"===t||"erroring"===t)return null;if("closed"===t)return 0;return Y(r._writableStreamController)}(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return!1===z(this)?Promise.reject(J("ready")):this._readyPromise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===z(this)?Promise.reject(J("abort")):void 0===this._ownerWritableStream?Promise.reject(K("abort")):function(e,r){return q(e._ownerWritableStream,r)}(this,e)},e.prototype.close=function(){if(!1===z(this))return Promise.reject(J("close"));var e=this._ownerWritableStream;return void 0===e?Promise.reject(K("close")):!0===A(e)?Promise.reject(new TypeError("cannot close an already-closing stream")):B(this)},e.prototype.releaseLock=function(){if(!1===z(this))throw J("releaseLock");void 0!==this._ownerWritableStream&&L(this)},e.prototype.write=function(e){return!1===z(this)?Promise.reject(J("write")):void 0===this._ownerWritableStream?Promise.reject(K("write to")):M(this,e)},e}();function z(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function B(e){var r=e._ownerWritableStream,t=r._state;if("closed"===t||"errored"===t)return Promise.reject(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var o,n=new Promise(function(e,t){var o={_resolve:e,_reject:t};r._closeRequest=o});return!0===r._backpressure&&"writable"===t&&ie(e),m(o=r._writableStreamController,"close",0),H(o),n}function I(e,r){"pending"===e._closedPromiseState?$(e,r):function(e,r){Z(e,r)}(e,r)}function F(e,r){"pending"===e._readyPromiseState?ne(e,r):function(e,r){te(e,r)}(e,r)}function L(e){var r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");F(e,t),I(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function M(e,r){var t=e._ownerWritableStream,o=t._writableStreamController,n=function(e,r){try{return e._strategySizeAlgorithm(r)}catch(r){return U(e,r),1}}(o,r);if(t!==e._ownerWritableStream)return Promise.reject(K("write to"));var i=t._state;if("errored"===i)return Promise.reject(t._storedError);if(!0===A(t)||"closed"===i)return Promise.reject(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return Promise.reject(t._storedError);var a=function(e){return new Promise(function(r,t){var o={_resolve:r,_reject:t};e._writeRequests.push(o)})}(t);return function(e,r,t){var o={chunk:r};try{m(e,o,t)}catch(r){return void U(e,r)}var n=e._controlledWritableStream;if(!1===A(n)&&"writable"===n._state){var i=V(e);W(n,i)}H(e)}(o,r,n),a}var x=function(){function e(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return e.prototype.error=function(e){if(!1===function(e){if(!o(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&Q(this,e)},e.prototype[v]=function(e){var r=this._abortAlgorithm(e);return N(this),r},e.prototype[w]=function(){y(this)},e}();function D(e,r,t,o,n,i,a,s){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,y(r),r._started=!1,r._strategySizeAlgorithm=s,r._strategyHWM=a,r._writeAlgorithm=o,r._closeAlgorithm=n,r._abortAlgorithm=i;var u=V(r);W(e,u);var l=t();Promise.resolve(l).then(function(){r._started=!0,H(r)},function(t){r._started=!0,j(e,t)}).catch(h)}function N(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Y(e){return e._strategyHWM-e._queueTotalSize}function H(e){var r=e._controlledWritableStream;if(!1!==e._started&&void 0===r._inFlightWriteRequest)if("erroring"!==r._state){if(0!==e._queue.length){var t=e._queue.peek().value;"close"===t?function(e){var r=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(r),p(e);var t=e._closeAlgorithm();N(e),t.then(function(){!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&&ee(r)}(r)},function(e){!function(e,r){e._inFlightCloseRequest._reject(r),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(r),e._pendingAbortRequest=void 0),j(e,r)}(r,e)}).catch(h)}(e):function(e,r){var t=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(t),e._writeAlgorithm(r).then(function(){!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(t);var r=t._state;if(p(e),!1===A(t)&&"writable"===r){var o=V(e);W(t,o)}H(e)},function(r){"writable"===t._state&&N(e),function(e,r){e._inFlightWriteRequest._reject(r),e._inFlightWriteRequest=void 0,j(e,r)}(t,r)}).catch(h)}(e,t.chunk)}}else C(r)}function U(e,r){"writable"===e._controlledWritableStream._state&&Q(e,r)}function V(e){return Y(e)<=0}function Q(e,r){var t=e._controlledWritableStream;N(e),E(t,r)}function G(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function J(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function K(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function X(e){e._closedPromise=new Promise(function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function Z(e,r){X(e),$(e,r)}function $(e,r){e._closedPromise.catch(function(){}),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function ee(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function re(e){e._readyPromise=new Promise(function(r,t){e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function te(e,r){re(e),ne(e,r)}function oe(e){re(e),ie(e)}function ne(e,r){e._readyPromise.catch(function(){}),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function ie(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}var ae,se,ue=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};"symbol"==typeof r.asyncIterator&&((ae={})[r.asyncIterator]=function(){return this},se=ae,Object.defineProperty(se,r.asyncIterator,{enumerable:!1}));var le=r("[[CancelSteps]]"),ce=r("[[PullSteps]]"),fe=function(){function e(e,r){void 0===e&&(e={}),void 0===r&&(r={}),be(this);var t=r.size,o=r.highWaterMark,n=e.type;if("bytes"===String(n)){if(void 0!==t)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===o&&(o=0),function(e,r,t){var o=Object.create(Xe.prototype);var n=s(r,"pull",0,[o]),i=s(r,"cancel",1,[]),a=r.autoAllocateChunkSize;if(void 0!==a&&(a=Number(a),!1===ue(a)||a<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(e,r,t,o,n,i,a){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=void 0,r._queue=r._queueTotalSize=void 0,y(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=f(i),r._pullAlgorithm=o,r._cancelAlgorithm=n,r._autoAllocateChunkSize=a,r._pendingPullIntos=new b,e._readableStreamController=r;var s=t();Promise.resolve(s).then(function(){r._started=!0,er(r)},function(e){dr(r,e)}).catch(h)}(e,o,function(){return u(r,"start",[o])},n,i,t,a)}(this,e,o=f(o))}else{if(void 0!==n)throw new RangeError("Invalid type is specified");var i=d(t);void 0===o&&(o=1),function(e,r,t,o){var n=Object.create(Me.prototype);var i=s(r,"pull",0,[n]),a=s(r,"cancel",1,[]);Je(e,n,function(){return u(r,"start",[n])},i,a,t,o)}(this,e,o=f(o),i)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===pe(this))throw br("locked");return me(this)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return!1===pe(this)?Promise.reject(br("cancel")):!0===me(this)?Promise.reject(new TypeError("Cannot cancel a stream that already has a reader")):Se(this,e)},e.prototype.getReader=function(e){var r=(void 0===e?{}:e).mode;if(!1===pe(this))throw br("getReader");if(void 0===r)return _e(this,!0);if("byob"===(r=String(r)))return function(e,r){void 0===r&&(r=!1);var t=new We(e);return t._forAuthorCode=r,t}(this,!0);throw new RangeError("Invalid mode is specified")},e.prototype.pipeThrough=function(e,r){var t=e.writable,o=e.readable,n=void 0===r?{}:r,i=n.preventClose,a=n.preventAbort,s=n.preventCancel,u=n.signal;if(!1===pe(this))throw br("pipeThrough");if(!1===P(t))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===pe(o))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),a=Boolean(a),s=Boolean(s),void 0!==u&&!hr(u))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===me(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===T(t))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return ve(this,t,i,a,s,u).catch(function(){}),o},e.prototype.pipeTo=function(e,r){var t=void 0===r?{}:r,o=t.preventClose,n=t.preventAbort,i=t.preventCancel,a=t.signal;return!1===pe(this)?Promise.reject(br("pipeTo")):!1===P(e)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(o=Boolean(o),n=Boolean(n),i=Boolean(i),void 0===a||hr(a)?!0===me(this)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===T(e)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ve(this,e,o,n,i,a):Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},e.prototype.tee=function(){if(!1===pe(this))throw br("tee");var e=function(e,r){var t,o,i,a,s,u=_e(e),l=!1,c=!1,f=!1,d=new Promise(function(e){s=e});function _(){return Le(u).then(function(e){if(!0!==l){var r=e.done;if(!0===r)return!1===c&&He(i._readableStreamController),!1===f&&He(a._readableStreamController),void(l=!0);var t=e.value,o=t,n=t;!1===c&&Ue(i._readableStreamController,o),!1===f&&Ue(a._readableStreamController,n)}})}function h(){}return i=he(h,_,function(r){if(c=!0,t=r,!0===f){var i=n([t,o]),a=Se(e,i);s(a)}return d}),a=he(h,_,function(r){if(f=!0,o=r,!0===c){var i=n([t,o]),a=Se(e,i);s(a)}return d}),u._closedPromise.catch(function(e){Ve(i._readableStreamController,e),Ve(a._readableStreamController,e)}),[i,a]}(this);return n(e)},e.prototype.getIterator=function(e){var r=(void 0===e?{}:e).preventCancel;if(!1===pe(this))throw br("getIterator");var t=_e(this),o=Object.create(de);return o._asyncIteratorReader=t,o._preventCancel=Boolean(r),o},e}(),de={next:function(){if(!1===ye(this))return Promise.reject(pr("next"));var e=this._asyncIteratorReader;return void 0===e._ownerReadableStream?Promise.reject(mr("iterate")):Le(e).then(function(r){var t=r.done;return t&&Fe(e),Pe(r.value,t,!0)})},return:function(e){if(!1===ye(this))return Promise.reject(pr("next"));var r=this._asyncIteratorReader;if(void 0===r._ownerReadableStream)return Promise.reject(mr("finish iterating"));if(r._readRequests.length>0)return Promise.reject(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var t=Ie(r,e);return Fe(r),t.then(function(){return Pe(e,!0,!0)})}return Fe(r),Promise.resolve(Pe(e,!0,!0))}};function _e(e,r){void 0===r&&(r=!1);var t=new Oe(e);return t._forAuthorCode=r,t}function he(e,r,t,o,n){void 0===o&&(o=1),void 0===n&&(n=function(){return 1});var i=Object.create(fe.prototype);return be(i),Je(i,Object.create(Me.prototype),e,r,t,o,n),i}function be(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function pe(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function me(e){return void 0!==e._reader}function ye(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorReader")}function ve(e,r,t,o,n,i){var a=_e(e),s=S(r),u=!1,l=Promise.resolve();return new Promise(function(c,f){var d,b,p,m;if(void 0!==i){if(d=function(){var t=new DOMException("Aborted","AbortError"),i=[];!1===o&&i.push(function(){return"writable"===r._state?q(r,t):Promise.resolve()}),!1===n&&i.push(function(){return"readable"===e._state?Se(e,t):Promise.resolve()}),g(function(){return function(e,r,t){var o,n;void 0===t&&(t=void 0);var i=new Promise(function(e,r){o=e,n=r});return void 0===t&&(t=function(e){throw e}),_(e,function(e){try{var t=r(e);o(t)}catch(e){n(e)}},function(e){try{var r=t(e);o(r)}catch(e){n(e)}}),i}(i.map(function(e){return e()}),function(e){return e})},!0,t)},!0===i.aborted)return void d();i.addEventListener("abort",d)}if(w(e,a._closedPromise,function(e){!1===o?g(function(){return q(r,e)},!0,e):S(!0,e)}),w(r,s._closedPromise,function(r){!1===n?g(function(){return Se(e,r)},!0,r):S(!0,r)}),b=e,p=a._closedPromise,m=function(){!1===t?g(function(){return function(e){var r=e._ownerWritableStream,t=r._state;return!0===A(r)||"closed"===t?Promise.resolve():"errored"===t?Promise.reject(r._storedError):B(e)}(s)}):S()},"closed"===b._state?m():p.then(m).catch(h),!0===A(r)||"closed"===r._state){var y=new TypeError("the destination writable stream closed before all data could be piped to it");!1===n?g(function(){return Se(e,y)},!0,y):S(!0,y)}function v(){var e=l;return l.then(function(){return e!==l?v():void 0})}function w(e,r,t){"errored"===e._state?t(e._storedError):r.catch(t).catch(h)}function g(e,t,o){function n(){e().then(function(){return R(t,o)},function(e){return R(!0,e)}).catch(h)}!0!==u&&(u=!0,"writable"===r._state&&!1===A(r)?v().then(n):n())}function S(e,t){!0!==u&&(u=!0,"writable"===r._state&&!1===A(r)?v().then(function(){return R(e,t)}).catch(h):R(e,t))}function R(e,r){L(s),Fe(a),void 0!==i&&i.removeEventListener("abort",d),e?f(r):c(void 0)}new Promise(function(e,r){!function t(o){o?e():(!0===u?Promise.resolve(!0):s._readyPromise.then(function(){return Le(a).then(function(e){var r=e.value,t=e.done;return!0===t||(l=M(s,r).catch(function(){}),!1)})})).then(t,r)}(!1)}).catch(h)})}function we(e){return new Promise(function(r,t){var o={_resolve:r,_reject:t};e._reader._readIntoRequests.push(o)})}function ge(e){return new Promise(function(r,t){var o={_resolve:r,_reject:t};e._reader._readRequests.push(o)})}function Se(e,r){return e._disturbed=!0,"closed"===e._state?Promise.resolve(void 0):"errored"===e._state?Promise.reject(e._storedError):(Re(e),e._readableStreamController[le](r).then(function(){}))}function Re(e){e._state="closed";var r=e._reader;void 0!==r&&(ze(r)&&(r._readRequests.forEach(function(e){e._resolve(Pe(void 0,!0,r._forAuthorCode))}),r._readRequests=new b),Sr(r))}function Pe(e,r,t){var o=null;!0===t&&(o=Object.prototype);var n=Object.create(o);return n.value=e,n.done=r,n}function Te(e,r){e._state="errored",e._storedError=r;var t=e._reader;void 0!==t&&(ze(t)?(t._readRequests.forEach(function(e){e._reject(r)}),t._readRequests=new b):(t._readIntoRequests.forEach(function(e){e._reject(r)}),t._readIntoRequests=new b),gr(t,r))}function qe(e,r,t){var o=e._reader;o._readRequests.shift()._resolve(Pe(r,t,o._forAuthorCode))}function je(e){return e._reader._readIntoRequests.length}function Ee(e){return e._reader._readRequests.length}function Ce(e){var r=e._reader;return void 0!==r&&!!ke(r)}function Ae(e){var r=e._reader;return void 0!==r&&!!ze(r)}void 0!==se&&Object.setPrototypeOf(de,se),Object.defineProperty(de,"next",{enumerable:!1}),Object.defineProperty(de,"return",{enumerable:!1}),"symbol"==typeof r.asyncIterator&&Object.defineProperty(fe.prototype,r.asyncIterator,{value:fe.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var Oe=function(){function e(e){if(!1===pe(e))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===me(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Be(this,e),this._readRequests=new b}return Object.defineProperty(e.prototype,"closed",{get:function(){return ze(this)?this._closedPromise:Promise.reject(yr("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return ze(this)?void 0===this._ownerReadableStream?Promise.reject(mr("cancel")):Ie(this,e):Promise.reject(yr("cancel"))},e.prototype.read=function(){return ze(this)?void 0===this._ownerReadableStream?Promise.reject(mr("read from")):Le(this):Promise.reject(yr("read"))},e.prototype.releaseLock=function(){if(!ze(this))throw yr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Fe(this)}},e}(),We=function(){function e(e){if(!pe(e))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===Ze(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(me(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Be(this,e),this._readIntoRequests=new b}return Object.defineProperty(e.prototype,"closed",{get:function(){return ke(this)?this._closedPromise:Promise.reject(Rr("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return ke(this)?void 0===this._ownerReadableStream?Promise.reject(mr("cancel")):Ie(this,e):Promise.reject(Rr("cancel"))},e.prototype.read=function(e){return ke(this)?void 0===this._ownerReadableStream?Promise.reject(mr("read from")):ArrayBuffer.isView(e)?(e.buffer,0===e.byteLength?Promise.reject(new TypeError("view must have non-zero byteLength")):function(e,r){var t=e._ownerReadableStream;if(t._disturbed=!0,"errored"===t._state)return Promise.reject(t._storedError);return function(e,r){var t=e._controlledReadableByteStream,o=1;r.constructor!==DataView&&(o=r.constructor.BYTES_PER_ELEMENT);var n=r.constructor,i={buffer:c(r.buffer),byteOffset:r.byteOffset,byteLength:r.byteLength,bytesFilled:0,elementSize:o,ctor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(i),we(t);if("closed"===t._state){var a=new n(i.buffer,i.byteOffset,0);return Promise.resolve(Pe(a,!0,t._reader._forAuthorCode))}if(e._queueTotalSize>0){if(!0===nr(e,i)){var s=tr(i);return ar(e),Promise.resolve(Pe(s,!1,t._reader._forAuthorCode))}if(!0===e._closeRequested){var u=new TypeError("Insufficient bytes to fill elements in the given buffer");return dr(e,u),Promise.reject(u)}}e._pendingPullIntos.push(i);var l=we(t);return er(e),l}(t._readableStreamController,r)}(this,e)):Promise.reject(new TypeError("view must be an array buffer view")):Promise.reject(Rr("read"))},e.prototype.releaseLock=function(){if(!ke(this))throw Rr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Fe(this)}},e}();function ke(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function ze(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Be(e,r){e._forAuthorCode=!0,e._ownerReadableStream=r,r._reader=e,"readable"===r._state?vr(e):"closed"===r._state?function(e){vr(e),Sr(e)}(e):wr(e,r._storedError)}function Ie(e,r){return Se(e._ownerReadableStream,r)}function Fe(e){"readable"===e._ownerReadableStream._state?gr(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,r){wr(e,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function Le(e){var r=e._ownerReadableStream;return r._disturbed=!0,"closed"===r._state?Promise.resolve(Pe(void 0,!0,e._forAuthorCode)):"errored"===r._state?Promise.reject(r._storedError):r._readableStreamController[ce]()}var Me=function(){function e(){throw new TypeError}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===xe(this))throw Pr("desiredSize");return Qe(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===xe(this))throw Pr("close");if(!1===Ge(this))throw new TypeError("The stream is not in a state that permits close");He(this)},e.prototype.enqueue=function(e){if(!1===xe(this))throw Pr("enqueue");if(!1===Ge(this))throw new TypeError("The stream is not in a state that permits enqueue");return Ue(this,e)},e.prototype.error=function(e){if(!1===xe(this))throw Pr("error");Ve(this,e)},e.prototype[le]=function(e){y(this);var r=this._cancelAlgorithm(e);return Ye(this),r},e.prototype[ce]=function(){var e=this._controlledReadableStream;if(this._queue.length>0){var r=p(this);return!0===this._closeRequested&&0===this._queue.length?(Ye(this),Re(e)):De(this),Promise.resolve(Pe(r,!1,e._reader._forAuthorCode))}var t=ge(e);return De(this),t},e}();function xe(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function De(e){!1!==Ne(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,De(e))},function(r){Ve(e,r)}).catch(h)):e._pullAgain=!0)}function Ne(e){var r=e._controlledReadableStream;return!1!==Ge(e)&&(!1!==e._started&&(!0===me(r)&&Ee(r)>0||Qe(e)>0))}function Ye(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function He(e){var r=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ye(e),Re(r))}function Ue(e,r){var t=e._controlledReadableStream;if(!0===me(t)&&Ee(t)>0)qe(t,r,!1);else{var o=void 0;try{o=e._strategySizeAlgorithm(r)}catch(r){throw Ve(e,r),r}try{m(e,r,o)}catch(r){throw Ve(e,r),r}}De(e)}function Ve(e,r){var t=e._controlledReadableStream;"readable"===t._state&&(y(e),Ye(e),Te(t,r))}function Qe(e){var r=e._controlledReadableStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function Ge(e){var r=e._controlledReadableStream._state;return!1===e._closeRequested&&"readable"===r}function Je(e,r,t,o,n,i,a){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,y(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=a,r._strategyHWM=i,r._pullAlgorithm=o,r._cancelAlgorithm=n,e._readableStreamController=r;var s=t();Promise.resolve(s).then(function(){r._started=!0,De(r)},function(e){Ve(r,e)}).catch(h)}var Ke=function(){function e(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!1===$e(this))throw Tr("view");return this._view},enumerable:!0,configurable:!0}),e.prototype.respond=function(e){if(!1===$e(this))throw Tr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,r){if(!1===i(r=Number(r)))throw new RangeError("bytesWritten must be a finite");lr(e,r)}(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!1===$e(this))throw Tr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");e.buffer,function(e,r){var t=e._pendingPullIntos.peek();if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.byteLength!==r.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");t.buffer=r.buffer,lr(e,r.byteLength)}(this._associatedReadableByteStreamController,e)},e}(),Xe=function(){function e(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!1===Ze(this))throw qr("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek(),r=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),t=Object.create(Ke.prototype);!function(e,r,t){e._associatedReadableByteStreamController=r,e._view=t}(t,this,r),this._byobRequest=t}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Ze(this))throw qr("desiredSize");return _r(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===Ze(this))throw qr("close");if(!0===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");!function(e){var r=e._controlledReadableByteStream;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){var t=e._pendingPullIntos.peek();if(t.bytesFilled>0){var o=new TypeError("Insufficient bytes to fill elements in the given buffer");throw dr(e,o),o}}fr(e),Re(r)}(this)},e.prototype.enqueue=function(e){if(!1===Ze(this))throw qr("enqueue");if(!0===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");if(!ArrayBuffer.isView(e))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");e.buffer,function(e,r){var t=e._controlledReadableByteStream,o=r.buffer,n=r.byteOffset,i=r.byteLength,a=c(o);if(!0===Ae(t))if(0===Ee(t))or(e,a,n,i);else{var s=new Uint8Array(a,n,i);qe(t,s,!1)}else!0===Ce(t)?(or(e,a,n,i),ur(e)):or(e,a,n,i);er(e)}(this,e)},e.prototype.error=function(e){if(!1===Ze(this))throw qr("error");dr(this,e)},e.prototype[le]=function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);y(this);var r=this._cancelAlgorithm(e);return fr(this),r},e.prototype[ce]=function(){var e=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift();this._queueTotalSize-=r.byteLength,ar(this);var t=void 0;try{t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}catch(e){return Promise.reject(e)}return Promise.resolve(Pe(t,!1,e._reader._forAuthorCode))}var o=this._autoAllocateChunkSize;if(void 0!==o){var n=void 0;try{n=new ArrayBuffer(o)}catch(e){return Promise.reject(e)}var i={buffer:n,byteOffset:0,byteLength:o,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}var a=ge(e);return er(this),a},e}();function Ze(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function $e(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function er(e){!1!==function(e){var r=e._controlledReadableByteStream;if("readable"!==r._state)return!1;if(!0===e._closeRequested)return!1;if(!1===e._started)return!1;if(!0===Ae(r)&&Ee(r)>0)return!0;if(!0===Ce(r)&&je(r)>0)return!0;if(_r(e)>0)return!0;return!1}(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,er(e))},function(r){dr(e,r)}).catch(h)):e._pullAgain=!0)}function rr(e,r){var t=!1;"closed"===e._state&&(t=!0);var o=tr(r);"default"===r.readerType?qe(e,o,t):function(e,r,t){var o=e._reader;o._readIntoRequests.shift()._resolve(Pe(r,t,o._forAuthorCode))}(e,o,t)}function tr(e){var r=e.bytesFilled,t=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,r/t)}function or(e,r,t,o){e._queue.push({buffer:r,byteOffset:t,byteLength:o}),e._queueTotalSize+=o}function nr(e,r){var t=r.elementSize,o=r.bytesFilled-r.bytesFilled%t,n=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+n,a=i-i%t,s=n,u=!1;a>o&&(s=a-r.bytesFilled,u=!0);for(var l,c,f,d,_,h=e._queue;s>0;){var b=h.peek(),p=Math.min(s,b.byteLength),m=r.byteOffset+r.bytesFilled;l=r.buffer,c=m,f=b.buffer,d=b.byteOffset,_=p,new Uint8Array(l).set(new Uint8Array(f,d,_),c),b.byteLength===p?h.shift():(b.byteOffset+=p,b.byteLength-=p),e._queueTotalSize-=p,ir(e,p,r),s-=p}return u}function ir(e,r,t){sr(e),t.bytesFilled+=r}function ar(e){0===e._queueTotalSize&&!0===e._closeRequested?(fr(e),Re(e._controlledReadableByteStream)):er(e)}function sr(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function ur(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var r=e._pendingPullIntos.peek();!0===nr(e,r)&&(cr(e),rr(e._controlledReadableByteStream,r))}}function lr(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");!function(e,r){r.buffer=c(r.buffer);var t=e._controlledReadableByteStream;if(!0===Ce(t))for(;je(t)>0;)rr(t,cr(e))}(e,t)}else!function(e,r,t){if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range");if(ir(e,r,t),!(t.bytesFilled<t.elementSize)){cr(e);var o=t.bytesFilled%t.elementSize;if(o>0){var n=t.byteOffset+t.bytesFilled,i=t.buffer.slice(n-o,n);or(e,i,0,i.byteLength)}t.buffer=c(t.buffer),t.bytesFilled-=o,rr(e._controlledReadableByteStream,t),ur(e)}}(e,r,t);er(e)}function cr(e){var r=e._pendingPullIntos.shift();return sr(e),r}function fr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function dr(e,r){var t=e._controlledReadableByteStream;"readable"===t._state&&(!function(e){sr(e),e._pendingPullIntos=new b}(e),y(e),fr(e),Te(t,r))}function _r(e){var r=e._controlledReadableByteStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function hr(e){if("object"!=typeof e||null===e)return!1;var r=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted").get;try{return r.call(e),!0}catch(e){return!1}}function br(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function pr(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}function mr(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function yr(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}function vr(e){e._closedPromise=new Promise(function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t})}function wr(e,r){vr(e),gr(e,r)}function gr(e,r){e._closedPromise.catch(function(){}),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Sr(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Rr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function Pr(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function Tr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function qr(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}var jr=function(){function e(e){var r=e.highWaterMark;this.highWaterMark=r}return e.prototype.size=function(e){return e.byteLength},e}(),Er=function(){function e(e){var r=e.highWaterMark;this.highWaterMark=r}return e.prototype.size=function(){return 1},e}(),Cr=function(){function e(e,r,t){void 0===e&&(e={}),void 0===r&&(r={}),void 0===t&&(t={});var o=r.size,n=r.highWaterMark,i=t.size,a=t.highWaterMark;if(void 0!==e.writableType)throw new RangeError("Invalid writable type specified");var c=d(o);if(void 0===n&&(n=1),n=f(n),void 0!==e.readableType)throw new RangeError("Invalid readable type specified");var _,h=d(i);void 0===a&&(a=0),a=f(a),function(e,r,t,o,n,i){function a(){return r}e._writable=function(e,r,t,o,n,i){void 0===n&&(n=1),void 0===i&&(i=function(){return 1});var a=Object.create(g.prototype);return R(a),D(a,Object.create(x.prototype),e,r,t,o,n,i),a}(a,function(r){return function(e,r){var t=e._transformStreamController;if(!0===e._backpressure){var o=e._backpressureChangePromise;return o.then(function(){var o=e._writable,n=o._state;if("erroring"===n)throw o._storedError;return Lr(t,r)})}return Lr(t,r)}(e,r)},function(){return function(e){var r=e._readable,t=e._transformStreamController,o=t._flushAlgorithm();return Ir(t),o.then(function(){if("errored"===r._state)throw r._storedError;var e=r._readableStreamController;!0===Ge(e)&&He(e)}).catch(function(t){throw Or(e,t),r._storedError})}(e)},function(r){return function(e,r){return Or(e,r),Promise.resolve()}(e,r)},t,o),e._readable=he(a,function(){return function(e){return kr(e,!1),e._backpressureChangePromise}(e)},function(r){return Wr(e,r),Promise.resolve()},n,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,kr(e,!0),e._transformStreamController=void 0}(this,new Promise(function(e){_=e}),n,c,a,h),function(e,r){var t=Object.create(zr.prototype),o=function(e){try{return Fr(t,e),Promise.resolve()}catch(e){return Promise.reject(e)}},n=r.transform;if(void 0!==n){if("function"!=typeof n)throw new TypeError("transform is not a method");o=function(e){return l(n,r,[e,t])}}var i=s(r,"flush",0,[t]);!function(e,r,t,o){r._controlledTransformStream=e,e._transformStreamController=r,r._transformAlgorithm=t,r._flushAlgorithm=o}(e,t,o,i)}(this,e);var b=u(e,"start",[this._transformStreamController]);_(b)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!1===Ar(this))throw xr("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!1===Ar(this))throw xr("writable");return this._writable},enumerable:!0,configurable:!0}),e}();function Ar(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Or(e,r){Ve(e._readable._readableStreamController,r),Wr(e,r)}function Wr(e,r){Ir(e._transformStreamController),U(e._writable._writableStreamController,r),!0===e._backpressure&&kr(e,!1)}function kr(e,r){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=new Promise(function(r){e._backpressureChangePromise_resolve=r}),e._backpressure=r}var zr=function(){function e(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Br(this))throw Mr("desiredSize");return Qe(this._controlledTransformStream._readable._readableStreamController)},enumerable:!0,configurable:!0}),e.prototype.enqueue=function(e){if(!1===Br(this))throw Mr("enqueue");Fr(this,e)},e.prototype.error=function(e){if(!1===Br(this))throw Mr("error");var r;r=e,Or(this._controlledTransformStream,r)},e.prototype.terminate=function(){if(!1===Br(this))throw Mr("terminate");!function(e){var r=e._controlledTransformStream,t=r._readable._readableStreamController;!0===Ge(t)&&He(t);var o=new TypeError("TransformStream terminated");Wr(r,o)}(this)},e}();function Br(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Ir(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Fr(e,r){var t=e._controlledTransformStream,o=t._readable._readableStreamController;if(!1===Ge(o))throw new TypeError("Readable side is not in a state that permits enqueue");try{Ue(o,r)}catch(e){throw Wr(t,e),t._readable._storedError}(function(e){return!0!==Ne(e)})(o)!==t._backpressure&&kr(t,!0)}function Lr(e,r){return e._transformAlgorithm(r).catch(function(r){throw Or(e._controlledTransformStream,r),r})}function Mr(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function xr(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}e.ReadableStream=fe,e.WritableStream=g,e.ByteLengthQueuingStrategy=jr,e.CountQueuingStrategy=Er,e.TransformStream=Cr,Object.defineProperty(e,"__esModule",{value:!0})});
- //# sourceMappingURL=/sm/50a6907fb78f9ce350ecd8437eec0dcc604ba21287893abed38c4313e34e04a6.map
|