@dbp-topics/signature
Version:
[GitLab Repository](https://gitlab.tugraz.at/dbp/esign/signature) | [npmjs package](https://www.npmjs.com/package/@dbp-topics/signature) | [Unpkg CDN](https://unpkg.com/browse/@dbp-topics/signature/) | [Esign Bundle](https://gitlab.tugraz.at/dbp/esign/dbp
58 lines • 1.1 MB
JavaScript
const _excluded=["ext","key_ops","alg","use"],_excluded2=["encryptedKey"],_excluded3=["encryptedKey"];let _2=e=>e,_t2,_t3,_t4,_t5,_t6,_t7,_t8,_t9,_t10,_t11,_t12,_t13,_t14,_t15,_t16,_t17,_t18,_t19,_t20,_t21,_t22,_t23,_t24,_t25,_t26,_t27,_t28,_t29,_t30,_t31,_t32,_t33,_t34,_t35,_t36,_t37,_t38,_t39,_t40,_t41,_t42,_t43,_t44,_t45,_t46,_t47,_t48,_t49,_t50,_t51,_t52,_t53,_t54,_t55,_t56,_t57,_t58;function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)i=o[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},_extends.apply(this,arguments)}
/*!
* License: LGPL-2.1-or-later
* Dependencies:
*
* @webcomponents/scoped-custom-element-registry: BSD-3-Clause
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/common: LGPL-2.1-or-later
* @dbp-toolkit/auth: LGPL-2.1-or-later
* event-target-shim: MIT
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/theme-switcher: LGPL-2.1-or-later
* path-to-regexp: MIT
* universal-router: MIT
* generateUrls: MIT
* @dbp-toolkit/matomo: LGPL-2.1-or-later
* @tugraz/web-components: LGPL-2.1-or-later
* @babel/runtime: MIT
* i18next: MIT
* @lit/reactive-element: BSD-3-Clause
* lit-html: BSD-3-Clause
* lit-element: BSD-3-Clause
* @open-wc/dedupe-mixin: MIT
* @open-wc/scoped-elements: MIT
* @digital-blueprint/annotpdf: MIT
* pdfjs-dist: Apache-2.0
* dommatrix: MIT
* web-streams-polyfill: MIT
* @dbp-toolkit/file-handling: LGPL-2.1-or-later
* webdav: MIT
* tabulator-tables: MIT
* jose: MIT
* file-saver: MIT
*/import{c as createInstance$1,r as readBinaryFileContent}from"./activity.9b918d92.es.js";import{x,k as b,S as ScopedElementsMixin,D as DBPLitElement,I as Icon,n as getAssetURL,i as i$2,a as getGeneralCSS,d as getButtonCSS,y,c as createInstance$2,m as humanFileSize,q as getTextUtilities,r as getModalDialogCSS,t as getRadioAndCheckboxCss,u as getTabulatorStyles,A as AdapterLitElement,g as getThemeCSS,v as asyncArrayForEach,o as asyncObjectForEach,w as getMimeTypeOfFile,z as getBaseName,B as getFileExtension}from"./dbp-lit-element.80eb49d3.es.js";import{e as e$1,i as i$1,t,c as commonjsGlobal,g as getAugmentedNamespace,b as getDefaultExportFromCjs,M as MiniSpinner,o,s as send}from"./jsonld.78121145.es.js";
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=e=>void 0===e.strings,f={},s=(e,t=f)=>e._$AH=t
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/,l=e$1(class extends i$1{constructor(i){if(super(i),i.type!==t.PROPERTY&&i.type!==t.ATTRIBUTE&&i.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!e(i))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[i]){if(i===x||i===b)return i;const r=e.element,n=e.name;if(e.type===t.PROPERTY){if(i===r[n])return x}else if(e.type===t.BOOLEAN_ATTRIBUTE){if(!!i===r.hasAttribute(n))return x}else if(e.type===t.ATTRIBUTE&&r.getAttribute(n)===i+"")return x;return s(e),i}});function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}},dommatrix={exports:{}},hasRequiredDommatrix;function requireDommatrix(){return hasRequiredDommatrix||(hasRequiredDommatrix=1,dommatrix.exports=function(){function e(e){var t=new u,i=Array.from(e);if(!i.every((function(e){return!Number.isNaN(e)})))throw TypeError('CSSMatrix: "'+e+'" must only have numbers.');if(16===i.length){var r=i[0],n=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],d=i[7],h=i[8],p=i[9],m=i[10],f=i[11],g=i[12],b=i[13],v=i[14],y=i[15];t.m11=r,t.a=r,t.m21=a,t.c=a,t.m31=h,t.m41=g,t.e=g,t.m12=n,t.b=n,t.m22=l,t.d=l,t.m32=p,t.m42=b,t.f=b,t.m13=o,t.m23=c,t.m33=m,t.m43=v,t.m14=s,t.m24=d,t.m34=f,t.m44=y}else{if(6!==i.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var w=i[0],C=i[1],_=i[2],E=i[3],x=i[4],S=i[5];t.m11=w,t.a=w,t.m12=C,t.b=C,t.m21=_,t.c=_,t.m22=E,t.d=E,t.m41=x,t.e=x,t.m42=S,t.f=S}return t}function t(t){var i=Object.keys(new u);if("object"==typeof t&&i.every((function(e){return e in t})))return e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]);throw TypeError('CSSMatrix: "'+JSON.stringify(t)+'" is not a DOMMatrix / CSSMatrix / JSON compatible object.')}
/**
* Creates a new mutable `CSSMatrix` given any valid CSS transform string,
* or what we call `TransformList`:
*
* * `matrix(a, b, c, d, e, f)` - valid matrix() transform function
* * `matrix3d(m11, m12, m13, ...m44)` - valid matrix3d() transform function
* * `translate(tx, ty) rotateX(alpha)` - any valid transform function(s)
*
* @copyright thednp © 2021
*
* @param {string} source valid CSS transform string syntax.
* @return {CSSMatrix} the resulted matrix.
*/function i(t){if("string"!=typeof t)throw TypeError('CSSMatrix: "'+t+'" is not a string.');var i=String(t).replace(/\s/g,""),r=new u,n='CSSMatrix: invalid transform string "'+t+'"';return i.split(")").filter((function(e){return e})).forEach((function(t){var i=t.split("("),o=i[0],s=i[1];if(!s)throw TypeError(n);var a=s.split(",").map((function(e){return e.includes("rad")?parseFloat(e)*(180/Math.PI):parseFloat(e)})),l=a[0],c=a[1],d=a[2],h=a[3],u=[l,c,d],p=[l,c,d,h];if("perspective"===o&&l&&[c,d].every((function(e){return void 0===e})))r.m34=-1/l;else if(o.includes("matrix")&&[6,16].includes(a.length)&&a.every((function(e){return!Number.isNaN(+e)}))){var m=a.map((function(e){return Math.abs(e)<1e-6?0:e}));r=r.multiply(e(m))}else if("translate3d"===o&&u.every((function(e){return!Number.isNaN(+e)})))r=r.translate(l,c,d);else if("translate"===o&&l&&void 0===d)r=r.translate(l,c||0,0);else if("rotate3d"===o&&p.every((function(e){return!Number.isNaN(+e)}))&&h)r=r.rotateAxisAngle(l,c,d,h);else if("rotate"===o&&l&&[c,d].every((function(e){return void 0===e})))r=r.rotate(0,0,l);else if("scale3d"===o&&u.every((function(e){return!Number.isNaN(+e)}))&&u.some((function(e){return 1!==e})))r=r.scale(l,c,d);else if("scale"!==o||Number.isNaN(l)||1===l||void 0!==d)if("skew"===o&&(l||!Number.isNaN(l)&&c)&&void 0===d)r=r.skew(l,c||0);else{if(!(/[XYZ]/.test(o)&&l&&[c,d].every((function(e){return void 0===e}))&&["translate","rotate","scale","skew"].some((function(e){return o.includes(e)}))))throw TypeError(n);if(["skewX","skewY"].includes(o))r=r[o](l);else{var f=o.replace(/[XYZ]/,""),g=o.replace(f,""),b=["X","Y","Z"].indexOf(g),v="scale"===f?1:0,y=[0===b?l:v,1===b?l:v,2===b?l:v];r=r[f].apply(r,y)}}else{var w=Number.isNaN(+c)?l:c;r=r.scale(l,w,1)}})),r}function r(e,t){return t?[e.a,e.b,e.c,e.d,e.e,e.f]:[e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44]}function n(e,t,i){var r=new u;return r.m41=e,r.e=e,r.m42=t,r.f=t,r.m43=i,r}function o(e,t,i){var r=new u,n=Math.PI/180,o=e*n,s=t*n,a=i*n,l=Math.cos(o),c=-Math.sin(o),d=Math.cos(s),h=-Math.sin(s),p=Math.cos(a),m=-Math.sin(a),f=d*p,g=-d*m;r.m11=f,r.a=f,r.m12=g,r.b=g,r.m13=h;var b=c*h*p+l*m;r.m21=b,r.c=b;var v=l*p-c*h*m;return r.m22=v,r.d=v,r.m23=-c*d,r.m31=c*m-l*h*p,r.m32=c*p+l*h*m,r.m33=l*d,r}function s(e,t,i,r){var n=new u,o=Math.sqrt(e*e+t*t+i*i);if(0===o)return n;var s=e/o,a=t/o,l=i/o,c=r*(Math.PI/360),d=Math.sin(c),h=Math.cos(c),p=d*d,m=s*s,f=a*a,g=l*l,b=1-2*(f+g)*p;n.m11=b,n.a=b;var v=2*(s*a*p+l*d*h);n.m12=v,n.b=v,n.m13=2*(s*l*p-a*d*h);var y=2*(a*s*p-l*d*h);n.m21=y,n.c=y;var w=1-2*(g+m)*p;return n.m22=w,n.d=w,n.m23=2*(a*l*p+s*d*h),n.m31=2*(l*s*p+a*d*h),n.m32=2*(l*a*p-s*d*h),n.m33=1-2*(m+f)*p,n}function a(e,t,i){var r=new u;return r.m11=e,r.a=e,r.m22=t,r.d=t,r.m33=i,r}function l(e,t){var i=new u;if(e){var r=e*Math.PI/180,n=Math.tan(r);i.m21=n,i.c=n}if(t){var o=t*Math.PI/180,s=Math.tan(o);i.m12=s,i.b=s}return i}function c(e){return l(e,0)}function d(e){return l(0,e)}function h(t,i){return e([i.m11*t.m11+i.m12*t.m21+i.m13*t.m31+i.m14*t.m41,i.m11*t.m12+i.m12*t.m22+i.m13*t.m32+i.m14*t.m42,i.m11*t.m13+i.m12*t.m23+i.m13*t.m33+i.m14*t.m43,i.m11*t.m14+i.m12*t.m24+i.m13*t.m34+i.m14*t.m44,i.m21*t.m11+i.m22*t.m21+i.m23*t.m31+i.m24*t.m41,i.m21*t.m12+i.m22*t.m22+i.m23*t.m32+i.m24*t.m42,i.m21*t.m13+i.m22*t.m23+i.m23*t.m33+i.m24*t.m43,i.m21*t.m14+i.m22*t.m24+i.m23*t.m34+i.m24*t.m44,i.m31*t.m11+i.m32*t.m21+i.m33*t.m31+i.m34*t.m41,i.m31*t.m12+i.m32*t.m22+i.m33*t.m32+i.m34*t.m42,i.m31*t.m13+i.m32*t.m23+i.m33*t.m33+i.m34*t.m43,i.m31*t.m14+i.m32*t.m24+i.m33*t.m34+i.m34*t.m44,i.m41*t.m11+i.m42*t.m21+i.m43*t.m31+i.m44*t.m41,i.m41*t.m12+i.m42*t.m22+i.m43*t.m32+i.m44*t.m42,i.m41*t.m13+i.m42*t.m23+i.m43*t.m33+i.m44*t.m43,i.m41*t.m14+i.m42*t.m24+i.m43*t.m34+i.m44*t.m44])}var u=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=this;if(i.a=1,i.b=0,i.c=0,i.d=1,i.e=0,i.f=0,i.m11=1,i.m12=0,i.m13=0,i.m14=0,i.m21=0,i.m22=1,i.m23=0,i.m24=0,i.m31=0,i.m32=0,i.m33=1,i.m34=0,i.m41=0,i.m42=0,i.m43=0,i.m44=1,e.length){var r=[16,6].some((function(t){return t===e.length}))?e:e[0];return i.setMatrixValue(r)}return i},p={isIdentity:{configurable:!0},is2D:{configurable:!0}};p.isIdentity.get=function(){var e=this;return 1===e.m11&&0===e.m12&&0===e.m13&&0===e.m14&&0===e.m21&&1===e.m22&&0===e.m23&&0===e.m24&&0===e.m31&&0===e.m32&&1===e.m33&&0===e.m34&&0===e.m41&&0===e.m42&&0===e.m43&&1===e.m44},p.is2D.get=function(){var e=this;return 0===e.m31&&0===e.m32&&1===e.m33&&0===e.m34&&0===e.m43&&1===e.m44},u.prototype.setMatrixValue=function(r){var n=this;return"string"==typeof r&&r.length&&"none"!==r?i(r):[Array,Float64Array,Float32Array].some((function(e){return r instanceof e}))?e(r):[u,DOMMatrix,Object].some((function(e){return r instanceof e}))?t(r):n},u.prototype.toFloat32Array=function(e){return Float32Array.from(r(this,e))},u.prototype.toFloat64Array=function(e){return Float64Array.from(r(this,e))},u.prototype.toString=function(){var e=this,t=e.is2D;return(t?"matrix":"matrix3d")+"("+e.toFloat64Array(t).join(", ")+")"},u.prototype.toJSON=function(){var e=this,t=e.is2D,i=e.isIdentity;return Object.assign({},e,{is2D:t,isIdentity:i})},u.prototype.multiply=function(e){return h(this,e)},u.prototype.translate=function(e,t,i){var r=t,o=i;return void 0===r&&(r=0),void 0===o&&(o=0),h(this,n(e,r,o))},u.prototype.scale=function(e,t,i){var r=t,n=i;return void 0===r&&(r=e),void 0===n&&(n=1),h(this,a(e,r,n))},u.prototype.rotate=function(e,t,i){var r=e,n=t||0,s=i||0;return"number"==typeof e&&void 0===t&&void 0===i&&(s=r,r=0,n=0),h(this,o(r,n,s))},u.prototype.rotateAxisAngle=function(e,t,i,r){if([e,t,i,r].some((function(e){return Number.isNaN(+e)})))throw new TypeError("CSSMatrix: expecting 4 values");return h(this,s(e,t,i,r))},u.prototype.skewX=function(e){return h(this,c(e))},u.prototype.skewY=function(e){return h(this,d(e))},u.prototype.skew=function(e,t){return h(this,l(e,t))},u.prototype.transformPoint=function(e){var t=this,i=t.m11*e.x+t.m21*e.y+t.m31*e.z+t.m41*e.w,r=t.m12*e.x+t.m22*e.y+t.m32*e.z+t.m42*e.w,n=t.m13*e.x+t.m23*e.y+t.m33*e.z+t.m43*e.w,o=t.m14*e.x+t.m24*e.y+t.m34*e.z+t.m44*e.w;return e instanceof DOMPoint?new DOMPoint(i,r,n,o):{x:i,y:r,z:n,w:o}},Object.defineProperties(u.prototype,p),Object.assign(u,{Translate:n,Rotate:o,RotateAxisAngle:s,Scale:a,SkewX:c,SkewY:d,Skew:l,Multiply:h,fromArray:e,fromMatrix:t,fromString:i,toArray:r});var m="1.0.3";return Object.assign(u,{Version:m}),u}()),dommatrix.exports}var ponyfill={exports:{}},hasRequiredPonyfill;function requirePonyfill(){return hasRequiredPonyfill||(hasRequiredPonyfill=1,function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function i(){}function r(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:void 0}var n=r();function o(e){return"object"==typeof e&&null!==e||"function"==typeof e}var s=i,a=Promise,l=Promise.prototype.then,c=Promise.resolve.bind(a),d=Promise.reject.bind(a);function h(e){return new a(e)}function u(e){return c(e)}function p(e){return d(e)}function m(e,t,i){return l.call(e,t,i)}function f(e,t,i){m(m(e,t,i),void 0,s)}function g(e,t){f(e,t)}function b(e,t){f(e,void 0,t)}function v(e,t,i){return m(e,t,i)}function y(e){m(e,void 0,s)}var w=function(){var e=n&&n.queueMicrotask;if("function"==typeof e)return e;var t=u(void 0);return function(e){return m(t,e)}}();function C(e,t,i){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,i)}function _(e,t,i){try{return u(C(e,t,i))}catch(e){return p(e)}}var E=16384,x=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 t=this._back,i=t;t._elements.length===E-1&&(i={_elements:[],_next:void 0}),t._elements.push(e),i!==t&&(this._back=i,t._next=i),++this._size},e.prototype.shift=function(){var e=this._front,t=e,i=this._cursor,r=i+1,n=e._elements,o=n[i];return r===E&&(t=e._next,r=0),--this._size,this._cursor=r,e!==t&&(this._front=t),n[i]=void 0,o},e.prototype.forEach=function(e){for(var t=this._cursor,i=this._front,r=i._elements;!(t===r.length&&void 0===i._next||t===r.length&&(t=0,0===(r=(i=i._next)._elements).length));)e(r[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function S(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?R(e):"closed"===t._state?M(e):P(e,t._storedError)}function A(e,t){return xr(e._ownerReadableStream,t)}function k(e){"readable"===e._ownerReadableStream._state?F(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):D(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 T(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function R(e){e._closedPromise=h((function(t,i){e._closedPromise_resolve=t,e._closedPromise_reject=i}))}function P(e,t){R(e),F(e,t)}function M(e){R(e),O(e)}function F(e,t){void 0!==e._closedPromise_reject&&(y(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function D(e,t){P(e,t)}function O(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var L=t("[[AbortSteps]]"),I=t("[[ErrorSteps]]"),N=t("[[CancelSteps]]"),j=t("[[PullSteps]]"),H=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},z=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function B(e){return"object"==typeof e||"function"==typeof e}function W(e,t){if(void 0!==e&&!B(e))throw new TypeError(t+" is not an object.")}function U(e,t){if("function"!=typeof e)throw new TypeError(t+" is not a function.")}function $(e){return"object"==typeof e&&null!==e||"function"==typeof e}function V(e,t){if(!$(e))throw new TypeError(t+" is not an object.")}function G(e,t,i){if(void 0===e)throw new TypeError("Parameter "+t+" is required in '"+i+"'.")}function q(e,t,i){if(void 0===e)throw new TypeError(t+" is required in '"+i+"'.")}function K(e){return Number(e)}function X(e){return 0===e?0:e}function J(e){return X(z(e))}function Y(e,t){var i=0,r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=X(n),!H(n))throw new TypeError(t+" is not a finite number");if((n=J(n))<i||n>r)throw new TypeError(t+" is outside the accepted range of "+i+" to "+r+", inclusive");return H(n)&&0!==n?n:0}function Q(e,t){if(!_r(e))throw new TypeError(t+" is not a ReadableStream.")}function Z(e){return new se(e)}function ee(e,t){e._reader._readRequests.push(t)}function te(e,t,i){var r=e._reader._readRequests.shift();i?r._closeSteps():r._chunkSteps(t)}function ie(e){return e._reader._readRequests.length}function re(e){var t=e._reader;return void 0!==t&&!!ae(t)}var ne,oe,se=function(){function e(e){if(G(e,1,"ReadableStreamDefaultReader"),Q(e,"First parameter"),Er(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");S(this,e),this._readRequests=new x}return Object.defineProperty(e.prototype,"closed",{get:function(){return ae(this)?this._closedPromise:p(ce("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),ae(this)?void 0===this._ownerReadableStream?p(T("cancel")):A(this,e):p(ce("cancel"))},e.prototype.read=function(){if(!ae(this))return p(ce("read"));if(void 0===this._ownerReadableStream)return p(T("read from"));var e,t,i=h((function(i,r){e=i,t=r})),r={_chunkSteps:function(t){return e({value:t,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return t(e)}};return le(this,r),i},e.prototype.releaseLock=function(){if(!ae(this))throw ce("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");k(this)}},e}();function ae(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof se}function le(e,t){var i=e._ownerReadableStream;i._disturbed=!0,"closed"===i._state?t._closeSteps():"errored"===i._state?t._errorSteps(i._storedError):i._readableStreamController[j](t)}function ce(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(se.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(se.prototype,t.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof t.asyncIterator&&((ne={})[t.asyncIterator]=function(){return this},oe=ne,Object.defineProperty(oe,t.asyncIterator,{enumerable:!1}));var de=function(){function e(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}return e.prototype.next=function(){var e=this,t=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,t,t):t(),this._ongoingPromise},e.prototype.return=function(e){var t=this,i=function(){return t._returnSteps(e)};return this._ongoingPromise?v(this._ongoingPromise,i,i):i()},e.prototype._nextSteps=function(){var e=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var t,i,r=this._reader;if(void 0===r._ownerReadableStream)return p(T("iterate"));var n=h((function(e,r){t=e,i=r}));return le(r,{_chunkSteps:function(i){e._ongoingPromise=void 0,w((function(){return t({value:i,done:!1})}))},_closeSteps:function(){e._ongoingPromise=void 0,e._isFinished=!0,k(r),t({value:void 0,done:!0})},_errorSteps:function(t){e._ongoingPromise=void 0,e._isFinished=!0,k(r),i(t)}}),n},e.prototype._returnSteps=function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var t=this._reader;if(void 0===t._ownerReadableStream)return p(T("finish iterating"));if(!this._preventCancel){var i=A(t,e);return k(t),v(i,(function(){return{value:e,done:!0}}))}return k(t),u({value:e,done:!0})},e}(),he={next:function(){return pe(this)?this._asyncIteratorImpl.next():p(me("next"))},return:function(e){return pe(this)?this._asyncIteratorImpl.return(e):p(me("return"))}};function ue(e,t){var i=Z(e),r=new de(i,t),n=Object.create(he);return n._asyncIteratorImpl=r,n}function pe(e){if(!o(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof de}catch(e){return!1}}function me(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}void 0!==oe&&Object.setPrototypeOf(he,oe);var fe=Number.isNaN||function(e){return e!=e};function ge(e){return e.slice()}function be(e,t,i,r,n){new Uint8Array(e).set(new Uint8Array(i,r,n),t)}function ve(e){return e}function ye(e){return!1}function we(e,t,i){if(e.slice)return e.slice(t,i);var r=i-t,n=new ArrayBuffer(r);return be(n,0,e,t,r),n}function Ce(e){return!("number"!=typeof e||fe(e)||e<0)}function _e(e){var t=we(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function Ee(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function xe(e,t,i){if(!Ce(i)||i===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:i}),e._queueTotalSize+=i}function Se(e){return e._queue.peek().value}function Ae(e){e._queue=new x,e._queueTotalSize=0}var ke=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!Pe(this))throw nt("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(e){if(!Pe(this))throw nt("respond");if(G(e,1,"respond"),e=Y(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");ye(this._view.buffer),Ze(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!Pe(this))throw nt("respondWithNewView");if(G(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");ye(e.buffer),et(this._associatedReadableByteStreamController,e)},e}();Object.defineProperties(ke.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ke.prototype,t.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Te=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!Re(this))throw ot("byobRequest");return Ye(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Re(this))throw ot("desiredSize");return Qe(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!Re(this))throw ot("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");Ke(this)},e.prototype.enqueue=function(e){if(!Re(this))throw ot("enqueue");if(G(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 t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");Xe(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!Re(this))throw ot("error");Je(this,e)},e.prototype[N]=function(e){Fe(this),Ae(this);var t=this._cancelAlgorithm(e);return qe(this),t},e.prototype[j]=function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var i=this._queue.shift();this._queueTotalSize-=i.byteLength,je(this);var r=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);e._chunkSteps(r)}else{var n=this._autoAllocateChunkSize;if(void 0!==n){var o=void 0;try{o=new ArrayBuffer(n)}catch(t){return void e._errorSteps(t)}var s={buffer:o,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}ee(t,e),Me(this)}},e}();function Re(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Te}function Pe(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ke}function Me(e){Ge(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,f(e._pullAlgorithm(),(function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Me(e))}),(function(t){Je(e,t)}))))}function Fe(e){He(e),e._pendingPullIntos=new x}function De(e,t){var i=!1;"closed"===e._state&&(i=!0);var r=Oe(t);"default"===t.readerType?te(e,r,i):lt(e,r,i)}function Oe(e){var t=e.bytesFilled,i=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/i)}function Le(e,t,i,r){e._queue.push({buffer:t,byteOffset:i,byteLength:r}),e._queueTotalSize+=r}function Ie(e,t){var i=t.elementSize,r=t.bytesFilled-t.bytesFilled%i,n=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),o=t.bytesFilled+n,s=o-o%i,a=n,l=!1;s>r&&(a=s-t.bytesFilled,l=!0);for(var c=e._queue;a>0;){var d=c.peek(),h=Math.min(a,d.byteLength),u=t.byteOffset+t.bytesFilled;be(t.buffer,u,d.buffer,d.byteOffset,h),d.byteLength===h?c.shift():(d.byteOffset+=h,d.byteLength-=h),e._queueTotalSize-=h,Ne(e,h,t),a-=h}return l}function Ne(e,t,i){i.bytesFilled+=t}function je(e){0===e._queueTotalSize&&e._closeRequested?(qe(e),Sr(e._controlledReadableByteStream)):Me(e)}function He(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function ze(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();Ie(e,t)&&(Ve(e),De(e._controlledReadableByteStream,t))}}function Be(e,t,i){var r=e._controlledReadableByteStream,n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);var o=t.constructor,s=ve(t.buffer),a={buffer:s,bufferByteLength:s.byteLength,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,viewConstructor:o,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(a),void at(r,i);if("closed"!==r._state){if(e._queueTotalSize>0){if(Ie(e,a)){var l=Oe(a);return je(e),void i._chunkSteps(l)}if(e._closeRequested){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return Je(e,c),void i._errorSteps(c)}}e._pendingPullIntos.push(a),at(r,i),Me(e)}else{var d=new o(a.buffer,a.byteOffset,0);i._closeSteps(d)}}function We(e,t){var i=e._controlledReadableByteStream;if(dt(i))for(;ct(i)>0;)De(i,Ve(e))}function Ue(e,t,i){if(Ne(e,t,i),!(i.bytesFilled<i.elementSize)){Ve(e);var r=i.bytesFilled%i.elementSize;if(r>0){var n=i.byteOffset+i.bytesFilled,o=we(i.buffer,n-r,n);Le(e,o,0,o.byteLength)}i.bytesFilled-=r,De(e._controlledReadableByteStream,i),ze(e)}}function $e(e,t){var i=e._pendingPullIntos.peek();He(e),"closed"===e._controlledReadableByteStream._state?We(e):Ue(e,t,i),Me(e)}function Ve(e){return e._pendingPullIntos.shift()}function Ge(e){var t=e._controlledReadableByteStream;return"readable"===t._state&&!e._closeRequested&&!!e._started&&(!!(re(t)&&ie(t)>0)||!!(dt(t)&&ct(t)>0)||Qe(e)>0)}function qe(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ke(e){var t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){var i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Je(e,i),i}qe(e),Sr(t)}}function Xe(e,t){var i=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===i._state){var r=t.buffer,n=t.byteOffset,o=t.byteLength,s=ve(r);if(e._pendingPullIntos.length>0){var a=e._pendingPullIntos.peek();ye(a.buffer),a.buffer=ve(a.buffer)}He(e),re(i)?0===ie(i)?Le(e,s,n,o):(e._pendingPullIntos.length>0&&Ve(e),te(i,new Uint8Array(s,n,o),!1)):dt(i)?(Le(e,s,n,o),ze(e)):Le(e,s,n,o),Me(e)}}function Je(e,t){var i=e._controlledReadableByteStream;"readable"===i._state&&(Fe(e),Ae(e),qe(e),Ar(i,t))}function Ye(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){var t=e._pendingPullIntos.peek(),i=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=Object.create(ke.prototype);rt(r,e,i),e._byobRequest=r}return e._byobRequest}function Qe(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Ze(e,t){var i=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(i.bytesFilled+t>i.byteLength)throw new RangeError("bytesWritten out of range")}i.buffer=ve(i.buffer),$e(e,t)}function et(e,t){var i=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(i.byteOffset+i.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(i.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(i.bytesFilled+t.byteLength>i.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var r=t.byteLength;i.buffer=ve(t.buffer),$e(e,r)}function tt(e,t,i,r,n,o,s){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,Ae(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=o,t._pullAlgorithm=r,t._cancelAlgorithm=n,t._autoAllocateChunkSize=s,t._pendingPullIntos=new x,e._readableStreamController=t,f(u(i()),(function(){t._started=!0,Me(t)}),(function(e){Je(t,e)}))}function it(e,t,i){var r=Object.create(Te.prototype),n=function(){},o=function(){return u(void 0)},s=function(){return u(void 0)};void 0!==t.start&&(n=function(){return t.start(r)}),void 0!==t.pull&&(o=function(){return t.pull(r)}),void 0!==t.cancel&&(s=function(e){return t.cancel(e)});var a=t.autoAllocateChunkSize;if(0===a)throw new TypeError("autoAllocateChunkSize must be greater than 0");tt(e,r,n,o,s,i,a)}function rt(e,t,i){e._associatedReadableByteStreamController=t,e._view=i}function nt(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function ot(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function st(e){return new ht(e)}function at(e,t){e._reader._readIntoRequests.push(t)}function lt(e,t,i){var r=e._reader._readIntoRequests.shift();i?r._closeSteps(t):r._chunkSteps(t)}function ct(e){return e._reader._readIntoRequests.length}function dt(e){var t=e._reader;return void 0!==t&&!!ut(t)}Object.defineProperties(Te.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Te.prototype,t.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var ht=function(){function e(e){if(G(e,1,"ReadableStreamBYOBReader"),Q(e,"First parameter"),Er(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Re(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");S(this,e),this._readIntoRequests=new x}return Object.defineProperty(e.prototype,"closed",{get:function(){return ut(this)?this._closedPromise:p(mt("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return void 0===e&&(e=void 0),ut(this)?void 0===this._ownerReadableStream?p(T("cancel")):A(this,e):p(mt("cancel"))},e.prototype.read=function(e){if(!ut(this))return p(mt("read"));if(!ArrayBuffer.isView(e))return p(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return p(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return p(new TypeError("view's buffer must have non-zero byteLength"));if(ye(e.buffer),void 0===this._ownerReadableStream)return p(T("read from"));var t,i,r=h((function(e,r){t=e,i=r})),n={_chunkSteps:function(e){return t({value:e,done:!1})},_closeSteps:function(e){return t({value:e,done:!0})},_errorSteps:function(e){return i(e)}};return pt(this,e,n),r},e.prototype.releaseLock=function(){if(!ut(this))throw mt("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");k(this)}},e}();function ut(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof ht}function pt(e,t,i){var r=e._ownerReadableStream;r._disturbed=!0,"errored"===r._state?i._errorSteps(r._storedError):Be(r._readableStreamController,t,i)}function mt(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function ft(e,t){var i=e.highWaterMark;if(void 0===i)return t;if(fe(i)||i<0)throw new RangeError("Invalid highWaterMark");return i}function gt(e){var t=e.size;return t||function(){return 1}}function bt(e,t){W(e,t);var i=null==e?void 0:e.highWaterMark,r=null==e?void 0:e.size;return{highWaterMark:void 0===i?void 0:K(i),size:void 0===r?void 0:vt(r,t+" has member 'size' that")}}function vt(e,t){return U(e,t),function(t){return K(e(t))}}function yt(e,t){W(e,t);var i=null==e?void 0:e.abort,r=null==e?void 0:e.close,n=null==e?void 0:e.start,o=null==e?void 0:e.type,s=null==e?void 0:e.write;return{abort:void 0===i?void 0:wt(i,e,t+" has member 'abort' that"),close:void 0===r?void 0:Ct(r,e,t+" has member 'close' that"),start:void 0===n?void 0:_t(n,e,t+" has member 'start' that"),write:void 0===s?void 0:Et(s,e,t+" has member 'write' that"),type:o}}function wt(e,t,i){return U(e,i),function(i){return _(e,t,[i])}}function Ct(e,t,i){return U(e,i),function(){return _(e,t,[])}}function _t(e,t,i){return U(e,i),function(i){return C(e,t,[i])}}function Et(e,t,i){return U(e,i),function(i,r){return _(e,t,[i,r])}}function xt(e,t){if(!Ft(e))throw new TypeError(t+" is not a WritableStream.")}function St(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}Object.defineProperties(ht.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ht.prototype,t.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var At="function"==typeof AbortController;function kt(){if(At)return new AbortController}var Tt=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:V(e,"First parameter");var i=bt(t,"Second parameter"),r=yt(e,"First parameter");if(Mt(this),void 0!==r.type)throw new RangeError("Invalid type is specified");var n=gt(i);di(this,r,ft(i,1),n)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Ft(this))throw _i("locked");return Dt(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Ft(this)?Dt(this)?p(new TypeError("Cannot abort a stream that already has a writer")):Ot(this,e):p(_i("abort"))},e.prototype.close=function(){return Ft(this)?Dt(this)?p(new TypeError("Cannot close a stream that already has a writer")):$t(this)?p(new TypeError("Cannot close an already-closing stream")):Lt(this):p(_i("close"))},e.prototype.getWriter=function(){if(!Ft(this))throw _i("getWriter");return Rt(this)},e}();function Rt(e){return new Jt(e)}function Pt(e,t,i,r,n,o){void 0===n&&(n=1),void 0===o&&(o=function(){return 1});var s=Object.create(Tt.prototype);return Mt(s),ci(s,Object.create(ai.prototype),e,t,i,r,n,o),s}function Mt(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new x,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function Ft(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Tt}function Dt(e){return void 0!==e._writer}function Ot(e,t){var i;if("closed"===e._state||"errored"===e._state)return u(void 0);e._writableStreamController._abortReason=t,null===(i=e._writableStreamController._abortController)||void 0===i||i.abort();var r=e._state;if("closed"===r||"errored"===r)return u(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var o=h((function(i,r){e._pendingAbortRequest={_promise:void 0,_resolve:i,_reject:r,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=o,n||jt(e,t),o}function Lt(e){var t=e._state;if("closed"===t||"errored"===t)return p(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var i=h((function(t,i){var r={_resolve:t,_reject:i};e._closeRequest=r})),r=e._writer;return void 0!==r&&e._backpressure&&"writable"===t&&ji(r),ui(e._writableStreamController),i}function It(e){return h((function(t,i){var r={_resolve:t,_reject:i};e._writeRequests.push(r)}))}function Nt(e,t){"writable"!==e._state?Ht(e):jt(e,t)}function jt(e,t){var i=e._writableStreamController;e._state="erroring",e._storedError=t;var r=e._writer;void 0!==r&&ii(r,t),!Vt(e)&&i._started&&Ht(e)}function Ht(e){e._state="errored",e._writableStreamController[I]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new x,void 0!==e._pendingAbortRequest){var i=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,i._wasAlreadyErroring)return i._reject(t),void Kt(e);f(e._writableStreamController[L](i._reason),(function(){i._resolve(),Kt(e)}),(function(t){i._reject(t),Kt(e)}))}else Kt(e)}function zt(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function Bt(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,Nt(e,t)}function Wt(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 t=e._writer;void 0!==t&&Mi(t)}function Ut(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),Nt(e,t)}function $t(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Vt(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}function Gt(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function qt(e){e._inFlightWriteRequest=e._writeRequests.shift()}function Kt(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&Ri(t,e._storedError)}function Xt(e,t){var i=e._writer;void 0!==i&&t!==e._backpressure&&(t?Ii(i):ji(i)),e._backpressure=t}Object.defineProperties(Tt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Tt.prototype,t.toStringTag,{value:"WritableStream",configurable:!0});var Jt=function(){function e(e){if(G(e,1,"WritableStreamDefaultWriter"),xt(e,"First parameter"),Dt(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t=e._state;if("writable"===t)!$t(e)&&e._backpressure?Fi(this):Oi(this),Ai(this);else if("erroring"===t)Di(this,e._storedError),Ai(this);else if("closed"===t)Oi(this),Ti(this);else{var i=e._storedError;Di(this,i),ki(this,i)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return Yt(this)?this._closedPromise:p(xi("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Yt(this))throw xi("desiredSize");if(void 0===this._ownerWritableStream)throw Si("desiredSize");return ri(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return Yt(this)?this._readyPromise:p(xi("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return void 0===e&&(e=void 0),Yt(this)?void 0===this._ownerWritableStream?p(Si("abort")):Qt(this,e):p(xi("abort"))},e.prototype.close=function(){if(!Yt(this))return p(xi("close"));var e=this._ownerWritableStream;return void 0===e?p(Si("close")):$t(e)?p(new TypeError("Cannot close an already-closing stream")):Zt(this)},e.prototype.releaseLock=function(){if(!Yt(this))throw xi("releaseLock");void 0!==this._ownerWritableStream&&ni(this)},e.prototype.write=function(e){return void 0===e&&(e=void 0),Yt(this)?void 0===this._ownerWritableStream?p(Si("write to")):oi(this,e):p(xi("write"))},e}();function Yt(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Jt}function Qt(e,t){return Ot(e._ownerWritableStream,t)}function Zt(e){return Lt(e._ownerWritableStream)}function ei(e){var t=e._ownerWritableStream,i=t._state;return $t(t)||"closed"===i?u(void 0):"errored"===i?p(t._storedError):Zt(e)}function ti(e,t){"pending"===e._closedPromiseState?Ri(e,t):Pi(e,t)}function ii(e,t){"pending"===e._readyPromiseState?Li(e,t):Ni(e,t)}function ri(e){var t=e._ownerWritableStream,i=t._state;return"errored"===i||"erroring"===i?null:"closed"===i?0:mi(t._writableStreamController)}function ni(e){var t=e._ownerWritableStream,i=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ii(e,i),ti(e,i),t._writer=void 0,e._ownerWritableStream=void 0}function oi(e,t){var i=e._ownerWritableStream,r=i._writableStreamController,n=pi(r,t);if(i!==e._ownerWritableStream)return p(Si("write to"));var o=i._state;if("errored"===o)return p(i._storedError);if($t(i)||"closed"===o)return p(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===o)return p(i._storedError);var s=It(i);return fi(r,t,n),s}Object.defineProperties(Jt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Jt.prototype,t.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var si={},ai=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"abortReason",{get:function(){if(!li(this))throw Ei("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"signal",{get:function(){if(!li(this))throw Ei("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),e.prototype.error=function(e){if(void 0===e&&(e=void 0),!li(this))throw Ei("error");"writable"===this._controlledWritableStream._state&&Ci(this,e)},e.prototype[L]=function(e){var t=this._abortAlgorithm(e);return hi(this),t},e.prototype[I]=function(){Ae(this)},e}();function li(e){return!!o(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof ai}function ci(e,t,i,r,n,o,s,a){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,Ae(t),t._abortReason=void 0,t._abortController=kt(),t._started=!1,t._strategySizeAlgorithm=a,t._strategyHWM=s,t._writeAlgorithm=r,t._closeAlgorithm=n,t._abortAlgorithm=o;var l=wi(t);Xt(e,l),f(u(i()),(function(){t._started=!0,gi(t)}),(function(i){t._started=!0,Nt(e,i)}))}function di(e,t,i,r){var n=Object.create(ai.prototype),o=function(){},s=function(){return u(void 0)},a=function(){return u(void 0)},l=function(){return u(void 0)};void 0!==t.start&&(o=function(){return t.start(n)}),void 0!==t.write&&(s=function(e){return t.write(e,n)}),void 0!==t.close&&(a=function(){return t.close()}),void 0!==t.abort&&(l=function(e){return t.abort(e)}),ci(e,n,o,s,a,l,i,r)}function hi(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ui(e){xe(e,si,0),gi(e)}function pi(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return bi(e,t),1}}function mi(e){return e._strategyHWM-e._queueTotalSize}function fi(e,t,i){try{xe(e,t,i)}catch(t){return void bi(e,t)}var r=e._controlledWritableStream;$t(r)||"writable"!==r._state||Xt(r,wi(e)),gi(e)}function gi(e){var t=e._controlledWritableStream;if(e._started&&void 0===t._inFlightWriteRequest)if("erroring"!==t._state){if(0!==e._queue.length){var i=Se(e);i===si?vi(e):yi(e,i)}}else Ht(t)}function bi(e,t){"writable"===e._controlledWritableStream._state&&Ci(e,t)}function vi(e){var t=e._controlledWritableStream;Gt(t),Ee(e);var i=e._closeAlgorithm();hi(e),f(i,(function(){Wt(t)}),(function(e){Ut(t,e)}))}function yi(e,t){var i=e._controlledWritableStream;qt(i),f(e._writeAlgorithm(t),(function(){zt(i);var t=i._state;if(Ee(e),!$t(i)&&"writable"===t){var r=wi(e);Xt(i,r)}gi(e)}),(function(t){"writable"===i._state&&hi(e),Bt(i,t)}))}function wi(e){return mi(e)<=0}function Ci(e,t){var i=e._controlledWritableStream;hi(e),jt(i,t)}function _i(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function Ei(e){return new TypeError("WritableStreamDefaultController.prototype."+e+" can only be used on a WritableStreamDefaultController")}function xi(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function Si(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Ai(e){e._closedPromise=h((function(t,i){e._closedPromise_resolve=t,e._closedPromise_reject=i,e._closedPromiseState="pending"}))}function ki(e,t){Ai(e),Ri(e,t)}function Ti(e){Ai(e),Mi(e)}function Ri(e,t){void 0!==e._closedPromise_reject&&(y(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Pi(e,t){ki(e,t)}function Mi(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 Fi(e){e._readyPromise=h((function(t,i){e._readyPromise_resolve=t,e._readyPromise_reject=i})),e._readyPromiseState="pending"}function Di(e,t){Fi(e),Li(e,t)}function Oi(e){Fi(e),ji(e)}function Li(e,t){void 0!==e._readyPromise_reject&&(y(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Ii(e){Fi(e)}function Ni(e,t){Di(e,t)}function ji(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(ai.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ai.prototype,t.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Hi="undefined"!=typeof DOMException?DOMException:void 0;function zi(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}function Bi(){var e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}var Wi=zi(Hi)?Hi:Bi();function Ui(e,t,r,n,o,s){var a=Z(e),l=Rt(t);e._disturbed=!0;var c=!1,d=u(void 0);return h((function(p,v){var w;if(void 0!==s){if(w=function(){var i=new Wi("Aborted","AbortError"),r=[];n||r.push((function(){return"writable"===t._state?Ot(t,i):u(void 0)})),o||r.push((function(){return"readable"===e._state?xr(e,i):u(void 0)})),T((function(){return Promise.all(r.map((function(e){return e()})))}),!0,i)},s.aborted)return void w();s.addEventListener("abort",w)}function C(){return h((function(e,t){function i(r){r?e():m(_(),i,t)}i(!1)}))}function _(){return c?u(!0):m(l._readyPromise,(function(){return h((function(e,t){le(a,{_chunkSteps:function(t){d=m(oi(l,t),void 0,i),e(!1)},_closeSteps:function(){return e(!0)},_errorSteps:t})}))}))}if(S(e,a._closedPromise,(function(e){n?R(!0,e):T((function(){return Ot(t,e)}),!0,e)})),S(t,l._closedPromise,(function(t){o?R(!0,t):T((function(){return xr(e,t)}),!0,t)})),A(e,a._closedPromise,(function(){r?R():T((function(){return ei(l)}))})),$t(t)||"closed"===t._state){var E=new TypeError("the destination writable stream closed before all data could be piped to it");o?R(!0,E):T((function(){return xr(e,E)}),!0,E)}function x(){var e=d;return m(d,(function(){return e!==d?x():void 0}))}function S(e,t,i){"errored"===e._state?i(e._storedError):b(t,i)}function A(e,t,i){"closed"===e._state?i():g(t,i)}function T(e,i,r){function n(){f(e(),(function(){return P(i,r)}),(function(e){return P(!0,e)}))}c||(c=!0,"writable"!==t._state||$t(t)?n():g(x(),n))}function R(e,i){c||(c=!0,"writable"!==t._state||$t(t)?P(e,i):g(x(),(function(){return P(e,i)})))}function P(e,t){ni(l