/*! dicom-parser - 1.7.6 - 2017-11-04 | (c) 2017 Chris Hafey | https://github.com/chafey/dicomParser */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("dicom-parser",[],t):"object"==typeof exports?exports["dicom-parser"]=t():e.dicomParser=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=43)}([function(e,t,r){"use strict";(function(e){function n(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function m(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function _(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,f/=2,r/=2}var u;if(i){var l=-1;for(u=r;us&&(r=s-f),u=r;u>=0;u--){for(var c=!0,h=0;hi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var f,u,l,c;switch(s){case 1:a<128&&(o=a);break;case 2:f=e[i+1],128==(192&f)&&(c=(31&a)<<6|63&f)>127&&(o=c);break;case 3:f=e[i+1],u=e[i+2],128==(192&f)&&128==(192&u)&&(c=(15&a)<<12|(63&f)<<6|63&u)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:f=e[i+1],u=e[i+2],l=e[i+3],128==(192&f)&&128==(192&u)&&128==(192&l)&&(c=(15&a)<<18|(63&f)<<12|(63&u)<<6|63&l)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return T(n)}function T(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(e,t,r,n,i){return i||j(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,i){return i||j(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(e,t,r,n,52,8),r+8}function Z(e){if(e=C(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function C(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function W(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function G(e){return K.toByteArray(Z(e))}function V(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e){return e!==e}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var K=r(49),X=r(50),$=r(28);t.Buffer=a,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return o(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),X.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),X.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),X.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),X.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){M(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return z(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return z(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1)for(var r=1;r0){var r=(0,o.readFixedString)(this.byteArray,t.dataOffset,t.length),n=r.match(/\\/g);return null===n?1:n.length+1}}},{key:"string",value:function(e,t){var r=this.elements[e];if(r&&r.length>0){var n=(0,o.readFixedString)(this.byteArray,r.dataOffset,r.length);if(t>=0){return n.split("\\")[t].trim()}return n.trim()}}},{key:"text",value:function(e,t){var r=this.elements[e];if(r&&r.length>0){var n=(0,o.readFixedString)(this.byteArray,r.dataOffset,r.length);if(t>=0){return n.split("\\")[t].replace(/ +$/,"")}return n.replace(/ +$/,"")}}},{key:"floatString",value:function(e,t){var r=this.elements[e];if(r&&r.length>0){t=void 0!==t?t:0;var n=this.string(e,t);if(void 0!==n)return parseFloat(n)}}},{key:"intString",value:function(e,t){var r=this.elements[e];if(r&&r.length>0){t=void 0!==t?t:0;var n=this.string(e,t);if(void 0!==n)return parseInt(n)}}},{key:"attributeTag",value:function(e){var t=this.elements[e];if(t&&4===t.length){var r=i(t,this.byteArrayParser).readUint16,n=this.byteArray,a=t.dataOffset;return"x"+("00000000"+(256*r(n,a)*256+r(n,a+2)).toString(16)).substr(-8)}}}]),e}();t.default=s},function(e,t,r){(function(e){function r(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function n(e){return"boolean"==typeof e}function i(e){return null===e}function a(e){return null==e}function o(e){return"number"==typeof e}function s(e){return"string"==typeof e}function f(e){return"symbol"==typeof e}function u(e){return void 0===e}function l(e){return"[object RegExp]"===m(e)}function c(e){return"object"==typeof e&&null!==e}function h(e){return"[object Date]"===m(e)}function d(e){return"[object Error]"===m(e)||e instanceof Error}function p(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function m(e){return Object.prototype.toString.call(e)}t.isArray=r,t.isBoolean=n,t.isNull=i,t.isNullOrUndefined=a,t.isNumber=o,t.isString=s,t.isSymbol=f,t.isUndefined=u,t.isRegExp=l,t.isObject=c,t.isDate=h,t.isError=d,t.isFunction=p,t.isPrimitive=g,t.isBuffer=e.isBuffer}).call(t,r(0).Buffer)},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(r=void 0===r?t.byteArray.length:r,void 0===t)throw"dicomParser.parseDicomDataSetExplicit: missing required parameter 'byteStream'";if(rt.byteArray.length)throw"dicomParser.parseDicomDataSetExplicit: invalid value for parameter 'maxP osition'";for(var i=e.elements;t.positionr)throw"dicomParser:parseDicomDataSetExplicit: buffer overrun"}function a(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(r=void 0===r?e.byteArray.length:r,void 0===t)throw"dicomParser.parseDicomDataSetImplicit: missing required parameter 'byteStream'";if(rt.byteArray.length)throw"dicomParser.parseDicomDataSetImplicit: invalid value for parameter 'maxPosition'";for(var i=e.elements;t.positione.length)throw"dicomParser.readFixedString: attempt to read past end of buffer";for(var n,i="",a=0;a=i.length)throw"dicomParser.ByteStream: parameter 'position' cannot be greater than or equal to 'byteArray' length";this.byteArrayParser=r,this.byteArray=i,this.position=a||0,this.warnings=[]}return i(t,[{key:"seek",value:function(e){if(this.position+e<0)throw"dicomParser.ByteStream.prototype.seek: cannot seek to position < 0";this.position+=e}},{key:"readByteStream",value:function(e){if(this.position+e>this.byteArray.length)throw"dicomParser.ByteStream.prototype.readByteStream: readByteStream - buffer overread";var r=(0,o.default)(this.byteArray,this.position,e);return this.position+=e,new t(this.byteArrayParser,r)}},{key:"readUint16",value:function(){var e=this.byteArrayParser.readUint16(this.byteArray,this.position);return this.position+=2,e}},{key:"readUint32",value:function(){var e=this.byteArrayParser.readUint32(this.byteArray,this.position);return this.position+=4,e}},{key:"readFixedString",value:function(e){var t=(0,s.readFixedString)(this.byteArray,this.position,e);return this.position+=e,t}}]),t}();t.default=f}).call(t,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function r(t,r,n){if(void 0!==e&&t instanceof e)return t.slice(r,r+n);if(t instanceof Uint8Array)return new Uint8Array(t.buffer,t.byteOffset+r,n);throw"dicomParser.from: unknown type for byteArray"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r}).call(t,r(0).Buffer)},function(e,t,r){"use strict";(function(t){function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(a=new Array(s-1),o=0;oe.length)throw"littleEndianByteArrayParser.readUint16: attempt to read past end of buffer";return e[t]+256*e[t+1]},readInt16:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"littleEndianByteArrayParser.readInt16: attempt to read past end of buffer";var r=e[t]+(e[t+1]<<8);return 32768&r&&(r=r-65535-1),r},readUint32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readUint32: attempt to read past end of buffer";return e[t]+256*e[t+1]+256*e[t+2]*256+256*e[t+3]*256*256},readInt32:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readInt32: attempt to read past end of buffer";return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)},readFloat:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"littleEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"littleEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"littleEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],r[4]=e[t+4],r[5]=e[t+5],r[6]=e[t+6],r[7]=e[t+7],new Float64Array(r.buffer)[0]}}},function(e,t,r){function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}var a=r(0),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=i),n(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,n,i){if(n=n||1,i=i||t.fragments,void 0===e)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'dataSet'";if(void 0===t)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'pixelDataElement'";if(void 0===r)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'startFragmentIndex'";if(void 0===n)throw"dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'numFragments'";if("x7fe00010"!==t.tag)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010";if(!0!==t.encapsulatedPixelData)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(!0!==t.hadUndefinedLength)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.basicOffsetTable)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.fragments)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(t.fragments.length<=0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data";if(r<0)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be >= 0";if(r>=t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be < number of fragments";if(n<1)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'numFragments' must be > 0";if(r+n>t.fragments.length)throw"dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragment' + 'numFragments' < number of fragments";var a=new f.default(e.byteArrayParser,e.byteArray,t.dataOffset),s=(0,l.default)(a);if("xfffee000"!==s.tag)throw"dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000";a.seek(s.length);var u=a.position;if(1===n)return(0,h.default)(a.byteArray,u+i[r].offset+8,i[r].length);for(var c=d(i,r,n),p=(0,o.default)(a.byteArray,c),g=0,m=r;me.byteArray.length-e.position&&(l=e.byteArray.length-e.position),t.fragments.push({offset:e.position-f-8,position:e.position,length:l}),e.seek(l),void(t.length=e.position-t.dataOffset);t.fragments.push({offset:e.position-f-8,position:e.position,length:l}),e.seek(l)}r&&r.push("pixel data element "+t.tag+" missing sequence delimiter tag xfffee0dd")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i=r(1),a=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,r){"use strict";function n(e,t){if(void 0===e)throw"dicomParser.findAndSetUNElementLength: missing required parameter 'byteStream'";for(var r=e.byteArray.length-8;e.position<=r;){if(65534===e.readUint16()){if(57565===e.readUint16()){return 0!==e.readUint32()&&e.warnings("encountered non zero length following item delimiter at position "+(e.position-4)+" while reading element of undefined length with tag "+t.tag),void(t.length=e.position-t.dataOffset)}}}t.length=e.byteArray.length-t.dataOffset,e.seek(e.byteArray.length-e.position)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){for(var r={};e.positione.length)throw"bigEndianByteArrayParser.readUint16: attempt to read past end of buffer";return(e[t]<<8)+e[t+1]},readInt16:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt16: position cannot be less than 0";if(t+2>e.length)throw"bigEndianByteArrayParser.readInt16: attempt to read past end of buffer";var r=(e[t]<<8)+e[t+1];return 32768&r&&(r=r-65535-1),r},readUint32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readUint32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readUint32: attempt to read past end of buffer";return 256*(256*(256*e[t]+e[t+1])+e[t+2])+e[t+3]},readInt32:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readInt32: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readInt32: attempt to read past end of buffer";return(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]},readFloat:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readFloat: position cannot be less than 0";if(t+4>e.length)throw"bigEndianByteArrayParser.readFloat: attempt to read past end of buffer";var r=new Uint8Array(4);return r[3]=e[t],r[2]=e[t+1],r[1]=e[t+2],r[0]=e[t+3],new Float32Array(r.buffer)[0]},readDouble:function(e,t){if(t<0)throw"bigEndianByteArrayParser.readDouble: position cannot be less than 0";if(t+8>e.length)throw"bigEndianByteArrayParser.readDouble: attempt to read past end of buffer";var r=new Uint8Array(8);return r[7]=e[t],r[6]=e[t+1],r[5]=e[t+2],r[4]=e[t+3],r[3]=e[t+4],r[2]=e[t+5],r[1]=e[t+6],r[0]=e[t+7],new Float64Array(r.buffer)[0]}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){function r(){if(n.seek(128),"DICM"!==n.readFixedString(4))throw"dicomParser.readPart10Header: DICM prefix not found at location 132 - this is not a valid DICOM P10 file."}if(void 0===e)throw"dicomParser.readPart10Header: missing required parameter 'byteArray'";var n=new o.default(l.default,e);return function(){r();for(var e=[],t={};n.position"x0002ffff"){n.position=i;break}a.parser=l.default,t[a.tag]=a}var o=new f.default(n.byteArrayParser,n.byteArray,t);return o.warnings=n.warnings,o.position=n.position,o}()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var a=r(12),o=n(a),s=r(5),f=n(s),u=r(20),l=n(u),c=r(9),h=n(c)},function(e,t,r){"use strict";(function(t,n){function i(e){return F.from(e)}function a(e){return F.isBuffer(e)||e instanceof j}function o(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?B(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function s(e,t){L=L||r(4),e=e||{},this.objectMode=!!e.objectMode,t instanceof L&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new q,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&&(C||(C=r(36).StringDecoder),this.decoder=new C(e.encoding),this.encoding=e.encoding)}function f(e){if(L=L||r(4),!(this instanceof f))return new f(e);this._readableState=new s(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),U.call(this)}function u(e,t,r,n,a){var o=e._readableState;if(null===t)o.reading=!1,g(e,o);else{var s;a||(s=c(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===F.prototype||(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):l(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?l(e,o,t,!1):b(e,o)):l(e,o,t,!1))):n||(o.reading=!1)}return h(o)}function l(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&&m(e)),b(e,t)}function c(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function h(e){return!e.ended&&(e.needReadable||e.length=H?e=H:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(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=d(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function g(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,m(e)}}function m(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Z("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(_,e):_(e))}function _(e){Z("emit readable"),e.emit("readable"),x(e)}function b(e,t){t.readingMore||(t.readingMore=!0,D(v,e,t))}function v(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=A(e,t.buffer,t.decoder),r}function A(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}function O(e,t){var r=F.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return Z("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):m(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&T(this),null;var n=t.needReadable;Z("need readable",n),(0===t.length||t.length-e0?S(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},f.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(e,t){function r(e,t){Z("onunpipe"),e===h&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){Z("onend"),e.end()}function a(){Z("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",m),e.removeListener("error",f),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",c),h.removeListener("data",s),_=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function s(t){Z("ondata"),b=!1,!1!==e.write(t)||b||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==I(d.pipes,e))&&!_&&(Z("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,b=!0),h.pause())}function f(t){Z("onerror",t),c(),e.removeListener("error",f),0===M(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),c()}function l(){Z("onfinish"),e.removeListener("close",u),c()}function c(){Z("unpipe"),h.unpipe(e)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,Z("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,g=p?i:c;d.endEmitted?D(g):h.once("end",g),e.on("unpipe",r);var m=y(h);e.on("drain",m);var _=!1,b=!1;return h.on("data",s),o(e,"error",f),e.once("close",u),e.once("finish",l),e.emit("pipe",h),d.flowing||(Z("pipe resume"),h.resume()),e},f.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){e.exports=r(32).EventEmitter},function(e,t,r){"use strict";function n(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(n||i)return void(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||o(a,this,e));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(o(a,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit("error",t)}var o=r(14);e.exports={destroy:n,undestroy:i}},function(e,t,r){"use strict";(function(t,n,i){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){P(t,e)}}function o(e){return B.from(e)}function s(e){return B.isBuffer(e)||e instanceof M}function f(){}function u(e,t){T=T||r(4),e=e||{},this.objectMode=!!e.objectMode,t instanceof T&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){b(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function l(e){if(T=T||r(4),!(F.call(l,this)||this instanceof T))return new l(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),L.call(this)}function c(e,t){var r=new Error("write after end");e.emit("error",r),O(t,r)}function h(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),O(n,a),i=!1),i}function d(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=B.from(t,r)),t}function p(e,t,r,n,i,a){if(!r){var o=d(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1?n:O;l.WritableState=u;var I=r(6);I.inherits=r(7);var D={deprecate:r(61)},L=r(33),B=r(21).Buffer,M=i.Uint8Array||function(){},U=r(34);I.inherits(l,L),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:D.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var F;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(e){return!!F.call(this,e)||e&&e._writableState instanceof u}})):F=function(e){return e instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=s(e)&&!n.objectMode;return a&&!B.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=f),n.ended?c(this,r):(a||h(this,n,e,r))&&(n.pendingcb++,i=p(this,n,a,e,t,r)),i},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},l.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},l.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||A(this,n,r)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),l.prototype.destroy=U.destroy,l.prototype._undestroy=U.undestroy,l.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(3),r(59).setImmediate,r(2))},function(e,t,r){function n(e){if(e&&!f(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var s=r(0).Buffer,f=s.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),n(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,i)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},function(e,t,r){"use strict";function n(e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length>>16&65535|0,o=0;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var a=i,o=n+r;e^=-1;for(var s=n;s>>8^a[255&(e^t[s])];return-1^e}var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=n},function(e,t,r){(function(e,n){function i(e,r){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),f(n,e,n.depth)}function a(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function o(e,t){return e}function s(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function f(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=f(e,i,n)),i}var a=u(e,r);if(a)return a;var o=Object.keys(r),g=s(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),S(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(r);if(0===o.length){if(A(r)){var m=r.name?": "+r.name:"";return e.stylize("[Function"+m+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var _="",b=!1,y=["{","}"];if(p(r)&&(b=!0,y=["[","]"]),A(r)){_=" [Function"+(r.name?": "+r.name:"")+"]"}if(E(r)&&(_=" "+RegExp.prototype.toString.call(r)),x(r)&&(_=" "+Date.prototype.toUTCString.call(r)),S(r)&&(_=" "+l(r)),0===o.length&&(!b||0==r.length))return y[0]+_+y[1];if(n<0)return E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var w;return w=b?c(e,r,n,g,o):o.map(function(t){return h(e,r,n,g,t,b)}),e.seen.pop(),d(w,_,y)}function u(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,n,i){for(var a=[],o=0,s=t.length;o-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),w(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function p(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function _(e){return null==e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return"symbol"==typeof e}function w(e){return void 0===e}function E(e){return k(e)&&"[object RegExp]"===O(e)}function k(e){return"object"==typeof e&&null!==e}function x(e){return k(e)&&"[object Date]"===O(e)}function S(e){return k(e)&&("[object Error]"===O(e)||e instanceof Error)}function A(e){return"function"==typeof e}function P(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function O(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}function R(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r= 0";if(r>=n.length)throw"dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be < basicOffsetTable.length";var f=n[r],u=o(i,f);if(void 0===u)throw"dicomParser.readEncapsulatedImageFrame: unable to find fragment that matches basic offset table entry";var l=s(r,n,i,u);return(0,a.default)(e,t,u,l,i)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i=r(22),a=function(e){return e&&e.__esModule?e:{default:e}}(i),o=function(e,t){for(var r=0;r=2){var r=parseInt(e.substring(0,2),10),n=e.length>=4?parseInt(e.substring(2,4),10):void 0,i=e.length>=6?parseInt(e.substring(4,6),10):void 0,a=e.length>=8?parseInt(e.substring(7,13),10):void 0;if(t&&(isNaN(r)||void 0!==n&&isNaN(n)||void 0!==i&&isNaN(i)||void 0!==a&&isNaN(a)||r<0||r>23||n&&(n<0||n>59)||i&&(i<0||i>59)||a&&(a<0||a>999999)))throw"invalid TM '"+e+"'";return{hours:r,minutes:n,seconds:i,fractionalSeconds:a}}if(t)throw"invalid TM '"+e+"'"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function n(e,t){switch(e){case 2:return t%4==0&&t%100||t%400==0?29:28;case 9:case 4:case 6:case 11:return 30;default:return 31}}function i(e,t,r){return!isNaN(r)&&(t>0&&t<=12&&e>0&&e<=n(t,r))}function a(e,t){if(e&&8===e.length){var r=parseInt(e.substring(0,4),10),n=parseInt(e.substring(4,6),10),a=parseInt(e.substring(6,8),10);if(t&&!0!==i(a,n,r))throw"invalid DA '"+e+"'";return{year:r,month:n,day:a}}if(t)throw"invalid DA '"+e+"'"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=a},function(e,t,r){"use strict";function n(e,t){if(void 0===e)throw"dicomParser.explicitDataSetToJS: missing required parameter dataSet";t=t||{omitPrivateAttibutes:!0,maxElementLength:128};var r={};for(var i in e.elements){var o=e.elements[i];if(!0!==t.omitPrivateAttibutes||!s.isPrivateTag(i))if(o.items){for(var f=[],u=0;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function a(e){var t,r,i,a,o,s=e.length;a=n(e),o=new c(3*s/4-a),r=a>0?s-4:s;var f=0;for(t=0;t>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===a?(i=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,o[f++]=255&i):1===a&&(i=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,r){for(var n,i=[],a=t;af?f:o+16383));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),a.push(i),a.join("")}t.byteLength=i,t.toByteArray=a,t.fromByteArray=f;for(var u=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d>1,l=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+c],c+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+c],c+=h,l-=8);if(0===a)a=1-u;else{if(a===f)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,f,u=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),t+=o+c>=1?h/f:h*Math.pow(2,1-c),t*f>=2&&(o++,f/=2),o+c>=l?(s=0,o=l):o+c>=1?(s=(t*f-1)*Math.pow(2,i),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*g}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="1.7.6"},function(e,t,r){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(t,n){function i(e){if(void 0===e.elements.x00020010)throw"dicomParser.parseDicom: missing required meta header attribute 0002,0010";var r=e.elements.x00020010;return w.readFixedString(t,r.dataOffset,r.length)}function a(e){return"1.2.840.10008.1.2"!==e}function o(i,a){if("1.2.840.10008.1.2.1.99"===i){if(n&&n.inflater){var o=n.inflater(t,a);return new c.default(g.default,o,0)}if(void 0!==e&&this.module!==e){var f=r(54),l=(0,v.default)(t,a,t.length-a),h=f.inflateRawSync(l),d=(0,s.default)(t,h.length+a);return t.copy(d,0,0,a),h.copy(d,a),new c.default(g.default,d,0)}if("undefined"!=typeof pako){var p=t.slice(a),m=pako.inflateRaw(p),_=(0,s.default)(t,m.length+a);return _.set(t.slice(0,a),0),_.set(m,a),new c.default(g.default,_,0)}throw"dicomParser.parseDicom: no inflater available to handle deflate transfer syntax"}return"1.2.840.10008.1.2.2"===i?new c.default(u.default,t,a):new c.default(g.default,t,a)}function f(e,t){for(var r in e.elements)e.elements.hasOwnProperty(r)&&(t.elements[r]=e.elements[r]);return void 0!==e.warnings&&(t.warnings=e.warnings.concat(t.warnings)),t}function l(e){var t=i(e),r=a(t),s=o(t,e.position),f={},u=new d.default(s.byteArrayParser,s.byteArray,f);u.warnings=s.warnings;try{r?k.parseDicomDataSetExplicit(u,s,s.byteArray.length,n):k.parseDicomDataSetImplicit(u,s,s.byteArray.length,n)}catch(e){var l={exception:e,dataSet:u};throw l}return u}if(void 0===t)throw"dicomParser.parseDicom: missing required parameter 'byteArray'";return function(){var e=(0,_.default)(t,n);return f(e,l(e))}()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var o=r(19),s=i(o),f=r(29),u=i(f),l=r(12),c=i(l),h=r(5),d=i(h),p=r(20),g=i(p),m=r(30),_=i(m),b=r(13),v=i(b),y=r(10),w=n(y),E=r(8),k=n(E)}).call(t,r(53)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(e,n){function i(t,r,n){function i(){for(var e;null!==(e=t.read());)s.push(e),f+=e.length;t.once("readable",i)}function a(e){t.removeListener("end",o),t.removeListener("readable",i),n(e)}function o(){var r=e.concat(s,f);s=[],n(null,r),t.close()}var s=[],f=0;t.on("error",a),t.on("end",o),t.end(r),i()}function a(t,r){if("string"==typeof r&&(r=new e(r)),!e.isBuffer(r))throw new TypeError("Not a string or buffer");var n=g.Z_FINISH;return t._processChunk(r,n)}function o(e){if(!(this instanceof o))return new o(e);d.call(this,e,g.DEFLATE)}function s(e){if(!(this instanceof s))return new s(e);d.call(this,e,g.INFLATE)}function f(e){if(!(this instanceof f))return new f(e);d.call(this,e,g.GZIP)}function u(e){if(!(this instanceof u))return new u(e);d.call(this,e,g.GUNZIP)}function l(e){if(!(this instanceof l))return new l(e);d.call(this,e,g.DEFLATERAW)}function c(e){if(!(this instanceof c))return new c(e);d.call(this,e,g.INFLATERAW)}function h(e){if(!(this instanceof h))return new h(e);d.call(this,e,g.UNZIP)}function d(r,n){if(this._opts=r=r||{},this._chunkSize=r.chunkSize||t.Z_DEFAULT_CHUNK,p.call(this,r),r.flush&&r.flush!==g.Z_NO_FLUSH&&r.flush!==g.Z_PARTIAL_FLUSH&&r.flush!==g.Z_SYNC_FLUSH&&r.flush!==g.Z_FULL_FLUSH&&r.flush!==g.Z_FINISH&&r.flush!==g.Z_BLOCK)throw new Error("Invalid flush flag: "+r.flush);if(this._flushFlag=r.flush||g.Z_NO_FLUSH,r.chunkSize&&(r.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+r.chunkSize);if(r.windowBits&&(r.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+r.windowBits);if(r.level&&(r.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+r.level);if(r.memLevel&&(r.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+r.memLevel);if(r.strategy&&r.strategy!=t.Z_FILTERED&&r.strategy!=t.Z_HUFFMAN_ONLY&&r.strategy!=t.Z_RLE&&r.strategy!=t.Z_FIXED&&r.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+r.strategy);if(r.dictionary&&!e.isBuffer(r.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new g.Zlib(n);var i=this;this._hadError=!1,this._binding.onerror=function(e,r){i._binding=null,i._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],i.emit("error",n)};var a=t.Z_DEFAULT_COMPRESSION;"number"==typeof r.level&&(a=r.level);var o=t.Z_DEFAULT_STRATEGY;"number"==typeof r.strategy&&(o=r.strategy),this._binding.init(r.windowBits||t.Z_DEFAULT_WINDOWBITS,a,r.memLevel||t.Z_DEFAULT_MEMLEVEL,o,r.dictionary),this._buffer=new e(this._chunkSize),this._offset=0,this._closed=!1,this._level=a,this._strategy=o,this.once("end",this.close)}var p=r(55),g=r(63),m=r(41),_=r(73).ok;g.Z_MIN_WINDOWBITS=8,g.Z_MAX_WINDOWBITS=15,g.Z_DEFAULT_WINDOWBITS=15,g.Z_MIN_CHUNK=64,g.Z_MAX_CHUNK=1/0,g.Z_DEFAULT_CHUNK=16384,g.Z_MIN_MEMLEVEL=1,g.Z_MAX_MEMLEVEL=9,g.Z_DEFAULT_MEMLEVEL=8,g.Z_MIN_LEVEL=-1,g.Z_MAX_LEVEL=9,g.Z_DEFAULT_LEVEL=g.Z_DEFAULT_COMPRESSION,Object.keys(g).forEach(function(e){e.match(/^Z/)&&(t[e]=g[e])}),t.codes={Z_OK:g.Z_OK,Z_STREAM_END:g.Z_STREAM_END,Z_NEED_DICT:g.Z_NEED_DICT,Z_ERRNO:g.Z_ERRNO,Z_STREAM_ERROR:g.Z_STREAM_ERROR,Z_DATA_ERROR:g.Z_DATA_ERROR,Z_MEM_ERROR:g.Z_MEM_ERROR,Z_BUF_ERROR:g.Z_BUF_ERROR,Z_VERSION_ERROR:g.Z_VERSION_ERROR},Object.keys(t.codes).forEach(function(e){t.codes[t.codes[e]]=e}),t.Deflate=o,t.Inflate=s,t.Gzip=f,t.Gunzip=u,t.DeflateRaw=l,t.InflateRaw=c,t.Unzip=h,t.createDeflate=function(e){return new o(e)},t.createInflate=function(e){return new s(e)},t.createDeflateRaw=function(e){return new l(e)},t.createInflateRaw=function(e){return new c(e)},t.createGzip=function(e){return new f(e)},t.createGunzip=function(e){return new u(e)},t.createUnzip=function(e){return new h(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new o(t),e,r)},t.deflateSync=function(e,t){return a(new o(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},t.gzipSync=function(e,t){return a(new f(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},t.deflateRawSync=function(e,t){return a(new l(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},t.unzipSync=function(e,t){return a(new h(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},t.inflateSync=function(e,t){return a(new s(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},t.gunzipSync=function(e,t){return a(new u(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},t.inflateRawSync=function(e,t){return a(new c(t),e)},m.inherits(d,p),d.prototype.params=function(e,r,i){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var a=this;this.flush(g.Z_SYNC_FLUSH,function(){a._binding.params(e,r),a._hadError||(a._level=e,a._strategy=r,i&&i())})}else n.nextTick(i)},d.prototype.reset=function(){return this._binding.reset()},d.prototype._flush=function(t){this._transform(new e(0),"",t)},d.prototype.flush=function(t,r){var i=this._writableState;if(("function"==typeof t||void 0===t&&!r)&&(r=t,t=g.Z_FULL_FLUSH),i.ended)r&&n.nextTick(r);else if(i.ending)r&&this.once("end",r);else if(i.needDrain){var a=this;this.once("drain",function(){a.flush(r)})}else this._flushFlag=t,this.write(new e(0),"",r)},d.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},d.prototype._transform=function(t,r,n){var i,a=this._writableState,o=a.ending||a.ended,s=o&&(!t||a.length===t.length);if(null===!t&&!e.isBuffer(t))return n(new Error("invalid input"));s?i=g.Z_FINISH:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||g.Z_NO_FLUSH));this._processChunk(t,i,n)},d.prototype._processChunk=function(t,r,n){function i(l,d){if(!f._hadError){var p=o-d;if(_(p>=0,"have should not go down"),p>0){var g=f._buffer.slice(f._offset,f._offset+p);f._offset+=p,u?f.push(g):(c.push(g),h+=g.length)}if((0===d||f._offset>=f._chunkSize)&&(o=f._chunkSize,f._offset=0,f._buffer=new e(f._chunkSize)),0===d){if(s+=a-l,a=l,!u)return!0;var m=f._binding.write(r,t,s,a,f._buffer,f._offset,f._chunkSize);return m.callback=i,void(m.buffer=t)}if(!u)return!1;n()}}var a=t&&t.length,o=this._chunkSize-this._offset,s=0,f=this,u="function"==typeof n;if(!u){var l,c=[],h=0;this.on("error",function(e){l=e});do{var d=this._binding.writeSync(r,t,s,a,this._buffer,this._offset,o)}while(!this._hadError&&i(d[0],d[1]));if(this._hadError)throw l;var p=e.concat(c,h);return this.close(),p}var g=this._binding.write(r,t,s,a,this._buffer,this._offset,o);g.buffer=t,g.callback=i},m.inherits(o,d),m.inherits(s,d),m.inherits(f,d),m.inherits(u,d),m.inherits(l,d),m.inherits(c,d),m.inherits(h,d)}).call(t,r(0).Buffer,r(3))},function(e,t,r){e.exports=r(56).Transform},function(e,t,r){t=e.exports=r(31),t.Stream=t,t.Readable=t,t.Writable=r(35),t.Duplex=r(4),t.Transform=r(37),t.PassThrough=r(62)},function(e,t){},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){e.copy(t,r)}var a=r(21).Buffer;e.exports=function(){function e(){n(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)i(r.data,t,n),n+=r.data.length,r=r.next;return t},e}()},function(e,t,r){function n(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new n(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(60),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,r){(function(e,t){!function(e,r){"use strict";function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function a(e,t){for(var r=0;r4?9:0)}function a(e){for(var t=e.length;--t>=0;)e[t]=0}function o(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(R.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function s(e,t){I._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function f(e,t){e.pending_buf[e.pending++]=t}function u(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function l(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,R.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=D(e.adler,t,i,r):2===e.state.wrap&&(e.adler=L(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function c(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,f=e.strstart>e.w_size-ue?e.strstart-(e.w_size-ue):0,u=e.window,l=e.w_mask,c=e.prev,h=e.strstart+fe,d=u[a+o-1],p=u[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+o]===p&&u[r+o-1]===d&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;d=u[a+o-1],p=u[a+o]}}}while((t=c[t&l])>f&&0!=--i);return o<=e.lookahead?o:e.lookahead}function h(e){var t,r,n,i,a,o=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-ue)){R.arraySet(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,r=e.hash_size,t=r;do{n=e.head[--t],e.head[t]=n>=o?n-o:0}while(--r);r=o,t=r;do{n=e.prev[--t],e.prev[t]=n>=o?n-o:0}while(--r);i+=o}if(0===e.strm.avail_in)break;if(r=l(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=se)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(h(e),0===e.lookahead&&t===M)return be;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,s(e,!1),0===e.strm.avail_out))return be;if(e.strstart-e.block_start>=e.w_size-ue&&(s(e,!1),0===e.strm.avail_out))return be}return e.insert=0,t===j?(s(e,!0),0===e.strm.avail_out?ye:we):(e.strstart>e.block_start&&(s(e,!1),e.strm.avail_out),be)}function p(e,t){for(var r,n;;){if(e.lookahead=se&&(e.ins_h=(e.ins_h<=se)if(n=I._tr_tally(e,e.strstart-e.match_start,e.match_length-se),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=se){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=se&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=se-1)),e.prev_length>=se&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-se,n=I._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-se),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<=se&&e.strstart>0&&(i=e.strstart-1,(n=o[i])===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+fe;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=se?(r=I._tr_tally(e,1,e.match_length-se),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=I._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(s(e,!1),0===e.strm.avail_out))return be}return e.insert=0,t===j?(s(e,!0),0===e.strm.avail_out?ye:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?be:ve}function _(e,t){for(var r;;){if(0===e.lookahead&&(h(e),0===e.lookahead)){if(t===M)return be;break}if(e.match_length=0,r=I._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(s(e,!1),0===e.strm.avail_out))return be}return e.insert=0,t===j?(s(e,!0),0===e.strm.avail_out?ye:we):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?be:ve}function b(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function v(e){e.window_size=2*e.w_size,a(e.head),e.max_lazy_match=T[e.level].max_lazy,e.good_match=T[e.level].good_length,e.nice_match=T[e.level].nice_length,e.max_chain_length=T[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=se-1,e.match_available=0,e.ins_h=0}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ae),this.dyn_dtree=new R.Buf16(2*(2*ne+1)),this.bl_tree=new R.Buf16(2*(2*ie+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(oe+1),this.heap=new R.Buf16(2*re+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*re+1),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function w(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=X,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ce:me,e.adler=2===t.wrap?0:1,t.last_flush=M,I._tr_init(t),N):n(e,C)}function E(e){var t=w(e);return t===N&&v(e.state),t}function k(e,t){return e&&e.state?2!==e.state.wrap?C:(e.state.gzhead=t,N):C}function x(e,t,r,i,a,o){if(!e)return C;var s=1;if(t===W&&(t=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>Q||r!==$||i<8||i>15||t<0||t>9||o<0||o>J)return n(e,C);8===i&&(i=9);var f=new y;return e.state=f,f.strm=e,f.wrap=s,f.gzhead=null,f.w_bits=i,f.w_size=1<z||t<0)return e?n(e,C):C;if(s=e.state,!e.output||!e.input&&0!==e.avail_in||s.status===_e&&t!==j)return n(e,0===e.avail_out?Y:C);if(s.strm=e,r=s.last_flush,s.last_flush=t,s.status===ce)if(2===s.wrap)e.adler=0,f(s,31),f(s,139),f(s,8),s.gzhead?(f(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),f(s,255&s.gzhead.time),f(s,s.gzhead.time>>8&255),f(s,s.gzhead.time>>16&255),f(s,s.gzhead.time>>24&255),f(s,9===s.level?2:s.strategy>=G||s.level<2?4:0),f(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(f(s,255&s.gzhead.extra.length),f(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(e.adler=L(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=he):(f(s,0),f(s,0),f(s,0),f(s,0),f(s,0),f(s,9===s.level?2:s.strategy>=G||s.level<2?4:0),f(s,Ee),s.status=me);else{var h=$+(s.w_bits-8<<4)<<8,d=-1;d=s.strategy>=G||s.level<2?0:s.level<6?1:6===s.level?2:3,h|=d<<6,0!==s.strstart&&(h|=le),h+=31-h%31,s.status=me,u(s,h),0!==s.strstart&&(u(s,e.adler>>>16),u(s,65535&e.adler)),e.adler=1}if(s.status===he)if(s.gzhead.extra){for(l=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>l&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),o(e),l=s.pending,s.pending!==s.pending_buf_size));)f(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>l&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=de)}else s.status=de;if(s.status===de)if(s.gzhead.name){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),o(e),l=s.pending,s.pending===s.pending_buf_size)){c=1;break}c=s.gzindexl&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),0===c&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),o(e),l=s.pending,s.pending===s.pending_buf_size)){c=1;break}c=s.gzindexl&&(e.adler=L(e.adler,s.pending_buf,s.pending-l,l)),0===c&&(s.status=ge)}else s.status=ge;if(s.status===ge&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&o(e),s.pending+2<=s.pending_buf_size&&(f(s,255&e.adler),f(s,e.adler>>8&255),e.adler=0,s.status=me)):s.status=me),0!==s.pending){if(o(e),0===e.avail_out)return s.last_flush=-1,N}else if(0===e.avail_in&&i(t)<=i(r)&&t!==j)return n(e,Y);if(s.status===_e&&0!==e.avail_in)return n(e,Y);if(0!==e.avail_in||0!==s.lookahead||t!==M&&s.status!==_e){var p=s.strategy===G?_(s,t):s.strategy===V?m(s,t):T[s.level].func(s,t);if(p!==ye&&p!==we||(s.status=_e),p===be||p===ye)return 0===e.avail_out&&(s.last_flush=-1),N;if(p===ve&&(t===U?I._tr_align(s):t!==z&&(I._tr_stored_block(s,0,0,!1),t===F&&(a(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),o(e),0===e.avail_out))return s.last_flush=-1,N}return t!==j?N:s.wrap<=0?Z:(2===s.wrap?(f(s,255&e.adler),f(s,e.adler>>8&255),f(s,e.adler>>16&255),f(s,e.adler>>24&255),f(s,255&e.total_in),f(s,e.total_in>>8&255),f(s,e.total_in>>16&255),f(s,e.total_in>>24&255)):(u(s,e.adler>>>16),u(s,65535&e.adler)),o(e),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?N:Z)}function P(e){var t;return e&&e.state?(t=e.state.status)!==ce&&t!==he&&t!==de&&t!==pe&&t!==ge&&t!==me&&t!==_e?n(e,C):(e.state=null,t===me?n(e,q):N):C}function O(e,t){var r,n,i,o,s,f,u,l,c=t.length;if(!e||!e.state)return C;if(r=e.state,2===(o=r.wrap)||1===o&&r.status!==ce||r.lookahead)return C;for(1===o&&(e.adler=D(e.adler,t,c,0)),r.wrap=0,c>=r.w_size&&(0===o&&(a(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new R.Buf8(r.w_size),R.arraySet(l,t,c-r.w_size,r.w_size,0),t=l,c=r.w_size),s=e.avail_in,f=e.next_in,u=e.input,e.avail_in=c,e.next_in=0,e.input=t,h(r);r.lookahead>=se;){n=r.strstart,i=r.lookahead-(se-1);do{r.ins_h=(r.ins_h<=0;)e[t]=0}function i(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function a(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return e<256?ae[e]:ae[256+(e>>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function f(e,t,r){e.bi_valid>G-r?(e.bi_buf|=t<>G-e.bi_valid,e.bi_valid+=r-G):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function c(e){16===e.bi_valid?(s(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function h(e,t){var r,n,i,a,o,s,f=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,c=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(a=0;a<=H;a++)e.bl_count[a]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(a=p,g++),f[2*n+1]=a,n>u||(e.bl_count[a]++,o=0,n>=d&&(o=h[n-d]),s=f[2*n],e.opt_len+=s*(a+o),c&&(e.static_len+=s*(l[2*n+1]+o)));if(0!==g){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>u||(f[2*i+1]!==a&&(e.opt_len+=(a-f[2*i+1])*f[2*i],f[2*i+1]=a),n--)}}function d(e,t,r){var n,i,a=new Array(H+1),o=0;for(n=1;n<=H;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=l(a[s]++,s))}}function p(){var e,t,r,n,a,o=new Array(H+1);for(r=0,n=0;n>=7;n8?s(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function _(e,t,r,n){m(e),n&&(s(e,r),s(e,~r)),D.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function b(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)v(e,a,r);i=f;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],v(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,v(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],h(e,t),d(a,u,e.bl_count)}function E(e,t,r){var n,i,a=-1,o=t[1],s=0,f=7,u=4;for(0===o&&(f=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s=3&&0===e.bl_tree[2*re[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function S(e,t,r,n){var i;for(f(e,t-257,5),f(e,r-1,5),f(e,n-4,4),i=0;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return B;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return M;for(t=32;t0?(e.strm.data_type===U&&(e.strm.data_type=A(e)),w(e,e.l_desc),w(e,e.d_desc),o=x(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?O(e,t,r,n):e.strategy===L||a===i?(f(e,(j<<1)+(n?1:0),3),y(e,ne,ie)):(f(e,(z<<1)+(n?1:0),3),S(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),y(e,e.dyn_ltree,e.dyn_dtree)),g(e),n&&m(e)}function I(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(oe[r]+Z+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1}var D=r(15),L=4,B=0,M=1,U=2,F=0,j=1,z=2,N=29,Z=256,C=Z+1+N,q=30,Y=19,W=2*C+1,H=15,G=16,V=7,J=256,K=16,X=17,$=18,Q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],te=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ne=new Array(2*(C+2));n(ne);var ie=new Array(2*q);n(ie);var ae=new Array(512);n(ae);var oe=new Array(256);n(oe);var se=new Array(N);n(se);var fe=new Array(q);n(fe);var ue,le,ce,he=!1;t._tr_init=P,t._tr_stored_block=O,t._tr_flush_block=R,t._tr_tally=I,t._tr_align=T},function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new b.Buf16(320),this.work=new b.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new b.Buf32(ge),t.distcode=t.distdyn=new b.Buf32(me),t.sane=1,t.back=-1,T):D}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):D}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?D:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o(e))):D}function f(e,t){var r,n;return e?(n=new i,e.state=n,n.window=null,r=s(e,t),r!==T&&(e.state=null),r):D}function u(e){return f(e,_e)}function l(e){if(be){var t;for(m=new b.Buf32(512),_=new b.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(E(x,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;E(S,e.lens,0,32,_,0,e.work,{bits:5}),be=!1}e.lencode=m,e.lenbits=9,e.distcode=_,e.distbits=5}function c(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(b.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),b.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(b.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=y(r.check,Pe,2,0),h=0,d=0,r.mode=j;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((15&h)!==U){e.msg="unknown compression method",r.mode=he;break}if(h>>>=4,d-=4,Ee=8+(15&h),0===r.wbits)r.wbits=Ee;else if(Ee>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<>8&1),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=y(r.check,Pe,2,0)),h=0,d=0,r.mode=z;case z:for(;d<32;){if(0===f)break e;f--,h+=i[o++]<>>8&255,Pe[2]=h>>>16&255,Pe[3]=h>>>24&255,r.check=y(r.check,Pe,4,0)),h=0,d=0,r.mode=N;case N:for(;d<16;){if(0===f)break e;f--,h+=i[o++]<>8),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=y(r.check,Pe,2,0)),h=0,d=0,r.mode=Z;case Z:if(1024&r.flags){for(;d<16;){if(0===f)break e;f--,h+=i[o++]<>>8&255,r.check=y(r.check,Pe,2,0)),h=0,d=0}else r.head&&(r.head.extra=null);r.mode=C;case C:if(1024&r.flags&&(m=r.length,m>f&&(m=f),m&&(r.head&&(Ee=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),b.arraySet(r.head.extra,i,o,m,Ee)),512&r.flags&&(r.check=y(r.check,i,m,o)),f-=m,o+=m,r.length-=m),r.length))break e;r.length=0,r.mode=q;case q:if(2048&r.flags){if(0===f)break e;m=0;do{Ee=i[o+m++],r.head&&Ee&&r.length<65536&&(r.head.name+=String.fromCharCode(Ee))}while(Ee&&m>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=V;break;case H:for(;d<32;){if(0===f)break e;f--,h+=i[o++]<>>=7&d,d-=7&d,r.mode=ue;break}for(;d<3;){if(0===f)break e;f--,h+=i[o++]<>>=1,d-=1,3&h){case 0:r.mode=K;break;case 1:if(l(r),r.mode=re,t===O){h>>>=2,d-=2;break e}break;case 2:r.mode=Q;break;case 3:e.msg="invalid block type",r.mode=he}h>>>=2,d-=2;break;case K:for(h>>>=7&d,d-=7&d;d<32;){if(0===f)break e;f--,h+=i[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=65535&h,h=0,d=0,r.mode=X,t===O)break e;case X:r.mode=$;case $:if(m=r.length){if(m>f&&(m=f),m>u&&(m=u),0===m)break e;b.arraySet(a,i,o,m,s),f-=m,o+=m,u-=m,s+=m,r.length-=m;break}r.mode=V;break;case Q:for(;d<14;){if(0===f)break e;f--,h+=i[o++]<>>=5,d-=5,r.ndist=1+(31&h),h>>>=5,d-=5,r.ncode=4+(15&h),h>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=ee;case ee:for(;r.have>>=3,d-=3}for(;r.have<19;)r.lens[Oe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,xe={bits:r.lenbits},ke=E(k,r.lens,0,19,r.lencode,0,r.work,xe),r.lenbits=xe.bits,ke){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=te;case te:for(;r.have>>24,_e=Ae>>>16&255,be=65535&Ae,!(me<=d);){if(0===f)break e;f--,h+=i[o++]<>>=me,d-=me,r.lens[r.have++]=be;else{if(16===be){for(Se=me+2;d>>=me,d-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=he;break}Ee=r.lens[r.have-1],m=3+(3&h),h>>>=2,d-=2}else if(17===be){for(Se=me+3;d>>=me,d-=me,Ee=0,m=3+(7&h),h>>>=3,d-=3}else{for(Se=me+7;d>>=me,d-=me,Ee=0,m=11+(127&h),h>>>=7,d-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;m--;)r.lens[r.have++]=Ee}}if(r.mode===he)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,xe={bits:r.lenbits},ke=E(x,r.lens,0,r.nlen,r.lencode,0,r.work,xe),r.lenbits=xe.bits,ke){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,xe={bits:r.distbits},ke=E(S,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,xe),r.distbits=xe.bits,ke){e.msg="invalid distances set",r.mode=he;break}if(r.mode=re,t===O)break e;case re:r.mode=ne;case ne:if(f>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,r.hold=h,r.bits=d,w(e,g),s=e.next_out,a=e.output,u=e.avail_out,o=e.next_in,i=e.input,f=e.avail_in,h=r.hold,d=r.bits,r.mode===V&&(r.back=-1);break}for(r.back=0;Ae=r.lencode[h&(1<>>24,_e=Ae>>>16&255,be=65535&Ae,!(me<=d);){if(0===f)break e;f--,h+=i[o++]<>ve)],me=Ae>>>24,_e=Ae>>>16&255,be=65535&Ae,!(ve+me<=d);){if(0===f)break e;f--,h+=i[o++]<>>=ve,d-=ve,r.back+=ve}if(h>>>=me,d-=me,r.back+=me,r.length=be,0===_e){r.mode=fe;break}if(32&_e){r.back=-1,r.mode=V;break}if(64&_e){e.msg="invalid literal/length code",r.mode=he;break}r.extra=15&_e,r.mode=ie;case ie:if(r.extra){for(Se=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Ae=r.distcode[h&(1<>>24,_e=Ae>>>16&255,be=65535&Ae,!(me<=d);){if(0===f)break e;f--,h+=i[o++]<>ve)],me=Ae>>>24,_e=Ae>>>16&255,be=65535&Ae,!(ve+me<=d);){if(0===f)break e;f--,h+=i[o++]<>>=ve,d-=ve,r.back+=ve}if(h>>>=me,d-=me,r.back+=me,64&_e){e.msg="invalid distance code",r.mode=he;break}r.offset=be,r.extra=15&_e,r.mode=oe;case oe:if(r.extra){for(Se=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=he;break}r.mode=se;case se:if(0===u)break e;if(m=g-u,r.offset>m){if((m=r.offset-m)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}m>r.wnext?(m-=r.wnext,_=r.wsize-m):_=r.wnext-m,m>r.length&&(m=r.length),ge=r.window}else ge=a,_=s-r.offset,m=r.length;m>u&&(m=u),u-=m,r.length-=m;do{a[s++]=ge[_++]}while(--m);0===r.length&&(r.mode=ne);break;case fe:if(0===u)break e;a[s++]=r.length,u--,r.mode=ne;break;case ue:if(r.wrap){for(;d<32;){if(0===f)break e;f--,h|=i[o++]<>>24,d>>>=y,p-=y,0===(y=v>>>16&255))A[a++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=g[(65535&v)+(d&(1<>>=y,p-=y),p<15&&(d+=S[n++]<>>24,d>>>=y,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=m[(65535&v)+(d&(1<f){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=y,p-=y,y=a-o,E>y){if((y=E-y)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,x=h,0===c){if(k+=u-y,y2;)A[a++]=x[k++],A[a++]=x[k++],A[a++]=x[k++],w-=3;w&&(A[a++]=x[k++],w>1&&(A[a++]=x[k++]))}else{k=a-E;do{A[a++]=A[k++],A[a++]=A[k++],A[a++]=A[k++],w-=3}while(w>2);w&&(A[a++]=A[k++],w>1&&(A[a++]=A[k++]))}break}}break}}while(n>3,n-=w,p-=w<<3,d&=(1<=1&&0===M[A];A--);if(P>A&&(P=A),0===A)return u[l++]=20971520,u[l++]=20971520,h.bits=1,0;for(S=1;S0&&(0===e||1!==A))return-1;for(U[1]=0,k=1;k<15;k++)U[k+1]=U[k]+M[k];for(x=0;x852||2===e&&I>592)return 1;for(var z=0;;){z++,v=k-T,c[x]b?(y=F[j+c[x]],w=L[B+c[x]]):(y=96,w=0),d=1<>T)+p]=v<<24|y<<16|w|0}while(0!==p);for(d=1<>=1;if(0!==d?(D&=d-1,D+=d):D=0,x++,0==--M[k]){if(k===A)break;k=t[r+c[x]]}if(k>P&&(D&m)!==g){for(0===T&&(T=P),_+=S,O=k-T,R=1<852||2===e&&I>592)return 1;g=D&m,u[g]=P<<24|O<<16|_-l|0}}return 0!==D&&(u[_+D]=k-T<<24|64<<16|0),h.bits=P,0}},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";(function(t){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i=0;s--)if(f[s]!==u[s])return!1;for(s=f.length-1;s>=0;s--)if(o=f[s],!d(e[o],t[o],r,n))return!1;return!0}function m(e,t,r){d(e,t,!0)&&c(e,t,r,"notDeepStrictEqual",m)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function b(e){var t;try{e()}catch(e){t=e}return t}function v(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=b(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&c(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!e&&y.isError(i),s=!e&&i&&!r;if((o&&a&&_(i,r)||s)&&c(i,r,"Got unwanted exception"+n),e&&i&&r&&!_(i,r)||!e&&i)throw i}var y=r(41),w=Object.prototype.hasOwnProperty,E=Array.prototype.slice,k=function(){return"foo"===function(){}.name}(),x=e.exports=h,S=/\s*function\s+([^\(\s]*)\s*/;x.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var t=e.stackStartFunction||c;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=s(t),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},y.inherits(x.AssertionError,Error),x.fail=c,x.ok=h,x.equal=function(e,t,r){e!=t&&c(e,t,r,"==",x.equal)},x.notEqual=function(e,t,r){e==t&&c(e,t,r,"!=",x.notEqual)},x.deepEqual=function(e,t,r){d(e,t,!1)||c(e,t,r,"deepEqual",x.deepEqual)},x.deepStrictEqual=function(e,t,r){d(e,t,!0)||c(e,t,r,"deepStrictEqual",x.deepStrictEqual)},x.notDeepEqual=function(e,t,r){d(e,t,!1)&&c(e,t,r,"notDeepEqual",x.notDeepEqual)},x.notDeepStrictEqual=m,x.strictEqual=function(e,t,r){e!==t&&c(e,t,r,"===",x.strictEqual)},x.notStrictEqual=function(e,t,r){e===t&&c(e,t,r,"!==",x.notStrictEqual)},x.throws=function(e,t,r){v(!0,e,t,r)},x.doesNotThrow=function(e,t,r){v(!1,e,t,r)},x.ifError=function(e){if(e)throw e};var A=Object.keys||function(e){var t=[];for(var r in e)w.call(e,r)&&t.push(r);return t}}).call(t,r(2))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){if(u||(u=!0,console&&console.log&&console.log("WARNING: dicomParser.readEncapsulatedPixelData() has been deprecated")),void 0===e)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'dataSet'";if(void 0===t)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'element'";if(void 0===r)throw"dicomParser.readEncapsulatedPixelData: missing required parameter 'frame'";if("x7fe00010"!==t.tag)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to non pixel data tag (expected tag = x7fe00010)";if(!0!==t.encapsulatedPixelData)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(!0!==t.hadUndefinedLength)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.basicOffsetTable)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(void 0===t.fragments)throw"dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data";if(r<0)throw"dicomParser.readEncapsulatedPixelData: parameter 'frame' must be >= 0";return 0!==t.basicOffsetTable.length?(0,o.default)(e,t,r):(0,f.default)(e,t,0,t.fragments.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var a=r(42),o=n(a),s=r(22),f=n(s),u=!1}])}); //# sourceMappingURL=dicomParser.min.js.map