hexo/node_modules/web-streams-polyfill/dist/ponyfill.es5.js

9 lines
63 KiB
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
/**
* @license
* web-streams-polyfill v4.0.0-beta.3
* Copyright 2021 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).WebStreamsPolyfill={})}(this,(function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol(".concat(e,")")};function t(){}function n(e){return"object"==typeof e&&null!==e||"function"==typeof e}var o=t;function a(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch(e){}}var i=Promise,l=Promise.prototype.then,u=Promise.resolve.bind(i),s=Promise.reject.bind(i);function c(e){return new i(e)}function d(e){return u(e)}function f(e){return s(e)}function b(e,r,t){return l.call(e,r,t)}function p(e,r,t){b(b(e,r,t),void 0,o)}function h(e,r){p(e,r)}function _(e,r){p(e,void 0,r)}function y(e,r,t){return b(e,r,t)}function m(e){b(e,void 0,o)}var v=function(e){if("function"==typeof queueMicrotask)v=queueMicrotask;else{var r=d(void 0);v=function(e){return b(r,e)}}return v(e)};function g(e,r,t){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function w(e,r,t){try{return d(g(e,r,t))}catch(e){return f(e)}}var S=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:!1,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,n=t+1,o=e._elements,a=o[t];return 16384===n&&(r=e._next,n=0),--this._size,this._cursor=n,e!==r&&(this._front=r),o[t]=void 0,a},e.prototype.forEach=function(e){for(var r=this._cursor,t=this._front,n=t._elements;!(r===n.length&&void 0===t._next||r===n.length&&(r=0,0===(n=(t=t._next)._elements).length));)e(n[r]),++r},e.prototype.peek=function(){var e=this._front,r=this._cursor;return e._elements[r]},e}(),R=r("[[AbortSteps]]"),T=r("[[ErrorSteps]]"),q=r("[[CancelSteps]]"),P=r("[[PullSteps]]"),C=r("[[ReleaseSteps]]");function E(e,r){e._ownerReadableStream=r,r._reader=e,"readable"===r._state?j(e):"closed"===r._state?function(e){j(e),z(e)}(e):B(e,r._storedError)}function W(e,r){return it(e._ownerReadableStream,r)}function O(e){var r=e._ownerReadableStream;"readable"===r._state?A(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,r){B(e,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[C](),r._reader=void 0,e._ownerReadableStream=void 0}function k(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function j(e){e._closedPromise=c((function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t}))}function B(e,r){j(e),A(e,r)}function A(e,r){void 0!==e._closedPromise_reject&&(m(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function z(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var L=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},F=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function I(e,r){if(void 0!==e&&("object"!=typeof(t=e)&&"function"!=typeof t))throw new TypeError("".concat(r," is not an object."));var t}function D(e,r){if("function"!=typeof e)throw new TypeError("".concat(r," is not a function."))}function M(e,r){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError("".concat(r," is not an object."))}function Q(e,r,t){if(void 0===e)throw new TypeError("Parameter ".concat(r," is required in '").concat(t,"'."))}function Y(e,r,t){if(void 0===e)throw new TypeError("".concat(r," is required in '").concat(t,"'.