UNPKG

theoplayer

Version:

THEOplayer is the universal video player solution, enabling you to quickly deliver cross-platform content playback.

39 lines (31 loc) 2.24 MB
/*! THEOplayer Usage of this software is limited by the THEOplayer License. It is prohibited to reverse engineer, decompile, translate, disassemble, decipher, decrypt, or otherwise attempt to discover the source code of this software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, visit https://www.theoplayer.com or contact contact @ theoplayer . com This product makes use of Open Source Software: long.js (Apache 2.0), promise-polyfill (MIT - Copyright (c) 2014 Taylor Hakes & Forbes Lindesay), shaka-player (Apache 2.0 - Copyright 2016 Google LLC) The code of these projects has been heavily modified during integration. More information on the licenses can be found here: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0), MIT (https://opensource.org/licenses/MIT) THEOplayer is based on patented technology developed by THEO Technologies (https://www.theoplayer.com). Version: 10.8.0 Created: 2026-01-15T14:16:26.308Z */ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(t):"function"==typeof define&&define.amd?define([],function(){return i(t)}):t.THEOplayer=i(t)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof s?s:"undefined"!=typeof global?global:this,function(t){"use strict";var i,n,r,e,s,u,o,h,c,a={exports:{}},f=(a.exports,t.window),v=t.document,d=t.location,l=t.navigator,g=t.setTimeout,w=t.clearTimeout,_=t.setInterval,m=t.clearInterval,y=t.Error,p=t.TypeError,k=(t.SyntaxError,t.Object),b=t.Math,A=t.parseInt,T=t.parseFloat,S=t.isNaN,E=t.Uint8Array,I=t.Worker,R=(t.WorkerGlobalScope,t.XMLHttpRequest),C=k.create,P=k.defineProperty,D=k.getOwnPropertyDescriptor,N=k.getOwnPropertyNames,x=k.getPrototypeOf,B=k.prototype.hasOwnProperty,O=function(t,i){return function(){return t&&(i=t(t=0)),i}},M=function(t,i){return function(){return i||t((i={exports:{}}).exports,i),i.exports}},L=function(t,i,n,r){if(i&&"object"==typeof i||"function"==typeof i)for(var e,s=N(i),u=0,o=s.length;u<o;u++)e=s[u],B.call(t,e)||e===n||P(t,e,{get:function(t){return i[t]}.bind(null,e),enumerable:!(r=D(i,e))||r.enumerable});return t},F=function(t,i,n){return n=null!=t?C(x(t)):{},L(!i&&t&&t.__esModule?n:P(n,"default",{value:t,enumerable:!0}),t)},U=O(function(){"function"==typeof Symbol&&Symbol.iterator?(i=Symbol,n=null!=(u=Symbol.for)?u:Symbol,r=Symbol.iterator,e=null!=(o=Symbol.dispose)?o:n("Symbol.dispose"),s=null!=(h=Symbol.asyncDispose)?h:n("Symbol.asyncDispose")):(c=0,i=function(t){return"hd"+t+"_"+ ++c},r=(n=function(t){return"hd"+t})("Symbol.iterator"),e=n("Symbol.dispose"),s=n("Symbol.asyncDispose"),i.for=n,i.iterator=r,i.dispose=e,i.asyncDispose=s)});function V(t,n){return null!=n&&void 0!==i&&n[i.hasInstance]?!!n[i.hasInstance](t):t instanceof n}var H=O(function(){U(),Et()});function W(t){return t&&void 0!==i&&t.constructor===i?"symbol":typeof t}var z,q,X,G,j,Q,Y,K,J,Z,tt,it,nt,rt,et,st,ut,ot,ht,ct,at=O(function(){U(),Et()});function ft(t){var i=this.constructor;return this.then(function(n){return i.resolve(t()).then(function(){return n})},function(n){return i.resolve(t()).then(function(){return i.reject(n)})})}function vt(t){return new this(function(i,n){if(!t||void 0===t.length)return n(new p((void 0===t?"undefined":W(t))+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return i([]);var e=r.length;function s(t,n){if(n&&("object"===(void 0===n?"undefined":W(n))||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,function(i){s(t,i)},function(n){r[t]={status:"rejected",reason:n},0===--e&&i(r)})}r[t]={status:"fulfilled",value:n},0===--e&&i(r)}for(var u=0;u<r.length;u++)s(u,r[u])})}function dt(t){return Boolean(t&&void 0!==t.length)}function lt(){}function gt(t){if(!V(this,gt))throw new p("Promises must be constructed via new");if("function"!=typeof t)throw new p("not a function");this.Ua=0,this.IEi=!1,this.fkt=void 0,this.REi=[],kt(t,this)}function wt(t,i){for(;3===t.Ua;)t=t.fkt;0!==t.Ua?(t.IEi=!0,gt.CEi(function(){var n=1===t.Ua?i.onFulfilled:i.onRejected;if(null!==n){var r;try{r=n(t.fkt)}catch(t){return void mt(i.promise,t)}_t(i.promise,r)}else(1===t.Ua?_t:mt)(i.promise,t.fkt)})):t.REi.push(i)}function _t(t,i){try{if(i===t)throw new p("A promise cannot be resolved with itself.");if(i&&("object"===(void 0===i?"undefined":W(i))||"function"==typeof i)){var n=i.then;if(V(i,gt))return t.Ua=3,t.fkt=i,void yt(t);if("function"==typeof n)return void kt(function(t,i){return function(){t.apply(i,arguments)}}(n,i),t)}t.Ua=1,t.fkt=i,yt(t)}catch(i){mt(t,i)}}function mt(t,i){t.Ua=2,t.fkt=i,yt(t)}function yt(t){2===t.Ua&&0===t.REi.length&&gt.CEi(function(){t.IEi||gt.PEi(t.fkt)});for(var i=0,n=t.REi.length;i<n;i++)wt(t,t.REi[i]);t.REi=null}function pt(t,i,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof i?i:null,this.promise=n}function kt(t,i){var n=!1;try{t(function(t){n||(n=!0,_t(i,t))},function(t){n||(n=!0,mt(i,t))})}catch(t){if(n)return;n=!0,mt(i,t)}}function bt(t){return new it(tt,{reason:t,promise:q.reject(t).catch(function(){}),cancelable:!0})}function At(t){var i=new nt(tt,{detail:{reason:t},cancelable:!0});return k.defineProperty(i,"reason",{value:t}),i}function Tt(t){var i=v.createEvent("CustomEvent");return i.initCustomEvent(tt,!1,!0,{reason:t}),i}var St=O(function(){var t,i,n,r;U(),Et(),H(),at(),z=g,gt.prototype.catch=function(t){return this.then(null,t)},gt.prototype.then=function(t,i){var n=new this.constructor(lt);return wt(this,new pt(t,i,n)),n},gt.prototype.finally=ft,gt.all=function(t){return new gt(function(i,n){if(!dt(t))return n(new p("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return i([]);var e=r.length;function s(t,u){try{if(u&&("object"===(void 0===u?"undefined":W(u))||"function"==typeof u)){var o=u.then;if("function"==typeof o)return void o.call(u,function(i){s(t,i)},n)}r[t]=u,0===--e&&i(r)}catch(t){n(t)}}for(var u=0;u<r.length;u++)s(u,r[u])})},gt.allSettled=vt,gt.resolve=function(t){return t&&"object"===(void 0===t?"undefined":W(t))&&t.constructor===gt?t:new gt(function(i){i(t)})},gt.reject=function(t){return new gt(function(i,n){n(t)})},gt.race=function(t){return new gt(function(i,n){if(!dt(t))return n(new p("Promise.race accepts an array"));for(var r=0,e=t.length;r<e;r++)gt.resolve(t[r]).then(i,n)})},gt.CEi="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){z(t,0)},gt.PEi=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},q=function(){var t=self.Promise;if(void 0!==t)try{if(-1!==t.toString().indexOf("[native code]"))return t}catch(t){}}(),X=l?l.userAgent:"",G=X.match(/Firefox\/([0-9]+)/i),j=null!=G,Q=G?Number(G[1]):0,Y=X.match(/(Version)\/((\d+)\.(\d+)(?:\.(\d+))?).*Safari/),K=null!=Y,J=Y?Number(Y[3]):0,Z=function(){function t(t){this.Ab=0,this.Wd=0,this.Kp=[],this.DEi=t}return t.prototype.NEi=function(t){var i=this.length();this.xEi(i+1);var n=this.Wd+i&this.DEi-1;this.Kp[n]=t,this.Ab=i+1},t.prototype.push=function(t){var i=this.length()+1;if(this.DEi<i)this.NEi(t);else{var n=this.Wd+i-1,r=this.DEi-1;this.Kp[n&r]=t,this.Ab=i}},t.prototype.shift=function(){var t=this.Wd,i=this.Kp[t];return this.Kp[t]=void 0,this.Wd=t+1&this.DEi-1,this.Ab--,i},t.prototype.length=function(){return this.Ab},t.prototype.xEi=function(t){this.DEi<t&&this.BEi(this.DEi<<1)},t.prototype.BEi=function(t){var i=this.DEi;this.DEi=t;var n=this.Wd+this.Ab&i-1;!function(t,i,n,r){for(var e=0;e<r;++e)t[e+n]=t[e+i],t[e+i]=void 0}(this.Kp,0,i,n)},t}(),tt="unhandledrejection",it=self.PromiseRejectionEvent,nt=self.CustomEvent,rt=function(t){return rt=function(){try{var t=q.resolve(),i="error",n=new it(tt,{reason:i,promise:t});return tt===n.type&&i===n.reason}catch(t){}return!1}()?bt:function(){try{var t="error",i=new nt(tt,{detail:{reason:t}});return tt===i.type&&t===i.detail.reason}catch(t){}return!1}()?At:Tt,rt(t)},st=j&&Q<60||K&&J<15,q&&!st?(ut=q,ot=function(){}):(ut=gt,ht=null!==(et=function(){var t=self.queueMicrotask;if("function"==typeof t)return function(i){return t(i)};var i=q;if(i&&"function"==typeof i.resolve){var n=i.resolve();return function(t){return n.then(t)}}}())&&void 0!==et?et:gt.CEi,t=ht,i=new Z(16),n=!1,ot=(ct={n8:function(e){i.push(e),n||(n=!0,t(r))},UQ:r=function(){for(;i.length()>0;)i.shift()();n=!1}}).UQ,gt.CEi=ct.n8,gt.PEi=function(t){try{var i=rt(t);if(!self.dispatchEvent(i)||i.defaultPrevented)return}catch(t){}g(function(){throw new y("Unhandled promise rejection: ".concat(t))},0)})}),Et=O(function(){St()});function It(t,i){return(It=k.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}var Rt=O(function(){U(),Et()});function Ct(t,i){if("function"!=typeof i&&null!==i)throw new p("Super expression must either be null or a function");t.prototype=k.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&It(t,i)}var Pt=O(function(){U(),Et(),Rt()});function Dt(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),k.defineProperty(t,r.key,r)}}function Nt(t,i,n){return i&&Dt(t.prototype,i),n&&Dt(t,n),t}var xt=O(function(){U(),Et()});function Bt(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,r=new Array(i);n<i;n++)r[n]=t[n];return r}var Ot=O(function(){U(),Et()});var Mt=O(function(){U(),Et(),Ot()});function Lt(t,n){var e=void 0!==i&&t[r]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,i){if(t){if("string"==typeof t)return Bt(t,i);var n=k.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bt(t,i):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var s=0;return function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}}}throw new p("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ft=O(function(){U(),Et(),Mt()});function Ut(t,i,n,r,e,s,u){try{var o=t[s](u),h=o.value}catch(t){return void n(t)}o.done?i(h):ut.resolve(h).then(r,e)}function Vt(t){return function(){var i=this,n=arguments;return new ut(function(r,e){var s=t.apply(i,n);function u(t){Ut(s,r,e,u,o,"next",t)}function o(t){Ut(s,r,e,u,o,"throw",t)}u(void 0)})}}var Ht,Wt=O(function(){U(),Et()});function zt(t,n){var e,s,u,o={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},h=k.create(("function"==typeof Iterator?Iterator:k).prototype);return h.next=c(0),h.throw=c(1),h.return=c(2),"function"==typeof i&&(h[r]=function(){return this}),h;function c(i){return function(r){return function(i){if(e)throw new p("Generator is already executing.");for(;h&&(h=0,i[0]&&(o=0)),o;)try{if(e=1,s&&(u=2&i[0]?s.return:i[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,i[1])).done)return u;switch(s=0,u&&(i=[2&i[0],u.value]),i[0]){case 0:case 1:u=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(u=o.trys,(u=u.length>0&&u[u.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!u||i[1]>u[0]&&i[1]<u[3])){o.label=i[1];break}if(6===i[0]&&o.label<u[1]){o.label=u[1],u=i;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(i);break}u[2]&&o.ops.pop(),o.trys.pop();continue}i=n.call(t,o)}catch(t){i=[6,t],s=0}finally{e=u=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,r])}}}function qt(t){var n="function"==typeof i&&r,e=n&&t[n],s=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new p(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(t,i,n){if(null!=i){if("object"!=typeof i&&"function"!=typeof i)throw new p("Object expected.");var r,u;if(n){if(!s)throw new p("Symbol.asyncDispose is not defined.");r=i[s]}if(void 0===r){if(!e)throw new p("Symbol.dispose is not defined.");r=i[e],n&&(u=r)}if("function"!=typeof r)throw new p("Object not disposable.");u&&(r=function(){try{u.call(this)}catch(t){return ut.reject(t)}}),t.stack.push({value:i,dispose:r,async:n})}else n&&t.stack.push({async:!0});return i}function Gt(t){function i(i){t.error=t.hasError?new Ht(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),ut.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,ut.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(t){i(t)}if(1===r)return t.hasError?ut.reject(t.error):ut.resolve();if(t.hasError)throw t.error}()}var jt=O(function(){U(),Et(),Ht="function"==typeof SuppressedError?SuppressedError:function(t,i,n){var r=new y(n);return r.name="SuppressedError",r.error=t,r.suppressed=i,r}}),Qt=O(function(){U(),Et(),jt()}),Yt=M(function(t,n){var e,s;U(),Et(),at(),e=t,s=function(t){var n="function"==typeof i&&"symbol"===W(r)?i:function(t){return"Symbol("+t+")"};function e(){}var s=Number.isNaN||function(t){return t!=t},u=e;function o(t){return"object"===(void 0===t?"undefined":W(t))&&null!==t||"function"==typeof t}function h(t){return t.slice()}function c(t,i,n,r,e){new E(t).set(new E(n,r,e),i)}function a(t){return!1!==function(t){return"number"==typeof t&&(!s(t)&&!(t<0))}(t)&&t!==1/0}function f(t,i,n){if("function"!=typeof t)throw new p("Argument is not a function");return Function.prototype.apply.call(t,i,n)}function v(t,i,n,r){var e=t[i];if(void 0!==e){if("function"!=typeof e)throw new p(e+" is not a method");switch(n){case 0:return function(){return l(e,t,r)};case 1:return function(i){var n=[i].concat(r);return l(e,t,n)}}}return function(){return I(void 0)}}function d(t,i,n){var r=t[i];if(void 0!==r)return f(r,t,n)}function l(t,i,n){try{return I(f(t,i,n))}catch(t){return R(t)}}function g(t){if(t=Number(t),s(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function w(t){if(void 0===t)return function(){return 1};if("function"!=typeof t)throw new p("size property of a queuing strategy must be a function");return function(i){return t(i)}}var _=ut,m=ut.prototype.then,A=ut.resolve.bind(_),T=ut.reject.bind(_);function S(t){return new _(t)}function I(t){return A(t)}function R(t){return T(t)}function C(t,i,n){return m.call(t,i,n)}function P(t,i,n){C(C(t,i,n),void 0,u)}function D(t,i){P(t,i)}function N(t,i){P(t,void 0,i)}function x(t,i,n){return C(t,i,n)}function B(t){C(t,void 0,u)}var O=function(){function t(){this.Ld=0,this.Hd=0,this.Wd={qd:[],zd:void 0},this.Gd=this.Wd,this.Ld=0,this.Hd=0}return k.defineProperty(t.prototype,"length",{get:function(){return this.Hd},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var i=this.Gd,n=i;16383===i.qd.length&&(n={qd:[],zd:void 0}),i.qd.push(t),n!==i&&(this.Gd=n,i.zd=n),++this.Hd},t.prototype.shift=function(){var t=this.Wd,i=t,n=this.Ld,r=n+1,e=t.qd,s=e[n];return 16384===r&&(i=t.zd,r=0),--this.Hd,this.Ld=r,t!==i&&(this.Wd=i),e[n]=void 0,s},t.prototype.forEach=function(t){for(var i=this.Ld,n=this.Wd,r=n.qd;!(i===r.length&&void 0===n.zd||i===r.length&&(i=0,0===(r=(n=n.zd).qd).length));)t(r[i]),++i},t.prototype.peek=function(){var t=this.Wd,i=this.Ld;return t.qd[i]},t}();function M(t,i,n){var r=null;!0===n&&(r=k.prototype);var e=k.create(r);return e.value=t,e.done=i,e}function L(t,i){t.Xd=!0,t.Qd=i,i.Kd=t,"readable"===i.Ua?H(t):"closed"===i.Ua?function(t){H(t),X(t)}(t):z(t,i.Yd)}function F(t,i){return Ki(t.Qd,i)}function U(t){"readable"===t.Qd.Ua?q(t,new p("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){z(t,i)}(t,new p("Reader was released and can no longer be used to monitor the stream's closedness")),t.Qd.Kd=void 0,t.Qd=void 0}function V(t){return new p("Cannot "+t+" a stream using a released reader")}function H(t){t.Jd=S(function(i,n){t.Zd=i,t.ul=n})}function z(t,i){H(t),q(t,i)}function q(t,i){B(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0}function X(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0}var G=n("[[CancelSteps]]"),j=n("[[PullSteps]]");function Q(t,i){void 0===i&&(i=!1);var n=new it(t);return n.Xd=i,n}function Y(t){return S(function(i,n){var r={tf:i,if:n};t.Kd.ef.push(r)})}function K(t,i,n){var r=t.Kd;r.ef.shift().tf(M(i,n,r.Xd))}function J(t){return t.Kd.ef.length}function Z(t){var i=t.Kd;return void 0!==i&&!!nt(i)}var $,tt,it=function(){function t(t){if(!1===Qi(t))throw new p("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Yi(t))throw new p("This stream has already been locked for exclusive reading by another reader");L(this,t),this.ef=new O}return k.defineProperty(t.prototype,"closed",{get:function(){return nt(this)?this.Jd:R(et("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return nt(this)?void 0===this.Qd?R(V("cancel")):F(this,t):R(et("cancel"))},t.prototype.read=function(){return nt(this)?void 0===this.Qd?R(V("read from")):rt(this):R(et("read"))},t.prototype.releaseLock=function(){if(!nt(this))throw et("releaseLock");if(void 0!==this.Qd){if(this.ef.length>0)throw new p("Tried to release a reader lock when that reader has pending read() calls un-settled");U(this)}},t}();function nt(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"ef")}function rt(t){var i=t.Qd;return i.nf=!0,"closed"===i.Ua?I(M(void 0,!0,t.Xd)):"errored"===i.Ua?R(i.Yd):i.rf[j]()}function et(t){return new p("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"===W(n.asyncIterator)&&(($={})[n.asyncIterator]=function(){return this},tt=$,k.defineProperty(tt,n.asyncIterator,{enumerable:!1}));var st={next:function(){if(!1===ot(this))return R(ht("next"));var t=this.hf;return void 0===t.Qd?R(V("iterate")):x(rt(t),function(i){var n=i.done;return n&&U(t),M(i.value,n,!0)})},return:function(t){if(!1===ot(this))return R(ht("next"));var i=this.hf;if(void 0===i.Qd)return R(V("finish iterating"));if(i.ef.length>0)return R(new p("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this.uf){var n=F(i,t);return U(i),x(n,function(){return M(t,!0,!0)})}return U(i),I(M(t,!0,!0))}};function ot(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"hf")}function ht(t){return new p("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function ct(t){var i=t.cf.shift();return t.df-=i.size,t.df<0&&(t.df=0),i.value}function at(t,i,n){if(!a(n=Number(n)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t.cf.push({value:i,size:n}),t.df+=n}function ft(t){t.cf=new O,t.df=0}void 0!==tt&&k.setPrototypeOf(st,tt),k.defineProperty(st,"next",{enumerable:!1}),k.defineProperty(st,"return",{enumerable:!1});var vt=n("[[AbortSteps]]"),dt=n("[[ErrorSteps]]"),lt=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),wt(this);var n=i.size,r=i.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var e=w(n);void 0===r&&(r=1),function(t,i,n,r){var e=k.create(Bt.prototype);function s(){return d(i,"start",[e])}var u=v(i,"write",1,[e]),o=v(i,"close",0,[]),h=v(i,"abort",1,[]);Ot(t,e,s,u,o,h,n,r)}(this,t,r=g(r),e)}return k.defineProperty(t.prototype,"locked",{get:function(){if(!1===_t(this))throw Wt("locked");return mt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===_t(this)?R(Wt("abort")):!0===mt(this)?R(new p("Cannot abort a stream that already has a writer")):yt(this,t)},t.prototype.close=function(){return!1===_t(this)?R(Wt("close")):!0===mt(this)?R(new p("Cannot close a stream that already has a writer")):!0===Tt(this)?R(new p("Cannot close an already-closing stream")):pt(this)},t.prototype.getWriter=function(){if(!1===_t(this))throw Wt("getWriter");return gt(this)},t}();function gt(t){return new It(t)}function wt(t){t.Ua="writable",t.Yd=void 0,t.lf=void 0,t.vf=void 0,t._f=new O,t.gf=void 0,t.pf=void 0,t.mf=void 0,t.wf=void 0,t.yf=!1}function _t(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"vf")}function mt(t){return void 0!==t.lf}function yt(t,i){var n=t.Ua;if("closed"===n||"errored"===n)return I(void 0);if(void 0!==t.wf)return t.wf.bf;var r=!1;"erroring"===n&&(r=!0,i=void 0);var e=S(function(n,e){t.wf={bf:void 0,tf:n,if:e,Af:i,Sf:r}});return t.wf.bf=e,!1===r&&bt(t,i),e}function pt(t){var i=t.Ua;if("closed"===i||"errored"===i)return R(new p("The stream (in "+i+" state) is not in the writable state and cannot be closed"));var n=S(function(i,n){var r={tf:i,if:n};t.pf=r}),r=t.lf;return void 0!==r&&!0===t.yf&&"writable"===i&&$t(r),function(t){at(t,"close",0),Ft(t)}(t.vf),n}function kt(t,i){"writable"!==t.Ua?At(t):bt(t,i)}function bt(t,i){var n=t.vf;t.Ua="erroring",t.Yd=i;var r=t.lf;void 0!==r&&Dt(r,i),!1===function(t){return void 0!==t.gf||void 0!==t.mf}(t)&&!0===n.Tf&&At(t)}function At(t){t.Ua="errored",t.vf[dt]();var i=t.Yd;if(t._f.forEach(function(t){t.if(i)}),t._f=new O,void 0!==t.wf){var n=t.wf;if(t.wf=void 0,!0===n.Sf)return n.if(i),void St(t);P(t.vf[vt](n.Af),function(){n.tf(),St(t)},function(i){n.if(i),St(t)})}else St(t)}function Tt(t){return void 0!==t.pf||void 0!==t.mf}function St(t){void 0!==t.pf&&(t.pf.if(t.Yd),t.pf=void 0);var i=t.lf;void 0!==i&&jt(i,t.Yd)}function Et(t,i){var n=t.lf;void 0!==n&&i!==t.yf&&(!0===i?function(t){Yt(t)}(n):$t(n)),t.yf=i}var It=function(){function t(t){if(!1===_t(t))throw new p("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===mt(t))throw new p("This stream has already been locked for exclusive writing by another writer");this.kf=t,t.lf=this;var i=t.Ua;if("writable"===i)!1===Tt(t)&&!0===t.yf?Yt(this):Jt(this),Xt(this);else if("erroring"===i)Kt(this,t.Yd),Xt(this);else if("closed"===i)Jt(this),function(t){Xt(t),Qt(t)}(this);else{var n=t.Yd;Kt(this,n),Gt(this,n)}}return k.defineProperty(t.prototype,"closed",{get:function(){return!1===Rt(this)?R(zt("closed")):this.Jd},enumerable:!0,configurable:!0}),k.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Rt(this))throw zt("desiredSize");if(void 0===this.kf)throw qt("desiredSize");return function(t){var i=t.kf,n=i.Ua;return"errored"===n||"erroring"===n?null:"closed"===n?0:Lt(i.vf)}(this)},enumerable:!0,configurable:!0}),k.defineProperty(t.prototype,"ready",{get:function(){return!1===Rt(this)?R(zt("ready")):this.Ef},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Rt(this)?R(zt("abort")):void 0===this.kf?R(qt("abort")):function(t,i){var n=t.kf;return yt(n,i)}(this,t)},t.prototype.close=function(){if(!1===Rt(this))return R(zt("close"));var t=this.kf;return void 0===t?R(qt("close")):!0===Tt(t)?R(new p("Cannot close an already-closing stream")):Ct(this)},t.prototype.releaseLock=function(){if(!1===Rt(this))throw zt("releaseLock");void 0!==this.kf&&Nt(this)},t.prototype.write=function(t){return!1===Rt(this)?R(zt("write")):void 0===this.kf?R(qt("write to")):xt(this,t)},t}();function Rt(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"kf")}function Ct(t){return pt(t.kf)}function Pt(t,i){"pending"===t.xf?jt(t,i):function(t,i){Gt(t,i)}(t,i)}function Dt(t,i){"pending"===t.Pf?Zt(t,i):function(t,i){Kt(t,i)}(t,i)}function Nt(t){var i=t.kf,n=new p("Writer was released and can no longer be used to monitor the stream's closedness");Dt(t,n),Pt(t,n),i.lf=void 0,t.kf=void 0}function xt(t,i){var n=t.kf,r=n.vf,e=function(t,i){try{return t.If(i)}catch(i){return Ut(t,i),1}}(r,i);if(n!==t.kf)return R(qt("write to"));var s=n.Ua;if("errored"===s)return R(n.Yd);if(!0===Tt(n)||"closed"===s)return R(new p("The stream is closing or closed and cannot be written to"));if("erroring"===s)return R(n.Yd);var u=function(t){return S(function(i,n){var r={tf:i,if:n};t._f.push(r)})}(n);return function(t,i,n){var r={chunk:i};try{at(t,r,n)}catch(i){return void Ut(t,i)}var e=t.Cf;!1===Tt(e)&&"writable"===e.Ua&&Et(e,Vt(t)),Ft(t)}(r,i,e),u}var Bt=function(){function t(){throw new p("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"Cf")}(this))throw new p("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this.Cf.Ua&&Ht(this,t)},t.prototype[vt]=function(t){var i=this.Rf(t);return Mt(this),i},t.prototype[dt]=function(){ft(this)},t}();function Ot(t,i,n,r,e,s,u,o){i.Cf=t,t.vf=i,i.cf=void 0,i.df=void 0,ft(i),i.Tf=!1,i.If=o,i.Df=u,i.Bf=r,i.Nf=e,i.Rf=s;var h=Vt(i);Et(t,h),P(I(n()),function(){i.Tf=!0,Ft(i)},function(n){i.Tf=!0,kt(t,n)})}function Mt(t){t.Bf=void 0,t.Nf=void 0,t.Rf=void 0,t.If=void 0}function Lt(t){return t.Df-t.df}function Ft(t){var i=t.Cf;if(!1!==t.Tf&&void 0===i.gf)if("erroring"!==i.Ua){if(0!==t.cf.length){var n=function(t){return t.cf.peek().value}(t);"close"===n?function(t){var i=t.Cf;(function(t){t.mf=t.pf,t.pf=void 0})(i),ct(t);var n=t.Nf();Mt(t),P(n,function(){!function(t){t.mf.tf(void 0),t.mf=void 0,"erroring"===t.Ua&&(t.Yd=void 0,void 0!==t.wf&&(t.wf.tf(),t.wf=void 0)),t.Ua="closed";var i=t.lf;void 0!==i&&Qt(i)}(i)},function(t){!function(t,i){t.mf.if(i),t.mf=void 0,void 0!==t.wf&&(t.wf.if(i),t.wf=void 0),kt(t,i)}(i,t)})}(t):function(t,i){var n=t.Cf;!function(t){t.gf=t._f.shift()}(n);var r=t.Bf(i);P(r,function(){!function(t){t.gf.tf(void 0),t.gf=void 0}(n);var i=n.Ua;if(ct(t),!1===Tt(n)&&"writable"===i){var r=Vt(t);Et(n,r)}Ft(t)},function(i){"writable"===n.Ua&&Mt(t),function(t,i){t.gf.if(i),t.gf=void 0,kt(t,i)}(n,i)})}(t,n.chunk)}}else At(i)}function Ut(t,i){"writable"===t.Cf.Ua&&Ht(t,i)}function Vt(t){return Lt(t)<=0}function Ht(t,i){var n=t.Cf;Mt(t),bt(n,i)}function Wt(t){return new p("WritableStream.prototype."+t+" can only be used on a WritableStream")}function zt(t){return new p("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function qt(t){return new p("Cannot "+t+" a stream using a released writer")}function Xt(t){t.Jd=S(function(i,n){t.Zd=i,t.ul=n,t.xf="pending"})}function Gt(t,i){Xt(t),jt(t,i)}function jt(t,i){B(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0,t.xf="rejected"}function Qt(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0,t.xf="resolved"}function Yt(t){t.Ef=S(function(i,n){t.Mf=i,t.Lf=n}),t.Pf="pending"}function Kt(t,i){Yt(t),Zt(t,i)}function Jt(t){Yt(t),$t(t)}function Zt(t,i){B(t.Ef),t.Lf(i),t.Mf=void 0,t.Lf=void 0,t.Pf="rejected"}function $t(t){t.Mf(void 0),t.Mf=void 0,t.Lf=void 0,t.Pf="fulfilled"}function ti(t){if("object"!==(void 0===t?"undefined":W(t))||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var ii,ni="undefined"!=typeof DOMException?DOMException:void 0,ri=function(t){if("function"!=typeof t&&"object"!==(void 0===t?"undefined":W(t)))return!1;try{return new t,!0}catch(t){return!1}}(ni)?ni:((ii=function(t,i){this.message=t||"",this.name=i||"Error",y.captureStackTrace&&y.captureStackTrace(this,this.constructor)}).prototype=k.create(y.prototype),k.defineProperty(ii.prototype,"constructor",{value:ii,writable:!0,configurable:!0}),ii);function ei(t,i,n,r,s,u){var o=Q(t),h=gt(i);t.nf=!0;var c=!1,a=I(void 0);return S(function(f,v){var d,l,g,w;if(void 0!==u){if(d=function(){var n=new ri("Aborted","AbortError"),e=[];!1===r&&e.push(function(){return"writable"===i.Ua?yt(i,n):I(void 0)}),!1===s&&e.push(function(){return"readable"===t.Ua?Ki(t,n):I(void 0)}),k(function(){return ut.all(e.map(function(t){return t()}))},!0,n)},!0===u.aborted)return void d();u.addEventListener("abort",d)}if(y(t,o.Jd,function(t){!1===r?k(function(){return yt(i,t)},!0,t):b(!0,t)}),y(i,h.Jd,function(i){!1===s?k(function(){return Ki(t,i)},!0,i):b(!0,i)}),l=t,g=o.Jd,w=function(){!1===n?k(function(){return function(t){var i=t.kf,n=i.Ua;return!0===Tt(i)||"closed"===n?I(void 0):"errored"===n?R(i.Yd):Ct(t)}(h)}):b()},"closed"===l.Ua?w():D(g,w),!0===Tt(i)||"closed"===i.Ua){var _=new p("the destination writable stream closed before all data could be piped to it");!1===s?k(function(){return Ki(t,_)},!0,_):b(!0,_)}function m(){var t=a;return C(a,function(){return t!==a?m():void 0})}function y(t,i,n){"errored"===t.Ua?n(t.Yd):N(i,n)}function k(t,n,r){function e(){P(t(),function(){return A(n,r)},function(t){return A(!0,t)})}!0!==c&&(c=!0,"writable"===i.Ua&&!1===Tt(i)?D(m(),e):e())}function b(t,n){!0!==c&&(c=!0,"writable"===i.Ua&&!1===Tt(i)?D(m(),function(){return A(t,n)}):A(t,n))}function A(t,i){Nt(h),U(o),void 0!==u&&u.removeEventListener("abort",d),t?v(i):f(void 0)}B(S(function(t,i){!function n(r){r?t():C(!0===c?I(!0):C(h.Ef,function(){return C(rt(o),function(t){return!0===t.done||(a=C(xt(h,t.value),void 0,e),!1)})}),n,i)}(!1)}))})}var si=function(){function t(){throw new p}return k.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===ui(this))throw wi("desiredSize");return di(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===ui(this))throw wi("close");if(!1===li(this))throw new p("The stream is not in a state that permits close");ai(this)},t.prototype.enqueue=function(t){if(!1===ui(this))throw wi("enqueue");if(!1===li(this))throw new p("The stream is not in a state that permits enqueue");return fi(this,t)},t.prototype.error=function(t){if(!1===ui(this))throw wi("error");vi(this,t)},t.prototype[G]=function(t){ft(this);var i=this.Of(t);return ci(this),i},t.prototype[j]=function(){var t=this.Ff;if(this.cf.length>0){var i=ct(this);return!0===this.Uf&&0===this.cf.length?(ci(this),Ji(t)):oi(this),I(M(i,!1,t.Kd.Xd))}var n=Y(t);return oi(this),n},t}();function ui(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"Ff")}function oi(t){!1!==hi(t)&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,oi(t))},function(i){vi(t,i)})):t.Wf=!0)}function hi(t){var i=t.Ff;return!1!==li(t)&&!1!==t.Tf&&(!0===Yi(i)&&J(i)>0||di(t)>0)}function ci(t){t.Hf=void 0,t.Of=void 0,t.If=void 0}function ai(t){var i=t.Ff;t.Uf=!0,0===t.cf.length&&(ci(t),Ji(i))}function fi(t,i){var n=t.Ff;if(!0===Yi(n)&&J(n)>0)K(n,i,!1);else{var r=void 0;try{r=t.If(i)}catch(i){throw vi(t,i),i}try{at(t,i,r)}catch(i){throw vi(t,i),i}}oi(t)}function vi(t,i){var n=t.Ff;"readable"===n.Ua&&(ft(t),ci(t),Zi(n,i))}function di(t){var i=t.Ff.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function li(t){var i=t.Ff.Ua;return!1===t.Uf&&"readable"===i}function gi(t,i,n,r,e,s,u){i.Ff=t,i.cf=void 0,i.df=void 0,ft(i),i.Tf=!1,i.Uf=!1,i.Wf=!1,i.Vf=!1,i.If=u,i.Df=s,i.Hf=r,i.Of=e,t.rf=i,P(I(n()),function(){i.Tf=!0,oi(i)},function(t){vi(i,t)})}function wi(t){return new p("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var _i=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&b.floor(t)===t},mi=function(){function t(){throw new p("ReadableStreamBYOBRequest cannot be used directly")}return k.defineProperty(t.prototype,"view",{get:function(){if(!1===ki(this))throw Li("view");return this.qf},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===ki(this))throw Li("respond");if(void 0===this.zf)throw new p("This BYOB request has been invalidated");this.qf.buffer,function(t,i){if(!1===a(i=Number(i)))throw new RangeError("bytesWritten must be a finite");Di(t,i)}(this.zf,t)},t.prototype.respondWithNewView=function(t){if(!1===ki(this))throw Li("respond");if(void 0===this.zf)throw new p("This BYOB request has been invalidated");if(!ArrayBuffer.isView(t))throw new p("You can only respond with array buffer views");t.buffer,function(t,i){var n=t.Gf.peek();if(n.byteOffset+n.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.byteLength!==i.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");n.buffer=i.buffer,Di(t,i.byteLength)}(this.zf,t)},t}(),yi=function(){function t(){throw new p("ReadableByteStreamController constructor cannot be used directly")}return k.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===pi(this))throw Fi("byobRequest");if(void 0===this.Xf&&this.Gf.length>0){var t=this.Gf.peek(),i=new E(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=k.create(mi.prototype);!function(t,i,n){t.zf=i,t.qf=n}(n,this,i),this.Xf=n}return this.Xf},enumerable:!0,configurable:!0}),k.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===pi(this))throw Fi("desiredSize");return Oi(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===pi(this))throw Fi("close");if(!0===this.Uf)throw new p("The stream has already been closed; do not close it again!");var t=this.jf.Ua;if("readable"!==t)throw new p("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function(t){var i=t.jf;if(t.df>0)t.Uf=!0;else{if(t.Gf.length>0&&t.Gf.peek().bytesFilled>0){var n=new p("Insufficient bytes to fill elements in the given buffer");throw Bi(t,n),n}xi(t),Ji(i)}}(this)},t.prototype.enqueue=function(t){if(!1===pi(this))throw Fi("enqueue");if(!0===this.Uf)throw new p("stream is closed or draining");var i=this.jf.Ua;if("readable"!==i)throw new p("The stream (in "+i+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(t))throw new p("You can only enqueue array buffer views when using a ReadableByteStreamController");t.buffer,function(t,i){var n=t.jf,r=i.buffer,e=i.byteOffset,s=i.byteLength,u=r;!0===Z(n)?0===J(n)?Si(t,u,e,s):K(n,new E(u,e,s),!1):!0===Hi(n)?(Si(t,u,e,s),Pi(t)):Si(t,u,e,s),bi(t)}(this,t)},t.prototype.error=function(t){if(!1===pi(this))throw Fi("error");Bi(this,t)},t.prototype[G]=function(t){this.Gf.length>0&&(this.Gf.peek().bytesFilled=0),ft(this);var i=this.Of(t);return xi(this),i},t.prototype[j]=function(){var t=this.jf;if(this.df>0){var i=this.cf.shift();this.df-=i.byteLength,Ri(this);var n=void 0;try{n=new E(i.buffer,i.byteOffset,i.byteLength)}catch(t){return R(t)}return I(M(n,!1,t.Kd.Xd))}var r=this.Qf;if(void 0!==r){var e=void 0;try{e=new ArrayBuffer(r)}catch(t){return R(t)}var s={buffer:e,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,ctor:E,readerType:"default"};this.Gf.push(s)}var u=Y(t);return bi(this),u},t}();function pi(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"jf")}function ki(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"zf")}function bi(t){var i=function(t){var i=t.jf;if("readable"!==i.Ua)return!1;if(!0===t.Uf)return!1;if(!1===t.Tf)return!1;if(!0===Z(i)&&J(i)>0)return!0;if(!0===Hi(i)&&Vi(i)>0)return!0;var n=Oi(t);return n>0}(t);!1!==i&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,bi(t))},function(i){Bi(t,i)})):t.Wf=!0)}function Ai(t,i){var n=!1;"closed"===t.Ua&&(n=!0);var r=Ti(i);"default"===i.readerType?K(t,r,n):function(t,i,n){var r=t.Kd,e=r.Kf.shift();e.tf(M(i,n,r.Xd))}(t,r,n)}function Ti(t){var i=t.bytesFilled,n=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,i/n)}function Si(t,i,n,r){t.cf.push({buffer:i,byteOffset:n,byteLength:r}),t.df+=r}function Ei(t,i){var n=i.elementSize,r=i.bytesFilled-i.bytesFilled%n,e=b.min(t.df,i.byteLength-i.bytesFilled),s=i.bytesFilled+e,u=s-s%n,o=e,h=!1;u>r&&(o=u-i.bytesFilled,h=!0);for(var a=t.cf;o>0;){var f=a.peek(),v=b.min(o,f.byteLength),d=i.byteOffset+i.bytesFilled;c(i.buffer,d,f.buffer,f.byteOffset,v),f.byteLength===v?a.shift():(f.byteOffset+=v,f.byteLength-=v),t.df-=v,Ii(t,v,i),o-=v}return h}function Ii(t,i,n){Ci(t),n.bytesFilled+=i}function Ri(t){0===t.df&&!0===t.Uf?(xi(t),Ji(t.jf)):bi(t)}function Ci(t){void 0!==t.Xf&&(t.Xf.zf=void 0,t.Xf.qf=void 0,t.Xf=void 0)}function Pi(t){for(;t.Gf.length>0;){if(0===t.df)return;var i=t.Gf.peek();!0===Ei(t,i)&&(Ni(t),Ai(t.jf,i))}}function Di(t,i){var n=t.Gf.peek();if("closed"===t.jf.Ua){if(0!==i)throw new p("bytesWritten must be 0 when calling respond() on a closed stream");!function(t,i){i.buffer=i.buffer;var n=t.jf;if(!0===Hi(n))for(;Vi(n)>0;)Ai(n,Ni(t))}(t,n)}else!function(t,i,n){if(n.bytesFilled+i>n.byteLength)throw new RangeError("bytesWritten out of range");if(Ii(t,i,n),!(n.bytesFilled<n.elementSize)){Ni(t);var r=n.bytesFilled%n.elementSize;if(r>0){var e=n.byteOffset+n.bytesFilled,s=n.buffer.slice(e-r,e);Si(t,s,0,s.byteLength)}n.buffer=n.buffer,n.bytesFilled-=r,Ai(t.jf,n),Pi(t)}}(t,i,n);bi(t)}function Ni(t){var i=t.Gf.shift();return Ci(t),i}function xi(t){t.Hf=void 0,t.Of=void 0}function Bi(t,i){var n=t.jf;"readable"===n.Ua&&(function(t){Ci(t),t.Gf=new O}(t),ft(t),xi(t),Zi(n,i))}function Oi(t){var i=t.jf.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function Mi(t,i,n){var r=k.create(yi.prototype),e=v(i,"pull",0,[r]),s=v(i,"cancel",1,[]),u=i.autoAllocateChunkSize;if(void 0!==u&&(u=Number(u),!1===_i(u)||u<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,i,n,r,e,s,u){i.jf=t,i.Wf=!1,i.Vf=!1,i.Xf=void 0,i.cf=i.df=void 0,ft(i),i.Uf=!1,i.Tf=!1,i.Df=g(s),i.Hf=r,i.Of=e,i.Qf=u,i.Gf=new O,t.rf=i,P(I(n()),function(){i.Tf=!0,bi(i)},function(t){Bi(i,t)})}(t,r,function(){return d(i,"start",[r])},e,s,n,u)}function Li(t){return new p("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Fi(t){return new p("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Ui(t){return S(function(i,n){var r={tf:i,if:n};t.Kd.Kf.push(r)})}function Vi(t){return t.Kd.Kf.length}function Hi(t){var i=t.Kd;return void 0!==i&&!!zi(i)}var Wi=function(){function t(t){if(!Qi(t))throw new p("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===pi(t.rf))throw new p("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Yi(t))throw new p("This stream has already been locked for exclusive reading by another reader");L(this,t),this.Kf=new O}return k.defineProperty(t.prototype,"closed",{get:function(){return zi(this)?this.Jd:R(qi("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return zi(this)?void 0===this.Qd?R(V("cancel")):F(this,t):R(qi("cancel"))},t.prototype.read=function(t){return zi(this)?void 0===this.Qd?R(V("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?R(new p("view must have non-zero byteLength")):function(t,i){var n=t.Qd;return n.nf=!0,"errored"===n.Ua?R(n.Yd):function(t,i){var n=t.jf,r=1;i.constructor!==DataView&&(r=i.constructor.BYTES_PER_ELEMENT);var e=i.constructor,s={buffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength,bytesFilled:0,elementSize:r,ctor:e,readerType:"byob"};if(t.Gf.length>0)return t.Gf.push(s),Ui(n);if("closed"===n.Ua)return I(M(new e(s.buffer,s.byteOffset,0),!0,n.Kd.Xd));if(t.df>0){if(!0===Ei(t,s)){var u=Ti(s);return Ri(t),I(M(u,!1,n.Kd.Xd))}if(!0===t.Uf){var o=new p("Insufficient bytes to fill elements in the given buffer");return Bi(t,o),R(o)}}t.Gf.push(s);var h=Ui(n);return bi(t),h}(n.rf,i)}(this,t)):R(new p("view must be an array buffer view")):R(qi("read"))},t.prototype.releaseLock=function(){if(!zi(this))throw qi("releaseLock");if(void 0!==this.Qd){if(this.Kf.length>0)throw new p("Tried to release a reader lock when that reader has pending read() calls un-settled");U(this)}},t}();function zi(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"Kf")}function qi(t){return new p("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var Xi=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),ji(this);var n=i.size,r=i.highWaterMark,e=t.type;if("bytes"===String(e)){if(void 0!==n)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===r&&(r=0),Mi(this,t,r=g(r))}else{if(void 0!==e)throw new RangeError("Invalid type is specified");var s=w(n);void 0===r&&(r=1),function(t,i,n,r){var e=k.create(si.prototype),s=v(i,"pull",0,[e]),u=v(i,"cancel",1,[]);gi(t,e,function(){return d(i,"start",[e])},s,u,n,r)}(this,t,r=g(r),s)}}return k.defineProperty(t.prototype,"locked",{get:function(){if(!1===Qi(this))throw $i("locked");return Yi(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===Qi(this)?R($i("cancel")):!0===Yi(this)?R(new p("Cannot cancel a stream that already has a reader")):Ki(this,t)},t.prototype.getReader=function(t){var i=(void 0===t?{}:t).mode;if(!1===Qi(this))throw $i("getReader");if(void 0===i)return Q(this,!0);if("byob"===(i=String(i)))return function(t,i){void 0===i&&(i=!1);var n=new Wi(t);return n.Xd=i,n}(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,i){var n=t.writable,r=t.readable,e=void 0===i?{}:i,s=e.preventClose,u=e.preventAbort,o=e.preventCancel,h=e.signal;if(!1===Qi(this))throw $i("pipeThrough");if(!1===_t(n))throw new p("writable argument to pipeThrough must be a WritableStream");if(!1===Qi(r))throw new p("readable argument to pipeThrough must be a ReadableStream");if(s=Boolean(s),u=Boolean(u),o=Boolean(o),void 0!==h&&!ti(h))throw new p("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Yi(this))throw new p("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===mt(n))throw new p("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return B(ei(this,n,s,u,o,h)),r},t.prototype.pipeTo=function(t,i){var n=void 0===i?{}:i,r=n.preventClose,e=n.preventAbort,s=n.preventCancel,u=n.signal;return!1===Qi(this)?R($i("pipeTo")):!1===_t(t)?R(new p("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(r=Boolean(r),e=Boolean(e),s=Boolean(s),void 0===u||ti(u)?!0===Yi(this)?R(new p("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===mt(t)?R(new p("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ei(this,t,r,e,s,u):R(new p("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===Qi(this))throw $i("tee");var t=function(t){var i,n,r,e,s,u=Q(t),o=!1,c=!1,a=!1,f=S(function(t){s=t});function v(){return!0===o||(o=!0,B(x(rt(u),function(t){if(o=!1,!0===t.done)return!1===c&&ai(r.rf),void(!1===a&&ai(e.rf));var i=t.value,n=i,s=i;!1===c&&fi(r.rf,n),!1===a&&fi(e.rf,s)}))),I(void 0)}function d(){}return r=Gi(d,v,function(r){if(c=!0,i=r,!0===a){var e=h([i,n]),u=Ki(t,e);s(u)}return f}),e=Gi(d,v,function(r){if(a=!0,n=r,!0===c){var e=h([i,n]),u=Ki(t,e);s(u)}return f}),N(u.Jd,function(t){vi(r.rf,t),vi(e.rf,t)}),[r,e]}(this);return h(t)},t.prototype.getIterator=function(t){var i=(void 0===t?{}:t).preventCancel,n=void 0!==i&&i;if(!1===Qi(this))throw $i("getIterator");return function(t,i){void 0===i&&(i=!1);var n=Q(t),r=k.create(st);return r.hf=n,r.uf=Boolean(i),r}(this,n)},t}();function Gi(t,i,n,r,e){void 0===r&&(r=1),void 0===e&&(e=function(){return 1});var s=k.create(Xi.prototype);return ji(s),gi(s,k.create(si.prototype),t,i,n,r,e),s}function ji(t){t.Ua="readable",t.Kd=void 0,t.Yd=void 0,t.nf=!1}function Qi(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"rf")}function Yi(t){return void 0!==t.Kd}function Ki(t,i){return t.nf=!0,"closed"===t.Ua?I(void 0):"errored"===t.Ua?R(t.Yd):(Ji(t),x(t.rf[G](i),e))}function Ji(t){t.Ua="closed";var i=t.Kd;void 0!==i&&(nt(i)&&(i.ef.forEach(function(t){t.tf(M(void 0,!0,i.Xd))}),i.ef=new O),X(i))}function Zi(t,i){t.Ua="errored",t.Yd=i;var n=t.Kd;void 0!==n&&(nt(n)?(n.ef.forEach(function(t){t.if(i)}),n.ef=new O):(n.Kf.forEach(function(t){t.if(i)}),n.Kf=new O),q(n,i))}function $i(t){return new p("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"===W(n.asyncIterator)&&k.defineProperty(Xi.prototype,n.asyncIterator,{value:Xi.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var tn=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(t){return t.byteLength},t}(),nn=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(){return 1},t}(),rn=function(){function t(t,i,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={});var r=i.size,e=i.highWaterMark,s=n.size,u=n.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var o=w(r);if(void 0===e&&(e=1),e=g(e),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var h,c=w(s);void 0===u&&(u=0),u=g(u),function(t,i,n,r,e,s){function u(){return i}function o(i){return function(t,i){var n=t.Yf;return!0===t.yf?x(t.Jf,function(){var r=t.Zf;if("erroring"===r.Ua)throw r.Yd;return vn(n,i)}):vn(n,i)}(t,i)}function h(i){return function(t,i){return sn(t,i),I(void 0)}(t,i)}function c(){return function(t){var i=t.$f,n=t.Yf,r=n.rv();return an(n),x(r,function(){if("errored"===i.Ua)throw i.Yd;var t=i.rf;!0===li(t)&&ai(t)},function(n){throw sn(t,n),i.Yd})}(t)}function a(){return function(t){return on(t,!1),t.Jf}(t)}function f(i){return un(t,i),I(void 0)}t.Zf=function(t,i,n,r,e,s){void 0===e&&(e=1),void 0===s&&(s=function(){return 1});var u=k.create(lt.prototype);return wt(u),Ot(u,k.create(Bt.prototype),t,i,n,r,e,s),u}(u,o,c,h,n,r),t.$f=Gi(u,a,f,e,s),t.yf=void 0,t.Jf=void 0,t.hv=void 0,on(t,!0),t.Yf=void 0}(this,S(function(t){h=t}),e,o,u,c),function(t,i){var n=k.create(hn.prototype),r=function(t){try{return fn(n,t),I(void 0)}catch(t){return R(t)}},e=i.transform;if(void 0!==e){if("function"!=typeof e)throw new p("transform is not a method");r=function(t){return l(e,i,[t,n])}}var s=v(i,"flush",0,[n]);!function(t,i,n,r){i.ov=t,t.Yf=i,i.uv=n,i.rv=r}(t,n,r,s)}(this,t);var a=d(t,"start",[this.Yf]);h(a)}return k.defineProperty(t.prototype,"readable",{get:function(){if(!1===en(this))throw ln("readable");return this.$f},enumerable:!0,configurable:!0}),k.defineProperty(t.prototype,"writable",{get:function(){if(!1===en(this))throw ln("writable");return this.Zf},enumerable:!0,configurable:!0}),t}();function en(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"Yf")}function sn(t,i){vi(t.$f.rf,i),un(t,i)}function un(t,i){an(t.Yf),Ut(t.Zf.vf,i),!0===t.yf&&on(t,!1)}function on(t,i){void 0!==t.Jf&&t.hv(),t.Jf=S(function(i){t.hv=i}),t.yf=i}var hn=function(){function t(){throw new p("TransformStreamDefaultController instances cannot be created directly")}return k.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===cn(this))throw dn("desiredSize");return di(this.ov.$f.rf)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===cn(this))throw dn("enqueue");fn(this,t)},t.prototype.error=function(t){if(!1===cn(this))throw dn("error");!function(t,i){sn(t.ov,i)}(this,t)},t.prototype.terminate=function(){if(!1===cn(this))throw dn("terminate");!function(t){var i=t.ov,n=i.$f.rf;!0===li(n)&&ai(n);var r=new p("TransformStream terminated");un(i,r)}(this)},t}();function cn(t){return!!o(t)&&!!k.prototype.hasOwnProperty.call(t,"ov")}function an(t){t.uv=void 0,t.rv=void 0}function fn(t,i){var n=t.ov,r=n.$f.rf;if(!1===li(r))throw new p("Readable side is not in a state that permits enqueue");try{fi(r,i)}catch(t){throw un(n,t),n.$f.Yd}var e=function(t){return!0!==hi(t)}(r);e!==n.yf&&on(n,!0)}function vn(t,i){return x(t.uv(i),void 0,function(i){throw sn(t.ov,i),i})}function dn(t){return new p("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function ln(t){return new p("TransformStream.prototype."+t+" can only be used on a TransformStream")}t.ByteLengthQueuingStrategy=tn,t.CountQueuingStrategy=nn,t.ReadableStream=Xi,t.TransformStream=rn,t.WritableStream=lt,k.defineProperty(t,"__esModule",{value:!0})},"object"===(void 0===t?"undefined":W(t))&&void 0!==n?s(t):"function"==typeof define&&define.amd?define(["exports"],s):s((e=e||self).WebStreamsPolyfill={})}),Kt=M(function(t){function i(){var t=Yt();return i=function(){return t},t}U(),Et(),k.defineProperty(t,"__esModule",{value:!0}),function(t,i){for(var n in i)k.defineProperty(t,n,{enumerable:!0,get:k.getOwnPropertyDescriptor(i,n).get})}(t,{get ByteLengthQueuingStrategy(){return i().ByteLengthQueuingStrategy},get CountQueuingStrategy(){return i().CountQueuingStrategy},get ReadableStream(){return i().ReadableStream},get TransformStream(){return i().TransformStream},get WritableStream(){return i().WritableStream}})});function Jt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jt=function(){return!!t})()}var Zt=O(function(){U(),Et()});function $t(t,i,n){return($t=Jt()?Reflect.construct:function(t,i,n){var r=[null];r.push.apply(r,i);var e=new(Function.bind.apply(t,r));return n&&It(e,n.prototype),e}).apply(null,arguments)}var ti=O(function(){U(),Et(),Zt(),Rt()});function ii(t){return(ii=k.setPrototypeOf?k.getPrototypeOf:function(t){return t.__proto__||k.getPrototypeOf(t)})(t)}var ni=O(function(){U(),Et()});var ri=O(function(){U(),Et()});function ei(t){var i="function"==typeof Map?new Map:void 0;return ei=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new p("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,n)}function n(){return $t(t,arguments,ii(this).constructor)}return n.prototype=k.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),It(n,t)},ei(t)}var si,ui=O(function(){U(),Et(),ti(),ni(),ri(),Rt()}),oi=M(function(t,r){var e,s;U(),Et(),Wt(),xt(),Pt(),H(),at(),ui(),Ft(),Qt(),e=t,s=function(t){var r,e=k.defineProperty,s=k.defineProper