mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-28 08:54:13 +01:00
1 line
344 KiB
JavaScript
1 line
344 KiB
JavaScript
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).bcur=e()}}((function(){for(var e=function(e){var t;return function(r){return t||e(t={exports:{},parent:r},t.exports),t.exports}},t=e((function(e,t){(function(t,i){"use strict";var o;e.exports=y,y.ReadableState=b,B.EventEmitter;var a=function(e,t){return e.listeners(t).length},s=kr.Buffer,f=i.Uint8Array||function(){},u=Object.create(xr);u.inherits=wr;var h,c=l({}),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){},u.inherits(y,Mr);var p=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var i=t instanceof(o=o||n({}));this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,s=e.readableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:i&&(s||0===s)?s:f,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Rr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r({}).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function y(e){if(o=o||n({}),!(this instanceof y))return new y(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),Mr.call(this)}function g(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,w(e)}}(e,a)):(i||(o=function(e,t){var r,n;return n=t,s.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):m(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?m(e,a,t,!1):S(e,a)):m(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function m(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&w(e)),S(e,t)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),y.prototype.destroy=Lr.destroy,y.prototype._undestroy=Lr.undestroy,y.prototype._destroy=function(e,t){this.push(null),t(e)},y.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),g(this,e,t,!1,r)},y.prototype.unshift=function(e){return g(this,e,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(e){return h||(h=r({}).StringDecoder),this._readableState.decoder=new h(e),this._readableState.encoding=e,this};function v(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function w(e){var t=e._readableState;t.needReadable=!1,t.emittedReada
|