Skip to content

Instantly share code, notes, and snippets.

@nitin42
Created September 2, 2017 10:59
Show Gist options
  • Save nitin42/5fef1095f281aa0cdf36ad6e5c460c9a to your computer and use it in GitHub Desktop.
Save nitin42/5fef1095f281aa0cdf36ad6e5c460c9a to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/*
Jimp v0.2.28
https://github.com/oliver-moran/jimp
Ported for the Web by Phil Seaton
The MIT License (MIT)
Copyright (c) 2014 Oliver Moran
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
"use strict";function _classCallCheck2(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};if((void 0===window||!window)&&"undefined"!=typeof self)var window=self;!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__dirname){function log(msg){clear(),void 0!==process&&process&&process.stdout?process.stdout.write(msg):"undefined"!=typeof console&&console&&console.log("Jimp",msg),chars=msg.length}function clear(){if(process&&process.stdout)for(;chars-- >0;)process.stdout.write("\b")}function noop(){}function isNodePattern(cb){if(void 0===cb)return!1;if("function"!=typeof cb)throw new Error("Callback must be a function");return!0}function throwError(error,cb){if("string"==typeof error&&(error=new Error(error)),"function"==typeof cb)return cb.call(this,error);throw error}function isArrayBuffer(test){return Object.prototype.toString.call(test).toLowerCase().indexOf("arraybuffer")>-1}function bufferFromArrayBuffer(arrayBuffer){for(var buffer=new Buffer(arrayBuffer.byteLength),view=new Uint8Array(arrayBuffer),i=0;i<buffer.length;++i)buffer[i]=view[i];return buffer}function loadBufferFromPath(src,cb){FS&&"function"==typeof FS.readFile&&!src.match(/^(http|ftp)s?:\/\/./)?FS.readFile(src,cb):Request(src,function(err,response,data){if(err)return cb(err);if("object"===(void 0===data?"undefined":_typeof(data))&&Buffer.isBuffer(data))return cb(null,data);var msg="Could not load Buffer from <"+src+"> (HTTP: "+response.statusCode+")";return Error(msg)})}function JimpEvMethod(methodName,evName,method){var evNameBefore="before-"+evName,evNameAfter=evName.replace(/e$/,"")+"ed";Jimp.prototype[methodName]=function(){var wrapedCb,cb=arguments[method.length-1],that=this;"function"==typeof cb?(wrapedCb=function(err,data){err?that.emitError(methodName,err):that.emitMulti(methodName,evNameAfter,_defineProperty({},methodName,data)),cb.apply(this,arguments)},arguments[arguments.length-1]=wrapedCb):wrapedCb=!1,this.emitMulti(methodName,evNameBefore);try{var result=method.apply(this,arguments);wrapedCb||this.emitMulti(methodName,evNameAfter,_defineProperty({},methodName,result))}catch(err){err.methodName=methodName,this.emitError(methodName,err)}return result},Jimp.prototype[methodName+"Quiet"]=method}function JimpEvChange(methodName,method){JimpEvMethod(methodName,"change",method)}function getMIMEFromBuffer(buffer,path){var fileTypeFromBuffer=FileType(buffer);return fileTypeFromBuffer?fileTypeFromBuffer.mime:path?MIME.lookup(path):null}function getBitmapFromGIF(data){var gifObj=new GIF.GifReader(data),gifData=new Buffer(gifObj.width*gifObj.height*4);return gifObj.decodeAndBlitFrameRGBA(0,gifData),{data:gifData,width:gifObj.width,height:gifObj.height}}function parseBitmap(data,path,cb){var that=this,mime=getMIMEFromBuffer(data,path);if("string"!=typeof mime)return cb(Error("Could not find MIME for Buffer <"+path+">"));switch(this._originalMime=mime.toLowerCase(),this.getMIME()){case Jimp.MIME_PNG:(new PNG).parse(data,function(err,data){return err?throwError.call(that,err,cb):(that.bitmap={data:new Buffer(data.data),width:data.width,height:data.height},cb.call(that,null,that))});break;case Jimp.MIME_JPEG:try{this.bitmap=JPEG.decode(data);try{this._exif=EXIFParser.create(data).parse(),exifRotate(this)}catch(err){}return cb.call(this,null,this)}catch(err){return cb.call(this,err,this)}case Jimp.MIME_BMP:case Jimp.MIME_X_MS_BMP:return this.bitmap=BMP.decode(data),cb.call(this,null,this);case Jimp.MIME_GIF:return this.bitmap=getBitmapFromGIF(data),cb.call(this,null,this);default:return throwError.call(this,"Unsupported MIME type: "+mime,cb)}}function exifRotate(img){var exif=img._exif;if(exif&&exif.tags&&exif.tags.Orientation)switch(img._exif.tags.Orientation){case 1:break;case 2:img.mirror(!0,!1);break;case 3:img.rotate(180,!1);break;case 4:img.mirror(!1,!0);break;case 5:img.rotate(-90,!1).mirror(!0,!1);break;case 6:img.rotate(-90,!1);break;case 7:img.rotate(90,!1).mirror(!0,!1);break;case 8:img.rotate(-270,!1)}return img}function getJimpDir(){var err=Error(),callLine=err.stack.split(/\n/).filter(function(l){return l.match(/getJimpDir/)})[0],reWebKit=/.*\(([^?]+\/)[^\/]+\).*/,reMoz=/.*@([^?]+\/).*/;return reWebKit.test(callLine)?callLine.replace(reWebKit,"$1"):reMoz.test(callLine)?callLine.replace(reMoz,"$1"):__dirname+"/"}function histogram(){var histogram={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,index){histogram.r[this.bitmap.data[index+0]]++,histogram.g[this.bitmap.data[index+1]]++,histogram.b[this.bitmap.data[index+2]]++}),histogram}function applyKernel(im,kernel,x,y){for(var value=[0,0,0],size=(kernel.length-1)/2,kx=0;kx<kernel.length;kx+=1)for(var ky=0;ky<kernel[kx].length;ky+=1){var idx=im.getPixelIndex(x+kx-size,y+ky-size);value[0]+=im.bitmap.data[idx]*kernel[kx][ky],value[1]+=im.bitmap.data[idx+1]*kernel[kx][ky],value[2]+=im.bitmap.data[idx+2]*kernel[kx][ky]}return value}function simpleRotate(deg){for(var i=Math.round(deg/90)%4;i<0;)i+=4;for(;i>0;){for(var dstBuffer=new Buffer(this.bitmap.data.length),dstOffset=0,x=this.bitmap.width-1;x>=0;x--)for(var y=0;y<this.bitmap.height;y++){var srcOffset=this.bitmap.width*y+x<<2,data=this.bitmap.data.readUInt32BE(srcOffset,!0);dstBuffer.writeUInt32BE(data,dstOffset,!0),dstOffset+=4}this.bitmap.data=new Buffer(dstBuffer);var tmp=this.bitmap.width;this.bitmap.width=this.bitmap.height,this.bitmap.height=tmp,i--}}function advancedRotate(deg,mode){function createTranslationFunction(deltaX,deltaY){return function(x,y){return{x:x+deltaX,y:y+deltaY}}}deg%=360;var rad=deg*Math.PI/180,cosine=Math.cos(rad),sine=Math.sin(rad),w=this.bitmap.width,h=this.bitmap.height;if(!0===mode||"string"==typeof mode){w=Math.ceil(Math.abs(this.bitmap.width*cosine)+Math.abs(this.bitmap.height*sine))+1,h=Math.ceil(Math.abs(this.bitmap.width*sine)+Math.abs(this.bitmap.height*cosine))+1,w%2!=0&&w++,h%2!=0&&h++;var c=this.cloneQuiet();this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data.writeUInt32BE(this._background,idx)});var max=Math.max(w,h,this.bitmap.width,this.bitmap.height);this.resize(max,max,mode),this.blit(c,this.bitmap.width/2-c.bitmap.width/2,this.bitmap.height/2-c.bitmap.height/2)}for(var bW=this.bitmap.width,bH=this.bitmap.height,dstBuffer=new Buffer(this.bitmap.data.length),translate2Cartesian=createTranslationFunction(-bW/2,-bH/2),translate2Screen=createTranslationFunction(bW/2+.5,bH/2+.5),_y5=1;_y5<=bH;_y5++)for(var _x6=1;_x6<=bW;_x6++){var cartesian=translate2Cartesian(_x6,_y5),source=translate2Screen(cosine*cartesian.x-sine*cartesian.y,cosine*cartesian.y+sine*cartesian.x),dstIdx=bW*(_y5-1)+_x6-1<<2;if(source.x>=0&&source.x<bW&&source.y>=0&&source.y<bH){var srcIdx=(bW*(0|source.y)+source.x|0)<<2,pixelRGBA=this.bitmap.data.readUInt32BE(srcIdx,!0);dstBuffer.writeUInt32BE(pixelRGBA,dstIdx)}else dstBuffer.writeUInt32BE(this._background,dstIdx)}if(this.bitmap.data=dstBuffer,!0===mode||"string"==typeof mode){var x=bW/2-w/2,y=bH/2-h/2;this.crop(x,y,w,h)}}function compositeBitmapOverBackground(image){return new Jimp(image.bitmap.width,image.bitmap.height,image._background).composite(image,0,0).bitmap}function loadPages(dir,pages){var newPages=pages.map(function(page){return Jimp.read(dir+"/"+page)});return Promise.all(newPages)}function xOffsetBasedOnAlignment(font,line,maxWidth,alignment){return alignment===Jimp.HORIZONTAL_ALIGN_LEFT?0:alignment===Jimp.HORIZONTAL_ALIGN_CENTER?(maxWidth-measureText(font,line))/2:maxWidth-measureText(font,line)}function printText(font,x,y,text){for(var _i4=0;_i4<text.length;_i4++)font.chars[text[_i4]]&&(drawCharacter(this,font,x,y,font.chars[text[_i4]]),x+=(font.kernings[text[_i4]]&&font.kernings[text[_i4]][text[_i4+1]]?font.kernings[text[_i4]][text[_i4+1]]:0)+(font.chars[text[_i4]].xadvance||0))}function drawCharacter(image,font,x,y,char){if(char.width>0&&char.height>0){var imageChar=font.pages[char.page].cloneQuiet().crop(char.x,char.y,char.width,char.height);return image.composite(imageChar,x+char.xoffset,y+char.yoffset)}return image}function measureText(font,text){for(var x=0,_i5=0;_i5<text.length;_i5++)font.chars[text[_i5]]&&(x+=font.chars[text[_i5]].xoffset+(font.kernings[text[_i5]]&&font.kernings[text[_i5]][text[_i5+1]]?font.kernings[text[_i5]][text[_i5+1]]:0)+(font.chars[text[_i5]].xadvance||0));return x}function measureTextHeight(font,text,maxWidth){for(var words=text.split(" "),line="",textTotalHeight=font.common.lineHeight,n=0;n<words.length;n++){var testLine=line+words[n]+" ";measureText(font,testLine)>maxWidth&&n>0?(textTotalHeight+=font.common.lineHeight,line=words[n]+" "):line=testLine}return textTotalHeight}var FS=require("fs"),PNG=require("pngjs").PNG,JPEG=require("jpeg-js"),BMP=require("bmp-js"),GIF=require("./omggif.js"),MIME=require("mime"),TinyColor=require("tinycolor2"),Resize=require("./resize.js"),Resize2=require("./resize2.js"),StreamToBuffer=require("stream-to-buffer"),FileType=require("file-type"),PixelMatch=require("pixelmatch"),EXIFParser=require("exif-parser"),ImagePHash=require("./phash.js"),BigNumber=require("bignumber.js"),BMFont=require("load-bmfont"),Path=require("path"),MkDirP=require("mkdirp"),Request=require("./src/request"),EventEmitter=require("events"),Promise=global.Promise||require("es6-promise").Promise,isDef=function(v){return void 0!==v&&null!==v},chars=0;process.on("exit",clear);var Jimp=function(_EventEmitter){function Jimp(){function finish(err){for(var _arguments2=arguments,_len=arguments.length,args=Array(_len>1?_len-1:0),_key2=1;_key2<_len;_key2++)args[_key2-1]=arguments[_key2];(err||{}).methodName="constructor",setTimeout(function(){var _cb;err?that.emitError("constructor",err):that.emitMulti("constructor","initialized"),(_cb=cb).call.apply(_cb,[that].concat(Array.prototype.slice.call(_arguments2)))},1)}var _arguments3=arguments;_classCallCheck2(this,Jimp);var _this2=_possibleConstructorReturn(this,(Jimp.__proto__||Object.getPrototypeOf(Jimp)).call(this)),cb=noop,that=_this2;if(isArrayBuffer(arguments[0])&&(arguments[0]=bufferFromArrayBuffer(arguments[0])),"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var _ret,w=arguments[0],h=arguments[1];if(cb=arguments[2],"number"==typeof arguments[2]&&(_this2._background=arguments[2],cb=arguments[3]),void 0===cb&&(cb=noop),"function"!=typeof cb)return _ret=throwError.call(_this2,"cb must be a function",finish),_possibleConstructorReturn(_this2,_ret);_this2.bitmap={data:new Buffer(w*h*4),width:w,height:h};for(var i=0;i<_this2.bitmap.data.length;i+=4)_this2.bitmap.data.writeUInt32BE(_this2._background,i);finish(null,_this2)}else if(arguments[0]instanceof Jimp){var _ret2,original=arguments[0];if(cb=arguments[1],void 0===cb&&(cb=noop),"function"!=typeof cb)return _ret2=throwError.call(_this2,"cb must be a function",finish),_possibleConstructorReturn(_this2,_ret2);var bitmap=new Buffer(original.bitmap.data.length);original.scanQuiet(0,0,original.bitmap.width,original.bitmap.height,function(x,y,idx){var data=original.bitmap.data.readUInt32BE(idx,!0);bitmap.writeUInt32BE(data,idx,!0)}),_this2.bitmap={data:bitmap,width:original.bitmap.width,height:original.bitmap.height},_this2._quality=original._quality,_this2._deflateLevel=original._deflateLevel,_this2._deflateStrategy=original._deflateStrategy,_this2._filterType=original._filterType,_this2._rgba=original._rgba,_this2._background=original._background,finish(null,_this2)}else if("string"==typeof arguments[0]){var _ret3,path=arguments[0];if(cb=arguments[1],void 0===cb&&(cb=noop),"function"!=typeof cb)return _ret3=throwError.call(_this2,"cb must be a function",finish),_possibleConstructorReturn(_this2,_ret3);loadBufferFromPath(path,function(err,data){if(err)return throwError.call(that,err,finish);parseBitmap.call(that,data,path,finish)})}else if("object"===_typeof(arguments[0])&&Buffer.isBuffer(arguments[0])){var _ret4,data=arguments[0];if("function"!=typeof(cb=arguments[1]))return _ret4=throwError.call(_this2,"cb must be a function",finish),_possibleConstructorReturn(_this2,_ret4);parseBitmap.call(_this2,data,null,finish)}else{var _ret5;cb=arguments[arguments.length-1],"function"!=typeof cb&&"function"!=typeof(cb=arguments[arguments.length-2])&&(cb=function(){});var extraConstructor=Jimp.__extraConstructors.find(function(c){return c.test.apply(c,_arguments3)});if(!extraConstructor)return _ret5=throwError.call(_this2,"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",finish),_possibleConstructorReturn(_this2,_ret5);new Promise(function(resolve,reject){var _extraConstructor$run;return(_extraConstructor$run=extraConstructor.run).call.apply(_extraConstructor$run,[_this2,resolve,reject].concat(Array.prototype.slice.call(_arguments3)))}).then(function(){return finish(null,_this2)}).catch(finish)}return _this2}return _inherits(Jimp,_EventEmitter),Jimp}(EventEmitter);Jimp.__extraConstructors=[],Jimp.appendConstructorOption=function(name,test,runner){Jimp.__extraConstructors.push({name:name,test:test,run:runner})},Jimp.prototype.emitMulti=function(methodName,eventName){var data=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};data=Object.assign(data,{methodName:methodName,eventName:eventName}),this.emit("any",data),methodName&&this.emit(methodName,data),this.emit(eventName,data)},Jimp.prototype.emitError=function(methodName,err){this.emitMulti(methodName,"error",err)},Jimp.read=function(src){return new Promise(function(resolve,reject){new Jimp(src,function(err,image){err?reject(err):resolve(image)})})},Jimp.AUTO=-1,Jimp.MIME_PNG="image/png",Jimp.MIME_JPEG="image/jpeg",Jimp.MIME_JGD="image/jgd",Jimp.MIME_BMP="image/bmp",Jimp.MIME_X_MS_BMP="image/x-ms-bmp",Jimp.MIME_GIF="image/gif",Jimp.PNG_FILTER_AUTO=-1,Jimp.PNG_FILTER_NONE=0,Jimp.PNG_FILTER_SUB=1,Jimp.PNG_FILTER_UP=2,Jimp.PNG_FILTER_AVERAGE=3,Jimp.PNG_FILTER_PAETH=4,Jimp.RESIZE_NEAREST_NEIGHBOR="nearestNeighbor",Jimp.RESIZE_BILINEAR="bilinearInterpolation",Jimp.RESIZE_BICUBIC="bicubicInterpolation",Jimp.RESIZE_HERMITE="hermiteInterpolation",Jimp.RESIZE_BEZIER="bezierInterpolation",Jimp.HORIZONTAL_ALIGN_LEFT=1,Jimp.HORIZONTAL_ALIGN_CENTER=2,Jimp.HORIZONTAL_ALIGN_RIGHT=4,Jimp.VERTICAL_ALIGN_TOP=8,Jimp.VERTICAL_ALIGN_MIDDLE=16,Jimp.VERTICAL_ALIGN_BOTTOM=32,Jimp.dirName=getJimpDir(),Jimp.FONT_SANS_8_BLACK=Jimp.dirName+"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt",Jimp.FONT_SANS_16_BLACK=Jimp.dirName+"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt",Jimp.FONT_SANS_32_BLACK=Jimp.dirName+"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt",Jimp.FONT_SANS_64_BLACK=Jimp.dirName+"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt",Jimp.FONT_SANS_128_BLACK=Jimp.dirName+"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt",Jimp.FONT_SANS_8_WHITE=Jimp.dirName+"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt",Jimp.FONT_SANS_16_WHITE=Jimp.dirName+"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt",Jimp.FONT_SANS_32_WHITE=Jimp.dirName+"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt",Jimp.FONT_SANS_64_WHITE=Jimp.dirName+"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt",Jimp.FONT_SANS_128_WHITE=Jimp.dirName+"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt",Jimp.EDGE_EXTEND=1,Jimp.EDGE_WRAP=2,Jimp.EDGE_CROP=3,Jimp.rgbaToInt=function(r,g,b,a,cb){if("number"!=typeof r||"number"!=typeof g||"number"!=typeof b||"number"!=typeof a)return throwError.call(this,"r, g, b and a must be numbers",cb);if(r<0||r>255)return throwError.call(this,"r must be between 0 and 255",cb);if((g<0||g>255)&&throwError.call(this,"g must be between 0 and 255",cb),b<0||b>255)return throwError.call(this,"b must be between 0 and 255",cb);if(a<0||a>255)return throwError.call(this,"a must be between 0 and 255",cb);r=Math.round(r),b=Math.round(b),g=Math.round(g),a=Math.round(a);var i=r*Math.pow(256,3)+g*Math.pow(256,2)+b*Math.pow(256,1)+a*Math.pow(256,0);return isNodePattern(cb)?cb.call(this,null,i):i},Jimp.intToRGBA=function(i,cb){if("number"!=typeof i)return throwError.call(this,"i must be a number",cb);var rgba={};return rgba.r=Math.floor(i/Math.pow(256,3)),rgba.g=Math.floor((i-rgba.r*Math.pow(256,3))/Math.pow(256,2)),rgba.b=Math.floor((i-rgba.r*Math.pow(256,3)-rgba.g*Math.pow(256,2))/Math.pow(256,1)),rgba.a=Math.floor((i-rgba.r*Math.pow(256,3)-rgba.g*Math.pow(256,2)-rgba.b*Math.pow(256,1))/Math.pow(256,0)),isNodePattern(cb)?cb.call(this,null,rgba):rgba},Jimp.limit255=function(n){return n=Math.max(n,0),n=Math.min(n,255)},Jimp.diff=function(img1,img2,threshold){if(!(img1 instanceof Jimp&&img2 instanceof Jimp))return throwError.call(this,"img1 and img2 must be an Jimp images");var bmp1=img1.bitmap,bmp2=img2.bitmap;if(bmp1.width===bmp2.width&&bmp1.height===bmp2.height||(bmp1.width*bmp1.height>bmp2.width*bmp2.height?img1=img1.cloneQuiet().resize(bmp2.width,bmp2.height):img2=img2.cloneQuiet().resize(bmp1.width,bmp1.height)),"number"!=typeof(threshold=threshold||.1)||threshold<0||threshold>1)return throwError.call(this,"threshold must be a number between 0 and 1");var diff=new Jimp(bmp1.width,bmp1.height,4294967295);return{percent:PixelMatch(bmp1.data,bmp2.data,diff.bitmap.data,diff.bitmap.width,diff.bitmap.height,{threshold:threshold})/(diff.bitmap.width*diff.bitmap.height),image:diff}},Jimp.distance=function(img1,img2){var phash=new ImagePHash,hash1=phash.getHash(img1),hash2=phash.getHash(img2);return phash.distance(hash1,hash2)},Jimp.prototype.bitmap={data:null,width:null,height:null},Jimp.prototype._quality=100,Jimp.prototype._deflateLevel=9,Jimp.prototype._deflateStrategy=3,Jimp.prototype._filterType=Jimp.PNG_FILTER_AUTO,Jimp.prototype._rgba=!0,Jimp.prototype._background=0,Jimp.prototype._originalMime=Jimp.MIME_PNG,Jimp.prototype._exif=null,JimpEvMethod("clone","clone",function(cb){var clone=new Jimp(this);return isNodePattern(cb)?cb.call(clone,null,clone):clone}),Jimp.prototype.quality=function(n,cb){return"number"!=typeof n?throwError.call(this,"n must be a number",cb):n<0||n>100?throwError.call(this,"n must be a number 0 - 100",cb):(this._quality=Math.round(n),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.deflateLevel=function(l,cb){return"number"!=typeof l?throwError.call(this,"l must be a number",cb):l<0||l>9?throwError.call(this,"l must be a number 0 - 9",cb):(this._deflateLevel=Math.round(l),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.deflateStrategy=function(s,cb){return"number"!=typeof s?throwError.call(this,"s must be a number",cb):s<0||s>3?throwError.call(this,"s must be a number 0 - 3",cb):(this._deflateStrategy=Math.round(s),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.filterType=function(f,cb){return"number"!=typeof f?throwError.call(this,"n must be a number",cb):f<-1||f>4?throwError.call(this,"n must be -1 (auto) or a number 0 - 4",cb):(this._filterType=Math.round(f),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.rgba=function(bool,cb){return"boolean"!=typeof bool?throwError.call(this,"bool must be a boolean, true for RGBA or false for RGB",cb):(this._rgba=bool,isNodePattern(cb)?cb.call(this,null,this):this)},JimpEvChange("background",function(hex,cb){return"number"!=typeof hex?throwError.call(this,"hex must be a hexadecimal rgba value",cb):(this._background=hex,isNodePattern(cb)?cb.call(this,null,this):this)}),JimpEvChange("scan",function(x,y,w,h,f,cb){if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);if("function"!=typeof f)return throwError.call(this,"f must be a function",cb);x=Math.round(x),y=Math.round(y),w=Math.round(w),h=Math.round(h);for(var _y=y;_y<y+h;_y++)for(var _x=x;_x<x+w;_x++){var idx=this.bitmap.width*_y+_x<<2;f.call(this,_x,_y,idx)}return isNodePattern(cb)?cb.call(this,null,this):this}),Jimp.prototype.getMIME=function(){return this._originalMime||Jimp.MIME_PNG},Jimp.prototype.getExtension=function(){var mime=this.getMIME();return MIME.extension(mime)},Jimp.prototype.getPixelIndex=function(x,y,edgeHandling,cb){var xi,yi;if("function"==typeof edgeHandling&&void 0===cb&&(cb=edgeHandling,edgeHandling=null),edgeHandling||(edgeHandling=Jimp.EDGE_EXTEND),"number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);xi=x=Math.round(x),yi=y=Math.round(y),edgeHandling===Jimp.EDGE_EXTEND&&(x<0&&(xi=0),x>=this.bitmap.width&&(xi=this.bitmap.width-1),y<0&&(yi=0),y>=this.bitmap.height&&(yi=this.bitmap.height-1)),edgeHandling===Jimp.EDGE_WRAP&&(x<0&&(xi=this.bitmap.width+x),x>=this.bitmap.width&&(xi=x%this.bitmap.width),y<0&&(xi=this.bitmap.height+y),y>=this.bitmap.height&&(yi=y%this.bitmap.height));var i=this.bitmap.width*yi+xi<<2;return(xi<0||xi>=this.bitmap.width)&&(i=-1),(yi<0||yi>=this.bitmap.height)&&(i=-1),isNodePattern(cb)?cb.call(this,null,i):i},Jimp.prototype.getPixelColor=Jimp.prototype.getPixelColour=function(x,y,cb){if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);x=Math.round(x),y=Math.round(y);var idx=this.getPixelIndex(x,y),hex=this.bitmap.data.readUInt32BE(idx);return isNodePattern(cb)?cb.call(this,null,hex):hex},Jimp.prototype.setPixelColor=Jimp.prototype.setPixelColour=function(hex,x,y,cb){if("number"!=typeof hex||"number"!=typeof x||"number"!=typeof y)return throwError.call(this,"hex, x and y must be numbers",cb);x=Math.round(x),y=Math.round(y);var idx=this.getPixelIndex(x,y);return this.bitmap.data.writeUInt32BE(hex,idx,!0),isNodePattern(cb)?cb.call(this,null,this):this};for(var maxHashLength=[],i=0;i<65;i++){var l=i>1?new BigNumber(Array(65).join("1"),2).toString(i):NaN;maxHashLength.push(l.length)}Jimp.prototype.hash=function(base,cb){if(base=base||64,"function"==typeof base&&(cb=base,base=64),"number"!=typeof base)return throwError.call(this,"base must be a number",cb);if(base<2||base>64)return throwError.call(this,"base must be a number between 2 and 64",cb);var hash=(new ImagePHash).getHash(this);for(hash=new BigNumber(hash,2).toString(base);hash.length<maxHashLength[base];)hash="0"+hash;return isNodePattern(cb)?cb.call(this,null,hash):hash},JimpEvChange("crop",function(x,y,w,h,cb){if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);x=Math.round(x),y=Math.round(y),w=Math.round(w),h=Math.round(h);var bitmap=new Buffer(this.bitmap.data.length),offset=0;return this.scanQuiet(x,y,w,h,function(x,y,idx){var data=this.bitmap.data.readUInt32BE(idx,!0);bitmap.writeUInt32BE(data,offset,!0),offset+=4}),this.bitmap.data=new Buffer(bitmap),this.bitmap.width=w,this.bitmap.height=h,isNodePattern(cb)?cb.call(this,null,this):this}),Jimp.colorDiff=function(){var pow=function(n){return Math.pow(n,2)},max=Math.max;return function(rgba1,rgba2){return 0===rgba1.a||rgba1.a||(rgba1.a=255),0===rgba2.a||rgba2.a||(rgba2.a=255),(max(pow(rgba1.r-rgba2.r),pow(rgba1.r-rgba2.r-rgba1.a+rgba2.a))+max(pow(rgba1.g-rgba2.g),pow(rgba1.g-rgba2.g-rgba1.a+rgba2.a))+max(pow(rgba1.b-rgba2.b),pow(rgba1.b-rgba2.b-rgba1.a+rgba2.a)))/195075}}(),Jimp.prototype.autocrop=function(){for(var cb,w=this.bitmap.width,h=this.bitmap.height,minPixelsPerSide=1,tolerance=2e-4,cropOnlyFrames=!0,_a=0,len=arguments.length;_a<len;_a++)"number"==typeof arguments[_a]&&(tolerance=arguments[_a]),"boolean"==typeof arguments[_a]&&(cropOnlyFrames=arguments[_a]),"function"==typeof arguments[_a]&&(cb=arguments[_a]);var colorTarget=this.getPixelColor(0,0),northPixelsToCrop=0,eastPixelsToCrop=0,southPixelsToCrop=0,westPixelsToCrop=0,rgba1=Jimp.intToRGBA(colorTarget);north:for(var y=0;y<h-minPixelsPerSide;y++){for(var x=0;x<w;x++){var colorXY=this.getPixelColor(x,y),rgba2=Jimp.intToRGBA(colorXY);if(Jimp.colorDiff(rgba1,rgba2)>tolerance)break north}northPixelsToCrop++}east:for(var _x3=0;_x3<w-minPixelsPerSide;_x3++){for(var _y2=0+northPixelsToCrop;_y2<h;_y2++){var _colorXY=this.getPixelColor(_x3,_y2),_rgba=Jimp.intToRGBA(_colorXY);if(Jimp.colorDiff(rgba1,_rgba)>tolerance)break east}eastPixelsToCrop++}south:for(var _y3=h-1;_y3>=northPixelsToCrop+minPixelsPerSide;_y3--){for(var _x4=w-eastPixelsToCrop-1;_x4>=0;_x4--){var _colorXY2=this.getPixelColor(_x4,_y3),_rgba2=Jimp.intToRGBA(_colorXY2);if(Jimp.colorDiff(rgba1,_rgba2)>tolerance)break south}southPixelsToCrop++}west:for(var _x5=w-1;_x5>=0+eastPixelsToCrop+minPixelsPerSide;_x5--){for(var _y4=h-1;_y4>=0+northPixelsToCrop;_y4--){var _colorXY3=this.getPixelColor(_x5,_y4),_rgba3=Jimp.intToRGBA(_colorXY3);if(Jimp.colorDiff(rgba1,_rgba3)>tolerance)break west}westPixelsToCrop++}var widthOfPixelsToCrop=w-(westPixelsToCrop+eastPixelsToCrop),heightOfPixelsToCrop=h-(southPixelsToCrop+northPixelsToCrop),doCrop=!1;return doCrop=cropOnlyFrames?0!==eastPixelsToCrop&&0!==northPixelsToCrop&&0!==westPixelsToCrop&&0!==southPixelsToCrop:0!==eastPixelsToCrop||0!==northPixelsToCrop||0!==westPixelsToCrop||0!==southPixelsToCrop,doCrop&&this.crop(eastPixelsToCrop,northPixelsToCrop,widthOfPixelsToCrop,heightOfPixelsToCrop),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.blit=function(src,x,y,srcx,srcy,srcw,srch,cb){if(!(src instanceof Jimp))return throwError.call(this,"The source must be a Jimp image",cb);if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);if("function"==typeof srcx)cb=srcx,srcx=0,srcy=0,srcw=src.bitmap.width,srch=src.bitmap.height;else{if((void 0===srcx?"undefined":_typeof(srcx))!==(void 0===srcy?"undefined":_typeof(srcy))||(void 0===srcy?"undefined":_typeof(srcy))!==(void 0===srcw?"undefined":_typeof(srcw))||(void 0===srcw?"undefined":_typeof(srcw))!==(void 0===srch?"undefined":_typeof(srch)))return throwError.call(this,"srcx, srcy, srcw, srch must be numbers",cb);srcx=srcx||0,srcy=srcy||0,srcw=srcw||src.bitmap.width,srch=srch||src.bitmap.height}x=Math.round(x),y=Math.round(y),srcx=Math.round(srcx),srcy=Math.round(srcy),srcw=Math.round(srcw),srch=Math.round(srch);var maxw=this.bitmap.width,maxh=this.bitmap.height,that=this;return src.scanQuiet(srcx,srcy,srcw,srch,function(sx,sy,idx){if(x+sx>=0&&y+sy>=0&&maxw-x-sx>0&&maxh-y-sy>0){var dstIdx=that.getPixelIndex(x+sx-srcx,y+sy-srcy);that.bitmap.data[dstIdx]=this.bitmap.data[idx],that.bitmap.data[dstIdx+1]=this.bitmap.data[idx+1],that.bitmap.data[dstIdx+2]=this.bitmap.data[idx+2],that.bitmap.data[dstIdx+3]=this.bitmap.data[idx+3]}}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.mask=function(src,x,y,cb){if(x||(x=0),y||(y=0),!(src instanceof Jimp))return throwError.call(this,"The source must be a Jimp image",cb);if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);x=Math.round(x),y=Math.round(y);var w=this.bitmap.width,h=this.bitmap.height,that=this;return src.scanQuiet(0,0,src.bitmap.width,src.bitmap.height,function(sx,sy,idx){var destX=x+sx,destY=y+sy;if(destX>=0&&destY>=0&&destX<w&&destY<h){var dstIdx=that.getPixelIndex(destX,destY),data=this.bitmap.data,avg=(data[idx+0]+data[idx+1]+data[idx+2])/3;that.bitmap.data[dstIdx+3]*=avg/255}}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.composite=function(src,x,y,cb){if(!(src instanceof Jimp))return throwError.call(this,"The source must be a Jimp image",cb);if("number"!=typeof x||"number"!=typeof y)return throwError.call(this,"x and y must be numbers",cb);x=Math.round(x),y=Math.round(y);var that=this;return src.scanQuiet(0,0,src.bitmap.width,src.bitmap.height,function(sx,sy,idx){var dstIdx=that.getPixelIndex(x+sx,y+sy),fg={r:this.bitmap.data[idx+0]/255,g:this.bitmap.data[idx+1]/255,b:this.bitmap.data[idx+2]/255,a:this.bitmap.data[idx+3]/255},bg={r:that.bitmap.data[dstIdx+0]/255,g:that.bitmap.data[dstIdx+1]/255,b:that.bitmap.data[dstIdx+2]/255,a:that.bitmap.data[dstIdx+3]/255},a=bg.a+fg.a-bg.a*fg.a,r=(fg.r*fg.a+bg.r*bg.a*(1-fg.a))/a,g=(fg.g*fg.a+bg.g*bg.a*(1-fg.a))/a,b=(fg.b*fg.a+bg.b*bg.a*(1-fg.a))/a;that.bitmap.data[dstIdx+0]=Jimp.limit255(255*r),that.bitmap.data[dstIdx+1]=Jimp.limit255(255*g),that.bitmap.data[dstIdx+2]=Jimp.limit255(255*b),that.bitmap.data[dstIdx+3]=Jimp.limit255(255*a)}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.brightness=function(val,cb){return"number"!=typeof val?throwError.call(this,"val must be numbers",cb):val<-1||val>1?throwError.call(this,"val must be a number between -1 and +1",cb):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){val<0?(this.bitmap.data[idx]=this.bitmap.data[idx]*(1+val),this.bitmap.data[idx+1]=this.bitmap.data[idx+1]*(1+val),this.bitmap.data[idx+2]=this.bitmap.data[idx+2]*(1+val)):(this.bitmap.data[idx]=this.bitmap.data[idx]+(255-this.bitmap.data[idx])*val,this.bitmap.data[idx+1]=this.bitmap.data[idx+1]+(255-this.bitmap.data[idx+1])*val,this.bitmap.data[idx+2]=this.bitmap.data[idx+2]+(255-this.bitmap.data[idx+2])*val)}),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.contrast=function(val,cb){function adjust(value){var x;return val<0?(x=value>127?1-value/255:value/255,x<0&&(x=0),x=.5*Math.pow(2*x,1+val),value>127?255*(1-x):255*x):(x=value>127?1-value/255:value/255,x<0&&(x=0),x=.5*Math.pow(2*x,1===val?127:1/(1-val)),value>127?255*(1-x):255*x)}return"number"!=typeof val?throwError.call(this,"val must be numbers",cb):val<-1||val>1?throwError.call(this,"val must be a number between -1 and +1",cb):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data[idx]=adjust(this.bitmap.data[idx]),this.bitmap.data[idx+1]=adjust(this.bitmap.data[idx+1]),this.bitmap.data[idx+2]=adjust(this.bitmap.data[idx+2])}),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.posterize=function(n,cb){return"number"!=typeof n?throwError.call(this,"n must be numbers",cb):(n<2&&(n=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data[idx]=Math.floor(this.bitmap.data[idx]/255*(n-1))/(n-1)*255,this.bitmap.data[idx+1]=Math.floor(this.bitmap.data[idx+1]/255*(n-1))/(n-1)*255,this.bitmap.data[idx+2]=Math.floor(this.bitmap.data[idx+2]/255*(n-1))/(n-1)*255}),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.normalize=function(cb){var h=histogram.call(this),normalize=function(value,min,max){return 255*(value-min)/(max-min)},getBounds=function(histogramChannel){return[histogramChannel.findIndex(function(value){return value>0}),255-histogramChannel.slice().reverse().findIndex(function(value){return value>0})]},bounds={r:getBounds(h.r),g:getBounds(h.g),b:getBounds(h.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var r=this.bitmap.data[idx+0],g=this.bitmap.data[idx+1],b=this.bitmap.data[idx+2];this.bitmap.data[idx+0]=normalize(r,bounds.r[0],bounds.r[1]),this.bitmap.data[idx+1]=normalize(g,bounds.g[0],bounds.g[1]),this.bitmap.data[idx+2]=normalize(b,bounds.b[0],bounds.b[1])}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.invert=function(cb){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data[idx]=255-this.bitmap.data[idx],this.bitmap.data[idx+1]=255-this.bitmap.data[idx+1],this.bitmap.data[idx+2]=255-this.bitmap.data[idx+2]}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.mirror=Jimp.prototype.flip=function(horizontal,vertical,cb){if("boolean"!=typeof horizontal||"boolean"!=typeof vertical)return throwError.call(this,"horizontal and vertical must be Booleans",cb);var bitmap=new Buffer(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var _x=horizontal?this.bitmap.width-1-x:x,_y=vertical?this.bitmap.height-1-y:y,_idx=this.bitmap.width*_y+_x<<2,data=this.bitmap.data.readUInt32BE(idx,!0);bitmap.writeUInt32BE(data,_idx,!0)}),this.bitmap.data=new Buffer(bitmap),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.gaussian=function(r,cb){if("number"!=typeof r)return throwError.call(this,"r must be a number",cb);if(r<1)return throwError.call(this,"r must be greater than 0",cb);for(var rs=Math.ceil(2.57*r),y=0;y<this.bitmap.height;y++){log("Gaussian: "+Math.round(y/this.bitmap.height*100)+"%");for(var x=0;x<this.bitmap.width;x++)for(var red=0,green=0,blue=0,alpha=0,wsum=0,iy=y-rs;iy<y+rs+1;iy++){for(var ix=x-rs;ix<x+rs+1;ix++){var x1=Math.min(this.bitmap.width-1,Math.max(0,ix)),y1=Math.min(this.bitmap.height-1,Math.max(0,iy)),dsq=(ix-x)*(ix-x)+(iy-y)*(iy-y),wght=Math.exp(-dsq/(2*r*r))/(2*Math.PI*r*r),_idx2=y1*this.bitmap.width+x1<<2;red+=this.bitmap.data[_idx2]*wght,green+=this.bitmap.data[_idx2+1]*wght,blue+=this.bitmap.data[_idx2+2]*wght,alpha+=this.bitmap.data[_idx2+3]*wght,wsum+=wght}var idx=y*this.bitmap.width+x<<2;this.bitmap.data[idx]=Math.round(red/wsum),this.bitmap.data[idx+1]=Math.round(green/wsum),this.bitmap.data[idx+2]=Math.round(blue/wsum),this.bitmap.data[idx+3]=Math.round(alpha/wsum)}}return clear(),isNodePattern(cb)?cb.call(this,null,this):this};var mulTable=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],shgTable=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];Jimp.prototype.blur=function(r,cb){if("number"!=typeof r)return throwError.call(this,"r must be a number",cb);if(r<1)return throwError.call(this,"r must be greater than 0",cb);for(var rsum,gsum,bsum,asum,x,y,i,p,p1,p2,yp,yi,yw,pa,wm=this.bitmap.width-1,hm=this.bitmap.height-1,rad1=r+1,mulSum=mulTable[r],shgSum=shgTable[r],red=[],green=[],blue=[],alpha=[],vmin=[],vmax=[],iterations=2;iterations-- >0;){for(yw=yi=0,y=0;y<this.bitmap.height;y++){for(rsum=this.bitmap.data[yw]*rad1,gsum=this.bitmap.data[yw+1]*rad1,bsum=this.bitmap.data[yw+2]*rad1,asum=this.bitmap.data[yw+3]*rad1,i=1;i<=r;i++)p=yw+((i>wm?wm:i)<<2),rsum+=this.bitmap.data[p++],gsum+=this.bitmap.data[p++],bsum+=this.bitmap.data[p++],asum+=this.bitmap.data[p];for(x=0;x<this.bitmap.width;x++)red[yi]=rsum,green[yi]=gsum,blue[yi]=bsum,alpha[yi]=asum,0===y&&(vmin[x]=((p=x+rad1)<wm?p:wm)<<2,vmax[x]=(p=x-r)>0?p<<2:0),p1=yw+vmin[x],p2=yw+vmax[x],rsum+=this.bitmap.data[p1++]-this.bitmap.data[p2++],gsum+=this.bitmap.data[p1++]-this.bitmap.data[p2++],bsum+=this.bitmap.data[p1++]-this.bitmap.data[p2++],asum+=this.bitmap.data[p1]-this.bitmap.data[p2],yi++;yw+=this.bitmap.width<<2}for(x=0;x<this.bitmap.width;x++){for(yp=x,rsum=red[yp]*rad1,gsum=green[yp]*rad1,bsum=blue[yp]*rad1,asum=alpha[yp]*rad1,i=1;i<=r;i++)yp+=i>hm?0:this.bitmap.width,rsum+=red[yp],gsum+=green[yp],bsum+=blue[yp],asum+=alpha[yp];for(yi=x<<2,y=0;y<this.bitmap.height;y++)this.bitmap.data[yi+3]=pa=asum*mulSum>>>shgSum,pa>255&&(this.bitmap.data[yi+3]=255),pa>0?(pa=255/pa,this.bitmap.data[yi]=(rsum*mulSum>>>shgSum)*pa,this.bitmap.data[yi+1]=(gsum*mulSum>>>shgSum)*pa,this.bitmap.data[yi+2]=(bsum*mulSum>>>shgSum)*pa):this.bitmap.data[yi]=this.bitmap.data[yi+1]=this.bitmap.data[yi+2]=0,0===x&&(vmin[y]=((p=y+rad1)<hm?p:hm)*this.bitmap.width,vmax[y]=(p=y-r)>0?p*this.bitmap.width:0),p1=x+vmin[y],p2=x+vmax[y],rsum+=red[p1]-red[p2],gsum+=green[p1]-green[p2],bsum+=blue[p1]-blue[p2],asum+=alpha[p1]-alpha[p2],yi+=this.bitmap.width<<2}}return isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.convolution=function(kernel,edgeHandling,cb){"function"==typeof edgeHandling&&void 0===cb&&(cb=edgeHandling,edgeHandling=null),edgeHandling||(edgeHandling=Jimp.EDGE_EXTEND);var weight,rSum,gSum,bSum,ri,gi,bi,xi,yi,idxi,newData=new Buffer(this.bitmap.data),kRows=kernel.length,kCols=kernel[0].length,rowEnd=Math.floor(kRows/2),colEnd=Math.floor(kCols/2),rowIni=-rowEnd,colIni=-colEnd;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){rSum=gSum=bSum=0;for(var row=rowIni;row<=rowEnd;row++)for(var col=colIni;col<=colEnd;col++)xi=x+col,yi=y+row,weight=kernel[row+rowEnd][col+colEnd],idxi=this.getPixelIndex(xi,yi,edgeHandling),-1===idxi?ri=gi=bi=0:(ri=this.bitmap.data[idxi+0],gi=this.bitmap.data[idxi+1],bi=this.bitmap.data[idxi+2]),rSum+=weight*ri,gSum+=weight*gi,bSum+=weight*bi;rSum<0&&(rSum=0),gSum<0&&(gSum=0),bSum<0&&(bSum=0),rSum>255&&(rSum=255),gSum>255&&(gSum=255),bSum>255&&(bSum=255),newData[idx+0]=rSum,newData[idx+1]=gSum,newData[idx+2]=bSum}),this.bitmap.data=newData,isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.greyscale=function(cb){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var grey=parseInt(.2126*this.bitmap.data[idx]+.7152*this.bitmap.data[idx+1]+.0722*this.bitmap.data[idx+2],10);this.bitmap.data[idx]=grey,this.bitmap.data[idx+1]=grey,this.bitmap.data[idx+2]=grey}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.grayscale=Jimp.prototype.greyscale,Jimp.prototype.sepia=function(cb){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var red=this.bitmap.data[idx],green=this.bitmap.data[idx+1],blue=this.bitmap.data[idx+2];red=.393*red+.769*green+.189*blue,green=.349*red+.686*green+.168*blue,blue=.272*red+.534*green+.131*blue,this.bitmap.data[idx]=red<255?red:255,this.bitmap.data[idx+1]=green<255?green:255,this.bitmap.data[idx+2]=blue<255?blue:255}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.opacity=function(f,cb){return"number"!=typeof f?throwError.call(this,"f must be a number",cb):f<0||f>1?throwError.call(this,"f must be a number from 0 to 1",cb):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var v=this.bitmap.data[idx+3]*f;this.bitmap.data[idx+3]=v}),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.fade=function(f,cb){return"number"!=typeof f?throwError.call(this,"f must be a number",cb):f<0||f>1?throwError.call(this,"f must be a number from 0 to 1",cb):(this.opacity(1-f),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.opaque=function(cb){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data[idx+3]=255}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.resize=function(w,h,mode,cb){if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);if("function"==typeof mode&&void 0===cb&&(cb=mode,mode=null),w===Jimp.AUTO&&h===Jimp.AUTO)return throwError.call(this,"w and h cannot both the set to auto",cb);if(w===Jimp.AUTO&&(w=this.bitmap.width*(h/this.bitmap.height)),h===Jimp.AUTO&&(h=this.bitmap.height*(w/this.bitmap.width)),w=Math.round(w),h=Math.round(h),"function"==typeof Resize2[mode]){var dst={data:new Buffer(w*h*4),width:w,height:h};Resize2[mode](this.bitmap,dst),this.bitmap=dst}else{var that=this;new Resize(this.bitmap.width,this.bitmap.height,w,h,!0,!0,function(buffer){that.bitmap.data=new Buffer(buffer),that.bitmap.width=w,that.bitmap.height=h}).resize(this.bitmap.data)}return isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.cover=function(w,h,alignBits,mode,cb){if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);alignBits&&"function"==typeof alignBits&&void 0===cb?(cb=alignBits,alignBits=null,mode=null):"function"==typeof mode&&void 0===cb&&(cb=mode,mode=null),alignBits=alignBits||Jimp.HORIZONTAL_ALIGN_CENTER|Jimp.VERTICAL_ALIGN_MIDDLE;var hbits=7&alignBits,vbits=alignBits>>3;if((0===hbits||hbits&hbits-1)&&(0===vbits||vbits&vbits-1))return throwError.call(this,"only use one flag per alignment direction",cb);var alignH=hbits>>1,alignV=vbits>>1,f=w/h>this.bitmap.width/this.bitmap.height?w/this.bitmap.width:h/this.bitmap.height;return this.scale(f,mode),this.crop((this.bitmap.width-w)/2*alignH,(this.bitmap.height-h)/2*alignV,w,h),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.contain=function(w,h,alignBits,mode,cb){if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);"string"==typeof alignBits&&("function"==typeof mode&&void 0===cb&&(cb=mode),mode=alignBits,alignBits=null),"function"==typeof alignBits&&(void 0===cb&&(cb=alignBits),mode=null,alignBits=null),"function"==typeof mode&&void 0===cb&&(cb=mode,mode=null),alignBits=alignBits||Jimp.HORIZONTAL_ALIGN_CENTER|Jimp.VERTICAL_ALIGN_MIDDLE;var hbits=7&alignBits,vbits=alignBits>>3;if((0===hbits||hbits&hbits-1)&&(0===vbits||vbits&vbits-1))return throwError.call(this,"only use one flag per alignment direction",cb);var alignH=hbits>>1,alignV=vbits>>1,f=w/h>this.bitmap.width/this.bitmap.height?h/this.bitmap.height:w/this.bitmap.width,c=this.cloneQuiet().scale(f,mode);return this.resize(w,h,mode),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){this.bitmap.data.writeUInt32BE(this._background,idx)}),this.blit(c,(this.bitmap.width-c.bitmap.width)/2*alignH,(this.bitmap.height-c.bitmap.height)/2*alignV),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.scale=function(f,mode,cb){if("number"!=typeof f)return throwError.call(this,"f must be a number",cb);if(f<0)return throwError.call(this,"f must be a positive number",cb);"function"==typeof mode&&void 0===cb&&(cb=mode,mode=null);var w=this.bitmap.width*f,h=this.bitmap.height*f;return this.resize(w,h,mode),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.scaleToFit=function(w,h,mode,cb){if("number"!=typeof w||"number"!=typeof h)return throwError.call(this,"w and h must be numbers",cb);"function"==typeof mode&&void 0===cb&&(cb=mode,mode=null);var f=w/h>this.bitmap.width/this.bitmap.height?h/this.bitmap.height:w/this.bitmap.width;return this.scale(f,mode),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.pixelate=function(size,x,y,w,h,cb){if("function"==typeof x)cb=x,x=y=w=h=null;else{if("number"!=typeof size)return throwError.call(this,"size must be a number",cb);if(isDef(x)&&"number"!=typeof x)return throwError.call(this,"x must be a number",cb);if(isDef(y)&&"number"!=typeof y)return throwError.call(this,"y must be a number",cb);if(isDef(w)&&"number"!=typeof w)return throwError.call(this,"w must be a number",cb);if(isDef(h)&&"number"!=typeof h)return throwError.call(this,"h must be a number",cb)}var kernel=[[1/16,.125,1/16],[.125,.25,.125],[1/16,.125,1/16]];x=x||0,y=y||0,w=isDef(w)?x:this.bitmap.width-x,h=isDef(h)?h:this.bitmap.height-y;var source=this.cloneQuiet();return this.scanQuiet(x,y,w,h,function(xx,yx,idx){xx=size*Math.floor(xx/size),yx=size*Math.floor(yx/size);var value=applyKernel(source,kernel,xx,yx);this.bitmap.data[idx]=value[0],this.bitmap.data[idx+1]=value[1],this.bitmap.data[idx+2]=value[2]}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.convolute=function(kernel,x,y,w,h,cb){if(!Array.isArray(kernel))return throwError.call(this,"the kernel must be an array",cb);if("function"==typeof x)cb=x,x=y=w=h=null;else{if(isDef(x)&&"number"!=typeof x)return throwError.call(this,"x must be a number",cb);if(isDef(y)&&"number"!=typeof y)return throwError.call(this,"y must be a number",cb);if(isDef(w)&&"number"!=typeof w)return throwError.call(this,"w must be a number",cb);if(isDef(h)&&"number"!=typeof h)return throwError.call(this,"h must be a number",cb)}var ksize=(kernel.length-1)/2;x=isDef(x)?x:ksize,y=isDef(y)?y:ksize,w=isDef(w)?w:this.bitmap.width-x,h=isDef(h)?h:this.bitmap.height-y;var source=this.cloneQuiet();return this.scanQuiet(x,y,w,h,function(xx,yx,idx){var value=applyKernel(source,kernel,xx,yx);this.bitmap.data[idx]=value[0],this.bitmap.data[idx+1]=value[1],this.bitmap.data[idx+2]=value[2]}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.rotate=function(deg,mode,cb){return void 0!==mode&&null!==mode||(mode=!0),"function"==typeof mode&&void 0===cb&&(cb=mode,mode=!0),"number"!=typeof deg?throwError.call(this,"deg must be a number",cb):"boolean"!=typeof mode&&"string"!=typeof mode?throwError.call(this,"mode must be a boolean or a string",cb):(deg%90==0&&!1===Boolean(mode)?simpleRotate.call(this,deg,cb):advancedRotate.call(this,deg,mode,cb),isNodePattern(cb)?cb.call(this,null,this):this)},Jimp.prototype.displace=function(map,offset,cb){if("object"!==(void 0===map?"undefined":_typeof(map))||map.constructor!==Jimp)return throwError.call(this,"The source must be a Jimp image",cb);if("number"!=typeof offset)return throwError.call(this,"factor must be a number",cb);var source=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var displacement=map.bitmap.data[idx]/256*offset;displacement=Math.round(displacement);var ids=this.getPixelIndex(x+displacement,y);this.bitmap.data[ids]=source.bitmap.data[idx],this.bitmap.data[ids+1]=source.bitmap.data[idx+1],this.bitmap.data[ids+2]=source.bitmap.data[idx+2]}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.getBuffer=function(mime,cb){if(mime===Jimp.AUTO&&(mime=this.getMIME()),"string"!=typeof mime)return throwError.call(this,"mime must be a string",cb);if("function"!=typeof cb)return throwError.call(this,"cb must be a function",cb);switch(mime.toLowerCase()){case Jimp.MIME_PNG:var that=this,png=new PNG({width:this.bitmap.width,height:this.bitmap.height,bitDepth:8,deflateLevel:this._deflateLevel,deflateStrategy:this._deflateStrategy,filterType:this._filterType,colorType:this._rgba?6:2,inputHasAlpha:!0});this._rgba?png.data=new Buffer(this.bitmap.data):png.data=compositeBitmapOverBackground(this).data,StreamToBuffer(png.pack(),function(err,buffer){return err?throwError.call(this,err,cb):cb.call(that,null,buffer)});break;case Jimp.MIME_JPEG:var jpeg=JPEG.encode(compositeBitmapOverBackground(this),this._quality);return cb.call(this,null,jpeg.data);case Jimp.MIME_BMP:case Jimp.MIME_X_MS_BMP:var bmp=BMP.encode(compositeBitmapOverBackground(this));return cb.call(this,null,bmp.data);default:return cb.call(this,"Unsupported MIME type: "+mime)}return this},Jimp.prototype.getBase64=function(mime,cb){return mime===Jimp.AUTO&&(mime=this.getMIME()),"string"!=typeof mime?throwError.call(this,"mime must be a string",cb):"function"!=typeof cb?throwError.call(this,"cb must be a function",cb):(this.getBuffer(mime,function(err,data){if(err)return throwError.call(this,err,cb);var src="data:"+mime+";base64,"+data.toString("base64");return cb.call(this,null,src)}),this)},Jimp.prototype.dither565=function(cb){var rgb565Matrix=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var tressholdId=((3&y)<<2)+x%4,dither=rgb565Matrix[tressholdId];this.bitmap.data[idx]=Math.min(this.bitmap.data[idx]+dither,255),this.bitmap.data[idx+1]=Math.min(this.bitmap.data[idx+1]+dither,255),this.bitmap.data[idx+2]=Math.min(this.bitmap.data[idx+2]+dither,255)}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.prototype.dither16=Jimp.prototype.dither565,Jimp.prototype.color=Jimp.prototype.colour=function(actions,cb){if(!actions||!Array.isArray(actions))return throwError.call(this,"actions must be an array",cb);var originalScope=this;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,function(x,y,idx){var clr=TinyColor({r:this.bitmap.data[idx],g:this.bitmap.data[idx+1],b:this.bitmap.data[idx+2]}),colorModifier=function(i,amount){var c=clr.toRgb();return c[i]=Math.max(0,Math.min(c[i]+amount,255)),TinyColor(c)};actions.forEach(function(action){if("mix"===action.apply)clr=TinyColor.mix(clr,action.params[0],action.params[1]);else if("tint"===action.apply)clr=TinyColor.mix(clr,"white",action.params[0]);else if("shade"===action.apply)clr=TinyColor.mix(clr,"black",action.params[0]);else if("xor"===action.apply){var clr2=TinyColor(action.params[0]).toRgb();clr=clr.toRgb(),clr=TinyColor({r:clr.r^clr2.r,g:clr.g^clr2.g,b:clr.b^clr2.b})}else if("red"===action.apply)clr=colorModifier("r",action.params[0]);else if("green"===action.apply)clr=colorModifier("g",action.params[0]);else if("blue"===action.apply)clr=colorModifier("b",action.params[0]);else{"hue"===action.apply&&(action.apply="spin");var fn=clr[action.apply];if(!fn)return throwError.call(originalScope,"action "+action.apply+" not supported",cb);clr=fn.apply(clr,action.params)}}),clr=clr.toRgb(),this.bitmap.data[idx]=clr.r,this.bitmap.data[idx+1]=clr.g,this.bitmap.data[idx+2]=clr.b}),isNodePattern(cb)?cb.call(this,null,this):this},Jimp.loadFont=function(file,cb){if("string"!=typeof file)return throwError.call(this,"file must be a string",cb);var that=this;return new Promise(function(resolve,reject){cb=cb||function(err,font){err?reject(err):resolve(font)},BMFont(file,function(err,font){var chars={},kernings={};if(err)return throwError.call(that,err,cb);for(var _i2=0;_i2<font.chars.length;_i2++)chars[String.fromCharCode(font.chars[_i2].id)]=font.chars[_i2];for(var _i3=0;_i3<font.kernings.length;_i3++){var firstString=String.fromCharCode(font.kernings[_i3].first);kernings[firstString]=kernings[firstString]||{},kernings[firstString][String.fromCharCode(font.kernings[_i3].second)]=font.kernings[_i3].amount}loadPages(Path.dirname(file),font.pages).then(function(pages){cb(null,{chars:chars,kernings:kernings,pages:pages,common:font.common,info:font.info})})})})},Jimp.prototype.print=function(font,x,y,text,maxWidth,maxHeight,cb){if("function"==typeof maxWidth&&void 0===cb&&(cb=maxWidth,maxWidth=1/0),void 0===maxWidth&&(maxWidth=1/0),"function"==typeof maxHeight&&void 0===cb&&(cb=maxHeight,maxWidth=1/0),void 0===maxHeight&&(maxHeight=1/0),"object"!==(void 0===font?"undefined":_typeof(font)))return throwError.call(this,"font must be a Jimp loadFont",cb);if("number"!=typeof x||"number"!=typeof y||"number"!=typeof maxWidth)return throwError.call(this,"x, y and maxWidth must be numbers",cb);if("string"!=typeof text&&"object"!==(void 0===text?"undefined":_typeof(text)))return throwError.call(this,"text must be a string or an object",cb);if("number"!=typeof maxWidth)return throwError.call(this,"maxWidth must be a number",cb);if("number"!=typeof maxHeight)return throwError.call(this,"maxHeight must be a number",cb);var alignmentX,alignmentY,that=this;"object"===(void 0===text?"undefined":_typeof(text))?(alignmentX=text.alignmentX||Jimp.HORIZONTAL_ALIGN_LEFT,alignmentY=text.alignmentY||Jimp.VERTICAL_ALIGN_TOP,text=text.text):(alignmentX=Jimp.HORIZONTAL_ALIGN_LEFT,alignmentY=Jimp.VERTICAL_ALIGN_TOP),maxHeight!==1/0&&alignmentY===Jimp.VERTICAL_ALIGN_BOTTOM?y=maxHeight-measureTextHeight(font,text,maxWidth):maxHeight!==1/0&&alignmentY===Jimp.VERTICAL_ALIGN_MIDDLE&&(y=maxHeight/2-measureTextHeight(font,text,maxWidth)/2);for(var words=text.split(" "),line="",n=0;n<words.length;n++){var testLine=line+words[n]+" ";measureText(font,testLine)>maxWidth&&n>0?(that=that.print(font,x+xOffsetBasedOnAlignment(font,line,maxWidth,alignmentX),y,line),line=words[n]+" ",y+=font.common.lineHeight):line=testLine}return printText.call(this,font,x+xOffsetBasedOnAlignment(font,line,maxWidth,alignmentX),y,line),isNodePattern(cb)?cb.call(this,null,that):that},Jimp.prototype.write=function(path,cb){if(!FS||!FS.createWriteStream)throw Error("Cant access the filesystem. You can use the getBase64 method.");if("string"!=typeof path)return throwError.call(this,"path must be a string",cb);if(void 0===cb&&(cb=function(){}),"function"!=typeof cb)return throwError.call(this,"cb must be a function",cb);var that=this,mime=MIME.lookup(path),pathObj=Path.parse(path);return pathObj.dir&&MkDirP.sync(pathObj.dir),this.getBuffer(mime,function(err,buffer){if(err)return throwError.call(that,err,cb);var stream=FS.createWriteStream(path);stream.on("open",function(){stream.write(buffer),stream.end()}).on("error",function(err){return throwError.call(that,err,cb)}),stream.on("finish",function(){return cb.call(that,null,that)})}),this},Jimp.prototype.inspect=function(){return"<Jimp "+(this.bitmap===Jimp.prototype.bitmap?"pending...":this.bitmap.width+"x"+this.bitmap.height)+">"},Jimp.prototype.toString=function(){return"[object Jimp]"};var gl;void 0!==window&&"object"===(void 0===window?"undefined":_typeof(window))&&(gl=window),"undefined"!=typeof self&&"object"===("undefined"==typeof self?"undefined":_typeof(self))&&(gl=self),gl.Jimp=Jimp,gl.Buffer=Buffer,module.exports=Jimp}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/")},{"./omggif.js":412,"./phash.js":413,"./resize.js":414,"./resize2.js":415,"./src/request":416,_process:105,"bignumber.js":70,"bmp-js":71,buffer:108,"es6-promise":152,events:153,"exif-parser":155,"file-type":166,fs:104,"jpeg-js":221,"load-bmfont":233,mime:241,mkdirp:245,path:268,pixelmatch:275,pngjs:295,"stream-to-buffer":379,tinycolor2:383}],2:[function(require,module,exports){function SCHEMA_URI_FORMAT_FUNC(str){return SCHEMA_URI_FORMAT.test(str)}function Ajv(opts){function validate(schemaKeyRef,data){var v;if("string"==typeof schemaKeyRef){if(!(v=getSchema(schemaKeyRef)))throw new Error('no schema with key or ref "'+schemaKeyRef+'"')}else{var schemaObj=_addSchema(schemaKeyRef);v=schemaObj.validate||_compile(schemaObj)}var valid=v(data);return!0===v.$async?"*"==self._opts.async?co(valid):valid:(self.errors=v.errors,valid)}function compile(schema,_meta){var schemaObj=_addSchema(schema,void 0,_meta);return schemaObj.validate||_compile(schemaObj)}function addSchema(schema,key,_skipValidation,_meta){if(Array.isArray(schema))for(var i=0;i<schema.length;i++)addSchema(schema[i],void 0,_skipValidation,_meta);else key=resolve.normalizeId(key||schema.id),checkUnique(key),self._schemas[key]=_addSchema(schema,_skipValidation,_meta,!0)}function addMetaSchema(schema,key,skipValidation){addSchema(schema,key,skipValidation,!0)}function validateSchema(schema,throwOrLogError){var $schema=schema.$schema||self._opts.defaultMeta||defaultMeta(),currentUriFormat=self._formats.uri;self._formats.uri="function"==typeof currentUriFormat?SCHEMA_URI_FORMAT_FUNC:SCHEMA_URI_FORMAT;var valid;try{valid=validate($schema,schema)}finally{self._formats.uri=currentUriFormat}if(!valid&&throwOrLogError){var message="schema is invalid: "+errorsText();if("log"!=self._opts.validateSchema)throw new Error(message);console.error(message)}return valid}function defaultMeta(){var meta=self._opts.meta;return self._opts.defaultMeta="object"==(void 0===meta?"undefined":_typeof(meta))?meta.id||meta:self._opts.v5?v5.META_SCHEMA_ID:META_SCHEMA_ID,self._opts.defaultMeta}function getSchema(keyRef){var schemaObj=_getSchemaObj(keyRef);switch(void 0===schemaObj?"undefined":_typeof(schemaObj)){case"object":return schemaObj.validate||_compile(schemaObj);case"string":return getSchema(schemaObj);case"undefined":return _getSchemaFragment(keyRef)}}function _getSchemaFragment(ref){var res=resolve.schema.call(self,{schema:{}},ref);if(res){var schema=res.schema,root=res.root,baseId=res.baseId,v=compileSchema.call(self,schema,root,void 0,baseId);return self._fragments[ref]=new SchemaObject({ref:ref,fragment:!0,schema:schema,root:root,baseId:baseId,validate:v}),v}}function _getSchemaObj(keyRef){return keyRef=resolve.normalizeId(keyRef),self._schemas[keyRef]||self._refs[keyRef]||self._fragments[keyRef]}function removeSchema(schemaKeyRef){if(schemaKeyRef instanceof RegExp)return _removeAllSchemas(self._schemas,schemaKeyRef),void _removeAllSchemas(self._refs,schemaKeyRef);switch(void 0===schemaKeyRef?"undefined":_typeof(schemaKeyRef)){case"undefined":return _removeAllSchemas(self._schemas),_removeAllSchemas(self._refs),void self._cache.clear();case"string":var schemaObj=_getSchemaObj(schemaKeyRef);return schemaObj&&self._cache.del(schemaObj.jsonStr),delete self._schemas[schemaKeyRef],void delete self._refs[schemaKeyRef];case"object":var jsonStr=stableStringify(schemaKeyRef);self._cache.del(jsonStr);var id=schemaKeyRef.id;id&&(id=resolve.normalizeId(id),delete self._schemas[id],delete self._refs[id])}}function _removeAllSchemas(schemas,regex){for(var keyRef in schemas){var schemaObj=schemas[keyRef];schemaObj.meta||regex&&!regex.test(keyRef)||(self._cache.del(schemaObj.jsonStr),delete schemas[keyRef])}}function _addSchema(schema,skipValidation,meta,shouldAddSchema){if("object"!=(void 0===schema?"undefined":_typeof(schema)))throw new Error("schema should be object");var jsonStr=stableStringify(schema),cached=self._cache.get(jsonStr);if(cached)return cached;shouldAddSchema=shouldAddSchema||!1!==self._opts.addUsedSchema;var id=resolve.normalizeId(schema.id);id&&shouldAddSchema&&checkUnique(id);var recursiveMeta,willValidate=!1!==self._opts.validateSchema&&!skipValidation;willValidate&&!(recursiveMeta=schema.id&&schema.id==schema.$schema)&&validateSchema(schema,!0);var localRefs=resolve.ids.call(self,schema),schemaObj=new SchemaObject({id:id,schema:schema,localRefs:localRefs,jsonStr:jsonStr,meta:meta});return"#"!=id[0]&&shouldAddSchema&&(self._refs[id]=schemaObj),self._cache.put(jsonStr,schemaObj),willValidate&&recursiveMeta&&validateSchema(schema,!0),schemaObj}function _compile(schemaObj,root){function callValidate(){var _validate=schemaObj.validate,result=_validate.apply(null,arguments);return callValidate.errors=_validate.errors,result}if(schemaObj.compiling)return schemaObj.validate=callValidate,callValidate.schema=schemaObj.schema,callValidate.errors=null,callValidate.root=root||callValidate,!0===schemaObj.schema.$async&&(callValidate.$async=!0),callValidate;schemaObj.compiling=!0;var currentOpts;schemaObj.meta&&(currentOpts=self._opts,self._opts=self._metaOpts);var v;try{v=compileSchema.call(self,schemaObj.schema,root,schemaObj.localRefs)}finally{schemaObj.compiling=!1,schemaObj.meta&&(self._opts=currentOpts)}return schemaObj.validate=v,schemaObj.refs=v.refs,schemaObj.refVal=v.refVal,schemaObj.root=v.root,v}function errorsText(errors,options){if(!(errors=errors||self.errors))return"No errors";options=options||{};for(var separator=void 0===options.separator?", ":options.separator,dataVar=void 0===options.dataVar?"data":options.dataVar,text="",i=0;i<errors.length;i++){var e=errors[i];e&&(text+=dataVar+e.dataPath+" "+e.message+separator)}return text.slice(0,-separator.length)}function addFormat(name,format){"string"==typeof format&&(format=new RegExp(format)),self._formats[name]=format}function addDraft4MetaSchema(){if(!1!==self._opts.meta){addMetaSchema(require("./refs/json-schema-draft-04.json"),META_SCHEMA_ID,!0),self._refs["http://json-schema.org/schema"]=META_SCHEMA_ID}}function addInitialSchemas(){var optsSchemas=self._opts.schemas;if(optsSchemas)if(Array.isArray(optsSchemas))addSchema(optsSchemas);else for(var key in optsSchemas)addSchema(optsSchemas[key],key)}function addInitialFormats(){for(var name in self._opts.formats){addFormat(name,self._opts.formats[name])}}function checkUnique(id){if(self._schemas[id]||self._refs[id])throw new Error('schema with key or id "'+id+'" already exists')}function getMetaSchemaOptions(){for(var metaOpts=util.copy(self._opts),i=0;i<META_IGNORE_OPTIONS.length;i++)delete metaOpts[META_IGNORE_OPTIONS[i]];return metaOpts}if(!(this instanceof Ajv))return new Ajv(opts);var self=this;opts=this._opts=util.copy(opts)||{},this._schemas={},this._refs={},this._fragments={},this._formats=formats(opts.format),this._cache=opts.cache||new Cache,this._loadingSchemas={},this._compilations=[],this.RULES=rules(),this.validate=validate,this.compile=compile,this.addSchema=addSchema,this.addMetaSchema=addMetaSchema,this.validateSchema=validateSchema,this.getSchema=getSchema,this.removeSchema=removeSchema,this.addFormat=addFormat,this.errorsText=errorsText,this._addSchema=_addSchema,this._compile=_compile,opts.loopRequired=opts.loopRequired||1/0,(opts.async||opts.transpile)&&async.setup(opts),!0===opts.beautify&&(opts.beautify={indent_size:2}),"property"==opts.errorDataPath&&(opts._errorDataPathProperty=!0),this._metaOpts=getMetaSchemaOptions(),opts.formats&&addInitialFormats(),addDraft4MetaSchema(),opts.v5&&v5.enable(this),"object"==_typeof(opts.meta)&&addMetaSchema(opts.meta),addInitialSchemas()}var compileSchema=require("./compile"),resolve=require("./compile/resolve"),Cache=require("./cache"),SchemaObject=require("./compile/schema_obj"),stableStringify=require("json-stable-stringify"),formats=require("./compile/formats"),rules=require("./compile/rules"),v5=require("./v5"),util=require("./compile/util"),async=require("./async"),co=require("co");module.exports=Ajv,Ajv.prototype.compileAsync=async.compile;var customKeyword=require("./keyword");Ajv.prototype.addKeyword=customKeyword.add,Ajv.prototype.getKeyword=customKeyword.get,Ajv.prototype.removeKeyword=customKeyword.remove,Ajv.ValidationError=require("./compile/validation_error");var META_SCHEMA_ID="http://json-schema.org/draft-04/schema",SCHEMA_URI_FORMAT=/^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,META_IGNORE_OPTIONS=["removeAdditional","useDefaults","coerceTypes"]},{"./async":3,"./cache":4,"./compile":8,"./compile/formats":7,"./compile/resolve":9,"./compile/rules":10,"./compile/schema_obj":11,"./compile/util":13,"./compile/validation_error":14,"./keyword":39,"./refs/json-schema-draft-04.json":40,"./v5":42,co:112,"json-stable-stringify":226}],3:[function(require,module,exports){function setupAsync(opts,required){!1!==required&&(required=!0);var check,async=opts.async,transpile=opts.transpile;switch(void 0===transpile?"undefined":_typeof(transpile)){case"string":var get=TRANSPILE[transpile];if(!get)throw new Error("bad transpiler: "+transpile);return opts._transpileFunc=get(opts,required);case"undefined":case"boolean":if("string"==typeof async){if(!(check=ASYNC[async]))throw new Error("bad async mode: "+async);return opts.transpile=check(opts,required)}for(var i=0;i<MODES.length;i++){var _opts=MODES[i];if(setupAsync(_opts,!1))return util.copy(_opts,opts),opts.transpile}throw new Error("generators, nodent and regenerator are not available");case"function":return opts._transpileFunc=opts.transpile;default:throw new Error("bad transpiler: "+transpile)}}function checkGenerators(opts,required){try{return new Function("(function*(){})()")(),!0}catch(e){if(required)throw new Error("generators not supported")}}function checkAsyncFunction(opts,required){try{return new Function("(async function(){})()")(),!0}catch(e){if(required)throw new Error("es7 async functions not supported")}}function getRegenerator(opts,required){try{if(!regenerator){regenerator=require("regenerator"),regenerator.runtime()}return opts.async&&!0!==opts.async||(opts.async="es7"),regeneratorTranspile}catch(e){if(required)throw new Error("regenerator not available")}}function regeneratorTranspile(code){return regenerator.compile(code).code}function getNodent(opts,required){try{if(!nodent){nodent=require("nodent")({log:!1,dontInstallRequireHook:!0})}return"es7"!=opts.async&&(opts.async&&!0!==opts.async&&console.warn("nodent transpiles only es7 async functions"),opts.async="es7"),nodentTranspile}catch(e){if(required)throw new Error("nodent not available")}}function nodentTranspile(code){return nodent.compile(code,"",{promises:!0,sourcemap:!1}).code}function compileAsync(schema,callback){function _compileAsync(schema,callback,firstCall){function loadMissingSchema(e){function schemaLoaded(err,sch){if(err)return callback(err);if(!self._refs[ref]&&!self._schemas[ref])try{self.addSchema(sch,ref)}catch(e){return void callback(e)}_compileAsync(schema,callback)}var ref=e.missingSchema;if(self._refs[ref]||self._schemas[ref])return callback(new Error("Schema "+ref+" is loaded but "+e.missingRef+" cannot be resolved"));var _callbacks=self._loadingSchemas[ref];_callbacks?"function"==typeof _callbacks?self._loadingSchemas[ref]=[_callbacks,schemaLoaded]:_callbacks[_callbacks.length]=schemaLoaded:(self._loadingSchemas[ref]=schemaLoaded,self._opts.loadSchema(ref,function(err,sch){var _callbacks=self._loadingSchemas[ref];if(delete self._loadingSchemas[ref],"function"==typeof _callbacks)_callbacks(err,sch);else for(var i=0;i<_callbacks.length;i++)_callbacks[i](err,sch)}))}function deferCallback(err,validate){if(!firstCall)return callback(err,validate);setTimeout(function(){callback(err,validate)})}var validate;try{validate=self.compile(schema)}catch(e){return void(e.missingSchema?loadMissingSchema(e):deferCallback(e))}deferCallback(null,validate)}var schemaObj,self=this;try{schemaObj=this._addSchema(schema)}catch(e){return void setTimeout(function(){callback(e)})}if(schemaObj.validate)setTimeout(function(){callback(null,schemaObj.validate)});else{if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");_compileAsync(schema,callback,!0)}}module.exports={setup:setupAsync,compile:compileAsync};var regenerator,nodent,util=require("./compile/util"),ASYNC={"*":checkGenerators,"co*":checkGenerators,es7:checkAsyncFunction},TRANSPILE={nodent:getNodent,regenerator:getRegenerator},MODES=[{async:"co*"},{async:"es7",transpile:"nodent"},{async:"co*",transpile:"regenerator"}]},{"./compile/util":13}],4:[function(require,module,exports){var Cache=module.exports=function(){this._cache={}};Cache.prototype.put=function(key,value){this._cache[key]=value},Cache.prototype.get=function(key){return this._cache[key]},Cache.prototype.del=function(key){delete this._cache[key]},Cache.prototype.clear=function(){this._cache={}}},{}],5:[function(require,module,exports){module.exports={$ref:require("../dotjs/ref"),allOf:require("../dotjs/allOf"),anyOf:require("../dotjs/anyOf"),dependencies:require("../dotjs/dependencies"),enum:require("../dotjs/enum"),format:require("../dotjs/format"),items:require("../dotjs/items"),maximum:require("../dotjs/_limit"),minimum:require("../dotjs/_limit"),maxItems:require("../dotjs/_limitItems"),minItems:require("../dotjs/_limitItems"),maxLength:require("../dotjs/_limitLength"),minLength:require("../dotjs/_limitLength"),maxProperties:require("../dotjs/_limitProperties"),minProperties:require("../dotjs/_limitProperties"),multipleOf:require("../dotjs/multipleOf"),not:require("../dotjs/not"),oneOf:require("../dotjs/oneOf"),pattern:require("../dotjs/pattern"),properties:require("../dotjs/properties"),required:require("../dotjs/required"),uniqueItems:require("../dotjs/uniqueItems"),validate:require("../dotjs/validate")}},{"../dotjs/_limit":16,"../dotjs/_limitItems":17,"../dotjs/_limitLength":18,"../dotjs/_limitProperties":19,"../dotjs/allOf":20,"../dotjs/anyOf":21,"../dotjs/dependencies":24,"../dotjs/enum":25,"../dotjs/format":26,"../dotjs/items":27,"../dotjs/multipleOf":28,"../dotjs/not":29,"../dotjs/oneOf":30,"../dotjs/pattern":31,"../dotjs/properties":33,"../dotjs/ref":34,"../dotjs/required":35,"../dotjs/uniqueItems":37,"../dotjs/validate":38}],6:[function(require,module,exports){module.exports=function equal(a,b){if(a===b)return!0;var i,arrA=Array.isArray(a),arrB=Array.isArray(b);if(arrA&&arrB){if(a.length!=b.length)return!1;for(i=0;i<a.length;i++)if(!equal(a[i],b[i]))return!1;return!0}if(arrA!=arrB)return!1;if(a&&b&&"object"===(void 0===a?"undefined":_typeof(a))&&"object"===(void 0===b?"undefined":_typeof(b))){var keys=Object.keys(a);if(keys.length!==Object.keys(b).length)return!1;var dateA=a instanceof Date,dateB=b instanceof Date;if(dateA&&dateB)return a.getTime()==b.getTime();if(dateA!=dateB)return!1;var regexpA=a instanceof RegExp,regexpB=b instanceof RegExp;if(regexpA&&regexpB)return a.toString()==b.toString();if(regexpA!=regexpB)return!1;for(i=0;i<keys.length;i++)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return!1;for(i=0;i<keys.length;i++)if(!equal(a[keys[i]],b[keys[i]]))return!1;return!0}return!1}},{}],7:[function(require,module,exports){function formats(mode){mode="full"==mode?"full":"fast";var formatDefs=util.copy(formats[mode]);for(var fName in formats.compare)formatDefs[fName]={validate:formatDefs[fName],compare:formats.compare[fName]};return formatDefs}function date(str){var matches=str.match(DATE);if(!matches)return!1;var month=+matches[1],day=+matches[2];return month>=1&&month<=12&&day>=1&&day<=DAYS[month]}function time(str,full){var matches=str.match(TIME);if(!matches)return!1;var hour=matches[1],minute=matches[2],second=matches[3],timeZone=matches[5];return hour<=23&&minute<=59&&second<=59&&(!full||timeZone)}function date_time(str){var dateTime=str.split(DATE_TIME_SEPARATOR);return 2==dateTime.length&&date(dateTime[0])&&time(dateTime[1],!0)}function hostname(str){return str.length<=255&&HOSTNAME.test(str)}function uri(str){return NOT_URI_FRAGMENT.test(str)&&URI.test(str)}function regex(str){try{return new RegExp(str),!0}catch(e){return!1}}function compareDate(d1,d2){if(d1&&d2)return d1>d2?1:d1<d2?-1:d1===d2?0:void 0}function compareTime(t1,t2){if(t1&&t2&&(t1=t1.match(TIME),t2=t2.match(TIME),t1&&t2))return t1=t1[1]+t1[2]+t1[3]+(t1[4]||""),t2=t2[1]+t2[2]+t2[3]+(t2[4]||""),t1>t2?1:t1<t2?-1:t1===t2?0:void 0}function compareDateTime(dt1,dt2){if(dt1&&dt2){dt1=dt1.split(DATE_TIME_SEPARATOR),dt2=dt2.split(DATE_TIME_SEPARATOR);var res=compareDate(dt1[0],dt2[0]);if(void 0!==res)return res||compareTime(dt1[1],dt2[1])}}var util=require("./util"),DATE=/^\d\d\d\d-(\d\d)-(\d\d)$/,DAYS=[0,31,29,31,30,31,30,31,31,30,31,30,31],TIME=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,HOSTNAME=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,URI=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i,UUID=/^(?:urn\:uuid\:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,JSON_POINTER=/^(?:\/(?:[^~\/]|~0|~1)*)*$|^\#(?:\/(?:[a-z0-9_\-\.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER=/^(?:0|[1-9][0-9]*)(?:\#|(?:\/(?:[^~\/]|~0|~1)*)*)$/;module.exports=formats,formats.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i,email:/^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:HOSTNAME,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:UUID,"json-pointer":JSON_POINTER,"relative-json-pointer":RELATIVE_JSON_POINTER},formats.full={date:date,time:time,"date-time":date_time,uri:uri,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:hostname,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:UUID,"json-pointer":JSON_POINTER,"relative-json-pointer":RELATIVE_JSON_POINTER},formats.compare={date:compareDate,time:compareTime,"date-time":compareDateTime};var DATE_TIME_SEPARATOR=/t|\s/i,NOT_URI_FRAGMENT=/\/|\:/},{"./util":13}],8:[function(require,module,exports){function loadBeautify(){if(void 0===beautify){try{beautify=require("js-beautify").js_beautify}catch(e){beautify=!1}}}function compile(schema,root,localRefs,baseId){function callValidate(){var validate=compilation.validate,result=validate.apply(null,arguments);return callValidate.errors=validate.errors,result}function localCompile(_schema,_root,localRefs,baseId){var isRoot=!_root||_root&&_root.schema==_schema;if(_root.schema!=root.schema)return compile.call(self,_schema,_root,localRefs,baseId);var $async=!0===_schema.$async;$async&&!opts.transpile&&async.setup(opts);var sourceCode=validateGenerator({isTop:!0,schema:_schema,isRoot:isRoot,baseId:baseId,root:_root,schemaPath:"",errSchemaPath:"#",errorPath:'""',RULES:RULES,validate:validateGenerator,util:util,resolve:resolve,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:opts,formats:formats,self:self});sourceCode=vars(refVal,refValCode)+vars(patterns,patternCode)+vars(defaults,defaultCode)+vars(customRules,customRuleCode)+sourceCode,opts.beautify&&(loadBeautify(),beautify?sourceCode=beautify(sourceCode,opts.beautify):console.error('"npm install js-beautify" to use beautify option'));var validate,validateCode,transpile=opts._transpileFunc;try{validateCode=$async&&transpile?transpile(sourceCode):sourceCode;validate=new Function("self","RULES","formats","root","refVal","defaults","customRules","co","equal","ucs2length","ValidationError",validateCode)(self,RULES,formats,root,refVal,defaults,customRules,co,equal,ucs2length,ValidationError),refVal[0]=validate}catch(e){throw console.error("Error compiling schema, function code:",validateCode),e}return validate.schema=_schema,validate.errors=null,validate.refs=refs,validate.refVal=refVal,validate.root=isRoot?validate:_root,$async&&(validate.$async=!0),keepSourceCode&&(validate.sourceCode=sourceCode),!0===opts.sourceCode&&(validate.source={patterns:patterns,defaults:defaults}),validate}function resolveRef(baseId,ref,isRoot){ref=resolve.url(baseId,ref);var _refVal,refCode,refIndex=refs[ref];if(void 0!==refIndex)return _refVal=refVal[refIndex],refCode="refVal["+refIndex+"]",resolvedRef(_refVal,refCode);if(!isRoot&&root.refs){var rootRefId=root.refs[ref];if(void 0!==rootRefId)return _refVal=root.refVal[rootRefId],refCode=addLocalRef(ref,_refVal),resolvedRef(_refVal,refCode)}refCode=addLocalRef(ref);var v=resolve.call(self,localCompile,root,ref);if(!v){var localSchema=localRefs&&localRefs[ref];localSchema&&(v=resolve.inlineRef(localSchema,opts.inlineRefs)?localSchema:compile.call(self,localSchema,root,localRefs,baseId))}return v?(replaceLocalRef(ref,v),resolvedRef(v,refCode)):void 0}function addLocalRef(ref,v){var refId=refVal.length;return refVal[refId]=v,refs[ref]=refId,"refVal"+refId}function replaceLocalRef(ref,v){var refId=refs[ref];refVal[refId]=v}function resolvedRef(refVal,code){return"object"==(void 0===refVal?"undefined":_typeof(refVal))?{code:code,schema:refVal,inline:!0}:{code:code,$async:refVal&&refVal.$async}}function usePattern(regexStr){var index=patternsHash[regexStr];return void 0===index&&(index=patternsHash[regexStr]=patterns.length,patterns[index]=regexStr),"pattern"+index}function useDefault(value){switch(void 0===value?"undefined":_typeof(value)){case"boolean":case"number":return""+value;case"string":return util.toQuotedString(value);case"object":if(null===value)return"null";var valueStr=stableStringify(value),index=defaultsHash[valueStr];return void 0===index&&(index=defaultsHash[valueStr]=defaults.length,defaults[index]=value),"default"+index}}function useCustomRule(rule,schema,parentSchema,it){var validateSchema=rule.definition.validateSchema;if(validateSchema&&!1!==self._opts.validateSchema){if(!validateSchema(schema)){var message="keyword schema is invalid: "+self.errorsText(validateSchema.errors);if("log"!=self._opts.validateSchema)throw new Error(message);console.error(message)}}var validate,compile=rule.definition.compile,inline=rule.definition.inline,macro=rule.definition.macro;compile?validate=compile.call(self,schema,parentSchema,it):macro?(validate=macro.call(self,schema,parentSchema,it),!1!==opts.validateSchema&&self.validateSchema(validate,!0)):validate=inline?inline.call(self,it,rule.keyword,schema,parentSchema):rule.definition.validate;var index=customRules.length;return customRules[index]=validate,{code:"customRule"+index,validate:validate}}var self=this,opts=this._opts,refVal=[void 0],refs={},patterns=[],patternsHash={},defaults=[],defaultsHash={},customRules=[],keepSourceCode=!1!==opts.sourceCode;root=root||{schema:schema,refVal:refVal,refs:refs};var c=checkCompiling.call(this,schema,root,baseId),compilation=this._compilations[c.index];if(c.compiling)return compilation.callValidate=callValidate;var formats=this._formats,RULES=this.RULES;try{var v=localCompile(schema,root,localRefs,baseId);compilation.validate=v;var cv=compilation.callValidate;return cv&&(cv.schema=v.schema,cv.errors=null,cv.refs=v.refs,cv.refVal=v.refVal,cv.root=v.root,cv.$async=v.$async,keepSourceCode&&(cv.sourceCode=v.sourceCode)),v}finally{endCompiling.call(this,schema,root,baseId)}}function checkCompiling(schema,root,baseId){var index=compIndex.call(this,schema,root,baseId);return index>=0?{index:index,compiling:!0}:(index=this._compilations.length,this._compilations[index]={schema:schema,root:root,baseId:baseId},{index:index,compiling:!1})}function endCompiling(schema,root,baseId){var i=compIndex.call(this,schema,root,baseId);i>=0&&this._compilations.splice(i,1)}function compIndex(schema,root,baseId){for(var i=0;i<this._compilations.length;i++){var c=this._compilations[i];if(c.schema==schema&&c.root==root&&c.baseId==baseId)return i}return-1}function patternCode(i,patterns){return"var pattern"+i+" = new RegExp("+util.toQuotedString(patterns[i])+");"}function defaultCode(i){return"var default"+i+" = defaults["+i+"];"}function refValCode(i,refVal){return refVal[i]?"var refVal"+i+" = refVal["+i+"];":""}function customRuleCode(i){return"var customRule"+i+" = customRules["+i+"];"}function vars(arr,statement){if(!arr.length)return"";for(var code="",i=0;i<arr.length;i++)code+=statement(i,arr);return code}var beautify,resolve=require("./resolve"),util=require("./util"),stableStringify=require("json-stable-stringify"),async=require("../async"),validateGenerator=require("../dotjs/validate"),co=require("co"),ucs2length=util.ucs2length,equal=require("./equal"),ValidationError=require("./validation_error");module.exports=compile},{"../async":3,"../dotjs/validate":38,"./equal":6,"./resolve":9,"./util":13,"./validation_error":14,co:112,"json-stable-stringify":226}],9:[function(require,module,exports){function resolve(compile,root,ref){var refVal=this._refs[ref];if("string"==typeof refVal){if(!this._refs[refVal])return resolve.call(this,compile,root,refVal);refVal=this._refs[refVal]}if((refVal=refVal||this._schemas[ref])instanceof SchemaObject)return inlineRef(refVal.schema,this._opts.inlineRefs)?refVal.schema:refVal.validate||this._compile(refVal);var schema,v,baseId,res=resolveSchema.call(this,root,ref);return res&&(schema=res.schema,root=res.root,baseId=res.baseId),schema instanceof SchemaObject?v=schema.validate||compile.call(this,schema.schema,root,void 0,baseId):schema&&(v=inlineRef(schema,this._opts.inlineRefs)?schema:compile.call(this,schema,root,void 0,baseId)),v}function resolveSchema(root,ref){var p=url.parse(ref,!1,!0),refPath=_getFullPath(p),baseId=getFullPath(root.schema.id);if(refPath!==baseId){var id=normalizeId(refPath),refVal=this._refs[id];if("string"==typeof refVal)return resolveRecursive.call(this,root,refVal,p);if(refVal instanceof SchemaObject)refVal.validate||this._compile(refVal),root=refVal;else{if(!((refVal=this._schemas[id])instanceof SchemaObject))return;if(refVal.validate||this._compile(refVal),id==normalizeId(ref))return{schema:refVal,root:root,baseId:baseId};root=refVal}if(!root.schema)return;baseId=getFullPath(root.schema.id)}return getJsonPointer.call(this,p,baseId,root.schema,root)}function resolveRecursive(root,ref,parsedRef){var res=resolveSchema.call(this,root,ref);if(res){var schema=res.schema,baseId=res.baseId;return root=res.root,schema.id&&(baseId=resolveUrl(baseId,schema.id)),getJsonPointer.call(this,parsedRef,baseId,schema,root)}}function getJsonPointer(parsedRef,baseId,schema,root){if(parsedRef.hash=parsedRef.hash||"","#/"==parsedRef.hash.slice(0,2)){for(var parts=parsedRef.hash.split("/"),i=1;i<parts.length;i++){var part=parts[i];if(part){if(part=util.unescapeFragment(part),!(schema=schema[part]))break;if(schema.id&&!PREVENT_SCOPE_CHANGE[part]&&(baseId=resolveUrl(baseId,schema.id)),schema.$ref){var $ref=resolveUrl(baseId,schema.$ref),res=resolveSchema.call(this,root,$ref);res&&(schema=res.schema,root=res.root,baseId=res.baseId)}}}return schema&&schema!=root.schema?{schema:schema,root:root,baseId:baseId}:void 0}}function inlineRef(schema,limit){return!1!==limit&&(void 0===limit||!0===limit?checkNoRef(schema):limit?countKeys(schema)<=limit:void 0)}function checkNoRef(schema){var item;if(Array.isArray(schema)){for(var i=0;i<schema.length;i++)if(item=schema[i],"object"==(void 0===item?"undefined":_typeof(item))&&!checkNoRef(item))return!1}else for(var key in schema){if("$ref"==key)return!1;if(item=schema[key],"object"==(void 0===item?"undefined":_typeof(item))&&!checkNoRef(item))return!1}return!0}function countKeys(schema){var item,count=0;if(Array.isArray(schema)){for(var i=0;i<schema.length;i++)if(item=schema[i],"object"==(void 0===item?"undefined":_typeof(item))&&(count+=countKeys(item)),count==1/0)return 1/0}else for(var key in schema){if("$ref"==key)return 1/0;if(SIMPLE_INLINED[key])count++;else if(item=schema[key],"object"==(void 0===item?"undefined":_typeof(item))&&(count+=countKeys(item)+1),count==1/0)return 1/0}return count}function getFullPath(id,normalize){return!1!==normalize&&(id=normalizeId(id)),_getFullPath(url.parse(id,!1,!0))}function _getFullPath(p){var protocolSeparator=p.protocol||"//"==p.href.slice(0,2)?"//":"";return(p.protocol||"")+protocolSeparator+(p.host||"")+(p.path||"")+"#"}function normalizeId(id){return id?id.replace(TRAILING_SLASH_HASH,""):""}function resolveUrl(baseId,id){return id=normalizeId(id),url.resolve(baseId,id)}function resolveIds(schema){function _resolveIds(schema,fullPath,baseId){if(Array.isArray(schema))for(var i=0;i<schema.length;i++)_resolveIds.call(this,schema[i],fullPath+"/"+i,baseId);else if(schema&&"object"==(void 0===schema?"undefined":_typeof(schema))){if("string"==typeof schema.id){var id=baseId=baseId?url.resolve(baseId,schema.id):schema.id;id=normalizeId(id);var refVal=this._refs[id];if("string"==typeof refVal&&(refVal=this._refs[refVal]),refVal&&refVal.schema){if(!equal(schema,refVal.schema))throw new Error('id "'+id+'" resolves to more than one schema')}else if(id!=normalizeId(fullPath))if("#"==id[0]){if(localRefs[id]&&!equal(schema,localRefs[id]))throw new Error('id "'+id+'" resolves to more than one schema');localRefs[id]=schema}else this._refs[id]=fullPath}for(var key in schema)_resolveIds.call(this,schema[key],fullPath+"/"+util.escapeFragment(key),baseId)}}var id=normalizeId(schema.id),localRefs={};return _resolveIds.call(this,schema,getFullPath(id,!1),id),localRefs}var url=require("url"),equal=require("./equal"),util=require("./util"),SchemaObject=require("./schema_obj");module.exports=resolve,resolve.normalizeId=normalizeId,resolve.fullPath=getFullPath,resolve.url=resolveUrl,resolve.ids=resolveIds,resolve.inlineRef=inlineRef,resolve.schema=resolveSchema;var PREVENT_SCOPE_CHANGE=util.toHash(["properties","patternProperties","enum","dependencies","definitions"]),SIMPLE_INLINED=util.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),TRAILING_SLASH_HASH=/#\/?$/},{"./equal":6,"./schema_obj":11,"./util":13,url:395}],10:[function(require,module,exports){var ruleModules=require("./_rules"),toHash=require("./util").toHash;module.exports=function(){var RULES=[{type:"number",rules:["maximum","minimum","multipleOf"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","uniqueItems","items"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","properties"]},{rules:["$ref","enum","not","anyOf","oneOf","allOf"]}],ALL=["type","additionalProperties","patternProperties"],KEYWORDS=["additionalItems","$schema","id","title","description","default"],TYPES=["number","integer","string","array","object","boolean","null"];return RULES.all=toHash(ALL),RULES.forEach(function(group){group.rules=group.rules.map(function(keyword){return ALL.push(keyword),RULES.all[keyword]={keyword:keyword,code:ruleModules[keyword]}})}),RULES.keywords=toHash(ALL.concat(KEYWORDS)),RULES.types=toHash(TYPES),RULES.custom={},RULES}},{"./_rules":5,"./util":13}],11:[function(require,module,exports){function SchemaObject(obj){util.copy(obj,this)}var util=require("./util");module.exports=SchemaObject},{"./util":13}],12:[function(require,module,exports){module.exports=function(str){for(var value,length=0,len=str.length,pos=0;pos<len;)length++,(value=str.charCodeAt(pos++))>=55296&&value<=56319&&pos<len&&56320==(64512&(value=str.charCodeAt(pos)))&&pos++;return length}},{}],13:[function(require,module,exports){function copy(o,to){to=to||{};for(var key in o)to[key]=o[key];return to}function checkDataType(dataType,data,negate){var EQUAL=negate?" !== ":" === ",AND=negate?" || ":" && ",OK=negate?"!":"",NOT=negate?"":"!";switch(dataType){case"null":return data+EQUAL+"null";case"array":return OK+"Array.isArray("+data+")";case"object":return"("+OK+data+AND+"typeof "+data+EQUAL+'"object"'+AND+NOT+"Array.isArray("+data+"))";case"integer":return"(typeof "+data+EQUAL+'"number"'+AND+NOT+"("+data+" % 1)"+AND+data+EQUAL+data+")";default:return"typeof "+data+EQUAL+'"'+dataType+'"'}}function checkDataTypes(dataTypes,data){switch(dataTypes.length){case 1:return checkDataType(dataTypes[0],data,!0);default:var code="",types=toHash(dataTypes);types.array&&types.object&&(code=types.null?"(":"(!"+data+" || ",code+="typeof "+data+' !== "object")',delete types.null,delete types.array,delete types.object),types.number&&delete types.integer;for(var t in types)code+=(code?" && ":"")+checkDataType(t,data,!0);return code}}function coerceToTypes(optionCoerceTypes,dataTypes){if(Array.isArray(dataTypes)){for(var types=[],i=0;i<dataTypes.length;i++){var t=dataTypes[i];COERCE_TO_TYPES[t]?types[types.length]=t:"array"===optionCoerceTypes&&"array"===t&&(types[types.length]=t)}if(types.length)return types}else{if(COERCE_TO_TYPES[dataTypes])return[dataTypes];if("array"===optionCoerceTypes&&"array"===dataTypes)return["array"]}}function toHash(arr){for(var hash={},i=0;i<arr.length;i++)hash[arr[i]]=!0;return hash}function getProperty(key){return"number"==typeof key?"["+key+"]":IDENTIFIER.test(key)?"."+key:"['"+escapeQuotes(key)+"']"}function escapeQuotes(str){return str.replace(SINGLE_QUOTE,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function varOccurences(str,dataVar){dataVar+="[^0-9]";var matches=str.match(new RegExp(dataVar,"g"));return matches?matches.length:0}function varReplace(str,dataVar,expr){return dataVar+="([^0-9])",expr=expr.replace(/\$/g,"$$$$"),str.replace(new RegExp(dataVar,"g"),expr+"$1")}function cleanUpCode(out){return out.replace(EMPTY_ELSE,"").replace(EMPTY_IF_NO_ELSE,"").replace(EMPTY_IF_WITH_ELSE,"if (!($1))")}function cleanUpVarErrors(out,async){var matches=out.match(ERRORS_REGEXP);return matches&&2===matches.length?async?out.replace(REMOVE_ERRORS_ASYNC,"").replace(RETURN_ASYNC,RETURN_TRUE_ASYNC):out.replace(REMOVE_ERRORS,"").replace(RETURN_VALID,RETURN_TRUE):out}function schemaHasRules(schema,rules){for(var key in schema)if(rules[key])return!0}function schemaHasRulesExcept(schema,rules,exceptKeyword){for(var key in schema)if(key!=exceptKeyword&&rules[key])return!0}function toQuotedString(str){return"'"+escapeQuotes(str)+"'"}function getPathExpr(currentPath,expr,jsonPointers,isNumber){return joinPaths(currentPath,jsonPointers?"'/' + "+expr+(isNumber?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):isNumber?"'[' + "+expr+" + ']'":"'[\\'' + "+expr+" + '\\']'")}function getPath(currentPath,prop,jsonPointers){return joinPaths(currentPath,toQuotedString(jsonPointers?"/"+escapeJsonPointer(prop):getProperty(prop)))}function getData($data,lvl,paths){var up,jsonPointer,data,matches;if(""===$data)return"rootData";if("/"==$data[0]){if(!JSON_POINTER.test($data))throw new Error("Invalid JSON-pointer: "+$data);jsonPointer=$data,data="rootData"}else{if(!(matches=$data.match(RELATIVE_JSON_POINTER)))throw new Error("Invalid JSON-pointer: "+$data);if(up=+matches[1],"#"==(jsonPointer=matches[2])){if(up>=lvl)throw new Error("Cannot access property/index "+up+" levels up, current level is "+lvl);return paths[lvl-up]}if(up>lvl)throw new Error("Cannot access data "+up+" levels up, current level is "+lvl);if(data="data"+(lvl-up||""),!jsonPointer)return data}for(var expr=data,segments=jsonPointer.split("/"),i=0;i<segments.length;i++){var segment=segments[i];segment&&(data+=getProperty(unescapeJsonPointer(segment)),expr+=" && "+data)}return expr}function joinPaths(a,b){return'""'==a?b:(a+" + "+b).replace(/' \+ '/g,"")}function unescapeFragment(str){return unescapeJsonPointer(decodeURIComponent(str))}function escapeFragment(str){return encodeURIComponent(escapeJsonPointer(str))}function escapeJsonPointer(str){return str.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(str){return str.replace(/~1/g,"/").replace(/~0/g,"~")}module.exports={copy:copy,checkDataType:checkDataType,checkDataTypes:checkDataTypes,coerceToTypes:coerceToTypes,toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,ucs2length:require("./ucs2length"),varOccurences:varOccurences,varReplace:varReplace,cleanUpCode:cleanUpCode,cleanUpVarErrors:cleanUpVarErrors,schemaHasRules:schemaHasRules,schemaHasRulesExcept:schemaHasRulesExcept,stableStringify:require("json-stable-stringify"),toQuotedString:toQuotedString,getPathExpr:getPathExpr,getPath:getPath,getData:getData,unescapeFragment:unescapeFragment,escapeFragment:escapeFragment,escapeJsonPointer:escapeJsonPointer};var COERCE_TO_TYPES=toHash(["string","number","integer","boolean","null"]),IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i,SINGLE_QUOTE=/'|\\/g,EMPTY_ELSE=/else\s*{\s*}/g,EMPTY_IF_NO_ELSE=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,EMPTY_IF_WITH_ELSE=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,ERRORS_REGEXP=/[^v\.]errors/g,REMOVE_ERRORS=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,REMOVE_ERRORS_ASYNC=/var errors = 0;|var vErrors = null;/g,RETURN_VALID="return errors === 0;",RETURN_TRUE="validate.errors = null; return true;",RETURN_ASYNC=/if \(errors === 0\) return true;\s*else throw new ValidationError\(vErrors\);/,RETURN_TRUE_ASYNC="return true;",JSON_POINTER=/^\/(?:[^~]|~0|~1)*$/,RELATIVE_JSON_POINTER=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},{"./ucs2length":12,"json-stable-stringify":226}],14:[function(require,module,exports){function ValidationError(errors){this.message="validation failed",this.errors=errors,this.ajv=this.validation=!0}module.exports=ValidationError,ValidationError.prototype=Object.create(Error.prototype),ValidationError.prototype.constructor=ValidationError},{}],15:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl;if(out+="var "+$valid+" = undefined;",!1===it.opts.format)return out+=" "+$valid+" = true; ";var $schemaFormat=it.schema.format,$isDataFormat=it.opts.v5&&$schemaFormat.$data,$closingBraces="";if($isDataFormat){var $schemaValueFormat=it.util.getData($schemaFormat.$data,$dataLvl,it.dataPathArr),$format="format"+$lvl,$compare="compare"+$lvl;out+=" var "+$format+" = formats["+$schemaValueFormat+"] , "+$compare+" = "+$format+" && "+$format+".compare;"}else{var $format=it.formats[$schemaFormat];if(!$format||!$format.compare)return out+=" "+$valid+" = true; ";var $compare="formats"+it.util.getProperty($schemaFormat)+".compare"}var $schemaValue,$isMax="formatMaximum"==$keyword,$exclusiveKeyword="formatExclusive"+($isMax?"Maximum":"Minimum"),$schemaExcl=it.schema[$exclusiveKeyword],$isDataExcl=it.opts.v5&&$schemaExcl&&$schemaExcl.$data,$op=$isMax?"<":">",$result="result"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;if($isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema,$isDataExcl){var $schemaValueExcl=it.util.getData($schemaExcl.$data,$dataLvl,it.dataPathArr),$exclusive="exclusive"+$lvl,$opExpr="op"+$lvl,$opStr="' + "+$opExpr+" + '";out+=" var schemaExcl"+$lvl+" = "+$schemaValueExcl+"; ",$schemaValueExcl="schemaExcl"+$lvl,out+=" if (typeof "+$schemaValueExcl+" != 'boolean' && "+$schemaValueExcl+" !== undefined) { "+$valid+" = false; ";var $errorKeyword=$exclusiveKeyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: '"+$exclusiveKeyword+" should be boolean' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",$breakOnError&&($closingBraces+="}",out+=" else { "),$isData&&(out+=" if ("+$schemaValue+" === undefined) "+$valid+" = true; else if (typeof "+$schemaValue+" != 'string') "+$valid+" = false; else { ",$closingBraces+="}"),$isDataFormat&&(out+=" if (!"+$compare+") "+$valid+" = true; else { ",$closingBraces+="}"),out+=" var "+$result+" = "+$compare+"("+$data+", ",out+=$isData?""+$schemaValue:""+it.util.toQuotedString($schema),out+=" ); if ("+$result+" === undefined) "+$valid+" = false; var "+$exclusive+" = "+$schemaValueExcl+" === true; if ("+$valid+" === undefined) { "+$valid+" = "+$exclusive+" ? "+$result+" "+$op+" 0 : "+$result+" "+$op+"= 0; } if (!"+$valid+") var op"+$lvl+" = "+$exclusive+" ? '"+$op+"' : '"+$op+"=';"}else{var $exclusive=!0===$schemaExcl,$opStr=$op;$exclusive||($opStr+="=");var $opExpr="'"+$opStr+"'";$isData&&(out+=" if ("+$schemaValue+" === undefined) "+$valid+" = true; else if (typeof "+$schemaValue+" != 'string') "+$valid+" = false; else { ",$closingBraces+="}"),$isDataFormat&&(out+=" if (!"+$compare+") "+$valid+" = true; else { ",$closingBraces+="}"),out+=" var "+$result+" = "+$compare+"("+$data+", ",out+=$isData?""+$schemaValue:""+it.util.toQuotedString($schema),out+=" ); if ("+$result+" === undefined) "+$valid+" = false; if ("+$valid+" === undefined) "+$valid+" = "+$result+" "+$op,$exclusive||(out+="="),out+=" 0;"}out+=$closingBraces+"if (!"+$valid+") { ";var $errorKeyword=$keyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_formatLimit")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { comparison: "+$opExpr+", limit: ",out+=$isData?""+$schemaValue:""+it.util.toQuotedString($schema),out+=" , exclusive: "+$exclusive+" } ",!1!==it.opts.messages&&(out+=" , message: 'should be "+$opStr+' "',out+=$isData?"' + "+$schemaValue+" + '":""+it.util.escapeQuotes($schema),out+="\"' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+it.util.toQuotedString($schema),out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="}"}},{}],16:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,$schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $isMax="maximum"==$keyword,$exclusiveKeyword=$isMax?"exclusiveMaximum":"exclusiveMinimum",$schemaExcl=it.schema[$exclusiveKeyword],$isDataExcl=it.opts.v5&&$schemaExcl&&$schemaExcl.$data,$op=$isMax?"<":">",$notOp=$isMax?">":"<";if($isDataExcl){var $schemaValueExcl=it.util.getData($schemaExcl.$data,$dataLvl,it.dataPathArr),$exclusive="exclusive"+$lvl,$opExpr="op"+$lvl,$opStr="' + "+$opExpr+" + '";out+=" var schemaExcl"+$lvl+" = "+$schemaValueExcl+"; ",$schemaValueExcl="schemaExcl"+$lvl,out+=" var exclusive"+$lvl+"; if (typeof "+$schemaValueExcl+" != 'boolean' && typeof "+$schemaValueExcl+" != 'undefined') { ";var $errorKeyword=$exclusiveKeyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: '"+$exclusiveKeyword+" should be boolean' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } else if( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'number') || "),out+=" ((exclusive"+$lvl+" = "+$schemaValueExcl+" === true) ? "+$data+" "+$notOp+"= "+$schemaValue+" : "+$data+" "+$notOp+" "+$schemaValue+") || "+$data+" !== "+$data+") { var op"+$lvl+" = exclusive"+$lvl+" ? '"+$op+"' : '"+$op+"=';"}else{var $exclusive=!0===$schemaExcl,$opStr=$op;$exclusive||($opStr+="=");var $opExpr="'"+$opStr+"'";out+=" if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'number') || "),out+=" "+$data+" "+$notOp,$exclusive&&(out+="="),out+=" "+$schemaValue+" || "+$data+" !== "+$data+") {"}var $errorKeyword=$keyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_limit")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { comparison: "+$opExpr+", limit: "+$schemaValue+", exclusive: "+$exclusive+" } ",!1!==it.opts.messages&&(out+=" , message: 'should be "+$opStr+" ",out+=$isData?"' + "+$schemaValue:$schema+"'"),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",$breakOnError&&(out+=" else { "),out}},{}],17:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,$schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $op="maxItems"==$keyword?">":"<";out+="if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'number') || "),out+=" "+$data+".length "+$op+" "+$schemaValue+") { ";var $errorKeyword=$keyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_limitItems")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { limit: "+$schemaValue+" } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have ",out+="maxItems"==$keyword?"more":"less",out+=" than ",out+=$isData?"' + "+$schemaValue+" + '":""+$schema,out+=" items' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} ",$breakOnError&&(out+=" else { "),out}},{}],18:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,$schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $op="maxLength"==$keyword?">":"<";out+="if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'number') || "),!1===it.opts.unicode?out+=" "+$data+".length ":out+=" ucs2length("+$data+") ",out+=" "+$op+" "+$schemaValue+") { ";var $errorKeyword=$keyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_limitLength")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { limit: "+$schemaValue+" } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT be ",out+="maxLength"==$keyword?"longer":"shorter",out+=" than ",out+=$isData?"' + "+$schemaValue+" + '":""+$schema,out+=" characters' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} ",$breakOnError&&(out+=" else { "),out}},{}],19:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,$schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $op="maxProperties"==$keyword?">":"<";out+="if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'number') || "),out+=" Object.keys("+$data+").length "+$op+" "+$schemaValue+") { ";var $errorKeyword=$keyword,$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"_limitProperties")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { limit: "+$schemaValue+" } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have ",out+="maxProperties"==$keyword?"more":"less",out+=" than ",out+=$isData?"' + "+$schemaValue+" + '":""+$schema,out+=" properties' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} ",$breakOnError&&(out+=" else { "),out}},{}],20:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level,$currentBaseId=$it.baseId,$allSchemasEmpty=!0,arr1=$schema;if(arr1)for(var $sch,$i=-1,l1=arr1.length-1;$i<l1;)$sch=arr1[$i+=1],it.util.schemaHasRules($sch,it.RULES.all)&&($allSchemasEmpty=!1,$it.schema=$sch,$it.schemaPath=$schemaPath+"["+$i+"]",$it.errSchemaPath=$errSchemaPath+"/"+$i,out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId,$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}"));return $breakOnError&&(out+=$allSchemasEmpty?" if (true) { ":" "+$closingBraces.slice(0,-1)+" "),out=it.util.cleanUpCode(out)}},{}],21:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level;if($schema.every(function($sch){return it.util.schemaHasRules($sch,it.RULES.all)})){var $currentBaseId=$it.baseId;out+=" var "+$errs+" = errors; var "+$valid+" = false; ";var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=!0;var arr1=$schema;if(arr1)for(var $sch,$i=-1,l1=arr1.length-1;$i<l1;)$sch=arr1[$i+=1],$it.schema=$sch,$it.schemaPath=$schemaPath+"["+$i+"]",$it.errSchemaPath=$errSchemaPath+"/"+$i,out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId,out+=" "+$valid+" = "+$valid+" || "+$nextValid+"; if (!"+$valid+") { ",$closingBraces+="}";it.compositeRule=$it.compositeRule=$wasComposite,out+=" "+$closingBraces+" if (!"+$valid+") { var err = ",!1!==it.createErrors?(out+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: 'should match some schema in anyOf' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = "+$errs+"; if (vErrors !== null) { if ("+$errs+") vErrors.length = "+$errs+"; else vErrors = null; } ",it.opts.allErrors&&(out+=" } "),out=it.util.cleanUpCode(out)}else $breakOnError&&(out+=" if (true) { ");return out}},{}],22:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;$isData&&(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; "),$isData||(out+=" var schema"+$lvl+" = validate.schema"+$schemaPath+";"),out+="var "+$valid+" = equal("+$data+", schema"+$lvl+"); if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'constant' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: 'should be equal to constant' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" }"}},{}],23:[function(require,module,exports){module.exports=function(it,$keyword){var $errorKeyword,$schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $compile,$inline,$macro,$ruleValidate,$validateCode,$rule=this,$definition="definition"+$lvl,$rDef=$rule.definition;if($isData&&$rDef.$data){$validateCode="keywordValidate"+$lvl;var $validateSchema=$rDef.validateSchema;out+=" var "+$definition+" = RULES.custom['"+$keyword+"'].definition; var "+$validateCode+" = "+$definition+".validate;"}else $ruleValidate=it.useCustomRule($rule,$schema,it.schema,it),$schemaValue="validate.schema"+$schemaPath,$validateCode=$ruleValidate.code,$compile=$rDef.compile,$inline=$rDef.inline,$macro=$rDef.macro;var $ruleErrs=$validateCode+".errors",$i="i"+$lvl,$ruleErr="ruleErr"+$lvl,$asyncKeyword=$rDef.async;if($asyncKeyword&&!it.async)throw new Error("async keyword in sync schema");if($inline||$macro||(out+=$ruleErrs+" = null;"),out+="var "+$errs+" = errors;var "+$valid+";",$validateSchema&&(out+=" "+$valid+" = "+$definition+".validateSchema("+$schemaValue+"); if ("+$valid+") {"),$inline)$rDef.statements?out+=" "+$ruleValidate.validate+" ":out+=" "+$valid+" = "+$ruleValidate.validate+"; ";else if($macro){var $it=it.util.copy(it);$it.level++;var $nextValid="valid"+$it.level;$it.schema=$ruleValidate.validate,$it.schemaPath="";var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=!0;var $code=it.validate($it).replace(/validate\.schema/g,$validateCode);it.compositeRule=$it.compositeRule=$wasComposite,out+=" "+$code}else{var $$outStack=$$outStack||[];$$outStack.push(out),out="",out+=" "+$validateCode+".call( ",it.opts.passContext?out+="this":out+="self",$compile||!1===$rDef.schema?out+=" , "+$data+" ":out+=" , "+$schemaValue+" , "+$data+" , validate.schema"+it.schemaPath+" ",out+=" , (dataPath || '')",'""'!=it.errorPath&&(out+=" + "+it.errorPath);var $parentData=$dataLvl?"data"+($dataLvl-1||""):"parentData",$parentDataProperty=$dataLvl?it.dataPathArr[$dataLvl]:"parentDataProperty";out+=" , "+$parentData+" , "+$parentDataProperty+" , rootData ) ";var def_callRuleValidate=out;out=$$outStack.pop(),!1===$rDef.errors?(out+=" "+$valid+" = ",$asyncKeyword&&(out+=""+it.yieldAwait),out+=def_callRuleValidate+"; "):$asyncKeyword?($ruleErrs="customErrors"+$lvl,out+=" var "+$ruleErrs+" = null; try { "+$valid+" = "+it.yieldAwait+def_callRuleValidate+"; } catch (e) { "+$valid+" = false; if (e instanceof ValidationError) "+$ruleErrs+" = e.errors; else throw e; } "):out+=" "+$ruleErrs+" = null; "+$valid+" = "+def_callRuleValidate+"; "}if($rDef.modifying&&(out+=" "+$data+" = "+$parentData+"["+$parentDataProperty+"];"),$validateSchema&&(out+=" }"),$rDef.valid)$breakOnError&&(out+=" if (true) { ");else{out+=" if ( ",void 0===$rDef.valid?(out+=" !",out+=$macro?""+$nextValid:""+$valid):out+=" "+!$rDef.valid+" ",out+=") { ",$errorKeyword=$rule.keyword;var $$outStack=$$outStack||[];$$outStack.push(out),out="";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"custom")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { keyword: '"+$rule.keyword+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should pass \""+$rule.keyword+"\" keyword validation' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var def_customError=out;out=$$outStack.pop(),$inline?$rDef.errors?"full"!=$rDef.errors&&(out+=" for (var "+$i+"="+$errs+"; "+$i+"<errors; "+$i+"++) { var "+$ruleErr+" = vErrors["+$i+"]; if ("+$ruleErr+".dataPath === undefined) "+$ruleErr+".dataPath = (dataPath || '') + "+it.errorPath+"; if ("+$ruleErr+".schemaPath === undefined) { "+$ruleErr+'.schemaPath = "'+$errSchemaPath+'"; } ',it.opts.verbose&&(out+=" "+$ruleErr+".schema = "+$schemaValue+"; "+$ruleErr+".data = "+$data+"; "),out+=" } "):!1===$rDef.errors?out+=" "+def_customError+" ":(out+=" if ("+$errs+" == errors) { "+def_customError+" } else { for (var "+$i+"="+$errs+"; "+$i+"<errors; "+$i+"++) { var "+$ruleErr+" = vErrors["+$i+"]; if ("+$ruleErr+".dataPath === undefined) "+$ruleErr+".dataPath = (dataPath || '') + "+it.errorPath+"; if ("+$ruleErr+".schemaPath === undefined) { "+$ruleErr+'.schemaPath = "'+$errSchemaPath+'"; } ',it.opts.verbose&&(out+=" "+$ruleErr+".schema = "+$schemaValue+"; "+$ruleErr+".data = "+$data+"; "),out+=" } } "):$macro?(out+=" var err = ",!1!==it.createErrors?(out+=" { keyword: '"+($errorKeyword||"custom")+"' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { keyword: '"+$rule.keyword+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should pass \""+$rule.keyword+"\" keyword validation' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!it.compositeRule&&$breakOnError&&(it.async?out+=" throw new ValidationError(vErrors); ":out+=" validate.errors = vErrors; return false; ")):!1===$rDef.errors?out+=" "+def_customError+" ":(out+=" if (Array.isArray("+$ruleErrs+")) { if (vErrors === null) vErrors = "+$ruleErrs+"; else vErrors = vErrors.concat("+$ruleErrs+"); errors = vErrors.length; for (var "+$i+"="+$errs+"; "+$i+"<errors; "+$i+"++) { var "+$ruleErr+" = vErrors["+$i+"]; if ("+$ruleErr+".dataPath === undefined) "+$ruleErr+".dataPath = (dataPath || '') + "+it.errorPath+"; "+$ruleErr+'.schemaPath = "'+$errSchemaPath+'"; ',it.opts.verbose&&(out+=" "+$ruleErr+".schema = "+$schemaValue+"; "+$ruleErr+".data = "+$data+"; "),out+=" } } else { "+def_customError+" } "),out+=" } ",$breakOnError&&(out+=" else { ")}return out}},{}],24:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level,$schemaDeps={},$propertyDeps={};for($property in $schema){var $sch=$schema[$property],$deps=Array.isArray($sch)?$propertyDeps:$schemaDeps;$deps[$property]=$sch}out+="var "+$errs+" = errors;";var $currentErrorPath=it.errorPath;out+="var missing"+$lvl+";";for(var $property in $propertyDeps){if($deps=$propertyDeps[$property],out+=" if ("+$data+it.util.getProperty($property)+" !== undefined ",$breakOnError){out+=" && ( ";var arr1=$deps;if(arr1)for(var _$property,$i=-1,l1=arr1.length-1;$i<l1;){_$property=arr1[$i+=1],$i&&(out+=" || ");var $prop=it.util.getProperty(_$property);out+=" ( "+$data+$prop+" === undefined && (missing"+$lvl+" = "+it.util.toQuotedString(it.opts.jsonPointers?_$property:$prop)+") ) "}out+=")) { ";var $propertyPath="missing"+$lvl,$missingProperty="' + "+$propertyPath+" + '";it.opts._errorDataPathProperty&&(it.errorPath=it.opts.jsonPointers?it.util.getPathExpr($currentErrorPath,$propertyPath,!0):$currentErrorPath+" + "+$propertyPath);var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { property: '"+it.util.escapeQuotes($property)+"', missingProperty: '"+$missingProperty+"', depsCount: "+$deps.length+", deps: '"+it.util.escapeQuotes(1==$deps.length?$deps[0]:$deps.join(", "))+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should have ",1==$deps.length?out+="property "+it.util.escapeQuotes($deps[0]):out+="properties "+it.util.escapeQuotes($deps.join(", ")),out+=" when property "+it.util.escapeQuotes($property)+" is present' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{out+=" ) { ";var arr2=$deps;if(arr2)for(var $reqProperty,i2=-1,l2=arr2.length-1;i2<l2;){$reqProperty=arr2[i2+=1];var $prop=it.util.getProperty($reqProperty),$missingProperty=it.util.escapeQuotes($reqProperty);it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPath($currentErrorPath,$reqProperty,it.opts.jsonPointers)),out+=" if ("+$data+$prop+" === undefined) { var err = ",!1!==it.createErrors?(out+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { property: '"+it.util.escapeQuotes($property)+"', missingProperty: '"+$missingProperty+"', depsCount: "+$deps.length+", deps: '"+it.util.escapeQuotes(1==$deps.length?$deps[0]:$deps.join(", "))+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should have ",1==$deps.length?out+="property "+it.util.escapeQuotes($deps[0]):out+="properties "+it.util.escapeQuotes($deps.join(", ")),out+=" when property "+it.util.escapeQuotes($property)+" is present' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}out+=" } ",$breakOnError&&($closingBraces+="}",out+=" else { ")}it.errorPath=$currentErrorPath;var $currentBaseId=$it.baseId;for(var $property in $schemaDeps){var $sch=$schemaDeps[$property];it.util.schemaHasRules($sch,it.RULES.all)&&(out+=" "+$nextValid+" = true; if ("+$data+it.util.getProperty($property)+" !== undefined) { ",$it.schema=$sch,$it.schemaPath=$schemaPath+it.util.getProperty($property),$it.errSchemaPath=$errSchemaPath+"/"+it.util.escapeFragment($property),out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId,out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}"))}return $breakOnError&&(out+=" "+$closingBraces+" if ("+$errs+" == errors) {"),out=it.util.cleanUpCode(out)}},{}],25:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;$isData&&(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ");var $i="i"+$lvl,$vSchema="schema"+$lvl;$isData||(out+=" var "+$vSchema+" = validate.schema"+$schemaPath+";"),out+="var "+$valid+";",$isData&&(out+=" if (schema"+$lvl+" === undefined) "+$valid+" = true; else if (!Array.isArray(schema"+$lvl+")) "+$valid+" = false; else {"),out+=$valid+" = false;for (var "+$i+"=0; "+$i+"<"+$vSchema+".length; "+$i+"++) if (equal("+$data+", "+$vSchema+"["+$i+"])) { "+$valid+" = true; break; }",$isData&&(out+=" } "),out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { allowedValues: schema"+$lvl+" } ",!1!==it.opts.messages&&(out+=" , message: 'should be equal to one of the allowed values' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" }",$breakOnError&&(out+=" else { "),out}},{}],26:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||"");if(!1===it.opts.format)return $breakOnError&&(out+=" if (true) { "),out;var $schemaValue,$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $unknownFormats=it.opts.unknownFormats,$allowUnknown=Array.isArray($unknownFormats);if($isData){var $format="format"+$lvl;out+=" var "+$format+" = formats["+$schemaValue+"]; var isObject"+$lvl+" = typeof "+$format+" == 'object' && !("+$format+" instanceof RegExp) && "+$format+".validate; if (isObject"+$lvl+") { ",it.async&&(out+=" var async"+$lvl+" = "+$format+".async; "),out+=" "+$format+" = "+$format+".validate; } if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'string') || "),out+=" (",(!0===$unknownFormats||$allowUnknown)&&(out+=" ("+$schemaValue+" && !"+$format+" ",$allowUnknown&&(out+=" && self._opts.unknownFormats.indexOf("+$schemaValue+") == -1 "),out+=") || "),out+=" ("+$format+" && !(typeof "+$format+" == 'function' ? ",it.async?out+=" (async"+$lvl+" ? "+it.yieldAwait+" "+$format+"("+$data+") : "+$format+"("+$data+")) ":out+=" "+$format+"("+$data+") ",out+=" : "+$format+".test("+$data+"))))) {"}else{var $format=it.formats[$schema];if(!$format){if(!0===$unknownFormats||$allowUnknown&&-1==$unknownFormats.indexOf($schema))throw new Error('unknown format "'+$schema+'" is used in schema at path "'+it.errSchemaPath+'"');return $allowUnknown||(console.warn('unknown format "'+$schema+'" ignored in schema at path "'+it.errSchemaPath+'"'),"ignore"!==$unknownFormats&&console.warn("In the next major version it will throw exception. See option unknownFormats for more information")),$breakOnError&&(out+=" if (true) { "),out}var $isObject="object"==(void 0===$format?"undefined":_typeof($format))&&!($format instanceof RegExp)&&$format.validate;if($isObject){var $async=!0===$format.async;$format=$format.validate}if($async){if(!it.async)throw new Error("async format in sync schema");var $formatRef="formats"+it.util.getProperty($schema)+".validate";out+=" if (!("+it.yieldAwait+" "+$formatRef+"("+$data+"))) { "}else{out+=" if (! ";var $formatRef="formats"+it.util.getProperty($schema);$isObject&&($formatRef+=".validate"),out+="function"==typeof $format?" "+$formatRef+"("+$data+") ":" "+$formatRef+".test("+$data+") ",out+=") { "}}var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'format' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { format: ",out+=$isData?""+$schemaValue:""+it.util.toQuotedString($schema),out+=" } ",!1!==it.opts.messages&&(out+=" , message: 'should match format \"",out+=$isData?"' + "+$schemaValue+" + '":""+it.util.escapeQuotes($schema),out+="\"' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+it.util.toQuotedString($schema),out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",$breakOnError&&(out+=" else { "),out}},{}],27:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level,$idx="i"+$lvl,$dataNxt=$it.dataLevel=it.dataLevel+1,$nextData="data"+$dataNxt,$currentBaseId=it.baseId;if(out+="var "+$errs+" = errors;var "+$valid+";",Array.isArray($schema)){var $additionalItems=it.schema.additionalItems;if(!1===$additionalItems){out+=" "+$valid+" = "+$data+".length <= "+$schema.length+"; ";var $currErrSchemaPath=$errSchemaPath;$errSchemaPath=it.errSchemaPath+"/additionalItems",out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { limit: "+$schema.length+" } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have more than "+$schema.length+" items' "),it.opts.verbose&&(out+=" , schema: false , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",$errSchemaPath=$currErrSchemaPath,$breakOnError&&($closingBraces+="}",out+=" else { ")}var arr1=$schema;if(arr1)for(var $sch,$i=-1,l1=arr1.length-1;$i<l1;)if($sch=arr1[$i+=1],it.util.schemaHasRules($sch,it.RULES.all)){out+=" "+$nextValid+" = true; if ("+$data+".length > "+$i+") { ";var $passData=$data+"["+$i+"]";$it.schema=$sch,$it.schemaPath=$schemaPath+"["+$i+"]",$it.errSchemaPath=$errSchemaPath+"/"+$i,$it.errorPath=it.util.getPathExpr(it.errorPath,$i,it.opts.jsonPointers,!0),$it.dataPathArr[$dataNxt]=$i;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}if("object"==(void 0===$additionalItems?"undefined":_typeof($additionalItems))&&it.util.schemaHasRules($additionalItems,it.RULES.all)){$it.schema=$additionalItems,$it.schemaPath=it.schemaPath+".additionalItems",$it.errSchemaPath=it.errSchemaPath+"/additionalItems",out+=" "+$nextValid+" = true; if ("+$data+".length > "+$schema.length+") { for (var "+$idx+" = "+$schema.length+"; "+$idx+" < "+$data+".length; "+$idx+"++) { ",$it.errorPath=it.util.getPathExpr(it.errorPath,$idx,it.opts.jsonPointers,!0);var $passData=$data+"["+$idx+"]";$it.dataPathArr[$dataNxt]=$idx;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",$breakOnError&&(out+=" if (!"+$nextValid+") break; "),out+=" } } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}}else if(it.util.schemaHasRules($schema,it.RULES.all)){$it.schema=$schema,$it.schemaPath=$schemaPath,$it.errSchemaPath=$errSchemaPath,out+=" for (var "+$idx+" = 0; "+$idx+" < "+$data+".length; "+$idx+"++) { ",$it.errorPath=it.util.getPathExpr(it.errorPath,$idx,it.opts.jsonPointers,!0);var $passData=$data+"["+$idx+"]";$it.dataPathArr[$dataNxt]=$idx;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",$breakOnError&&(out+=" if (!"+$nextValid+") break; "),out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}return $breakOnError&&(out+=" "+$closingBraces+" if ("+$errs+" == errors) {"),out=it.util.cleanUpCode(out)}},{}],28:[function(require,module,exports){module.exports=function(it,$keyword){var $schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema,out+="var division"+$lvl+";if (",$isData&&(out+=" "+$schemaValue+" !== undefined && ( typeof "+$schemaValue+" != 'number' || "),out+=" (division"+$lvl+" = "+$data+" / "+$schemaValue+", ",it.opts.multipleOfPrecision?out+=" Math.abs(Math.round(division"+$lvl+") - division"+$lvl+") > 1e-"+it.opts.multipleOfPrecision+" ":out+=" division"+$lvl+" !== parseInt(division"+$lvl+") ",out+=" ) ",$isData&&(out+=" ) "),out+=" ) { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { multipleOf: "+$schemaValue+" } ",!1!==it.opts.messages&&(out+=" , message: 'should be multiple of ",out+=$isData?"' + "+$schemaValue:$schema+"'"),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} ",$breakOnError&&(out+=" else { "),out}},{}],29:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$errs="errs__"+$lvl,$it=it.util.copy(it);$it.level++;var $nextValid="valid"+$it.level;if(it.util.schemaHasRules($schema,it.RULES.all)){$it.schema=$schema,$it.schemaPath=$schemaPath,$it.errSchemaPath=$errSchemaPath,out+=" var "+$errs+" = errors; ";var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=!0,$it.createErrors=!1;var $allErrorsOption;$it.opts.allErrors&&($allErrorsOption=$it.opts.allErrors,$it.opts.allErrors=!1),out+=" "+it.validate($it)+" ",$it.createErrors=!0,$allErrorsOption&&($it.opts.allErrors=$allErrorsOption),it.compositeRule=$it.compositeRule=$wasComposite,out+=" if ("+$nextValid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'not' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: 'should NOT be valid' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } else { errors = "+$errs+"; if (vErrors !== null) { if ("+$errs+") vErrors.length = "+$errs+"; else vErrors = null; } ",it.opts.allErrors&&(out+=" } ")}else out+=" var err = ",!1!==it.createErrors?(out+=" { keyword: 'not' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: 'should NOT be valid' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",$breakOnError&&(out+=" if (false) { ");return out}},{}],30:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level;out+="var "+$errs+" = errors;var prevValid"+$lvl+" = false;var "+$valid+" = false;";var $currentBaseId=$it.baseId,$wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=!0;var arr1=$schema;if(arr1)for(var $sch,$i=-1,l1=arr1.length-1;$i<l1;)$sch=arr1[$i+=1],it.util.schemaHasRules($sch,it.RULES.all)?($it.schema=$sch,$it.schemaPath=$schemaPath+"["+$i+"]",$it.errSchemaPath=$errSchemaPath+"/"+$i,out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId):out+=" var "+$nextValid+" = true; ",$i&&(out+=" if ("+$nextValid+" && prevValid"+$lvl+") "+$valid+" = false; else { ",$closingBraces+="}"),out+=" if ("+$nextValid+") "+$valid+" = prevValid"+$lvl+" = true;";it.compositeRule=$it.compositeRule=$wasComposite,out+=$closingBraces+"if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: {} ",!1!==it.opts.messages&&(out+=" , message: 'should match exactly one schema in oneOf' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} else { errors = "+$errs+"; if (vErrors !== null) { if ("+$errs+") vErrors.length = "+$errs+"; else vErrors = null; }",it.opts.allErrors&&(out+=" } "),out}},{}],31:[function(require,module,exports){module.exports=function(it,$keyword){var $schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$isData=it.opts.v5&&$schema&&$schema.$data;$isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema;var $regexp=$isData?"(new RegExp("+$schemaValue+"))":it.usePattern($schema);out+="if ( ",$isData&&(out+=" ("+$schemaValue+" !== undefined && typeof "+$schemaValue+" != 'string') || "),out+=" !"+$regexp+".test("+$data+") ) { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { pattern: ",out+=$isData?""+$schemaValue:""+it.util.toQuotedString($schema),out+=" } ",!1!==it.opts.messages&&(out+=" , message: 'should match pattern \"",out+=$isData?"' + "+$schemaValue+" + '":""+it.util.escapeQuotes($schema),out+="\"' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+it.util.toQuotedString($schema),out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;return out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+="} ",$breakOnError&&(out+=" else { "),out}},{}],32:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$key="key"+$lvl,$matched="patternMatched"+$lvl,$closingBraces="",$ownProperties=it.opts.ownProperties;out+="var "+$valid+" = true;";var arr1=$schema;if(arr1)for(var $pProperty,i1=-1,l1=arr1.length-1;i1<l1;){$pProperty=arr1[i1+=1],out+=" var "+$matched+" = false; for (var "+$key+" in "+$data+") { ",$ownProperties&&(out+=" if (!Object.prototype.hasOwnProperty.call("+$data+", "+$key+")) continue; "),out+=" "+$matched+" = "+it.usePattern($pProperty)+".test("+$key+"); if ("+$matched+") break; } ";var $missingPattern=it.util.escapeQuotes($pProperty);out+=" if (!"+$matched+") { "+$valid+" = false; var err = ",!1!==it.createErrors?(out+=" { keyword: 'patternRequired' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingPattern: '"+$missingPattern+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should have property matching pattern \\'"+$missingPattern+"\\'' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ",$breakOnError&&($closingBraces+="}",out+=" else { ")}return out+=""+$closingBraces}},{}],33:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $nextValid="valid"+$it.level,$key="key"+$lvl,$dataNxt=$it.dataLevel=it.dataLevel+1,$nextData="data"+$dataNxt,$schemaKeys=Object.keys($schema||{}),$pProperties=it.schema.patternProperties||{},$pPropertyKeys=Object.keys($pProperties),$aProperties=it.schema.additionalProperties,$someProperties=$schemaKeys.length||$pPropertyKeys.length,$noAdditional=!1===$aProperties,$additionalIsSchema="object"==(void 0===$aProperties?"undefined":_typeof($aProperties))&&Object.keys($aProperties).length,$removeAdditional=it.opts.removeAdditional,$checkAdditional=$noAdditional||$additionalIsSchema||$removeAdditional,$ownProperties=it.opts.ownProperties,$currentBaseId=it.baseId,$required=it.schema.required;if($required&&(!it.opts.v5||!$required.$data)&&$required.length<it.opts.loopRequired)var $requiredHash=it.util.toHash($required);if(it.opts.v5)var $pgProperties=it.schema.patternGroups||{},$pgPropertyKeys=Object.keys($pgProperties);if(out+="var "+$errs+" = errors;var "+$nextValid+" = true;",$checkAdditional){if(out+=" for (var "+$key+" in "+$data+") { ",$ownProperties&&(out+=" if (!Object.prototype.hasOwnProperty.call("+$data+", "+$key+")) continue; "),$someProperties){if(out+=" var isAdditional"+$lvl+" = !(false ",$schemaKeys.length)if($schemaKeys.length>5)out+=" || validate.schema"+$schemaPath+"["+$key+"] ";else{var arr1=$schemaKeys;if(arr1)for(var $propertyKey,i1=-1,l1=arr1.length-1;i1<l1;)$propertyKey=arr1[i1+=1],out+=" || "+$key+" == "+it.util.toQuotedString($propertyKey)+" "}if($pPropertyKeys.length){var arr2=$pPropertyKeys;if(arr2)for(var $pProperty,$i=-1,l2=arr2.length-1;$i<l2;)$pProperty=arr2[$i+=1],out+=" || "+it.usePattern($pProperty)+".test("+$key+") "}if(it.opts.v5&&$pgPropertyKeys&&$pgPropertyKeys.length){var arr3=$pgPropertyKeys;if(arr3)for(var $pgProperty,$i=-1,l3=arr3.length-1;$i<l3;)$pgProperty=arr3[$i+=1],out+=" || "+it.usePattern($pgProperty)+".test("+$key+") "}out+=" ); if (isAdditional"+$lvl+") { "}if("all"==$removeAdditional)out+=" delete "+$data+"["+$key+"]; ";else{var $currentErrorPath=it.errorPath,$additionalProperty="' + "+$key+" + '";if(it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPathExpr(it.errorPath,$key,it.opts.jsonPointers)),$noAdditional)if($removeAdditional)out+=" delete "+$data+"["+$key+"]; ";else{out+=" "+$nextValid+" = false; ";var $currErrSchemaPath=$errSchemaPath;$errSchemaPath=it.errSchemaPath+"/additionalProperties";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { additionalProperty: '"+$additionalProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have additional properties' "),it.opts.verbose&&(out+=" , schema: false , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",$errSchemaPath=$currErrSchemaPath,$breakOnError&&(out+=" break; ")}else if($additionalIsSchema)if("failing"==$removeAdditional){out+=" var "+$errs+" = errors; ";var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=!0,$it.schema=$aProperties,$it.schemaPath=it.schemaPath+".additionalProperties",$it.errSchemaPath=it.errSchemaPath+"/additionalProperties",$it.errorPath=it.opts._errorDataPathProperty?it.errorPath:it.util.getPathExpr(it.errorPath,$key,it.opts.jsonPointers);var $passData=$data+"["+$key+"]";$it.dataPathArr[$dataNxt]=$key;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",out+=" if (!"+$nextValid+") { errors = "+$errs+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+$data+"["+$key+"]; } ",it.compositeRule=$it.compositeRule=$wasComposite}else{$it.schema=$aProperties,$it.schemaPath=it.schemaPath+".additionalProperties",$it.errSchemaPath=it.errSchemaPath+"/additionalProperties",$it.errorPath=it.opts._errorDataPathProperty?it.errorPath:it.util.getPathExpr(it.errorPath,$key,it.opts.jsonPointers);var $passData=$data+"["+$key+"]";$it.dataPathArr[$dataNxt]=$key;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",$breakOnError&&(out+=" if (!"+$nextValid+") break; ")}it.errorPath=$currentErrorPath}$someProperties&&(out+=" } "),out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}var $useDefaults=it.opts.useDefaults&&!it.compositeRule;if($schemaKeys.length){var arr4=$schemaKeys;if(arr4)for(var $propertyKey,i4=-1,l4=arr4.length-1;i4<l4;){$propertyKey=arr4[i4+=1];var $sch=$schema[$propertyKey];if(it.util.schemaHasRules($sch,it.RULES.all)){var $prop=it.util.getProperty($propertyKey),$passData=$data+$prop,$hasDefault=$useDefaults&&void 0!==$sch.default;$it.schema=$sch,$it.schemaPath=$schemaPath+$prop,$it.errSchemaPath=$errSchemaPath+"/"+it.util.escapeFragment($propertyKey),$it.errorPath=it.util.getPath(it.errorPath,$propertyKey,it.opts.jsonPointers),$it.dataPathArr[$dataNxt]=it.util.toQuotedString($propertyKey);var $code=it.validate($it);if($it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2){$code=it.util.varReplace($code,$nextData,$passData);var $useData=$passData}else{var $useData=$nextData;out+=" var "+$nextData+" = "+$passData+"; "}if($hasDefault)out+=" "+$code+" ";else{if($requiredHash&&$requiredHash[$propertyKey]){out+=" if ("+$useData+" === undefined) { "+$nextValid+" = false; ";var $currentErrorPath=it.errorPath,$currErrSchemaPath=$errSchemaPath,$missingProperty=it.util.escapeQuotes($propertyKey);it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPath($currentErrorPath,$propertyKey,it.opts.jsonPointers)),$errSchemaPath=it.errSchemaPath+"/required";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",$errSchemaPath=$currErrSchemaPath,it.errorPath=$currentErrorPath,out+=" } else { "}else out+=$breakOnError?" if ("+$useData+" === undefined) { "+$nextValid+" = true; } else { ":" if ("+$useData+" !== undefined) { ";out+=" "+$code+" } "}}$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}}var arr5=$pPropertyKeys;if(arr5)for(var $pProperty,i5=-1,l5=arr5.length-1;i5<l5;){$pProperty=arr5[i5+=1];var $sch=$pProperties[$pProperty];if(it.util.schemaHasRules($sch,it.RULES.all)){$it.schema=$sch,$it.schemaPath=it.schemaPath+".patternProperties"+it.util.getProperty($pProperty),$it.errSchemaPath=it.errSchemaPath+"/patternProperties/"+it.util.escapeFragment($pProperty),out+=" for (var "+$key+" in "+$data+") { ",$ownProperties&&(out+=" if (!Object.prototype.hasOwnProperty.call("+$data+", "+$key+")) continue; "),out+=" if ("+it.usePattern($pProperty)+".test("+$key+")) { ",$it.errorPath=it.util.getPathExpr(it.errorPath,$key,it.opts.jsonPointers);var $passData=$data+"["+$key+"]";$it.dataPathArr[$dataNxt]=$key;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",$breakOnError&&(out+=" if (!"+$nextValid+") break; "),out+=" } ",$breakOnError&&(out+=" else "+$nextValid+" = true; "),out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}")}}if(it.opts.v5){var arr6=$pgPropertyKeys;if(arr6)for(var $pgProperty,i6=-1,l6=arr6.length-1;i6<l6;){$pgProperty=arr6[i6+=1];var $pgSchema=$pgProperties[$pgProperty],$sch=$pgSchema.schema;if(it.util.schemaHasRules($sch,it.RULES.all)){$it.schema=$sch,$it.schemaPath=it.schemaPath+".patternGroups"+it.util.getProperty($pgProperty)+".schema",$it.errSchemaPath=it.errSchemaPath+"/patternGroups/"+it.util.escapeFragment($pgProperty)+"/schema",out+=" var pgPropCount"+$lvl+" = 0; for (var "+$key+" in "+$data+") { ",$ownProperties&&(out+=" if (!Object.prototype.hasOwnProperty.call("+$data+", "+$key+")) continue; "),out+=" if ("+it.usePattern($pgProperty)+".test("+$key+")) { pgPropCount"+$lvl+"++; ",$it.errorPath=it.util.getPathExpr(it.errorPath,$key,it.opts.jsonPointers);var $passData=$data+"["+$key+"]";$it.dataPathArr[$dataNxt]=$key;var $code=it.validate($it);$it.baseId=$currentBaseId,it.util.varOccurences($code,$nextData)<2?out+=" "+it.util.varReplace($code,$nextData,$passData)+" ":out+=" var "+$nextData+" = "+$passData+"; "+$code+" ",$breakOnError&&(out+=" if (!"+$nextValid+") break; "),out+=" } ",$breakOnError&&(out+=" else "+$nextValid+" = true; "),out+=" } ",$breakOnError&&(out+=" if ("+$nextValid+") { ",$closingBraces+="}");var $pgMin=$pgSchema.minimum,$pgMax=$pgSchema.maximum;if(void 0!==$pgMin||void 0!==$pgMax){out+=" var "+$valid+" = true; ";var $currErrSchemaPath=$errSchemaPath;if(void 0!==$pgMin){var $limit=$pgMin,$reason="minimum",$moreOrLess="less";out+=" "+$valid+" = pgPropCount"+$lvl+" >= "+$pgMin+"; ",$errSchemaPath=it.errSchemaPath+"/patternGroups/minimum",out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { reason: '"+$reason+"', limit: "+$limit+", pattern: '"+it.util.escapeQuotes($pgProperty)+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have "+$moreOrLess+" than "+$limit+' properties matching pattern "'+it.util.escapeQuotes($pgProperty)+"\"' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",void 0!==$pgMax&&(out+=" else ")}if(void 0!==$pgMax){var $limit=$pgMax,$reason="maximum",$moreOrLess="more";out+=" "+$valid+" = pgPropCount"+$lvl+" <= "+$pgMax+"; ",$errSchemaPath=it.errSchemaPath+"/patternGroups/maximum",out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { reason: '"+$reason+"', limit: "+$limit+", pattern: '"+it.util.escapeQuotes($pgProperty)+"' } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have "+$moreOrLess+" than "+$limit+' properties matching pattern "'+it.util.escapeQuotes($pgProperty)+"\"' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } "}$errSchemaPath=$currErrSchemaPath,$breakOnError&&(out+=" if ("+$valid+") { ",$closingBraces+="}")}}}}return $breakOnError&&(out+=" "+$closingBraces+" if ("+$errs+" == errors) {"),out=it.util.cleanUpCode(out)}},{}],34:[function(require,module,exports){module.exports=function(it,$keyword){var $async,$refCode,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl;if("#"==$schema||"#/"==$schema)it.isRoot?($async=it.async,$refCode="validate"):($async=!0===it.root.schema.$async,$refCode="root.refVal[0]");else{var $refVal=it.resolveRef(it.baseId,$schema,it.isRoot);if(void 0===$refVal){var $message="can't resolve reference "+$schema+" from id "+it.baseId;if("fail"==it.opts.missingRefs){console.log($message);var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { ref: '"+it.util.escapeQuotes($schema)+"' } ",!1!==it.opts.messages&&(out+=" , message: 'can\\'t resolve reference "+it.util.escapeQuotes($schema)+"' "),it.opts.verbose&&(out+=" , schema: "+it.util.toQuotedString($schema)+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",$breakOnError&&(out+=" if (false) { ")}else{if("ignore"!=it.opts.missingRefs){var $error=new Error($message);throw $error.missingRef=it.resolve.url(it.baseId,$schema),$error.missingSchema=it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)),$error}console.log($message),$breakOnError&&(out+=" if (true) { ")}}else if($refVal.inline){var $it=it.util.copy(it);$it.level++;var $nextValid="valid"+$it.level;$it.schema=$refVal.schema,$it.schemaPath="",$it.errSchemaPath=$schema;var $code=it.validate($it).replace(/validate\.schema/g,$refVal.code);out+=" "+$code+" ",$breakOnError&&(out+=" if ("+$nextValid+") { ")}else $async=!0===$refVal.$async,$refCode=$refVal.code}if($refCode){var $$outStack=$$outStack||[];$$outStack.push(out),out="",it.opts.passContext?out+=" "+$refCode+".call(this, ":out+=" "+$refCode+"( ",out+=" "+$data+", (dataPath || '')",'""'!=it.errorPath&&(out+=" + "+it.errorPath);out+=" , "+($dataLvl?"data"+($dataLvl-1||""):"parentData")+" , "+($dataLvl?it.dataPathArr[$dataLvl]:"parentDataProperty")+", rootData) ";var __callValidate=out;if(out=$$outStack.pop(),$async){if(!it.async)throw new Error("async schema referenced by sync schema");out+=" try { ",$breakOnError&&(out+="var "+$valid+" ="),out+=" "+it.yieldAwait+" "+__callValidate+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",$breakOnError&&(out+=" if ("+$valid+") { ")}else out+=" if (!"+__callValidate+") { if (vErrors === null) vErrors = "+$refCode+".errors; else vErrors = vErrors.concat("+$refCode+".errors); errors = vErrors.length; } ",$breakOnError&&(out+=" else { ")}return out}},{}],35:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;$isData&&(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ");var $vSchema="schema"+$lvl;if(!$isData)if($schema.length<it.opts.loopRequired&&it.schema.properties&&Object.keys(it.schema.properties).length){var $required=[],arr1=$schema;if(arr1)for(var $property,i1=-1,l1=arr1.length-1;i1<l1;){$property=arr1[i1+=1];var $propertySch=it.schema.properties[$property];$propertySch&&it.util.schemaHasRules($propertySch,it.RULES.all)||($required[$required.length]=$property)}}else var $required=$schema;if($isData||$required.length){var $currentErrorPath=it.errorPath,$loopRequired=$isData||$required.length>=it.opts.loopRequired;if($breakOnError)if(out+=" var missing"+$lvl+"; ",$loopRequired){$isData||(out+=" var "+$vSchema+" = validate.schema"+$schemaPath+"; ");var $i="i"+$lvl,$propertyPath="schema"+$lvl+"["+$i+"]",$missingProperty="' + "+$propertyPath+" + '";it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPathExpr($currentErrorPath,$propertyPath,it.opts.jsonPointers)),out+=" var "+$valid+" = true; ",$isData&&(out+=" if (schema"+$lvl+" === undefined) "+$valid+" = true; else if (!Array.isArray(schema"+$lvl+")) "+$valid+" = false; else {"),out+=" for (var "+$i+" = 0; "+$i+" < "+$vSchema+".length; "+$i+"++) { "+$valid+" = "+$data+"["+$vSchema+"["+$i+"]] !== undefined; if (!"+$valid+") break; } ",$isData&&(out+=" } "),out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } else { "}else{out+=" if ( ";var arr2=$required;if(arr2)for(var _$property,$i=-1,l2=arr2.length-1;$i<l2;){_$property=arr2[$i+=1],$i&&(out+=" || ");var $prop=it.util.getProperty(_$property);out+=" ( "+$data+$prop+" === undefined && (missing"+$lvl+" = "+it.util.toQuotedString(it.opts.jsonPointers?_$property:$prop)+") ) "}out+=") { ";var $propertyPath="missing"+$lvl,$missingProperty="' + "+$propertyPath+" + '";it.opts._errorDataPathProperty&&(it.errorPath=it.opts.jsonPointers?it.util.getPathExpr($currentErrorPath,$propertyPath,!0):$currentErrorPath+" + "+$propertyPath);var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } else { "}else if($loopRequired){$isData||(out+=" var "+$vSchema+" = validate.schema"+$schemaPath+"; ");var $i="i"+$lvl,$propertyPath="schema"+$lvl+"["+$i+"]",$missingProperty="' + "+$propertyPath+" + '";it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPathExpr($currentErrorPath,$propertyPath,it.opts.jsonPointers)),$isData&&(out+=" if ("+$vSchema+" && !Array.isArray("+$vSchema+")) { var err = ",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+$vSchema+" !== undefined) { "),out+=" for (var "+$i+" = 0; "+$i+" < "+$vSchema+".length; "+$i+"++) { if ("+$data+"["+$vSchema+"["+$i+"]] === undefined) { var err = ",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",$isData&&(out+=" } ")}else{var arr3=$required;if(arr3)for(var $reqProperty,i3=-1,l3=arr3.length-1;i3<l3;){$reqProperty=arr3[i3+=1];var $prop=it.util.getProperty($reqProperty),$missingProperty=it.util.escapeQuotes($reqProperty);it.opts._errorDataPathProperty&&(it.errorPath=it.util.getPath($currentErrorPath,$reqProperty,it.opts.jsonPointers)),out+=" if ("+$data+$prop+" === undefined) { var err = ",!1!==it.createErrors?(out+=" { keyword: 'required' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { missingProperty: '"+$missingProperty+"' } ",!1!==it.opts.messages&&(out+=" , message: '",it.opts._errorDataPathProperty?out+="is a required property":out+="should have required property \\'"+$missingProperty+"\\'",out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ",out+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}it.errorPath=$currentErrorPath}else $breakOnError&&(out+=" if (true) {");return out}},{}],36:[function(require,module,exports){module.exports=function(it,$keyword){var out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$errs="errs__"+$lvl,$it=it.util.copy(it),$closingBraces="";$it.level++;var $shouldContinue,$nextValid="valid"+$it.level,$ifPassed="ifPassed"+it.level,$currentBaseId=$it.baseId;out+="var "+$ifPassed+";";var arr1=$schema;if(arr1)for(var $sch,$caseIndex=-1,l1=arr1.length-1;$caseIndex<l1;){if($sch=arr1[$caseIndex+=1],$caseIndex&&!$shouldContinue&&(out+=" if (!"+$ifPassed+") { ",$closingBraces+="}"),$sch.if&&it.util.schemaHasRules($sch.if,it.RULES.all)){out+=" var "+$errs+" = errors; ";var $wasComposite=it.compositeRule;if(it.compositeRule=$it.compositeRule=!0,$it.createErrors=!1,$it.schema=$sch.if,$it.schemaPath=$schemaPath+"["+$caseIndex+"].if",$it.errSchemaPath=$errSchemaPath+"/"+$caseIndex+"/if",out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId,$it.createErrors=!0,it.compositeRule=$it.compositeRule=$wasComposite,out+=" "+$ifPassed+" = "+$nextValid+"; if ("+$ifPassed+") { ","boolean"==typeof $sch.then){if(!1===$sch.then){var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'switch' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { caseIndex: "+$caseIndex+" } ",!1!==it.opts.messages&&(out+=" , message: 'should pass \"switch\" keyword validation' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}out+=" var "+$nextValid+" = "+$sch.then+"; "}else $it.schema=$sch.then,$it.schemaPath=$schemaPath+"["+$caseIndex+"].then",$it.errSchemaPath=$errSchemaPath+"/"+$caseIndex+"/then",out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId;out+=" } else { errors = "+$errs+"; if (vErrors !== null) { if ("+$errs+") vErrors.length = "+$errs+"; else vErrors = null; } } "}else if(out+=" "+$ifPassed+" = true; ","boolean"==typeof $sch.then){if(!1===$sch.then){var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'switch' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { caseIndex: "+$caseIndex+" } ",!1!==it.opts.messages&&(out+=" , message: 'should pass \"switch\" keyword validation' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}out+=" var "+$nextValid+" = "+$sch.then+"; "}else $it.schema=$sch.then,$it.schemaPath=$schemaPath+"["+$caseIndex+"].then",$it.errSchemaPath=$errSchemaPath+"/"+$caseIndex+"/then",out+=" "+it.validate($it)+" ",$it.baseId=$currentBaseId;$shouldContinue=$sch.continue}return out+=$closingBraces+"var "+$valid+" = "+$nextValid+"; ",out=it.util.cleanUpCode(out)}},{}],37:[function(require,module,exports){module.exports=function(it,$keyword){var $schemaValue,out=" ",$lvl=it.level,$dataLvl=it.dataLevel,$schema=it.schema[$keyword],$schemaPath=it.schemaPath+it.util.getProperty($keyword),$errSchemaPath=it.errSchemaPath+"/"+$keyword,$breakOnError=!it.opts.allErrors,$data="data"+($dataLvl||""),$valid="valid"+$lvl,$isData=it.opts.v5&&$schema&&$schema.$data;if($isData?(out+=" var schema"+$lvl+" = "+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+"; ",$schemaValue="schema"+$lvl):$schemaValue=$schema,($schema||$isData)&&!1!==it.opts.uniqueItems){$isData&&(out+=" var "+$valid+"; if ("+$schemaValue+" === false || "+$schemaValue+" === undefined) "+$valid+" = true; else if (typeof "+$schemaValue+" != 'boolean') "+$valid+" = false; else { "),out+=" var "+$valid+" = true; if ("+$data+".length > 1) { var i = "+$data+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+$data+"[i], "+$data+"[j])) { "+$valid+" = false; break outer; } } } } ",$isData&&(out+=" } "),out+=" if (!"+$valid+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { i: i, j: j } ",!1!==it.opts.messages&&(out+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),it.opts.verbose&&(out+=" , schema: ",out+=$isData?"validate.schema"+$schemaPath:""+$schema,out+=" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } ",$breakOnError&&(out+=" else { ")}else $breakOnError&&(out+=" if (true) { ");return out}},{}],38:[function(require,module,exports){module.exports=function(it,$keyword){function $shouldUseGroup($rulesGroup){for(var i=0;i<$rulesGroup.rules.length;i++)if($shouldUseRule($rulesGroup.rules[i]))return!0}function $shouldUseRule($rule){return void 0!==it.schema[$rule.keyword]||"properties"==$rule.keyword&&(!1===it.schema.additionalProperties||"object"==_typeof(it.schema.additionalProperties)||it.schema.patternProperties&&Object.keys(it.schema.patternProperties).length||it.opts.v5&&it.schema.patternGroups&&Object.keys(it.schema.patternGroups).length)}var out="",$async=!0===it.schema.$async;if(it.isTop){var $top=it.isTop,$lvl=it.level=0,$dataLvl=it.dataLevel=0,$data="data";if(it.rootId=it.resolve.fullPath(it.root.schema.id),it.baseId=it.baseId||it.rootId,$async){it.async=!0;var $es7="es7"==it.opts.async;it.yieldAwait=$es7?"await":"yield"}delete it.isTop,it.dataPathArr=[void 0],out+=" var validate = ",$async?$es7?out+=" (async function ":("co*"==it.opts.async&&(out+="co.wrap"),out+="(function* "):out+=" (function ",out+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; ",out+=" var errors = 0; ",out+=" if (rootData === undefined) rootData = data;"}else{var $lvl=it.level,$dataLvl=it.dataLevel,$data="data"+($dataLvl||"");if(it.schema.id&&(it.baseId=it.resolve.url(it.baseId,it.schema.id)),$async&&!it.async)throw new Error("async schema in sync schema");out+=" var errs_"+$lvl+" = errors;"}var $valid="valid"+$lvl,$breakOnError=!it.opts.allErrors,$closingBraces1="",$closingBraces2="",$typeSchema=it.schema.type,$typeIsArray=Array.isArray($typeSchema);if($typeSchema&&it.opts.coerceTypes){var $coerceToTypes=it.util.coerceToTypes(it.opts.coerceTypes,$typeSchema);if($coerceToTypes){var $schemaPath=it.schemaPath+".type",$errSchemaPath=it.errSchemaPath+"/type",$method=$typeIsArray?"checkDataTypes":"checkDataType";out+=" if ("+it.util[$method]($typeSchema,$data,!0)+") { ";var $dataType="dataType"+$lvl,$coerced="coerced"+$lvl;out+=" var "+$dataType+" = typeof "+$data+"; ","array"==it.opts.coerceTypes&&(out+=" if ("+$dataType+" == 'object' && Array.isArray("+$data+")) "+$dataType+" = 'array'; "),out+=" var "+$coerced+" = undefined; ";var $bracesCoercion="",arr1=$coerceToTypes;if(arr1)for(var $type,$i=-1,l1=arr1.length-1;$i<l1;)$type=arr1[$i+=1],$i&&(out+=" if ("+$coerced+" === undefined) { ",$bracesCoercion+="}"),"array"==it.opts.coerceTypes&&"array"!=$type&&(out+=" if ("+$dataType+" == 'array' && "+$data+".length == 1) { "+$coerced+" = "+$data+" = "+$data+"[0]; "+$dataType+" = typeof "+$data+"; } "),"string"==$type?out+=" if ("+$dataType+" == 'number' || "+$dataType+" == 'boolean') "+$coerced+" = '' + "+$data+"; else if ("+$data+" === null) "+$coerced+" = ''; ":"number"==$type||"integer"==$type?(out+=" if ("+$dataType+" == 'boolean' || "+$data+" === null || ("+$dataType+" == 'string' && "+$data+" && "+$data+" == +"+$data+" ","integer"==$type&&(out+=" && !("+$data+" % 1)"),out+=")) "+$coerced+" = +"+$data+"; "):"boolean"==$type?out+=" if ("+$data+" === 'false' || "+$data+" === 0 || "+$data+" === null) "+$coerced+" = false; else if ("+$data+" === 'true' || "+$data+" === 1) "+$coerced+" = true; ":"null"==$type?out+=" if ("+$data+" === '' || "+$data+" === 0 || "+$data+" === false) "+$coerced+" = null; ":"array"==it.opts.coerceTypes&&"array"==$type&&(out+=" if ("+$dataType+" == 'string' || "+$dataType+" == 'number' || "+$dataType+" == 'boolean' || "+$data+" == null) "+$coerced+" = ["+$data+"]; ");out+=" "+$bracesCoercion+" if ("+$coerced+" === undefined) { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'type' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { type: '",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' } ",!1!==it.opts.messages&&(out+=" , message: 'should be ",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } else { ";var $parentData=$dataLvl?"data"+($dataLvl-1||""):"parentData",$parentDataProperty=$dataLvl?it.dataPathArr[$dataLvl]:"parentDataProperty";out+=" "+$data+" = "+$coerced+"; ",$dataLvl||(out+="if ("+$parentData+" !== undefined)"),out+=" "+$parentData+"["+$parentDataProperty+"] = "+$coerced+"; } } "}}var $refKeywords;if(it.schema.$ref&&($refKeywords=it.util.schemaHasRulesExcept(it.schema,it.RULES.all,"$ref"))){if("fail"==it.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+it.errSchemaPath+'"');"ignore"==it.opts.extendRefs?($refKeywords=!1,console.log('$ref: keywords ignored in schema at path "'+it.errSchemaPath+'"')):!0!==it.opts.extendRefs&&console.log('$ref: all keywords used in schema at path "'+it.errSchemaPath+'". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour')}if(it.schema.$ref&&!$refKeywords)out+=" "+it.RULES.all.$ref.code(it,"$ref")+" ",$breakOnError&&(out+=" } if (errors === ",out+=$top?"0":"errs_"+$lvl,out+=") { ",$closingBraces2+="}");else{var arr2=it.RULES;if(arr2)for(var $rulesGroup,i2=-1,l2=arr2.length-1;i2<l2;)if($rulesGroup=arr2[i2+=1],$shouldUseGroup($rulesGroup)){if($rulesGroup.type&&(out+=" if ("+it.util.checkDataType($rulesGroup.type,$data)+") { "),it.opts.useDefaults&&!it.compositeRule)if("object"==$rulesGroup.type&&it.schema.properties){var $schema=it.schema.properties,$schemaKeys=Object.keys($schema),arr3=$schemaKeys;if(arr3)for(var $propertyKey,i3=-1,l3=arr3.length-1;i3<l3;){$propertyKey=arr3[i3+=1];var $sch=$schema[$propertyKey];if(void 0!==$sch.default){var $passData=$data+it.util.getProperty($propertyKey);out+=" if ("+$passData+" === undefined) "+$passData+" = ","shared"==it.opts.useDefaults?out+=" "+it.useDefault($sch.default)+" ":out+=" "+JSON.stringify($sch.default)+" ",out+="; "}}}else if("array"==$rulesGroup.type&&Array.isArray(it.schema.items)){var arr4=it.schema.items;if(arr4)for(var $sch,$i=-1,l4=arr4.length-1;$i<l4;)if($sch=arr4[$i+=1],void 0!==$sch.default){var $passData=$data+"["+$i+"]";out+=" if ("+$passData+" === undefined) "+$passData+" = ","shared"==it.opts.useDefaults?out+=" "+it.useDefault($sch.default)+" ":out+=" "+JSON.stringify($sch.default)+" ",out+="; "}}var arr5=$rulesGroup.rules;if(arr5)for(var $rule,i5=-1,l5=arr5.length-1;i5<l5;)$rule=arr5[i5+=1],$shouldUseRule($rule)&&(out+=" "+$rule.code(it,$rule.keyword)+" ",$breakOnError&&($closingBraces1+="}"));if($breakOnError&&(out+=" "+$closingBraces1+" ",$closingBraces1=""),$rulesGroup.type&&(out+=" } ",$typeSchema&&$typeSchema===$rulesGroup.type&&!$coerceToTypes)){var $typeChecked=!0;out+=" else { ";var $schemaPath=it.schemaPath+".type",$errSchemaPath=it.errSchemaPath+"/type",$$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'type' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { type: '",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' } ",!1!==it.opts.messages&&(out+=" , message: 'should be ",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" } "}$breakOnError&&(out+=" if (errors === ",out+=$top?"0":"errs_"+$lvl,out+=") { ",$closingBraces2+="}")}}if($typeSchema&&!$typeChecked&&!$coerceToTypes){var $schemaPath=it.schemaPath+".type",$errSchemaPath=it.errSchemaPath+"/type",$method=$typeIsArray?"checkDataTypes":"checkDataType";out+=" if ("+it.util[$method]($typeSchema,$data,!0)+") { ";var $$outStack=$$outStack||[];$$outStack.push(out),out="",!1!==it.createErrors?(out+=" { keyword: 'type' , dataPath: (dataPath || '') + "+it.errorPath+" , schemaPath: "+it.util.toQuotedString($errSchemaPath)+" , params: { type: '",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' } ",!1!==it.opts.messages&&(out+=" , message: 'should be ",out+=$typeIsArray?""+$typeSchema.join(","):""+$typeSchema,out+="' "),it.opts.verbose&&(out+=" , schema: validate.schema"+$schemaPath+" , parentSchema: validate.schema"+it.schemaPath+" , data: "+$data+" "),out+=" } "):out+=" {} ";var __err=out;out=$$outStack.pop(),!it.compositeRule&&$breakOnError?it.async?out+=" throw new ValidationError(["+__err+"]); ":out+=" validate.errors = ["+__err+"]; return false; ":out+=" var err = "+__err+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",out+=" }"}return $breakOnError&&(out+=" "+$closingBraces2+" "),$top?($async?(out+=" if (errors === 0) return true; ",out+=" else throw new ValidationError(vErrors); "):(out+=" validate.errors = vErrors; ",out+=" return errors === 0; "),out+=" }); return validate;"):out+=" var "+$valid+" = errors === errs_"+$lvl+";",out=it.util.cleanUpCode(out),$top&&$breakOnError&&(out=it.util.cleanUpVarErrors(out,$async)),out}},{}],39:[function(require,module,exports){function addKeyword(keyword,definition){function _addRule(keyword,dataType,definition){for(var ruleGroup,i=0;i<RULES.length;i++){var rg=RULES[i];if(rg.type==dataType){ruleGroup=rg;break}}ruleGroup||(ruleGroup={type:dataType,rules:[]},RULES.push(ruleGroup));var rule={keyword:keyword,definition:definition,custom:!0,code:customRuleCode};ruleGroup.rules.push(rule),RULES.custom[keyword]=rule}function checkDataType(dataType){if(!RULES.types[dataType])throw new Error("Unknown type "+dataType)}var RULES=this.RULES;if(RULES.keywords[keyword])throw new Error("Keyword "+keyword+" is already defined");if(!IDENTIFIER.test(keyword))throw new Error("Keyword "+keyword+" is not a valid identifier");if(definition){if(definition.macro&&void 0!==definition.valid)throw new Error('"valid" option cannot be used with macro keywords');var dataType=definition.type;if(Array.isArray(dataType)){var i,len=dataType.length;for(i=0;i<len;i++)checkDataType(dataType[i]);for(i=0;i<len;i++)_addRule(keyword,dataType[i],definition)}else dataType&&checkDataType(dataType),_addRule(keyword,dataType,definition);var $data=!0===definition.$data&&this._opts.v5;if($data&&!definition.validate)throw new Error('$data support: "validate" function is not defined');var metaSchema=definition.metaSchema;metaSchema&&($data&&(metaSchema={anyOf:[metaSchema,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#/definitions/$data"}]}),definition.validateSchema=this.compile(metaSchema,!0))}RULES.keywords[keyword]=RULES.all[keyword]=!0}function getKeyword(keyword){var rule=this.RULES.custom[keyword];return rule?rule.definition:this.RULES.keywords[keyword]||!1}function removeKeyword(keyword){var RULES=this.RULES;delete RULES.keywords[keyword],delete RULES.all[keyword],delete RULES.custom[keyword];for(var i=0;i<RULES.length;i++)for(var rules=RULES[i].rules,j=0;j<rules.length;j++)if(rules[j].keyword==keyword){rules.splice(j,1);break}}var IDENTIFIER=/^[a-z_$][a-z0-9_$\-]*$/i,customRuleCode=require("./dotjs/custom");module.exports={add:addKeyword,get:getKeyword,remove:removeKeyword}},{"./dotjs/custom":23}],40:[function(require,module,exports){module.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}},{}],41:[function(require,module,exports){module.exports={id:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema (v5 proposals)",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},$data:{type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{anyOf:[{type:"number",minimum:0,exclusiveMinimum:!0},{$ref:"#/definitions/$data"}]},maximum:{anyOf:[{type:"number"},{$ref:"#/definitions/$data"}]},exclusiveMaximum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},minimum:{anyOf:[{type:"number"},{$ref:"#/definitions/$data"}]},exclusiveMinimum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},maxLength:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minLength:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},pattern:{anyOf:[{type:"string",format:"regex"},{$ref:"#/definitions/$data"}]},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"},{$ref:"#/definitions/$data"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minItems:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},uniqueItems:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},maxProperties:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minProperties:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},required:{anyOf:[{$ref:"#/definitions/stringArray"},{$ref:"#/definitions/$data"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"},{$ref:"#/definitions/$data"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{anyOf:[{type:"array",minItems:1,uniqueItems:!0},{$ref:"#/definitions/$data"}]},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"},format:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatMaximum:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatMinimum:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatExclusiveMaximum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},formatExclusiveMinimum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},constant:{anyOf:[{},{$ref:"#/definitions/$data"}]},contains:{$ref:"#"},patternGroups:{type:"object",additionalProperties:{type:"object",required:["schema"],properties:{maximum:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minimum:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},schema:{$ref:"#"}},additionalProperties:!1},default:{}},switch:{type:"array",items:{required:["then"],properties:{if:{$ref:"#"},then:{anyOf:[{type:"boolean"},{$ref:"#"}]},continue:{type:"boolean"}},additionalProperties:!1,dependencies:{continue:["if"]}}}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"],formatMaximum:["format"],formatMinimum:["format"],formatExclusiveMaximum:["formatMaximum"],formatExclusiveMinimum:["formatMinimum"]},default:{}}},{}],42:[function(require,module,exports){function enableV5(ajv){function _addKeyword(keyword,types,inlineFunc){var definition={inline:inlineFunc||inlineFunctions[keyword],statements:!0,errors:"full"};types&&(definition.type=types),ajv.addKeyword(keyword,definition)}var inlineFunctions={switch:require("./dotjs/switch"),constant:require("./dotjs/constant"),_formatLimit:require("./dotjs/_formatLimit"),patternRequired:require("./dotjs/patternRequired")};if(!1!==ajv._opts.meta){var metaSchema=require("./refs/json-schema-v5.json");ajv.addMetaSchema(metaSchema,META_SCHEMA_ID)}_addKeyword("constant"),ajv.addKeyword("contains",{type:"array",macro:containsMacro}),_addKeyword("formatMaximum","string",inlineFunctions._formatLimit),_addKeyword("formatMinimum","string",inlineFunctions._formatLimit),ajv.addKeyword("formatExclusiveMaximum"),ajv.addKeyword("formatExclusiveMinimum"),ajv.addKeyword("patternGroups"),_addKeyword("patternRequired","object"),_addKeyword("switch")}function containsMacro(schema){return{not:{items:{not:schema}}}}var META_SCHEMA_ID="https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json";module.exports={enable:enableV5,META_SCHEMA_ID:META_SCHEMA_ID}},{"./dotjs/_formatLimit":15,"./dotjs/constant":22,"./dotjs/patternRequired":32,"./dotjs/switch":36,"./refs/json-schema-v5.json":41}],43:[function(require,module,exports){var asn1=exports;asn1.bignum=require("bn.js"),asn1.define=require("./asn1/api").define,asn1.base=require("./asn1/base"),asn1.constants=require("./asn1/constants"),asn1.decoders=require("./asn1/decoders"),asn1.encoders=require("./asn1/encoders")},{"./asn1/api":44,"./asn1/base":46,"./asn1/constants":50,"./asn1/decoders":52,"./asn1/encoders":55,"bn.js":74}],44:[function(require,module,exports){function Entity(name,body){this.name=name,this.body=body,this.decoders={},this.encoders={}}var asn1=require("../asn1"),inherits=require("inherits");exports.define=function(name,body){return new Entity(name,body)},Entity.prototype._createNamed=function(base){var named;try{named=require("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){named=function(entity){this._initNamed(entity)}}return inherits(named,base),named.prototype._initNamed=function(entity){base.call(this,entity)},new named(this)},Entity.prototype._getDecoder=function(enc){return enc=enc||"der",this.decoders.hasOwnProperty(enc)||(this.decoders[enc]=this._createNamed(asn1.decoders[enc])),this.decoders[enc]},Entity.prototype.decode=function(data,enc,options){return this._getDecoder(enc).decode(data,options)},Entity.prototype._getEncoder=function(enc){return enc=enc||"der",this.encoders.hasOwnProperty(enc)||(this.encoders[enc]=this._createNamed(asn1.encoders[enc])),this.encoders[enc]},Entity.prototype.encode=function(data,enc,reporter){return this._getEncoder(enc).encode(data,reporter)}},{"../asn1":43,inherits:215,vm:408}],45:[function(require,module,exports){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+(void 0===value?"undefined":_typeof(value)));this.value=value,this.length=value.length}}var inherits=require("inherits"),Reporter=require("../base").Reporter,Buffer=require("buffer").Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},{"../base":46,buffer:108,inherits:215}],46:[function(require,module,exports){var base=exports;base.Reporter=require("./reporter").Reporter,base.DecoderBuffer=require("./buffer").DecoderBuffer,base.EncoderBuffer=require("./buffer").EncoderBuffer,base.Node=require("./node")},{"./buffer":45,"./node":47,"./reporter":48}],47:[function(require,module,exports){function Node(enc,parent){var state={};this._baseState=state,state.enc=enc,state.parent=parent||null,state.children=null,state.tag=null,state.args=null,state.reverseArgs=null,state.choice=null,state.optional=!1,state.any=!1,state.obj=!1,state.use=null,state.useDecoder=null,state.key=null,state.default=null,state.explicit=null,state.implicit=null,state.contains=null,state.parent||(state.children=[],this._wrap())}var Reporter=require("../base").Reporter,EncoderBuffer=require("../base").EncoderBuffer,DecoderBuffer=require("../base").DecoderBuffer,assert=require("minimalistic-assert"),tags=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];module.exports=Node;var stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function(){var state=this._baseState,cstate={};stateProps.forEach(function(prop){cstate[prop]=state[prop]});var res=new this.constructor(cstate.parent);return res._baseState=cstate,res},Node.prototype._wrap=function(){var state=this._baseState;methods.forEach(function(method){this[method]=function(){var clone=new this.constructor(this);return state.children.push(clone),clone[method].apply(clone,arguments)}},this)},Node.prototype._init=function(body){var state=this._baseState;assert(null===state.parent),body.call(this),state.children=state.children.filter(function(child){return child._baseState.parent===this},this),assert.equal(state.children.length,1,"Root node can have only one child")},Node.prototype._useArgs=function(args){var state=this._baseState,children=args.filter(function(arg){return arg instanceof this.constructor},this);args=args.filter(function(arg){return!(arg instanceof this.constructor)},this),0!==children.length&&(assert(null===state.children),state.children=children,children.forEach(function(child){child._baseState.parent=this},this)),0!==args.length&&(assert(null===state.args),state.args=args,state.reverseArgs=args.map(function(arg){if("object"!==(void 0===arg?"undefined":_typeof(arg))||arg.constructor!==Object)return arg;var res={};return Object.keys(arg).forEach(function(key){key==(0|key)&&(key|=0);var value=arg[key];res[value]=key}),res}))},overrided.forEach(function(method){Node.prototype[method]=function(){var state=this._baseState;throw new Error(method+" not implemented for encoding: "+state.enc)}}),tags.forEach(function(tag){Node.prototype[tag]=function(){var state=this._baseState,args=Array.prototype.slice.call(arguments);return assert(null===state.tag),state.tag=tag,this._useArgs(args),this}}),Node.prototype.use=function(item){assert(item);var state=this._baseState;return assert(null===state.use),state.use=item,this},Node.prototype.optional=function(){return this._baseState.optional=!0,this},Node.prototype.def=function(val){var state=this._baseState;return assert(null===state.default),state.default=val,state.optional=!0,this},Node.prototype.explicit=function(num){var state=this._baseState;return assert(null===state.explicit&&null===state.implicit),state.explicit=num,this},Node.prototype.implicit=function(num){var state=this._baseState;return assert(null===state.explicit&&null===state.implicit),state.implicit=num,this},Node.prototype.obj=function(){var state=this._baseState,args=Array.prototype.slice.call(arguments);return state.obj=!0,0!==args.length&&this._useArgs(args),this},Node.prototype.key=function(newKey){var state=this._baseState;return assert(null===state.key),state.key=newKey,this},Node.prototype.any=function(){return this._baseState.any=!0,this},Node.prototype.choice=function(obj){var state=this._baseState;return assert(null===state.choice),state.choice=obj,this._useArgs(Object.keys(obj).map(function(key){return obj[key]})),this},Node.prototype.contains=function(item){var state=this._baseState;return assert(null===state.use),state.contains=item,this},Node.prototype._decode=function(input,options){var state=this._baseState;if(null===state.parent)return input.wrapResult(state.children[0]._decode(input,options));var result=state.default,present=!0,prevKey=null;if(null!==state.key&&(prevKey=input.enterKey(state.key)),state.optional){var tag=null;if(null!==state.explicit?tag=state.explicit:null!==state.implicit?tag=state.implicit:null!==state.tag&&(tag=state.tag),null!==tag||state.any){if(present=this._peekTag(input,tag,state.any),input.isError(present))return present}else{var save=input.save();try{null===state.choice?this._decodeGeneric(state.tag,input,options):this._decodeChoice(input,options),present=!0}catch(e){present=!1}input.restore(save)}}var prevObj;if(state.obj&&present&&(prevObj=input.enterObject()),present){if(null!==state.explicit){var explicit=this._decodeTag(input,state.explicit);if(input.isError(explicit))return explicit;input=explicit}var start=input.offset;if(null===state.use&&null===state.choice){if(state.any)var save=input.save();var body=this._decodeTag(input,null!==state.implicit?state.implicit:state.tag,state.any);if(input.isError(body))return body;state.any?result=input.raw(save):input=body}if(options&&options.track&&null!==state.tag&&options.track(input.path(),start,input.length,"tagged"),options&&options.track&&null!==state.tag&&options.track(input.path(),input.offset,input.length,"content"),result=state.any?result:null===state.choice?this._decodeGeneric(state.tag,input,options):this._decodeChoice(input,options),input.isError(result))return result;if(state.any||null!==state.choice||null===state.children||state.children.forEach(function(child){child._decode(input,options)}),state.contains&&("octstr"===state.tag||"bitstr"===state.tag)){var data=new DecoderBuffer(result);result=this._getUse(state.contains,input._reporterState.obj)._decode(data,options)}}return state.obj&&present&&(result=input.leaveObject(prevObj)),null===state.key||null===result&&!0!==present?null!==prevKey&&input.exitKey(prevKey):input.leaveKey(prevKey,state.key,result),result},Node.prototype._decodeGeneric=function(tag,input,options){var state=this._baseState;return"seq"===tag||"set"===tag?null:"seqof"===tag||"setof"===tag?this._decodeList(input,tag,state.args[0],options):/str$/.test(tag)?this._decodeStr(input,tag,options):"objid"===tag&&state.args?this._decodeObjid(input,state.args[0],state.args[1],options):"objid"===tag?this._decodeObjid(input,null,null,options):"gentime"===tag||"utctime"===tag?this._decodeTime(input,tag,options):"null_"===tag?this._decodeNull(input,options):"bool"===tag?this._decodeBool(input,options):"objDesc"===tag?this._decodeStr(input,tag,options):"int"===tag||"enum"===tag?this._decodeInt(input,state.args&&state.args[0],options):null!==state.use?this._getUse(state.use,input._reporterState.obj)._decode(input,options):input.error("unknown tag: "+tag)},Node.prototype._getUse=function(entity,obj){var state=this._baseState;return state.useDecoder=this._use(entity,obj),assert(null===state.useDecoder._baseState.parent),state.useDecoder=state.useDecoder._baseState.children[0],state.implicit!==state.useDecoder._baseState.implicit&&(state.useDecoder=state.useDecoder.clone(),state.useDecoder._baseState.implicit=state.implicit),state.useDecoder},Node.prototype._decodeChoice=function(input,options){var state=this._baseState,result=null,match=!1;return Object.keys(state.choice).some(function(key){var save=input.save(),node=state.choice[key];try{var value=node._decode(input,options);if(input.isError(value))return!1;result={type:key,value:value},match=!0}catch(e){return input.restore(save),!1}return!0},this),match?result:input.error("Choice not matched")},Node.prototype._createEncoderBuffer=function(data){return new EncoderBuffer(data,this.reporter)},Node.prototype._encode=function(data,reporter,parent){var state=this._baseState;if(null===state.default||state.default!==data){var result=this._encodeValue(data,reporter,parent);if(void 0!==result&&!this._skipDefault(result,reporter,parent))return result}},Node.prototype._encodeValue=function(data,reporter,parent){var state=this._baseState;if(null===state.parent)return state.children[0]._encode(data,reporter||new Reporter);var result=null;if(this.reporter=reporter,state.optional&&void 0===data){if(null===state.default)return;data=state.default}var content=null,primitive=!1;if(state.any)result=this._createEncoderBuffer(data);else if(state.choice)result=this._encodeChoice(data,reporter);else if(state.contains)content=this._getUse(state.contains,parent)._encode(data,reporter),primitive=!0;else if(state.children)content=state.children.map(function(child){if("null_"===child._baseState.tag)return child._encode(null,reporter,data);if(null===child._baseState.key)return reporter.error("Child should have a key");var prevKey=reporter.enterKey(child._baseState.key);if("object"!==(void 0===data?"undefined":_typeof(data)))return reporter.error("Child expected, but input is not object");var res=child._encode(data[child._baseState.key],reporter,data);return reporter.leaveKey(prevKey),res},this).filter(function(child){return child}),content=this._createEncoderBuffer(content);else if("seqof"===state.tag||"setof"===state.tag){if(!state.args||1!==state.args.length)return reporter.error("Too many args for : "+state.tag);if(!Array.isArray(data))return reporter.error("seqof/setof, but data is not Array");var child=this.clone();child._baseState.implicit=null,content=this._createEncoderBuffer(data.map(function(item){var state=this._baseState;return this._getUse(state.args[0],data)._encode(item,reporter)},child))}else null!==state.use?result=this._getUse(state.use,parent)._encode(data,reporter):(content=this._encodePrimitive(state.tag,data),primitive=!0);var result;if(!state.any&&null===state.choice){var tag=null!==state.implicit?state.implicit:state.tag,cls=null===state.implicit?"universal":"context";null===tag?null===state.use&&reporter.error("Tag could be ommited only for .use()"):null===state.use&&(result=this._encodeComposite(tag,primitive,cls,content))}return null!==state.explicit&&(result=this._encodeComposite(state.explicit,!1,"context",result)),result},Node.prototype._encodeChoice=function(data,reporter){var state=this._baseState,node=state.choice[data.type];return node||assert(!1,data.type+" not found in "+JSON.stringify(Object.keys(state.choice))),node._encode(data.value,reporter)},Node.prototype._encodePrimitive=function(tag,data){var state=this._baseState;if(/str$/.test(tag))return this._encodeStr(data,tag);if("objid"===tag&&state.args)return this._encodeObjid(data,state.reverseArgs[0],state.args[1]);if("objid"===tag)return this._encodeObjid(data,null,null);if("gentime"===tag||"utctime"===tag)return this._encodeTime(data,tag);if("null_"===tag)return this._encodeNull();if("int"===tag||"enum"===tag)return this._encodeInt(data,state.args&&state.reverseArgs[0]);if("bool"===tag)return this._encodeBool(data);if("objDesc"===tag)return this._encodeStr(data,tag);throw new Error("Unsupported tag: "+tag)},Node.prototype._isNumstr=function(str){return/^[0-9 ]*$/.test(str)},Node.prototype._isPrintstr=function(str){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str)}},{"../base":46,"minimalistic-assert":243}],48:[function(require,module,exports){function Reporter(options){this._reporterState={obj:null,path:[],options:options||{},errors:[]}}function ReporterError(path,msg){this.path=path,this.rethrow(msg)}var inherits=require("inherits");exports.Reporter=Reporter,Reporter.prototype.isError=function(obj){return obj instanceof ReporterError},Reporter.prototype.save=function(){var state=this._reporterState;return{obj:state.obj,pathLen:state.path.length}},Reporter.prototype.restore=function(data){var state=this._reporterState;state.obj=data.obj,state.path=state.path.slice(0,data.pathLen)},Reporter.prototype.enterKey=function(key){return this._reporterState.path.push(key)},Reporter.prototype.exitKey=function(index){var state=this._reporterState;state.path=state.path.slice(0,index-1)},Reporter.prototype.leaveKey=function(index,key,value){var state=this._reporterState;this.exitKey(index),null!==state.obj&&(state.obj[key]=value)},Reporter.prototype.path=function(){return this._reporterState.path.join("/")},Reporter.prototype.enterObject=function(){var state=this._reporterState,prev=state.obj;return state.obj={},prev},Reporter.prototype.leaveObject=function(prev){var state=this._reporterState,now=state.obj;return state.obj=prev,now},Reporter.prototype.error=function(msg){var err,state=this._reporterState,inherited=msg instanceof ReporterError;if(err=inherited?msg:new ReporterError(state.path.map(function(elem){return"["+JSON.stringify(elem)+"]"}).join(""),msg.message||msg,msg.stack),!state.options.partial)throw err;return inherited||state.errors.push(err),err},Reporter.prototype.wrapResult=function(result){var state=this._reporterState;return state.options.partial?{result:this.isError(result)?null:result,errors:state.errors}:result},inherits(ReporterError,Error),ReporterError.prototype.rethrow=function(msg){if(this.message=msg+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:215}],49:[function(require,module,exports){var constants=require("../constants");exports.tagClass={0:"universal",1:"application",2:"context",3:"private"},exports.tagClassByName=constants._reverse(exports.tagClass),exports.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},exports.tagByName=constants._reverse(exports.tag)},{"../constants":50}],50:[function(require,module,exports){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0);var value=map[key];res[value]=key}),res},constants.der=require("./der")},{"./der":49}],51:[function(require,module,exports){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i<num;i++){len<<=8;var j=buf.readUInt8(fail);if(buf.isError(j))return j;len|=j}return len}var inherits=require("inherits"),asn1=require("../../asn1"),base=asn1.base,bignum=asn1.bignum,der=asn1.constants.der;module.exports=DERDecoder,DERDecoder.prototype.decode=function(data,options){return data instanceof base.DecoderBuffer||(data=new base.DecoderBuffer(data,options)),this.tree._decode(data,options)},inherits(DERNode,base.Node),DERNode.prototype._peekTag=function(buffer,tag,any){if(buffer.isEmpty())return!1;var state=buffer.save(),decodedTag=derDecodeTag(buffer,'Failed to peek tag: "'+tag+'"');return buffer.isError(decodedTag)?decodedTag:(buffer.restore(state),decodedTag.tag===tag||decodedTag.tagStr===tag||decodedTag.tagStr+"of"===tag||any)},DERNode.prototype._decodeTag=function(buffer,tag,any){var decodedTag=derDecodeTag(buffer,'Failed to decode tag of "'+tag+'"');if(buffer.isError(decodedTag))return decodedTag;var len=derDecodeLen(buffer,decodedTag.primitive,'Failed to get length of "'+tag+'"');if(buffer.isError(len))return len;if(!any&&decodedTag.tag!==tag&&decodedTag.tagStr!==tag&&decodedTag.tagStr+"of"!==tag)return buffer.error('Failed to match tag: "'+tag+'"');if(decodedTag.primitive||null!==len)return buffer.skip(len,'Failed to match body of: "'+tag+'"');var state=buffer.save(),res=this._skipUntilEnd(buffer,'Failed to skip indefinite length body: "'+this.tag+'"');return buffer.isError(res)?res:(len=buffer.offset-state.offset,buffer.restore(state),buffer.skip(len,'Failed to match body of: "'+tag+'"'))},DERNode.prototype._skipUntilEnd=function(buffer,fail){for(;;){var tag=derDecodeTag(buffer,fail);if(buffer.isError(tag))return tag;var len=derDecodeLen(buffer,tag.primitive,fail);if(buffer.isError(len))return len;var res;if(res=tag.primitive||null!==len?buffer.skip(len):this._skipUntilEnd(buffer,fail),buffer.isError(res))return res;if("end"===tag.tagStr)break}},DERNode.prototype._decodeList=function(buffer,tag,decoder,options){for(var result=[];!buffer.isEmpty();){var possibleEnd=this._peekTag(buffer,"end");if(buffer.isError(possibleEnd))return possibleEnd;var res=decoder.decode(buffer,"der",options);if(buffer.isError(res)&&possibleEnd)break;result.push(res)}return result},DERNode.prototype._decodeStr=function(buffer,tag){if("bitstr"===tag){var unused=buffer.readUInt8();return buffer.isError(unused)?unused:{unused:unused,data:buffer.raw()}}if("bmpstr"===tag){var raw=buffer.raw();if(raw.length%2==1)return buffer.error("Decoding of string type: bmpstr length mismatch");for(var str="",i=0;i<raw.length/2;i++)str+=String.fromCharCode(raw.readUInt16BE(2*i));return str}if("numstr"===tag){var numstr=buffer.raw().toString("ascii");return this._isNumstr(numstr)?numstr:buffer.error("Decoding of string type: numstr unsupported characters")}if("octstr"===tag)return buffer.raw();if("objDesc"===tag)return buffer.raw();if("printstr"===tag){var printstr=buffer.raw().toString("ascii");return this._isPrintstr(printstr)?printstr:buffer.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(tag)?buffer.raw().toString():buffer.error("Decoding of string type: "+tag+" unsupported")},DERNode.prototype._decodeObjid=function(buffer,values,relative){for(var result,identifiers=[],ident=0;!buffer.isEmpty();){var subident=buffer.readUInt8();ident<<=7,ident|=127&subident,0==(128&subident)&&(identifiers.push(ident),ident=0)}128&subident&&identifiers.push(ident);var first=identifiers[0]/40|0,second=identifiers[0]%40;if(result=relative?identifiers:[first,second].concat(identifiers.slice(1)),values){var tmp=values[result.join(" ")];void 0===tmp&&(tmp=values[result.join(".")]),void 0!==tmp&&(result=tmp)}return result},DERNode.prototype._decodeTime=function(buffer,tag){var str=buffer.raw().toString();if("gentime"===tag)var year=0|str.slice(0,4),mon=0|str.slice(4,6),day=0|str.slice(6,8),hour=0|str.slice(8,10),min=0|str.slice(10,12),sec=0|str.slice(12,14);else{if("utctime"!==tag)return buffer.error("Decoding "+tag+" time is not supported yet");var year=0|str.slice(0,2),mon=0|str.slice(2,4),day=0|str.slice(4,6),hour=0|str.slice(6,8),min=0|str.slice(8,10),sec=0|str.slice(10,12);year=year<70?2e3+year:1900+year}return Date.UTC(year,mon-1,day,hour,min,sec,0)},DERNode.prototype._decodeNull=function(buffer){return null},DERNode.prototype._decodeBool=function(buffer){var res=buffer.readUInt8();return buffer.isError(res)?res:0!==res},DERNode.prototype._decodeInt=function(buffer,values){var raw=buffer.raw(),res=new bignum(raw);return values&&(res=values[res.toString(10)]||res),res},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getDecoder("der").tree}},{"../../asn1":43,inherits:215}],52:[function(require,module,exports){var decoders=exports;decoders.der=require("./der"),decoders.pem=require("./pem")},{"./der":51,"./pem":53}],53:[function(require,module,exports){function PEMDecoder(entity){DERDecoder.call(this,entity),this.enc="pem"}var inherits=require("inherits"),Buffer=require("buffer").Buffer,DERDecoder=require("./der");inherits(PEMDecoder,DERDecoder),module.exports=PEMDecoder,PEMDecoder.prototype.decode=function(data,options){for(var lines=data.toString().split(/[\r\n]+/g),label=options.label.toUpperCase(),re=/^-----(BEGIN|END) ([^-]+)-----$/,start=-1,end=-1,i=0;i<lines.length;i++){var match=lines[i].match(re);if(null!==match&&match[2]===label){if(-1!==start){if("END"!==match[1])break;end=i;break}if("BEGIN"!==match[1])break;start=i}}if(-1===start||-1===end)throw new Error("PEM section not found for: "+label);var base64=lines.slice(start+1,end).join("");base64.replace(/[^a-z0-9\+\/=]+/gi,"");var input=new Buffer(base64,"base64");return DERDecoder.prototype.decode.call(this,input,options)}},{"./der":51,buffer:108,inherits:215}],54:[function(require,module,exports){function DEREncoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function two(num){return num<10?"0"+num:num}function encodeTag(tag,primitive,cls,reporter){var res;if("seqof"===tag?tag="seq":"setof"===tag&&(tag="set"),der.tagByName.hasOwnProperty(tag))res=der.tagByName[tag];else{if("number"!=typeof tag||(0|tag)!==tag)return reporter.error("Unknown tag: "+tag);res=tag}return res>=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=require("inherits"),Buffer=require("buffer").Buffer,asn1=require("../../asn1"),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i<str.length;i++)buf.writeUInt16BE(str.charCodeAt(i),2*i);return this._createEncoderBuffer(buf)}return"numstr"===tag?this._isNumstr(str)?this._createEncoderBuffer(str):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===tag?this._isPrintstr(str)?this._createEncoderBuffer(str):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(tag)?this._createEncoderBuffer(str):"objDesc"===tag?this._createEncoderBuffer(str):this.reporter.error("Encoding of string type: "+tag+" unsupported")},DERNode.prototype._encodeObjid=function(id,values,relative){if("string"==typeof id){if(!values)return this.reporter.error("string objid given, but no values map found");if(!values.hasOwnProperty(id))return this.reporter.error("objid not found in values map");id=values[id].split(/[\s\.]+/g);for(var i=0;i<id.length;i++)id[i]|=0}else if(Array.isArray(id)){id=id.slice();for(var i=0;i<id.length;i++)id[i]|=0}if(!Array.isArray(id))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(id));if(!relative){if(id[1]>=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i<id.length;i++){var ident=id[i];for(size++;ident>=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i<data.length;i++)if(data[i]!==state.defaultBuffer[i])return!1;return!0}},{"../../asn1":43,buffer:108,inherits:215}],55:[function(require,module,exports){var encoders=exports;encoders.der=require("./der"),encoders.pem=require("./pem")},{"./der":54,"./pem":56}],56:[function(require,module,exports){function PEMEncoder(entity){DEREncoder.call(this,entity),this.enc="pem"}var inherits=require("inherits"),DEREncoder=require("./der");inherits(PEMEncoder,DEREncoder),module.exports=PEMEncoder,PEMEncoder.prototype.encode=function(data,options){for(var buf=DEREncoder.prototype.encode.call(this,data),p=buf.toString("base64"),out=["-----BEGIN "+options.label+"-----"],i=0;i<p.length;i+=64)out.push(p.slice(i,i+64));return out.push("-----END "+options.label+"-----"),out.join("\n")}},{"./der":54,inherits:215}],57:[function(require,module,exports){module.exports={newInvalidAsn1Error:function(msg){var e=new Error;return e.name="InvalidAsn1Error",e.message=msg||"",e}}},{}],58:[function(require,module,exports){var errors=require("./errors"),types=require("./types"),Reader=require("./reader"),Writer=require("./writer");module.exports={Reader:Reader,Writer:Writer};for(var t in types)types.hasOwnProperty(t)&&(module.exports[t]=types[t]);for(var e in errors)errors.hasOwnProperty(e)&&(module.exports[e]=errors[e])},{"./errors":57,"./reader":59,"./types":60,"./writer":61}],59:[function(require,module,exports){(function(Buffer){function Reader(data){if(!data||!Buffer.isBuffer(data))throw new TypeError("data must be a node Buffer");this._buf=data,this._size=data.length,this._len=0,this._offset=0}var assert=require("assert"),ASN1=require("./types"),errors=require("./errors"),newInvalidAsn1Error=errors.newInvalidAsn1Error;Object.defineProperty(Reader.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(Reader.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(Reader.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(Reader.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),Reader.prototype.readByte=function(peek){if(this._size-this._offset<1)return null;var b=255&this._buf[this._offset];return peek||(this._offset+=1),b},Reader.prototype.peek=function(){return this.readByte(!0)},Reader.prototype.readLength=function(offset){if(void 0===offset&&(offset=this._offset),offset>=this._size)return null;var lenB=255&this._buf[offset++];if(null===lenB)return null;if(128==(128&lenB)){if(0==(lenB&=127))throw newInvalidAsn1Error("Indefinite length not supported");if(lenB>4)throw newInvalidAsn1Error("encoding too long");if(this._size-offset<lenB)return null;this._len=0;for(var i=0;i<lenB;i++)this._len=(this._len<<8)+(255&this._buf[offset++])}else this._len=lenB;return offset},Reader.prototype.readSequence=function(tag){var seq=this.peek();if(null===seq)return null;if(void 0!==tag&&tag!==seq)throw newInvalidAsn1Error("Expected 0x"+tag.toString(16)+": got 0x"+seq.toString(16));var o=this.readLength(this._offset+1);return null===o?null:(this._offset=o,seq)},Reader.prototype.readInt=function(){return this._readTag(ASN1.Integer)},Reader.prototype.readBoolean=function(){return 0!==this._readTag(ASN1.Boolean)},Reader.prototype.readEnumeration=function(){return this._readTag(ASN1.Enumeration)},Reader.prototype.readString=function(tag,retbuf){tag||(tag=ASN1.OctetString);var b=this.peek();if(null===b)return null;if(b!==tag)throw newInvalidAsn1Error("Expected 0x"+tag.toString(16)+": got 0x"+b.toString(16));var o=this.readLength(this._offset+1);if(null===o)return null;if(this.length>this._size-o)return null;if(this._offset=o,0===this.length)return retbuf?new Buffer(0):"";var str=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,retbuf?str:str.toString("utf8")},Reader.prototype.readOID=function(tag){tag||(tag=ASN1.OID);var b=this.readString(tag,!0);if(null===b)return null;for(var values=[],value=0,i=0;i<b.length;i++){var byte=255&b[i];value<<=7,value+=127&byte,0==(128&byte)&&(values.push(value),value=0)}return value=values.shift(),values.unshift(value%40),values.unshift(value/40>>0),values.join(".")},Reader.prototype._readTag=function(tag){assert.ok(void 0!==tag);var b=this.peek();if(null===b)return null;if(b!==tag)throw newInvalidAsn1Error("Expected 0x"+tag.toString(16)+": got 0x"+b.toString(16));var o=this.readLength(this._offset+1);if(null===o)return null;if(this.length>4)throw newInvalidAsn1Error("Integer too long: "+this.length);if(this.length>this._size-o)return null;this._offset=o;for(var fb=this._buf[this._offset],value=0,i=0;i<this.length;i++)value<<=8,value|=255&this._buf[this._offset++];return 128==(128&fb)&&4!==i&&(value-=1<<8*i),value>>0},module.exports=Reader}).call(this,require("buffer").Buffer)},{"./errors":57,"./types":60,assert:64,buffer:108}],60:[function(require,module,exports){module.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],61:[function(require,module,exports){(function(Buffer){function merge(from,to){return assert.ok(from),assert.equal(void 0===from?"undefined":_typeof(from),"object"),assert.ok(to),assert.equal(void 0===to?"undefined":_typeof(to),"object"),Object.getOwnPropertyNames(from).forEach(function(key){if(!to[key]){var value=Object.getOwnPropertyDescriptor(from,key);Object.defineProperty(to,key,value)}}),to}function Writer(options){options=merge(DEFAULT_OPTS,options||{}),this._buf=new Buffer(options.size||1024),this._size=this._buf.length,this._offset=0,this._options=options,this._seq=[]}var assert=require("assert"),ASN1=require("./types"),errors=require("./errors"),DEFAULT_OPTS=(errors.newInvalidAsn1Error,{size:1024,growthFactor:8});Object.defineProperty(Writer.prototype,"buffer",{get:function(){if(this._seq.length)throw new InvalidAsn1Error(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),Writer.prototype.writeByte=function(b){if("number"!=typeof b)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=b},Writer.prototype.writeInt=function(i,tag){if("number"!=typeof i)throw new TypeError("argument must be a Number");"number"!=typeof tag&&(tag=ASN1.Integer);for(var sz=4;(0==(4286578688&i)||-8388608==(4286578688&i))&&sz>1;)sz--,i<<=8;if(sz>4)throw new InvalidAsn1Error("BER ints cannot be > 0xffffffff");for(this._ensure(2+sz),this._buf[this._offset++]=tag,this._buf[this._offset++]=sz;sz-- >0;)this._buf[this._offset++]=(4278190080&i)>>>24,i<<=8},Writer.prototype.writeNull=function(){this.writeByte(ASN1.Null),this.writeByte(0)},Writer.prototype.writeEnumeration=function(i,tag){if("number"!=typeof i)throw new TypeError("argument must be a Number");return"number"!=typeof tag&&(tag=ASN1.Enumeration),this.writeInt(i,tag)},Writer.prototype.writeBoolean=function(b,tag){if("boolean"!=typeof b)throw new TypeError("argument must be a Boolean");"number"!=typeof tag&&(tag=ASN1.Boolean),this._ensure(3),this._buf[this._offset++]=tag,this._buf[this._offset++]=1,this._buf[this._offset++]=b?255:0},Writer.prototype.writeString=function(s,tag){if("string"!=typeof s)throw new TypeError("argument must be a string (was: "+(void 0===s?"undefined":_typeof(s))+")");"number"!=typeof tag&&(tag=ASN1.OctetString);var len=Buffer.byteLength(s);this.writeByte(tag),this.writeLength(len),len&&(this._ensure(len),this._buf.write(s,this._offset),this._offset+=len)},Writer.prototype.writeBuffer=function(buf,tag){if("number"!=typeof tag)throw new TypeError("tag must be a number");if(!Buffer.isBuffer(buf))throw new TypeError("argument must be a buffer");this.writeByte(tag),this.writeLength(buf.length),this._ensure(buf.length),buf.copy(this._buf,this._offset,0,buf.length),this._offset+=buf.length},Writer.prototype.writeStringArray=function(strings){if(!strings instanceof Array)throw new TypeError("argument must be an Array[String]");var self=this;strings.forEach(function(s){self.writeString(s)})},Writer.prototype.writeOID=function(s,tag){function encodeOctet(bytes,octet){octet<128?bytes.push(octet):octet<16384?(bytes.push(octet>>>7|128),bytes.push(127&octet)):octet<2097152?(bytes.push(octet>>>14|128),bytes.push(255&(octet>>>7|128)),bytes.push(127&octet)):octet<268435456?(bytes.push(octet>>>21|128),bytes.push(255&(octet>>>14|128)),bytes.push(255&(octet>>>7|128)),bytes.push(127&octet)):(bytes.push(255&(octet>>>28|128)),bytes.push(255&(octet>>>21|128)),bytes.push(255&(octet>>>14|128)),bytes.push(255&(octet>>>7|128)),bytes.push(127&octet))}if("string"!=typeof s)throw new TypeError("argument must be a string");if("number"!=typeof tag&&(tag=ASN1.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(s))throw new Error("argument is not a valid OID string");var tmp=s.split("."),bytes=[];bytes.push(40*parseInt(tmp[0],10)+parseInt(tmp[1],10)),tmp.slice(2).forEach(function(b){encodeOctet(bytes,parseInt(b,10))});var self=this;this._ensure(2+bytes.length),this.writeByte(tag),this.writeLength(bytes.length),bytes.forEach(function(b){self.writeByte(b)})},Writer.prototype.writeLength=function(len){if("number"!=typeof len)throw new TypeError("argument must be a Number");if(this._ensure(4),len<=127)this._buf[this._offset++]=len;else if(len<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=len;else if(len<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=len>>8,this._buf[this._offset++]=len;else{if(!(len<=16777215))throw new InvalidAsn1ERror("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=len>>16,this._buf[this._offset++]=len>>8,this._buf[this._offset++]=len}},Writer.prototype.startSequence=function(tag){"number"!=typeof tag&&(tag=ASN1.Sequence|ASN1.Constructor),this.writeByte(tag),this._seq.push(this._offset),this._ensure(3),this._offset+=3},Writer.prototype.endSequence=function(){var seq=this._seq.pop(),start=seq+3,len=this._offset-start;if(len<=127)this._shift(start,len,-2),this._buf[seq]=len;else if(len<=255)this._shift(start,len,-1),this._buf[seq]=129,this._buf[seq+1]=len;else if(len<=65535)this._buf[seq]=130,this._buf[seq+1]=len>>8,this._buf[seq+2]=len;else{if(!(len<=16777215))throw new InvalidAsn1Error("Sequence too long");this._shift(start,len,1),this._buf[seq]=131,this._buf[seq+1]=len>>16,this._buf[seq+2]=len>>8,this._buf[seq+3]=len}},Writer.prototype._shift=function(start,len,shift){assert.ok(void 0!==start),assert.ok(void 0!==len),assert.ok(shift),this._buf.copy(this._buf,start+shift,start,start+len),this._offset+=shift},Writer.prototype._ensure=function(len){if(assert.ok(len),this._size-this._offset<len){var sz=this._size*this._options.growthFactor;sz-this._offset<len&&(sz+=len);var buf=new Buffer(sz);this._buf.copy(buf,0,0,this._offset),this._buf=buf,this._size=sz}},module.exports=Writer}).call(this,require("buffer").Buffer)},{"./errors":57,"./types":60,assert:64,buffer:108}],62:[function(require,module,exports){var Ber=require("./ber/index");module.exports={Ber:Ber,BerReader:Ber.Reader,BerWriter:Ber.Writer}},{"./ber/index":58}],63:[function(require,module,exports){(function(Buffer,process){function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}function _toss(name,expected,oper,arg,actual){throw new assert.AssertionError({message:util.format("%s (%s) is required",name,expected),actual:void 0===actual?void 0===arg?"undefined":_typeof(arg):actual(arg),expected:expected,operator:oper||"===",stackStartFunction:_toss.caller})}function _getClass(arg){return Object.prototype.toString.call(arg).slice(8,-1)}function noop(){}function _setExports(ndebug){var out,keys=Object.keys(types);return out=process.env.NODE_NDEBUG?noop:function(arg,msg){arg||_toss(msg,"true",arg)},keys.forEach(function(k){if(ndebug)return void(out[k]=noop);var type=types[k];out[k]=function(arg,msg){type.check(arg)||_toss(msg,k,type.operator,arg,type.actual)}}),keys.forEach(function(k){var name="optional"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k];out[name]=function(arg,msg){void 0!==arg&&null!==arg&&(type.check(arg)||_toss(msg,k,type.operator,arg,type.actual))}}),keys.forEach(function(k){var name="arrayOf"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k],expected="["+k+"]";out[name]=function(arg,msg){Array.isArray(arg)||_toss(msg,expected,type.operator,arg,type.actual);var i;for(i=0;i<arg.length;i++)type.check(arg[i])||_toss(msg,expected,type.operator,arg,type.actual)}}),keys.forEach(function(k){var name="optionalArrayOf"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k],expected="["+k+"]";out[name]=function(arg,msg){if(void 0!==arg&&null!==arg){Array.isArray(arg)||_toss(msg,expected,type.operator,arg,type.actual);var i;for(i=0;i<arg.length;i++)type.check(arg[i])||_toss(msg,expected,type.operator,arg,type.actual)}}}),Object.keys(assert).forEach(function(k){return"AssertionError"===k?void(out[k]=assert[k]):ndebug?void(out[k]=noop):void(out[k]=assert[k])}),out._setExports=_setExports,out}var assert=require("assert"),Stream=require("stream").Stream,util=require("util"),UUID_REGEXP=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/,types={bool:{check:function(arg){return"boolean"==typeof arg}},func:{check:function(arg){return"function"==typeof arg}},string:{check:function(arg){return"string"==typeof arg}},object:{check:function(arg){return"object"===(void 0===arg?"undefined":_typeof(arg))&&null!==arg}},number:{check:function(arg){return"number"==typeof arg&&!isNaN(arg)&&isFinite(arg)}},buffer:{check:function(arg){return Buffer.isBuffer(arg)},operator:"Buffer.isBuffer"},array:{check:function(arg){return Array.isArray(arg)},operator:"Array.isArray"},stream:{check:function(arg){return arg instanceof Stream},operator:"instanceof",actual:_getClass},date:{check:function(arg){return arg instanceof Date},operator:"instanceof",actual:_getClass},regexp:{check:function(arg){return arg instanceof RegExp},operator:"instanceof",actual:_getClass},uuid:{check:function(arg){return"string"==typeof arg&&UUID_REGEXP.test(arg)},operator:"isUUID"}};module.exports=_setExports(process.env.NODE_NDEBUG)}).call(this,{isBuffer:require("../is-buffer/index.js")},require("_process"))},{"../is-buffer/index.js":216,_process:105,assert:64,stream:374,util:400}],64:[function(require,module,exports){(function(global){function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0}function isBuffer(b){return global.Buffer&&"function"==typeof global.Buffer.isBuffer?global.Buffer.isBuffer(b):!(null==b||!b._isBuffer)}function pToString(obj){return Object.prototype.toString.call(obj)}function isView(arrbuf){return!isBuffer(arrbuf)&&("function"==typeof global.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(arrbuf):!!arrbuf&&(arrbuf instanceof DataView||!!(arrbuf.buffer&&arrbuf.buffer instanceof ArrayBuffer))))}function getName(func){if(util.isFunction(func)){if(functionsHaveNames)return func.name;var str=func.toString(),match=str.match(regex);return match&&match[1]}}function truncate(s,n){return"string"==typeof s?s.length<n?s:s.slice(0,n):s}function inspect(something){if(functionsHaveNames||!util.isFunction(something))return util.inspect(something);var rawname=getName(something);return"[Function"+(rawname?": "+rawname:"")+"]"}function getMessage(self){return truncate(inspect(self.actual),128)+" "+self.operator+" "+truncate(inspect(self.expected),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}function ok(value,message){value||fail(value,!0,message,"==",assert.ok)}function _deepEqual(actual,expected,strict,memos){if(actual===expected)return!0;if(isBuffer(actual)&&isBuffer(expected))return 0===compare(actual,expected);if(util.isDate(actual)&&util.isDate(expected))return actual.getTime()===expected.getTime();if(util.isRegExp(actual)&&util.isRegExp(expected))return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase;if(null!==actual&&"object"===(void 0===actual?"undefined":_typeof(actual))||null!==expected&&"object"===(void 0===expected?"undefined":_typeof(expected))){if(isView(actual)&&isView(expected)&&pToString(actual)===pToString(expected)&&!(actual instanceof Float32Array||actual instanceof Float64Array))return 0===compare(new Uint8Array(actual.buffer),new Uint8Array(expected.buffer));if(isBuffer(actual)!==isBuffer(expected))return!1;memos=memos||{actual:[],expected:[]};var actualIndex=memos.actual.indexOf(actual);return-1!==actualIndex&&actualIndex===memos.expected.indexOf(expected)||(memos.actual.push(actual),memos.expected.push(expected),objEquiv(actual,expected,strict,memos))}return strict?actual===expected:actual==expected}function isArguments(object){return"[object Arguments]"==Object.prototype.toString.call(object)}function objEquiv(a,b,strict,actualVisitedObjects){if(null===a||void 0===a||null===b||void 0===b)return!1;if(util.isPrimitive(a)||util.isPrimitive(b))return a===b;if(strict&&Object.getPrototypeOf(a)!==Object.getPrototypeOf(b))return!1;var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return!1;if(aIsArgs)return a=pSlice.call(a),b=pSlice.call(b),_deepEqual(a,b,strict);var key,i,ka=objectKeys(a),kb=objectKeys(b);if(ka.length!==kb.length)return!1;for(ka.sort(),kb.sort(),i=ka.length-1;i>=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&!0===expected.call({},actual)}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=require("util/"),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{"util/":400}],65:[function(require,module,exports){function authorization(options){return"AWS "+options.key+":"+sign(options)}function hmacSha1(options){return crypto.createHmac("sha1",options.secret).update(options.message).digest("base64")}function sign(options){return options.message=stringToSign(options),hmacSha1(options)}function signQuery(options){return options.message=queryStringToSign(options),hmacSha1(options)}function stringToSign(options){var headers=options.amazonHeaders||"";return headers&&(headers+="\n"),[options.verb,options.md5,options.contentType,options.date?options.date.toUTCString():"",headers+options.resource].join("\n")}function queryStringToSign(options){return"GET\n\n\n"+options.date+"\n"+options.resource}function canonicalizeHeaders(headers){for(var buf=[],fields=Object.keys(headers),i=0,len=fields.length;i<len;++i){var field=fields[i],val=headers[field],field=field.toLowerCase();0===field.indexOf("x-amz")&&buf.push(field+":"+val)}return buf.sort().join("\n")}function canonicalizeResource(resource){var url=parse(resource,!0),path=url.pathname,buf=[];return Object.keys(url.query).forEach(function(key){if(~keys.indexOf(key)){var val=""==url.query[key]?"":"="+encodeURIComponent(url.query[key]);buf.push(key+val)}}),path+(buf.length?"?"+buf.sort().join("&"):"")}var crypto=require("crypto"),parse=require("url").parse,keys=["acl","location","logging","notification","partNumber","policy","requestPayment","torrent","uploadId","uploads","versionId","versioning","versions","website"];module.exports=authorization,module.exports.authorization=authorization,module.exports.hmacSha1=hmacSha1,module.exports.sign=sign,module.exports.signQuery=signQuery,module.exports.queryStringToSign=stringToSign,module.exports.queryStringToSign=queryStringToSign,module.exports.canonicalizeHeaders=canonicalizeHeaders,module.exports.canonicalizeResource=canonicalizeResource},{crypto:121,url:395}],66:[function(require,module,exports){(function(process,Buffer){function hmac(key,string,encoding){return crypto.createHmac("sha256",key).update(string,"utf8").digest(encoding)}function hash(string,encoding){return crypto.createHash("sha256").update(string,"utf8").digest(encoding)}function encodeRfc3986(urlEncodedString){return urlEncodedString.replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()})}function RequestSigner(request,credentials){"string"==typeof request&&(request=url.parse(request));var headers=request.headers=request.headers||{},hostParts=this.matchHost(request.hostname||request.host||headers.Host||headers.host);this.request=request,this.credentials=credentials||this.defaultCredentials(),this.service=request.service||hostParts[0]||"",this.region=request.region||hostParts[1]||"us-east-1","email"===this.service&&(this.service="ses"),!request.method&&request.body&&(request.method="POST"),headers.Host||headers.host||(headers.Host=request.hostname||request.host||this.createHost(),request.port&&(headers.Host+=":"+request.port)),request.hostname||request.host||(request.hostname=headers.Host||headers.host),this.isCodeCommitGit="codecommit"===this.service&&"GIT"===request.method}var aws4=exports,url=require("url"),querystring=require("querystring"),crypto=require("crypto"),lru=require("./lru"),credentialsCache=lru(1e3);RequestSigner.prototype.matchHost=function(host){var match=(host||"").match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/),hostParts=(match||[]).slice(1,3);return"es"===hostParts[1]&&(hostParts=hostParts.reverse()),hostParts},RequestSigner.prototype.isSingleRegion=function(){return["s3","sdb"].indexOf(this.service)>=0&&"us-east-1"===this.region||["cloudfront","ls","route53","iam","importexport","sts"].indexOf(this.service)>=0},RequestSigner.prototype.createHost=function(){var region=this.isSingleRegion()?"":("s3"===this.service&&"us-east-1"!==this.region?"-":".")+this.region;return("ses"===this.service?"email":this.service)+region+".amazonaws.com"},RequestSigner.prototype.prepareRequest=function(){this.parsePath();var query,request=this.request,headers=request.headers;request.signQuery?(this.parsedPath.query=query=this.parsedPath.query||{},this.credentials.sessionToken&&(query["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||query["X-Amz-Expires"]||(query["X-Amz-Expires"]=86400),query["X-Amz-Date"]?this.datetime=query["X-Amz-Date"]:query["X-Amz-Date"]=this.getDateTime(),query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",query["X-Amz-Credential"]=this.credentials.accessKeyId+"/"+this.credentialString(),query["X-Amz-SignedHeaders"]=this.signedHeaders()):(request.doNotModifyHeaders||this.isCodeCommitGit||(!request.body||headers["Content-Type"]||headers["content-type"]||(headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8"),!request.body||headers["Content-Length"]||headers["content-length"]||(headers["Content-Length"]=Buffer.byteLength(request.body)),!this.credentials.sessionToken||headers["X-Amz-Security-Token"]||headers["x-amz-security-token"]||(headers["X-Amz-Security-Token"]=this.credentials.sessionToken),"s3"!==this.service||headers["X-Amz-Content-Sha256"]||headers["x-amz-content-sha256"]||(headers["X-Amz-Content-Sha256"]=hash(this.request.body||"","hex")),headers["X-Amz-Date"]||headers["x-amz-date"]?this.datetime=headers["X-Amz-Date"]||headers["x-amz-date"]:headers["X-Amz-Date"]=this.getDateTime()),delete headers.Authorization,delete headers.authorization)},RequestSigner.prototype.sign=function(){return this.parsedPath||this.prepareRequest(),this.request.signQuery?this.parsedPath.query["X-Amz-Signature"]=this.signature():this.request.headers.Authorization=this.authHeader(),this.request.path=this.formatPath(),this.request},RequestSigner.prototype.getDateTime=function(){if(!this.datetime){var headers=this.request.headers,date=new Date(headers.Date||headers.date||new Date);this.datetime=date.toISOString().replace(/[:\-]|\.\d{3}/g,""),this.isCodeCommitGit&&(this.datetime=this.datetime.slice(0,-1))}return this.datetime},RequestSigner.prototype.getDate=function(){return this.getDateTime().substr(0,8)},RequestSigner.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")},RequestSigner.prototype.signature=function(){var kDate,kRegion,kService,date=this.getDate(),cacheKey=[this.credentials.secretAccessKey,date,this.region,this.service].join(),kCredentials=credentialsCache.get(cacheKey);return kCredentials||(kDate=hmac("AWS4"+this.credentials.secretAccessKey,date),kRegion=hmac(kDate,this.region),kService=hmac(kRegion,this.service),kCredentials=hmac(kService,"aws4_request"),credentialsCache.set(cacheKey,kCredentials)),hmac(kCredentials,this.stringToSign(),"hex")},RequestSigner.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),hash(this.canonicalString(),"hex")].join("\n")},RequestSigner.prototype.canonicalString=function(){this.parsedPath||this.prepareRequest();var bodyHash,pathStr=this.parsedPath.path,query=this.parsedPath.query,headers=this.request.headers,queryStr="",normalizePath="s3"!==this.service,decodePath="s3"===this.service||this.request.doNotEncodePath,decodeSlashesInPath="s3"===this.service,firstValOnly="s3"===this.service;return bodyHash="s3"===this.service&&this.request.signQuery?"UNSIGNED-PAYLOAD":this.isCodeCommitGit?"":headers["X-Amz-Content-Sha256"]||headers["x-amz-content-sha256"]||hash(this.request.body||"","hex"),query&&(queryStr=encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj,key){return key?(obj[key]=Array.isArray(query[key])?firstValOnly?query[key][0]:query[key].slice().sort():query[key],obj):obj},{})))),"/"!==pathStr&&(normalizePath&&(pathStr=pathStr.replace(/\/{2,}/g,"/")),pathStr=pathStr.split("/").reduce(function(path,piece){return normalizePath&&".."===piece?path.pop():normalizePath&&"."===piece||(decodePath&&(piece=querystring.unescape(piece)),path.push(encodeRfc3986(querystring.escape(piece)))),path},[]).join("/"),"/"!==pathStr[0]&&(pathStr="/"+pathStr),decodeSlashesInPath&&(pathStr=pathStr.replace(/%2F/g,"/"))),[this.request.method||"GET",pathStr,queryStr,this.canonicalHeaders()+"\n",this.signedHeaders(),bodyHash].join("\n")},RequestSigner.prototype.canonicalHeaders=function(){function trimAll(header){return header.toString().trim().replace(/\s+/g," ")}var headers=this.request.headers;return Object.keys(headers).sort(function(a,b){return a.toLowerCase()<b.toLowerCase()?-1:1}).map(function(key){return key.toLowerCase()+":"+trimAll(headers[key])}).join("\n")},RequestSigner.prototype.signedHeaders=function(){return Object.keys(this.request.headers).map(function(key){return key.toLowerCase()}).sort().join(";")},RequestSigner.prototype.credentialString=function(){return[this.getDate(),this.region,this.service,"aws4_request"].join("/")},RequestSigner.prototype.defaultCredentials=function(){var env=process.env;return{accessKeyId:env.AWS_ACCESS_KEY_ID||env.AWS_ACCESS_KEY,secretAccessKey:env.AWS_SECRET_ACCESS_KEY||env.AWS_SECRET_KEY,sessionToken:env.AWS_SESSION_TOKEN}},RequestSigner.prototype.parsePath=function(){var path=this.request.path||"/",queryIx=path.indexOf("?"),query=null;queryIx>=0&&(query=querystring.parse(path.slice(queryIx+1)),path=path.slice(0,queryIx)),/[^0-9A-Za-z!'()*\-._~%\/]/.test(path)&&(path=path.split("/").map(function(piece){return querystring.escape(querystring.unescape(piece))}).join("/")),this.parsedPath={path:path,query:query}},RequestSigner.prototype.formatPath=function(){var path=this.parsedPath.path,query=this.parsedPath.query;return query?(null!=query[""]&&delete query[""],path+"?"+encodeRfc3986(querystring.stringify(query))):path},aws4.RequestSigner=RequestSigner,aws4.sign=function(request,credentials){return new RequestSigner(request,credentials).sign()}}).call(this,require("_process"),require("buffer").Buffer)},{"./lru":67,_process:105,buffer:108,crypto:121,querystring:313,url:395}],67:[function(require,module,exports){function LruCache(size){this.capacity=0|size,this.map=Object.create(null),this.list=new DoublyLinkedList}function DoublyLinkedList(){this.firstNode=null,this.lastNode=null}function DoublyLinkedNode(key,val){this.key=key,this.val=val,this.prev=null,this.next=null}module.exports=function(size){return new LruCache(size)},LruCache.prototype.get=function(key){var node=this.map[key];if(null!=node)return this.used(node),node.val},LruCache.prototype.set=function(key,val){var node=this.map[key];if(null!=node)node.val=val;else{if(this.capacity||this.prune(),!this.capacity)return!1;node=new DoublyLinkedNode(key,val),this.map[key]=node,this.capacity--}return this.used(node),!0},LruCache.prototype.used=function(node){this.list.moveToFront(node)},LruCache.prototype.prune=function(){var node=this.list.pop();null!=node&&(delete this.map[node.key],this.capacity++)},DoublyLinkedList.prototype.moveToFront=function(node){this.firstNode!=node&&(this.remove(node),null==this.firstNode?(this.firstNode=node,this.lastNode=node,node.prev=null,node.next=null):(node.prev=null,node.next=this.firstNode,node.next.prev=node,this.firstNode=node))},DoublyLinkedList.prototype.pop=function(){var lastNode=this.lastNode;return null!=lastNode&&this.remove(lastNode),lastNode},DoublyLinkedList.prototype.remove=function(node){this.firstNode==node?this.firstNode=node.next:null!=node.prev&&(node.prev.next=node.next),this.lastNode==node?this.lastNode=node.prev:null!=node.next&&(node.next.prev=node.prev)}},{}],68:[function(require,module,exports){function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i<l;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[L++]=tmp>>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;i<end;i+=3)tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2],output.push(tripletToBase64(tmp));return output.join("")}function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,output="",parts=[],maxChunkLength=16383,i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength)parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},{}],69:[function(require,module,exports){function F(S,x8,i){return(S[0][x8[i+3]]+S[1][x8[i+2]]^S[2][x8[i+1]])+S[3][x8[i]]}function stream2word(data,databytes){var i,temp=0;for(i=0;i<4;i++,BLF_J++)BLF_J>=databytes&&(BLF_J=0),temp=temp<<8|data[BLF_J];return temp}function bcrypt_hash(sha2pass,sha2salt,out){var i,state=new Blowfish,cdata=new Uint32Array(BCRYPT_BLOCKS),ciphertext=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(state.expandstate(sha2salt,64,sha2pass,64),i=0;i<64;i++)state.expand0state(sha2salt,64),state.expand0state(sha2pass,64);for(i=0;i<BCRYPT_BLOCKS;i++)cdata[i]=stream2word(ciphertext,ciphertext.byteLength);for(i=0;i<64;i++)state.enc(cdata,cdata.byteLength/8);for(i=0;i<BCRYPT_BLOCKS;i++)out[4*i+3]=cdata[i]>>>24,out[4*i+2]=cdata[i]>>>16,out[4*i+1]=cdata[i]>>>8,out[4*i+0]=cdata[i]}function bcrypt_pbkdf(pass,passlen,salt,saltlen,key,keylen,rounds){var i,j,amt,stride,dest,count,sha2pass=new Uint8Array(64),sha2salt=new Uint8Array(64),out=new Uint8Array(BCRYPT_HASHSIZE),tmpout=new Uint8Array(BCRYPT_HASHSIZE),countsalt=new Uint8Array(saltlen+4),origkeylen=keylen;if(rounds<1)return-1;if(0===passlen||0===saltlen||0===keylen||keylen>out.byteLength*out.byteLength||saltlen>1<<20)return-1;for(stride=Math.floor((keylen+out.byteLength-1)/out.byteLength),amt=Math.floor((keylen+stride-1)/stride),i=0;i<saltlen;i++)countsalt[i]=salt[i];for(crypto_hash_sha512(sha2pass,pass,passlen),count=1;keylen>0;count++){for(countsalt[saltlen+0]=count>>>24,countsalt[saltlen+1]=count>>>16,countsalt[saltlen+2]=count>>>8,countsalt[saltlen+3]=count,crypto_hash_sha512(sha2salt,countsalt,saltlen+4),bcrypt_hash(sha2pass,sha2salt,tmpout),i=out.byteLength;i--;)out[i]=tmpout[i];for(i=1;i<rounds;i++)for(crypto_hash_sha512(sha2salt,tmpout,tmpout.byteLength),bcrypt_hash(sha2pass,sha2salt,tmpout),j=0;j<out.byteLength;j++)out[j]^=tmpout[j];for(amt=Math.min(amt,keylen),i=0;i<amt&&!((dest=i*stride+(count-1))>=origkeylen);i++)key[dest]=out[i];keylen-=i}return 0}var crypto_hash_sha512=require("tweetnacl").lowlevel.crypto_hash,BLF_J=0,Blowfish=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};Blowfish.prototype.encipher=function(x,x8){void 0===x8&&(x8=new Uint8Array(x.buffer),0!==x.byteOffset&&(x8=x8.subarray(x.byteOffset))),x[0]^=this.P[0];for(var i=1;i<16;i+=2)x[1]^=F(this.S,x8,0)^this.P[i],x[0]^=F(this.S,x8,4)^this.P[i+1];var t=x[0];x[0]=x[1]^this.P[17],x[1]=t},Blowfish.prototype.decipher=function(x){var x8=new Uint8Array(x.buffer);0!==x.byteOffset&&(x8=x8.subarray(x.byteOffset)),x[0]^=this.P[17];for(var i=16;i>0;i-=2)x[1]^=F(this.S,x8,0)^this.P[i],x[0]^=F(this.S,x8,4)^this.P[i-1];var t=x[0];x[0]=x[1]^this.P[0],x[1]=t},Blowfish.prototype.expand0state=function(key,keybytes){var i,k,d=new Uint32Array(2),d8=new Uint8Array(d.buffer);for(i=0,BLF_J=0;i<18;i++)this.P[i]^=stream2word(key,keybytes);for(BLF_J=0,i=0;i<18;i+=2)this.encipher(d,d8),this.P[i]=d[0],this.P[i+1]=d[1];for(i=0;i<4;i++)for(k=0;k<256;k+=2)this.encipher(d,d8),this.S[i][k]=d[0],this.S[i][k+1]=d[1]},Blowfish.prototype.expandstate=function(data,databytes,key,keybytes){var i,k,d=new Uint32Array(2);for(i=0,BLF_J=0;i<18;i++)this.P[i]^=stream2word(key,keybytes);for(i=0,BLF_J=0;i<18;i+=2)d[0]^=stream2word(data,databytes),d[1]^=stream2word(data,databytes),this.encipher(d),this.P[i]=d[0],this.P[i+1]=d[1];for(i=0;i<4;i++)for(k=0;k<256;k+=2)d[0]^=stream2word(data,databytes),d[1]^=stream2word(data,databytes),this.encipher(d),this.S[i][k]=d[0],this.S[i][k+1]=d[1];BLF_J=0},Blowfish.prototype.enc=function(data,blocks){for(var i=0;i<blocks;i++)this.encipher(data.subarray(2*i))},Blowfish.prototype.dec=function(data,blocks){for(var i=0;i<blocks;i++)this.decipher(data.subarray(2*i))};var BCRYPT_BLOCKS=8,BCRYPT_HASHSIZE=32;module.exports={BLOCKS:BCRYPT_BLOCKS,HASHSIZE:BCRYPT_HASHSIZE,hash:bcrypt_hash,pbkdf:bcrypt_pbkdf}},{tweetnacl:394}],70:[function(require,module,exports){!function(globalObj){function constructorFactory(configObj){function BigNumber(n,b){var c,e,i,num,len,str,x=this;if(!(x instanceof BigNumber))return ERRORS&&raise(26,"constructor call without new",n),new BigNumber(n,b);if(null!=b&&isValidInt(b,2,64,id,"base")){if(b|=0,str=n+"",10==b)return x=new BigNumber(n instanceof BigNumber?n:str),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if((num="number"==typeof n)&&0*n!=0||!new RegExp("^-?"+(c="["+ALPHABET.slice(0,b)+"]+")+"(?:\\."+c+")?$",b<37?"i":"").test(str))return parseNumeric(x,str,num,b);num?(x.s=1/n<0?(str=str.slice(1),-1):1,ERRORS&&str.replace(/^0\.0*|\./,"").length>15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e<MIN_EXP)x.c=[x.e=0];else{if(x.e=e,x.c=[],i=(e+1)%LOG_BASE,e<0&&(i+=LOG_BASE),i<len){for(i&&x.c.push(+str.slice(0,i)),len-=LOG_BASE;i<len;)x.c.push(+str.slice(i,i+=LOG_BASE));str=str.slice(i),i=LOG_BASE-str.length}else i-=len;for(;i--;str+="0");x.c.push(+str)}else x.c=[x.e=0];id=0}function convertBase(str,baseOut,baseIn,sign){var d,e,k,r,x,xc,y,i=str.indexOf("."),dp=DECIMAL_PLACES,rm=ROUNDING_MODE;for(baseIn<37&&(str=str.toLowerCase()),i>=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;len<i;str+="0",len++);str=toExponential(str,e)}else if(i-=ne,str=toFixedPoint(str,e),e+1>len){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++i<args.length;){if(n=new BigNumber(args[i]),!n.s){m=n;break}method.call(m,n)&&(m=n)}return m}function intValidatorWithErrors(n,min,max,caller,name){return(n<min||n>max||n!=truncate(n))&&raise(caller,(name||"decimal places")+(n<min||n>max?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e<MIN_EXP?n.c=[n.e=0]:(n.e=e,n.c=c),n}function raise(caller,msg,val){var error=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][caller]+"() "+msg+": "+val);throw error.name="BigNumber Error",id=0,error}function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;if(xc){out:{for(d=1,k=xc[0];k>=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.e<MIN_EXP&&(x.c=[x.e=0])}return x}var div,id=0,P=BigNumber.prototype,ONE=new BigNumber(1),DECIMAL_PLACES=20,ROUNDING_MODE=4,TO_EXP_NEG=-7,TO_EXP_POS=21,MIN_EXP=-1e7,MAX_EXP=1e7,ERRORS=!0,isValidInt=intValidatorWithErrors,CRYPTO=!1,MODULO_MODE=1,POW_PRECISION=100,FORMAT={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};return BigNumber.another=constructorFactory,BigNumber.ROUND_UP=0,BigNumber.ROUND_DOWN=1,BigNumber.ROUND_CEIL=2,BigNumber.ROUND_FLOOR=3,BigNumber.ROUND_HALF_UP=4,BigNumber.ROUND_HALF_DOWN=5,BigNumber.ROUND_HALF_EVEN=6,BigNumber.ROUND_HALF_CEIL=7,BigNumber.ROUND_HALF_FLOOR=8,BigNumber.EUCLID=9,BigNumber.config=function(){var v,p,i=0,r={},a=arguments,o=a[0],has=o&&"object"==(void 0===o?"undefined":_typeof(o))?function(){if(o.hasOwnProperty(p))return null!=(v=o[p])}:function(){if(a.length>i)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v),r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!!v||1===v||0===v?(CRYPTO=!(!v||!cryptoObj),v&&!CRYPTO&&ERRORS&&raise(2,"crypto unavailable",cryptoObj)):ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==(void 0===v?"undefined":_typeof(v))?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var pow2_53=9007199254740992,random53bitInt=Math.random()*pow2_53&2097151?function(){return mathfloor(Math.random()*pow2_53)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(cryptoObj&&cryptoObj.getRandomValues){for(a=cryptoObj.getRandomValues(new Uint32Array(k*=2));i<k;)v=131072*a[i]+(a[i+1]>>>11),v>=9e15?(b=cryptoObj.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(cryptoObj&&cryptoObj.randomBytes){for(a=cryptoObj.randomBytes(k*=7);i<k;)v=281474976710656*(31&a[i])+1099511627776*a[i+1]+4294967296*a[i+2]+16777216*a[i+3]+(a[i+4]<<16)+(a[i+5]<<8)+a[i+6],v>=9e15?cryptoObj.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else ERRORS&&raise(14,"crypto unavailable",cryptoObj);if(!i)for(;i<k;)(v=random53bitInt())<9e15&&(c[i++]=v%1e14);for(k=c[--i],dp%=LOG_BASE,k&&dp&&(v=POWS_TEN[LOG_BASE-dp],c[i]=mathfloor(k/v)*v);0===c[i];c.pop(),i--);if(i<0)c=[e=0];else{for(e=-1;0===c[0];c.shift(),e-=LOG_BASE);for(i=1,v=c[0];v>=10;v/=10,i++);i<LOG_BASE&&(e-=LOG_BASE-i)}return rand.e=e,rand.c=c,rand}}(),div=function(){function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;)xlo=x[i]%SQRT_BASE,xhi=x[i]/SQRT_BASE|0,m=khi*xlo+xhi*klo,temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry,carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi,x[i]=temp%base;return carry&&x.unshift(carry),x}function compare(a,b,aL,bL){var i,cmp;if(aL!=bL)cmp=aL>bL?1:-1;else for(i=cmp=0;i<aL;i++)if(a[i]!=b[i]){cmp=a[i]>b[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]<b[aL]?1:0,a[aL]=i*base+a[aL]-b[aL];for(;!a[0]&&a.length>1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL<yL;rem[remL++]=0);yz=yc.slice(),yz.unshift(0),yc0=yc[0],yc[1]>=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL<prodL?yz:yc,prodL,base),prodL=prod.length,cmp=1;else 0==n&&(cmp=n=1),prod=yc.slice(),prodL=prod.length;if(prodL<remL&&prod.unshift(0),subtract(rem,prod,remL,base),remL=rem.length,-1==cmp)for(;compare(yc,rem,yL,remL)<1;)n++,subtract(rem,yL<remL?yz:yc,remL,base),remL=rem.length}else 0===cmp&&(n++,rem=[0]);qc[i++]=n,rem[0]?rem[remL++]=xc[xi]||0:(rem=[xc[xi]],remL=1)}while((xi++<xL||null!=rem[0])&&s--);more=null!=rem[0],qc[0]||qc.shift()}if(base==BASE){for(i=1,s=qc[0];s>=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var basePrefix=/^(-?)0([xbo])(?=\w[\w.]*$)/i,dotAfter=/^([^.]+)\.$/,dotBefore=/^\.([^.]+)$/,isInfinityOrNaN=/^-?(Infinity|NaN)$/,whitespaceOrPlus=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(x,str,num,b){var base,s=num?str:str.replace(whitespaceOrPlus,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(basePrefix,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(dotAfter,"$1").replace(dotBefore,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,-1===(b=compare(this,new BigNumber(y,b)))||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b<j;b++)if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}if(xLTy&&(t=xc,xc=yc,yc=t,y.s=-y.s),(b=(j=yc.length)-(i=xc.length))>0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=b);--xc[i],xc[j]+=BASE}xc[j]-=yc[j]}for(;0==xc[0];xc.shift(),--ye);return xc[0]?normalise(y,xc,ye):(y.s=3==ROUNDING_MODE?-1:1,y.c=[y.e=0],y)},P.modulo=P.mod=function(y,b){var q,s,x=this;return id=11,y=new BigNumber(y,b),!x.c||!y.s||y.c&&!y.c[0]?new BigNumber(NaN):!y.c||x.c&&!x.c[0]?new BigNumber(x):(9==MODULO_MODE?(s=y.s,y.s=1,q=div(x,y,0,3),y.s=s,q.s*=s):q=div(x,y,0,MODULO_MODE),x.minus(q.times(y)))},P.negated=P.neg=function(){var x=new BigNumber(this);return x.s=-x.s||null,x},P.plus=P.add=function(y,b){var t,x=this,a=x.s;if(id=12,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.minus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return new BigNumber(a/0);if(!xc[0]||!yc[0])return yc[0]?y:new BigNumber(xc[0]?x:0*a)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for(a>0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]%=BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e<e&&--s,"9999"!=(n=n.slice(s-3,s+1))&&(rep||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(round(r,r.e+DECIMAL_PLACES+2,1),m=!r.times(r).eq(x));break}if(!rep&&(round(t,t.e+DECIMAL_PLACES+2,0),t.times(t).eq(x))){r=t;break}dp+=4,s+=4,rep=1}return round(r,r.e+DECIMAL_PLACES+1,ROUNDING_MODE,m)},P.times=P.mul=function(y,b){var c,e,i,j,k,m,xcL,xlo,xhi,ycL,ylo,yhi,zc,base,sqrtBase,x=this,xc=x.c,yc=(id=17,y=new BigNumber(y,b)).c;if(!(xc&&yc&&xc[0]&&yc[0]))return!x.s||!y.s||xc&&!xc[0]&&!yc||yc&&!yc[0]&&!xc?y.c=y.e=y.s=null:(y.s*=x.s,xc&&yc?(y.c=[0],y.e=0):y.c=y.e=null),y;for(e=bitFloor(x.e/LOG_BASE)+bitFloor(y.e/LOG_BASE),y.s*=x.s,xcL=xc.length,ycL=yc.length,xcL<ycL&&(zc=xc,xc=yc,yc=zc,i=xcL,xcL=ycL,ycL=i),i=xcL+ycL,zc=[];i--;zc.push(0));for(base=BASE,sqrtBase=SQRT_BASE,i=ycL;--i>=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i<len;i+=g1)intPart+=groupSeparator+intDigits.substr(i,g1);g2>0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";i<j;){for(s=a[i++]+"",z=LOG_BASE-s.length;z--;s="0"+s);r+=s}for(j=r.length;48===r.charCodeAt(--j););return r.slice(0,j+1||1)}function compare(x,y){var a,b,xc=x.c,yc=y.c,i=x.s,j=y.s,k=x.e,l=y.e;if(!i||!j)return null;if(a=xc&&!xc[0],b=yc&&!yc[0],a||b)return a?b?0:-j:i;if(i!=j)return i;if(a=i<0,b=k==l,!xc||!yc)return b?0:!xc^a?1:-1;if(!b)return k>l^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;i<j;i++)if(xc[i]!=yc[i])return xc[i]>yc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn);for(arr[j=0]+=ALPHABET.indexOf(str.charAt(i++));j<arr.length;j++)arr[j]>baseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else e<len&&(str=str.slice(0,e)+"."+str.slice(e));return str}function truncate(n){return n=parseFloat(n),n<0?mathceil(n):mathfloor(n)}var BigNumber,cryptoObj,parseNumeric,isNumeric=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,notBool=" not a boolean or binary digit",roundingMode="rounding mode",tooManyDigits="number type has more than 15 significant digits",ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;if("undefined"!=typeof crypto&&(cryptoObj=crypto),BigNumber=constructorFactory(),BigNumber.default=BigNumber.BigNumber=BigNumber,"function"==typeof define&&define.amd)define(function(){return BigNumber});else if(void 0!==module&&module.exports){if(module.exports=BigNumber,!cryptoObj)try{cryptoObj=require("crypto")}catch(e){}}else globalObj||(globalObj="undefined"!=typeof self?self:Function("return this")()),globalObj.BigNumber=BigNumber}(this)},{}],71:[function(require,module,exports){var encode=require("./lib/encoder"),decode=require("./lib/decoder");module.exports={encode:encode,decode:decode}},{"./lib/decoder":72,"./lib/encoder":73}],72:[function(require,module,exports){(function(Buffer){function BmpDecoder(buffer,is_with_alpha){if(this.pos=0,this.buffer=buffer,this.is_with_alpha=!!is_with_alpha,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}BmpDecoder.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var len=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(len);for(var i=0;i<len;i++){var blue=this.buffer.readUInt8(this.pos++),green=this.buffer.readUInt8(this.pos++),red=this.buffer.readUInt8(this.pos++),quad=this.buffer.readUInt8(this.pos++);this.palette[i]={red:red,green:green,blue:blue,quad:quad}}}},BmpDecoder.prototype.parseBGR=function(){this.pos=this.offset;try{var bitn="bit"+this.bitPP,len=this.width*this.height*4;this.data=new Buffer(len),this[bitn]()}catch(e){console.log("bit decode error:"+e)}},BmpDecoder.prototype.bit1=function(){for(var xlen=Math.ceil(this.width/8),mode=xlen%4,y=this.height-1;y>=0;y--){for(var x=0;x<xlen;x++)for(var b=this.buffer.readUInt8(this.pos++),location=y*this.width*4+8*x*4,i=0;i<8&&8*x+i<this.width;i++){var rgb=this.palette[b>>7-i&1];this.data[location+4*i]=rgb.blue,this.data[location+4*i+1]=rgb.green,this.data[location+4*i+2]=rgb.red,this.data[location+4*i+3]=255}0!=mode&&(this.pos+=4-mode)}},BmpDecoder.prototype.bit4=function(){for(var xlen=Math.ceil(this.width/2),mode=xlen%4,y=this.height-1;y>=0;y--){for(var x=0;x<xlen;x++){var b=this.buffer.readUInt8(this.pos++),location=y*this.width*4+2*x*4,before=b>>4,after=15&b,rgb=this.palette[before];if(this.data[location]=rgb.blue,this.data[location+1]=rgb.green,this.data[location+2]=rgb.red,this.data[location+3]=255,2*x+1>=this.width)break;rgb=this.palette[after],this.data[location+4]=rgb.blue,this.data[location+4+1]=rgb.green,this.data[location+4+2]=rgb.red,this.data[location+4+3]=255}0!=mode&&(this.pos+=4-mode)}},BmpDecoder.prototype.bit8=function(){for(var mode=this.width%4,y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var b=this.buffer.readUInt8(this.pos++),location=y*this.width*4+4*x;if(b<this.palette.length){var rgb=this.palette[b];this.data[location]=rgb.blue,this.data[location+1]=rgb.green,this.data[location+2]=rgb.red,this.data[location+3]=255}else this.data[location]=255,this.data[location+1]=255,this.data[location+2]=255,this.data[location+3]=255}0!=mode&&(this.pos+=4-mode)}},BmpDecoder.prototype.bit15=function(){for(var dif_w=this.width%3,_11111=parseInt("11111",2),_1_5=_11111,y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var B=this.buffer.readUInt16LE(this.pos);this.pos+=2;var blue=(B&_1_5)/_1_5*255|0,green=(B>>5&_1_5)/_1_5*255|0,red=(B>>10&_1_5)/_1_5*255|0,alpha=B>>15?255:0,location=y*this.width*4+4*x;this.data[location]=red,this.data[location+1]=green,this.data[location+2]=blue,this.data[location+3]=alpha}this.pos+=dif_w}},BmpDecoder.prototype.bit16=function(){for(var dif_w=this.width%3,_11111=parseInt("11111",2),_1_5=_11111,_111111=parseInt("111111",2),_1_6=_111111,y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var B=this.buffer.readUInt16LE(this.pos);this.pos+=2;var blue=(B&_1_5)/_1_5*255|0,green=(B>>5&_1_6)/_1_6*255|0,red=(B>>11)/_1_5*255|0,location=y*this.width*4+4*x;this.data[location]=red,this.data[location+1]=green,this.data[location+2]=blue,this.data[location+3]=255}this.pos+=dif_w}},BmpDecoder.prototype.bit24=function(){for(var y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var blue=this.buffer.readUInt8(this.pos++),green=this.buffer.readUInt8(this.pos++),red=this.buffer.readUInt8(this.pos++),location=y*this.width*4+4*x;this.data[location]=red,this.data[location+1]=green,this.data[location+2]=blue,this.data[location+3]=255}this.pos+=this.width%4}},BmpDecoder.prototype.bit32=function(){for(var y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var blue=this.buffer.readUInt8(this.pos++),green=this.buffer.readUInt8(this.pos++),red=this.buffer.readUInt8(this.pos++),alpha=this.buffer.readUInt8(this.pos++),location=y*this.width*4+4*x;this.data[location]=red,this.data[location+1]=green,this.data[location+2]=blue,this.data[location+3]=alpha}this.pos+=this.width%4}},BmpDecoder.prototype.getData=function(){return this.data},module.exports=function(bmpData){var decoder=new BmpDecoder(bmpData);return{data:decoder.getData(),width:decoder.width,height:decoder.height}}}).call(this,require("buffer").Buffer)},{buffer:108}],73:[function(require,module,exports){(function(Buffer){function BmpEncoder(imgData){this.buffer=imgData.data,this.width=imgData.width,this.height=imgData.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}BmpEncoder.prototype.encode=function(){var tempBuffer=new Buffer(this.offset+this.rgbSize);this.pos=0,tempBuffer.write(this.flag,this.pos,2),this.pos+=2,tempBuffer.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.reserved,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.offset,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.width,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.height,this.pos),this.pos+=4,tempBuffer.writeUInt16LE(this.planes,this.pos),this.pos+=2,tempBuffer.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,tempBuffer.writeUInt32LE(this.compress,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.hr,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.vr,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.colors,this.pos),this.pos+=4,tempBuffer.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var i=0,rowBytes=3*this.width+this.extraBytes,y=this.height-1;y>=0;y--){for(var x=0;x<this.width;x++){var p=this.pos+y*rowBytes+3*x;tempBuffer[p+2]=this.buffer[i++],tempBuffer[p+1]=this.buffer[i++],tempBuffer[p]=this.buffer[i++],i++}if(this.extraBytes>0){var fillOffset=this.pos+y*rowBytes+3*this.width;tempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes)}}return tempBuffer},module.exports=function(imgData,quality){return void 0===quality&&(quality=100),{data:new BmpEncoder(imgData).encode(),width:imgData.width,height:imgData.height}}}).call(this,require("buffer").Buffer)},{buffer:108}],74:[function(require,module,exports){!function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i<len;i++){var c=str.charCodeAt(i)-48;r<<=4,r|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i<len;i++){var c=str.charCodeAt(i)-48;r*=mul,r+=c>=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit<w.length;bit++){var off=bit/26|0,wbit=bit%26;w[bit]=(num.words[off]&1<<wbit)>>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k<len;k++){for(var ncarry=carry>>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k<out.length-1;k++){var ncarry=hncarry;hncarry=0;for(var rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j,a=0|self.words[i],b=0|num.words[j],r=a*b,lo=67108863&r;ncarry=ncarry+(r/67108864|0)|0,lo=lo+rword|0,rword=67108863&lo,ncarry=ncarry+(lo>>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"===(void 0===module?"undefined":_typeof(module))?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=require("buffer").Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"===(void 0===num?"undefined":_typeof(num))&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"===(void 0===number?"undefined":_typeof(number)))return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var j,w,off=0;if("be"===endian)for(i=number.length-1,j=0;i>=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<<off&67108863,this.words[j+1]=w>>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i<number.length;i+=3)w=number[i]|number[i+1]<<8|number[i+2]<<16,this.words[j]|=w<<off&67108863,this.words[j+1]=w>>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var j,w,off=0;for(i=number.length-6,j=0;i>=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<<off&67108863,this.words[j+1]|=w>>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<<off&67108863,this.words[j+1]|=w>>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i<end;i+=limbLen)word=parseBase(number,i,i+limbLen,base),this.imuln(limbPow),this.words[0]+word<67108864?this.words[0]+=word:this._iaddn(word);if(0!==mod){var pow=1;for(word=parseBase(number,i,number.length,base),i=0;i<mod;i++)pow*=base;this.imuln(pow),this.words[0]+word<67108864?this.words[0]+=word:this._iaddn(word)}},BN.prototype.copy=function(dest){dest.words=new Array(this.length);for(var i=0;i<this.length;i++)dest.words[i]=this.words[i];dest.length=this.length,dest.negative=this.negative,dest.red=this.red},BN.prototype.clone=function(){var r=new BN(null);return this.copy(r),r},BN.prototype._expand=function(size){for(;this.length<size;)this.words[this.length++]=0;return this},BN.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i<this.length;i++){var w=this.words[i],word=(16777215&(w<<off|carry)).toString(16);carry=w>>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i<reqLength;i++)res[i]=0}else{for(i=0;i<reqLength-byteLength;i++)res[i]=0;for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[reqLength-i-1]=b}return res},Math.clz32?BN.prototype._countBits=function(w){return 32-Math.clz32(w)}:BN.prototype._countBits=function(w){var t=w,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;i<this.length;i++){var b=this._zeroBits(this.words[i]);if(r+=b,26!==b)break}return r},BN.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function(width){return 0!==this.negative?this.abs().inotn(width).iaddn(1):this.clone()},BN.prototype.fromTwos=function(width){return this.testn(width-1)?this.notn(width).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function(){return 0!==this.negative},BN.prototype.neg=function(){return this.clone().ineg()},BN.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function(num){for(;this.length<num.length;)this.words[this.length++]=0;for(var i=0;i<num.length;i++)this.words[i]=this.words[i]|num.words[i];return this.strip()},BN.prototype.ior=function(num){return assert(0==(this.negative|num.negative)),this.iuor(num)},BN.prototype.or=function(num){return this.length>num.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;i<b.length;i++)this.words[i]=this.words[i]&num.words[i];return this.length=b.length,this.strip()},BN.prototype.iand=function(num){return assert(0==(this.negative|num.negative)),this.iuand(num)},BN.prototype.and=function(num){return this.length>num.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;i<b.length;i++)this.words[i]=a.words[i]^b.words[i];if(this!==a)for(;i<a.length;i++)this.words[i]=a.words[i];return this.length=a.length,this.strip()},BN.prototype.ixor=function(num){return assert(0==(this.negative|num.negative)),this.iuxor(num)},BN.prototype.xor=function(num){return this.length>num.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i<bytesNeeded;i++)this.words[i]=67108863&~this.words[i];return bitsLeft>0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<<wbit:this.words[off]&~(1<<wbit),this.strip()},BN.prototype.iadd=function(num){var r;if(0!==this.negative&&0===num.negative)return this.negative=0,r=this.isub(num),this.negative^=1,this._normSign();if(0===this.negative&&0!==num.negative)return num.negative=0,r=this.isub(num),num.negative=1,r._normSign();var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i<b.length;i++)r=(0|a.words[i])+(0|b.words[i])+carry,this.words[i]=67108863&r,carry=r>>>26;for(;0!==carry&&i<a.length;i++)r=(0|a.words[i])+carry,this.words[i]=67108863&r,carry=r>>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;i<a.length;i++)this.words[i]=a.words[i];return this},BN.prototype.add=function(num){var res;return 0!==num.negative&&0===this.negative?(num.negative=0,res=this.sub(num),num.negative^=1,res):0===num.negative&&0!==this.negative?(this.negative=0,res=num.sub(this),this.negative=1,res):this.length>num.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i<b.length;i++)r=(0|a.words[i])-(0|b.words[i])+carry,carry=r>>26,this.words[i]=67108863&r;for(;0!==carry&&i<a.length;i++)r=(0|a.words[i])+carry,carry=r>>26,this.words[i]=67108863&r;if(0===carry&&i<a.length&&a!==this)for(;i<a.length;i++)this.words[i]=a.words[i];return this.length=Math.max(this.length,i),a!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function(num){return this.clone().isub(num)};var comb10MulTo=function(self,num,out){var lo,mid,hi,a=self.words,b=num.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0,mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i<N;i++)t[i]=this.revBin(i,l,N);return t},FFTM.prototype.revBin=function(x,l,N){if(0===x||x===N-1)return x;for(var rb=0,i=0;i<l;i++)rb|=(1&x)<<l-i-1,x>>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i<N;i++)rtws[i]=rws[rbt[i]],itws[i]=iws[rbt[i]]},FFTM.prototype.transform=function(rws,iws,rtws,itws,N,rbt){this.permute(rbt,rws,iws,rtws,itws,N);for(var s=1;s<N;s<<=1)for(var l=s<<1,rtwdf=Math.cos(2*Math.PI/l),itwdf=Math.sin(2*Math.PI/l),p=0;p<N;p+=l)for(var rtwdf_=rtwdf,itwdf_=itwdf,j=0;j<s;j++){var re=rtws[p+j],ie=itws[p+j],ro=rtws[p+j+s],io=itws[p+j+s],rx=rtwdf_*ro-itwdf_*io;io=rtwdf_*io+itwdf_*ro,ro=rx,rtws[p+j]=re+ro,itws[p+j]=ie+io,rtws[p+j+s]=re-ro,itws[p+j+s]=ie-io,j!==l&&(rx=rtwdf*rtwdf_-itwdf*itwdf_,itwdf_=rtwdf*itwdf_+itwdf*rtwdf_,rtwdf_=rx)}},FFTM.prototype.guessLen13b=function(n,m){var N=1|Math.max(m,n),odd=1&N,i=0;for(N=N/2|0;N;N>>>=1)i++;return 1<<i+1+odd},FFTM.prototype.conjugate=function(rws,iws,N){if(!(N<=1))for(var i=0;i<N/2;i++){var t=rws[i];rws[i]=rws[N-i-1],rws[N-i-1]=t,t=iws[i],iws[i]=-iws[N-i-1],iws[N-i-1]=-t}},FFTM.prototype.normalize13b=function(ws,N){for(var carry=0,i=0;i<N/2;i++){var w=8192*Math.round(ws[2*i+1]/N)+Math.round(ws[2*i]/N)+carry;ws[i]=67108863&w,carry=w<67108864?0:w/67108864|0}return ws},FFTM.prototype.convert13b=function(ws,len,rws,N){for(var carry=0,i=0;i<len;i++)carry+=0|ws[i],rws[2*i]=8191&carry,carry>>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i<N;++i)rws[i]=0;assert(0===carry),assert(0==(-8192&carry))},FFTM.prototype.stub=function(N){for(var ph=new Array(N),i=0;i<N;i++)ph[i]=0;return ph},FFTM.prototype.mulp=function(x,y,out){var N=2*this.guessLen13b(x.length,y.length),rbt=this.makeRBT(N),_=this.stub(N),rws=new Array(N),rwst=new Array(N),iwst=new Array(N),nrws=new Array(N),nrwst=new Array(N),niwst=new Array(N),rmws=out.words;rmws.length=N,this.convert13b(x.words,x.length,rws,N),this.convert13b(y.words,y.length,nrws,N),this.transform(rws,_,rwst,iwst,N,rbt),this.transform(nrws,_,nrwst,niwst,N,rbt);for(var i=0;i<N;i++){var rx=rwst[i]*nrwst[i]-iwst[i]*niwst[i];iwst[i]=rwst[i]*niwst[i]+iwst[i]*nrwst[i],rwst[i]=rx}return this.conjugate(rwst,iwst,N),this.transform(rwst,iwst,rmws,_,N,rbt),this.conjugate(rmws,_,N),this.normalize13b(rmws,N),out.negative=x.negative^y.negative,out.length=x.length+y.length,out.strip()},BN.prototype.mul=function(num){var out=new BN(null);return out.words=new Array(this.length+num.length),this.mulTo(num,out)},BN.prototype.mulf=function(num){var out=new BN(null);return out.words=new Array(this.length+num.length),jumboMulTo(this,num,out)},BN.prototype.imul=function(num){return this.clone().mulTo(num,this)},BN.prototype.imuln=function(num){assert("number"==typeof num),assert(num<67108864);for(var carry=0,i=0;i<this.length;i++){var w=(0|this.words[i])*num,lo=(67108863&w)+(67108863&carry);carry>>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i<w.length&&0===w[i];i++,res=res.sqr());if(++i<w.length)for(var q=res.sqr();i<w.length;i++,q=q.sqr())0!==w[i]&&(res=res.mul(q));return res},BN.prototype.iushln=function(bits){assert("number"==typeof bits&&bits>=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i<this.length;i++){var newCarry=this.words[i]&carryMask,c=(0|this.words[i])-newCarry<<r;this.words[i]=c|carry,carry=newCarry>>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i<s;i++)this.words[i]=0;this.length+=s}return this.strip()},BN.prototype.ishln=function(bits){return assert(0===this.negative),this.iushln(bits)},BN.prototype.iushrn=function(bits,hint,extended){assert("number"==typeof bits&&bits>=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<<r,maskedWords=extended;if(h-=s,h=Math.max(0,h),maskedWords){for(var i=0;i<s;i++)maskedWords.words[i]=this.words[i];maskedWords.length=s}if(0===s);else if(this.length>s)for(this.length-=s,i=0;i<this.length;i++)this.words[i]=this.words[i+s];else this.words[0]=0,this.length=1;var carry=0;for(i=this.length-1;i>=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<<r;return!(this.length<=s)&&!!(this.words[s]&q)},BN.prototype.imaskn=function(bits){assert("number"==typeof bits&&bits>=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<<r;this.words[this.length-1]&=mask}return this.strip()},BN.prototype.maskn=function(bits){return this.clone().imaskn(bits)},BN.prototype.iaddn=function(num){return assert("number"==typeof num),assert(num<67108864),num<0?this.isubn(-num):0!==this.negative?1===this.length&&(0|this.words[0])<num?(this.words[0]=num-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(num),this.negative=1,this):this._iaddn(num)},BN.prototype._iaddn=function(num){this.words[0]+=num;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},BN.prototype.addn=function(num){return this.clone().iaddn(num)},BN.prototype.subn=function(num){return this.clone().isubn(num)},BN.prototype.iabs=function(){return this.negative=0,this},BN.prototype.abs=function(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function(num,mul,shift){var i,len=num.length+shift;this._expand(len);var w,carry=0;for(i=0;i<num.length;i++){w=(0|this.words[i+shift])+carry;var right=(0|num.words[i])*mul;w-=67108863&right,carry=(w>>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i<this.length-shift;i++)w=(0|this.words[i+shift])+carry,carry=w>>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(-1===carry),carry=0,i=0;i<this.length;i++)w=-(0|this.words[i])+carry,carry=w>>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i<q.length;i++)q.words[i]=0}var diff=a.clone()._ishlnsubmul(b,1,m);0===diff.negative&&(a=diff,q&&(q.words[m]=1));for(var j=m-1;j>=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)},BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<<r;if(this.length<=s)return this._expand(s+1),this.words[s]|=q,this;for(var carry=q,i=s;0!==carry&&i<this.length;i++){var w=0|this.words[i];w+=carry,carry=w>>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:w<num?-1:1}return 0!==this.negative?0|-res:res},BN.prototype.cmp=function(num){if(0!==this.negative&&0===num.negative)return-1;if(0===this.negative&&0!==num.negative)return 1;var res=this.ucmp(num);return 0!==this.negative?0|-res:res},BN.prototype.ucmp=function(num){if(this.length>num.length)return 1;if(this.length<num.length)return-1;for(var res=0,i=this.length-1;i>=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){a<b?res=-1:a>b&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return-1===this.cmpn(num)},BN.prototype.lt=function(num){return-1===this.cmp(num)},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen<this.n?-1:r.ucmp(this.p);return 0===cmp?(r.words[0]=0,r.length=1):cmp>0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var mask=4194303,outLen=Math.min(input.length,9),i=0;i<outLen;i++)output.words[i]=input.words[i];if(output.length=outLen,input.length<=9)return input.words[0]=0,void(input.length=1);var prev=input.words[9];for(output.words[output.length++]=prev&mask,i=10;i<input.length;i++){var next=0|input.words[i];input.words[i-10]=(next&mask)<<4|prev>>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i<num.length;i++){var w=0|num.words[i];lo+=977*w,num.words[i]=67108863&lo,lo=64*w+(lo/67108864|0)}return 0===num.words[num.length-1]&&(num.length--,0===num.words[num.length-1]&&num.length--),num},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function(num){for(var carry=0,i=0;i<num.length;i++){var hi=19*(0|num.words[i])+carry,lo=67108863&hi;hi>>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i<m);var b=this.pow(c,new BN(1).iushln(m-i-1));r=r.redMul(b),c=b.redSqr(),t=t.redMul(c),m=i}return r},Red.prototype.invm=function(a){var inv=a._invmp(this.m);return 0!==inv.negative?(inv.negative=0,this.imod(inv).redNeg()):this.imod(inv)},Red.prototype.pow=function(a,num){if(num.isZero())return new BN(1).toRed(this);if(0===num.cmpn(1))return a.clone();var windowSize=4,wnd=new Array(1<<windowSize);wnd[0]=new BN(1).toRed(this),wnd[1]=a;for(var i=2;i<wnd.length;i++)wnd[i]=this.mul(wnd[i-1],a);var res=wnd[0],current=0,currentLen=0,start=num.bitLength()%26;for(0===start&&(start=26),i=num.length-1;i>=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(++currentLen===windowSize||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)},{buffer:76}],75:[function(require,module,exports){function Rand(rand){this.rand=rand}var r;if(module.exports=function(len){return r||(r=new Rand(null)),r.generate(len)},module.exports.Rand=Rand,Rand.prototype.generate=function(len){return this._rand(len)},Rand.prototype._rand=function(n){if(this.rand.getBytes)return this.rand.getBytes(n);for(var res=new Uint8Array(n),i=0;i<res.length;i++)res[i]=this.rand.getByte();return res},"object"===("undefined"==typeof self?"undefined":_typeof(self)))self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function(n){var arr=new Uint8Array(n);return self.crypto.getRandomValues(arr),arr}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function(n){var arr=new Uint8Array(n);return self.msCrypto.getRandomValues(arr),arr}:"object"===(void 0===window?"undefined":_typeof(window))&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var crypto=require("crypto");if("function"!=typeof crypto.randomBytes)throw new Error("Not supported");Rand.prototype._rand=function(n){return crypto.randomBytes(n)}}catch(e){}},{crypto:76}],76:[function(require,module,exports){},{}],77:[function(require,module,exports){(function(Buffer){function fixup_uint32(x){var x_pos;return x>uint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(var i=0;i<v.length;v++)v[i]=0;return!1}function Global(){this.SBOX=[],this.INV_SBOX=[],this.SUB_MIX=[[],[],[],[]],this.INV_SUB_MIX=[[],[],[],[]],this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}function bufferToArray(buf){for(var len=buf.length/4,out=new Array(len),i=-1;++i<len;)out[i]=buf.readUInt32BE(4*i);return out}function AES(key){this._key=bufferToArray(key),this._doReset()}var uint_max=Math.pow(2,32);Global.prototype.init=function(){var d,i,sx,t,x,x2,x4,x8,xi,_i;for(d=function(){var _i,_results;for(_results=[],i=_i=0;_i<256;i=++_i)i<128?_results.push(i<<1):_results.push(i<<1^283);return _results}(),x=0,xi=0,i=_i=0;_i<256;i=++_i)sx=xi^xi<<1^xi<<2^xi<<3^xi<<4,sx=sx>>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow<ksRows;ksRow++)this._keySchedule[ksRow]=ksRow<keySize?keyWords[ksRow]:(t=this._keySchedule[ksRow-1],ksRow%keySize==0?(t=t<<8|t>>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow<ksRows;invKsRow++)ksRow=ksRows-invKsRow,t=this._keySchedule[ksRow-(invKsRow%4?0:4)],this._invKeySchedule[invKsRow]=invKsRow<4||ksRow<=4?t:G.INV_SUB_MIX[0][G.SBOX[t>>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round<this._nRounds;round++)t0=SUB_MIX[0][s0>>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(this,require("buffer").Buffer)},{buffer:108}],78:[function(require,module,exports){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i<len;)out+=a[i]^b[i];return out}var aes=require("./aes"),Transform=require("cipher-base"),inherits=require("inherits"),GHASH=require("./ghash"),xor=require("buffer-xor");inherits(StreamCipher,Transform),module.exports=StreamCipher,StreamCipher.prototype._update=function(chunk){if(!this._called&&this._alen){var rump=16-this._alen%16;rump<16&&(rump=new Buffer(rump),rump.fill(0),this._ghash.update(rump))}this._called=!0;var out=this._mode.encrypt(this,chunk);return this._decrypt?this._ghash.update(chunk):this._ghash.update(out),this._len+=chunk.length,out},StreamCipher.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var tag=xor(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(xorTest(tag,this._authTag))throw new Error("Unsupported state or unable to authenticate data")}else this._authTag=tag;this._cipher.scrub()},StreamCipher.prototype.getAuthTag=function(){if(!this._decrypt&&Buffer.isBuffer(this._authTag))return this._authTag;throw new Error("Attempting to get auth tag in unsupported state")},StreamCipher.prototype.setAuthTag=function(tag){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=tag},StreamCipher.prototype.setAAD=function(buf){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(buf),this._alen+=buf.length}}).call(this,require("buffer").Buffer)},{"./aes":77,"./ghash":82,buffer:108,"buffer-xor":107,"cipher-base":111,inherits:215}],79:[function(require,module,exports){function getCiphers(){return Object.keys(modes)}var ciphers=require("./encrypter");exports.createCipher=exports.Cipher=ciphers.createCipher,exports.createCipheriv=exports.Cipheriv=ciphers.createCipheriv;var deciphers=require("./decrypter");exports.createDecipher=exports.Decipher=deciphers.createDecipher,exports.createDecipheriv=exports.Decipheriv=deciphers.createDecipheriv;var modes=require("./modes");exports.listCiphers=exports.getCiphers=getCiphers},{"./decrypter":80,"./encrypter":81,"./modes":83}],80:[function(require,module,exports){(function(Buffer){function Decipher(mode,key,iv){if(!(this instanceof Decipher))return new Decipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._last=void 0,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function unpad(last){for(var padded=last[15],i=-1;++i<padded;)if(last[i+(16-padded)]!==padded)throw new Error("unable to decrypt data");if(16!==padded)return last.slice(0,16-padded)}function createDecipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv,!0):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv,!0):new Decipher(modelist[config.mode],password,iv)}function createDecipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createDecipheriv(suite,keys.key,keys.iv)}var aes=require("./aes"),Transform=require("cipher-base"),inherits=require("inherits"),modes=require("./modes"),StreamCipher=require("./streamCipher"),AuthCipher=require("./authCipher"),ebtk=require("evp_bytestokey");inherits(Decipher,Transform),Decipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get(this._autopadding);)thing=this._mode.decrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Decipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return unpad(this._mode.decrypt(this,chunk));if(chunk)throw new Error("data not multiple of block length")},Decipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(autoPadding){var out;if(autoPadding){if(this.cache.length>16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:require("./modes/ecb"),CBC:require("./modes/cbc"),CFB:require("./modes/cfb"),CFB8:require("./modes/cfb8"),CFB1:require("./modes/cfb1"),OFB:require("./modes/ofb"),CTR:require("./modes/ctr"),GCM:require("./modes/ctr")};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(this,require("buffer").Buffer)},{"./aes":77,"./authCipher":78,"./modes":83,"./modes/cbc":84,"./modes/cfb":85,"./modes/cfb1":86,"./modes/cfb8":87,"./modes/ctr":88,"./modes/ecb":89,"./modes/ofb":90,"./streamCipher":91,buffer:108,"cipher-base":111,evp_bytestokey:154,inherits:215}],81:[function(require,module,exports){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=require("./aes"),Transform=require("cipher-base"),inherits=require("inherits"),modes=require("./modes"),ebtk=require("evp_bytestokey"),StreamCipher=require("./streamCipher"),AuthCipher=require("./authCipher");inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++i<len;)padBuff.writeUInt8(len,i);return Buffer.concat([this.cache,padBuff])};var modelist={ECB:require("./modes/ecb"),CBC:require("./modes/cbc"),CFB:require("./modes/cfb"),CFB8:require("./modes/cfb8"),CFB1:require("./modes/cfb1"),OFB:require("./modes/ofb"),CTR:require("./modes/ctr"),GCM:require("./modes/ctr")};exports.createCipheriv=createCipheriv,exports.createCipher=createCipher}).call(this,require("buffer").Buffer)},{"./aes":77,"./authCipher":78,"./modes":83,"./modes/cbc":84,"./modes/cfb":85,"./modes/cfb1":86,"./modes/cfb8":87,"./modes/ctr":88,"./modes/ecb":89,"./modes/ofb":90,"./streamCipher":91,buffer:108,"cipher-base":111,evp_bytestokey:154,inherits:215}],82:[function(require,module,exports){(function(Buffer){function GHASH(key){this.h=key,this.state=new Buffer(16),this.state.fill(0),this.cache=new Buffer("")}function toArray(buf){return[buf.readUInt32BE(0),buf.readUInt32BE(4),buf.readUInt32BE(8),buf.readUInt32BE(12)]}function fromArray(out){out=out.map(fixup_uint32);var buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf}function fixup_uint32(x){var x_pos;return x>uint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i<block.length;)this.state[i]^=block[i];this._multiply()},GHASH.prototype._multiply=function(){for(var j,xi,lsb_Vi,Vi=toArray(this.h),Zi=[0,0,0,0],i=-1;++i<128;){for(xi=0!=(this.state[~~(i/8)]&1<<7-i%8),xi&&(Zi=xor(Zi,Vi)),lsb_Vi=0!=(1&Vi[3]),j=3;j>0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(this,require("buffer").Buffer)},{buffer:108}],83:[function(require,module,exports){exports["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},exports["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},exports["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},exports["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},exports["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},exports["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},exports.aes128=exports["aes-128-cbc"],exports.aes192=exports["aes-192-cbc"],exports.aes256=exports["aes-256-cbc"],exports["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},exports["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},exports["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},exports["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},exports["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},exports["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},exports["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},exports["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},exports["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},exports["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},exports["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},exports["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},exports["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},exports["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},exports["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},exports["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},exports["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},exports["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],84:[function(require,module,exports){var xor=require("buffer-xor");exports.encrypt=function(self,block){var data=xor(block,self._prev);return self._prev=self._cipher.encryptBlock(data),self._prev},exports.decrypt=function(self,block){var pad=self._prev;self._prev=block;var out=self._cipher.decryptBlock(block);return xor(out,pad)}},{"buffer-xor":107}],85:[function(require,module,exports){(function(Buffer){function encryptStart(self,data,decrypt){var len=data.length,out=xor(data,self._cache);return self._cache=self._cache.slice(len),self._prev=Buffer.concat([self._prev,decrypt?data:out]),out}var xor=require("buffer-xor");exports.encrypt=function(self,data,decrypt){for(var len,out=new Buffer("");data.length;){if(0===self._cache.length&&(self._cache=self._cipher.encryptBlock(self._prev),self._prev=new Buffer("")),!(self._cache.length<=data.length)){out=Buffer.concat([out,encryptStart(self,data,decrypt)]);break}len=self._cache.length,out=Buffer.concat([out,encryptStart(self,data.slice(0,len),decrypt)]),data=data.slice(len)}return out}}).call(this,require("buffer").Buffer)},{buffer:108,"buffer-xor":107}],86:[function(require,module,exports){(function(Buffer){function encryptByte(self,byteParam,decrypt){for(var pad,bit,value,i=-1,len=8,out=0;++i<len;)pad=self._cipher.encryptBlock(self._prev),bit=byteParam&1<<7-i?128:0,value=pad[0]^bit,out+=(128&value)>>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i<len;)out[i]=buffer[i]<<1|buffer[i+1]>>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i<len;)out[i]=encryptByte(self,chunk[i],decrypt);return out}}).call(this,require("buffer").Buffer)},{buffer:108}],87:[function(require,module,exports){(function(Buffer){function encryptByte(self,byteParam,decrypt){var pad=self._cipher.encryptBlock(self._prev),out=pad[0]^byteParam;return self._prev=Buffer.concat([self._prev.slice(1),new Buffer([decrypt?byteParam:out])]),out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i<len;)out[i]=encryptByte(self,chunk[i],decrypt);return out}}).call(this,require("buffer").Buffer)},{buffer:108}],88:[function(require,module,exports){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=require("buffer-xor");exports.encrypt=function(self,chunk){for(;self._cache.length<chunk.length;)self._cache=Buffer.concat([self._cache,getBlock(self)]);var pad=self._cache.slice(0,chunk.length);return self._cache=self._cache.slice(chunk.length),xor(chunk,pad)}}).call(this,require("buffer").Buffer)},{buffer:108,"buffer-xor":107}],89:[function(require,module,exports){exports.encrypt=function(self,block){return self._cipher.encryptBlock(block)},exports.decrypt=function(self,block){return self._cipher.decryptBlock(block)}},{}],90:[function(require,module,exports){(function(Buffer){function getBlock(self){return self._prev=self._cipher.encryptBlock(self._prev),self._prev}var xor=require("buffer-xor");exports.encrypt=function(self,chunk){for(;self._cache.length<chunk.length;)self._cache=Buffer.concat([self._cache,getBlock(self)]);var pad=self._cache.slice(0,chunk.length);return self._cache=self._cache.slice(chunk.length),xor(chunk,pad)}}).call(this,require("buffer").Buffer)},{buffer:108,"buffer-xor":107}],91:[function(require,module,exports){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,iv.copy(this._prev),this._mode=mode}var aes=require("./aes"),Transform=require("cipher-base");require("inherits")(StreamCipher,Transform),module.exports=StreamCipher,StreamCipher.prototype._update=function(chunk){return this._mode.encrypt(this,chunk,this._decrypt)},StreamCipher.prototype._final=function(){this._cipher.scrub()}}).call(this,require("buffer").Buffer)},{"./aes":77,buffer:108,"cipher-base":111,inherits:215}],92:[function(require,module,exports){function createCipher(suite,password){var keyLen,ivLen;if(suite=suite.toLowerCase(),aesModes[suite])keyLen=aesModes[suite].key,ivLen=aesModes[suite].iv;else{if(!desModes[suite])throw new TypeError("invalid suite type");keyLen=8*desModes[suite].key,ivLen=desModes[suite].iv}var keys=ebtk(password,!1,keyLen,ivLen);return createCipheriv(suite,keys.key,keys.iv)}function createDecipher(suite,password){var keyLen,ivLen;if(suite=suite.toLowerCase(),aesModes[suite])keyLen=aesModes[suite].key,ivLen=aesModes[suite].iv;else{if(!desModes[suite])throw new TypeError("invalid suite type");keyLen=8*desModes[suite].key,ivLen=desModes[suite].iv}var keys=ebtk(password,!1,keyLen,ivLen);return createDecipheriv(suite,keys.key,keys.iv)}function createCipheriv(suite,key,iv){if(suite=suite.toLowerCase(),aesModes[suite])return aes.createCipheriv(suite,key,iv);if(desModes[suite])return new DES({key:key,iv:iv,mode:suite});throw new TypeError("invalid suite type")}function createDecipheriv(suite,key,iv){if(suite=suite.toLowerCase(),aesModes[suite])return aes.createDecipheriv(suite,key,iv);if(desModes[suite])return new DES({key:key,iv:iv,mode:suite,decrypt:!0});throw new TypeError("invalid suite type")}function getCiphers(){return Object.keys(desModes).concat(aes.getCiphers())}var ebtk=require("evp_bytestokey"),aes=require("browserify-aes/browser"),DES=require("browserify-des"),desModes=require("browserify-des/modes"),aesModes=require("browserify-aes/modes");exports.createCipher=exports.Cipher=createCipher,exports.createCipheriv=exports.Cipheriv=createCipheriv,exports.createDecipher=exports.Decipher=createDecipher,exports.createDecipheriv=exports.Decipheriv=createDecipheriv,exports.listCiphers=exports.getCiphers=getCiphers},{"browserify-aes/browser":79,"browserify-aes/modes":83,"browserify-des":93,"browserify-des/modes":94,evp_bytestokey:154}],93:[function(require,module,exports){(function(Buffer){function DES(opts){CipherBase.call(this);var type,modeName=opts.mode.toLowerCase(),mode=modes[modeName];type=opts.decrypt?"decrypt":"encrypt";var key=opts.key;"des-ede"!==modeName&&"des-ede-cbc"!==modeName||(key=Buffer.concat([key,key.slice(0,8)]));var iv=opts.iv;this._des=mode.create({key:key,iv:iv,type:type})}var CipherBase=require("cipher-base"),des=require("des.js"),inherits=require("inherits"),modes={"des-ede3-cbc":des.CBC.instantiate(des.EDE),"des-ede3":des.EDE,"des-ede-cbc":des.CBC.instantiate(des.EDE),"des-ede":des.EDE,"des-cbc":des.CBC.instantiate(des.DES),"des-ecb":des.DES};modes.des=modes["des-cbc"],modes.des3=modes["des-ede3-cbc"],module.exports=DES,inherits(DES,CipherBase),DES.prototype._update=function(data){return new Buffer(this._des.update(data))},DES.prototype._final=function(){return new Buffer(this._des.final())}}).call(this,require("buffer").Buffer)},{buffer:108,"cipher-base":111,"des.js":123,inherits:215}],94:[function(require,module,exports){exports["des-ecb"]={key:8,iv:0},exports["des-cbc"]=exports.des={key:8,iv:8},exports["des-ede3-cbc"]=exports.des3={key:24,iv:8},exports["des-ede3"]={key:24,iv:0},exports["des-ede-cbc"]={key:16,iv:8},exports["des-ede"]={key:16,iv:0}},{}],95:[function(require,module,exports){(function(Buffer){function blind(priv){var r=getr(priv);return{blinder:r.toRed(bn.mont(priv.modulus)).redPow(new bn(priv.publicExponent)).fromRed(),unblinder:r.invm(priv.modulus)}}function crt(msg,priv){var blinds=blind(priv),len=priv.modulus.byteLength(),blinded=(bn.mont(priv.modulus),new bn(msg).mul(blinds.blinder).umod(priv.modulus)),c1=blinded.toRed(bn.mont(priv.prime1)),c2=blinded.toRed(bn.mont(priv.prime2)),qinv=priv.coefficient,p=priv.prime1,q=priv.prime2,m1=c1.redPow(priv.exponent1),m2=c2.redPow(priv.exponent2);m1=m1.fromRed(),m2=m2.fromRed();var h=m1.isub(m2).imul(qinv).umod(p);return h.imul(q),m2.iadd(h),new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(!1,len))}function getr(priv){for(var len=priv.modulus.byteLength(),r=new bn(randomBytes(len));r.cmp(priv.modulus)>=0||!r.umod(priv.prime1)||!r.umod(priv.prime2);)r=new bn(randomBytes(len));return r}var bn=require("bn.js"),randomBytes=require("randombytes");module.exports=crt,crt.getr=getr}).call(this,require("buffer").Buffer)},{"bn.js":74,buffer:108,randombytes:314}],96:[function(require,module,exports){module.exports=require("./browser/algorithms.json")},{"./browser/algorithms.json":97}],97:[function(require,module,exports){module.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],98:[function(require,module,exports){module.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],99:[function(require,module,exports){(function(Buffer){function Sign(algorithm){stream.Writable.call(this);var data=algorithms[algorithm];if(!data)throw new Error("Unknown message digest");this._hashType=data.hash,this._hash=createHash(data.hash),this._tag=data.id,this._signType=data.sign}function Verify(algorithm){stream.Writable.call(this);var data=algorithms[algorithm];if(!data)throw new Error("Unknown message digest");this._hash=createHash(data.hash),this._tag=data.id,this._signType=data.sign}function createSign(algorithm){return new Sign(algorithm)}function createVerify(algorithm){return new Verify(algorithm)}var createHash=require("create-hash"),stream=require("stream"),inherits=require("inherits"),sign=require("./sign"),verify=require("./verify"),algorithms=require("./algorithms.json");Object.keys(algorithms).forEach(function(key){algorithms[key].id=new Buffer(algorithms[key].id,"hex"),algorithms[key.toLowerCase()]=algorithms[key]}),inherits(Sign,stream.Writable),Sign.prototype._write=function(data,_,done){this._hash.update(data),done()},Sign.prototype.update=function(data,enc){return"string"==typeof data&&(data=new Buffer(data,enc)),this._hash.update(data),this},Sign.prototype.sign=function(key,enc){this.end();var hash=this._hash.digest(),sig=sign(hash,key,this._hashType,this._signType,this._tag);return enc?sig.toString(enc):sig},inherits(Verify,stream.Writable),Verify.prototype._write=function(data,_,done){this._hash.update(data),done()},Verify.prototype.update=function(data,enc){return"string"==typeof data&&(data=new Buffer(data,enc)),this._hash.update(data),this},Verify.prototype.verify=function(key,sig,enc){"string"==typeof sig&&(sig=new Buffer(sig,enc)),this.end();var hash=this._hash.digest();return verify(sig,hash,key,this._signType,this._tag)},module.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify}}).call(this,require("buffer").Buffer)},{"./algorithms.json":97,"./sign":100,"./verify":101,buffer:108,"create-hash":116,inherits:215,stream:374}],100:[function(require,module,exports){(function(Buffer){function sign(hash,key,hashType,signType,tag){var priv=parseKeys(key);if(priv.curve){if("ecdsa"!==signType&&"ecdsa/rsa"!==signType)throw new Error("wrong private key type");return ecSign(hash,priv)}if("dsa"===priv.type){if("dsa"!==signType)throw new Error("wrong private key type");return dsaSign(hash,priv,hashType)}if("rsa"!==signType&&"ecdsa/rsa"!==signType)throw new Error("wrong private key type");hash=Buffer.concat([tag,hash]);for(var len=priv.modulus.byteLength(),pad=[0,1];hash.length+pad.length+1<len;)pad.push(255);pad.push(0);for(var i=-1;++i<hash.length;)pad.push(hash[i]);return crt(pad,priv)}function ecSign(hash,priv){var curveId=curves[priv.curve.join(".")];if(!curveId)throw new Error("unknown curve "+priv.curve.join("."));var curve=new EC(curveId),key=curve.keyFromPrivate(priv.privateKey),out=key.sign(hash);return new Buffer(out.toDER())}function dsaSign(hash,priv,algo){for(var k,x=priv.params.priv_key,p=priv.params.p,q=priv.params.q,g=priv.params.g,r=new BN(0),H=bits2int(hash,q).mod(q),s=!1,kv=getKey(x,q,hash,algo);!1===s;)k=makeKey(q,kv,algo),r=makeR(g,k,p,q),s=k.invm(q).imul(H.add(x.mul(r))).mod(q),0===s.cmpn(0)&&(s=!1,r=new BN(0));return toDER(r,s)}function toDER(r,s){r=r.toArray(),s=s.toArray(),128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s));var total=r.length+s.length+4,res=[48,total,2,r.length];return res=res.concat(r,[2,s.length],s),new Buffer(res)}function getKey(x,q,hash,algo){if(x=new Buffer(x.toArray()),x.length<q.byteLength()){var zeros=new Buffer(q.byteLength()-x.length);zeros.fill(0),x=Buffer.concat([zeros,x])}var hlen=hash.length,hbits=bits2octets(hash,q),v=new Buffer(hlen);v.fill(1);var k=new Buffer(hlen);return k.fill(0),k=createHmac(algo,k).update(v).update(new Buffer([0])).update(x).update(hbits).digest(),v=createHmac(algo,k).update(v).digest(),k=createHmac(algo,k).update(v).update(new Buffer([1])).update(x).update(hbits).digest(),v=createHmac(algo,k).update(v).digest(),{k:k,v:v}}function bits2int(obits,q){var bits=new BN(obits),shift=(obits.length<<3)-q.bitLength();return shift>0&&bits.ishrn(shift),bits}function bits2octets(bits,q){bits=bits2int(bits,q),bits=bits.mod(q);var out=new Buffer(bits.toArray());if(out.length<q.byteLength()){var zeros=new Buffer(q.byteLength()-out.length);zeros.fill(0),out=Buffer.concat([zeros,out])}return out}function makeKey(q,kv,algo){var t,k;do{for(t=new Buffer(0);8*t.length<q.bitLength();)kv.v=createHmac(algo,kv.k).update(kv.v).digest(),t=Buffer.concat([t,kv.v]);k=bits2int(t,q),kv.k=createHmac(algo,kv.k).update(kv.v).update(new Buffer([0])).digest(),kv.v=createHmac(algo,kv.k).update(kv.v).digest()}while(-1!==k.cmp(q));return k}function makeR(g,k,p,q){return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)}var createHmac=require("create-hmac"),crt=require("browserify-rsa"),EC=require("elliptic").ec,BN=require("bn.js"),parseKeys=require("parse-asn1"),curves=require("./curves.json");module.exports=sign,module.exports.getKey=getKey,module.exports.makeKey=makeKey}).call(this,require("buffer").Buffer)},{"./curves.json":98,"bn.js":74,"browserify-rsa":95,buffer:108,"create-hmac":119,elliptic:136,"parse-asn1":262}],101:[function(require,module,exports){(function(Buffer){function verify(sig,hash,key,signType,tag){var pub=parseKeys(key);if("ec"===pub.type){if("ecdsa"!==signType&&"ecdsa/rsa"!==signType)throw new Error("wrong public key type");return ecVerify(sig,hash,pub)}if("dsa"===pub.type){if("dsa"!==signType)throw new Error("wrong public key type");return dsaVerify(sig,hash,pub)}if("rsa"!==signType&&"ecdsa/rsa"!==signType)throw new Error("wrong public key type");hash=Buffer.concat([tag,hash]);for(var len=pub.modulus.byteLength(),pad=[1],padNum=0;hash.length+pad.length+2<len;)pad.push(255),padNum++;pad.push(0);for(var i=-1;++i<hash.length;)pad.push(hash[i]);pad=new Buffer(pad);var red=BN.mont(pub.modulus);sig=new BN(sig).toRed(red),sig=sig.redPow(new BN(pub.publicExponent)),sig=new Buffer(sig.fromRed().toArray());var out=padNum<8?1:0;for(len=Math.min(sig.length,pad.length),sig.length!==pad.length&&(out=1),i=-1;++i<len;)out|=sig[i]^pad[i];return 0===out}function ecVerify(sig,hash,pub){var curveId=curves[pub.data.algorithm.curve.join(".")];if(!curveId)throw new Error("unknown curve "+pub.data.algorithm.curve.join("."));var curve=new EC(curveId),pubkey=pub.data.subjectPrivateKey.data;return curve.verify(hash,sig,pubkey)}function dsaVerify(sig,hash,pub){var p=pub.data.p,q=pub.data.q,g=pub.data.g,y=pub.data.pub_key,unpacked=parseKeys.signature.decode(sig,"der"),s=unpacked.s,r=unpacked.r;checkValue(s,q),checkValue(r,q);var montp=BN.mont(p),w=s.invm(q);return 0===g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q).cmp(r)}function checkValue(b,q){if(b.cmpn(0)<=0)throw new Error("invalid sig");if(b.cmp(q)>=q)throw new Error("invalid sig")}var BN=require("bn.js"),EC=require("elliptic").ec,parseKeys=require("parse-asn1"),curves=require("./curves.json");module.exports=verify}).call(this,require("buffer").Buffer)},{"./curves.json":98,"bn.js":74,buffer:108,elliptic:136,"parse-asn1":262}],102:[function(require,module,exports){(function(process,Buffer){function Zlib(mode){if(mode<exports.DEFLATE||mode>exports.UNZIP)throw new TypeError("Bad argument");this.mode=mode,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 bufferSet(data,offset){for(var i=0;i<data.length;i++)this[offset+i]=data[i]}var msg=require("pako/lib/zlib/messages"),zstream=require("pako/lib/zlib/zstream"),zlib_deflate=require("pako/lib/zlib/deflate.js"),zlib_inflate=require("pako/lib/zlib/inflate.js"),constants=require("pako/lib/zlib/constants");for(var key in constants)exports[key]=constants[key];exports.NONE=0,exports.DEFLATE=1,exports.INFLATE=2,exports.GZIP=3,exports.GUNZIP=4,exports.DEFLATERAW=5,exports.INFLATERAW=6,exports.UNZIP=7,Zlib.prototype.init=function(windowBits,level,memLevel,strategy,dictionary){switch(this.windowBits=windowBits,this.level=level,this.memLevel=memLevel,this.strategy=strategy,this.mode!==exports.GZIP&&this.mode!==exports.GUNZIP||(this.windowBits+=16),this.mode===exports.UNZIP&&(this.windowBits+=32),this.mode!==exports.DEFLATERAW&&this.mode!==exports.INFLATERAW||(this.windowBits=-this.windowBits),this.strm=new zstream,this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:var status=zlib_deflate.deflateInit2(this.strm,this.level,exports.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:case exports.UNZIP:var status=zlib_inflate.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(status!==exports.Z_OK)return void this._error(status);this.write_in_progress=!1,this.init_done=!0},Zlib.prototype.params=function(){throw new Error("deflateParams Not supported")},Zlib.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===exports.NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Zlib.prototype.write=function(flush,input,in_off,in_len,out,out_off,out_len){this._writeCheck(),this.write_in_progress=!0;var self=this;return process.nextTick(function(){self.write_in_progress=!1;var res=self._write(flush,input,in_off,in_len,out,out_off,out_len);self.callback(res[0],res[1]),self.pending_close&&self.close()}),this},Zlib.prototype.writeSync=function(flush,input,in_off,in_len,out,out_off,out_len){return this._writeCheck(),this._write(flush,input,in_off,in_len,out,out_off,out_len)},Zlib.prototype._write=function(flush,input,in_off,in_len,out,out_off,out_len){if(this.write_in_progress=!0,flush!==exports.Z_NO_FLUSH&&flush!==exports.Z_PARTIAL_FLUSH&&flush!==exports.Z_SYNC_FLUSH&&flush!==exports.Z_FULL_FLUSH&&flush!==exports.Z_FINISH&&flush!==exports.Z_BLOCK)throw new Error("Invalid flush value");null==input&&(input=new Buffer(0),in_len=0,in_off=0),out._set?out.set=out._set:out.set=bufferSet;var strm=this.strm;switch(strm.avail_in=in_len,strm.input=input,strm.next_in=in_off,strm.avail_out=out_len,strm.output=out,strm.next_out=out_off,this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:var status=zlib_deflate.deflate(strm,flush);break;case exports.UNZIP:case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:var status=zlib_inflate.inflate(strm,flush);break;default:throw new Error("Unknown mode "+this.mode)}return status!==exports.Z_STREAM_END&&status!==exports.Z_OK&&this._error(status),this.write_in_progress=!1,[strm.avail_in,strm.avail_out]},Zlib.prototype.close=function(){if(this.write_in_progress)return void(this.pending_close=!0);this.pending_close=!1,this.mode===exports.DEFLATE||this.mode===exports.GZIP||this.mode===exports.DEFLATERAW?zlib_deflate.deflateEnd(this.strm):zlib_inflate.inflateEnd(this.strm),this.mode=exports.NONE},Zlib.prototype.reset=function(){switch(this.mode){case exports.DEFLATE:case exports.DEFLATERAW:var status=zlib_deflate.deflateReset(this.strm);break;case exports.INFLATE:case exports.INFLATERAW:var status=zlib_inflate.inflateReset(this.strm)}status!==exports.Z_OK&&this._error(status)},Zlib.prototype._error=function(status){this.onerror(msg[status]+": "+this.strm.msg,status),this.write_in_progress=!1,this.pending_close&&this.close()},exports.Zlib=Zlib}).call(this,require("_process"),require("buffer").Buffer)},{_process:105,buffer:108,"pako/lib/zlib/constants":249,"pako/lib/zlib/deflate.js":251,"pako/lib/zlib/inflate.js":253,"pako/lib/zlib/messages":255,"pako/lib/zlib/zstream":257}],103:[function(require,module,exports){(function(process,Buffer){function zlibBuffer(engine,buffer,callback){function flow(){for(var chunk;null!==(chunk=engine.read());)buffers.push(chunk),nread+=chunk.length;engine.once("readable",flow)}function onError(err){engine.removeListener("end",onEnd),engine.removeListener("readable",flow),callback(err)}function onEnd(){var buf=Buffer.concat(buffers,nread);buffers=[],callback(null,buf),engine.close()}var buffers=[],nread=0;engine.on("error",onError),engine.on("end",onEnd),engine.end(buffer),flow()}function zlibBufferSync(engine,buffer){if("string"==typeof buffer&&(buffer=new Buffer(buffer)),!Buffer.isBuffer(buffer))throw new TypeError("Not a string or buffer");var flushFlag=binding.Z_FINISH;return engine._processChunk(buffer,flushFlag)}function Deflate(opts){if(!(this instanceof Deflate))return new Deflate(opts);Zlib.call(this,opts,binding.DEFLATE)}function Inflate(opts){if(!(this instanceof Inflate))return new Inflate(opts);Zlib.call(this,opts,binding.INFLATE)}function Gzip(opts){if(!(this instanceof Gzip))return new Gzip(opts);Zlib.call(this,opts,binding.GZIP)}function Gunzip(opts){if(!(this instanceof Gunzip))return new Gunzip(opts);Zlib.call(this,opts,binding.GUNZIP)}function DeflateRaw(opts){if(!(this instanceof DeflateRaw))return new DeflateRaw(opts);Zlib.call(this,opts,binding.DEFLATERAW)}function InflateRaw(opts){if(!(this instanceof InflateRaw))return new InflateRaw(opts);Zlib.call(this,opts,binding.INFLATERAW)}function Unzip(opts){if(!(this instanceof Unzip))return new Unzip(opts);Zlib.call(this,opts,binding.UNZIP)}function Zlib(opts,mode){if(this._opts=opts=opts||{},this._chunkSize=opts.chunkSize||exports.Z_DEFAULT_CHUNK,Transform.call(this,opts),opts.flush&&opts.flush!==binding.Z_NO_FLUSH&&opts.flush!==binding.Z_PARTIAL_FLUSH&&opts.flush!==binding.Z_SYNC_FLUSH&&opts.flush!==binding.Z_FULL_FLUSH&&opts.flush!==binding.Z_FINISH&&opts.flush!==binding.Z_BLOCK)throw new Error("Invalid flush flag: "+opts.flush);if(this._flushFlag=opts.flush||binding.Z_NO_FLUSH,opts.chunkSize&&(opts.chunkSize<exports.Z_MIN_CHUNK||opts.chunkSize>exports.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+opts.chunkSize);if(opts.windowBits&&(opts.windowBits<exports.Z_MIN_WINDOWBITS||opts.windowBits>exports.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+opts.windowBits);if(opts.level&&(opts.level<exports.Z_MIN_LEVEL||opts.level>exports.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+opts.level);if(opts.memLevel&&(opts.memLevel<exports.Z_MIN_MEMLEVEL||opts.memLevel>exports.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+opts.memLevel);if(opts.strategy&&opts.strategy!=exports.Z_FILTERED&&opts.strategy!=exports.Z_HUFFMAN_ONLY&&opts.strategy!=exports.Z_RLE&&opts.strategy!=exports.Z_FIXED&&opts.strategy!=exports.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+opts.strategy);if(opts.dictionary&&!Buffer.isBuffer(opts.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new binding.Zlib(mode);var self=this;this._hadError=!1,this._binding.onerror=function(message,errno){self._binding=null,self._hadError=!0;var error=new Error(message);error.errno=errno,error.code=exports.codes[errno],self.emit("error",error)};var level=exports.Z_DEFAULT_COMPRESSION;"number"==typeof opts.level&&(level=opts.level);var strategy=exports.Z_DEFAULT_STRATEGY;"number"==typeof opts.strategy&&(strategy=opts.strategy),this._binding.init(opts.windowBits||exports.Z_DEFAULT_WINDOWBITS,level,opts.memLevel||exports.Z_DEFAULT_MEMLEVEL,strategy,opts.dictionary),this._buffer=new Buffer(this._chunkSize),this._offset=0,this._closed=!1,this._level=level,this._strategy=strategy,this.once("end",this.close)}var Transform=require("_stream_transform"),binding=require("./binding"),util=require("util"),assert=require("assert").ok;binding.Z_MIN_WINDOWBITS=8,binding.Z_MAX_WINDOWBITS=15,binding.Z_DEFAULT_WINDOWBITS=15,binding.Z_MIN_CHUNK=64,binding.Z_MAX_CHUNK=1/0,binding.Z_DEFAULT_CHUNK=16384,binding.Z_MIN_MEMLEVEL=1,binding.Z_MAX_MEMLEVEL=9,binding.Z_DEFAULT_MEMLEVEL=8,binding.Z_MIN_LEVEL=-1,binding.Z_MAX_LEVEL=9,binding.Z_DEFAULT_LEVEL=binding.Z_DEFAULT_COMPRESSION,Object.keys(binding).forEach(function(k){k.match(/^Z/)&&(exports[k]=binding[k])}),exports.codes={Z_OK:binding.Z_OK,Z_STREAM_END:binding.Z_STREAM_END,Z_NEED_DICT:binding.Z_NEED_DICT,Z_ERRNO:binding.Z_ERRNO,Z_STREAM_ERROR:binding.Z_STREAM_ERROR,Z_DATA_ERROR:binding.Z_DATA_ERROR,Z_MEM_ERROR:binding.Z_MEM_ERROR,Z_BUF_ERROR:binding.Z_BUF_ERROR,Z_VERSION_ERROR:binding.Z_VERSION_ERROR},Object.keys(exports.codes).forEach(function(k){exports.codes[exports.codes[k]]=k}),exports.Deflate=Deflate,exports.Inflate=Inflate,exports.Gzip=Gzip,exports.Gunzip=Gunzip,exports.DeflateRaw=DeflateRaw,exports.InflateRaw=InflateRaw,exports.Unzip=Unzip,exports.createDeflate=function(o){return new Deflate(o)},exports.createInflate=function(o){return new Inflate(o)},exports.createDeflateRaw=function(o){return new DeflateRaw(o)},exports.createInflateRaw=function(o){return new InflateRaw(o)},exports.createGzip=function(o){return new Gzip(o)},exports.createGunzip=function(o){return new Gunzip(o)},exports.createUnzip=function(o){return new Unzip(o)},exports.deflate=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new Deflate(opts),buffer,callback)},exports.deflateSync=function(buffer,opts){return zlibBufferSync(new Deflate(opts),buffer)},exports.gzip=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new Gzip(opts),buffer,callback)},exports.gzipSync=function(buffer,opts){return zlibBufferSync(new Gzip(opts),buffer)},exports.deflateRaw=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new DeflateRaw(opts),buffer,callback)},exports.deflateRawSync=function(buffer,opts){return zlibBufferSync(new DeflateRaw(opts),buffer)},exports.unzip=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new Unzip(opts),buffer,callback)},exports.unzipSync=function(buffer,opts){return zlibBufferSync(new Unzip(opts),buffer)},exports.inflate=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new Inflate(opts),buffer,callback)},exports.inflateSync=function(buffer,opts){return zlibBufferSync(new Inflate(opts),buffer)},exports.gunzip=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new Gunzip(opts),buffer,callback)},exports.gunzipSync=function(buffer,opts){return zlibBufferSync(new Gunzip(opts),buffer)},exports.inflateRaw=function(buffer,opts,callback){return"function"==typeof opts&&(callback=opts,opts={}),zlibBuffer(new InflateRaw(opts),buffer,callback)},exports.inflateRawSync=function(buffer,opts){return zlibBufferSync(new InflateRaw(opts),buffer)},util.inherits(Zlib,Transform),Zlib.prototype.params=function(level,strategy,callback){if(level<exports.Z_MIN_LEVEL||level>exports.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+level);if(strategy!=exports.Z_FILTERED&&strategy!=exports.Z_HUFFMAN_ONLY&&strategy!=exports.Z_RLE&&strategy!=exports.Z_FIXED&&strategy!=exports.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+strategy);if(this._level!==level||this._strategy!==strategy){var self=this;this.flush(binding.Z_SYNC_FLUSH,function(){self._binding.params(level,strategy),self._hadError||(self._level=level,self._strategy=strategy,callback&&callback())})}else process.nextTick(callback)},Zlib.prototype.reset=function(){return this._binding.reset()},Zlib.prototype._flush=function(callback){this._transform(new Buffer(0),"",callback)},Zlib.prototype.flush=function(kind,callback){var ws=this._writableState;if(("function"==typeof kind||void 0===kind&&!callback)&&(callback=kind,kind=binding.Z_FULL_FLUSH),ws.ended)callback&&process.nextTick(callback);else if(ws.ending)callback&&this.once("end",callback);else if(ws.needDrain){var self=this;this.once("drain",function(){self.flush(callback)})}else this._flushFlag=kind,this.write(new Buffer(0),"",callback)},Zlib.prototype.close=function(callback){if(callback&&process.nextTick(callback),!this._closed){this._closed=!0,this._binding.close();var self=this;process.nextTick(function(){self.emit("close")})}},Zlib.prototype._transform=function(chunk,encoding,cb){var flushFlag,ws=this._writableState,ending=ws.ending||ws.ended,last=ending&&(!chunk||ws.length===chunk.length);if(null===!chunk&&!Buffer.isBuffer(chunk))return cb(new Error("invalid input"));last?flushFlag=binding.Z_FINISH:(flushFlag=this._flushFlag,chunk.length>=ws.length&&(this._flushFlag=this._opts.flush||binding.Z_NO_FLUSH));this._processChunk(chunk,flushFlag,cb)},Zlib.prototype._processChunk=function(chunk,flushFlag,cb){function callback(availInAfter,availOutAfter){if(!self._hadError){var have=availOutBefore-availOutAfter;if(assert(have>=0,"have should not go down"),have>0){var out=self._buffer.slice(self._offset,self._offset+have);self._offset+=have,async?self.push(out):(buffers.push(out),nread+=out.length)}if((0===availOutAfter||self._offset>=self._chunkSize)&&(availOutBefore=self._chunkSize,self._offset=0,self._buffer=new Buffer(self._chunkSize)),0===availOutAfter){if(inOff+=availInBefore-availInAfter,availInBefore=availInAfter,!async)return!0;var newReq=self._binding.write(flushFlag,chunk,inOff,availInBefore,self._buffer,self._offset,self._chunkSize);return newReq.callback=callback,void(newReq.buffer=chunk)}if(!async)return!1;cb()}}var availInBefore=chunk&&chunk.length,availOutBefore=this._chunkSize-this._offset,inOff=0,self=this,async="function"==typeof cb;if(!async){var error,buffers=[],nread=0;this.on("error",function(er){error=er});do{var res=this._binding.writeSync(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore)}while(!this._hadError&&callback(res[0],res[1]));if(this._hadError)throw error;var buf=Buffer.concat(buffers,nread);return this.close(),buf}var req=this._binding.write(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore);req.buffer=chunk,req.callback=callback},util.inherits(Deflate,Zlib),util.inherits(Inflate,Zlib),util.inherits(Gzip,Zlib),util.inherits(Gunzip,Zlib),util.inherits(DeflateRaw,Zlib),util.inherits(InflateRaw,Zlib),util.inherits(Unzip,Zlib)}).call(this,require("_process"),require("buffer").Buffer)},{"./binding":102,_process:105,_stream_transform:326,assert:64,buffer:108,util:400}],104:[function(require,module,exports){arguments[4][76][0].apply(exports,arguments)},{dup:76}],105:[function(require,module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var cachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],106:[function(require,module,exports){var Buffer=require("buffer").Buffer;module.exports=function(a,b){if(Buffer.isBuffer(a)&&Buffer.isBuffer(b)){if("function"==typeof a.equals)return a.equals(b);if(a.length!==b.length)return!1;for(var i=0;i<a.length;i++)if(a[i]!==b[i])return!1;return!0}}},{buffer:108}],107:[function(require,module,exports){(function(Buffer){module.exports=function(a,b){for(var length=Math.min(a.length,b.length),buffer=new Buffer(length),i=0;i<length;++i)buffer[i]=a[i]^b[i];return buffer}}).call(this,require("buffer").Buffer)},{buffer:108}],108:[function(require,module,exports){function typedArraySupport(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()}catch(e){return!1}}function createBuffer(length){if(length>K_MAX_LENGTH)throw new RangeError("Invalid typed array length");var buf=new Uint8Array(length);return buf.__proto__=Buffer.prototype,buf}function Buffer(arg,encodingOrOffset,length){if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}function from(value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError('"value" argument must not be a number');return isArrayBuffer(value)?fromArrayBuffer(value,encodingOrOffset,length):"string"==typeof value?fromString(value,encodingOrOffset):fromObject(value)}function assertSize(size){if("number"!=typeof size)throw new TypeError('"size" argument must be a number');if(size<0)throw new RangeError('"size" argument must not be negative')}function alloc(size,fill,encoding){return assertSize(size),size<=0?createBuffer(size):void 0!==fill?"string"==typeof encoding?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill):createBuffer(size)}function allocUnsafe(size){return assertSize(size),createBuffer(size<0?0:0|checked(size))}function fromString(string,encoding){if("string"==typeof encoding&&""!==encoding||(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');var length=0|byteLength(string,encoding),buf=createBuffer(length),actual=buf.write(string,encoding);return actual!==length&&(buf=buf.slice(0,actual)),buf}function fromArrayLike(array){for(var length=array.length<0?0:0|checked(array.length),buf=createBuffer(length),i=0;i<length;i+=1)buf[i]=255&array[i];return buf}function fromArrayBuffer(array,byteOffset,length){if(byteOffset<0||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");var buf;return buf=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length),buf.__proto__=Buffer.prototype,buf}function fromObject(obj){if(Buffer.isBuffer(obj)){var len=0|checked(obj.length),buf=createBuffer(len);return 0===buf.length?buf:(obj.copy(buf,0,0,len),buf)}if(obj){if(isArrayBufferView(obj)||"length"in obj)return"number"!=typeof obj.length||numberIsNaN(obj.length)?createBuffer(0):fromArrayLike(obj);if("Buffer"===obj.type&&Array.isArray(obj.data))return fromArrayLike(obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if(isArrayBufferView(string)||isArrayBuffer(string))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,numberIsNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)===read(val,-1===foundIndex?0:i-foundIndex)){if(-1===foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else-1!==foundIndex&&(i-=i-foundIndex),foundIndex=-1}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length))>remaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i<length;++i){var parsed=parseInt(string.substr(2*i,2),16);if(numberIsNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i<end;){var firstByte=buf[i],codePoint=null,bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;i<len;)res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||start<0)&&(start=0),(!end||end<0||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=String.fromCharCode(bytes[i]+256*bytes[i+1]);return res}function checkOffset(offset,ext,length){if(offset%1!=0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return value=+value,offset>>>=0,noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return value=+value,offset>>>=0,noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=str.trim().replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i<length;++i){if((codePoint=string.charCodeAt(i))>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}function utf16leToBytes(str,units){for(var c,hi,lo,byteArray=[],i=0;i<str.length&&!((units-=2)<0);++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isArrayBuffer(obj){return obj instanceof ArrayBuffer||null!=obj&&null!=obj.constructor&&"ArrayBuffer"===obj.constructor.name&&"number"==typeof obj.byteLength}function isArrayBufferView(obj){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(obj)}function numberIsNaN(obj){return obj!==obj}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)},Buffer.isBuffer=function(b){return null!=b&&!0===b._isBuffer},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(list,length){if(!Array.isArray(list))throw new TypeError('"list" argument must be an Array of Buffers');if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var len=this.length;if(len%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function(){var len=this.length;if(len%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function(){var len=this.length;if(len%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function(){var length=this.length;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0},Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)},Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else{if(!isFinite(offset))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");offset>>>=0,isFinite(length)?(length>>>=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0)}var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end<start&&(end=start);var newBuf=this.subarray(start,end);return newBuf.__proto__=Buffer.prototype,newBuf},Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;byteLength>0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset>>>=0,byteLength>>>=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){offset>>>=0,noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){offset>>>=0,noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return offset>>>=0,noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,byteLength>>>=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,byteLength>>>=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var i=byteLength-1,mul=1;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,255,0),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),this[offset]=255&value,this[offset+1]=value>>>8,offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),this[offset]=value>>>8,this[offset+1]=255&value,offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value,offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value,offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset>>>=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,127,-128),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),this[offset]=255&value,this[offset+1]=value>>>8,offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),this[offset]=value>>>8,this[offset+1]=255&value,offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24,offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value,offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(targetStart<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var i,len=end-start;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;i>=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);code<256&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(start<0||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=Buffer.isBuffer(val)?val:new Buffer(val,encoding),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g},{"base64-js":68,ieee754:213}],109:[function(require,module,exports){module.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],110:[function(require,module,exports){function Caseless(dict){this.dict=dict||{}}Caseless.prototype.set=function(name,value,clobber){if("object"!==(void 0===name?"undefined":_typeof(name))){void 0===clobber&&(clobber=!0);var has=this.has(name);return!clobber&&has?this.dict[has]=this.dict[has]+","+value:this.dict[has||name]=value,has}for(var i in name)this.set(i,name[i],value)},Caseless.prototype.has=function(name){for(var keys=Object.keys(this.dict),name=name.toLowerCase(),i=0;i<keys.length;i++)if(keys[i].toLowerCase()===name)return keys[i];return!1},Caseless.prototype.get=function(name){name=name.toLowerCase();var result,_key,headers=this.dict;return Object.keys(headers).forEach(function(key){_key=key.toLowerCase(),name===_key&&(result=headers[key])}),result},Caseless.prototype.swap=function(name){var has=this.has(name);if(has!==name){if(!has)throw new Error('There is no header than matches "'+name+'"');this.dict[name]=this.dict[has],delete this.dict[has]}},Caseless.prototype.del=function(name){var has=this.has(name);return delete this.dict[has||name]},module.exports=function(dict){return new Caseless(dict)},module.exports.httpify=function(resp,headers){var c=new Caseless(headers);return resp.setHeader=function(key,value,clobber){if(void 0!==value)return c.set(key,value,clobber)},resp.hasHeader=function(key){return c.has(key)},resp.getHeader=function(key){return c.get(key)},resp.removeHeader=function(key){return c.del(key)},resp.headers=c.dict,c}},{}],111:[function(require,module,exports){function CipherBase(hashMode){Transform.call(this),this.hashMode="string"==typeof hashMode,this.hashMode?this[hashMode]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=require("safe-buffer").Buffer,Transform=require("stream").Transform,StringDecoder=require("string_decoder").StringDecoder;require("inherits")(CipherBase,Transform),CipherBase.prototype.update=function(data,inputEnc,outputEnc){"string"==typeof data&&(data=Buffer.from(data,inputEnc));var outData=this._update(data);return this.hashMode?this:(outputEnc&&(outData=this._toString(outData,outputEnc)),outData)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(data,_,next){var err;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){err=e}finally{next(err)}},CipherBase.prototype._flush=function(done){var err;try{this.push(this.__final())}catch(e){err=e}done(err)},CipherBase.prototype._finalOrDigest=function(outputEnc){var outData=this.__final()||Buffer.alloc(0);return outputEnc&&(outData=this._toString(outData,outputEnc,!0)),outData},CipherBase.prototype._toString=function(value,enc,fin){if(this._decoder||(this._decoder=new StringDecoder(enc),this._encoding=enc),this._encoding!==enc)throw new Error("can't switch encodings");var out=this._decoder.write(value);return fin&&(out+=this._decoder.end()),out},module.exports=CipherBase},{inherits:215,"safe-buffer":341,stream:374,string_decoder:381}],112:[function(require,module,exports){function co(gen){var ctx=this,args=slice.call(arguments,1);return new Promise(function(resolve,reject){function onFulfilled(res){var ret;try{ret=gen.next(res)}catch(e){return reject(e)}next(ret)}function onRejected(err){var ret;try{ret=gen.throw(err)}catch(e){return reject(e)}next(ret)}function next(ret){if(ret.done)return resolve(ret.value);var value=toPromise.call(ctx,ret.value);return value&&isPromise(value)?value.then(onFulfilled,onRejected):onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(ret.value)+'"'))}if("function"==typeof gen&&(gen=gen.apply(ctx,args)),!gen||"function"!=typeof gen.next)return resolve(gen);onFulfilled()})}function toPromise(obj){return obj?isPromise(obj)?obj:isGeneratorFunction(obj)||isGenerator(obj)?co.call(this,obj):"function"==typeof obj?thunkToPromise.call(this,obj):Array.isArray(obj)?arrayToPromise.call(this,obj):isObject(obj)?objectToPromise.call(this,obj):obj:obj}function thunkToPromise(fn){var ctx=this;return new Promise(function(resolve,reject){fn.call(ctx,function(err,res){if(err)return reject(err);arguments.length>2&&(res=slice.call(arguments,1)),resolve(res)})})}function arrayToPromise(obj){return Promise.all(obj.map(toPromise,this))}function objectToPromise(obj){function defer(promise,key){results[key]=void 0,promises.push(promise.then(function(res){results[key]=res}))}for(var results=new obj.constructor,keys=Object.keys(obj),promises=[],i=0;i<keys.length;i++){var key=keys[i],promise=toPromise.call(this,obj[key]);promise&&isPromise(promise)?defer(promise,key):results[key]=obj[key]}return Promise.all(promises).then(function(){return results})}function isPromise(obj){return"function"==typeof obj.then}function isGenerator(obj){return"function"==typeof obj.next&&"function"==typeof obj.throw}function isGeneratorFunction(obj){var constructor=obj.constructor;return!!constructor&&("GeneratorFunction"===constructor.name||"GeneratorFunction"===constructor.displayName||isGenerator(constructor.prototype))}function isObject(val){return Object==val.constructor}var slice=Array.prototype.slice;module.exports=co.default=co.co=co,co.wrap=function(fn){function createPromise(){return co.call(this,fn.apply(this,arguments))}return createPromise.__generatorFunction__=fn,createPromise}},{}],113:[function(require,module,exports){(function(Buffer){function CombinedStream(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null}var util=require("util"),Stream=require("stream").Stream,DelayedStream=require("delayed-stream");module.exports=CombinedStream,util.inherits(CombinedStream,Stream),CombinedStream.create=function(options){var combinedStream=new this;options=options||{};for(var option in options)combinedStream[option]=options[option];return combinedStream},CombinedStream.isStreamLike=function(stream){return"function"!=typeof stream&&"string"!=typeof stream&&"boolean"!=typeof stream&&"number"!=typeof stream&&!Buffer.isBuffer(stream)},CombinedStream.prototype.append=function(stream){if(CombinedStream.isStreamLike(stream)){if(!(stream instanceof DelayedStream)){var newStream=DelayedStream.create(stream,{maxDataSize:1/0,pauseStream:this.pauseStreams});stream.on("data",this._checkDataSize.bind(this)),stream=newStream}this._handleErrors(stream),this.pauseStreams&&stream.pause()}return this._streams.push(stream),this},CombinedStream.prototype.pipe=function(dest,options){return Stream.prototype.pipe.call(this,dest,options),this.resume(),dest},CombinedStream.prototype._getNext=function(){this._currentStream=null;var stream=this._streams.shift();return void 0===stream?void this.end():"function"!=typeof stream?void this._pipeNext(stream):void stream(function(stream){CombinedStream.isStreamLike(stream)&&(stream.on("data",this._checkDataSize.bind(this)),this._handleErrors(stream)),this._pipeNext(stream)}.bind(this))},CombinedStream.prototype._pipeNext=function(stream){if(this._currentStream=stream,CombinedStream.isStreamLike(stream))return stream.on("end",this._getNext.bind(this)),void stream.pipe(this,{end:!1});var value=stream;this.write(value),this._getNext()},CombinedStream.prototype._handleErrors=function(stream){var self=this;stream.on("error",function(err){self._emitError(err)})},CombinedStream.prototype.write=function(data){this.emit("data",data)},CombinedStream.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},CombinedStream.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},CombinedStream.prototype.end=function(){this._reset(),this.emit("end")},CombinedStream.prototype.destroy=function(){this._reset(),this.emit("close")},CombinedStream.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},CombinedStream.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var message="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(message))}},CombinedStream.prototype._updateDataSize=function(){this.dataSize=0;var self=this;this._streams.forEach(function(stream){stream.dataSize&&(self.dataSize+=stream.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},CombinedStream.prototype._emitError=function(err){this._reset(),this.emit("error",err)}}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":216,"delayed-stream":122,stream:374,util:400}],114:[function(require,module,exports){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"===(void 0===arg?"undefined":_typeof(arg))}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"===(void 0===arg?"undefined":_typeof(arg))&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"===(void 0===arg?"undefined":_typeof(arg))||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":216}],115:[function(require,module,exports){(function(Buffer){function ECDH(curve){this.curveType=aliases[curve],this.curveType||(this.curveType={name:curve}),this.curve=new elliptic.ec(this.curveType.name),this.keys=void 0}function formatReturnValue(bn,enc,len){Array.isArray(bn)||(bn=bn.toArray());var buf=new Buffer(bn);if(len&&buf.length<len){var zeros=new Buffer(len-buf.length);zeros.fill(0),buf=Buffer.concat([zeros,buf])}return enc?buf.toString(enc):buf}var elliptic=require("elliptic"),BN=require("bn.js");module.exports=function(curve){return new ECDH(curve)};var aliases={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};aliases.p224=aliases.secp224r1,aliases.p256=aliases.secp256r1=aliases.prime256v1,aliases.p192=aliases.secp192r1=aliases.prime192v1,aliases.p384=aliases.secp384r1,aliases.p521=aliases.secp521r1,ECDH.prototype.generateKeys=function(enc,format){return this.keys=this.curve.genKeyPair(),this.getPublicKey(enc,format)},ECDH.prototype.computeSecret=function(other,inenc,enc){return inenc=inenc||"utf8",Buffer.isBuffer(other)||(other=new Buffer(other,inenc)),formatReturnValue(this.curve.keyFromPublic(other).getPublic().mul(this.keys.getPrivate()).getX(),enc,this.curveType.byteLength)},ECDH.prototype.getPublicKey=function(enc,format){var key=this.keys.getPublic("compressed"===format,!0);return"hybrid"===format&&(key[key.length-1]%2?key[0]=7:key[0]=6),formatReturnValue(key,enc)},ECDH.prototype.getPrivateKey=function(enc){return formatReturnValue(this.keys.getPrivate(),enc)},ECDH.prototype.setPublicKey=function(pub,enc){return enc=enc||"utf8",Buffer.isBuffer(pub)||(pub=new Buffer(pub,enc)),this.keys._importPublic(pub),this},ECDH.prototype.setPrivateKey=function(priv,enc){enc=enc||"utf8",Buffer.isBuffer(priv)||(priv=new Buffer(priv,enc));var _priv=new BN(priv);return _priv=_priv.toString(16),this.keys._importPrivate(_priv),this}}).call(this,require("buffer").Buffer)},{"bn.js":74,buffer:108,elliptic:136}],116:[function(require,module,exports){(function(Buffer){function HashNoConstructor(hash){Base.call(this,"digest"),this._hash=hash,this.buffers=[]}function Hash(hash){Base.call(this,"digest"),this._hash=hash}var inherits=require("inherits"),md5=require("./md5"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),Base=require("cipher-base");inherits(HashNoConstructor,Base),HashNoConstructor.prototype._update=function(data){this.buffers.push(data)},HashNoConstructor.prototype._final=function(){var buf=Buffer.concat(this.buffers),r=this._hash(buf);return this.buffers=null,r},inherits(Hash,Base),Hash.prototype._update=function(data){this._hash.update(data)},Hash.prototype._final=function(){return this._hash.digest()},module.exports=function(alg){return alg=alg.toLowerCase(),"md5"===alg?new HashNoConstructor(md5):new Hash("rmd160"===alg||"ripemd160"===alg?new RIPEMD160:sha(alg))}}).call(this,require("buffer").Buffer)},{"./md5":118,buffer:108,"cipher-base":111,inherits:215,ripemd160:340,"sha.js":343}],117:[function(require,module,exports){(function(Buffer){function toArray(buf){if(buf.length%intSize!=0){var len=buf.length+(intSize-buf.length%intSize);buf=Buffer.concat([buf,zeroBuffer],len)}for(var arr=new Array(buf.length>>>2),i=0,j=0;i<buf.length;i+=intSize,j++)arr[j]=buf.readInt32LE(i);return arr}var intSize=4,zeroBuffer=new Buffer(intSize);zeroBuffer.fill(0),module.exports=function(buf,fn){var arr=fn(toArray(buf),8*buf.length);buf=new Buffer(16);for(var i=0;i<arr.length;i++)buf.writeInt32LE(arr[i],i<<2,!0);return buf}}).call(this,require("buffer").Buffer)},{buffer:108}],118:[function(require,module,exports){function core_md5(x,len){x[len>>5]|=128<<len%32,x[14+(len+64>>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i<x.length;i+=16){var olda=a,oldb=b,oldc=c,oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936),d=md5_ff(d,a,b,c,x[i+1],12,-389564586),c=md5_ff(c,d,a,b,x[i+2],17,606105819),b=md5_ff(b,c,d,a,x[i+3],22,-1044525330),a=md5_ff(a,b,c,d,x[i+4],7,-176418897),d=md5_ff(d,a,b,c,x[i+5],12,1200080426),c=md5_ff(c,d,a,b,x[i+6],17,-1473231341),b=md5_ff(b,c,d,a,x[i+7],22,-45705983),a=md5_ff(a,b,c,d,x[i+8],7,1770035416),d=md5_ff(d,a,b,c,x[i+9],12,-1958414417),c=md5_ff(c,d,a,b,x[i+10],17,-42063),b=md5_ff(b,c,d,a,x[i+11],22,-1990404162),a=md5_ff(a,b,c,d,x[i+12],7,1804603682),d=md5_ff(d,a,b,c,x[i+13],12,-40341101),c=md5_ff(c,d,a,b,x[i+14],17,-1502002290),b=md5_ff(b,c,d,a,x[i+15],22,1236535329),a=md5_gg(a,b,c,d,x[i+1],5,-165796510),d=md5_gg(d,a,b,c,x[i+6],9,-1069501632),c=md5_gg(c,d,a,b,x[i+11],14,643717713),b=md5_gg(b,c,d,a,x[i+0],20,-373897302),a=md5_gg(a,b,c,d,x[i+5],5,-701558691),d=md5_gg(d,a,b,c,x[i+10],9,38016083),c=md5_gg(c,d,a,b,x[i+15],14,-660478335),b=md5_gg(b,c,d,a,x[i+4],20,-405537848),a=md5_gg(a,b,c,d,x[i+9],5,568446438),d=md5_gg(d,a,b,c,x[i+14],9,-1019803690),c=md5_gg(c,d,a,b,x[i+3],14,-187363961),b=md5_gg(b,c,d,a,x[i+8],20,1163531501),a=md5_gg(a,b,c,d,x[i+13],5,-1444681467),d=md5_gg(d,a,b,c,x[i+2],9,-51403784),c=md5_gg(c,d,a,b,x[i+7],14,1735328473),b=md5_gg(b,c,d,a,x[i+12],20,-1926607734),a=md5_hh(a,b,c,d,x[i+5],4,-378558),d=md5_hh(d,a,b,c,x[i+8],11,-2022574463),c=md5_hh(c,d,a,b,x[i+11],16,1839030562),b=md5_hh(b,c,d,a,x[i+14],23,-35309556),a=md5_hh(a,b,c,d,x[i+1],4,-1530992060),d=md5_hh(d,a,b,c,x[i+4],11,1272893353),c=md5_hh(c,d,a,b,x[i+7],16,-155497632),b=md5_hh(b,c,d,a,x[i+10],23,-1094730640),a=md5_hh(a,b,c,d,x[i+13],4,681279174),d=md5_hh(d,a,b,c,x[i+0],11,-358537222),c=md5_hh(c,d,a,b,x[i+3],16,-722521979),b=md5_hh(b,c,d,a,x[i+6],23,76029189),a=md5_hh(a,b,c,d,x[i+9],4,-640364487),d=md5_hh(d,a,b,c,x[i+12],11,-421815835),c=md5_hh(c,d,a,b,x[i+15],16,530742520),b=md5_hh(b,c,d,a,x[i+2],23,-995338651),a=md5_ii(a,b,c,d,x[i+0],6,-198630844),d=md5_ii(d,a,b,c,x[i+7],10,1126891415),c=md5_ii(c,d,a,b,x[i+14],15,-1416354905),b=md5_ii(b,c,d,a,x[i+5],21,-57434055),a=md5_ii(a,b,c,d,x[i+12],6,1700485571),d=md5_ii(d,a,b,c,x[i+3],10,-1894986606),c=md5_ii(c,d,a,b,x[i+10],15,-1051523),b=md5_ii(b,c,d,a,x[i+1],21,-2054922799),a=md5_ii(a,b,c,d,x[i+8],6,1873313359),d=md5_ii(d,a,b,c,x[i+15],10,-30611744),c=md5_ii(c,d,a,b,x[i+6],15,-1560198380),b=md5_ii(b,c,d,a,x[i+13],21,1309151649),a=md5_ii(a,b,c,d,x[i+4],6,-145523070),d=md5_ii(d,a,b,c,x[i+11],10,-1120210379),c=md5_ii(c,d,a,b,x[i+2],15,718787259),b=md5_ii(b,c,d,a,x[i+9],21,-343485551),a=safe_add(a,olda),b=safe_add(b,oldb),c=safe_add(c,oldc),d=safe_add(d,oldd)}return[a,b,c,d]}function md5_cmn(q,a,b,x,s,t){return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)}function md5_ff(a,b,c,d,x,s,t){return md5_cmn(b&c|~b&d,a,b,x,s,t)}function md5_gg(a,b,c,d,x,s,t){return md5_cmn(b&d|c&~d,a,b,x,s,t)}function md5_hh(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t)}function md5_ii(a,b,c,d,x,s,t){return md5_cmn(c^(b|~d),a,b,x,s,t)}function safe_add(x,y){var lsw=(65535&x)+(65535&y);return(x>>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<<cnt|num>>>32-cnt}var makeHash=require("./make-hash");module.exports=function(buf){return makeHash(buf,core_md5)}},{"./make-hash":117}],119:[function(require,module,exports){function Hmac(alg,key){Base.call(this,"digest"),"string"==typeof key&&(key=Buffer.from(key));var blocksize="sha512"===alg||"sha384"===alg?128:64;if(this._alg=alg,this._key=key,key.length>blocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.length<blocksize&&(key=Buffer.concat([key,ZEROS],blocksize));for(var ipad=this._ipad=Buffer.allocUnsafe(blocksize),opad=this._opad=Buffer.allocUnsafe(blocksize),i=0;i<blocksize;i++)ipad[i]=54^key[i],opad[i]=92^key[i];this._hash="rmd160"===alg?new RIPEMD160:sha(alg),this._hash.update(ipad)}var inherits=require("inherits"),Legacy=require("./legacy"),Base=require("cipher-base"),Buffer=require("safe-buffer").Buffer,md5=require("create-hash/md5"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),ZEROS=Buffer.alloc(128);inherits(Hmac,Base),Hmac.prototype._update=function(data){this._hash.update(data)},Hmac.prototype._final=function(){var h=this._hash.digest();return("rmd160"===this._alg?new RIPEMD160:sha(this._alg)).update(this._opad).update(h).digest()},module.exports=function(alg,key){return alg=alg.toLowerCase(),"rmd160"===alg||"ripemd160"===alg?new Hmac("rmd160",key):"md5"===alg?new Legacy(md5,key):new Hmac(alg,key)}},{"./legacy":120,"cipher-base":111,"create-hash/md5":118,inherits:215,ripemd160:340,"safe-buffer":341,"sha.js":343}],120:[function(require,module,exports){function Hmac(alg,key){Base.call(this,"digest"),"string"==typeof key&&(key=Buffer.from(key)),this._alg=alg,this._key=key,key.length>blocksize?key=alg(key):key.length<blocksize&&(key=Buffer.concat([key,ZEROS],blocksize));for(var ipad=this._ipad=Buffer.allocUnsafe(blocksize),opad=this._opad=Buffer.allocUnsafe(blocksize),i=0;i<blocksize;i++)ipad[i]=54^key[i],opad[i]=92^key[i];this._hash=[ipad]}var inherits=require("inherits"),Buffer=require("safe-buffer").Buffer,Base=require("cipher-base"),ZEROS=Buffer.alloc(128),blocksize=64;inherits(Hmac,Base),Hmac.prototype._update=function(data){this._hash.push(data)},Hmac.prototype._final=function(){var h=this._alg(Buffer.concat(this._hash));return this._alg(Buffer.concat([this._opad,h]))},module.exports=Hmac},{"cipher-base":111,inherits:215,"safe-buffer":341}],121:[function(require,module,exports){exports.randomBytes=exports.rng=exports.pseudoRandomBytes=exports.prng=require("randombytes"),exports.createHash=exports.Hash=require("create-hash"),exports.createHmac=exports.Hmac=require("create-hmac");var algos=require("browserify-sign/algos"),algoKeys=Object.keys(algos),hashes=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(algoKeys);exports.getHashes=function(){return hashes};var p=require("pbkdf2");exports.pbkdf2=p.pbkdf2,exports.pbkdf2Sync=p.pbkdf2Sync;var aes=require("browserify-cipher");exports.Cipher=aes.Cipher,exports.createCipher=aes.createCipher,exports.Cipheriv=aes.Cipheriv,exports.createCipheriv=aes.createCipheriv,exports.Decipher=aes.Decipher,exports.createDecipher=aes.createDecipher,exports.Decipheriv=aes.Decipheriv,exports.createDecipheriv=aes.createDecipheriv,exports.getCiphers=aes.getCiphers,exports.listCiphers=aes.listCiphers;var dh=require("diffie-hellman");exports.DiffieHellmanGroup=dh.DiffieHellmanGroup,exports.createDiffieHellmanGroup=dh.createDiffieHellmanGroup,exports.getDiffieHellman=dh.getDiffieHellman,exports.createDiffieHellman=dh.createDiffieHellman,exports.DiffieHellman=dh.DiffieHellman;var sign=require("browserify-sign");exports.createSign=sign.createSign,exports.Sign=sign.Sign,exports.createVerify=sign.createVerify,exports.Verify=sign.Verify,exports.createECDH=require("create-ecdh");var publicEncrypt=require("public-encrypt");exports.publicEncrypt=publicEncrypt.publicEncrypt,exports.privateEncrypt=publicEncrypt.privateEncrypt,exports.publicDecrypt=publicEncrypt.publicDecrypt,exports.privateDecrypt=publicEncrypt.privateDecrypt,exports.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},exports.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":92,"browserify-sign":99,"browserify-sign/algos":96,"create-ecdh":115,"create-hash":116,"create-hmac":119,"diffie-hellman":129,pbkdf2:269,"public-encrypt":299,randombytes:314}],122:[function(require,module,exports){function DelayedStream(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}var Stream=require("stream").Stream,util=require("util");module.exports=DelayedStream,util.inherits(DelayedStream,Stream),DelayedStream.create=function(source,options){var delayedStream=new this;options=options||{};for(var option in options)delayedStream[option]=options[option];delayedStream.source=source;var realEmit=source.emit;return source.emit=function(){return delayedStream._handleEmit(arguments),realEmit.apply(source,arguments)},source.on("error",function(){}),delayedStream.pauseStream&&source.pause(),delayedStream},Object.defineProperty(DelayedStream.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),DelayedStream.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},DelayedStream.prototype.resume=function(){this._released||this.release(),this.source.resume()},DelayedStream.prototype.pause=function(){this.source.pause()},DelayedStream.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(args){this.emit.apply(this,args)}.bind(this)),this._bufferedEvents=[]},DelayedStream.prototype.pipe=function(){var r=Stream.prototype.pipe.apply(this,arguments);return this.resume(),r},DelayedStream.prototype._handleEmit=function(args){if(this._released)return void this.emit.apply(this,args);"data"===args[0]&&(this.dataSize+=args[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(args)},DelayedStream.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var message="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(message))}}},{stream:374,util:400}],123:[function(require,module,exports){exports.utils=require("./des/utils"),exports.Cipher=require("./des/cipher"),exports.DES=require("./des/des"),exports.CBC=require("./des/cbc"),exports.EDE=require("./des/ede")},{"./des/cbc":124,"./des/cipher":125,"./des/des":126,"./des/ede":127,"./des/utils":128}],124:[function(require,module,exports){function CBCState(iv){assert.equal(iv.length,8,"Invalid IV length"),this.iv=new Array(8);for(var i=0;i<this.iv.length;i++)this.iv[i]=iv[i]}function instantiate(Base){function CBC(options){Base.call(this,options),this._cbcInit()}inherits(CBC,Base);for(var keys=Object.keys(proto),i=0;i<keys.length;i++){var key=keys[i];CBC.prototype[key]=proto[key]}return CBC.create=function(options){return new CBC(options)},CBC}var assert=require("minimalistic-assert"),inherits=require("inherits"),proto={};exports.instantiate=instantiate,proto._cbcInit=function(){var state=new CBCState(this.options.iv);this._cbcState=state},proto._update=function(inp,inOff,out,outOff){var state=this._cbcState,superProto=this.constructor.super_.prototype,iv=state.iv;if("encrypt"===this.type){for(var i=0;i<this.blockSize;i++)iv[i]^=inp[inOff+i];superProto._update.call(this,iv,0,out,outOff);for(var i=0;i<this.blockSize;i++)iv[i]=out[outOff+i]}else{superProto._update.call(this,inp,inOff,out,outOff);for(var i=0;i<this.blockSize;i++)out[outOff+i]^=iv[i];for(var i=0;i<this.blockSize;i++)iv[i]=inp[inOff+i]}}},{inherits:215,"minimalistic-assert":243}],125:[function(require,module,exports){function Cipher(options){this.options=options,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var assert=require("minimalistic-assert");module.exports=Cipher,Cipher.prototype._init=function(){},Cipher.prototype.update=function(data){return 0===data.length?[]:"decrypt"===this.type?this._updateDecrypt(data):this._updateEncrypt(data)},Cipher.prototype._buffer=function(data,off){for(var min=Math.min(this.buffer.length-this.bufferOff,data.length-off),i=0;i<min;i++)this.buffer[this.bufferOff+i]=data[off+i];return this.bufferOff+=min,min},Cipher.prototype._flushBuffer=function(out,off){return this._update(this.buffer,0,out,off),this.bufferOff=0,this.blockSize},Cipher.prototype._updateEncrypt=function(data){var inputOff=0,outputOff=0,count=(this.bufferOff+data.length)/this.blockSize|0,out=new Array(count*this.blockSize);0!==this.bufferOff&&(inputOff+=this._buffer(data,inputOff),this.bufferOff===this.buffer.length&&(outputOff+=this._flushBuffer(out,outputOff)));for(var max=data.length-(data.length-inputOff)%this.blockSize;inputOff<max;inputOff+=this.blockSize)this._update(data,inputOff,out,outputOff),outputOff+=this.blockSize;for(;inputOff<data.length;inputOff++,this.bufferOff++)this.buffer[this.bufferOff]=data[inputOff];return out},Cipher.prototype._updateDecrypt=function(data){for(var inputOff=0,outputOff=0,count=Math.ceil((this.bufferOff+data.length)/this.blockSize)-1,out=new Array(count*this.blockSize);count>0;count--)inputOff+=this._buffer(data,inputOff),outputOff+=this._flushBuffer(out,outputOff);return inputOff+=this._buffer(data,inputOff),out},Cipher.prototype.final=function(buffer){var first;buffer&&(first=this.update(buffer));var last;return last="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),first?first.concat(last):last},Cipher.prototype._pad=function(buffer,off){if(0===off)return!1;for(;off<buffer.length;)buffer[off++]=0;return!0},Cipher.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var out=new Array(this.blockSize);return this._update(this.buffer,0,out,0),out},Cipher.prototype._unpad=function(buffer){return buffer},Cipher.prototype._finalDecrypt=function(){assert.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var out=new Array(this.blockSize);return this._flushBuffer(out,0),this._unpad(out)}},{"minimalistic-assert":243}],126:[function(require,module,exports){function DESState(){this.tmp=new Array(2),this.keys=null}function DES(options){Cipher.call(this,options);var state=new DESState;this._desState=state,this.deriveKeys(state,options.key)}var assert=require("minimalistic-assert"),inherits=require("inherits"),des=require("../des"),utils=des.utils,Cipher=des.Cipher;inherits(DES,Cipher),module.exports=DES,DES.create=function(options){return new DES(options)};var shiftTable=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES.prototype.deriveKeys=function(state,key){state.keys=new Array(32),assert.equal(key.length,this.blockSize,"Invalid key length");var kL=utils.readUInt32BE(key,0),kR=utils.readUInt32BE(key,4);utils.pc1(kL,kR,state.tmp,0),kL=state.tmp[0],kR=state.tmp[1];for(var i=0;i<state.keys.length;i+=2){var shift=shiftTable[i>>>1];kL=utils.r28shl(kL,shift),kR=utils.r28shl(kR,shift),utils.pc2(kL,kR,state.keys,i)}},DES.prototype._update=function(inp,inOff,out,outOff){var state=this._desState,l=utils.readUInt32BE(inp,inOff),r=utils.readUInt32BE(inp,inOff+4);utils.ip(l,r,state.tmp,0),l=state.tmp[0],r=state.tmp[1],"encrypt"===this.type?this._encrypt(state,l,r,state.tmp,0):this._decrypt(state,l,r,state.tmp,0),l=state.tmp[0],r=state.tmp[1],utils.writeUInt32BE(out,l,outOff),utils.writeUInt32BE(out,r,outOff+4)},DES.prototype._pad=function(buffer,off){for(var value=buffer.length-off,i=off;i<buffer.length;i++)buffer[i]=value;return!0},DES.prototype._unpad=function(buffer){for(var pad=buffer[buffer.length-1],i=buffer.length-pad;i<buffer.length;i++)assert.equal(buffer[i],pad);return buffer.slice(0,buffer.length-pad)},DES.prototype._encrypt=function(state,lStart,rStart,out,off){for(var l=lStart,r=rStart,i=0;i<state.keys.length;i+=2){var keyL=state.keys[i],keyR=state.keys[i+1];utils.expand(r,state.tmp,0),keyL^=state.tmp[0],keyR^=state.tmp[1];var s=utils.substitute(keyL,keyR),f=utils.permute(s),t=r;r=(l^f)>>>0,l=t}utils.rip(r,l,out,off)},DES.prototype._decrypt=function(state,lStart,rStart,out,off){for(var l=rStart,r=lStart,i=state.keys.length-2;i>=0;i-=2){var keyL=state.keys[i],keyR=state.keys[i+1];utils.expand(l,state.tmp,0),keyL^=state.tmp[0],keyR^=state.tmp[1];var s=utils.substitute(keyL,keyR),f=utils.permute(s),t=l;l=(r^f)>>>0,r=t}utils.rip(l,r,out,off)}},{"../des":123,inherits:215,"minimalistic-assert":243}],127:[function(require,module,exports){function EDEState(type,key){assert.equal(key.length,24,"Invalid key length");var k1=key.slice(0,8),k2=key.slice(8,16),k3=key.slice(16,24);this.ciphers="encrypt"===type?[DES.create({type:"encrypt",key:k1}),DES.create({type:"decrypt",key:k2}),DES.create({type:"encrypt",key:k3})]:[DES.create({type:"decrypt",key:k3}),DES.create({type:"encrypt",key:k2}),DES.create({type:"decrypt",key:k1})]}function EDE(options){Cipher.call(this,options);var state=new EDEState(this.type,this.options.key);this._edeState=state}var assert=require("minimalistic-assert"),inherits=require("inherits"),des=require("../des"),Cipher=des.Cipher,DES=des.DES;inherits(EDE,Cipher),module.exports=EDE,EDE.create=function(options){return new EDE(options)},EDE.prototype._update=function(inp,inOff,out,outOff){var state=this._edeState;state.ciphers[0]._update(inp,inOff,out,outOff),state.ciphers[1]._update(out,outOff,out,outOff),state.ciphers[2]._update(out,outOff,out,outOff)},EDE.prototype._pad=DES.prototype._pad,EDE.prototype._unpad=DES.prototype._unpad},{"../des":123,inherits:215,"minimalistic-assert":243}],128:[function(require,module,exports){exports.readUInt32BE=function(bytes,off){return(bytes[0+off]<<24|bytes[1+off]<<16|bytes[2+off]<<8|bytes[3+off])>>>0},exports.writeUInt32BE=function(bytes,value,off){bytes[0+off]=value>>>24,bytes[1+off]=value>>>16&255,bytes[2+off]=value>>>8&255,bytes[3+off]=255&value},exports.ip=function(inL,inR,out,off){for(var outL=0,outR=0,i=6;i>=0;i-=2){for(var j=0;j<=24;j+=8)outL<<=1,outL|=inR>>>j+i&1;for(var j=0;j<=24;j+=8)outL<<=1,outL|=inL>>>j+i&1}for(var i=6;i>=0;i-=2){for(var j=1;j<=25;j+=8)outR<<=1,outR|=inR>>>j+i&1;for(var j=1;j<=25;j+=8)outR<<=1,outR|=inL>>>j+i&1}out[off+0]=outL>>>0,out[off+1]=outR>>>0},exports.rip=function(inL,inR,out,off){for(var outL=0,outR=0,i=0;i<4;i++)for(var j=24;j>=0;j-=8)outL<<=1,outL|=inR>>>j+i&1,outL<<=1,outL|=inL>>>j+i&1;for(var i=4;i<8;i++)for(var j=24;j>=0;j-=8)outR<<=1,outR|=inR>>>j+i&1,outR<<=1,outR|=inL>>>j+i&1;out[off+0]=outL>>>0,out[off+1]=outR>>>0},exports.pc1=function(inL,inR,out,off){for(var outL=0,outR=0,i=7;i>=5;i--){for(var j=0;j<=24;j+=8)outL<<=1,outL|=inR>>j+i&1;for(var j=0;j<=24;j+=8)outL<<=1,outL|=inL>>j+i&1}for(var j=0;j<=24;j+=8)outL<<=1,outL|=inR>>j+i&1;for(var i=1;i<=3;i++){for(var j=0;j<=24;j+=8)outR<<=1,outR|=inR>>j+i&1;for(var j=0;j<=24;j+=8)outR<<=1,outR|=inL>>j+i&1}for(var j=0;j<=24;j+=8)outR<<=1,outR|=inL>>j+i&1;out[off+0]=outL>>>0,out[off+1]=outR>>>0},exports.r28shl=function(num,shift){return num<<shift&268435455|num>>>28-shift};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];exports.pc2=function(inL,inR,out,off){for(var outL=0,outR=0,len=pc2table.length>>>1,i=0;i<len;i++)outL<<=1,outL|=inL>>>pc2table[i]&1;for(var i=len;i<pc2table.length;i++)outR<<=1,outR|=inR>>>pc2table[i]&1;out[off+0]=outL>>>0,out[off+1]=outR>>>0},exports.expand=function(r,out,off){var outL=0,outR=0;outL=(1&r)<<5|r>>>27;for(var i=23;i>=15;i-=4)outL<<=6,outL|=r>>>i&63;for(var i=11;i>=3;i-=4)outR|=r>>>i&63,outR<<=6;outR|=(31&r)<<1|r>>>31,out[off+0]=outL>>>0,out[off+1]=outR>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];exports.substitute=function(inL,inR){for(var out=0,i=0;i<4;i++){var b=inL>>>18-6*i&63,sb=sTable[64*i+b];out<<=4,out|=sb}for(var i=0;i<4;i++){var b=inR>>>18-6*i&63,sb=sTable[256+64*i+b];out<<=4,out|=sb}return out>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];exports.permute=function(num){for(var out=0,i=0;i<permuteTable.length;i++)out<<=1,out|=num>>>permuteTable[i]&1;return out>>>0},exports.padSplit=function(num,size,group){for(var str=num.toString(2);str.length<size;)str="0"+str;for(var out=[],i=0;i<size;i+=group)out.push(str.slice(i,i+group));return out.join(" ")}},{}],129:[function(require,module,exports){(function(Buffer){function getDiffieHellman(mod){var prime=new Buffer(primes[mod].prime,"hex"),gen=new Buffer(primes[mod].gen,"hex");return new DH(prime,gen)}function createDiffieHellman(prime,enc,generator,genc){return Buffer.isBuffer(enc)||void 0===ENCODINGS[enc]?createDiffieHellman(prime,"binary",enc,generator):(enc=enc||"binary",genc=genc||"binary",generator=generator||new Buffer([2]),Buffer.isBuffer(generator)||(generator=new Buffer(generator,genc)),"number"==typeof prime?new DH(generatePrime(prime,generator),generator,!0):(Buffer.isBuffer(prime)||(prime=new Buffer(prime,enc)),new DH(prime,generator,!0)))}var generatePrime=require("./lib/generatePrime"),primes=require("./lib/primes.json"),DH=require("./lib/dh"),ENCODINGS={binary:!0,hex:!0,base64:!0};exports.DiffieHellmanGroup=exports.createDiffieHellmanGroup=exports.getDiffieHellman=getDiffieHellman,exports.createDiffieHellman=exports.DiffieHellman=createDiffieHellman}).call(this,require("buffer").Buffer)},{"./lib/dh":130,"./lib/generatePrime":131,"./lib/primes.json":132,buffer:108}],130:[function(require,module,exports){(function(Buffer){function setPublicKey(pub,enc){return enc=enc||"utf8",Buffer.isBuffer(pub)||(pub=new Buffer(pub,enc)),this._pub=new BN(pub),this}function setPrivateKey(priv,enc){return enc=enc||"utf8",Buffer.isBuffer(priv)||(priv=new Buffer(priv,enc)),this._priv=new BN(priv),this}function checkPrime(prime,generator){var gen=generator.toString("hex"),hex=[gen,prime.toString(16)].join("_");if(hex in primeCache)return primeCache[hex];var error=0;if(prime.isEven()||!primes.simpleSieve||!primes.fermatTest(prime)||!millerRabin.test(prime))return error+=1,error+="02"===gen||"05"===gen?8:4,primeCache[hex]=error,error;millerRabin.test(prime.shrn(1))||(error+=2);var rem;switch(gen){case"02":prime.mod(TWENTYFOUR).cmp(ELEVEN)&&(error+=8);break;case"05":rem=prime.mod(TEN),rem.cmp(THREE)&&rem.cmp(SEVEN)&&(error+=8);break;default:error+=4}return primeCache[hex]=error,error}function DH(prime,generator,malleable){this.setGenerator(generator),this.__prime=new BN(prime),this._prime=BN.mont(this.__prime),this._primeLen=prime.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,malleable?(this.setPublicKey=setPublicKey,this.setPrivateKey=setPrivateKey):this._primeCode=8}function formatReturnValue(bn,enc){var buf=new Buffer(bn.toArray());return enc?buf.toString(enc):buf}var BN=require("bn.js"),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,TWENTYFOUR=new BN(24),ELEVEN=new BN(11),TEN=new BN(10),THREE=new BN(3),SEVEN=new BN(7),primes=require("./generatePrime"),randomBytes=require("randombytes");module.exports=DH;var primeCache={};Object.defineProperty(DH.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=checkPrime(this.__prime,this.__gen)),this._primeCode}}),DH.prototype.generateKeys=function(){return this._priv||(this._priv=new BN(randomBytes(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},DH.prototype.computeSecret=function(other){other=new BN(other),other=other.toRed(this._prime);var secret=other.redPow(this._priv).fromRed(),out=new Buffer(secret.toArray()),prime=this.getPrime();if(out.length<prime.length){var front=new Buffer(prime.length-out.length);front.fill(0),out=Buffer.concat([front,out])}return out},DH.prototype.getPublicKey=function(enc){return formatReturnValue(this._pub,enc)},DH.prototype.getPrivateKey=function(enc){return formatReturnValue(this._priv,enc)},DH.prototype.getPrime=function(enc){return formatReturnValue(this.__prime,enc)},DH.prototype.getGenerator=function(enc){return formatReturnValue(this._gen,enc)},DH.prototype.setGenerator=function(gen,enc){return enc=enc||"utf8",Buffer.isBuffer(gen)||(gen=new Buffer(gen,enc)),this.__gen=gen,this._gen=new BN(gen),this}}).call(this,require("buffer").Buffer)},{"./generatePrime":131,"bn.js":74,buffer:108,"miller-rabin":237,randombytes:314}],131:[function(require,module,exports){function _getPrimes(){if(null!==primes)return primes;var limit=1048576,res=[];res[0]=2;for(var i=1,k=3;k<limit;k+=2){for(var sqrt=Math.ceil(Math.sqrt(k)),j=0;j<i&&res[j]<=sqrt&&k%res[j]!=0;j++);i!==j&&res[j]<=sqrt||(res[i++]=k)}return primes=res,res}function simpleSieve(p){for(var primes=_getPrimes(),i=0;i<primes.length;i++)if(0===p.modn(primes[i]))return 0===p.cmpn(primes[i]);return!0}function fermatTest(p){var red=BN.mont(p);return 0===TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1)}function findPrime(bits,gen){if(bits<16)return new BN(2===gen||5===gen?[140,123]:[140,39]);gen=new BN(gen);for(var num,n2;;){for(num=new BN(randomBytes(Math.ceil(bits/8)));num.bitLength()>bits;)num.ishrn(1);if(num.isEven()&&num.iadd(ONE),num.testn(1)||num.iadd(TWO),gen.cmp(TWO)){if(!gen.cmp(FIVE))for(;num.mod(TEN).cmp(THREE);)num.iadd(FOUR)}else for(;num.mod(TWENTYFOUR).cmp(ELEVEN);)num.iadd(FOUR);if(n2=num.shrn(1),simpleSieve(n2)&&simpleSieve(num)&&fermatTest(n2)&&fermatTest(num)&&millerRabin.test(n2)&&millerRabin.test(num))return num}}var randomBytes=require("randombytes");module.exports=findPrime,findPrime.simpleSieve=simpleSieve,findPrime.fermatTest=fermatTest;var BN=require("bn.js"),TWENTYFOUR=new BN(24),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,ONE=new BN(1),TWO=new BN(2),FIVE=new BN(5),TEN=(new BN(16),new BN(8),new BN(10)),THREE=new BN(3),ELEVEN=(new BN(7),new BN(11)),FOUR=new BN(4),primes=(new BN(12),null)},{"bn.js":74,"miller-rabin":237,randombytes:314}],132:[function(require,module,exports){module.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],133:[function(require,module,exports){(function(Buffer){function unstupid(hex,len){return hex.length>=len?hex:unstupid("0"+hex,len)}var crypto=require("crypto"),BigInteger=require("jsbn").BigInteger;require("./lib/ec.js").ECPointFp;exports.ECCurves=require("./lib/sec.js"),exports.ECKey=function(curve,key,isPublic){var priv,c=curve(),n=c.getN(),bytes=Math.floor(n.bitLength()/8);if(key)if(isPublic){var curve=c.getCurve();this.P=curve.decodePointHex(key.toString("hex"))}else{if(key.length!=bytes)return!1;priv=new BigInteger(key.toString("hex"),16)}else{var n1=n.subtract(BigInteger.ONE),r=new BigInteger(crypto.randomBytes(n.bitLength()));priv=r.mod(n1).add(BigInteger.ONE),this.P=c.getG().multiply(priv)}this.P&&(this.PublicKey=new Buffer(c.getCurve().encodeCompressedPointHex(this.P),"hex")),priv&&(this.PrivateKey=new Buffer(unstupid(priv.toString(16),2*bytes),"hex"),this.deriveSharedSecret=function(key){if(!key||!key.P)return!1;var S=key.P.multiply(priv);return new Buffer(unstupid(S.getX().toBigInteger().toString(16),2*bytes),"hex")})}}).call(this,require("buffer").Buffer)},{"./lib/ec.js":134,"./lib/sec.js":135,buffer:108,crypto:121,jsbn:224}],134:[function(require,module,exports){function ECFieldElementFp(q,x){this.x=x,this.q=q}function feFpEquals(other){return other==this||this.q.equals(other.q)&&this.x.equals(other.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(b){return new ECFieldElementFp(this.q,this.x.add(b.toBigInteger()).mod(this.q))}function feFpSubtract(b){return new ECFieldElementFp(this.q,this.x.subtract(b.toBigInteger()).mod(this.q))}function feFpMultiply(b){return new ECFieldElementFp(this.q,this.x.multiply(b.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(b){return new ECFieldElementFp(this.q,this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(curve,x,y,z){this.curve=curve,this.x=x,this.y=y,this.z=null==z?BigInteger.ONE:z,this.zinv=null}function pointFpGetX(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var r=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(r),this.curve.fromBigInteger(r)}function pointFpGetY(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var r=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(r),this.curve.fromBigInteger(r)}function pointFpEquals(other){if(other==this)return!0;if(this.isInfinity())return other.isInfinity();if(other.isInfinity())return this.isInfinity();var u,v;return u=other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q),!!u.equals(BigInteger.ZERO)&&(v=other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q),v.equals(BigInteger.ZERO))}function pointFpIsInfinity(){return null==this.x&&null==this.y||this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(b){if(this.isInfinity())return b;if(b.isInfinity())return this;var u=b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q),v=b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(v))return BigInteger.ZERO.equals(u)?this.twice():this.curve.getInfinity();var THREE=new BigInteger("3"),x1=this.x.toBigInteger(),y1=this.y.toBigInteger(),v2=(b.x.toBigInteger(),b.y.toBigInteger(),v.square()),v3=v2.multiply(v),x1v2=x1.multiply(v2),zu2=u.square().multiply(this.z),x3=zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q),y3=x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q),z3=v3.multiply(this.z).multiply(b.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(x3),this.curve.fromBigInteger(y3),z3)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var THREE=new BigInteger("3"),x1=this.x.toBigInteger(),y1=this.y.toBigInteger(),y1z1=y1.multiply(this.z),y1sqz1=y1z1.multiply(y1).mod(this.curve.q),a=this.curve.a.toBigInteger(),w=x1.square().multiply(THREE);BigInteger.ZERO.equals(a)||(w=w.add(this.z.square().multiply(a))),w=w.mod(this.curve.q);var x3=w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q),y3=w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q),z3=y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(x3),this.curve.fromBigInteger(y3),z3)}function pointFpMultiply(k){if(this.isInfinity())return this;if(0==k.signum())return this.curve.getInfinity();var i,e=k,h=e.multiply(new BigInteger("3")),neg=this.negate(),R=this;for(i=h.bitLength()-2;i>0;--i){R=R.twice();var hBit=h.testBit(i);hBit!=e.testBit(i)&&(R=R.add(hBit?this:neg))}return R}function pointFpMultiplyTwo(j,x,k){var i;i=j.bitLength()>k.bitLength()?j.bitLength()-1:k.bitLength()-1;for(var R=this.curve.getInfinity(),both=this.add(x);i>=0;)R=R.twice(),j.testBit(i)?R=k.testBit(i)?R.add(both):R.add(this):k.testBit(i)&&(R=R.add(x)),--i;return R}function ECCurveFp(q,a,b){this.q=q,this.a=this.fromBigInteger(a),this.b=this.fromBigInteger(b),this.infinity=new ECPointFp(this,null,null),this.reducer=new Barrett(this.q)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(other){return other==this||this.q.equals(other.q)&&this.a.equals(other.a)&&this.b.equals(other.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(x){return new ECFieldElementFp(this.q,x)}function curveReduce(x){this.reducer.reduce(x)}function curveFpEncodePointHex(p){if(p.isInfinity())return"00";var xHex=p.getX().toBigInteger().toString(16),yHex=p.getY().toBigInteger().toString(16),oLen=this.getQ().toString(16).length;for(oLen%2!=0&&oLen++;xHex.length<oLen;)xHex="0"+xHex;for(;yHex.length<oLen;)yHex="0"+yHex;return"04"+xHex+yHex}var BigInteger=require("jsbn").BigInteger,Barrett=BigInteger.prototype.Barrett;ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.reduce=curveReduce,ECCurveFp.prototype.encodePointHex=curveFpEncodePointHex,ECCurveFp.prototype.decodePointHex=function(s){var yIsEven;switch(parseInt(s.substr(0,2),16)){case 0:return this.infinity;case 2:yIsEven=!1;case 3:void 0==yIsEven&&(yIsEven=!0);var len=s.length-2,xHex=s.substr(2,len),x=this.fromBigInteger(new BigInteger(xHex,16)),alpha=x.multiply(x.square().add(this.getA())).add(this.getB()),beta=alpha.sqrt();if(null==beta)throw"Invalid point compression";var betaValue=beta.toBigInteger();return betaValue.testBit(0)!=yIsEven&&(beta=this.fromBigInteger(this.getQ().subtract(betaValue))),new ECPointFp(this,x,beta);case 4:case 6:case 7:var len=(s.length-2)/2,xHex=s.substr(2,len),yHex=s.substr(len+2,len);return new ECPointFp(this,this.fromBigInteger(new BigInteger(xHex,16)),this.fromBigInteger(new BigInteger(yHex,16)));default:return null}},ECCurveFp.prototype.encodeCompressedPointHex=function(p){if(p.isInfinity())return"00";var xHex=p.getX().toBigInteger().toString(16),oLen=this.getQ().toString(16).length;for(oLen%2!=0&&oLen++;xHex.length<oLen;)xHex="0"+xHex;return(p.getY().toBigInteger().isEven()?"02":"03")+xHex},ECFieldElementFp.prototype.getR=function(){if(void 0!=this.r)return this.r;this.r=null;var bitLength=this.q.bitLength();if(bitLength>128){-1==this.q.shiftRight(bitLength-64).intValue()&&(this.r=BigInteger.ONE.shiftLeft(bitLength).subtract(this.q))}return this.r},ECFieldElementFp.prototype.modMult=function(x1,x2){return this.modReduce(x1.multiply(x2))},ECFieldElementFp.prototype.modReduce=function(x){if(null!=this.getR()){for(var qLen=q.bitLength();x.bitLength()>qLen+1;){var u=x.shiftRight(qLen),v=x.subtract(u.shiftLeft(qLen));this.getR().equals(BigInteger.ONE)||(u=u.multiply(this.getR())),x=u.add(v)}for(;x.compareTo(q)>=0;)x=x.subtract(q)}else x=x.mod(q);return x},ECFieldElementFp.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var z=new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));return z.square().equals(this)?z:null}var qMinusOne=this.q.subtract(BigInteger.ONE),legendreExponent=qMinusOne.shiftRight(1);if(!this.x.modPow(legendreExponent,this.q).equals(BigInteger.ONE))return null;var U,V,u=qMinusOne.shiftRight(2),k=u.shiftLeft(1).add(BigInteger.ONE),Q=this.x,fourQ=modDouble(modDouble(Q));do{var P;do{P=new BigInteger(this.q.bitLength(),new SecureRandom)}while(P.compareTo(this.q)>=0||!P.multiply(P).subtract(fourQ).modPow(legendreExponent,this.q).equals(qMinusOne));var result=this.lucasSequence(P,Q,k);if(U=result[0],V=result[1],this.modMult(V,V).equals(fourQ))return V.testBit(0)&&(V=V.add(q)),V=V.shiftRight(1),new ECFieldElementFp(q,V)}while(U.equals(BigInteger.ONE)||U.equals(qMinusOne));return null},ECFieldElementFp.prototype.lucasSequence=function(P,Q,k){for(var n=k.bitLength(),s=k.getLowestSetBit(),Uh=BigInteger.ONE,Vl=BigInteger.TWO,Vh=P,Ql=BigInteger.ONE,Qh=BigInteger.ONE,j=n-1;j>=s+1;--j)Ql=this.modMult(Ql,Qh),k.testBit(j)?(Qh=this.modMult(Ql,Q),Uh=this.modMult(Uh,Vh),Vl=this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))),Vh=this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)))):(Qh=Ql,Uh=this.modReduce(Uh.multiply(Vl).subtract(Ql)),Vh=this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))),Vl=this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))));Ql=this.modMult(Ql,Qh),Qh=this.modMult(Ql,Q),Uh=this.modReduce(Uh.multiply(Vl).subtract(Ql)),Vl=this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))),Ql=this.modMult(Ql,Qh);for(var j=1;j<=s;++j)Uh=this.modMult(Uh,Vl),Vl=this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))),Ql=this.modMult(Ql,Ql);return[Uh,Vl]};var exports={ECCurveFp:ECCurveFp,ECPointFp:ECPointFp,ECFieldElementFp:ECFieldElementFp};module.exports=exports},{jsbn:224}],135:[function(require,module,exports){function X9ECParameters(curve,g,n,h){this.curve=curve,this.g=g,this.n=n,this.h=h}function x9getCurve(){return this.curve}function x9getG(){return this.g}function x9getN(){return this.n}function x9getH(){return this.h}function fromHex(s){return new BigInteger(s,16)}function secp128r1(){var p=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),a=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),b=fromHex("E87579C11079F43DD824993C2CEE5ED3"),n=fromHex("FFFFFFFE0000000075A30D1B9038A115"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),n,h)}function secp160k1(){var p=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),a=BigInteger.ZERO,b=fromHex("7"),n=fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),n,h)}function secp160r1(){var p=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),b=fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),n=fromHex("0100000000000000000001F4C8F927AED3CA752257"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),n,h)}function secp192k1(){var p=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),a=BigInteger.ZERO,b=fromHex("3"),n=fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),n,h)}function secp192r1(){var p=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),b=fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),n=fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),n,h)}function secp224r1(){var p=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),b=fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),n=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),n,h)}function secp256r1(){var p=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),a=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),b=fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),n=fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),h=BigInteger.ONE,curve=new ECCurveFp(p,a,b);return new X9ECParameters(curve,curve.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),n,h)}var BigInteger=require("jsbn").BigInteger,ECCurveFp=require("./ec.js").ECCurveFp;X9ECParameters.prototype.getCurve=x9getCurve,X9ECParameters.prototype.getG=x9getG,X9ECParameters.prototype.getN=x9getN,X9ECParameters.prototype.getH=x9getH,module.exports={secp128r1:secp128r1,secp160k1:secp160k1,secp160r1:secp160r1,secp192k1:secp192k1,secp192r1:secp192r1,secp224r1:secp224r1,secp256r1:secp256r1}},{"./ec.js":134,jsbn:224}],136:[function(require,module,exports){var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("brorand"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec"),elliptic.eddsa=require("./elliptic/eddsa")},{"../package.json":151,"./elliptic/curve":139,"./elliptic/curves":142,"./elliptic/ec":143,"./elliptic/eddsa":146,"./elliptic/utils":150,brorand:75}],137:[function(require,module,exports){function BaseCurve(type,conf){this.type=type,this.p=new BN(conf.p,16),this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=conf.n&&new BN(conf.n,16),this.g=conf.g&&this.pointFromJSON(conf.g,conf.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var adjustCount=this.n&&this.p.div(this.n);!adjustCount||adjustCount.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<<doubles.step+1)-(doubles.step%2==0?2:1);I/=3;for(var repr=[],j=0;j<naf.length;j+=doubles.step){for(var nafW=0,k=j+doubles.step-1;k>=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j<repr.length;j++){var nafW=repr[j];nafW===i?b=b.mixedAdd(doubles.points[j]):nafW===-i&&(b=b.mixedAdd(doubles.points[j].neg()))}a=a.add(b)}return a.toP()},BaseCurve.prototype._wnafMul=function(p,k){var w=4,nafPoints=p._getNAFPoints(w);w=nafPoints.wnd;for(var wnd=nafPoints.points,naf=getNAF(k,w),acc=this.jpoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i<len;i++){var p=points[i],nafPoints=p._getNAFPoints(defW);wndWidth[i]=nafPoints.wnd,wnd[i]=nafPoints.points}for(var i=len-1;i>=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j<max;j++){var ja=0|jsf[0][j],jb=0|jsf[1][j];naf[a][j]=index[3*(ja+1)+(jb+1)],naf[b][j]=0,wnd[a]=comb}}else naf[a]=getNAF(coeffs[a],wndWidth[a]),naf[b]=getNAF(coeffs[b],wndWidth[b]),max=Math.max(naf[a].length,max),max=Math.max(naf[b].length,max)}for(var acc=this.jpoint(null,null,null),tmp=this._wnafT4,i=max;i>=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j<len;j++)tmp[j]=0|naf[j][i],0!==tmp[j]&&(zero=!1);if(!zero)break;k++,i--}if(i>=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j<len;j++){var p,z=tmp[j];0!==z&&(z>0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i<len;i++)wnd[i]=null;return jacobianResult?acc:acc.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function(){throw new Error("Not implemented")},BasePoint.prototype.validate=function(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function(bytes,enc){bytes=utils.toArray(bytes,enc);var len=this.p.byteLength();if((4===bytes[0]||6===bytes[0]||7===bytes[0])&&bytes.length-1==2*len){6===bytes[0]?assert(bytes[bytes.length-1]%2==0):7===bytes[0]&&assert(bytes[bytes.length-1]%2==1);return this.point(bytes.slice(1,1+len),bytes.slice(1+len,1+2*len))}if((2===bytes[0]||3===bytes[0])&&bytes.length-1===len)return this.pointFromX(bytes.slice(1,1+len),3===bytes[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function(enc){return this.encode(enc,!0)},BasePoint.prototype._encode=function(compact){var len=this.curve.p.byteLength(),x=this.getX().toArray("be",len);return compact?[this.getY().isEven()?2:3].concat(x):[4].concat(x,this.getY().toArray("be",len))},BasePoint.prototype.encode=function(enc,compact){return utils.encode(this._encode(compact),enc)},BasePoint.prototype.precompute=function(power){if(this.precomputed)return this;var precomputed={doubles:null,naf:null,beta:null};return precomputed.naf=this._getNAFPoints(8),precomputed.doubles=this._getDoubles(4,power),precomputed.beta=this._getBeta(),this.precomputed=precomputed,this},BasePoint.prototype._hasDoubles=function(k){if(!this.precomputed)return!1;var doubles=this.precomputed.doubles;return!!doubles&&doubles.points.length>=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i<power;i+=step){for(var j=0;j<step;j++)acc=acc.dbl();doubles.push(acc)}return{step:step,points:doubles}},BasePoint.prototype._getNAFPoints=function(wnd){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var res=[this],max=(1<<wnd)-1,dbl=1===max?null:this.dbl(),i=1;i<max;i++)res[i]=res[i-1].add(dbl);return{wnd:wnd,points:res}},BasePoint.prototype._getBeta=function(){return null},BasePoint.prototype.dblp=function(k){for(var r=this,i=0;i<k;i++)r=r.dbl();return r}},{"../../elliptic":136,"bn.js":74}],138:[function(require,module,exports){function EdwardsCurve(conf){this.twisted=1!=(0|conf.a),this.mOneA=this.twisted&&-1==(0|conf.a),this.extended=this.mOneA,Base.call(this,"edwards",conf),this.a=new BN(conf.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN(conf.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN(conf.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|conf.c)}function Point(curve,x,y,z,t){Base.BasePoint.call(this,curve,"projective"),null===x&&null===y&&null===z?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=z?new BN(z,16):this.curve.one,this.t=t&&new BN(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var curve=require("../curve"),elliptic=require("../../elliptic"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,assert=elliptic.utils.assert;inherits(EdwardsCurve,Base),module.exports=EdwardsCurve,EdwardsCurve.prototype._mulA=function(num){return this.mOneA?num.redNeg():this.a.redMul(num)},EdwardsCurve.prototype._mulC=function(num){return this.oneC?num:this.c.redMul(num)},EdwardsCurve.prototype.jpoint=function(x,y,z,t){return this.point(x,y,z,t)},EdwardsCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var x2=x.redSqr(),rhs=this.c2.redSub(this.a.redMul(x2)),lhs=this.one.redSub(this.c2.redMul(this.d).redMul(x2)),y2=rhs.redMul(lhs.redInvm()),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},EdwardsCurve.prototype.pointFromY=function(y,odd){y=new BN(y,16),y.red||(y=y.toRed(this.red));var y2=y.redSqr(),lhs=y2.redSub(this.one),rhs=y2.redMul(this.d).redAdd(this.one),x2=lhs.redMul(rhs.redInvm());if(0===x2.cmp(this.zero)){if(odd)throw new Error("invalid point");return this.point(this.zero,y)}var x=x2.redSqrt();if(0!==x.redSqr().redSub(x2).cmp(this.zero))throw new Error("invalid point");return x.isOdd()!==odd&&(x=x.redNeg()),this.point(x,y)},EdwardsCurve.prototype.validate=function(point){if(point.isInfinity())return!0;point.normalize();var x2=point.x.redSqr(),y2=point.y.redSqr(),lhs=x2.redMul(this.a).redAdd(y2),rhs=this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));return 0===lhs.cmp(rhs)},inherits(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},EdwardsCurve.prototype.point=function(x,y,z,t){return new Point(this,x,y,z,t)},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1],obj[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":136,"../curve":139,"bn.js":74,inherits:215}],139:[function(require,module,exports){var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards")},{"./base":137,"./edwards":138,"./mont":140,"./short":141}],140:[function(require,module,exports){function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=require("../curve"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,elliptic=require("../../elliptic"),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)},Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":136,"../curve":139,"bn.js":74,inherits:215}],141:[function(require,module,exports){function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=require("../curve"),elliptic=require("../../elliptic"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i<points.length;i++){var split=this._endoSplit(coeffs[i]),p=points[i],beta=p._getBeta();split.k1.negative&&(split.k1.ineg(),p=p.neg(!0)),split.k2.negative&&(split.k2.ineg(),beta=beta.neg(!0)),npoints[2*i]=p,npoints[2*i+1]=beta,ncoeffs[2*i]=split.k1,ncoeffs[2*i+1]=split.k2}for(var res=this._wnafMulAdd(1,npoints,ncoeffs,2*i,jacobianResult),j=0;j<2*i;j++)npoints[j]=null,ncoeffs[j]=null;return res},inherits(Point,Base.BasePoint),ShortCurve.prototype.point=function(x,y,isRed){return new Point(this,x,y,isRed)},ShortCurve.prototype.pointFromJSON=function(obj,red){return Point.fromJSON(this,obj,red)},Point.prototype._getBeta=function(){if(this.curve.endo){var pre=this.precomputed;if(pre&&pre.beta)return pre.beta;var beta=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(pre){var curve=this.curve,endoMul=function(p){return curve.point(p.x.redMul(curve.endo.beta),p.y)};pre.beta=beta,beta.precomputed={beta:null,naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(endoMul)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(endoMul)}}}return beta}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(curve,obj,red){function obj2point(obj){return curve.point(obj[0],obj[1],red)}"string"==typeof obj&&(obj=JSON.parse(obj));var res=curve.point(obj[0],obj[1],red);if(!obj[2])return res;var pre=obj[2];return res.precomputed={beta:null,doubles:pre.doubles&&{step:pre.doubles.step,points:[res].concat(pre.doubles.points.map(obj2point))},naf:pre.naf&&{wnd:pre.naf.wnd,points:[res].concat(pre.naf.points.map(obj2point))}},res},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i<pow;i++)r=r.dbl();return r}for(var a=this.curve.a,tinv=this.curve.tinv,jx=this.x,jy=this.y,jz=this.z,jz4=jz.redSqr().redSqr(),jyd=jy.redAdd(jy),i=0;i<pow;i++){var jx2=jx.redSqr(),jyd2=jyd.redSqr(),jyd4=jyd2.redSqr(),c=jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)),t1=jx.redMul(jyd2),nx=c.redSqr().redISub(t1.redAdd(t1)),t2=t1.redISub(nx),dny=c.redMul(t2);dny=dny.redIAdd(dny).redISub(jyd4);var nz=jyd.redMul(jz);i+1<pow&&(jz4=jz4.redMul(jyd4)),jx=nx,jz=nz,jyd=dny}return this.curve.jpoint(jx,jyd.redMul(tinv),jz)},JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function(){var nx,ny,nz;if(this.zOne){var xx=this.x.redSqr(),yy=this.y.redSqr(),yyyy=yy.redSqr(),s=this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);s=s.redIAdd(s);var m=xx.redAdd(xx).redIAdd(xx),t=m.redSqr().redISub(s).redISub(s),yyyy8=yyyy.redIAdd(yyyy);yyyy8=yyyy8.redIAdd(yyyy8),yyyy8=yyyy8.redIAdd(yyyy8),nx=t,ny=m.redMul(s.redISub(t)).redISub(yyyy8),nz=this.y.redAdd(this.y)}else{var a=this.x.redSqr(),b=this.y.redSqr(),c=b.redSqr(),d=this.x.redAdd(b).redSqr().redISub(a).redISub(c);d=d.redIAdd(d);var e=a.redAdd(a).redIAdd(a),f=e.redSqr(),c8=c.redIAdd(c);c8=c8.redIAdd(c8),c8=c8.redIAdd(c8),nx=f.redISub(d).redISub(d),ny=e.redMul(d.redISub(nx)).redISub(c8),nz=this.y.redMul(this.z),nz=nz.redIAdd(nz)}return this.curve.jpoint(nx,ny,nz)},JPoint.prototype._threeDbl=function(){var nx,ny,nz;if(this.zOne){var xx=this.x.redSqr(),yy=this.y.redSqr(),yyyy=yy.redSqr(),s=this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);s=s.redIAdd(s);var m=xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a),t=m.redSqr().redISub(s).redISub(s);nx=t;var yyyy8=yyyy.redIAdd(yyyy);yyyy8=yyyy8.redIAdd(yyyy8),yyyy8=yyyy8.redIAdd(yyyy8),ny=m.redMul(s.redISub(t)).redISub(yyyy8),nz=this.y.redAdd(this.y)}else{var delta=this.z.redSqr(),gamma=this.y.redSqr(),beta=this.x.redMul(gamma),alpha=this.x.redSub(delta).redMul(this.x.redAdd(delta));alpha=alpha.redAdd(alpha).redIAdd(alpha);var beta4=beta.redIAdd(beta);beta4=beta4.redIAdd(beta4);var beta8=beta4.redAdd(beta4);nx=alpha.redSqr().redISub(beta8),nz=this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);var ggamma8=gamma.redSqr();ggamma8=ggamma8.redIAdd(ggamma8),ggamma8=ggamma8.redIAdd(ggamma8),ggamma8=ggamma8.redIAdd(ggamma8),ny=alpha.redMul(beta4.redISub(nx)).redISub(ggamma8)}return this.curve.jpoint(nx,ny,nz)},JPoint.prototype._dbl=function(){var a=this.curve.a,jx=this.x,jy=this.y,jz=this.z,jz4=jz.redSqr().redSqr(),jx2=jx.redSqr(),jy2=jy.redSqr(),c=jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)),jxd4=jx.redAdd(jx);jxd4=jxd4.redIAdd(jxd4);var t1=jxd4.redMul(jy2),nx=c.redSqr().redISub(t1.redAdd(t1)),t2=t1.redISub(nx),jyd8=jy2.redSqr();jyd8=jyd8.redIAdd(jyd8),jyd8=jyd8.redIAdd(jyd8),jyd8=jyd8.redIAdd(jyd8);var ny=c.redMul(t2).redISub(jyd8),nz=jy.redAdd(jy).redMul(jz);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var xx=this.x.redSqr(),yy=this.y.redSqr(),zz=this.z.redSqr(),yyyy=yy.redSqr(),m=xx.redAdd(xx).redIAdd(xx),mm=m.redSqr(),e=this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);e=e.redIAdd(e),e=e.redAdd(e).redIAdd(e),e=e.redISub(mm);var ee=e.redSqr(),t=yyyy.redIAdd(yyyy);t=t.redIAdd(t),t=t.redIAdd(t),t=t.redIAdd(t);var u=m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t),yyu4=yy.redMul(u);yyu4=yyu4.redIAdd(yyu4),yyu4=yyu4.redIAdd(yyu4);var nx=this.x.redMul(ee).redISub(yyu4);nx=nx.redIAdd(nx),nx=nx.redIAdd(nx);var ny=this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));ny=ny.redIAdd(ny),ny=ny.redIAdd(ny),ny=ny.redIAdd(ny);var nz=this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mul=function(k,kbase){return k=new BN(k,kbase),this.curve._wnafMul(this,k)},JPoint.prototype.eq=function(p){if("affine"===p.type)return this.eq(p.toJ());if(this===p)return!0;var z2=this.z.redSqr(),pz2=p.z.redSqr();if(0!==this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0))return!1;var z3=z2.redMul(this.z),pz3=pz2.redMul(p.z);return 0===this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0)},JPoint.prototype.eqXToP=function(x){var zs=this.z.redSqr(),rx=x.toRed(this.curve.red).redMul(zs);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(zs);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":136,"../curve":139,"bn.js":74,inherits:215}],142:[function(require,module,exports){function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=require("hash.js"),elliptic=require("../elliptic"),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=require("./precomputed/secp256k1")}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},{"../elliptic":136,"./precomputed/secp256k1":149,"hash.js":193}],143:[function(require,module,exports){function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=require("bn.js"),HmacDRBG=require("hmac-drbg"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,KeyPair=require("./key"),Signature=require("./signature");module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"===(void 0===enc?"undefined":_typeof(enc))&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":136,"./key":144,"./signature":145,"bn.js":74,"hmac-drbg":206}],144:[function(require,module,exports){function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":136,"bn.js":74}],145:[function(require,module,exports){function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i<octetLen;i++,off++)val<<=8,val|=buf[off];return p.place=off,val}function rmPadding(buf){for(var i=0,len=buf.length-1;!buf[i]&&!(128&buf[i+1])&&i<len;)i++;return 0===i?buf:buf.slice(i)}function constructLength(arr,len){if(len<128)return void arr.push(len);var octets=1+(Math.log(len)/Math.LN2>>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},{"../../elliptic":136,"bn.js":74}],146:[function(require,module,exports){function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=require("hash.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=require("./key"),Signature=require("./signature");module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i<arguments.length;i++)hash.update(arguments[i]);return utils.intFromLE(hash.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function(pub){return KeyPair.fromPublic(this,pub)},EDDSA.prototype.keyFromSecret=function(secret){return KeyPair.fromSecret(this,secret)},EDDSA.prototype.makeSignature=function(sig){return sig instanceof Signature?sig:new Signature(this,sig)},EDDSA.prototype.encodePoint=function(point){var enc=point.getY().toArray("le",this.encodingLength);return enc[this.encodingLength-1]|=point.getX().isOdd()?128:0,enc},EDDSA.prototype.decodePoint=function(bytes){bytes=utils.parseBytes(bytes);var lastIx=bytes.length-1,normed=bytes.slice(0,lastIx).concat(-129&bytes[lastIx]),xIsOdd=0!=(128&bytes[lastIx]),y=utils.intFromLE(normed);return this.curve.pointFromY(y,xIsOdd)},EDDSA.prototype.encodeInt=function(num){return num.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function(bytes){return utils.intFromLE(bytes)},EDDSA.prototype.isPoint=function(val){return val instanceof this.pointClass}},{"../../elliptic":136,"./key":147,"./signature":148,"hash.js":193}],147:[function(require,module,exports){function KeyPair(eddsa,params){this.eddsa=eddsa,this._secret=parseBytes(params.secret),eddsa.isPoint(params.pub)?this._pub=params.pub:this._pubBytes=parseBytes(params.pub)}var elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,cachedProperty=utils.cachedProperty;KeyPair.fromPublic=function(eddsa,pub){return pub instanceof KeyPair?pub:new KeyPair(eddsa,{pub:pub})},KeyPair.fromSecret=function(eddsa,secret){return secret instanceof KeyPair?secret:new KeyPair(eddsa,{secret:secret})},KeyPair.prototype.secret=function(){return this._secret},cachedProperty(KeyPair,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),cachedProperty(KeyPair,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty(KeyPair,"privBytes",function(){var eddsa=this.eddsa,hash=this.hash(),lastIx=eddsa.encodingLength-1,a=hash.slice(0,eddsa.encodingLength);return a[0]&=248,a[lastIx]&=127,a[lastIx]|=64,a}),cachedProperty(KeyPair,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty(KeyPair,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty(KeyPair,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair.prototype.sign=function(message){return assert(this._secret,"KeyPair can only verify"),this.eddsa.sign(message,this)},KeyPair.prototype.verify=function(message,sig){return this.eddsa.verify(message,sig,this)},KeyPair.prototype.getSecret=function(enc){return assert(this._secret,"KeyPair is public only"),utils.encode(this.secret(),enc)},KeyPair.prototype.getPublic=function(enc){return utils.encode(this.pubBytes(),enc)},module.exports=KeyPair},{"../../elliptic":136}],148:[function(require,module,exports){function Signature(eddsa,sig){this.eddsa=eddsa,"object"!==(void 0===sig?"undefined":_typeof(sig))&&(sig=parseBytes(sig)),Array.isArray(sig)&&(sig={R:sig.slice(0,eddsa.encodingLength),S:sig.slice(eddsa.encodingLength)}),assert(sig.R&&sig.S,"Signature without R or S"),eddsa.isPoint(sig.R)&&(this._R=sig.R),sig.S instanceof BN&&(this._S=sig.S),this._Rencoded=Array.isArray(sig.R)?sig.R:sig.Rencoded,this._Sencoded=Array.isArray(sig.S)?sig.S:sig.Sencoded}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,cachedProperty=utils.cachedProperty,parseBytes=utils.parseBytes;cachedProperty(Signature,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Signature.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Signature.prototype.toHex=function(){return utils.encode(this.toBytes(),"hex").toUpperCase()},module.exports=Signature},{"../../elliptic":136,"bn.js":74}],149:[function(require,module,exports){module.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],150:[function(require,module,exports){function getNAF(num,w){for(var naf=[],ws=1<<w+1,k=num.clone();k.cmpn(1)>=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i<shift;i++)naf.push(0);k.iushrn(shift)}return naf}function getJSF(k1,k2){var jsf=[[],[]];k1=k1.clone(),k2=k2.clone();for(var d1=0,d2=0;k1.cmpn(-d1)>0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=require("bn.js"),minAssert=require("minimalistic-assert"),minUtils=require("minimalistic-crypto-utils");utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},{"bn.js":74,"minimalistic-assert":243,"minimalistic-crypto-utils":244}],151:[function(require,module,exports){module.exports={_from:"elliptic@^6.0.0",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_spec:"elliptic@^6.0.0",_where:"/Users/nitintulswani/Downloads/jimp-master/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],152:[function(require,module,exports){(function(process,global){!function(global,factory){"object"===(void 0===exports?"undefined":_typeof(exports))&&void 0!==module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.ES6Promise=factory()}(this,function(){function objectOrFunction(x){return"function"==typeof x||"object"===(void 0===x?"undefined":_typeof(x))&&null!==x}function isFunction(x){return"function"==typeof x}function setScheduler(scheduleFn){customSchedulerFn=scheduleFn}function setAsap(asapFn){asap=asapFn}function useNextTick(){return function(){return process.nextTick(flush)}}function useVertxTimer(){return function(){vertxNext(flush)}}function useMutationObserver(){var iterations=0,observer=new BrowserMutationObserver(flush),node=document.createTextNode("");return observer.observe(node,{characterData:!0}),function(){node.data=iterations=++iterations%2}}function useMessageChannel(){var channel=new MessageChannel;return channel.port1.onmessage=flush,function(){return channel.port2.postMessage(0)}}function useSetTimeout(){var globalSetTimeout=setTimeout;return function(){return globalSetTimeout(flush,1)}}function flush(){for(var i=0;i<len;i+=2){(0,queue[i])(queue[i+1]),queue[i]=void 0,queue[i+1]=void 0}len=0}function attemptVertx(){try{var r=require,vertx=r("vertx");return vertxNext=vertx.runOnLoop||vertx.runOnContext,useVertxTimer()}catch(e){return useSetTimeout()}}function then(onFulfillment,onRejection){var _arguments=arguments,parent=this,child=new this.constructor(noop);void 0===child[PROMISE_ID]&&makePromise(child);var _state=parent._state;return _state?function(){var callback=_arguments[_state-1];asap(function(){return invokeCallback(_state,child,callback,parent._result)})}():subscribe(parent,child,onFulfillment,onRejection),child}function resolve(object){var Constructor=this;if(object&&"object"===(void 0===object?"undefined":_typeof(object))&&object.constructor===Constructor)return object;var promise=new Constructor(noop);return _resolve(promise,object),promise}function noop(){}function selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function getThen(promise){try{return promise.then}catch(error){return GET_THEN_ERROR.error=error,GET_THEN_ERROR}}function tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function handleForeignThenable(promise,thenable,then){asap(function(promise){var sealed=!1,error=tryThen(then,thenable,function(value){sealed||(sealed=!0,thenable!==value?_resolve(promise,value):fulfill(promise,value))},function(reason){sealed||(sealed=!0,_reject(promise,reason))},"Settle: "+(promise._label||" unknown promise"));!sealed&&error&&(sealed=!0,_reject(promise,error))},promise)}function handleOwnThenable(promise,thenable){thenable._state===FULFILLED?fulfill(promise,thenable._result):thenable._state===REJECTED?_reject(promise,thenable._result):subscribe(thenable,void 0,function(value){return _resolve(promise,value)},function(reason){return _reject(promise,reason)})}function handleMaybeThenable(promise,maybeThenable,then$$){maybeThenable.constructor===promise.constructor&&then$$===then&&maybeThenable.constructor.resolve===resolve?handleOwnThenable(promise,maybeThenable):then$$===GET_THEN_ERROR?_reject(promise,GET_THEN_ERROR.error):void 0===then$$?fulfill(promise,maybeThenable):isFunction(then$$)?handleForeignThenable(promise,maybeThenable,then$$):fulfill(promise,maybeThenable)}function _resolve(promise,value){promise===value?_reject(promise,selfFulfillment()):objectOrFunction(value)?handleMaybeThenable(promise,value,getThen(value)):fulfill(promise,value)}function publishRejection(promise){promise._onerror&&promise._onerror(promise._result),publish(promise)}function fulfill(promise,value){promise._state===PENDING&&(promise._result=value,promise._state=FULFILLED,0!==promise._subscribers.length&&asap(publish,promise))}function _reject(promise,reason){promise._state===PENDING&&(promise._state=REJECTED,promise._result=reason,asap(publishRejection,promise))}function subscribe(parent,child,onFulfillment,onRejection){var _subscribers=parent._subscribers,length=_subscribers.length;parent._onerror=null,_subscribers[length]=child,_subscribers[length+FULFILLED]=onFulfillment,_subscribers[length+REJECTED]=onRejection,0===length&&parent._state&&asap(publish,parent)}function publish(promise){var subscribers=promise._subscribers,settled=promise._state;if(0!==subscribers.length){for(var child=void 0,callback=void 0,detail=promise._result,i=0;i<subscribers.length;i+=3)child=subscribers[i],callback=subscribers[i+settled],child?invokeCallback(settled,child,callback,detail):callback(detail);promise._subscribers.length=0}}function ErrorObject(){this.error=null}function tryCatch(callback,detail){try{return callback(detail)}catch(e){return TRY_CATCH_ERROR.error=e,TRY_CATCH_ERROR}}function invokeCallback(settled,promise,callback,detail){var hasCallback=isFunction(callback),value=void 0,error=void 0,succeeded=void 0,failed=void 0;if(hasCallback){if(value=tryCatch(callback,detail),value===TRY_CATCH_ERROR?(failed=!0,error=value.error,value=null):succeeded=!0,promise===value)return void _reject(promise,cannotReturnOwn())}else value=detail,succeeded=!0;promise._state!==PENDING||(hasCallback&&succeeded?_resolve(promise,value):failed?_reject(promise,error):settled===FULFILLED?fulfill(promise,value):settled===REJECTED&&_reject(promise,value))}function initializePromise(promise,resolver){try{resolver(function(value){_resolve(promise,value)},function(reason){_reject(promise,reason)})}catch(e){_reject(promise,e)}}function nextId(){return id++}function makePromise(promise){promise[PROMISE_ID]=id++,promise._state=void 0,promise._result=void 0,promise._subscribers=[]}function Enumerator(Constructor,input){this._instanceConstructor=Constructor,this.promise=new Constructor(noop),this.promise[PROMISE_ID]||makePromise(this.promise),isArray(input)?(this._input=input,this.length=input.length,this._remaining=input.length,this._result=new Array(this.length),0===this.length?fulfill(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&fulfill(this.promise,this._result))):_reject(this.promise,validationError())}function validationError(){return new Error("Array Methods must be provided an Array")}function all(entries){return new Enumerator(this,entries).promise}function race(entries){var Constructor=this;return new Constructor(isArray(entries)?function(resolve,reject){for(var length=entries.length,i=0;i<length;i++)Constructor.resolve(entries[i]).then(resolve,reject)}:function(_,reject){return reject(new TypeError("You must pass an array to race."))})}function reject(reason){var Constructor=this,promise=new Constructor(noop);return _reject(promise,reason),promise}function needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function Promise(resolver){this[PROMISE_ID]=nextId(),this._result=this._state=void 0,this._subscribers=[],noop!==resolver&&("function"!=typeof resolver&&needsResolver(),this instanceof Promise?initializePromise(this,resolver):needsNew())}function polyfill(){var local=void 0;if(void 0!==global)local=global;else if("undefined"!=typeof self)local=self;else try{local=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=local.Promise;if(P){var promiseToString=null;try{promiseToString=Object.prototype.toString.call(P.resolve())}catch(e){}if("[object Promise]"===promiseToString&&!P.cast)return}local.Promise=Promise}var _isArray=void 0;_isArray=Array.isArray?Array.isArray:function(x){return"[object Array]"===Object.prototype.toString.call(x)};var isArray=_isArray,len=0,vertxNext=void 0,customSchedulerFn=void 0,asap=function(callback,arg){queue[len]=callback,queue[len+1]=arg,2===(len+=2)&&(customSchedulerFn?customSchedulerFn(flush):scheduleFlush())},browserWindow=void 0!==window?window:void 0,browserGlobal=browserWindow||{},BrowserMutationObserver=browserGlobal.MutationObserver||browserGlobal.WebKitMutationObserver,isNode="undefined"==typeof self&&void 0!==process&&"[object process]"==={}.toString.call(process),isWorker="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,queue=new Array(1e3),scheduleFlush=void 0;scheduleFlush=isNode?useNextTick():BrowserMutationObserver?useMutationObserver():isWorker?useMessageChannel():void 0===browserWindow&&"function"==typeof require?attemptVertx():useSetTimeout();var PROMISE_ID=Math.random().toString(36).substring(16),PENDING=void 0,FULFILLED=1,REJECTED=2,GET_THEN_ERROR=new ErrorObject,TRY_CATCH_ERROR=new ErrorObject,id=0;return Enumerator.prototype._enumerate=function(){for(var length=this.length,_input=this._input,i=0;this._state===PENDING&&i<length;i++)this._eachEntry(_input[i],i)},Enumerator.prototype._eachEntry=function(entry,i){var c=this._instanceConstructor,resolve$$=c.resolve;if(resolve$$===resolve){var _then=getThen(entry);if(_then===then&&entry._state!==PENDING)this._settledAt(entry._state,i,entry._result);else if("function"!=typeof _then)this._remaining--,this._result[i]=entry;else if(c===Promise){var promise=new c(noop);handleMaybeThenable(promise,entry,_then),this._willSettleAt(promise,i)}else this._willSettleAt(new c(function(resolve$$){return resolve$$(entry)}),i)}else this._willSettleAt(resolve$$(entry),i)},Enumerator.prototype._settledAt=function(state,i,value){var promise=this.promise;promise._state===PENDING&&(this._remaining--,state===REJECTED?_reject(promise,value):this._result[i]=value),0===this._remaining&&fulfill(promise,this._result)},Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;subscribe(promise,void 0,function(value){return enumerator._settledAt(FULFILLED,i,value)},function(reason){return enumerator._settledAt(REJECTED,i,reason)})},Promise.all=all,Promise.race=race,Promise.resolve=resolve,Promise.reject=reject,Promise._setScheduler=setScheduler,Promise._setAsap=setAsap,Promise._asap=asap,Promise.prototype={constructor:Promise,then:then,catch:function(onRejection){return this.then(null,onRejection)}},polyfill(),Promise.polyfill=polyfill,Promise.Promise=Promise,Promise})}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{_process:105}],153:[function(require,module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"===(void 0===arg?"undefined":_typeof(arg))&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i<len;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners)&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},{}],154:[function(require,module,exports){function EVP_BytesToKey(password,salt,keyLen,ivLen){if(Buffer.isBuffer(password)||(password=Buffer.from(password,"binary")),salt&&(Buffer.isBuffer(salt)||(salt=Buffer.from(salt,"binary")),8!==salt.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var key=Buffer.alloc(keyLen),iv=Buffer.alloc(ivLen),tmp=Buffer.alloc(0);keyLen>0||ivLen>0;){var hash=new MD5;hash.update(tmp),hash.update(password),salt&&hash.update(salt),tmp=hash.digest();var used=0;if(keyLen>0){var keyStart=key.length-keyLen;used=Math.min(keyLen,tmp.length),tmp.copy(key,keyStart,0,used),keyLen-=used}if(used<tmp.length&&ivLen>0){var ivStart=iv.length-ivLen,length=Math.min(ivLen,tmp.length-used);tmp.copy(iv,ivStart,used,used+length),ivLen-=length}}return tmp.fill(0),{key:key,iv:iv}}var Buffer=require("safe-buffer").Buffer,MD5=require("md5.js");module.exports=EVP_BytesToKey},{"md5.js":235,"safe-buffer":341}],155:[function(require,module,exports){function getGlobal(){return(0,eval)("this")}var Parser=require("./lib/parser");module.exports={create:function(buffer,global){if(global=global||getGlobal(),buffer instanceof global.ArrayBuffer){var DOMBufferStream=require("./lib/dom-bufferstream");return new Parser(new DOMBufferStream(buffer,0,buffer.byteLength,!0,global))}var NodeBufferStream=require("./lib/bufferstream");return new Parser(new NodeBufferStream(buffer,0,buffer.length,!0))}}},{"./lib/bufferstream":156,"./lib/dom-bufferstream":158,"./lib/parser":162}],156:[function(require,module,exports){function BufferStream(buffer,offset,length,bigEndian){this.buffer=buffer,this.offset=offset||0,length="number"==typeof length?length:buffer.length,this.endPosition=this.offset+length,this.setBigEndian(bigEndian)}BufferStream.prototype={setBigEndian:function(bigEndian){this.bigEndian=!!bigEndian},nextUInt8:function(){var value=this.buffer.readUInt8(this.offset);return this.offset+=1,value},nextInt8:function(){var value=this.buffer.readInt8(this.offset);return this.offset+=1,value},nextUInt16:function(){var value=this.bigEndian?this.buffer.readUInt16BE(this.offset):this.buffer.readUInt16LE(this.offset);return this.offset+=2,value},nextUInt32:function(){var value=this.bigEndian?this.buffer.readUInt32BE(this.offset):this.buffer.readUInt32LE(this.offset);return this.offset+=4,value},nextInt16:function(){var value=this.bigEndian?this.buffer.readInt16BE(this.offset):this.buffer.readInt16LE(this.offset);return this.offset+=2,value},nextInt32:function(){var value=this.bigEndian?this.buffer.readInt32BE(this.offset):this.buffer.readInt32LE(this.offset);return this.offset+=4,value},nextFloat:function(){var value=this.bigEndian?this.buffer.readFloatBE(this.offset):this.buffer.readFloatLE(this.offset);return this.offset+=4,value},nextDouble:function(){var value=this.bigEndian?this.buffer.readDoubleBE(this.offset):this.buffer.readDoubleLE(this.offset);return this.offset+=8,value},nextBuffer:function(length){var value=this.buffer.slice(this.offset,this.offset+length);return this.offset+=length,value},remainingLength:function(){return this.endPosition-this.offset},nextString:function(length){var value=this.buffer.toString("utf8",this.offset,this.offset+length);return this.offset+=length,value},mark:function(){var self=this;return{openWithOffset:function(offset){return offset=(offset||0)+this.offset,new BufferStream(self.buffer,offset,self.endPosition-offset,self.bigEndian)},offset:this.offset}},offsetFrom:function(marker){return this.offset-marker.offset},skip:function(amount){this.offset+=amount},branch:function(offset,length){return length="number"==typeof length?length:this.endPosition-(this.offset+offset),new BufferStream(this.buffer,this.offset+offset,length,this.bigEndian)}},module.exports=BufferStream},{}],157:[function(require,module,exports){function parseNumber(s){return parseInt(s,10)}function parseDateTimeParts(dateParts,timeParts){dateParts=dateParts.map(parseNumber),timeParts=timeParts.map(parseNumber);var year=dateParts[0],month=dateParts[1]-1,day=dateParts[2],hours=timeParts[0],minutes=timeParts[1],seconds=timeParts[2];return Date.UTC(year,month,day,hours,minutes,seconds,0)/1e3}function parseDateWithTimezoneFormat(dateTimeStr){var dateParts=dateTimeStr.substr(0,10).split("-"),timeParts=dateTimeStr.substr(11,8).split(":"),timezoneStr=dateTimeStr.substr(19,6),timezoneParts=timezoneStr.split(":").map(parseNumber),timezoneOffset=timezoneParts[0]*hours+timezoneParts[1]*minutes,timestamp=parseDateTimeParts(dateParts,timeParts);if("number"==typeof(timestamp-=timezoneOffset)&&!isNaN(timestamp))return timestamp}function parseDateWithSpecFormat(dateTimeStr){var parts=dateTimeStr.split(" "),dateParts=parts[0].split(":"),timeParts=parts[1].split(":"),timestamp=parseDateTimeParts(dateParts,timeParts);if("number"==typeof timestamp&&!isNaN(timestamp))return timestamp}function parseExifDate(dateTimeStr){var isSpecFormat=19===dateTimeStr.length&&":"===dateTimeStr.charAt(4),isTimezoneFormat=25===dateTimeStr.length&&"T"===dateTimeStr.charAt(10);return isTimezoneFormat?parseDateWithTimezoneFormat(dateTimeStr):isSpecFormat?parseDateWithSpecFormat(dateTimeStr):void 0}var hours=3600,minutes=60;module.exports={parseDateWithSpecFormat:parseDateWithSpecFormat,parseDateWithTimezoneFormat:parseDateWithTimezoneFormat,parseExifDate:parseExifDate}},{}],158:[function(require,module,exports){function DOMBufferStream(arrayBuffer,offset,length,bigEndian,global,parentOffset){this.global=global,offset=offset||0,length=length||arrayBuffer.byteLength-offset,this.arrayBuffer=arrayBuffer.slice(offset,offset+length),this.view=new global.DataView(this.arrayBuffer,0,this.arrayBuffer.byteLength),this.setBigEndian(bigEndian),this.offset=0,this.parentOffset=(parentOffset||0)+offset}DOMBufferStream.prototype={setBigEndian:function(bigEndian){this.littleEndian=!bigEndian},nextUInt8:function(){var value=this.view.getUint8(this.offset);return this.offset+=1,value},nextInt8:function(){var value=this.view.getInt8(this.offset);return this.offset+=1,value},nextUInt16:function(){var value=this.view.getUint16(this.offset,this.littleEndian);return this.offset+=2,value},nextUInt32:function(){var value=this.view.getUint32(this.offset,this.littleEndian);return this.offset+=4,value},nextInt16:function(){var value=this.view.getInt16(this.offset,this.littleEndian);return this.offset+=2,value},nextInt32:function(){var value=this.view.getInt32(this.offset,this.littleEndian);return this.offset+=4,value},nextFloat:function(){var value=this.view.getFloat32(this.offset,this.littleEndian);return this.offset+=4,value},nextDouble:function(){var value=this.view.getFloat64(this.offset,this.littleEndian);return this.offset+=8,value},nextBuffer:function(length){var value=this.arrayBuffer.slice(this.offset,this.offset+length);return this.offset+=length,value},remainingLength:function(){return this.arrayBuffer.byteLength-this.offset},nextString:function(length){var value=this.arrayBuffer.slice(this.offset,this.offset+length);return value=String.fromCharCode.apply(null,new this.global.Uint8Array(value)),this.offset+=length,value},mark:function(){var self=this;return{openWithOffset:function(offset){return offset=(offset||0)+this.offset,new DOMBufferStream(self.arrayBuffer,offset,self.arrayBuffer.byteLength-offset,!self.littleEndian,self.global,self.parentOffset)},offset:this.offset,getParentOffset:function(){return self.parentOffset}}},offsetFrom:function(marker){return this.parentOffset+this.offset-(marker.offset+marker.getParentOffset())},skip:function(amount){this.offset+=amount},branch:function(offset,length){return length="number"==typeof length?length:this.arrayBuffer.byteLength-(this.offset+offset),new DOMBufferStream(this.arrayBuffer,this.offset+offset,length,!this.littleEndian,this.global,this.parentOffset)}},module.exports=DOMBufferStream},{}],159:[function(require,module,exports){module.exports={exif:{1:"InteropIndex",2:"InteropVersion",11:"ProcessingSoftware",254:"SubfileType",255:"OldSubfileType",256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Thresholding",264:"CellWidth",265:"CellLength",266:"FillOrder",269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",285:"PageName",286:"XPosition",287:"YPosition",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",292:"T4Options",293:"T6Options",296:"ResolutionUnit",297:"PageNumber",300:"ColorResponseUnit",301:"TransferFunction",305:"Software",306:"ModifyDate",315:"Artist",316:"HostComputer",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",320:"ColorMap",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFD",332:"InkSet",333:"InkNames",334:"NumberofInks",336:"DotRange",337:"TargetPrinter",338:"ExtraSamples",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",435:"T82Options",437:"JPEGTables",512:"JPEGProc",513:"ThumbnailOffset",514:"ThumbnailLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"ApplicationNotes",999:"USPTOMiscellaneous",4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight",18246:"Rating",18247:"XP_DIP_XML",18248:"StitchInfo",18249:"RatingPercent",32781:"ImageID",32931:"WangTag1",32932:"WangAnnotation",32933:"WangTag3",32934:"WangTag4",32995:"Matteing",32996:"DataType",32997:"ImageDepth",32998:"TileDepth",33405:"Model2",33421:"CFARepeatPatternDim",33422:"CFAPattern2",33423:"BatteryLevel",33424:"KodakIFD",33432:"Copyright",33434:"ExposureTime",33437:"FNumber",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"PixelScale",33589:"AdventScale",33590:"AdventRevision",33628:"UIC1Tag",33629:"UIC2Tag",33630:"UIC3Tag",33631:"UIC4Tag",33723:"IPTC-NAA",33918:"IntergraphPacketData",33919:"IntergraphFlagRegisters",33920:"IntergraphMatrix",33921:"INGRReserved",33922:"ModelTiePoint",34016:"Site",34017:"ColorSequence",34018:"IT8Header",34019:"RasterPadding",34020:"BitsPerRunLength",34021:"BitsPerExtendedRunLength",34022:"ColorTable",34023:"ImageColorIndicator",34024:"BackgroundColorIndicator",34025:"ImageColorValue",34026:"BackgroundColorValue",34027:"PixelIntensityRange",34028:"TransparencyIndicator",34029:"ColorCharacterization",34030:"HCUsage",34031:"TrapIndicator",34032:"CMYKEquivalent",34118:"SEMInfo",34152:"AFCP_IPTC",34232:"PixelMagicJBIGOptions",34264:"ModelTransform",34306:"WB_GRGBLevels",34310:"LeafData",34377:"PhotoshopSettings",34665:"ExifOffset",34675:"ICC_Profile",34687:"TIFF_FXExtensions",34688:"MultiProfiles",34689:"SharedData",34690:"T88Options",34732:"ImageLayer",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34850:"ExposureProgram",34852:"SpectralSensitivity",34853:"GPSInfo",34855:"ISO",34856:"Opto-ElectricConvFactor",34857:"Interlace",34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",34908:"FaxRecvParams",34909:"FaxSubAddress",34910:"FaxRecvTime",34954:"LeafSubIFD",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"CreateDate",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureCompensation",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37387:"FlashEnergy",37388:"SpatialFrequencyResponse",37389:"Noise",37390:"FocalPlaneXResolution",37391:"FocalPlaneYResolution",37392:"FocalPlaneResolutionUnit",37393:"ImageNumber",37394:"SecurityClassification",37395:"ImageHistory",37396:"SubjectArea",37397:"ExposureIndex",37398:"TIFF-EPStandardID",37399:"SensingMethod",37434:"CIP3DataFile",37435:"CIP3Sheet",37436:"CIP3Side",37439:"StoNits",37500:"MakerNote",37510:"UserComment",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37679:"MSDocumentText",37680:"MSPropertySetStorage",37681:"MSDocumentTextPosition",37724:"ImageSourceData",40091:"XPTitle",40092:"XPComment",40093:"XPAuthor",40094:"XPKeywords",40095:"XPSubject",40960:"FlashpixVersion",40961:"ColorSpace",40962:"ExifImageWidth",40963:"ExifImageHeight",40964:"RelatedSoundFile",40965:"InteropOffset",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41485:"Noise",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41489:"ImageNumber",41490:"SecurityClassification",41491:"ImageHistory",41492:"SubjectLocation",41493:"ExposureIndex",41494:"TIFF-EPStandardID",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFormat",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"OwnerName",42033:"SerialNumber",42034:"LensInfo",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42112:"GDALMetadata",42113:"GDALNoData",42240:"Gamma",44992:"ExpandSoftware",44993:"ExpandLens",44994:"ExpandFilm",44995:"ExpandFilterLens",44996:"ExpandScanner",44997:"ExpandFlashLamp",48129:"PixelFormat",48130:"Transformation",48131:"Uncompressed",48132:"ImageType",48256:"ImageWidth",48257:"ImageHeight",48258:"WidthResolution",48259:"HeightResolution",48320:"ImageOffset",48321:"ImageByteCount",48322:"AlphaOffset",48323:"AlphaByteCount",48324:"ImageDataDiscard",48325:"AlphaDataDiscard",50215:"OceScanjobDesc",50216:"OceApplicationSelector",50217:"OceIDNumber",50218:"OceImageLogic",50255:"Annotations",50341:"PrintIM",50560:"USPTOOriginalContentType",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50739:"ShadowScale",50740:"DNGPrivateData",50741:"MakerNoteSafety",50752:"RawImageSegmentation",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50781:"RawDataUniqueID",50784:"AliasLayerMetadata",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50829:"ActiveArea",50830:"MaskedAreas",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50935:"NoiseReductionApplied",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:"ProfileEmbedPolicy",50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:"PreviewColorSpace",50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50974:"SubTileBlockSize",50975:"RowInterleaveFactor",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51008:"OpcodeList1",51009:"OpcodeList2",51022:"OpcodeList3",51041:"NoiseProfile",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:"ProfileHueSatMapEncoding",51108:"ProfileLookTableEncoding",51109:"BaselineExposureOffset",51110:"DefaultBlackRender",51111:"NewRawImageDigest",51112:"RawToPreviewGain",51125:"DefaultUserCrop",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65024:"KDC_IFD",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"}}},{}],160:[function(require,module,exports){function readExifValue(format,stream){switch(format){case 1:return stream.nextUInt8();case 3:return stream.nextUInt16();case 4:return stream.nextUInt32();case 5:return[stream.nextUInt32(),stream.nextUInt32()];case 6:return stream.nextInt8();case 8:return stream.nextUInt16();case 9:return stream.nextUInt32();case 10:return[stream.nextInt32(),stream.nextInt32()];case 11:return stream.nextFloat();case 12:return stream.nextDouble();default:throw new Error("Invalid format while decoding: "+format)}}function getBytesPerComponent(format){switch(format){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}}function readExifTag(tiffMarker,stream){var values,c,tagType=stream.nextUInt16(),format=stream.nextUInt16(),bytesPerComponent=getBytesPerComponent(format),components=stream.nextUInt32(),valueBytes=bytesPerComponent*components;if(valueBytes>4&&(stream=tiffMarker.openWithOffset(stream.nextUInt32())),2===format){values=stream.nextString(components);var lastNull=values.indexOf("\0");-1!==lastNull&&(values=values.substr(0,lastNull))}else if(7===format)values=stream.nextBuffer(components);else if(0!==format)for(values=[],c=0;c<components;++c)values.push(readExifValue(format,stream));return valueBytes<4&&stream.skip(4-valueBytes),[tagType,values,format]}function readIFDSection(tiffMarker,stream,iterator){var tag,i,numberOfEntries=stream.nextUInt16();for(i=0;i<numberOfEntries;++i)tag=readExifTag(tiffMarker,stream),iterator(tag[0],tag[1],tag[2])}function readHeader(stream){if("Exif\0\0"!==stream.nextString(6))throw new Error("Invalid EXIF header");var tiffMarker=stream.mark(),tiffHeader=stream.nextUInt16();if(18761===tiffHeader)stream.setBigEndian(!1);else{if(19789!==tiffHeader)throw new Error("Invalid TIFF header");stream.setBigEndian(!0)}if(42!==stream.nextUInt16())throw new Error("Invalid TIFF data");return tiffMarker}module.exports={IFD0:1,IFD1:2,GPSIFD:3,SubIFD:4,InteropIFD:5,parseTags:function(stream,iterator){var tiffMarker;try{tiffMarker=readHeader(stream)}catch(e){return!1}var subIfdOffset,gpsOffset,interopOffset,ifd0Stream=tiffMarker.openWithOffset(stream.nextUInt32()),IFD0=this.IFD0;readIFDSection(tiffMarker,ifd0Stream,function(tagType,value,format){switch(tagType){case 34853:gpsOffset=value[0];break;case 34665:subIfdOffset=value[0];break;default:iterator(IFD0,tagType,value,format)}});var ifd1Offset=ifd0Stream.nextUInt32();if(0!==ifd1Offset){readIFDSection(tiffMarker,tiffMarker.openWithOffset(ifd1Offset),iterator.bind(null,this.IFD1))}if(gpsOffset){readIFDSection(tiffMarker,tiffMarker.openWithOffset(gpsOffset),iterator.bind(null,this.GPSIFD))}if(subIfdOffset){var subIfdStream=tiffMarker.openWithOffset(subIfdOffset),InteropIFD=this.InteropIFD;readIFDSection(tiffMarker,subIfdStream,function(tagType,value,format){40965===tagType?interopOffset=value[0]:iterator(InteropIFD,tagType,value,format)})}if(interopOffset){readIFDSection(tiffMarker,tiffMarker.openWithOffset(interopOffset),iterator.bind(null,this.InteropIFD))}return!0}}},{}],161:[function(require,module,exports){module.exports={parseSections:function(stream,iterator){var len,markerType;for(stream.setBigEndian(!0);stream.remainingLength()>0&&218!==markerType;){if(255!==stream.nextUInt8())throw new Error("Invalid JPEG section offset");markerType=stream.nextUInt8(),len=markerType>=208&&markerType<=217||218===markerType?0:stream.nextUInt16()-2,iterator(markerType,stream.branch(0,len)),stream.skip(len)}},getSizeFromSOFSection:function(stream){return stream.skip(1),{height:stream.nextUInt16(),width:stream.nextUInt16()}},getSectionName:function(markerType){var name,index;switch(markerType){case 216:name="SOI";break;case 196:name="DHT";break;case 219:name="DQT";break;case 221:name="DRI";break;case 218:name="SOS";break;case 254:name="COM";break;case 217:name="EOI";break;default:markerType>=224&&markerType<=239?(name="APP",index=markerType-224):markerType>=192&&markerType<=207&&196!==markerType&&200!==markerType&&204!==markerType?(name="SOF",index=markerType-192):markerType>=208&&markerType<=215&&(name="RST",index=markerType-208)}var nameStruct={name:name};return"number"==typeof index&&(nameStruct.index=index),nameStruct}}},{}],162:[function(require,module,exports){function ExifResult(startMarker,tags,imageSize,thumbnailOffset,thumbnailLength,thumbnailType,app1Offset){this.startMarker=startMarker,this.tags=tags,this.imageSize=imageSize,this.thumbnailOffset=thumbnailOffset,this.thumbnailLength=thumbnailLength,this.thumbnailType=thumbnailType,this.app1Offset=app1Offset}function Parser(stream){this.stream=stream,this.flags={readBinaryTags:!1,resolveTagNames:!0,simplifyValues:!0,imageSize:!0,hidePointers:!0,returnTags:!0}}var jpeg=require("./jpeg"),exif=require("./exif"),simplify=require("./simplify");ExifResult.prototype={hasThumbnail:function(mime){return!(!this.thumbnailOffset||!this.thumbnailLength)&&("string"!=typeof mime||("image/jpeg"===mime.toLowerCase().trim()?6===this.thumbnailType:"image/tiff"===mime.toLowerCase().trim()&&1===this.thumbnailType))},getThumbnailOffset:function(){return this.app1Offset+6+this.thumbnailOffset},getThumbnailLength:function(){return this.thumbnailLength},getThumbnailBuffer:function(){return this._getThumbnailStream().nextBuffer(this.thumbnailLength)},_getThumbnailStream:function(){return this.startMarker.openWithOffset(this.getThumbnailOffset())},getImageSize:function(){return this.imageSize},getThumbnailSize:function(){var size,stream=this._getThumbnailStream();return jpeg.parseSections(stream,function(sectionType,sectionStream){"SOF"===jpeg.getSectionName(sectionType).name&&(size=jpeg.getSizeFromSOFSection(sectionStream))}),size}},Parser.prototype={enableBinaryFields:function(enable){return this.flags.readBinaryTags=!!enable,this},enablePointers:function(enable){return this.flags.hidePointers=!enable,this},enableTagNames:function(enable){return this.flags.resolveTagNames=!!enable,this},enableImageSize:function(enable){return this.flags.imageSize=!!enable,this},enableReturnTags:function(enable){return this.flags.returnTags=!!enable,this},enableSimpleValues:function(enable){return this.flags.simplifyValues=!!enable,this},parse:function(){var tags,imageSize,thumbnailOffset,thumbnailLength,thumbnailType,app1Offset,tagNames,getTagValue,setTagValue,start=this.stream.mark(),stream=start.openWithOffset(0),flags=this.flags;return flags.resolveTagNames&&(tagNames=require("./exif-tags")),flags.resolveTagNames?(tags={},getTagValue=function(t){return tags[t.name]},setTagValue=function(t,value){tags[t.name]=value}):(tags=[],getTagValue=function(t){var i;for(i=0;i<tags.length;++i)if(tags[i].type===t.type&&tags[i].section===t.section)return tags.value},setTagValue=function(t,value){var i;for(i=0;i<tags.length;++i)if(tags[i].type===t.type&&tags[i].section===t.section)return void(tags.value=value)}),jpeg.parseSections(stream,function(sectionType,sectionStream){var sectionOffset=sectionStream.offsetFrom(start);225===sectionType?exif.parseTags(sectionStream,function(ifdSection,tagType,value,format){if(flags.readBinaryTags||7!==format){if(513===tagType){if(thumbnailOffset=value[0],flags.hidePointers)return}else if(514===tagType){if(thumbnailLength=value[0],flags.hidePointers)return}else if(259===tagType&&(thumbnailType=value[0],flags.hidePointers))return;if(flags.returnTags)if(flags.simplifyValues&&(value=simplify.simplifyValue(value,format)),flags.resolveTagNames){var sectionTagNames=ifdSection===exif.GPSIFD?tagNames.gps:tagNames.exif,name=sectionTagNames[tagType];name||(name=tagNames.exif[tagType]),tags.hasOwnProperty(name)||(tags[name]=value)}else tags.push({section:ifdSection,type:tagType,value:value})}})&&(app1Offset=sectionOffset):flags.imageSize&&"SOF"===jpeg.getSectionName(sectionType).name&&(imageSize=jpeg.getSizeFromSOFSection(sectionStream))}),flags.simplifyValues&&(simplify.castDegreeValues(getTagValue,setTagValue),simplify.castDateValues(getTagValue,setTagValue)),new ExifResult(start,tags,imageSize,thumbnailOffset,thumbnailLength,thumbnailType,app1Offset)}},module.exports=Parser},{"./exif":160,"./exif-tags":159,"./jpeg":161,"./simplify":163}],163:[function(require,module,exports){var exif=require("./exif"),date=require("./date"),degreeTags=[{section:exif.GPSIFD,type:2,name:"GPSLatitude",refType:1,refName:"GPSLatitudeRef",posVal:"N"},{section:exif.GPSIFD,type:4,name:"GPSLongitude",refType:3,refName:"GPSLongitudeRef",posVal:"E"}],dateTags=[{section:exif.SubIFD,type:306,name:"ModifyDate"},{section:exif.SubIFD,type:36867,name:"DateTimeOriginal"},{section:exif.SubIFD,type:36868,name:"CreateDate"},{section:exif.SubIFD,type:306,name:"ModifyDate"}];module.exports={castDegreeValues:function(getTagValue,setTagValue){degreeTags.forEach(function(t){var degreeVal=getTagValue(t);if(degreeVal){var degreeRef=getTagValue({section:t.section,type:t.refType,name:t.refName}),degreeNumRef=degreeRef===t.posVal?1:-1,degree=(degreeVal[0]+degreeVal[1]/60+degreeVal[2]/3600)*degreeNumRef;setTagValue(t,degree)}})},castDateValues:function(getTagValue,setTagValue){dateTags.forEach(function(t){var dateStrVal=getTagValue(t);if(dateStrVal){var timestamp=date.parseExifDate(dateStrVal);void 0!==timestamp&&setTagValue(t,timestamp)}})},simplifyValue:function(values,format){return Array.isArray(values)&&(values=values.map(function(value){return 10===format||5===format?value[0]/value[1]:value}),1===values.length&&(values=values[0])),values}}},{"./date":157,"./exif":160}],164:[function(require,module,exports){var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,isArray=function(arr){return"function"==typeof Array.isArray?Array.isArray(arr):"[object Array]"===toStr.call(arr)},isPlainObject=function(obj){if(!obj||"[object Object]"!==toStr.call(obj))return!1;var hasOwnConstructor=hasOwn.call(obj,"constructor"),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn.call(obj.constructor.prototype,"isPrototypeOf");if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;var key;for(key in obj);return void 0===key||hasOwn.call(obj,key)};module.exports=function extend(){var options,name,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[1]||{},i=2),(null==target||"object"!==(void 0===target?"undefined":_typeof(target))&&"function"!=typeof target)&&(target={});i<length;++i)if(null!=(options=arguments[i]))for(name in options)src=target[name],copy=options[name],target!==copy&&(deep&&copy&&(isPlainObject(copy)||(copyIsArray=isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&isArray(src)?src:[]):clone=src&&isPlainObject(src)?src:{},target[name]=extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target}},{}],165:[function(require,module,exports){(function(process){function jsSprintf(fmt){var flags,width,precision,conversion,left,pad,sign,arg,match,regex=["([^%]*)","%","(['\\-+ #0]*?)","([1-9]\\d*)?","(\\.([1-9]\\d*))?","[lhjztL]*?","([diouxXfFeEgGaAcCsSp%jr])"].join(""),re=new RegExp(regex),args=Array.prototype.slice.call(arguments,1),ret="",argn=1;for(mod_assert.equal("string",void 0===fmt?"undefined":_typeof(fmt));null!==(match=re.exec(fmt));)if(ret+=match[1],fmt=fmt.substring(match[0].length),flags=match[2]||"",width=match[3]||0,precision=match[4]||"",conversion=match[6],left=!1,sign=!1,pad=" ","%"!=conversion){if(0===args.length)throw new Error("too few args to sprintf");if(arg=args.shift(),argn++,flags.match(/[\' #]/))throw new Error("unsupported flags: "+flags);if(precision.length>0)throw new Error("non-zero precision not supported");switch(flags.match(/-/)&&(left=!0),flags.match(/0/)&&(pad="0"),flags.match(/\+/)&&(sign=!0),conversion){case"s":if(void 0===arg||null===arg)throw new Error("argument "+argn+": attempted to print undefined or null as a string");ret+=doPad(pad,width,left,arg.toString());break;case"d":arg=Math.floor(arg);case"f":sign=sign&&arg>0?"+":"",ret+=sign+doPad(pad,width,left,arg.toString());break;case"x":ret+=doPad(pad,width,left,arg.toString(16));break;case"j":0===width&&(width=10),ret+=mod_util.inspect(arg,!1,width);break;case"r":ret+=dumpException(arg);break;default:throw new Error("unsupported conversion: "+conversion)}}else ret+="%";return ret+=fmt}function jsPrintf(){var args=Array.prototype.slice.call(arguments);args.unshift(process.stdout),jsFprintf.apply(null,args)}function jsFprintf(stream){var args=Array.prototype.slice.call(arguments,1);return stream.write(jsSprintf.apply(this,args))}function doPad(chr,width,left,str){for(var ret=str;ret.length<width;)left?ret+=chr:ret=chr+ret;return ret}function dumpException(ex){var ret;if(!(ex instanceof Error))throw new Error(jsSprintf("invalid type for %%r: %j",ex));if(ret="EXCEPTION: "+ex.constructor.name+": "+ex.stack,ex.cause&&"function"==typeof ex.cause){var cex=ex.cause();cex&&(ret+="\nCaused by: "+dumpException(cex))}return ret}var mod_assert=require("assert"),mod_util=require("util");exports.sprintf=jsSprintf,exports.printf=jsPrintf,exports.fprintf=jsFprintf}).call(this,require("_process"))},{_process:105,assert:64,util:400}],166:[function(require,module,exports){module.exports=function(buf){return buf&&buf.length>1?255===buf[0]&&216===buf[1]&&255===buf[2]?{ext:"jpg",mime:"image/jpeg"}:137===buf[0]&&80===buf[1]&&78===buf[2]&&71===buf[3]?{ext:"png",mime:"image/png"}:71===buf[0]&&73===buf[1]&&70===buf[2]?{ext:"gif",mime:"image/gif"}:87===buf[8]&&69===buf[9]&&66===buf[10]&&80===buf[11]?{ext:"webp",mime:"image/webp"}:70===buf[0]&&76===buf[1]&&73===buf[2]&&70===buf[3]?{ext:"flif",mime:"image/flif"}:(73===buf[0]&&73===buf[1]&&42===buf[2]&&0===buf[3]||77===buf[0]&&77===buf[1]&&0===buf[2]&&42===buf[3])&&67===buf[8]&&82===buf[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===buf[0]&&73===buf[1]&&42===buf[2]&&0===buf[3]||77===buf[0]&&77===buf[1]&&0===buf[2]&&42===buf[3]?{ext:"tif",mime:"image/tiff"}:66===buf[0]&&77===buf[1]?{ext:"bmp",mime:"image/bmp"}:73===buf[0]&&73===buf[1]&&188===buf[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===buf[0]&&66===buf[1]&&80===buf[2]&&83===buf[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===buf[0]&&75===buf[1]&&3===buf[2]&&4===buf[3]&&109===buf[30]&&105===buf[31]&&109===buf[32]&&101===buf[33]&&116===buf[34]&&121===buf[35]&&112===buf[36]&&101===buf[37]&&97===buf[38]&&112===buf[39]&&112===buf[40]&&108===buf[41]&&105===buf[42]&&99===buf[43]&&97===buf[44]&&116===buf[45]&&105===buf[46]&&111===buf[47]&&110===buf[48]&&47===buf[49]&&101===buf[50]&&112===buf[51]&&117===buf[52]&&98===buf[53]&&43===buf[54]&&122===buf[55]&&105===buf[56]&&112===buf[57]?{ext:"epub",mime:"application/epub+zip"}:80===buf[0]&&75===buf[1]&&3===buf[2]&&4===buf[3]&&77===buf[30]&&69===buf[31]&&84===buf[32]&&65===buf[33]&&45===buf[34]&&73===buf[35]&&78===buf[36]&&70===buf[37]&&47===buf[38]&&109===buf[39]&&111===buf[40]&&122===buf[41]&&105===buf[42]&&108===buf[43]&&108===buf[44]&&97===buf[45]&&46===buf[46]&&114===buf[47]&&115===buf[48]&&97===buf[49]?{ext:"xpi",mime:"application/x-xpinstall"}:80!==buf[0]||75!==buf[1]||3!==buf[2]&&5!==buf[2]&&7!==buf[2]||4!==buf[3]&&6!==buf[3]&&8!==buf[3]?117===buf[257]&&115===buf[258]&&116===buf[259]&&97===buf[260]&&114===buf[261]?{ext:"tar",mime:"application/x-tar"}:82!==buf[0]||97!==buf[1]||114!==buf[2]||33!==buf[3]||26!==buf[4]||7!==buf[5]||0!==buf[6]&&1!==buf[6]?31===buf[0]&&139===buf[1]&&8===buf[2]?{ext:"gz",mime:"application/gzip"}:66===buf[0]&&90===buf[1]&&104===buf[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===buf[0]&&122===buf[1]&&188===buf[2]&&175===buf[3]&&39===buf[4]&&28===buf[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===buf[0]&&1===buf[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===buf[0]&&0===buf[1]&&0===buf[2]&&(24===buf[3]||32===buf[3])&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]||51===buf[0]&&103===buf[1]&&112===buf[2]&&53===buf[3]||0===buf[0]&&0===buf[1]&&0===buf[2]&&28===buf[3]&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]&&109===buf[8]&&112===buf[9]&&52===buf[10]&&50===buf[11]&&109===buf[16]&&112===buf[17]&&52===buf[18]&&49===buf[19]&&109===buf[20]&&112===buf[21]&&52===buf[22]&&50===buf[23]&&105===buf[24]&&115===buf[25]&&111===buf[26]&&109===buf[27]||0===buf[0]&&0===buf[1]&&0===buf[2]&&28===buf[3]&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]&&105===buf[8]&&115===buf[9]&&111===buf[10]&&109===buf[11]||0===buf[0]&&0===buf[1]&&0===buf[2]&&28===buf[3]&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]&&109===buf[8]&&112===buf[9]&&52===buf[10]&&50===buf[11]&&0===buf[12]&&0===buf[13]&&0===buf[14]&&0===buf[15]?{ext:"mp4",mime:"video/mp4"}:0===buf[0]&&0===buf[1]&&0===buf[2]&&28===buf[3]&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]&&77===buf[8]&&52===buf[9]&&86===buf[10]?{ext:"m4v",mime:"video/x-m4v"}:77===buf[0]&&84===buf[1]&&104===buf[2]&&100===buf[3]?{ext:"mid",mime:"audio/midi"}:109===buf[31]&&97===buf[32]&&116===buf[33]&&114===buf[34]&&111===buf[35]&&115===buf[36]&&107===buf[37]&&97===buf[38]?{ext:"mkv",mime:"video/x-matroska"}:26===buf[0]&&69===buf[1]&&223===buf[2]&&163===buf[3]?{ext:"webm",mime:"video/webm"}:0===buf[0]&&0===buf[1]&&0===buf[2]&&20===buf[3]&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]?{ext:"mov",mime:"video/quicktime"}:82===buf[0]&&73===buf[1]&&70===buf[2]&&70===buf[3]&&65===buf[8]&&86===buf[9]&&73===buf[10]?{ext:"avi",mime:"video/x-msvideo"}:48===buf[0]&&38===buf[1]&&178===buf[2]&&117===buf[3]&&142===buf[4]&&102===buf[5]&&207===buf[6]&&17===buf[7]&&166===buf[8]&&217===buf[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===buf[0]&&0===buf[1]&&1===buf[2]&&"b"===buf[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===buf[0]&&68===buf[1]&&51===buf[2]||255===buf[0]&&251===buf[1]?{ext:"mp3",mime:"audio/mpeg"}:102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7]&&77===buf[8]&&52===buf[9]&&65===buf[10]||77===buf[0]&&52===buf[1]&&65===buf[2]&&32===buf[3]?{ext:"m4a",mime:"audio/m4a"}:79===buf[28]&&112===buf[29]&&117===buf[30]&&115===buf[31]&&72===buf[32]&&101===buf[33]&&97===buf[34]&&100===buf[35]?{ext:"opus",mime:"audio/opus"}:79===buf[0]&&103===buf[1]&&103===buf[2]&&83===buf[3]?{ext:"ogg",mime:"audio/ogg"}:102===buf[0]&&76===buf[1]&&97===buf[2]&&67===buf[3]?{ext:"flac",mime:"audio/x-flac"}:82===buf[0]&&73===buf[1]&&70===buf[2]&&70===buf[3]&&87===buf[8]&&65===buf[9]&&86===buf[10]&&69===buf[11]?{ext:"wav",mime:"audio/x-wav"}:35===buf[0]&&33===buf[1]&&65===buf[2]&&77===buf[3]&&82===buf[4]&&10===buf[5]?{ext:"amr",mime:"audio/amr"}:37===buf[0]&&80===buf[1]&&68===buf[2]&&70===buf[3]?{ext:"pdf",mime:"application/pdf"}:77===buf[0]&&90===buf[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==buf[0]&&70!==buf[0]||87!==buf[1]||83!==buf[2]?123===buf[0]&&92===buf[1]&&114===buf[2]&&116===buf[3]&&102===buf[4]?{ext:"rtf",mime:"application/rtf"}:119===buf[0]&&79===buf[1]&&70===buf[2]&&70===buf[3]&&(0===buf[4]&&1===buf[5]&&0===buf[6]&&0===buf[7]||79===buf[4]&&84===buf[5]&&84===buf[6]&&79===buf[7])?{ext:"woff",mime:"application/font-woff"}:119===buf[0]&&79===buf[1]&&70===buf[2]&&50===buf[3]&&(0===buf[4]&&1===buf[5]&&0===buf[6]&&0===buf[7]||79===buf[4]&&84===buf[5]&&84===buf[6]&&79===buf[7])?{ext:"woff2",mime:"application/font-woff"}:76===buf[34]&&80===buf[35]&&(0===buf[8]&&0===buf[9]&&1===buf[10]||1===buf[8]&&0===buf[9]&&2===buf[10]||2===buf[8]&&0===buf[9]&&2===buf[10])?{ext:"eot",mime:"application/octet-stream"}:0===buf[0]&&1===buf[1]&&0===buf[2]&&0===buf[3]&&0===buf[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===buf[0]&&84===buf[1]&&84===buf[2]&&79===buf[3]&&0===buf[4]?{ext:"otf",mime:"application/font-sfnt"}:0===buf[0]&&0===buf[1]&&1===buf[2]&&0===buf[3]?{ext:"ico",mime:"image/x-icon"}:70===buf[0]&&76===buf[1]&&86===buf[2]&&1===buf[3]?{ext:"flv",mime:"video/x-flv"}:37===buf[0]&&33===buf[1]?{ext:"ps",mime:"application/postscript"}:253===buf[0]&&55===buf[1]&&122===buf[2]&&88===buf[3]&&90===buf[4]&&0===buf[5]?{ext:"xz",mime:"application/x-xz"}:83===buf[0]&&81===buf[1]&&76===buf[2]&&105===buf[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===buf[0]&&69===buf[1]&&83===buf[2]&&26===buf[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===buf[0]&&114===buf[1]&&50===buf[2]&&52===buf[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===buf[0]&&83===buf[1]&&67===buf[2]&&70===buf[3]||73===buf[0]&&83===buf[1]&&99===buf[2]&&40===buf[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===buf[0]&&60===buf[1]&&97===buf[2]&&114===buf[3]&&99===buf[4]&&104===buf[5]&&62===buf[6]&&10===buf[7]&&100===buf[8]&&101===buf[9]&&98===buf[10]&&105===buf[11]&&97===buf[12]&&110===buf[13]&&45===buf[14]&&98===buf[15]&&105===buf[16]&&110===buf[17]&&97===buf[18]&&114===buf[19]&&121===buf[20]?{ext:"deb",mime:"application/x-deb"}:33===buf[0]&&60===buf[1]&&97===buf[2]&&114===buf[3]&&99===buf[4]&&104===buf[5]&&62===buf[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===buf[0]&&171===buf[1]&&238===buf[2]&&219===buf[3]?{ext:"rpm",mime:"application/x-rpm"}:31===buf[0]&&160===buf[1]||31===buf[0]&&157===buf[1]?{ext:"Z",mime:"application/x-compress"}:76===buf[0]&&90===buf[1]&&73===buf[2]&&80===buf[3]?{ext:"lz",mime:"application/x-lzip"}:208===buf[0]&&207===buf[1]&&17===buf[2]&&224===buf[3]&&161===buf[4]&&177===buf[5]&&26===buf[6]&&225===buf[7]?{ext:"msi",mime:"application/x-msi"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}:{ext:"rar",mime:"application/x-rar-compressed"}:{ext:"zip",mime:"application/zip"}:null}},{}],167:[function(require,module,exports){function forEach(list,iterator,context){if(!isFunction(iterator))throw new TypeError("iterator must be a function");arguments.length<3&&(context=this),"[object Array]"===toString.call(list)?forEachArray(list,iterator,context):"string"==typeof list?forEachString(list,iterator,context):forEachObject(list,iterator,context)}function forEachArray(array,iterator,context){for(var i=0,len=array.length;i<len;i++)hasOwnProperty.call(array,i)&&iterator.call(context,array[i],i,array)}function forEachString(string,iterator,context){for(var i=0,len=string.length;i<len;i++)iterator.call(context,string.charAt(i),i,string)}function forEachObject(object,iterator,context){for(var k in object)hasOwnProperty.call(object,k)&&iterator.call(context,object[k],k,object)}var isFunction=require("is-function");module.exports=forEach;var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty},{"is-function":217}],168:[function(require,module,exports){function getConnectionName(host,port){return"string"==typeof host?host+":"+port:host.host+":"+host.port+":"+(host.localAddress?host.localAddress+":":":")}function ForeverAgent(options){var self=this;self.options=options||{},self.requests={},self.sockets={},self.freeSockets={},self.maxSockets=self.options.maxSockets||Agent.defaultMaxSockets,self.minSockets=self.options.minSockets||ForeverAgent.defaultMinSockets,self.on("free",function(socket,host,port){var name=getConnectionName(host,port);if(self.requests[name]&&self.requests[name].length)self.requests[name].shift().onSocket(socket);else if(self.sockets[name].length<self.minSockets){self.freeSockets[name]||(self.freeSockets[name]=[]),self.freeSockets[name].push(socket);var onIdleError=function(){socket.destroy()};socket._onIdleError=onIdleError,socket.on("error",onIdleError)}else socket.destroy()})}function ForeverAgentSSL(options){ForeverAgent.call(this,options)}function createConnectionSSL(port,host,options){return options="object"===(void 0===port?"undefined":_typeof(port))?port:"object"===(void 0===host?"undefined":_typeof(host))?host:"object"===(void 0===options?"undefined":_typeof(options))?options:{},"number"==typeof port&&(options.port=port),"string"==typeof host&&(options.host=host),tls.connect(options)}module.exports=ForeverAgent,ForeverAgent.SSL=ForeverAgentSSL;var util=require("util"),Agent=require("http").Agent,net=require("net"),tls=require("tls"),AgentSSL=require("https").Agent;util.inherits(ForeverAgent,Agent),ForeverAgent.defaultMinSockets=5,ForeverAgent.prototype.createConnection=net.createConnection,ForeverAgent.prototype.addRequestNoreuse=Agent.prototype.addRequest,ForeverAgent.prototype.addRequest=function(req,host,port){var name=getConnectionName(host,port);if("string"!=typeof host){var options=host;port=options.port,host=options.host}if(this.freeSockets[name]&&this.freeSockets[name].length>0&&!req.useChunkedEncodingByDefault){var idleSocket=this.freeSockets[name].pop();idleSocket.removeListener("error",idleSocket._onIdleError),delete idleSocket._onIdleError,req._reusedSocket=!0,req.onSocket(idleSocket)}else this.addRequestNoreuse(req,host,port)},ForeverAgent.prototype.removeSocket=function(s,name,host,port){if(this.sockets[name]){var index=this.sockets[name].indexOf(s);-1!==index&&this.sockets[name].splice(index,1)}else this.sockets[name]&&0===this.sockets[name].length&&(delete this.sockets[name],delete this.requests[name]);if(this.freeSockets[name]){var index=this.freeSockets[name].indexOf(s);-1!==index&&(this.freeSockets[name].splice(index,1),0===this.freeSockets[name].length&&delete this.freeSockets[name])}this.requests[name]&&this.requests[name].length&&this.createSocket(name,host,port).emit("free")},util.inherits(ForeverAgentSSL,ForeverAgent),ForeverAgentSSL.prototype.createConnection=createConnectionSSL,ForeverAgentSSL.prototype.addRequestNoreuse=AgentSSL.prototype.addRequest},{http:375,https:212,net:104,tls:104,util:400}],169:[function(require,module,exports){module.exports="object"==("undefined"==typeof self?"undefined":_typeof(self))?self.FormData:window.FormData},{}],170:[function(require,module,exports){(function(global){var win;win=void 0!==window?window:void 0!==global?global:"undefined"!=typeof self?self:{},module.exports=win}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0!==window?window:{})},{}],171:[function(require,module,exports){module.exports={id:"afterRequest.json#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],172:[function(require,module,exports){module.exports={id:"beforeRequest.json#",type:"object",optional:!0,required:["lastAccess","eTag","hitCount"],properties:{expires:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},lastAccess:{type:"string",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},eTag:{type:"string"},hitCount:{type:"integer"},comment:{type:"string"}}}},{}],173:[function(require,module,exports){module.exports={id:"browser.json#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],174:[function(require,module,exports){module.exports={id:"cache.json#",properties:{beforeRequest:{oneOf:[{type:"null"},{$ref:"beforeRequest.json#"}]},afterRequest:{oneOf:[{type:"null"},{$ref:"afterRequest.json#"}]},comment:{type:"string"}}}},{}],175:[function(require,module,exports){module.exports={id:"content.json#",type:"object",required:["size","mimeType"],properties:{size:{type:"integer"},compression:{type:"integer"},mimeType:{type:"string"},text:{type:"string"},encoding:{type:"string"},comment:{type:"string"}}}},{}],176:[function(require,module,exports){module.exports={id:"cookie.json#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},path:{type:"string"},domain:{type:"string"},expires:{type:["string","null"],format:"date-time"},httpOnly:{type:"boolean"},secure:{type:"boolean"},comment:{type:"string"}}}},{}],177:[function(require,module,exports){module.exports={id:"creator.json#",type:"object",required:["name","version"],properties:{name:{type:"string"},version:{type:"string"},comment:{type:"string"}}}},{}],178:[function(require,module,exports){module.exports={id:"entry.json#",type:"object",optional:!0,required:["startedDateTime","time","request","response","cache","timings"],properties:{pageref:{type:"string"},startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},time:{type:"number",min:0},request:{$ref:"request.json#"},response:{$ref:"response.json#"},cache:{$ref:"cache.json#"},timings:{$ref:"timings.json#"},serverIPAddress:{type:"string",oneOf:[{format:"ipv4"},{format:"ipv6"}]},connection:{type:"string"},comment:{type:"string"}}}},{}],179:[function(require,module,exports){module.exports={id:"har.json#",type:"object",required:["log"],properties:{log:{$ref:"log.json#"}}}},{}],180:[function(require,module,exports){module.exports={id:"header.json#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],181:[function(require,module,exports){module.exports={afterRequest:require("./afterRequest.json"),beforeRequest:require("./beforeRequest.json"),browser:require("./browser.json"),cache:require("./cache.json"),content:require("./content.json"),cookie:require("./cookie.json"),creator:require("./creator.json"),entry:require("./entry.json"),har:require("./har.json"),header:require("./header.json"),log:require("./log.json"),page:require("./page.json"),pageTimings:require("./pageTimings.json"),postData:require("./postData.json"),query:require("./query.json"),request:require("./request.json"),response:require("./response.json"),timings:require("./timings.json")}},{"./afterRequest.json":171,"./beforeRequest.json":172,"./browser.json":173,"./cache.json":174,"./content.json":175,"./cookie.json":176,"./creator.json":177,"./entry.json":178,"./har.json":179,"./header.json":180,"./log.json":182,"./page.json":183,"./pageTimings.json":184,"./postData.json":185,"./query.json":186,"./request.json":187,"./response.json":188,"./timings.json":189}],182:[function(require,module,exports){module.exports={id:"log.json#",type:"object",required:["version","creator","entries"],properties:{version:{type:"string"},creator:{$ref:"creator.json#"},browser:{$ref:"browser.json#"},pages:{type:"array",items:{$ref:"page.json#"}},entries:{type:"array",items:{$ref:"entry.json#"}},comment:{type:"string"}}}},{}],183:[function(require,module,exports){module.exports={id:"page.json#",type:"object",optional:!0,required:["startedDateTime","id","title","pageTimings"],properties:{startedDateTime:{type:"string",format:"date-time",pattern:"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},id:{type:"string",unique:!0},title:{type:"string"},pageTimings:{$ref:"pageTimings.json#"},comment:{type:"string"}}}},{}],184:[function(require,module,exports){module.exports={id:"pageTimings.json#",type:"object",properties:{onContentLoad:{type:"number",min:-1},onLoad:{type:"number",min:-1},comment:{type:"string"}}}},{}],185:[function(require,module,exports){module.exports={id:"postData.json#",type:"object",optional:!0,required:["mimeType"],properties:{mimeType:{type:"string"},text:{type:"string"},params:{type:"array",required:["name"],properties:{name:{type:"string"},value:{type:"string"},fileName:{type:"string"},contentType:{type:"string"},comment:{type:"string"}}},comment:{type:"string"}}}},{}],186:[function(require,module,exports){module.exports={id:"query.json#",type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"},comment:{type:"string"}}}},{}],187:[function(require,module,exports){module.exports={id:"request.json#",type:"object",required:["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],properties:{method:{type:"string"},url:{type:"string",format:"uri"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},queryString:{type:"array",items:{$ref:"query.json#"}},postData:{$ref:"postData.json#"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],188:[function(require,module,exports){module.exports={id:"response.json#",type:"object",required:["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],properties:{status:{type:"integer"},statusText:{type:"string"},httpVersion:{type:"string"},cookies:{type:"array",items:{$ref:"cookie.json#"}},headers:{type:"array",items:{$ref:"header.json#"}},content:{$ref:"content.json#"},redirectURL:{type:"string"},headersSize:{type:"integer"},bodySize:{type:"integer"},comment:{type:"string"}}}},{}],189:[function(require,module,exports){module.exports={id:"timings.json#",required:["send","wait","receive"],properties:{dns:{type:"number",min:-1},connect:{type:"number",min:-1},blocked:{type:"number",min:-1},send:{type:"number",min:-1},wait:{type:"number",min:-1},receive:{type:"number",min:-1},ssl:{type:"number",min:-1},comment:{type:"string"}}}},{}],190:[function(require,module,exports){function HARError(errors){var message="validation failed";this.name="HARError",this.message=message,this.errors=errors,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(message).stack}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=HARError,HARError.prototype=Error.prototype,module.exports=exports.default},{}],191:[function(require,module,exports){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function validate(name){var data=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ajv=ajv||new _ajv2.default({allErrors:!0,schemas:schemas});var validate=ajv.getSchema(name+".json");return new Promise(function(resolve,reject){validate(data)?resolve(data):reject(new _error2.default(validate.errors))})}function afterRequest(data){return validate("afterRequest",data)}function beforeRequest(data){return validate("beforeRequest",data)}function browser(data){return validate("browser",data)}function cache(data){return validate("cache",data)}function content(data){return validate("content",data)}function cookie(data){return validate("cookie",data)}function creator(data){return validate("creator",data)}function entry(data){return validate("entry",data)}function har(data){return validate("har",data)}function header(data){return validate("header",data)}function log(data){return validate("log",data)}function page(data){return validate("page",data)}function pageTimings(data){return validate("pageTimings",data)}function postData(data){return validate("postData",data)}function query(data){return validate("query",data)}function request(data){return validate("request",data)}function response(data){return validate("response",data)}function timings(data){return validate("timings",data)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.validate=validate,exports.afterRequest=afterRequest,exports.beforeRequest=beforeRequest,exports.browser=browser,exports.cache=cache,exports.content=content,exports.cookie=cookie,exports.creator=creator,exports.entry=entry,exports.har=har,exports.header=header,exports.log=log,exports.page=page,exports.pageTimings=pageTimings,exports.postData=postData,exports.query=query,exports.request=request,exports.response=response,exports.timings=timings;var _harSchema=require("har-schema"),schemas=_interopRequireWildcard(_harSchema),_ajv=require("ajv"),_ajv2=_interopRequireDefault(_ajv),_error=require("./error"),_error2=_interopRequireDefault(_error),ajv=void 0},{"./error":190,ajv:2,"har-schema":181}],192:[function(require,module,exports){(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=require("stream").Transform;require("inherits")(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)block[i++]=data[offset++];this._update(),this._blockOffset=0}for(;offset<data.length;)block[this._blockOffset++]=data[offset++];for(var j=0,carry=8*data.length;carry>0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(this,require("buffer").Buffer)},{buffer:108,inherits:215,stream:374}],193:[function(require,module,exports){var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.sha384=hash.sha.sha384,hash.sha512=hash.sha.sha512,hash.ripemd160=hash.ripemd.ripemd160},{"./hash/common":194,"./hash/hmac":195,"./hash/ripemd":196,"./hash/sha":197,"./hash/utils":204}],194:[function(require,module,exports){function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var utils=require("./utils"),assert=require("minimalistic-assert");exports.BlockHash=BlockHash,BlockHash.prototype.update=function(msg,enc){if(msg=utils.toArray(msg,enc),this.pending?this.pending=this.pending.concat(msg):this.pending=msg,this.pendingTotal+=msg.length,this.pending.length>=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i<msg.length;i+=this._delta32)this._update(msg,i,i+this._delta32)}return this},BlockHash.prototype.digest=function(enc){return this.update(this._pad()),assert(null===this.pending),this._digest(enc)},BlockHash.prototype._pad=function(){var len=this.pendingTotal,bytes=this._delta8,k=bytes-(len+this.padLength)%bytes,res=new Array(k+this.padLength);res[0]=128;for(var i=1;i<k;i++)res[i]=0;if(len<<=3,"big"===this.endian){for(var t=8;t<this.padLength;t++)res[i++]=0;res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=len>>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else for(res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0,t=8;t<this.padLength;t++)res[i++]=0;return res}},{"./utils":204,"minimalistic-assert":243}],195:[function(require,module,exports){function Hmac(hash,key,enc){if(!(this instanceof Hmac))return new Hmac(hash,key,enc);this.Hash=hash,this.blockSize=hash.blockSize/8,this.outSize=hash.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(key,enc))}var utils=require("./utils"),assert=require("minimalistic-assert");module.exports=Hmac,Hmac.prototype._init=function(key){key.length>this.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i<this.blockSize;i++)key.push(0);for(i=0;i<key.length;i++)key[i]^=54;for(this.inner=(new this.Hash).update(key),i=0;i<key.length;i++)key[i]^=106;this.outer=(new this.Hash).update(key)},Hmac.prototype.update=function(msg,enc){return this.inner.update(msg,enc),this},Hmac.prototype.digest=function(enc){return this.outer.update(this.inner.digest()),this.outer.digest(enc)}},{"./utils":204,"minimalistic-assert":243}],196:[function(require,module,exports){function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(j,x,y,z){return j<=15?x^y^z:j<=31?x&y|~x&z:j<=47?(x|~y)^z:j<=63?x&z|y&~z:x^(y|~z)}function K(j){return j<=15?0:j<=31?1518500249:j<=47?1859775393:j<=63?2400959708:2840853838}function Kh(j){return j<=15?1352829926:j<=31?1548603684:j<=47?1836072691:j<=63?2053994217:0}var utils=require("./utils"),common=require("./common"),rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=common.BlockHash;utils.inherits(RIPEMD160,BlockHash),exports.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function(msg,start){for(var A=this.h[0],B=this.h[1],C=this.h[2],D=this.h[3],E=this.h[4],Ah=A,Bh=B,Ch=C,Dh=D,Eh=E,j=0;j<80;j++){var T=sum32(rotl32(sum32_4(A,f(j,B,C,D),msg[r[j]+start],K(j)),s[j]),E);A=E,E=D,D=rotl32(C,10),C=B,B=T,T=sum32(rotl32(sum32_4(Ah,f(79-j,Bh,Ch,Dh),msg[rh[j]+start],Kh(j)),sh[j]),Eh),Ah=Eh,Eh=Dh,Dh=rotl32(Ch,10),Ch=Bh,Bh=T}T=sum32_3(this.h[1],C,Dh),this.h[1]=sum32_3(this.h[2],D,Eh),this.h[2]=sum32_3(this.h[3],E,Ah),this.h[3]=sum32_3(this.h[4],A,Bh),this.h[4]=sum32_3(this.h[0],B,Ch),this.h[0]=T},RIPEMD160.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":194,"./utils":204}],197:[function(require,module,exports){exports.sha1=require("./sha/1"),exports.sha224=require("./sha/224"),exports.sha256=require("./sha/256"),exports.sha384=require("./sha/384"),exports.sha512=require("./sha/512")},{"./sha/1":198,"./sha/224":199,"./sha/256":200,"./sha/384":201,"./sha/512":202}],198:[function(require,module,exports){function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var utils=require("../utils"),common=require("../common"),shaCommon=require("./common"),rotl32=utils.rotl32,sum32=utils.sum32,sum32_5=utils.sum32_5,ft_1=shaCommon.ft_1,BlockHash=common.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];utils.inherits(SHA1,BlockHash),module.exports=SHA1,SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(msg,start){for(var W=this.W,i=0;i<16;i++)W[i]=msg[start+i];for(;i<W.length;i++)W[i]=rotl32(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);var a=this.h[0],b=this.h[1],c=this.h[2],d=this.h[3],e=this.h[4];for(i=0;i<W.length;i++){var s=~~(i/20),t=sum32_5(rotl32(a,5),ft_1(s,b,c,d),e,W[i],sha1_K[s]);e=d,d=c,c=rotl32(b,30),b=a,a=t}this.h[0]=sum32(this.h[0],a),this.h[1]=sum32(this.h[1],b),this.h[2]=sum32(this.h[2],c),this.h[3]=sum32(this.h[3],d),this.h[4]=sum32(this.h[4],e)},SHA1.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}},{"../common":194,"../utils":204,"./common":203}],199:[function(require,module,exports){function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}var utils=require("../utils"),SHA256=require("./256");utils.inherits(SHA224,SHA256),module.exports=SHA224,SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h.slice(0,7),"big"):utils.split32(this.h.slice(0,7),"big")}},{"../utils":204,"./256":200}],200:[function(require,module,exports){function SHA256(){if(!(this instanceof SHA256))return new SHA256;BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}var utils=require("../utils"),common=require("../common"),shaCommon=require("./common"),assert=require("minimalistic-assert"),sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash=common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];utils.inherits(SHA256,BlockHash),module.exports=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function(msg,start){for(var W=this.W,i=0;i<16;i++)W[i]=msg[start+i];for(;i<W.length;i++)W[i]=sum32_4(g1_256(W[i-2]),W[i-7],g0_256(W[i-15]),W[i-16]);var a=this.h[0],b=this.h[1],c=this.h[2],d=this.h[3],e=this.h[4],f=this.h[5],g=this.h[6],h=this.h[7];for(assert(this.k.length===W.length),i=0;i<W.length;i++){var T1=sum32_5(h,s1_256(e),ch32(e,f,g),this.k[i],W[i]),T2=sum32(s0_256(a),maj32(a,b,c));h=g,g=f,f=e,e=sum32(d,T1),d=c,c=b,b=a,a=sum32(T1,T2)}this.h[0]=sum32(this.h[0],a),this.h[1]=sum32(this.h[1],b),this.h[2]=sum32(this.h[2],c),this.h[3]=sum32(this.h[3],d),this.h[4]=sum32(this.h[4],e),this.h[5]=sum32(this.h[5],f),this.h[6]=sum32(this.h[6],g),this.h[7]=sum32(this.h[7],h)},SHA256.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}},{"../common":194,"../utils":204,"./common":203,"minimalistic-assert":243}],201:[function(require,module,exports){function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}var utils=require("../utils"),SHA512=require("./512");utils.inherits(SHA384,SHA512),module.exports=SHA384,SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h.slice(0,12),"big"):utils.split32(this.h.slice(0,12),"big")}},{"../utils":204,"./512":202}],202:[function(require,module,exports){function SHA512(){if(!(this instanceof SHA512))return new SHA512;BlockHash.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}function ch64_hi(xh,xl,yh,yl,zh){var r=xh&yh^~xh&zh;return r<0&&(r+=4294967296),r}function ch64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^~xl&zl;return r<0&&(r+=4294967296),r}function maj64_hi(xh,xl,yh,yl,zh){var r=xh&yh^xh&zh^yh&zh;return r<0&&(r+=4294967296),r}function maj64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^xl&zl^yl&zl;return r<0&&(r+=4294967296),r}function s0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,28),c1_hi=rotr64_hi(xl,xh,2),c2_hi=rotr64_hi(xl,xh,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,28),c1_lo=rotr64_lo(xl,xh,2),c2_lo=rotr64_lo(xl,xh,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function s1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,14),c1_hi=rotr64_hi(xh,xl,18),c2_hi=rotr64_hi(xl,xh,9),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,14),c1_lo=rotr64_lo(xh,xl,18),c2_lo=rotr64_lo(xl,xh,9),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,1),c1_hi=rotr64_hi(xh,xl,8),c2_hi=shr64_hi(xh,xl,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,1),c1_lo=rotr64_lo(xh,xl,8),c2_lo=shr64_lo(xh,xl,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,19),c1_hi=rotr64_hi(xl,xh,29),c2_hi=shr64_hi(xh,xl,6),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,19),c1_lo=rotr64_lo(xl,xh,29),c2_lo=shr64_lo(xh,xl,6),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}var utils=require("../utils"),common=require("../common"),assert=require("minimalistic-assert"),rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash=common.BlockHash,sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];utils.inherits(SHA512,BlockHash),module.exports=SHA512,SHA512.blockSize=1024,SHA512.outSize=512,SHA512.hmacStrength=192,SHA512.padLength=128,SHA512.prototype._prepareBlock=function(msg,start){for(var W=this.W,i=0;i<32;i++)W[i]=msg[start+i];for(;i<W.length;i+=2){var c0_hi=g1_512_hi(W[i-4],W[i-3]),c0_lo=g1_512_lo(W[i-4],W[i-3]),c1_hi=W[i-14],c1_lo=W[i-13],c2_hi=g0_512_hi(W[i-30],W[i-29]),c2_lo=g0_512_lo(W[i-30],W[i-29]),c3_hi=W[i-32],c3_lo=W[i-31];W[i]=sum64_4_hi(c0_hi,c0_lo,c1_hi,c1_lo,c2_hi,c2_lo,c3_hi,c3_lo),W[i+1]=sum64_4_lo(c0_hi,c0_lo,c1_hi,c1_lo,c2_hi,c2_lo,c3_hi,c3_lo)}},SHA512.prototype._update=function(msg,start){this._prepareBlock(msg,start);var W=this.W,ah=this.h[0],al=this.h[1],bh=this.h[2],bl=this.h[3],ch=this.h[4],cl=this.h[5],dh=this.h[6],dl=this.h[7],eh=this.h[8],el=this.h[9],fh=this.h[10],fl=this.h[11],gh=this.h[12],gl=this.h[13],hh=this.h[14],hl=this.h[15];assert(this.k.length===W.length);for(var i=0;i<W.length;i+=2){var c0_hi=hh,c0_lo=hl,c1_hi=s1_512_hi(eh,el),c1_lo=s1_512_lo(eh,el),c2_hi=ch64_hi(eh,el,fh,fl,gh,gl),c2_lo=ch64_lo(eh,el,fh,fl,gh,gl),c3_hi=this.k[i],c3_lo=this.k[i+1],c4_hi=W[i],c4_lo=W[i+1],T1_hi=sum64_5_hi(c0_hi,c0_lo,c1_hi,c1_lo,c2_hi,c2_lo,c3_hi,c3_lo,c4_hi,c4_lo),T1_lo=sum64_5_lo(c0_hi,c0_lo,c1_hi,c1_lo,c2_hi,c2_lo,c3_hi,c3_lo,c4_hi,c4_lo);c0_hi=s0_512_hi(ah,al),c0_lo=s0_512_lo(ah,al),c1_hi=maj64_hi(ah,al,bh,bl,ch,cl),c1_lo=maj64_lo(ah,al,bh,bl,ch,cl);var T2_hi=sum64_hi(c0_hi,c0_lo,c1_hi,c1_lo),T2_lo=sum64_lo(c0_hi,c0_lo,c1_hi,c1_lo);hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=sum64_hi(dh,dl,T1_hi,T1_lo),el=sum64_lo(dl,dl,T1_hi,T1_lo),dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=sum64_hi(T1_hi,T1_lo,T2_hi,T2_lo),al=sum64_lo(T1_hi,T1_lo,T2_hi,T2_lo)}sum64(this.h,0,ah,al),sum64(this.h,2,bh,bl),sum64(this.h,4,ch,cl),sum64(this.h,6,dh,dl),sum64(this.h,8,eh,el),sum64(this.h,10,fh,fl),sum64(this.h,12,gh,gl),sum64(this.h,14,hh,hl)},SHA512.prototype._digest=function(enc){return"hex"===enc?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}},{"../common":194,"../utils":204,"minimalistic-assert":243}],203:[function(require,module,exports){function ft_1(s,x,y,z){return 0===s?ch32(x,y,z):1===s||3===s?p32(x,y,z):2===s?maj32(x,y,z):void 0}function ch32(x,y,z){return x&y^~x&z}function maj32(x,y,z){return x&y^x&z^y&z}function p32(x,y,z){return x^y^z}function s0_256(x){return rotr32(x,2)^rotr32(x,13)^rotr32(x,22)}function s1_256(x){return rotr32(x,6)^rotr32(x,11)^rotr32(x,25)}function g0_256(x){return rotr32(x,7)^rotr32(x,18)^x>>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}var utils=require("../utils"),rotr32=utils.rotr32;exports.ft_1=ft_1,exports.ch32=ch32,exports.maj32=maj32,exports.p32=p32,exports.s0_256=s0_256,exports.s1_256=s1_256,exports.g0_256=g0_256,exports.g1_256=g1_256},{"../utils":204}],204:[function(require,module,exports){function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"==typeof msg)if(enc){if("hex"===enc)for(msg=msg.replace(/[^a-z0-9]+/gi,""),msg.length%2!=0&&(msg="0"+msg),i=0;i<msg.length;i+=2)res.push(parseInt(msg[i]+msg[i+1],16))}else for(var i=0;i<msg.length;i++){var c=msg.charCodeAt(i),hi=c>>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(i=0;i<msg.length;i++)res[i]=0|msg[i];return res}function toHex(msg){for(var res="",i=0;i<msg.length;i++)res+=zero2(msg[i].toString(16));return res}function htonl(w){return(w>>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i<msg.length;i++){var w=msg[i];"little"===endian&&(w=htonl(w)),res+=zero8(w.toString(16))}return res}function zero2(word){return 1===word.length?"0"+word:word}function zero8(word){return 7===word.length?"0"+word:6===word.length?"00"+word:5===word.length?"000"+word:4===word.length?"0000"+word:3===word.length?"00000"+word:2===word.length?"000000"+word:1===word.length?"0000000"+word:word}function join32(msg,start,end,endian){var len=end-start;assert(len%4==0);for(var res=new Array(len/4),i=0,k=start;i<res.length;i++,k+=4){var w;w="big"===endian?msg[k]<<24|msg[k+1]<<16|msg[k+2]<<8|msg[k+3]:msg[k+3]<<24|msg[k+2]<<16|msg[k+1]<<8|msg[k],res[i]=w>>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i<msg.length;i++,k+=4){var m=msg[i];"big"===endian?(res[k]=m>>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<<b|w>>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo<al?1:0)+ah+bh;buf[pos]=hi>>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0<al?1:0)+ah+bh>>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo<al?1:0,lo=lo+cl>>>0,carry+=lo<cl?1:0,lo=lo+dl>>>0,carry+=lo<dl?1:0,ah+bh+ch+dh+carry>>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo<al?1:0,lo=lo+cl>>>0,carry+=lo<cl?1:0,lo=lo+dl>>>0,carry+=lo<dl?1:0,lo=lo+el>>>0,carry+=lo<el?1:0,ah+bh+ch+dh+eh+carry>>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var assert=require("minimalistic-assert"),inherits=require("inherits");exports.inherits=inherits,exports.toArray=toArray,exports.toHex=toHex,exports.htonl=htonl,exports.toHex32=toHex32,exports.zero2=zero2,exports.zero8=zero8,exports.join32=join32,exports.split32=split32,exports.rotr32=rotr32,exports.rotl32=rotl32,exports.sum32=sum32,exports.sum32_3=sum32_3,exports.sum32_4=sum32_4,exports.sum32_5=sum32_5,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},{inherits:215,"minimalistic-assert":243}],205:[function(require,module,exports){var hawk={internals:{}};hawk.client={header:function(uri,method,options){var result={field:"",artifacts:{}};if(!uri||"string"!=typeof uri&&"object"!==(void 0===uri?"undefined":_typeof(uri))||!method||"string"!=typeof method||!options||"object"!==(void 0===options?"undefined":_typeof(options)))return result.err="Invalid argument type",result;var timestamp=options.timestamp||hawk.utils.now(options.localtimeOffsetMsec),credentials=options.credentials;if(!(credentials&&credentials.id&&credentials.key&&credentials.algorithm))return result.err="Invalid credentials object",result;if(-1===hawk.crypto.algorithms.indexOf(credentials.algorithm))return result.err="Unknown algorithm",result;"string"==typeof uri&&(uri=hawk.utils.parseUri(uri));var artifacts={ts:timestamp,nonce:options.nonce||hawk.utils.randomString(6),method:method,resource:uri.resource,host:uri.host,port:uri.port,hash:options.hash,ext:options.ext,app:options.app,dlg:options.dlg};result.artifacts=artifacts,artifacts.hash||!options.payload&&""!==options.payload||(artifacts.hash=hawk.crypto.calculatePayloadHash(options.payload,credentials.algorithm,options.contentType));var mac=hawk.crypto.calculateMac("header",credentials,artifacts),hasExt=null!==artifacts.ext&&void 0!==artifacts.ext&&""!==artifacts.ext,header='Hawk id="'+credentials.id+'", ts="'+artifacts.ts+'", nonce="'+artifacts.nonce+(artifacts.hash?'", hash="'+artifacts.hash:"")+(hasExt?'", ext="'+hawk.utils.escapeHeaderAttribute(artifacts.ext):"")+'", mac="'+mac+'"';return artifacts.app&&(header+=', app="'+artifacts.app+(artifacts.dlg?'", dlg="'+artifacts.dlg:"")+'"'),result.field=header,result},bewit:function(uri,options){if(!uri||"string"!=typeof uri||!options||"object"!==(void 0===options?"undefined":_typeof(options))||!options.ttlSec)return"";options.ext=null===options.ext||void 0===options.ext?"":options.ext;var now=hawk.utils.now(options.localtimeOffsetMsec),credentials=options.credentials;if(!(credentials&&credentials.id&&credentials.key&&credentials.algorithm))return"";if(-1===hawk.crypto.algorithms.indexOf(credentials.algorithm))return"";uri=hawk.utils.parseUri(uri);var exp=now+options.ttlSec,mac=hawk.crypto.calculateMac("bewit",credentials,{ts:exp,nonce:"",method:"GET",resource:uri.resource,host:uri.host,port:uri.port,ext:options.ext}),bewit=credentials.id+"\\"+exp+"\\"+mac+"\\"+options.ext;return hawk.utils.base64urlEncode(bewit)},authenticate:function(request,credentials,artifacts,options){options=options||{};var getHeader=function(name){return request.getResponseHeader?request.getResponseHeader(name):request.getHeader(name)},wwwAuthenticate=getHeader("www-authenticate");if(wwwAuthenticate){var wwwAttributes=hawk.utils.parseAuthorizationHeader(wwwAuthenticate,["ts","tsm","error"]);if(!wwwAttributes)return!1;if(wwwAttributes.ts){if(hawk.crypto.calculateTsMac(wwwAttributes.ts,credentials)!==wwwAttributes.tsm)return!1;hawk.utils.setNtpOffset(wwwAttributes.ts-Math.floor((new Date).getTime()/1e3))}}var serverAuthorization=getHeader("server-authorization");if(!serverAuthorization&&!options.required)return!0;var attributes=hawk.utils.parseAuthorizationHeader(serverAuthorization,["mac","ext","hash"]);if(!attributes)return!1;var modArtifacts={ts:artifacts.ts,nonce:artifacts.nonce,method:artifacts.method,resource:artifacts.resource,host:artifacts.host,port:artifacts.port,hash:attributes.hash,ext:attributes.ext,app:artifacts.app,dlg:artifacts.dlg};return hawk.crypto.calculateMac("response",credentials,modArtifacts)===attributes.mac&&(!options.payload&&""!==options.payload||!!attributes.hash&&hawk.crypto.calculatePayloadHash(options.payload,credentials.algorithm,getHeader("content-type"))===attributes.hash)},message:function(host,port,_message,options){if(!host||"string"!=typeof host||!port||"number"!=typeof port||null===_message||void 0===_message||"string"!=typeof _message||!options||"object"!==(void 0===options?"undefined":_typeof(options)))return null;var timestamp=options.timestamp||hawk.utils.now(options.localtimeOffsetMsec),credentials=options.credentials;if(!(credentials&&credentials.id&&credentials.key&&credentials.algorithm))return null;if(-1===hawk.crypto.algorithms.indexOf(credentials.algorithm))return null;var artifacts={ts:timestamp,nonce:options.nonce||hawk.utils.randomString(6),host:host,port:port,hash:hawk.crypto.calculatePayloadHash(_message,credentials.algorithm)};return{id:credentials.id,ts:artifacts.ts,nonce:artifacts.nonce,hash:artifacts.hash,mac:hawk.crypto.calculateMac("message",credentials,artifacts)}},authenticateTimestamp:function(message,credentials,updateClock){return hawk.crypto.calculateTsMac(message.ts,credentials)===message.tsm&&(!1!==updateClock&&hawk.utils.setNtpOffset(message.ts-Math.floor((new Date).getTime()/1e3)),!0)}},hawk.crypto={headerVersion:"1",algorithms:["sha1","sha256"],calculateMac:function(type,credentials,options){var normalized=hawk.crypto.generateNormalizedString(type,options);return CryptoJS["Hmac"+credentials.algorithm.toUpperCase()](normalized,credentials.key).toString(CryptoJS.enc.Base64)},generateNormalizedString:function(type,options){var normalized="hawk."+hawk.crypto.headerVersion+"."+type+"\n"+options.ts+"\n"+options.nonce+"\n"+(options.method||"").toUpperCase()+"\n"+(options.resource||"")+"\n"+options.host.toLowerCase()+"\n"+options.port+"\n"+(options.hash||"")+"\n";return options.ext&&(normalized+=options.ext.replace("\\","\\\\").replace("\n","\\n")),normalized+="\n",options.app&&(normalized+=options.app+"\n"+(options.dlg||"")+"\n"),normalized},calculatePayloadHash:function(payload,algorithm,contentType){var hash=CryptoJS.algo[algorithm.toUpperCase()].create();return hash.update("hawk."+hawk.crypto.headerVersion+".payload\n"),hash.update(hawk.utils.parseContentType(contentType)+"\n"),hash.update(payload),hash.update("\n"),hash.finalize().toString(CryptoJS.enc.Base64)},calculateTsMac:function(ts,credentials){return CryptoJS["Hmac"+credentials.algorithm.toUpperCase()]("hawk."+hawk.crypto.headerVersion+".ts\n"+ts+"\n",credentials.key).toString(CryptoJS.enc.Base64)}},hawk.internals.LocalStorage=function(){this._cache={},this.length=0,this.getItem=function(key){return this._cache.hasOwnProperty(key)?String(this._cache[key]):null},this.setItem=function(key,value){this._cache[key]=String(value),this.length=Object.keys(this._cache).length},this.removeItem=function(key){delete this._cache[key],this.length=Object.keys(this._cache).length},this.clear=function(){this._cache={},this.length=0},this.key=function(i){return Object.keys(this._cache)[i||0]}},hawk.utils={storage:new hawk.internals.LocalStorage,setStorage:function(storage){var ntpOffset=hawk.utils.storage.getItem("hawk_ntp_offset");hawk.utils.storage=storage,ntpOffset&&hawk.utils.setNtpOffset(ntpOffset)},setNtpOffset:function(offset){try{hawk.utils.storage.setItem("hawk_ntp_offset",offset)}catch(err){console.error("[hawk] could not write to storage."),console.error(err)}},getNtpOffset:function(){var offset=hawk.utils.storage.getItem("hawk_ntp_offset");return offset?parseInt(offset,10):0},now:function(localtimeOffsetMsec){return Math.floor(((new Date).getTime()+(localtimeOffsetMsec||0))/1e3)+hawk.utils.getNtpOffset()},escapeHeaderAttribute:function(attribute){return attribute.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')},parseContentType:function(header){return header?header.split(";")[0].replace(/^\s+|\s+$/g,"").toLowerCase():""},parseAuthorizationHeader:function(header,keys){if(!header)return null;var headerParts=header.match(/^(\w+)(?:\s+(.*))?$/);if(!headerParts)return null;if("hawk"!==headerParts[1].toLowerCase())return null;var attributesString=headerParts[2];if(!attributesString)return null;var attributes={};return""!==attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g,function($0,$1,$2){if(-1!==keys.indexOf($1)&&null!==$2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/)&&!attributes.hasOwnProperty($1))return attributes[$1]=$2,""})?null:attributes},randomString:function(size){for(var randomSource="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",len=randomSource.length,result=[],i=0;i<size;++i)result[i]=randomSource[Math.floor(Math.random()*len)];return result.join("")},uriRegex:/^([^:]+)\:\/\/(?:[^@]*@)?([^\/:]+)(?:\:(\d+))?([^#]*)(?:#.*)?$/,parseUri:function(input){var parts=input.match(hawk.utils.uriRegex);if(!parts)return{host:"",port:"",resource:""};var scheme=parts[1].toLowerCase();return{host:parts[2],port:parts[3]||("http"===scheme?"80":"https"===scheme?"443":""),resource:parts[4]}},base64urlEncode:function(value){var wordArray=CryptoJS.enc.Utf8.parse(value);return CryptoJS.enc.Base64.stringify(wordArray).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}};var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;return a&&b.mixIn(a),b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[],this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;if(a=a.sigBytes,this.clamp(),c%4)for(var e=0;e<a;e++)b[c+e>>>2]|=(d[e>>>2]>>>24-e%4*8&255)<<24-(c+e)%4*8;else if(65535<d.length)for(e=0;e<a;e+=4)b[c+e>>>2]=d[e>>>2];else b.push.apply(b,d);return this.sigBytes+=a,this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-b%4*8,a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(a){for(var b=[],d=0;d<a;d+=4)b.push(4294967296*h.random()|0);return new j.init(b,a)}}),m=k.enc={},s=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++){var e=b[c>>>2]>>>24-c%4*8&255;d.push((e>>>4).toString(16)),d.push((15&e).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c+=2)d[c>>>3]|=parseInt(a.substr(c,2),16)<<24-c%8*4;return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++)d.push(String.fromCharCode(b[c>>>2]>>>24-c%4*8&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c++)d[c>>>2]|=(255&a.charCodeAt(c))<<24-c%4*8;return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data")}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((0|f)-this._minBufferSize,0);if(a=f*e,c=h.min(4*a,c),a){for(var g=0;g<a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a),b.sigBytes-=c}return new j.init(g,c)},clone:function(){var a=f.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0});l.Hasher=q.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){q.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){return a&&this._append(a),this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return new a.init(d).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return new u.HMAC.init(a,d).finalize(b)}}});var u=k.algo={};return k}(Math);!function(){var k=CryptoJS,b=k.lib,m=b.WordArray,l=b.Hasher,d=[],b=k.algo.SHA1=l.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(n,p){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],j=a[3],b=a[4],c=0;80>c;c++){if(16>c)d[c]=0|n[p+c];else{var g=d[c-3]^d[c-8]^d[c-14]^d[c-16];d[c]=g<<1|g>>>31}g=(e<<5|e>>>27)+b+d[c],g=20>c?g+(1518500249+(f&h|~f&j)):40>c?g+(1859775393+(f^h^j)):60>c?g+((f&h|f&j|h&j)-1894007588):g+((f^h^j)-899497514),b=j,j=h,h=f<<30|f>>>2,f=e,e=g}a[0]=a[0]+e|0,a[1]=a[1]+f|0,a[2]=a[2]+h|0,a[3]=a[3]+j|0,a[4]=a[4]+b|0},_doFinalize:function(){var b=this._data,d=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;return d[e>>>5]|=128<<24-e%32,d[14+(e+64>>>9<<4)]=Math.floor(a/4294967296),d[15+(e+64>>>9<<4)]=a,b.sigBytes=4*d.length,this._process(),this._hash},clone:function(){var b=l.clone.call(this);return b._hash=this._hash.clone(),b}});k.SHA1=l._createHelper(b),k.HmacSHA1=l._createHmacHelper(b)}(),function(k){for(var g=CryptoJS,h=g.lib,v=h.WordArray,j=h.Hasher,h=g.algo,s=[],t=[],u=function(q){return 4294967296*(q-(0|q))|0},l=2,b=0;64>b;){var d;a:{d=l;for(var w=k.sqrt(d),r=2;r<=w;r++)if(!(d%r)){d=!1;break a}d=!0}d&&(8>b&&(s[b]=u(k.pow(l,.5))),t[b]=u(k.pow(l,1/3)),b++),l++}var n=[],h=h.SHA256=j.extend({_doReset:function(){this._hash=new v.init(s.slice(0))},_doProcessBlock:function(q,h){for(var a=this._hash.words,c=a[0],d=a[1],b=a[2],k=a[3],f=a[4],g=a[5],j=a[6],l=a[7],e=0;64>e;e++){if(16>e)n[e]=0|q[h+e];else{var m=n[e-15],p=n[e-2];n[e]=((m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3)+n[e-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[e-16]}m=l+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&g^~f&j)+t[e]+n[e],p=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&d^c&b^d&b),l=j,j=g,g=f,f=k+m|0,k=b,b=d,d=c,c=m+p|0}a[0]=a[0]+c|0,a[1]=a[1]+d|0,a[2]=a[2]+b|0,a[3]=a[3]+k|0,a[4]=a[4]+f|0,a[5]=a[5]+g|0,a[6]=a[6]+j|0,a[7]=a[7]+l|0},_doFinalize:function(){var d=this._data,b=d.words,a=8*this._nDataBytes,c=8*d.sigBytes;return b[c>>>5]|=128<<24-c%32,b[14+(c+64>>>9<<4)]=k.floor(a/4294967296),b[15+(c+64>>>9<<4)]=a,d.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var b=j.clone.call(this);return b._hash=this._hash.clone(),b}});g.SHA256=j._createHelper(h),g.HmacSHA256=j._createHmacHelper(h)}(Math),function(){var c=CryptoJS,k=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init,"string"==typeof b&&(b=k.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b)),b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d<c;d++)h[d]^=1549556828,j[d]^=909522486;f.sigBytes=g.sigBytes=e,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher;return a=b.finalize(a),b.reset(),b.finalize(this._oKey.clone().concat(a))}})}(),function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp(),b=[];for(var a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-a%4*8&255)<<16|(e[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|e[a+2>>>2]>>>24-(a+2)%4*8&255,g=0;4>g&&a+.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&-1!=(c=b.indexOf(c))&&(e=c);for(var c=[],a=0,d=0;d<e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<d%4*2,h=f.indexOf(b.charAt(d))>>>6-d%4*2;c[a>>>2]|=(g|h)<<24-a%4*8,a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),hawk.crypto.internals=CryptoJS,void 0!==module&&module.exports&&(module.exports=hawk)},{}],206:[function(require,module,exports){function HmacDRBG(options){if(!(this instanceof HmacDRBG))return new HmacDRBG(options);this.hash=options.hash,this.predResist=!!options.predResist,this.outLen=this.hash.outSize,this.minEntropy=options.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var entropy=utils.toArray(options.entropy,options.entropyEnc||"hex"),nonce=utils.toArray(options.nonce,options.nonceEnc||"hex"),pers=utils.toArray(options.pers,options.persEnc||"hex");assert(entropy.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=require("hash.js"),utils=require("minimalistic-crypto-utils"),assert=require("minimalistic-assert");module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(seed),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG.prototype._hmac=function(){return new hash.hmac(this.hash,this.K)},HmacDRBG.prototype._update=function(seed){var kmac=this._hmac().update(this.V).update([0]);seed&&(kmac=kmac.update(seed)),this.K=kmac.digest(),this.V=this._hmac().update(this.V).digest(),seed&&(this.K=this._hmac().update(this.V).update([1]).update(seed).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG.prototype.reseed=function(entropy,entropyEnc,add,addEnc){"string"!=typeof entropyEnc&&(addEnc=add,add=entropyEnc,entropyEnc=null),entropy=utils.toArray(entropy,entropyEnc),add=utils.toArray(add,addEnc),assert(entropy.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length<len;)this.V=this._hmac().update(this.V).digest(),temp=temp.concat(this.V);var res=temp.slice(0,len);return this._update(add),this._reseed++,utils.encode(res,enc)}},{"hash.js":193,"minimalistic-assert":243,"minimalistic-crypto-utils":244}],207:[function(require,module,exports){var parser=require("./parser"),signer=require("./signer"),verify=require("./verify"),utils=require("./utils");module.exports={parse:parser.parseRequest,parseRequest:parser.parseRequest,sign:signer.signRequest,signRequest:signer.signRequest,createSigner:signer.createSigner,isSigner:signer.isSigner,sshKeyToPEM:utils.sshKeyToPEM,sshKeyFingerprint:utils.fingerprint,pemToRsaSSHKey:utils.pemToRsaSSHKey,verify:verify.verifySignature,verifySignature:verify.verifySignature,verifyHMAC:verify.verifyHMAC}},{"./parser":208,"./signer":209,"./utils":210,"./verify":211}],208:[function(require,module,exports){function ExpiredRequestError(message){HttpSignatureError.call(this,message,ExpiredRequestError)}function InvalidHeaderError(message){HttpSignatureError.call(this,message,InvalidHeaderError)}function InvalidParamsError(message){HttpSignatureError.call(this,message,InvalidParamsError)}function MissingHeaderError(message){HttpSignatureError.call(this,message,MissingHeaderError)}function StrictParsingError(message){HttpSignatureError.call(this,message,StrictParsingError)}var assert=require("assert-plus"),util=require("util"),utils=require("./utils"),HttpSignatureError=(utils.HASH_ALGOS,utils.PK_ALGOS,utils.HttpSignatureError),InvalidAlgorithmError=utils.InvalidAlgorithmError,validateAlgorithm=utils.validateAlgorithm,State={New:0,Params:1},ParamsState={Name:0,Quote:1,Value:2,Comma:3};util.inherits(ExpiredRequestError,HttpSignatureError),util.inherits(InvalidHeaderError,HttpSignatureError),util.inherits(InvalidParamsError,HttpSignatureError),util.inherits(MissingHeaderError,HttpSignatureError),util.inherits(StrictParsingError,HttpSignatureError),module.exports={parseRequest:function(request,options){if(assert.object(request,"request"),assert.object(request.headers,"request.headers"),void 0===options&&(options={}),void 0===options.headers&&(options.headers=[request.headers["x-date"]?"x-date":"date"]),assert.object(options,"options"),assert.arrayOfString(options.headers,"options.headers"),assert.optionalNumber(options.clockSkew,"options.clockSkew"),!request.headers.authorization)throw new MissingHeaderError("no authorization header present in the request");options.clockSkew=options.clockSkew||300;var i=0,state=State.New,substate=ParamsState.Name,tmpName="",tmpValue="",parsed={scheme:"",params:{},signingString:"",get algorithm(){return this.params.algorithm.toUpperCase()},get keyId(){return this.params.keyId}},authz=request.headers.authorization;for(i=0;i<authz.length;i++){var c=authz.charAt(i);switch(Number(state)){case State.New:" "!==c?parsed.scheme+=c:state=State.Params;break;case State.Params:switch(Number(substate)){case ParamsState.Name:var code=c.charCodeAt(0);if(code>=65&&code<=90||code>=97&&code<=122)tmpName+=c;else{if("="!==c)throw new InvalidHeaderError("bad param format");if(0===tmpName.length)throw new InvalidHeaderError("bad param format");substate=ParamsState.Quote}break;case ParamsState.Quote:if('"'!==c)throw new InvalidHeaderError("bad param format");tmpValue="",substate=ParamsState.Value;break;case ParamsState.Value:'"'===c?(parsed.params[tmpName]=tmpValue,substate=ParamsState.Comma):tmpValue+=c;break;case ParamsState.Comma:if(","!==c)throw new InvalidHeaderError("bad param format");tmpName="",substate=ParamsState.Name;break;default:throw new Error("Invalid substate")}break;default:throw new Error("Invalid substate")}}if(parsed.params.headers&&""!==parsed.params.headers?parsed.params.headers=parsed.params.headers.split(" "):request.headers["x-date"]?parsed.params.headers=["x-date"]:parsed.params.headers=["date"],!parsed.scheme||"Signature"!==parsed.scheme)throw new InvalidHeaderError('scheme was not "Signature"');if(!parsed.params.keyId)throw new InvalidHeaderError("keyId was not specified");if(!parsed.params.algorithm)throw new InvalidHeaderError("algorithm was not specified");if(!parsed.params.signature)throw new InvalidHeaderError("signature was not specified");parsed.params.algorithm=parsed.params.algorithm.toLowerCase();try{validateAlgorithm(parsed.params.algorithm)}catch(e){throw e instanceof InvalidAlgorithmError?new InvalidParamsError(parsed.params.algorithm+" is not supported"):e}for(i=0;i<parsed.params.headers.length;i++){var h=parsed.params.headers[i].toLowerCase();if(parsed.params.headers[i]=h,"request-line"===h){if(options.strict)throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");parsed.signingString+=request.method+" "+request.url+" HTTP/"+request.httpVersion}else if("(request-target)"===h)parsed.signingString+="(request-target): "+request.method.toLowerCase()+" "+request.url;else{var value=request.headers[h];if(void 0===value)throw new MissingHeaderError(h+" was not in the request");parsed.signingString+=h+": "+value}i+1<parsed.params.headers.length&&(parsed.signingString+="\n")}var date;if(request.headers.date||request.headers["x-date"]){date=request.headers["x-date"]?new Date(request.headers["x-date"]):new Date(request.headers.date);var now=new Date,skew=Math.abs(now.getTime()-date.getTime());if(skew>1e3*options.clockSkew)throw new ExpiredRequestError("clock skew of "+skew/1e3+"s was greater than "+options.clockSkew+"s")}if(options.headers.forEach(function(hdr){if(parsed.params.headers.indexOf(hdr)<0)throw new MissingHeaderError(hdr+" was not a signed header")}),options.algorithms&&-1===options.algorithms.indexOf(parsed.params.algorithm))throw new InvalidParamsError(parsed.params.algorithm+" is not a supported algorithm");return parsed}}},{"./utils":210,"assert-plus":63,util:400}],209:[function(require,module,exports){(function(Buffer){function MissingHeaderError(message){HttpSignatureError.call(this,message,MissingHeaderError)}function StrictParsingError(message){HttpSignatureError.call(this,message,StrictParsingError)}function RequestSigner(options){assert.object(options,"options");var alg=[];if(void 0!==options.algorithm&&(assert.string(options.algorithm,"options.algorithm"),alg=validateAlgorithm(options.algorithm)),this.rs_alg=alg,void 0!==options.sign)assert.func(options.sign,"options.sign"),this.rs_signFunc=options.sign;else if("hmac"===alg[0]&&void 0!==options.key){if(assert.string(options.keyId,"options.keyId"),this.rs_keyId=options.keyId,"string"!=typeof options.key&&!Buffer.isBuffer(options.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=crypto.createHmac(alg[1].toUpperCase(),options.key),this.rs_signer.sign=function(){var digest=this.digest("base64");return{hashAlgorithm:alg[1],toString:function(){return digest}}}}else{if(void 0===options.key)throw new TypeError("options.sign (func) or options.key is required");var key=options.key;if(("string"==typeof key||Buffer.isBuffer(key))&&(key=sshpk.parsePrivateKey(key)),assert.ok(sshpk.PrivateKey.isPrivateKey(key,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=key,assert.string(options.keyId,"options.keyId"),this.rs_keyId=options.keyId,!PK_ALGOS[key.type])throw new InvalidAlgorithmError(key.type.toUpperCase()+" type keys are not supported");if(void 0!==alg[0]&&key.type!==alg[0])throw new InvalidAlgorithmError("options.key must be a "+alg[0].toUpperCase()+" key, was given a "+key.type.toUpperCase()+" key instead");this.rs_signer=key.createSign(alg[1])}this.rs_headers=[],this.rs_lines=[]}var assert=require("assert-plus"),crypto=require("crypto"),util=(require("http"),require("util")),sshpk=require("sshpk"),jsprim=require("jsprim"),utils=require("./utils"),sprintf=require("util").format,HASH_ALGOS=utils.HASH_ALGOS,PK_ALGOS=utils.PK_ALGOS,InvalidAlgorithmError=utils.InvalidAlgorithmError,HttpSignatureError=utils.HttpSignatureError,validateAlgorithm=utils.validateAlgorithm,AUTHZ_FMT='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';util.inherits(MissingHeaderError,HttpSignatureError),util.inherits(StrictParsingError,HttpSignatureError),RequestSigner.prototype.writeHeader=function(header,value){if(assert.string(header,"header"),header=header.toLowerCase(),assert.string(value,"value"),this.rs_headers.push(header),this.rs_signFunc)this.rs_lines.push(header+": "+value);else{var line=header+": "+value;this.rs_headers.length>0&&(line="\n"+line),this.rs_signer.update(line)}return value},RequestSigner.prototype.writeDateHeader=function(){return this.writeHeader("date",jsprim.rfc1123(new Date))},RequestSigner.prototype.writeTarget=function(method,path){assert.string(method,"method"),assert.string(path,"path"),method=method.toLowerCase(),this.writeHeader("(request-target)",method+" "+path)},RequestSigner.prototype.sign=function(cb){if(assert.func(cb,"callback"),this.rs_headers.length<1)throw new Error("At least one header must be signed");var alg,authz;if(this.rs_signFunc){var data=this.rs_lines.join("\n"),self=this;this.rs_signFunc(data,function(err,sig){if(err)return void cb(err);try{assert.object(sig,"signature"),assert.string(sig.keyId,"signature.keyId"),assert.string(sig.algorithm,"signature.algorithm"),assert.string(sig.signature,"signature.signature"),alg=validateAlgorithm(sig.algorithm),authz=sprintf(AUTHZ_FMT,sig.keyId,sig.algorithm,self.rs_headers.join(" "),sig.signature)}catch(e){return void cb(e)}cb(null,authz)})}else{try{var sigObj=this.rs_signer.sign()}catch(e){return void cb(e)}alg=(this.rs_alg[0]||this.rs_key.type)+"-"+sigObj.hashAlgorithm;var signature=sigObj.toString();authz=sprintf(AUTHZ_FMT,this.rs_keyId,alg,this.rs_headers.join(" "),signature),cb(null,authz)}},module.exports={isSigner:function(obj){return"object"===(void 0===obj?"undefined":_typeof(obj))&&obj instanceof RequestSigner},createSigner:function(options){return new RequestSigner(options)},signRequest:function(request,options){assert.object(request,"request"),assert.object(options,"options"),assert.optionalString(options.algorithm,"options.algorithm"),assert.string(options.keyId,"options.keyId"),assert.optionalArrayOfString(options.headers,"options.headers"),assert.optionalString(options.httpVersion,"options.httpVersion"),request.getHeader("Date")||request.setHeader("Date",jsprim.rfc1123(new Date)),options.headers||(options.headers=["date"]),options.httpVersion||(options.httpVersion="1.1");var alg=[];options.algorithm&&(options.algorithm=options.algorithm.toLowerCase(),alg=validateAlgorithm(options.algorithm));var i,stringToSign="";for(i=0;i<options.headers.length;i++){if("string"!=typeof options.headers[i])throw new TypeError("options.headers must be an array of Strings");var h=options.headers[i].toLowerCase();if("request-line"===h){if(options.strict)throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");stringToSign+=request.method+" "+request.path+" HTTP/"+options.httpVersion}else if("(request-target)"===h)stringToSign+="(request-target): "+request.method.toLowerCase()+" "+request.path;else{var value=request.getHeader(h);if(void 0===value||""===value)throw new MissingHeaderError(h+" was not in the request");stringToSign+=h+": "+value}i+1<options.headers.length&&(stringToSign+="\n")}request.hasOwnProperty("_stringToSign")&&(request._stringToSign=stringToSign);var signature;if("hmac"===alg[0]){if("string"!=typeof options.key&&!Buffer.isBuffer(options.key))throw new TypeError("options.key must be a string or Buffer");var hmac=crypto.createHmac(alg[1].toUpperCase(),options.key);hmac.update(stringToSign),signature=hmac.digest("base64")}else{var key=options.key;if(("string"==typeof key||Buffer.isBuffer(key))&&(key=sshpk.parsePrivateKey(options.key)),assert.ok(sshpk.PrivateKey.isPrivateKey(key,[1,2]),"options.key must be a sshpk.PrivateKey"),!PK_ALGOS[key.type])throw new InvalidAlgorithmError(key.type.toUpperCase()+" type keys are not supported");if(void 0!==alg[0]&&key.type!==alg[0])throw new InvalidAlgorithmError("options.key must be a "+alg[0].toUpperCase()+" key, was given a "+key.type.toUpperCase()+" key instead");var signer=key.createSign(alg[1]);signer.update(stringToSign);var sigObj=signer.sign();if(!HASH_ALGOS[sigObj.hashAlgorithm])throw new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase()+" is not a supported hash algorithm");options.algorithm=key.type+"-"+sigObj.hashAlgorithm,signature=sigObj.toString(),assert.notStrictEqual(signature,"","empty signature produced")}return request.setHeader("Authorization",sprintf(AUTHZ_FMT,options.keyId,options.algorithm,options.headers.join(" "),signature)),!0}}}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":216,"./utils":210,"assert-plus":63,crypto:121,http:375,jsprim:231,sshpk:367,util:400}],210:[function(require,module,exports){function HttpSignatureError(message,caller){Error.captureStackTrace&&Error.captureStackTrace(this,caller||HttpSignatureError),this.message=message,this.name=caller.name}function InvalidAlgorithmError(message){HttpSignatureError.call(this,message,InvalidAlgorithmError)}function validateAlgorithm(algorithm){var alg=algorithm.toLowerCase().split("-");if(2!==alg.length)throw new InvalidAlgorithmError(alg[0].toUpperCase()+" is not a valid algorithm");if("hmac"!==alg[0]&&!PK_ALGOS[alg[0]])throw new InvalidAlgorithmError(alg[0].toUpperCase()+" type keys are not supported");if(!HASH_ALGOS[alg[1]])throw new InvalidAlgorithmError(alg[1].toUpperCase()+" is not a supported hash algorithm");return alg}var assert=require("assert-plus"),sshpk=require("sshpk"),util=require("util"),HASH_ALGOS={sha1:!0,sha256:!0,sha512:!0},PK_ALGOS={rsa:!0,dsa:!0,ecdsa:!0};util.inherits(HttpSignatureError,Error),util.inherits(InvalidAlgorithmError,HttpSignatureError),module.exports={HASH_ALGOS:HASH_ALGOS,PK_ALGOS:PK_ALGOS,HttpSignatureError:HttpSignatureError,InvalidAlgorithmError:InvalidAlgorithmError,validateAlgorithm:validateAlgorithm,sshKeyToPEM:function(key){return assert.string(key,"ssh_key"),sshpk.parseKey(key,"ssh").toString("pem")},fingerprint:function(key){return assert.string(key,"ssh_key"),sshpk.parseKey(key,"ssh").fingerprint("md5").toString("hex")},pemToRsaSSHKey:function(pem,comment){assert.equal("string",void 0===pem?"undefined":_typeof(pem),"typeof pem");var k=sshpk.parseKey(pem,"pem");return k.comment=comment,k.toString("ssh")}}},{"assert-plus":63,sshpk:367,util:400}],211:[function(require,module,exports){(function(Buffer){var assert=require("assert-plus"),crypto=require("crypto"),sshpk=require("sshpk"),utils=require("./utils"),validateAlgorithm=(utils.HASH_ALGOS,utils.PK_ALGOS,utils.InvalidAlgorithmError,utils.HttpSignatureError,utils.validateAlgorithm);module.exports={verifySignature:function(parsedSignature,pubkey){assert.object(parsedSignature,"parsedSignature"),("string"==typeof pubkey||Buffer.isBuffer(pubkey))&&(pubkey=sshpk.parseKey(pubkey)),assert.ok(sshpk.Key.isKey(pubkey,[1,1]),"pubkey must be a sshpk.Key");var alg=validateAlgorithm(parsedSignature.algorithm);if("hmac"===alg[0]||alg[0]!==pubkey.type)return!1;var v=pubkey.createVerify(alg[1]);return v.update(parsedSignature.signingString),v.verify(parsedSignature.params.signature,"base64")},verifyHMAC:function(parsedSignature,secret){assert.object(parsedSignature,"parsedHMAC"),assert.string(secret,"secret");var alg=validateAlgorithm(parsedSignature.algorithm);if("hmac"!==alg[0])return!1;var hashAlg=alg[1].toUpperCase(),hmac=crypto.createHmac(hashAlg,secret);hmac.update(parsedSignature.signingString);var h1=crypto.createHmac(hashAlg,secret);h1.update(hmac.digest()),h1=h1.digest();var h2=crypto.createHmac(hashAlg,secret);return h2.update(new Buffer(parsedSignature.params.signature,"base64")),h2=h2.digest(),"string"==typeof h1?h1===h2:Buffer.isBuffer(h1)&&!h1.equals?h1.toString("binary")===h2.toString("binary"):h1.equals(h2)}}}).call(this,require("buffer").Buffer)},{"./utils":210,"assert-plus":63,buffer:108,crypto:121,sshpk:367}],212:[function(require,module,exports){function validateParams(params){if("string"==typeof params&&(params=url.parse(params)),params.protocol||(params.protocol="https:"),"https:"!==params.protocol)throw new Error('Protocol "'+params.protocol+'" not supported. Expected "https:"');return params}var http=require("http"),url=require("url"),https=module.exports;for(var key in http)http.hasOwnProperty(key)&&(https[key]=http[key]);https.request=function(params,cb){return params=validateParams(params),http.request.call(this,params,cb)},https.get=function(params,cb){return params=validateParams(params),http.get.call(this,params,cb)}},{http:375,url:395}],213:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;eLen>0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},{}],214:[function(require,module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i)if(arr[i]===obj)return i;return-1}},{}],215:[function(require,module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},{}],216:[function(require,module,exports){function isBuffer(obj){return!!obj.constructor&&"function"==typeof obj.constructor.isBuffer&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isBuffer(obj.slice(0,0))}module.exports=function(obj){return null!=obj&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)}},{}],217:[function(require,module,exports){function isFunction(fn){var string=toString.call(fn);return"[object Function]"===string||"function"==typeof fn&&"[object RegExp]"!==string||void 0!==window&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString},{}],218:[function(require,module,exports){function isTypedArray(arr){return isStrictTypedArray(arr)||isLooseTypedArray(arr)}function isStrictTypedArray(arr){return arr instanceof Int8Array||arr instanceof Int16Array||arr instanceof Int32Array||arr instanceof Uint8Array||arr instanceof Uint8ClampedArray||arr instanceof Uint16Array||arr instanceof Uint32Array||arr instanceof Float32Array||arr instanceof Float64Array}function isLooseTypedArray(arr){return names[toString.call(arr)]}module.exports=isTypedArray,isTypedArray.strict=isStrictTypedArray,isTypedArray.loose=isLooseTypedArray;var toString=Object.prototype.toString,names={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0}},{}],219:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},{}],220:[function(require,module,exports){function isStream(obj){return obj instanceof stream.Stream}function isReadable(obj){return isStream(obj)&&"function"==typeof obj._read&&"object"==_typeof(obj._readableState)}function isWritable(obj){return isStream(obj)&&"function"==typeof obj._write&&"object"==_typeof(obj._writableState)}function isDuplex(obj){return isReadable(obj)&&isWritable(obj)}var stream=require("stream");module.exports=isStream,module.exports.isReadable=isReadable,module.exports.isWritable=isWritable,module.exports.isDuplex=isDuplex},{stream:374}],221:[function(require,module,exports){var encode=require("./lib/encoder"),decode=require("./lib/decoder");module.exports={encode:encode,decode:decode}},{"./lib/decoder":222,"./lib/encoder":223}],222:[function(require,module,exports){(function(Buffer){function decode(jpegData,useTArray){var arr=new Uint8Array(jpegData),decoder=new JpegImage;decoder.parse(arr);var image={width:decoder.width,height:decoder.height,data:useTArray?new Uint8Array(decoder.width*decoder.height*4):new Buffer(decoder.width*decoder.height*4)};return decoder.copyToImageData(image),image}var JpegImage=function(){function constructor(){}function buildHuffmanTable(codeLengths,values){for(var i,j,k=0,code=[],length=16;length>0&&!codeLengths[length-1];)length--;code.push({children:[],index:0});var q,p=code[0];for(i=0;i<length;i++){for(j=0;j<codeLengths[i];j++){for(p=code.pop(),p.children[p.index]=values[k];p.index>0;)p=code.pop();for(p.index++,code.push(p);code.length<=i;)code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q;k++}i+1<length&&(code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q)}return code[0].children}function decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successivePrev,successive){function readBit(){if(bitsCount>0)return bitsCount--,bitsData>>bitsCount&1;if(255==(bitsData=data[offset++])){var nextByte=data[offset++];if(nextByte)throw"unexpected marker: "+(bitsData<<8|nextByte).toString(16)}return bitsCount=7,bitsData>>>7}function decodeHuffman(tree){for(var bit,node=tree;null!==(bit=readBit());){if("number"==typeof(node=node[bit]))return node;if("object"!==(void 0===node?"undefined":_typeof(node)))throw"invalid huffman sequence"}return null}function receive(length){for(var n=0;length>0;){var bit=readBit();if(null===bit)return;n=n<<1|bit,length--}return n}function receiveAndExtend(length){var n=receive(length);return n>=1<<length-1?n:n+(-1<<length)+1}function decodeBaseline(component,zz){var t=decodeHuffman(component.huffmanTableDC),diff=0===t?0:receiveAndExtend(t);zz[0]=component.pred+=diff;for(var k=1;k<64;){var rs=decodeHuffman(component.huffmanTableAC),s=15&rs,r=rs>>4;if(0!==s){k+=r;zz[dctZigZag[k]]=receiveAndExtend(s),k++}else{if(r<15)break;k+=16}}}function decodeDCFirst(component,zz){var t=decodeHuffman(component.huffmanTableDC),diff=0===t?0:receiveAndExtend(t)<<successive;zz[0]=component.pred+=diff}function decodeDCSuccessive(component,zz){zz[0]|=readBit()<<successive}function decodeACFirst(component,zz){if(eobrun>0)return void eobrun--;for(var k=spectralStart,e=spectralEnd;k<=e;){var rs=decodeHuffman(component.huffmanTableAC),s=15&rs,r=rs>>4;if(0!==s){k+=r;zz[dctZigZag[k]]=receiveAndExtend(s)*(1<<successive),k++}else{if(r<15){eobrun=receive(r)+(1<<r)-1;break}k+=16}}}function decodeACSuccessive(component,zz){for(var k=spectralStart,e=spectralEnd,r=0;k<=e;){var z=dctZigZag[k];switch(successiveACState){case 0:var rs=decodeHuffman(component.huffmanTableAC),s=15&rs,r=rs>>4;if(0===s)r<15?(eobrun=receive(r)+(1<<r),successiveACState=4):(r=16,successiveACState=1);else{if(1!==s)throw"invalid ACn encoding";successiveACNextValue=receiveAndExtend(s),successiveACState=r?2:3}continue;case 1:case 2:zz[z]?zz[z]+=readBit()<<successive:0===--r&&(successiveACState=2==successiveACState?3:0);break;case 3:zz[z]?zz[z]+=readBit()<<successive:(zz[z]=successiveACNextValue<<successive,successiveACState=0);break;case 4:zz[z]&&(zz[z]+=readBit()<<successive)}k++}4===successiveACState&&0===--eobrun&&(successiveACState=0)}function decodeMcu(component,decode,mcu,row,col){var mcuRow=mcu/mcusPerLine|0,mcuCol=mcu%mcusPerLine,blockRow=mcuRow*component.v+row,blockCol=mcuCol*component.h+col;decode(component,component.blocks[blockRow][blockCol])}function decodeBlock(component,decode,mcu){var blockRow=mcu/component.blocksPerLine|0,blockCol=mcu%component.blocksPerLine;decode(component,component.blocks[blockRow][blockCol])}var successiveACNextValue,component,i,j,k,n,decodeFn,mcusPerLine=(frame.precision,frame.samplesPerLine,frame.scanLines,frame.mcusPerLine),progressive=frame.progressive,startOffset=(frame.maxH,frame.maxV,offset),bitsData=0,bitsCount=0,eobrun=0,successiveACState=0,componentsLength=components.length;decodeFn=progressive?0===spectralStart?0===successivePrev?decodeDCFirst:decodeDCSuccessive:0===successivePrev?decodeACFirst:decodeACSuccessive:decodeBaseline;var marker,mcuExpected,mcu=0;mcuExpected=1==componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn,resetInterval||(resetInterval=mcuExpected);for(var h,v;mcu<mcuExpected;){for(i=0;i<componentsLength;i++)components[i].pred=0;if(eobrun=0,1==componentsLength)for(component=components[0],n=0;n<resetInterval;n++)decodeBlock(component,decodeFn,mcu),mcu++;else for(n=0;n<resetInterval;n++){for(i=0;i<componentsLength;i++)for(component=components[i],h=component.h,v=component.v,j=0;j<v;j++)for(k=0;k<h;k++)decodeMcu(component,decodeFn,mcu,j,k);if(++mcu===mcuExpected)break}if(bitsCount=0,(marker=data[offset]<<8|data[offset+1])<65280)throw"marker was not found";if(!(marker>=65488&&marker<=65495))break;offset+=2}return offset-startOffset}function buildComponentData(frame,component){function quantizeAndInverse(zz,dataOut,dataIn){var v0,v1,v2,v3,v4,v5,v6,v7,t,i,qt=component.quantizationTable,p=dataIn;for(i=0;i<64;i++)p[i]=zz[i]*qt[i];for(i=0;i<8;++i){var row=8*i;0!=p[1+row]||0!=p[2+row]||0!=p[3+row]||0!=p[4+row]||0!=p[5+row]||0!=p[6+row]||0!=p[7+row]?(v0=dctSqrt2*p[0+row]+128>>8,v1=dctSqrt2*p[4+row]+128>>8,v2=p[2+row],v3=p[6+row],v4=dctSqrt1d2*(p[1+row]-p[7+row])+128>>8,v7=dctSqrt1d2*(p[1+row]+p[7+row])+128>>8,v5=p[3+row]<<4,v6=p[5+row]<<4,t=v0-v1+1>>1,v0=v0+v1+1>>1,v1=t,t=v2*dctSin6+v3*dctCos6+128>>8,v2=v2*dctCos6-v3*dctSin6+128>>8,v3=t,t=v4-v6+1>>1,v4=v4+v6+1>>1,v6=t,t=v7+v5+1>>1,v5=v7-v5+1>>1,v7=t,t=v0-v3+1>>1,v0=v0+v3+1>>1,v3=t,t=v1-v2+1>>1,v1=v1+v2+1>>1,v2=t,t=v4*dctSin3+v7*dctCos3+2048>>12,v4=v4*dctCos3-v7*dctSin3+2048>>12,v7=t,t=v5*dctSin1+v6*dctCos1+2048>>12,v5=v5*dctCos1-v6*dctSin1+2048>>12,v6=t,p[0+row]=v0+v7,p[7+row]=v0-v7,p[1+row]=v1+v6,p[6+row]=v1-v6,p[2+row]=v2+v5,p[5+row]=v2-v5,p[3+row]=v3+v4,p[4+row]=v3-v4):(t=dctSqrt2*p[0+row]+512>>10,p[0+row]=t,p[1+row]=t,p[2+row]=t,p[3+row]=t,p[4+row]=t,p[5+row]=t,p[6+row]=t,p[7+row]=t)}for(i=0;i<8;++i){var col=i;0!=p[8+col]||0!=p[16+col]||0!=p[24+col]||0!=p[32+col]||0!=p[40+col]||0!=p[48+col]||0!=p[56+col]?(v0=dctSqrt2*p[0+col]+2048>>12,v1=dctSqrt2*p[32+col]+2048>>12,v2=p[16+col],v3=p[48+col],v4=dctSqrt1d2*(p[8+col]-p[56+col])+2048>>12,v7=dctSqrt1d2*(p[8+col]+p[56+col])+2048>>12,v5=p[24+col],v6=p[40+col],t=v0-v1+1>>1,v0=v0+v1+1>>1,v1=t,t=v2*dctSin6+v3*dctCos6+2048>>12,v2=v2*dctCos6-v3*dctSin6+2048>>12,v3=t,t=v4-v6+1>>1,v4=v4+v6+1>>1,v6=t,t=v7+v5+1>>1,v5=v7-v5+1>>1,v7=t,t=v0-v3+1>>1,v0=v0+v3+1>>1,v3=t,t=v1-v2+1>>1,v1=v1+v2+1>>1,v2=t,t=v4*dctSin3+v7*dctCos3+2048>>12,v4=v4*dctCos3-v7*dctSin3+2048>>12,v7=t,t=v5*dctSin1+v6*dctCos1+2048>>12,v5=v5*dctCos1-v6*dctSin1+2048>>12,v6=t,p[0+col]=v0+v7,p[56+col]=v0-v7,p[8+col]=v1+v6,p[48+col]=v1-v6,p[16+col]=v2+v5,p[40+col]=v2-v5,p[24+col]=v3+v4,p[32+col]=v3-v4):(t=dctSqrt2*dataIn[i+0]+8192>>14,p[0+col]=t,p[8+col]=t,p[16+col]=t,p[24+col]=t,p[32+col]=t,p[40+col]=t,p[48+col]=t,p[56+col]=t)}for(i=0;i<64;++i){var sample=128+(p[i]+8>>4);dataOut[i]=sample<0?0:sample>255?255:sample}}for(var i,j,lines=[],blocksPerLine=component.blocksPerLine,blocksPerColumn=component.blocksPerColumn,samplesPerLine=blocksPerLine<<3,R=new Int32Array(64),r=new Uint8Array(64),blockRow=0;blockRow<blocksPerColumn;blockRow++){var scanLine=blockRow<<3;for(i=0;i<8;i++)lines.push(new Uint8Array(samplesPerLine));for(var blockCol=0;blockCol<blocksPerLine;blockCol++){quantizeAndInverse(component.blocks[blockRow][blockCol],r,R);var offset=0,sample=blockCol<<3;for(j=0;j<8;j++){var line=lines[scanLine+j];for(i=0;i<8;i++)line[sample+i]=r[offset++]}}}return lines}function clampTo8bit(a){return a<0?0:a>255?255:a}var dctZigZag=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),dctCos1=4017,dctSin1=799,dctCos3=3406,dctSin3=2276,dctCos6=1567,dctSin6=3784,dctSqrt2=5793,dctSqrt1d2=2896;return constructor.prototype={load:function(path){var xhr=new XMLHttpRequest;xhr.open("GET",path,!0),xhr.responseType="arraybuffer",xhr.onload=function(){var data=new Uint8Array(xhr.response||xhr.mozResponseArrayBuffer);this.parse(data),this.onload&&this.onload()}.bind(this),xhr.send(null)},parse:function(data){function readUint16(){var value=data[offset]<<8|data[offset+1];return offset+=2,value}function readDataBlock(){var length=readUint16(),array=data.subarray(offset,offset+length-2);return offset+=array.length,array}function prepareComponents(frame){var component,componentId,maxH=0,maxV=0;for(componentId in frame.components)frame.components.hasOwnProperty(componentId)&&(component=frame.components[componentId],maxH<component.h&&(maxH=component.h),maxV<component.v&&(maxV=component.v));var mcusPerLine=Math.ceil(frame.samplesPerLine/8/maxH),mcusPerColumn=Math.ceil(frame.scanLines/8/maxV);for(componentId in frame.components)if(frame.components.hasOwnProperty(componentId)){component=frame.components[componentId];for(var blocksPerLine=Math.ceil(Math.ceil(frame.samplesPerLine/8)*component.h/maxH),blocksPerColumn=Math.ceil(Math.ceil(frame.scanLines/8)*component.v/maxV),blocksPerLineForMcu=mcusPerLine*component.h,blocksPerColumnForMcu=mcusPerColumn*component.v,blocks=[],i=0;i<blocksPerColumnForMcu;i++){for(var row=[],j=0;j<blocksPerLineForMcu;j++)row.push(new Int32Array(64));blocks.push(row)}component.blocksPerLine=blocksPerLine,component.blocksPerColumn=blocksPerColumn,component.blocks=blocks}frame.maxH=maxH,frame.maxV=maxV,frame.mcusPerLine=mcusPerLine,frame.mcusPerColumn=mcusPerColumn}var frame,resetInterval,offset=0,jfif=(data.length,null),adobe=null,quantizationTables=[],frames=[],huffmanTablesAC=[],huffmanTablesDC=[],fileMarker=readUint16();if(65496!=fileMarker)throw"SOI not found";for(fileMarker=readUint16();65497!=fileMarker;){var i,j;switch(fileMarker){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var appData=readDataBlock();65504===fileMarker&&74===appData[0]&&70===appData[1]&&73===appData[2]&&70===appData[3]&&0===appData[4]&&(jfif={version:{major:appData[5],minor:appData[6]},densityUnits:appData[7],xDensity:appData[8]<<8|appData[9],yDensity:appData[10]<<8|appData[11],thumbWidth:appData[12],thumbHeight:appData[13],thumbData:appData.subarray(14,14+3*appData[12]*appData[13])}),65518===fileMarker&&65===appData[0]&&100===appData[1]&&111===appData[2]&&98===appData[3]&&101===appData[4]&&0===appData[5]&&(adobe={version:appData[6],flags0:appData[7]<<8|appData[8],flags1:appData[9]<<8|appData[10],transformCode:appData[11]});break;case 65499:for(var quantizationTablesLength=readUint16(),quantizationTablesEnd=quantizationTablesLength+offset-2;offset<quantizationTablesEnd;){var quantizationTableSpec=data[offset++],tableData=new Int32Array(64);if(quantizationTableSpec>>4==0)for(j=0;j<64;j++){var z=dctZigZag[j];tableData[z]=data[offset++]}else{if(quantizationTableSpec>>4!=1)throw"DQT: invalid table spec";for(j=0;j<64;j++){var z=dctZigZag[j];tableData[z]=readUint16()}}quantizationTables[15&quantizationTableSpec]=tableData}break;case 65472:case 65473:case 65474:readUint16(),frame={},frame.extended=65473===fileMarker,frame.progressive=65474===fileMarker,frame.precision=data[offset++],frame.scanLines=readUint16(),frame.samplesPerLine=readUint16(),frame.components={},frame.componentsOrder=[];var componentId,componentsCount=data[offset++];for(i=0;i<componentsCount;i++){componentId=data[offset];var h=data[offset+1]>>4,v=15&data[offset+1],qId=data[offset+2];frame.componentsOrder.push(componentId),frame.components[componentId]={h:h,v:v,quantizationIdx:qId},offset+=3}prepareComponents(frame),frames.push(frame);break;case 65476:var huffmanLength=readUint16();for(i=2;i<huffmanLength;){var huffmanTableSpec=data[offset++],codeLengths=new Uint8Array(16),codeLengthSum=0;for(j=0;j<16;j++,offset++)codeLengthSum+=codeLengths[j]=data[offset];var huffmanValues=new Uint8Array(codeLengthSum);for(j=0;j<codeLengthSum;j++,offset++)huffmanValues[j]=data[offset];i+=17+codeLengthSum,(huffmanTableSpec>>4==0?huffmanTablesDC:huffmanTablesAC)[15&huffmanTableSpec]=buildHuffmanTable(codeLengths,huffmanValues)}break;case 65501:readUint16(),resetInterval=readUint16();break;case 65498:var component,selectorsCount=(readUint16(),data[offset++]),components=[];for(i=0;i<selectorsCount;i++){component=frame.components[data[offset++]];var tableSpec=data[offset++];component.huffmanTableDC=huffmanTablesDC[tableSpec>>4],component.huffmanTableAC=huffmanTablesAC[15&tableSpec],components.push(component)}var spectralStart=data[offset++],spectralEnd=data[offset++],successiveApproximation=data[offset++],processed=decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successiveApproximation>>4,15&successiveApproximation);offset+=processed;break;default:if(255==data[offset-3]&&data[offset-2]>=192&&data[offset-2]<=254){offset-=3;break}throw"unknown JPEG marker "+fileMarker.toString(16)}fileMarker=readUint16()}if(1!=frames.length)throw"only single frame JPEGs supported";for(var i=0;i<frames.length;i++){var cp=frames[i].components;for(var j in cp)cp[j].quantizationTable=quantizationTables[cp[j].quantizationIdx],delete cp[j].quantizationIdx}this.width=frame.samplesPerLine,this.height=frame.scanLines,this.jfif=jfif,this.adobe=adobe,this.components=[];for(var i=0;i<frame.componentsOrder.length;i++){var component=frame.components[frame.componentsOrder[i]];this.components.push({lines:buildComponentData(frame,component),scaleX:component.h/frame.maxH,scaleY:component.v/frame.maxV})}},getData:function(width,height){var component1,component2,component3,component4,component1Line,component2Line,component3Line,component4Line,x,y,Y,Cb,Cr,K,C,M,Ye,R,G,B,colorTransform,scaleX=this.width/width,scaleY=this.height/height,offset=0,dataLength=width*height*this.components.length,data=new Uint8Array(dataLength);switch(this.components.length){case 1:for(component1=this.components[0],y=0;y<height;y++)for(component1Line=component1.lines[0|y*component1.scaleY*scaleY],x=0;x<width;x++)Y=component1Line[0|x*component1.scaleX*scaleX],data[offset++]=Y;break;case 2:for(component1=this.components[0],component2=this.components[1],y=0;y<height;y++)for(component1Line=component1.lines[0|y*component1.scaleY*scaleY],component2Line=component2.lines[0|y*component2.scaleY*scaleY],x=0;x<width;x++)Y=component1Line[0|x*component1.scaleX*scaleX],data[offset++]=Y,Y=component2Line[0|x*component2.scaleX*scaleX],data[offset++]=Y;break;case 3:for(colorTransform=!0,this.adobe&&this.adobe.transformCode?colorTransform=!0:void 0!==this.colorTransform&&(colorTransform=!!this.colorTransform),component1=this.components[0],component2=this.components[1],component3=this.components[2],y=0;y<height;y++)for(component1Line=component1.lines[0|y*component1.scaleY*scaleY],component2Line=component2.lines[0|y*component2.scaleY*scaleY],component3Line=component3.lines[0|y*component3.scaleY*scaleY],x=0;x<width;x++)colorTransform?(Y=component1Line[0|x*component1.scaleX*scaleX],Cb=component2Line[0|x*component2.scaleX*scaleX],Cr=component3Line[0|x*component3.scaleX*scaleX],R=clampTo8bit(Y+1.402*(Cr-128)),G=clampTo8bit(Y-.3441363*(Cb-128)-.71413636*(Cr-128)),B=clampTo8bit(Y+1.772*(Cb-128))):(R=component1Line[0|x*component1.scaleX*scaleX],G=component2Line[0|x*component2.scaleX*scaleX],B=component3Line[0|x*component3.scaleX*scaleX]),data[offset++]=R,data[offset++]=G,data[offset++]=B;break;case 4:if(!this.adobe)throw"Unsupported color mode (4 components)";for(colorTransform=!1,this.adobe&&this.adobe.transformCode?colorTransform=!0:void 0!==this.colorTransform&&(colorTransform=!!this.colorTransform),component1=this.components[0],component2=this.components[1],component3=this.components[2],component4=this.components[3],y=0;y<height;y++)for(component1Line=component1.lines[0|y*component1.scaleY*scaleY],component2Line=component2.lines[0|y*component2.scaleY*scaleY],component3Line=component3.lines[0|y*component3.scaleY*scaleY],component4Line=component4.lines[0|y*component4.scaleY*scaleY],x=0;x<width;x++)colorTransform?(Y=component1Line[0|x*component1.scaleX*scaleX],Cb=component2Line[0|x*component2.scaleX*scaleX],Cr=component3Line[0|x*component3.scaleX*scaleX],K=component4Line[0|x*component4.scaleX*scaleX],C=255-clampTo8bit(Y+1.402*(Cr-128)),M=255-clampTo8bit(Y-.3441363*(Cb-128)-.71413636*(Cr-128)),Ye=255-clampTo8bit(Y+1.772*(Cb-128))):(C=component1Line[0|x*component1.scaleX*scaleX],M=component2Line[0|x*component2.scaleX*scaleX],Ye=component3Line[0|x*component3.scaleX*scaleX],K=component4Line[0|x*component4.scaleX*scaleX]),data[offset++]=255-C,data[offset++]=255-M,data[offset++]=255-Ye,data[offset++]=255-K;break;default:throw"Unsupported color mode"}return data},copyToImageData:function(imageData){var x,y,Y,K,C,M,R,G,B,width=imageData.width,height=imageData.height,imageDataArray=imageData.data,data=this.getData(width,height),i=0,j=0;switch(this.components.length){case 1:for(y=0;y<height;y++)for(x=0;x<width;x++)Y=data[i++],imageDataArray[j++]=Y,imageDataArray[j++]=Y,imageDataArray[j++]=Y,imageDataArray[j++]=255;break;case 3:for(y=0;y<height;y++)for(x=0;x<width;x++)R=data[i++],G=data[i++],B=data[i++],imageDataArray[j++]=R,imageDataArray[j++]=G,imageDataArray[j++]=B,imageDataArray[j++]=255;break;case 4:for(y=0;y<height;y++)for(x=0;x<width;x++)C=data[i++],M=data[i++],Y=data[i++],K=data[i++],R=255-clampTo8bit(C*(1-K/255)+K),G=255-clampTo8bit(M*(1-K/255)+K),B=255-clampTo8bit(Y*(1-K/255)+K),imageDataArray[j++]=R,imageDataArray[j++]=G,imageDataArray[j++]=B,imageDataArray[j++]=255;break;default:throw"Unsupported color mode"}}},constructor}();module.exports=decode}).call(this,require("buffer").Buffer)},{buffer:108}],223:[function(require,module,exports){(function(Buffer){function JPEGEncoder(quality){function initQuantTables(sf){for(var YQT=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var t=ffloor((YQT[i]*sf+50)/100);t<1?t=1:t>255&&(t=255),YTable[ZigZag[i]]=t}for(var UVQT=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],j=0;j<64;j++){var u=ffloor((UVQT[j]*sf+50)/100);u<1?u=1:u>255&&(u=255),UVTable[ZigZag[j]]=u}for(var aasf=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],k=0,row=0;row<8;row++)for(var col=0;col<8;col++)fdtbl_Y[k]=1/(YTable[ZigZag[k]]*aasf[row]*aasf[col]*8),fdtbl_UV[k]=1/(UVTable[ZigZag[k]]*aasf[row]*aasf[col]*8),k++}function computeHuffmanTbl(nrcodes,std_table){for(var codevalue=0,pos_in_table=0,HT=new Array,k=1;k<=16;k++){for(var j=1;j<=nrcodes[k];j++)HT[std_table[pos_in_table]]=[],HT[std_table[pos_in_table]][0]=codevalue,HT[std_table[pos_in_table]][1]=k,pos_in_table++,codevalue++;codevalue*=2}return HT}function initHuffmanTbl(){YDC_HT=computeHuffmanTbl(std_dc_luminance_nrcodes,std_dc_luminance_values),UVDC_HT=computeHuffmanTbl(std_dc_chrominance_nrcodes,std_dc_chrominance_values),YAC_HT=computeHuffmanTbl(std_ac_luminance_nrcodes,std_ac_luminance_values),UVAC_HT=computeHuffmanTbl(std_ac_chrominance_nrcodes,std_ac_chrominance_values)}function initCategoryNumber(){for(var nrlower=1,nrupper=2,cat=1;cat<=15;cat++){for(var nr=nrlower;nr<nrupper;nr++)category[32767+nr]=cat,bitcode[32767+nr]=[],bitcode[32767+nr][1]=cat,bitcode[32767+nr][0]=nr;for(var nrneg=-(nrupper-1);nrneg<=-nrlower;nrneg++)category[32767+nrneg]=cat,bitcode[32767+nrneg]=[],bitcode[32767+nrneg][1]=cat,bitcode[32767+nrneg][0]=nrupper-1+nrneg;nrlower<<=1,nrupper<<=1}}function initRGBYUVTable(){for(var i=0;i<256;i++)RGB_YUV_TABLE[i]=19595*i,RGB_YUV_TABLE[i+256>>0]=38470*i,RGB_YUV_TABLE[i+512>>0]=7471*i+32768,RGB_YUV_TABLE[i+768>>0]=-11059*i,RGB_YUV_TABLE[i+1024>>0]=-21709*i,RGB_YUV_TABLE[i+1280>>0]=32768*i+8421375,RGB_YUV_TABLE[i+1536>>0]=-27439*i,RGB_YUV_TABLE[i+1792>>0]=-5329*i}function writeBits(bs){for(var value=bs[0],posval=bs[1]-1;posval>=0;)value&1<<posval&&(bytenew|=1<<bytepos),posval--,--bytepos<0&&(255==bytenew?(writeByte(255),writeByte(0)):writeByte(bytenew),bytepos=7,bytenew=0)}function writeByte(value){byteout.push(value)}function writeWord(value){writeByte(value>>8&255),writeByte(255&value)}function fDCTQuant(data,fdtbl){var d0,d1,d2,d3,d4,d5,d6,d7,i,dataOff=0,I8=8,I64=64;for(i=0;i<I8;++i){d0=data[dataOff],d1=data[dataOff+1],d2=data[dataOff+2],d3=data[dataOff+3],d4=data[dataOff+4],d5=data[dataOff+5],d6=data[dataOff+6],d7=data[dataOff+7];var tmp0=d0+d7,tmp7=d0-d7,tmp1=d1+d6,tmp6=d1-d6,tmp2=d2+d5,tmp5=d2-d5,tmp3=d3+d4,tmp4=d3-d4,tmp10=tmp0+tmp3,tmp13=tmp0-tmp3,tmp11=tmp1+tmp2,tmp12=tmp1-tmp2;data[dataOff]=tmp10+tmp11,data[dataOff+4]=tmp10-tmp11;var z1=.707106781*(tmp12+tmp13);data[dataOff+2]=tmp13+z1,data[dataOff+6]=tmp13-z1,tmp10=tmp4+tmp5,tmp11=tmp5+tmp6,tmp12=tmp6+tmp7;var z5=.382683433*(tmp10-tmp12),z2=.5411961*tmp10+z5,z4=1.306562965*tmp12+z5,z3=.707106781*tmp11,z11=tmp7+z3,z13=tmp7-z3;data[dataOff+5]=z13+z2,data[dataOff+3]=z13-z2,data[dataOff+1]=z11+z4,data[dataOff+7]=z11-z4,dataOff+=8}for(dataOff=0,i=0;i<I8;++i){d0=data[dataOff],d1=data[dataOff+8],d2=data[dataOff+16],d3=data[dataOff+24],d4=data[dataOff+32],d5=data[dataOff+40],d6=data[dataOff+48],d7=data[dataOff+56];var tmp0p2=d0+d7,tmp7p2=d0-d7,tmp1p2=d1+d6,tmp6p2=d1-d6,tmp2p2=d2+d5,tmp5p2=d2-d5,tmp3p2=d3+d4,tmp4p2=d3-d4,tmp10p2=tmp0p2+tmp3p2,tmp13p2=tmp0p2-tmp3p2,tmp11p2=tmp1p2+tmp2p2,tmp12p2=tmp1p2-tmp2p2;data[dataOff]=tmp10p2+tmp11p2,data[dataOff+32]=tmp10p2-tmp11p2;var z1p2=.707106781*(tmp12p2+tmp13p2);data[dataOff+16]=tmp13p2+z1p2,data[dataOff+48]=tmp13p2-z1p2,tmp10p2=tmp4p2+tmp5p2,tmp11p2=tmp5p2+tmp6p2,tmp12p2=tmp6p2+tmp7p2;var z5p2=.382683433*(tmp10p2-tmp12p2),z2p2=.5411961*tmp10p2+z5p2,z4p2=1.306562965*tmp12p2+z5p2,z3p2=.707106781*tmp11p2,z11p2=tmp7p2+z3p2,z13p2=tmp7p2-z3p2;data[dataOff+40]=z13p2+z2p2,data[dataOff+24]=z13p2-z2p2,data[dataOff+8]=z11p2+z4p2,data[dataOff+56]=z11p2-z4p2,dataOff++}var fDCTQuant;for(i=0;i<I64;++i)fDCTQuant=data[i]*fdtbl[i],outputfDCTQuant[i]=fDCTQuant>0?fDCTQuant+.5|0:fDCTQuant-.5|0;return outputfDCTQuant}function writeAPP0(){writeWord(65504),writeWord(16),writeByte(74),writeByte(70),writeByte(73),writeByte(70),writeByte(0),writeByte(1),writeByte(1),writeByte(0),writeWord(1),writeWord(1),writeByte(0),writeByte(0)}function writeSOF0(width,height){writeWord(65472),writeWord(17),writeByte(8),writeWord(height),writeWord(width),writeByte(3),writeByte(1),writeByte(17),writeByte(0),writeByte(2),writeByte(17),writeByte(1),writeByte(3),writeByte(17),writeByte(1)}function writeDQT(){writeWord(65499),writeWord(132),writeByte(0);for(var i=0;i<64;i++)writeByte(YTable[i]);writeByte(1);for(var j=0;j<64;j++)writeByte(UVTable[j])}function writeDHT(){writeWord(65476),writeWord(418),writeByte(0);for(var i=0;i<16;i++)writeByte(std_dc_luminance_nrcodes[i+1]);for(var j=0;j<=11;j++)writeByte(std_dc_luminance_values[j]);writeByte(16);for(var k=0;k<16;k++)writeByte(std_ac_luminance_nrcodes[k+1]);for(var l=0;l<=161;l++)writeByte(std_ac_luminance_values[l]);writeByte(1);for(var m=0;m<16;m++)writeByte(std_dc_chrominance_nrcodes[m+1]);for(var n=0;n<=11;n++)writeByte(std_dc_chrominance_values[n]);writeByte(17);for(var o=0;o<16;o++)writeByte(std_ac_chrominance_nrcodes[o+1]);for(var p=0;p<=161;p++)writeByte(std_ac_chrominance_values[p])}function writeSOS(){writeWord(65498),writeWord(12),writeByte(3),writeByte(1),writeByte(0),writeByte(2),writeByte(17),writeByte(3),writeByte(17),writeByte(0),writeByte(63),writeByte(0)}function processDU(CDU,fdtbl,DC,HTDC,HTAC){for(var pos,EOB=HTAC[0],M16zeroes=HTAC[240],I16=16,I63=63,I64=64,DU_DCT=fDCTQuant(CDU,fdtbl),j=0;j<I64;++j)DU[ZigZag[j]]=DU_DCT[j];var Diff=DU[0]-DC;DC=DU[0],0==Diff?writeBits(HTDC[0]):(pos=32767+Diff,writeBits(HTDC[category[pos]]),writeBits(bitcode[pos]));for(var end0pos=63;end0pos>0&&0==DU[end0pos];end0pos--);if(0==end0pos)return writeBits(EOB),DC;for(var lng,i=1;i<=end0pos;){for(var startpos=i;0==DU[i]&&i<=end0pos;++i);var nrzeroes=i-startpos;if(nrzeroes>=I16){lng=nrzeroes>>4;for(var nrmarker=1;nrmarker<=lng;++nrmarker)writeBits(M16zeroes);nrzeroes&=15}pos=32767+DU[i],writeBits(HTAC[(nrzeroes<<4)+category[pos]]),writeBits(bitcode[pos]),i++}return end0pos!=I63&&writeBits(EOB),DC}function initCharLookupTable(){for(var sfcc=String.fromCharCode,i=0;i<256;i++)clt[i]=sfcc(i)}function setQuality(quality){if(quality<=0&&(quality=1),quality>100&&(quality=100),currentQuality!=quality){var sf=0;sf=quality<50?Math.floor(5e3/quality):Math.floor(200-2*quality),initQuantTables(sf),currentQuality=quality}}function init(){var time_start=(new Date).getTime();quality||(quality=50),initCharLookupTable(),initHuffmanTbl(),initCategoryNumber(),initRGBYUVTable(),setQuality(quality);(new Date).getTime()}var YDC_HT,UVDC_HT,YAC_HT,UVAC_HT,currentQuality,ffloor=(Math.round,Math.floor),YTable=new Array(64),UVTable=new Array(64),fdtbl_Y=new Array(64),fdtbl_UV=new Array(64),bitcode=new Array(65535),category=new Array(65535),outputfDCTQuant=new Array(64),DU=new Array(64),byteout=[],bytenew=0,bytepos=7,YDU=new Array(64),UDU=new Array(64),VDU=new Array(64),clt=new Array(256),RGB_YUV_TABLE=new Array(2048),ZigZag=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],std_dc_luminance_nrcodes=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],std_dc_luminance_values=[0,1,2,3,4,5,6,7,8,9,10,11],std_ac_luminance_nrcodes=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],std_ac_luminance_values=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],std_dc_chrominance_nrcodes=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],std_dc_chrominance_values=[0,1,2,3,4,5,6,7,8,9,10,11],std_ac_chrominance_nrcodes=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],std_ac_chrominance_values=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];this.encode=function(image,quality){(new Date).getTime();quality&&setQuality(quality),byteout=new Array,bytenew=0,bytepos=7,writeWord(65496),writeAPP0(),writeDQT(),writeSOF0(image.width,image.height),writeDHT(),writeSOS();var DCY=0,DCU=0,DCV=0;bytenew=0,bytepos=7,this.encode.displayName="_encode_";for(var x,r,g,b,start,p,col,row,pos,imageData=image.data,width=image.width,height=image.height,quadWidth=4*width,y=0;y<height;){for(x=0;x<quadWidth;){for(start=quadWidth*y+x,p=start,col=-1,row=0,pos=0;pos<64;pos++)row=pos>>3,col=4*(7&pos),p=start+row*quadWidth+col,y+row>=height&&(p-=quadWidth*(y+1+row-height)),x+col>=quadWidth&&(p-=x+col-quadWidth+4),r=imageData[p++],g=imageData[p++],b=imageData[p++],YDU[pos]=(RGB_YUV_TABLE[r]+RGB_YUV_TABLE[g+256>>0]+RGB_YUV_TABLE[b+512>>0]>>16)-128,UDU[pos]=(RGB_YUV_TABLE[r+768>>0]+RGB_YUV_TABLE[g+1024>>0]+RGB_YUV_TABLE[b+1280>>0]>>16)-128,VDU[pos]=(RGB_YUV_TABLE[r+1280>>0]+RGB_YUV_TABLE[g+1536>>0]+RGB_YUV_TABLE[b+1792>>0]>>16)-128;DCY=processDU(YDU,fdtbl_Y,DCY,YDC_HT,YAC_HT),DCU=processDU(UDU,fdtbl_UV,DCU,UVDC_HT,UVAC_HT),DCV=processDU(VDU,fdtbl_UV,DCV,UVDC_HT,UVAC_HT),x+=32}y+=8}if(bytepos>=0){var fillbits=[];fillbits[1]=bytepos+1,fillbits[0]=(1<<bytepos+1)-1,writeBits(fillbits)}return writeWord(65497),new Buffer(byteout)},init()}function encode(imgData,qu){return void 0===qu&&(qu=50),{data:new JPEGEncoder(qu).encode(imgData,qu),width:imgData.width,height:imgData.height}}module.exports=encode}).call(this,require("buffer").Buffer)},{buffer:108}],224:[function(require,module,exports){(function(){function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(i,x,w,j,c,n){for(;--n>=0;){var v=x*this[i++]+w[j]+c;c=Math.floor(v/67108864),w[j++]=67108863&v}return c}function am2(i,x,w,j,c,n){for(var xl=32767&x,xh=x>>15;--n>=0;){var l=32767&this[i],h=this[i++]>>15,m=xh*l+h*xl;l=xl*l+((32767&m)<<15)+w[j]+(1073741823&c),c=(l>>>30)+(m>>>15)+xh*h+(c>>>30),w[j++]=1073741823&l}return c}function am3(i,x,w,j,c,n){for(var xl=16383&x,xh=x>>14;--n>=0;){var l=16383&this[i],h=this[i++]>>14,m=xh*l+h*xl;l=xl*l+((16383&m)<<14)+w[j]+c,c=(l>>28)+(m>>14)+xh*h,w[j++]=268435455&l}return c}function int2char(n){return BI_RM.charAt(n)}function intAt(s,i){var c=BI_RC[s.charCodeAt(i)];return null==c?-1:c}function bnpCopyTo(r){for(var i=this.t-1;i>=0;--i)r[i]=this[i];r.t=this.t,r.s=this.s}function bnpFromInt(x){this.t=1,this.s=x<0?-1:0,x>0?this[0]=x:x<-1?this[0]=x+this.DV:this.t=0}function nbv(i){var r=nbi();return r.fromInt(i),r}function bnpFromString(s,b){var k;if(16==b)k=4;else if(8==b)k=3;else if(256==b)k=8;else if(2==b)k=1;else if(32==b)k=5;else{if(4!=b)return void this.fromRadix(s,b);k=2}this.t=0,this.s=0;for(var i=s.length,mi=!1,sh=0;--i>=0;){var x=8==k?255&s[i]:intAt(s,i);x<0?"-"==s.charAt(i)&&(mi=!0):(mi=!1,0==sh?this[this.t++]=x:sh+k>this.DB?(this[this.t-1]|=(x&(1<<this.DB-sh)-1)<<sh,this[this.t++]=x>>this.DB-sh):this[this.t-1]|=x<<sh,(sh+=k)>=this.DB&&(sh-=this.DB))}8==k&&0!=(128&s[0])&&(this.s=-1,sh>0&&(this[this.t-1]|=(1<<this.DB-sh)-1<<sh)),this.clamp(),mi&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var c=this.s&this.DM;this.t>0&&this[this.t-1]==c;)--this.t}function bnToString(b){if(this.s<0)return"-"+this.negate().toString(b);var k;if(16==b)k=4;else if(8==b)k=3;else if(2==b)k=1;else if(32==b)k=5;else{if(4!=b)return this.toRadix(b);k=2}var d,km=(1<<k)-1,m=!1,r="",i=this.t,p=this.DB-i*this.DB%k;if(i-- >0)for(p<this.DB&&(d=this[i]>>p)>0&&(m=!0,r=int2char(d));i>=0;)p<k?(d=(this[i]&(1<<p)-1)<<k-p,d|=this[--i]>>(p+=this.DB-k)):(d=this[i]>>(p-=k)&km,p<=0&&(p+=this.DB,--i)),d>0&&(m=!0),m&&(r+=int2char(d));return m?r:"0"}function bnNegate(){var r=nbi();return BigInteger.ZERO.subTo(this,r),r}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var r=this.s-a.s;if(0!=r)return r;var i=this.t;if(0!=(r=i-a.t))return this.s<0?-r:r;for(;--i>=0;)if(0!=(r=this[i]-a[i]))return r;return 0}function nbits(x){var t,r=1;return 0!=(t=x>>>16)&&(x=t,r+=16),0!=(t=x>>8)&&(x=t,r+=8),0!=(t=x>>4)&&(x=t,r+=4),0!=(t=x>>2)&&(x=t,r+=2),0!=(t=x>>1)&&(x=t,r+=1),r}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(n,r){var i;for(i=this.t-1;i>=0;--i)r[i+n]=this[i];for(i=n-1;i>=0;--i)r[i]=0;r.t=this.t+n,r.s=this.s}function bnpDRShiftTo(n,r){for(var i=n;i<this.t;++i)r[i-n]=this[i];r.t=Math.max(this.t-n,0),r.s=this.s}function bnpLShiftTo(n,r){var i,bs=n%this.DB,cbs=this.DB-bs,bm=(1<<cbs)-1,ds=Math.floor(n/this.DB),c=this.s<<bs&this.DM;for(i=this.t-1;i>=0;--i)r[i+ds+1]=this[i]>>cbs|c,c=(this[i]&bm)<<bs;for(i=ds-1;i>=0;--i)r[i]=0;r[ds]=c,r.t=this.t+ds+1,r.s=this.s,r.clamp()}function bnpRShiftTo(n,r){r.s=this.s;var ds=Math.floor(n/this.DB);if(ds>=this.t)return void(r.t=0);var bs=n%this.DB,cbs=this.DB-bs,bm=(1<<bs)-1;r[0]=this[ds]>>bs;for(var i=ds+1;i<this.t;++i)r[i-ds-1]|=(this[i]&bm)<<cbs,r[i-ds]=this[i]>>bs;bs>0&&(r[this.t-ds-1]|=(this.s&bm)<<cbs),r.t=this.t-ds,r.clamp()}function bnpSubTo(a,r){for(var i=0,c=0,m=Math.min(a.t,this.t);i<m;)c+=this[i]-a[i],r[i++]=c&this.DM,c>>=this.DB;if(a.t<this.t){for(c-=a.s;i<this.t;)c+=this[i],r[i++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;i<a.t;)c-=a[i],r[i++]=c&this.DM,c>>=this.DB;c-=a.s}r.s=c<0?-1:0,c<-1?r[i++]=this.DV+c:c>0&&(r[i++]=c),r.t=i,r.clamp()}function bnpMultiplyTo(a,r){var x=this.abs(),y=a.abs(),i=x.t;for(r.t=i+y.t;--i>=0;)r[i]=0;for(i=0;i<y.t;++i)r[i+x.t]=x.am(0,y[i],r,i,0,x.t);r.s=0,r.clamp(),this.s!=a.s&&BigInteger.ZERO.subTo(r,r)}function bnpSquareTo(r){for(var x=this.abs(),i=r.t=2*x.t;--i>=0;)r[i]=0;for(i=0;i<x.t-1;++i){var c=x.am(i,x[i],r,2*i,0,1);(r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1))>=x.DV&&(r[i+x.t]-=x.DV,r[i+x.t+1]=1)}r.t>0&&(r[r.t-1]+=x.am(i,x[i],r,2*i,0,1)),r.s=0,r.clamp()}function bnpDivRemTo(m,q,r){var pm=m.abs();if(!(pm.t<=0)){var pt=this.abs();if(pt.t<pm.t)return null!=q&&q.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=nbi());var y=nbi(),ts=this.s,ms=m.s,nsh=this.DB-nbits(pm[pm.t-1]);nsh>0?(pm.lShiftTo(nsh,y),pt.lShiftTo(nsh,r)):(pm.copyTo(y),pt.copyTo(r));var ys=y.t,y0=y[ys-1];if(0!=y0){var yt=y0*(1<<this.F1)+(ys>1?y[ys-2]>>this.F2:0),d1=this.FV/yt,d2=(1<<this.F1)/yt,e=1<<this.F2,i=r.t,j=i-ys,t=null==q?nbi():q;for(y.dlShiftTo(j,t),r.compareTo(t)>=0&&(r[r.t++]=1,r.subTo(t,r)),BigInteger.ONE.dlShiftTo(ys,t),t.subTo(y,y);y.t<ys;)y[y.t++]=0;for(;--j>=0;){var qd=r[--i]==y0?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);if((r[i]+=y.am(0,qd,r,j,0,ys))<qd)for(y.dlShiftTo(j,t),r.subTo(t,r);r[i]<--qd;)r.subTo(t,r)}null!=q&&(r.drShiftTo(ys,q),ts!=ms&&BigInteger.ZERO.subTo(q,q)),r.t=ys,r.clamp(),nsh>0&&r.rShiftTo(nsh,r),ts<0&&BigInteger.ZERO.subTo(r,r)}}}function bnMod(a){var r=nbi();return this.abs().divRemTo(a,null,r),this.s<0&&r.compareTo(BigInteger.ZERO)>0&&a.subTo(r,r),r}function Classic(m){this.m=m}function cConvert(x){return x.s<0||x.compareTo(this.m)>=0?x.mod(this.m):x}function cRevert(x){return x}function cReduce(x){x.divRemTo(this.m,null,x)}function cMulTo(x,y,r){x.multiplyTo(y,r),this.reduce(r)}function cSqrTo(x,r){x.squareTo(r),this.reduce(r)}function bnpInvDigit(){if(this.t<1)return 0;var x=this[0];if(0==(1&x))return 0;var y=3&x;return y=y*(2-(15&x)*y)&15,y=y*(2-(255&x)*y)&255,y=y*(2-((65535&x)*y&65535))&65535,y=y*(2-x*y%this.DV)%this.DV,y>0?this.DV-y:-y}function Montgomery(m){this.m=m,this.mp=m.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<m.DB-15)-1,this.mt2=2*m.t}function montConvert(x){var r=nbi();return x.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),x.s<0&&r.compareTo(BigInteger.ZERO)>0&&this.m.subTo(r,r),r}function montRevert(x){var r=nbi();return x.copyTo(r),this.reduce(r),r}function montReduce(x){for(;x.t<=this.mt2;)x[x.t++]=0;for(var i=0;i<this.m.t;++i){var j=32767&x[i],u0=j*this.mpl+((j*this.mph+(x[i]>>15)*this.mpl&this.um)<<15)&x.DM;for(j=i+this.m.t,x[j]+=this.m.am(0,u0,x,i,0,this.m.t);x[j]>=x.DV;)x[j]-=x.DV,x[++j]++}x.clamp(),x.drShiftTo(this.m.t,x),x.compareTo(this.m)>=0&&x.subTo(this.m,x)}function montSqrTo(x,r){x.squareTo(r),this.reduce(r)}function montMulTo(x,y,r){x.multiplyTo(y,r),this.reduce(r)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(e,z){if(e>4294967295||e<1)return BigInteger.ONE;var r=nbi(),r2=nbi(),g=z.convert(this),i=nbits(e)-1;for(g.copyTo(r);--i>=0;)if(z.sqrTo(r,r2),(e&1<<i)>0)z.mulTo(r2,g,r);else{var t=r;r=r2,r2=t}return z.revert(r)}function bnModPowInt(e,m){var z;return z=e<256||m.isEven()?new Classic(m):new Montgomery(m),this.exp(e,z)}function bnClone(){var r=nbi();return this.copyTo(r),r}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(b){if(null==b&&(b=10),0==this.signum()||b<2||b>36)return"0";var cs=this.chunkSize(b),a=Math.pow(b,cs),d=nbv(a),y=nbi(),z=nbi(),r="";for(this.divRemTo(d,y,z);y.signum()>0;)r=(a+z.intValue()).toString(b).substr(1)+r,y.divRemTo(d,y,z);return z.intValue().toString(b)+r}function bnpFromRadix(s,b){this.fromInt(0),null==b&&(b=10);for(var cs=this.chunkSize(b),d=Math.pow(b,cs),mi=!1,j=0,w=0,i=0;i<s.length;++i){var x=intAt(s,i);x<0?"-"==s.charAt(i)&&0==this.signum()&&(mi=!0):(w=b*w+x,++j>=cs&&(this.dMultiply(d),this.dAddOffset(w,0),j=0,w=0))}j>0&&(this.dMultiply(Math.pow(b,j)),this.dAddOffset(w,0)),mi&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var x=new Array,t=7&a;x.length=1+(a>>3),b.nextBytes(x),t>0?x[0]&=(1<<t)-1:x[0]=0,this.fromString(x,256)}}function bnToByteArray(){var i=this.t,r=new Array;r[0]=this.s;var d,p=this.DB-i*this.DB%8,k=0;if(i-- >0)for(p<this.DB&&(d=this[i]>>p)!=(this.s&this.DM)>>p&&(r[k++]=d|this.s<<this.DB-p);i>=0;)p<8?(d=(this[i]&(1<<p)-1)<<8-p,d|=this[--i]>>(p+=this.DB-8)):(d=this[i]>>(p-=8)&255,p<=0&&(p+=this.DB,--i)),0!=(128&d)&&(d|=-256),0==k&&(128&this.s)!=(128&d)&&++k,(k>0||d!=this.s)&&(r[k++]=d);return r}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,op,r){var i,f,m=Math.min(a.t,this.t);for(i=0;i<m;++i)r[i]=op(this[i],a[i]);if(a.t<this.t){for(f=a.s&this.DM,i=m;i<this.t;++i)r[i]=op(this[i],f);r.t=this.t}else{for(f=this.s&this.DM,i=m;i<a.t;++i)r[i]=op(f,a[i]);r.t=a.t}r.s=op(this.s,a.s),r.clamp()}function op_and(x,y){return x&y}function bnAnd(a){var r=nbi();return this.bitwiseTo(a,op_and,r),r}function op_or(x,y){return x|y}function bnOr(a){var r=nbi();return this.bitwiseTo(a,op_or,r),r}function op_xor(x,y){return x^y}function bnXor(a){var r=nbi();return this.bitwiseTo(a,op_xor,r),r}function op_andnot(x,y){return x&~y}function bnAndNot(a){var r=nbi();return this.bitwiseTo(a,op_andnot,r),r}function bnNot(){for(var r=nbi(),i=0;i<this.t;++i)r[i]=this.DM&~this[i];return r.t=this.t,r.s=~this.s,r}function bnShiftLeft(n){var r=nbi();return n<0?this.rShiftTo(-n,r):this.lShiftTo(n,r),r}function bnShiftRight(n){var r=nbi();return n<0?this.lShiftTo(-n,r):this.rShiftTo(n,r),r}function lbit(x){if(0==x)return-1;var r=0;return 0==(65535&x)&&(x>>=16,r+=16),0==(255&x)&&(x>>=8,r+=8),0==(15&x)&&(x>>=4,r+=4),0==(3&x)&&(x>>=2,r+=2),0==(1&x)&&++r,r}function bnGetLowestSetBit(){for(var i=0;i<this.t;++i)if(0!=this[i])return i*this.DB+lbit(this[i]);return this.s<0?this.t*this.DB:-1}function cbit(x){for(var r=0;0!=x;)x&=x-1,++r;return r}function bnBitCount(){for(var r=0,x=this.s&this.DM,i=0;i<this.t;++i)r+=cbit(this[i]^x);return r}function bnTestBit(n){var j=Math.floor(n/this.DB);return j>=this.t?0!=this.s:0!=(this[j]&1<<n%this.DB)}function bnpChangeBit(n,op){var r=BigInteger.ONE.shiftLeft(n);return this.bitwiseTo(r,op,r),r}function bnSetBit(n){return this.changeBit(n,op_or)}function bnClearBit(n){return this.changeBit(n,op_andnot)}function bnFlipBit(n){return this.changeBit(n,op_xor)}function bnpAddTo(a,r){for(var i=0,c=0,m=Math.min(a.t,this.t);i<m;)c+=this[i]+a[i],r[i++]=c&this.DM,c>>=this.DB;if(a.t<this.t){for(c+=a.s;i<this.t;)c+=this[i],r[i++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;i<a.t;)c+=a[i],r[i++]=c&this.DM,c>>=this.DB;c+=a.s}r.s=c<0?-1:0,c>0?r[i++]=c:c<-1&&(r[i++]=this.DV+c),r.t=i,r.clamp()}function bnAdd(a){var r=nbi();return this.addTo(a,r),r}function bnSubtract(a){var r=nbi();return this.subTo(a,r),r}function bnMultiply(a){var r=nbi();return this.multiplyTo(a,r),r}function bnSquare(){var r=nbi();return this.squareTo(r),r}function bnDivide(a){var r=nbi();return this.divRemTo(a,r,null),r}function bnRemainder(a){var r=nbi();return this.divRemTo(a,null,r),r}function bnDivideAndRemainder(a){var q=nbi(),r=nbi();return this.divRemTo(a,q,r),new Array(q,r)}function bnpDMultiply(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(n,w){if(0!=n){for(;this.t<=w;)this[this.t++]=0;for(this[w]+=n;this[w]>=this.DV;)this[w]-=this.DV,++w>=this.t&&(this[this.t++]=0),++this[w]}}function NullExp(){}function nNop(x){return x}function nMulTo(x,y,r){x.multiplyTo(y,r)}function nSqrTo(x,r){x.squareTo(r)}function bnPow(e){return this.exp(e,new NullExp)}function bnpMultiplyLowerTo(a,n,r){var i=Math.min(this.t+a.t,n);for(r.s=0,r.t=i;i>0;)r[--i]=0;var j;for(j=r.t-this.t;i<j;++i)r[i+this.t]=this.am(0,a[i],r,i,0,this.t);for(j=Math.min(a.t,n);i<j;++i)this.am(0,a[i],r,i,0,n-i);r.clamp()}function bnpMultiplyUpperTo(a,n,r){--n;var i=r.t=this.t+a.t-n;for(r.s=0;--i>=0;)r[i]=0;for(i=Math.max(n-this.t,0);i<a.t;++i)r[this.t+i-n]=this.am(n-i,a[i],r,0,0,this.t+i-n);r.clamp(),r.drShiftTo(1,r)}function Barrett(m){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*m.t,this.r2),this.mu=this.r2.divide(m),this.m=m}function barrettConvert(x){if(x.s<0||x.t>2*this.m.t)return x.mod(this.m);if(x.compareTo(this.m)<0)return x;var r=nbi();return x.copyTo(r),this.reduce(r),r}function barrettRevert(x){return x}function barrettReduce(x){for(x.drShiftTo(this.m.t-1,this.r2),x.t>this.m.t+1&&(x.t=this.m.t+1,x.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);x.compareTo(this.r2)<0;)x.dAddOffset(1,this.m.t+1);for(x.subTo(this.r2,x);x.compareTo(this.m)>=0;)x.subTo(this.m,x)}function barrettSqrTo(x,r){x.squareTo(r),this.reduce(r)}function barrettMulTo(x,y,r){x.multiplyTo(y,r),this.reduce(r)}function bnModPow(e,m){var k,z,i=e.bitLength(),r=nbv(1);if(i<=0)return r;k=i<18?1:i<48?3:i<144?4:i<768?5:6,z=i<8?new Classic(m):m.isEven()?new Barrett(m):new Montgomery(m);var g=new Array,n=3,k1=k-1,km=(1<<k)-1;if(g[1]=z.convert(this),k>1){var g2=nbi();for(z.sqrTo(g[1],g2);n<=km;)g[n]=nbi(),z.mulTo(g2,g[n-2],g[n]),n+=2}var w,t,j=e.t-1,is1=!0,r2=nbi();for(i=nbits(e[j])-1;j>=0;){for(i>=k1?w=e[j]>>i-k1&km:(w=(e[j]&(1<<i+1)-1)<<k1-i,j>0&&(w|=e[j-1]>>this.DB+i-k1)),n=k;0==(1&w);)w>>=1,--n;if((i-=n)<0&&(i+=this.DB,--j),is1)g[w].copyTo(r),is1=!1;else{for(;n>1;)z.sqrTo(r,r2),z.sqrTo(r2,r),n-=2;n>0?z.sqrTo(r,r2):(t=r,r=r2,r2=t),z.mulTo(r2,g[w],r)}for(;j>=0&&0==(e[j]&1<<i);)z.sqrTo(r,r2),t=r,r=r2,r2=t,--i<0&&(i=this.DB-1,--j)}return z.revert(r)}function bnGCD(a){var x=this.s<0?this.negate():this.clone(),y=a.s<0?a.negate():a.clone();if(x.compareTo(y)<0){var t=x;x=y,y=t}var i=x.getLowestSetBit(),g=y.getLowestSetBit();if(g<0)return x;for(i<g&&(g=i),g>0&&(x.rShiftTo(g,x),y.rShiftTo(g,y));x.signum()>0;)(i=x.getLowestSetBit())>0&&x.rShiftTo(i,x),(i=y.getLowestSetBit())>0&&y.rShiftTo(i,y),x.compareTo(y)>=0?(x.subTo(y,x),x.rShiftTo(1,x)):(y.subTo(x,y),y.rShiftTo(1,y));return g>0&&y.lShiftTo(g,y),y}function bnpModInt(n){if(n<=0)return 0;var d=this.DV%n,r=this.s<0?n-1:0;if(this.t>0)if(0==d)r=this[0]%n;else for(var i=this.t-1;i>=0;--i)r=(d*r+this[i])%n;return r}function bnModInverse(m){var ac=m.isEven();if(this.isEven()&&ac||0==m.signum())return BigInteger.ZERO;for(var u=m.clone(),v=this.clone(),a=nbv(1),b=nbv(0),c=nbv(0),d=nbv(1);0!=u.signum();){for(;u.isEven();)u.rShiftTo(1,u),ac?(a.isEven()&&b.isEven()||(a.addTo(this,a),b.subTo(m,b)),a.rShiftTo(1,a)):b.isEven()||b.subTo(m,b),b.rShiftTo(1,b);for(;v.isEven();)v.rShiftTo(1,v),ac?(c.isEven()&&d.isEven()||(c.addTo(this,c),d.subTo(m,d)),c.rShiftTo(1,c)):d.isEven()||d.subTo(m,d),d.rShiftTo(1,d);u.compareTo(v)>=0?(u.subTo(v,u),ac&&a.subTo(c,a),b.subTo(d,b)):(v.subTo(u,v),ac&&c.subTo(a,c),d.subTo(b,d))}return 0!=v.compareTo(BigInteger.ONE)?BigInteger.ZERO:d.compareTo(m)>=0?d.subtract(m):d.signum()<0?(d.addTo(m,d),d.signum()<0?d.add(m):d):d}function bnIsProbablePrime(t){var i,x=this.abs();if(1==x.t&&x[0]<=lowprimes[lowprimes.length-1]){for(i=0;i<lowprimes.length;++i)if(x[0]==lowprimes[i])return!0;return!1}if(x.isEven())return!1;for(i=1;i<lowprimes.length;){for(var m=lowprimes[i],j=i+1;j<lowprimes.length&&m<lplim;)m*=lowprimes[j++];for(m=x.modInt(m);i<j;)if(m%lowprimes[i++]==0)return!1}return x.millerRabin(t)}function bnpMillerRabin(t){var n1=this.subtract(BigInteger.ONE),k=n1.getLowestSetBit();if(k<=0)return!1;var r=n1.shiftRight(k);(t=t+1>>1)>lowprimes.length&&(t=lowprimes.length);for(var a=nbi(),i=0;i<t;++i){a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var y=a.modPow(r,this);if(0!=y.compareTo(BigInteger.ONE)&&0!=y.compareTo(n1)){for(var j=1;j++<k&&0!=y.compareTo(n1);)if(y=y.modPowInt(2,this),0==y.compareTo(BigInteger.ONE))return!1;if(0!=y.compareTo(n1))return!1}}return!0}function rng_seed_int(x){rng_pool[rng_pptr++]^=255&x,rng_pool[rng_pptr++]^=x>>8&255,rng_pool[rng_pptr++]^=x>>16&255,rng_pool[rng_pptr++]^=x>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(ba){var i;for(i=0;i<ba.length;++i)ba[i]=rng_get_byte()}function SecureRandom(){}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(key){var i,j,t;for(i=0;i<256;++i)this.S[i]=i;for(j=0,i=0;i<256;++i)j=j+this.S[i]+key[i%key.length]&255,t=this.S[i],this.S[i]=this.S[j],this.S[j]=t;this.i=0,this.j=0}function ARC4next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary),inBrowser="undefined"!=typeof navigator;inBrowser&&j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):inBrowser&&j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var rr,vv,BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array;for(rr="0".charCodeAt(0),vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,BigInteger.prototype.Barrett=Barrett;var rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if(void 0!==window&&window.crypto)if(window.crypto.getRandomValues){var ua=new Uint8Array(32);for(window.crypto.getRandomValues(ua),t=0;t<32;++t)rng_pool[rng_pptr++]=ua[t]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z.charCodeAt(t)}for(;rng_pptr<rng_psize;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256;BigInteger.SecureRandom=SecureRandom,BigInteger.BigInteger=BigInteger,void 0!==exports?exports=module.exports=BigInteger:(this.BigInteger=BigInteger,this.SecureRandom=SecureRandom)}).call(this)},{}],225:[function(require,module,exports){!function(root,factory){"function"==typeof define&&define.amd?define([],function(){return factory()}):"object"===(void 0===module?"undefined":_typeof(module))&&module.exports?module.exports=factory():root.jsonSchema=factory()}(this,function(){function validate(instance,schema){return validate(instance,schema,{changing:!1})}var exports=validate;exports.Integer={type:"integer"};var primitiveConstructors={String:String,Boolean:Boolean,Number:Number,Object:Object,Array:Array,Date:Date};exports.validate=validate,exports.checkPropertyChange=function(value,schema,property){return validate(value,schema,{changing:property||"property"})};var validate=exports._validate=function(instance,schema,options){function getType(schema){return schema.type||primitiveConstructors[schema.name]==schema&&schema.name.toLowerCase()}function checkProp(value,schema,path,i){function addError(message){errors.push({property:path,message:message})}function checkType(type,value){if(type){if(!("string"!=typeof type||"any"==type||("null"==type?null===value:(void 0===value?"undefined":_typeof(value))==type)||value instanceof Array&&"array"==type||value instanceof Date&&"date"==type||"integer"==type&&value%1==0))return[{property:path,message:(void 0===value?"undefined":_typeof(value))+" value found, but a "+type+" is required"}];if(type instanceof Array){for(var unionErrors=[],j=0;j<type.length&&(unionErrors=checkType(type[j],value)).length;j++);if(unionErrors.length)return unionErrors}else if("object"==(void 0===type?"undefined":_typeof(type))){var priorErrors=errors;errors=[],checkProp(value,type,path);var theseErrors=errors;return errors=priorErrors,theseErrors}}return[]}var l;if(path+=path?"number"==typeof i?"["+i+"]":void 0===i?"":"."+i:i,("object"!=(void 0===schema?"undefined":_typeof(schema))||schema instanceof Array)&&(path||"function"!=typeof schema)&&(!schema||!getType(schema)))return"function"==typeof schema?value instanceof schema||addError("is not an instance of the class/constructor "+schema.name):schema&&addError("Invalid schema/property definition "+schema),null;if(_changing&&schema.readonly&&addError("is a readonly field, it can not be changed"),schema.extends&&checkProp(value,schema.extends,path,i),void 0===value)schema.required&&addError("is missing and it is required");else if(errors=errors.concat(checkType(getType(schema),value)),schema.disallow&&!checkType(schema.disallow,value).length&&addError(" disallowed value was matched"),null!==value){if(value instanceof Array){if(schema.items){var itemsIsArray=schema.items instanceof Array,propDef=schema.items;for(i=0,l=value.length;i<l;i+=1)itemsIsArray&&(propDef=schema.items[i]),options.coerce&&(value[i]=options.coerce(value[i],propDef)),errors.concat(checkProp(value[i],propDef,path,i))}schema.minItems&&value.length<schema.minItems&&addError("There must be a minimum of "+schema.minItems+" in the array"),schema.maxItems&&value.length>schema.maxItems&&addError("There must be a maximum of "+schema.maxItems+" in the array")}else(schema.properties||schema.additionalProperties)&&errors.concat(checkObj(value,schema.properties,path,schema.additionalProperties));if(schema.pattern&&"string"==typeof value&&!value.match(schema.pattern)&&addError("does not match the regex pattern "+schema.pattern),schema.maxLength&&"string"==typeof value&&value.length>schema.maxLength&&addError("may only be "+schema.maxLength+" characters long"),schema.minLength&&"string"==typeof value&&value.length<schema.minLength&&addError("must be at least "+schema.minLength+" characters long"),void 0!==_typeof(schema.minimum)&&(void 0===value?"undefined":_typeof(value))==_typeof(schema.minimum)&&schema.minimum>value&&addError("must have a minimum value of "+schema.minimum),void 0!==_typeof(schema.maximum)&&(void 0===value?"undefined":_typeof(value))==_typeof(schema.maximum)&&schema.maximum<value&&addError("must have a maximum value of "+schema.maximum),schema.enum){var enumer=schema.enum;l=enumer.length;for(var found,j=0;j<l;j++)if(enumer[j]===value){found=1;break}found||addError("does not have a value in the enumeration "+enumer.join(", "))}"number"==typeof schema.maxDecimal&&value.toString().match(new RegExp("\\.[0-9]{"+(schema.maxDecimal+1)+",}"))&&addError("may only have "+schema.maxDecimal+" digits of decimal places")}return null}function checkObj(instance,objTypeDef,path,additionalProp){if("object"==(void 0===objTypeDef?"undefined":_typeof(objTypeDef))){("object"!=(void 0===instance?"undefined":_typeof(instance))||instance instanceof Array)&&errors.push({property:path,message:"an object is required"});for(var i in objTypeDef)if(objTypeDef.hasOwnProperty(i)){var value=instance[i];if(void 0===value&&options.existingOnly)continue;var propDef=objTypeDef[i];void 0===value&&propDef.default&&(value=instance[i]=propDef.default),options.coerce&&i in instance&&(value=instance[i]=options.coerce(value,propDef)),checkProp(value,propDef,path,i)}}for(i in instance){if(instance.hasOwnProperty(i)&&("_"!=i.charAt(0)||"_"!=i.charAt(1))&&objTypeDef&&!objTypeDef[i]&&!1===additionalProp){if(options.filter){delete instance[i];continue}errors.push({property:path,message:(void 0===value?"undefined":_typeof(value))+"The property "+i+" is not defined in the schema and the schema does not allow additional properties"})}var requires=objTypeDef&&objTypeDef[i]&&objTypeDef[i].requires;!requires||requires in instance||errors.push({property:path,message:"the presence of the property "+i+" requires that "+requires+" also be present"}),value=instance[i],!additionalProp||objTypeDef&&"object"==(void 0===objTypeDef?"undefined":_typeof(objTypeDef))&&i in objTypeDef||(options.coerce&&(value=instance[i]=options.coerce(value,additionalProp)),checkProp(value,additionalProp,path,i)),!_changing&&value&&value.$schema&&(errors=errors.concat(checkProp(value,value.$schema,path,i)))}return errors}options||(options={});var _changing=options.changing,errors=[];return schema&&checkProp(instance,schema,"",_changing||""),!_changing&&instance&&instance.$schema&&checkProp(instance,instance.$schema,"",""),{valid:!errors.length,errors:errors}};return exports.mustBeValid=function(result){if(!result.valid)throw new TypeError(result.errors.map(function(error){return"for property "+error.property+": "+error.message}).join(", \n"))},exports})},{}],226:[function(require,module,exports){var json="undefined"!=typeof JSON?JSON:require("jsonify");module.exports=function(obj,opts){opts||(opts={}),"function"==typeof opts&&(opts={cmp:opts});var space=opts.space||"";"number"==typeof space&&(space=Array(space+1).join(" "));var cycles="boolean"==typeof opts.cycles&&opts.cycles,replacer=opts.replacer||function(key,value){return value},cmp=opts.cmp&&function(f){return function(node){return function(a,b){var aobj={key:a,value:node[a]},bobj={key:b,value:node[b]};return f(aobj,bobj)}}}(opts.cmp),seen=[];return function stringify(parent,key,node,level){var indent=space?"\n"+new Array(level+1).join(space):"",colonSeparator=space?": ":":";if(node&&node.toJSON&&"function"==typeof node.toJSON&&(node=node.toJSON()),void 0!==(node=replacer.call(parent,key,node))){if("object"!==(void 0===node?"undefined":_typeof(node))||null===node)return json.stringify(node);if(isArray(node)){for(var out=[],i=0;i<node.length;i++){var item=stringify(node,i,node[i],level+1)||json.stringify(null);out.push(indent+space+item)}return"["+out.join(",")+indent+"]"}if(-1!==seen.indexOf(node)){if(cycles)return json.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}seen.push(node);for(var keys=objectKeys(node).sort(cmp&&cmp(node)),out=[],i=0;i<keys.length;i++){var key=keys[i],value=stringify(node,key,node[key],level+1);if(value){var keyValue=json.stringify(key)+colonSeparator+value;out.push(indent+space+keyValue)}}return seen.splice(seen.indexOf(node),1),"{"+out.join(",")+indent+"}"}}({"":obj},"",obj,0)};var isArray=Array.isArray||function(x){return"[object Array]"==={}.toString.call(x)},objectKeys=Object.keys||function(obj){var has=Object.prototype.hasOwnProperty||function(){return!0},keys=[];for(var key in obj)has.call(obj,key)&&keys.push(key);return keys}},{jsonify:228}],227:[function(require,module,exports){function stringify(obj,replacer,spaces,cycleReplacer){return JSON.stringify(obj,serializer(replacer,cycleReplacer),spaces)}function serializer(replacer,cycleReplacer){var stack=[],keys=[];return null==cycleReplacer&&(cycleReplacer=function(key,value){return stack[0]===value?"[Circular ~]":"[Circular ~."+keys.slice(0,stack.indexOf(value)).join(".")+"]"}),function(key,value){if(stack.length>0){var thisPos=stack.indexOf(this);~thisPos?stack.splice(thisPos+1):stack.push(this),~thisPos?keys.splice(thisPos,1/0,key):keys.push(key),~stack.indexOf(value)&&(value=cycleReplacer.call(this,key,value))}else stack.push(value);return null==replacer?value:replacer.call(this,key,value)}}exports=module.exports=stringify,exports.getSerialize=serializer},{}],228:[function(require,module,exports){exports.parse=require("./lib/parse"),exports.stringify=require("./lib/stringify")},{"./lib/parse":229,"./lib/stringify":230}],229:[function(require,module,exports){var at,ch,text,value,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected '"+c+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&ch<="9";)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&ch<="9";)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),"-"!==ch&&"+"!==ch||(string+=ch,next());ch>="0"&&ch<="9";)string+=ch,next();if(number=+string,isFinite(number))return number;error("Bad number")},string=function(){var hex,i,uffff,string="";if('"'===ch)for(;next();){if('"'===ch)return next(),string;if("\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;i<4&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&ch<=" ";)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected '"+ch+"'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error('Duplicate key "'+key+'"'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};value=function(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}},module.exports=function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"===(void 0===value?"undefined":_typeof(value)))for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}},{}],230:[function(require,module,exports){function quote(string){return escapable.lastIndex=0,escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return"string"==typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,partial,mind=gap,value=holder[key];switch(value&&"object"===(void 0===value?"undefined":_typeof(value))&&"function"==typeof value.toJSON&&(value=value.toJSON(key)),"function"==typeof rep&&(value=rep.call(holder,key,value)),void 0===value?"undefined":_typeof(value)){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],"[object Array]"===Object.prototype.toString.apply(value)){for(length=value.length,i=0;i<length;i+=1)partial[i]=str(i,value)||"null";return v=0===partial.length?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&"object"===(void 0===rep?"undefined":_typeof(rep)))for(length=rep.length,i=0;i<length;i+=1)"string"==typeof(k=rep[i])&&(v=str(k,value))&&partial.push(quote(k)+(gap?": ":":")+v);else for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=str(k,value))&&partial.push(quote(k)+(gap?": ":":")+v);return v=0===partial.length?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}",gap=mind,v}}var gap,indent,rep,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};module.exports=function(value,replacer,space){var i;if(gap="",indent="","number"==typeof space)for(i=0;i<space;i+=1)indent+=" ";else"string"==typeof space&&(indent=space);if(rep=replacer,replacer&&"function"!=typeof replacer&&("object"!==(void 0===replacer?"undefined":_typeof(replacer))||"number"!=typeof replacer.length))throw new Error("JSON.stringify");return str("",{"":value})}},{}],231:[function(require,module,exports){function deepCopy(obj){var ret,key,marker="__deepCopy";if(obj&&obj[marker])throw new Error("attempted deep copy of cyclic object");if(obj&&obj.constructor==Object){ret={},obj[marker]=!0;for(key in obj)key!=marker&&(ret[key]=deepCopy(obj[key]));return delete obj[marker],ret}if(obj&&obj.constructor==Array){for(ret=[],obj[marker]=!0,key=0;key<obj.length;key++)ret.push(deepCopy(obj[key]));return delete obj[marker],ret}return obj}function deepEqual(obj1,obj2){if((void 0===obj1?"undefined":_typeof(obj1))!=(void 0===obj2?"undefined":_typeof(obj2)))return!1;if(null===obj1||null===obj2||"object"!=(void 0===obj1?"undefined":_typeof(obj1)))return obj1===obj2;if(obj1.constructor!=obj2.constructor)return!1;var k;for(k in obj1){if(!obj2.hasOwnProperty(k))return!1;if(!deepEqual(obj1[k],obj2[k]))return!1}for(k in obj2)if(!obj1.hasOwnProperty(k))return!1;return!0}function isEmpty(obj){var key;for(key in obj)return!1;return!0}function hasKey(obj,key){return mod_assert.equal(void 0===key?"undefined":_typeof(key),"string"),Object.prototype.hasOwnProperty.call(obj,key)}function forEachKey(obj,callback){for(var key in obj)hasKey(obj,key)&&callback(key,obj[key])}function pluck(obj,key){return mod_assert.equal(void 0===key?"undefined":_typeof(key),"string"),pluckv(obj,key)}function pluckv(obj,key){if(null!==obj&&"object"===(void 0===obj?"undefined":_typeof(obj))){if(obj.hasOwnProperty(key))return obj[key];var i=key.indexOf(".");if(-1!=i){var key1=key.substr(0,i);if(obj.hasOwnProperty(key1))return pluckv(obj[key1],key.substr(i+1))}}}function flattenIter(data,depth,callback){doFlattenIter(data,depth,[],callback)}function doFlattenIter(data,depth,accum,callback){var each,key;if(0===depth)return each=accum.slice(0),each.push(data),void callback(each);mod_assert.ok(null!==data),mod_assert.equal(void 0===data?"undefined":_typeof(data),"object"),mod_assert.equal(void 0===depth?"undefined":_typeof(depth),"number"),mod_assert.ok(depth>=0);for(key in data)each=accum.slice(0),each.push(key),doFlattenIter(data[key],depth-1,each,callback)}function flattenObject(data,depth){if(0===depth)return[data];mod_assert.ok(null!==data),mod_assert.equal(void 0===data?"undefined":_typeof(data),"object"),mod_assert.equal(void 0===depth?"undefined":_typeof(depth),"number"),mod_assert.ok(depth>=0);var key,rv=[];for(key in data)flattenObject(data[key],depth-1).forEach(function(p){rv.push([key].concat(p))});return rv}function startsWith(str,prefix){return str.substr(0,prefix.length)==prefix}function endsWith(str,suffix){return str.substr(str.length-suffix.length,suffix.length)==suffix}function iso8601(d){return"number"==typeof d&&(d=new Date(d)),mod_assert.ok(d.constructor===Date),mod_extsprintf.sprintf("%4d-%02d-%02dT%02d:%02d:%02d.%03dZ",d.getUTCFullYear(),d.getUTCMonth()+1,d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds())}function rfc1123(date){return mod_extsprintf.sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",RFC1123_DAYS[date.getUTCDay()],date.getUTCDate(),RFC1123_MONTHS[date.getUTCMonth()],date.getUTCFullYear(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds())}function parseDateTime(str){var numeric=+str;return isNaN(numeric)?new Date(str):new Date(numeric)}function parseInteger(str,uopts){mod_assert.string(str,"str"),mod_assert.optionalObject(uopts,"options");var baseOverride=!1,options=PI_DEFAULTS;uopts&&(baseOverride=hasKey(uopts,"base"),options=mergeObjects(options,uopts),mod_assert.number(options.base,"options.base"),mod_assert.ok(options.base>=2,"options.base >= 2"),mod_assert.ok(options.base<=36,"options.base <= 36"),mod_assert.bool(options.allowSign,"options.allowSign"),mod_assert.bool(options.allowPrefix,"options.allowPrefix"),mod_assert.bool(options.allowTrailing,"options.allowTrailing"),mod_assert.bool(options.allowImprecise,"options.allowImprecise"),mod_assert.bool(options.trimWhitespace,"options.trimWhitespace"),mod_assert.bool(options.leadingZeroIsOctal,"options.leadingZeroIsOctal"),options.leadingZeroIsOctal&&mod_assert.ok(!baseOverride,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var c,start,pbase=-1,base=options.base,mult=1,value=0,idx=0,len=str.length;if(options.trimWhitespace)for(;idx<len&&isSpace(str.charCodeAt(idx));)++idx;for(options.allowSign&&("-"===str[idx]?(idx+=1,mult=-1):"+"===str[idx]&&(idx+=1)),"0"===str[idx]&&(options.allowPrefix&&(-1===(pbase=prefixToBase(str.charCodeAt(idx+1)))||baseOverride&&pbase!==base||(base=pbase,idx+=2)),-1===pbase&&options.leadingZeroIsOctal&&(base=8)),start=idx;idx<len&&(-1!==(c=translateDigit(str.charCodeAt(idx)))&&c<base);++idx)value*=base,value+=c;if(start===idx)return new Error("invalid number: "+JSON.stringify(str));if(options.trimWhitespace)for(;idx<len&&isSpace(str.charCodeAt(idx));)++idx;if(idx<len&&!options.allowTrailing)return new Error("trailing characters after number: "+JSON.stringify(str.slice(idx)));if(0===value)return 0;var result=value*mult;return!options.allowImprecise&&(value>MAX_SAFE_INTEGER||result<MIN_SAFE_INTEGER)?new Error("number is outside of the supported range: "+JSON.stringify(str.slice(start,idx))):result}function translateDigit(d){return d>=CP_0&&d<=CP_9?d-PI_CONV_DEC:d>=CP_A&&d<=CP_Z?d-PI_CONV_UC:d>=CP_a&&d<=CP_z?d-PI_CONV_LC:-1}function isSpace(c){return 32===c||c>=9&&c<=13||160===c||5760===c||6158===c||c>=8192&&c<=8202||8232===c||8233===c||8239===c||8287===c||12288===c||65279===c}function prefixToBase(c){return c===CP_b||c===CP_B?2:c===CP_o||c===CP_O?8:c===CP_t||c===CP_T?10:c===CP_x||c===CP_X?16:-1}function validateJsonObjectJS(schema,input){var report=mod_jsonschema.validate(input,schema);if(0===report.errors.length)return null;var i,j,error=report.errors[0],propname=error.property,reason=error.message.toLowerCase();-1!=(i=reason.indexOf("the property "))&&-1!=(j=reason.indexOf(" is not defined in the schema and the schema does not allow additional properties"))&&(i+="the property ".length,propname=""===propname?reason.substr(i,j-i):propname+"."+reason.substr(i,j-i),reason="unsupported property");var rv=new mod_verror.VError('property "%s": %s',propname,reason);return rv.jsv_details=error,rv}function randElt(arr){return mod_assert.ok(Array.isArray(arr)&&arr.length>0,"randElt argument must be a non-empty array"),arr[Math.floor(Math.random()*arr.length)]}function assertHrtime(a){mod_assert.ok(a[0]>=0&&a[1]>=0,"negative numbers not allowed in hrtimes"),mod_assert.ok(a[1]<1e9,"nanoseconds column overflow")}function hrtimeDiff(a,b){assertHrtime(a),assertHrtime(b),mod_assert.ok(a[0]>b[0]||a[0]==b[0]&&a[1]>=b[1],"negative differences not allowed");var rv=[a[0]-b[0],0];return a[1]>=b[1]?rv[1]=a[1]-b[1]:(rv[0]--,rv[1]=1e9-(b[1]-a[1])),rv}function hrtimeNanosec(a){return assertHrtime(a),Math.floor(1e9*a[0]+a[1])}function hrtimeMicrosec(a){return assertHrtime(a),Math.floor(1e6*a[0]+a[1]/1e3)}function hrtimeMillisec(a){return assertHrtime(a),Math.floor(1e3*a[0]+a[1]/1e6)}function hrtimeAccum(a,b){return assertHrtime(a),assertHrtime(b),a[1]+=b[1],a[1]>=1e9&&(a[0]++,a[1]-=1e9),a[0]+=b[0],a}function hrtimeAdd(a,b){return assertHrtime(a),hrtimeAccum([a[0],a[1]],b)}function extraProperties(obj,allowed){mod_assert.ok("object"===(void 0===obj?"undefined":_typeof(obj))&&null!==obj,"obj argument must be a non-null object"),mod_assert.ok(Array.isArray(allowed),"allowed argument must be an array of strings");for(var i=0;i<allowed.length;i++)mod_assert.ok("string"==typeof allowed[i],"allowed argument must be an array of strings");return Object.keys(obj).filter(function(key){return-1===allowed.indexOf(key)})}function mergeObjects(provided,overrides,defaults){var rv,k;if(rv={},defaults)for(k in defaults)rv[k]=defaults[k];if(provided)for(k in provided)rv[k]=provided[k];if(overrides)for(k in overrides)rv[k]=overrides[k];return rv}var mod_assert=require("assert-plus"),mod_extsprintf=(require("util"),require("extsprintf")),mod_verror=require("verror"),mod_jsonschema=require("json-schema");exports.deepCopy=deepCopy,exports.deepEqual=deepEqual,exports.isEmpty=isEmpty,exports.hasKey=hasKey,exports.forEachKey=forEachKey,exports.pluck=pluck,exports.flattenObject=flattenObject,exports.flattenIter=flattenIter,exports.validateJsonObject=validateJsonObjectJS,exports.validateJsonObjectJS=validateJsonObjectJS,exports.randElt=randElt,exports.extraProperties=extraProperties,exports.mergeObjects=mergeObjects,exports.startsWith=startsWith,exports.endsWith=endsWith,exports.parseInteger=parseInteger,exports.iso8601=iso8601,exports.rfc1123=rfc1123,exports.parseDateTime=parseDateTime,exports.hrtimediff=hrtimeDiff,exports.hrtimeDiff=hrtimeDiff,exports.hrtimeAccum=hrtimeAccum,exports.hrtimeAdd=hrtimeAdd,exports.hrtimeNanosec=hrtimeNanosec,exports.hrtimeMicrosec=hrtimeMicrosec,exports.hrtimeMillisec=hrtimeMillisec;var RFC1123_MONTHS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],RFC1123_DAYS=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,MIN_SAFE_INTEGER=Number.MIN_SAFE_INTEGER||-9007199254740991,PI_DEFAULTS={base:10,allowSign:!0,allowPrefix:!1,allowTrailing:!1,allowImprecise:!1,trimWhitespace:!1,leadingZeroIsOctal:!1},CP_0=48,CP_9=57,CP_A=65,CP_B=66,CP_O=79,CP_T=84,CP_X=88,CP_Z=90,CP_a=97,CP_b=98,CP_o=111,CP_t=116,CP_x=120,CP_z=122,PI_CONV_DEC=48,PI_CONV_UC=55,PI_CONV_LC=87},{"assert-plus":232,extsprintf:165,"json-schema":225,util:400,verror:406}],232:[function(require,module,exports){(function(Buffer,process){function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}function _toss(name,expected,oper,arg,actual){throw new assert.AssertionError({message:util.format("%s (%s) is required",name,expected),actual:void 0===actual?void 0===arg?"undefined":_typeof(arg):actual(arg),expected:expected,operator:oper||"===",stackStartFunction:_toss.caller})}function _getClass(arg){return Object.prototype.toString.call(arg).slice(8,-1)}function noop(){}function _setExports(ndebug){var out,keys=Object.keys(types);return out=process.env.NODE_NDEBUG?noop:function(arg,msg){arg||_toss(msg,"true",arg)},keys.forEach(function(k){if(ndebug)return void(out[k]=noop);var type=types[k];out[k]=function(arg,msg){type.check(arg)||_toss(msg,k,type.operator,arg,type.actual)}}),keys.forEach(function(k){var name="optional"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k];out[name]=function(arg,msg){void 0!==arg&&null!==arg&&(type.check(arg)||_toss(msg,k,type.operator,arg,type.actual))}}),keys.forEach(function(k){var name="arrayOf"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k],expected="["+k+"]";out[name]=function(arg,msg){Array.isArray(arg)||_toss(msg,expected,type.operator,arg,type.actual);var i;for(i=0;i<arg.length;i++)type.check(arg[i])||_toss(msg,expected,type.operator,arg,type.actual)}}),keys.forEach(function(k){var name="optionalArrayOf"+_capitalize(k);if(ndebug)return void(out[name]=noop);var type=types[k],expected="["+k+"]";out[name]=function(arg,msg){if(void 0!==arg&&null!==arg){Array.isArray(arg)||_toss(msg,expected,type.operator,arg,type.actual);var i;for(i=0;i<arg.length;i++)type.check(arg[i])||_toss(msg,expected,type.operator,arg,type.actual)}}}),Object.keys(assert).forEach(function(k){return"AssertionError"===k?void(out[k]=assert[k]):ndebug?void(out[k]=noop):void(out[k]=assert[k])}),out._setExports=_setExports,out}var assert=require("assert"),Stream=require("stream").Stream,util=require("util"),UUID_REGEXP=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/,types={bool:{check:function(arg){return"boolean"==typeof arg}},func:{check:function(arg){return"function"==typeof arg}},string:{check:function(arg){return"string"==typeof arg}},object:{check:function(arg){return"object"===(void 0===arg?"undefined":_typeof(arg))&&null!==arg}},number:{check:function(arg){return"number"==typeof arg&&!isNaN(arg)}},finite:{check:function(arg){return"number"==typeof arg&&!isNaN(arg)&&isFinite(arg)}},buffer:{check:function(arg){return Buffer.isBuffer(arg)},operator:"Buffer.isBuffer"},array:{check:function(arg){return Array.isArray(arg)},operator:"Array.isArray"},stream:{check:function(arg){return arg instanceof Stream},operator:"instanceof",actual:_getClass},date:{check:function(arg){return arg instanceof Date},operator:"instanceof",actual:_getClass},regexp:{check:function(arg){return arg instanceof RegExp},operator:"instanceof",actual:_getClass},uuid:{check:function(arg){return"string"==typeof arg&&UUID_REGEXP.test(arg)},operator:"isUUID"}};module.exports=_setExports(process.env.NODE_NDEBUG)}).call(this,{isBuffer:require("../../../is-buffer/index.js")},require("_process"))},{"../../../is-buffer/index.js":216,_process:105,assert:64,stream:374,util:400}],233:[function(require,module,exports){(function(Buffer){function isArrayBuffer(arr){return"[object ArrayBuffer]"===Object.prototype.toString.call(arr)}function getBinaryOpts(opt){if(xml2)return xtend(opt,{responseType:"arraybuffer"});if(void 0===self.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var req=new self.XMLHttpRequest;return req.overrideMimeType("text/plain; charset=x-user-defined"),xtend({xhr:req},opt)}var xhr=require("xhr"),noop=function(){},parseASCII=require("parse-bmfont-ascii"),parseXML=require("parse-bmfont-xml"),readBinary=require("parse-bmfont-binary"),isBinaryFormat=require("./lib/is-binary"),xtend=require("xtend"),xml2=function(){return self.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}();module.exports=function(opt,cb){cb="function"==typeof cb?cb:noop,"string"==typeof opt?opt={uri:opt}:opt||(opt={}),opt.binary&&(opt=getBinaryOpts(opt)),xhr(opt,function(err,res,body){if(err)return cb(err);if(!/^2/.test(res.statusCode))return cb(new Error("http status code: "+res.statusCode));if(!body)return cb(new Error("no body result"));var binary=!1;if(isArrayBuffer(body)){var array=new Uint8Array(body);body=new Buffer(array,"binary")}isBinaryFormat(body)&&(binary=!0,"string"==typeof body&&(body=new Buffer(body,"binary"))),binary||(Buffer.isBuffer(body)&&(body=body.toString(opt.encoding)),body=body.trim());var result;try{var type=res.headers["content-type"];result=binary?readBinary(body):/json/.test(type)||"{"===body.charAt(0)?JSON.parse(body):/xml/.test(type)||"<"===body.charAt(0)?parseXML(body):parseASCII(body)}catch(e){cb(new Error("error parsing font "+e.message)),cb=noop}cb(null,result)})}}).call(this,require("buffer").Buffer)},{"./lib/is-binary":234,buffer:108,"parse-bmfont-ascii":263,"parse-bmfont-binary":264,"parse-bmfont-xml":265,xhr:409,xtend:411}],234:[function(require,module,exports){(function(Buffer){var equal=require("buffer-equal"),HEADER=new Buffer([66,77,70,3]);module.exports=function(buf){return"string"==typeof buf?"BMF"===buf.substring(0,3):buf.length>4&&equal(buf.slice(0,4),HEADER)}}).call(this,require("buffer").Buffer)},{buffer:108,"buffer-equal":106}],235:[function(require,module,exports){(function(Buffer){function MD5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(x,n){return x<<n|x>>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}var inherits=require("inherits"),HashBase=require("hash-base"),ARRAY16=new Array(16);inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;a=fnF(a,b,c,d,M[0],3614090360,7),d=fnF(d,a,b,c,M[1],3905402710,12),c=fnF(c,d,a,b,M[2],606105819,17),b=fnF(b,c,d,a,M[3],3250441966,22),a=fnF(a,b,c,d,M[4],4118548399,7),d=fnF(d,a,b,c,M[5],1200080426,12),c=fnF(c,d,a,b,M[6],2821735955,17),b=fnF(b,c,d,a,M[7],4249261313,22),a=fnF(a,b,c,d,M[8],1770035416,7),d=fnF(d,a,b,c,M[9],2336552879,12),c=fnF(c,d,a,b,M[10],4294925233,17),b=fnF(b,c,d,a,M[11],2304563134,22),a=fnF(a,b,c,d,M[12],1804603682,7),d=fnF(d,a,b,c,M[13],4254626195,12),c=fnF(c,d,a,b,M[14],2792965006,17),b=fnF(b,c,d,a,M[15],1236535329,22),a=fnG(a,b,c,d,M[1],4129170786,5),d=fnG(d,a,b,c,M[6],3225465664,9),c=fnG(c,d,a,b,M[11],643717713,14),b=fnG(b,c,d,a,M[0],3921069994,20),a=fnG(a,b,c,d,M[5],3593408605,5),d=fnG(d,a,b,c,M[10],38016083,9),c=fnG(c,d,a,b,M[15],3634488961,14),b=fnG(b,c,d,a,M[4],3889429448,20),a=fnG(a,b,c,d,M[9],568446438,5),d=fnG(d,a,b,c,M[14],3275163606,9),c=fnG(c,d,a,b,M[3],4107603335,14),b=fnG(b,c,d,a,M[8],1163531501,20),a=fnG(a,b,c,d,M[13],2850285829,5),d=fnG(d,a,b,c,M[2],4243563512,9),c=fnG(c,d,a,b,M[7],1735328473,14),b=fnG(b,c,d,a,M[12],2368359562,20),a=fnH(a,b,c,d,M[5],4294588738,4),d=fnH(d,a,b,c,M[8],2272392833,11),c=fnH(c,d,a,b,M[11],1839030562,16),b=fnH(b,c,d,a,M[14],4259657740,23),a=fnH(a,b,c,d,M[1],2763975236,4),d=fnH(d,a,b,c,M[4],1272893353,11),c=fnH(c,d,a,b,M[7],4139469664,16),b=fnH(b,c,d,a,M[10],3200236656,23),a=fnH(a,b,c,d,M[13],681279174,4),d=fnH(d,a,b,c,M[0],3936430074,11),c=fnH(c,d,a,b,M[3],3572445317,16),b=fnH(b,c,d,a,M[6],76029189,23),a=fnH(a,b,c,d,M[9],3654602809,4),d=fnH(d,a,b,c,M[12],3873151461,11),c=fnH(c,d,a,b,M[15],530742520,16),b=fnH(b,c,d,a,M[2],3299628645,23),a=fnI(a,b,c,d,M[0],4096336452,6),d=fnI(d,a,b,c,M[7],1126891415,10),c=fnI(c,d,a,b,M[14],2878612391,15),b=fnI(b,c,d,a,M[5],4237533241,21),a=fnI(a,b,c,d,M[12],1700485571,6),d=fnI(d,a,b,c,M[3],2399980690,10),c=fnI(c,d,a,b,M[10],4293915773,15),b=fnI(b,c,d,a,M[1],2240044497,21),a=fnI(a,b,c,d,M[8],1873313359,6),d=fnI(d,a,b,c,M[15],4264355552,10),c=fnI(c,d,a,b,M[6],2734768916,15),b=fnI(b,c,d,a,M[13],1309151649,21),a=fnI(a,b,c,d,M[4],4149444226,6),d=fnI(d,a,b,c,M[11],3174756917,10),c=fnI(c,d,a,b,M[2],718787259,15),b=fnI(b,c,d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(16);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer},module.exports=MD5}).call(this,require("buffer").Buffer)},{buffer:108,"hash-base":236,inherits:215}],236:[function(require,module,exports){function throwIfNotStringOrBuffer(val,prefix){if(!Buffer.isBuffer(val)&&"string"!=typeof val)throw new TypeError(prefix+" must be a string or a buffer")}function HashBase(blockSize){Transform.call(this),this._block=Buffer.allocUnsafe(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Buffer=require("safe-buffer").Buffer,Transform=require("stream").Transform;require("inherits")(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(throwIfNotStringOrBuffer(data,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=Buffer.from(data,encoding));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)block[i++]=data[offset++];this._update(),this._blockOffset=0}for(;offset<data.length;)block[this._blockOffset++]=data[offset++];for(var j=0,carry=8*data.length;carry>0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();void 0!==encoding&&(digest=digest.toString(encoding)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase},{inherits:215,"safe-buffer":341,stream:374}],237:[function(require,module,exports){function MillerRabin(rand){this.rand=rand||new brorand.Rand}var bn=require("bn.js"),brorand=require("brorand");module.exports=MillerRabin,MillerRabin.create=function(rand){return new MillerRabin(rand)},MillerRabin.prototype._rand=function(n){var len=n.bitLength(),buf=this.rand.generate(Math.ceil(len/8));buf[0]|=3;var mask=7&len;return 0!==mask&&(buf[buf.length-1]>>=7-mask),new bn(buf)},MillerRabin.prototype.test=function(n,k,cb){var len=n.bitLength(),red=bn.mont(n),rone=new bn(1).toRed(red);k||(k=Math.max(1,len/48|0));for(var n1=n.subn(1),n2=n1.subn(1),s=0;!n1.testn(s);s++);for(var d=n.shrn(s),rn1=n1.toRed(red),prime=!0;k>0;k--){var a=this._rand(n2);cb&&cb(a);var x=a.toRed(red).redPow(d);if(0!==x.cmp(rone)&&0!==x.cmp(rn1)){for(var i=1;i<s;i++){if(x=x.redSqr(),0===x.cmp(rone))return!1;if(0===x.cmp(rn1))break}if(i===s)return!1}}return prime},MillerRabin.prototype.getDivisor=function(n,k){var len=n.bitLength(),red=bn.mont(n),rone=new bn(1).toRed(red);k||(k=Math.max(1,len/48|0));for(var n1=n.subn(1),n2=n1.subn(1),s=0;!n1.testn(s);s++);for(var d=n.shrn(s),rn1=n1.toRed(red);k>0;k--){var a=this._rand(n2),g=n.gcd(a);if(0!==g.cmpn(1))return g;var x=a.toRed(red).redPow(d);if(0!==x.cmp(rone)&&0!==x.cmp(rn1)){for(var i=1;i<s;i++){if(x=x.redSqr(),0===x.cmp(rone))return x.fromRed().subn(1).gcd(n);if(0===x.cmp(rn1))break}if(i===s)return x=x.redSqr(),x.fromRed().subn(1).gcd(n)}}return!1}},{"bn.js":74,brorand:75}],238:[function(require,module,exports){module.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iana"},"application/emma+xml":{source:"iana",extensions:["emma"]},"application/emotionml+xml":{source:"iana"},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana"},"application/epub+zip":{source:"iana",extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana"},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1,extensions:["woff"]},"application/font-woff2":{compressible:!1,extensions:["woff2"]},"application/framework-attributes+xml":{source:"iana"},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/gml+xml":{source:"iana",extensions:["gml"]},"application/gpx+xml":{source:"apache",extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana"},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana"},"application/ibe-pkg-reply+xml":{source:"iana"},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana"},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana"},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana"},"application/kpml-response+xml":{source:"iana"},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana"},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana"},"application/lost+xml":{source:"iana",extensions:["lostxml"]},"application/lostsync+xml":{source:"iana"},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",extensions:["mads"]},"application/manifest+json":{charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",extensions:["mathml"]},"application/mathml-content+xml":{source:"iana"},"application/mathml-presentation+xml":{source:"iana"},"application/mbms-associated-procedure-description+xml":{source:"iana"},"application/mbms-deregister+xml":{source:"iana"},"application/mbms-envelope+xml":{source:"iana"},"application/mbms-msk+xml":{source:"iana"},"application/mbms-msk-response+xml":{source:"iana"},"application/mbms-protection-description+xml":{source:"iana"},"application/mbms-reception-report+xml":{source:"iana"},"application/mbms-register+xml":{source:"iana"},"application/mbms-register-response+xml":{source:"iana"},"application/mbms-schedule+xml":{source:"iana"},"application/mbms-user-service-description+xml":{source:"iana"},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana"},"application/media_control+xml":{source:"iana"},"application/mediaservercontrol+xml":{source:"iana",extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",extensions:["metalink"]},"application/metalink4+xml":{source:"iana",extensions:["meta4"]},"application/mets+xml":{source:"iana",extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mods+xml":{source:"iana",extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana"},"application/mrb-publish+xml":{source:"iana"},"application/msc-ivr+xml":{source:"iana"},"application/msc-mixer+xml":{source:"iana"},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana"},"application/n-triples":{source:"iana"},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana"},"application/news-groupinfo":{source:"iana"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana"},"application/nss":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p2p-overlay+xml":{source:"iana"},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana"},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana"},"application/pidf-diff+xml":{source:"iana"},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",extensions:["pls"]},"application/poc-settings+xml":{source:"iana"},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana"},"application/provenance+xml":{source:"iana"},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.hpub+zip":{source:"iana"},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana"},"application/pskc+xml":{source:"iana",extensions:["pskcxml"]},"application/qsig":{source:"iana"},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf"]},"application/reginfo+xml":{source:"iana",extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",extensions:["rld"]},"application/rfc+xml":{source:"iana"},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana"},"application/rls-services+xml":{source:"iana",extensions:["rs"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana"},"application/samlmetadata+xml":{source:"iana"},"application/sbml+xml":{source:"iana",extensions:["sbml"]},"application/scaip+xml":{source:"iana"},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/sep+xml":{source:"iana"},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",extensions:["shf"]},"application/sieve":{source:"iana"},"application/simple-filter+xml":{source:"iana"},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",extensions:["srx"]},"application/spirits-event+xml":{source:"iana"},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",extensions:["grxml"]},"application/sru+xml":{source:"iana",extensions:["sru"]},"application/ssdl+xml":{source:"apache",extensions:["ssdl"]},"application/ssml+xml":{source:"iana",extensions:["ssml"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/tei+xml":{source:"iana",extensions:["tei","teicorpus"]},"application/thraud+xml":{source:"iana",extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/trig":{source:"iana"},"application/ttml+xml":{source:"iana"},"application/tve-trigger":{source:"iana"},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana"},"application/urc-ressheet+xml":{source:"iana"},"application/urc-targetdesc+xml":{source:"iana"},"application/urc-uisocketdesc+xml":{source:"iana"},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana"},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana"},"application/vnd.3gpp-prose+xml":{source:"iana"},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana"},"application/vnd.3gpp.bsf+xml":{source:"iana"},"application/vnd.3gpp.mid-call+xml":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana"},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana"},"application/vnd.3gpp.srvcc-info+xml":{source:"iana"},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana"},"application/vnd.3gpp.ussd+xml":{source:"iana"},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana"},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",extensions:["mpkg"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avistar+xml":{source:"iana"},"application/vnd.balsamiq.bmml+xml":{source:"iana"},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana"},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana"},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",extensions:["wbs"]},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana"},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana"},"application/vnd.cybank":{source:"iana"},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume-movie":{source:"iana"},"application/vnd.desmume.movie":{source:"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana"},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana"},"application/vnd.dvb.notif-container+xml":{source:"iana"},"application/vnd.dvb.notif-generic+xml":{source:"iana"},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana"},"application/vnd.dvb.notif-init+xml":{source:"iana"},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana"},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana"},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana"},"application/vnd.eszigno3+xml":{source:"iana",extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana"},"application/vnd.etsi.asic-e+zip":{source:"iana"},"application/vnd.etsi.asic-s+zip":{source:"iana"},"application/vnd.etsi.cug+xml":{source:"iana"},"application/vnd.etsi.iptvcommand+xml":{source:"iana"},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana"},"application/vnd.etsi.iptvprofile+xml":{source:"iana"},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana"},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana"},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana"},"application/vnd.etsi.iptvservice+xml":{source:"iana"},"application/vnd.etsi.iptvsync+xml":{source:"iana"},"application/vnd.etsi.iptvueprofile+xml":{source:"iana"},"application/vnd.etsi.mcid+xml":{source:"iana"},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana"},"application/vnd.etsi.pstn+xml":{source:"iana"},"application/vnd.etsi.sci+xml":{source:"iana"},"application/vnd.etsi.simservs+xml":{source:"iana"},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana"},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana"},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana"},"application/vnd.gov.sk.e-form+zip":{source:"iana"},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana"},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana"},"application/vnd.imagemeter.image+zip":{source:"iana"},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana"},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana"},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana"},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana"},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana"},"application/vnd.iptc.g2.packageitem+xml":{source:"iana"},"application/vnd.iptc.g2.planningitem+xml":{source:"iana"},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",extensions:["lasxml"]},"application/vnd.liberty-request+xml":{source:"iana"},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",extensions:["lbe"]},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana"},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana"},"application/vnd.marlin.drm.conftoken+xml":{source:"iana"},"application/vnd.marlin.drm.license+xml":{source:"iana"},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana"},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana"},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana"},"application/vnd.ms-printing.printticket+xml":{source:"apache"},"application/vnd.ms-printschematicket+xml":{source:"iana"},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana"},"application/vnd.nokia.iptv.config+xml":{source:"iana"},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana"},"application/vnd.nokia.landmarkcollection+xml":{source:"iana"},"application/vnd.nokia.n-gage.ac+xml":{source:"iana"},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana"},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana"},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana"},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana"},"application/vnd.oipf.dae.xhtml+xml":{source:"iana"},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana"},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana"},"application/vnd.oipf.spdlist+xml":{source:"iana"},"application/vnd.oipf.ueprofile+xml":{source:"iana"},"application/vnd.oipf.userprofile+xml":{source:"iana"},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana"},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.imd+xml":{source:"iana"},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana"},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana"},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.sprov+xml":{source:"iana"},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana"},"application/vnd.oma.cab-feature-handler+xml":{source:"iana"},"application/vnd.oma.cab-pcc+xml":{source:"iana"},"application/vnd.oma.cab-subs-invite+xml":{source:"iana"},"application/vnd.oma.cab-user-prefs+xml":{source:"iana"},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana"},"application/vnd.oma.group-usage-list+xml":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana"},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana"},"application/vnd.oma.poc.final-report+xml":{source:"iana"},"application/vnd.oma.poc.groups+xml":{source:"iana"},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana"},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana"},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana"},"application/vnd.oma.xcap-directory+xml":{source:"iana"},"application/vnd.omads-email+xml":{source:"iana"},"application/vnd.omads-file+xml":{source:"iana"},"application/vnd.omads-folder+xml":{source:"iana"},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana"},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml-template":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"apache",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml-template":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"apache",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml-template":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"apache",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana"},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana"},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana"},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana"},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana"},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos+xml":{source:"iana"},"application/vnd.paos.xml":{source:"apache"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana"},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana"},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana"},"application/vnd.radisys.msml+xml":{source:"iana"},"application/vnd.radisys.msml-audit+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana"},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana"},"application/vnd.radisys.msml-conf+xml":{source:"iana"},"application/vnd.radisys.msml-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana"},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana"},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.software602.filler.form+xml":{source:"iana"},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana"},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana"},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.tmd.mediaflex.api+xml":{source:"iana"},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana"},"application/vnd.wv.ssp+xml":{source:"iana"},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana"},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",extensions:["zaz"]},"application/voicexml+xml":{source:"iana",extensions:["vxml"]},"application/vq-rtcpxr":{source:"iana"},"application/watcherinfo+xml":{source:"iana"},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-otf":{source:"apache",compressible:!0,extensions:["otf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-ttf":{source:"apache",compressible:!0,extensions:["ttf","ttc"]},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"apache",extensions:["der","crt","pem"]},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana"},"application/xaml+xml":{source:"apache",extensions:["xaml"]},"application/xcap-att+xml":{source:"iana"},"application/xcap-caps+xml":{source:"iana"},"application/xcap-diff+xml":{source:"iana",extensions:["xdf"]},"application/xcap-el+xml":{source:"iana"},"application/xcap-error+xml":{source:"iana"},"application/xcap-ns+xml":{source:"iana"},"application/xcon-conference-info+xml":{source:"iana"},"application/xcon-conference-info-diff+xml":{source:"iana"},"application/xenc+xml":{source:"iana",extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache"},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana"},"application/xmpp+xml":{source:"iana"},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",extensions:["xpl"]},"application/xslt+xml":{source:"iana",extensions:["xslt"]},"application/xspf+xml":{source:"apache",extensions:["xspf"]},"application/xv+xml":{source:"iana",extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana"},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana"},"application/yin+xml":{source:"iana",extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana"},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana"},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tone":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/opentype":{compressible:!0,extensions:["otf"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana"},"image/emf":{source:"iana"},"image/fits":{source:"iana"},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana"},"image/jp2":{source:"iana"},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jpm":{source:"iana"},"image/jpx":{source:"iana"},"image/ktx":{source:"iana",extensions:["ktx"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana"},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana"},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/tiff-fx":{source:"iana"},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana"},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana"},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana"},"image/vnd.valve.source.texture":{source:"iana"},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana"},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana"},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana"},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana"},"message/global-delivery-status":{source:"iana"},"message/global-disposition-notification":{source:"iana"},"message/global-headers":{source:"iana"},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana"},"model/3mf":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/vnd.collada+xml":{source:"iana",extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana"},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana"},"model/vnd.parasolid.transmit.binary":{source:"iana"},"model/vnd.parasolid.transmit.text":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.valve.source.compiled-map":{source:"iana"},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana"},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana"},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana",compressible:!1},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fwdred":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/hjson":{extensions:["hjson"]},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/slim":{extensions:["slim","slm"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"apache"},"video/3gpp":{source:"apache",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"apache"},"video/3gpp2":{source:"apache",extensions:["3g2"]},"video/bmpeg":{source:"apache"},"video/bt656":{source:"apache"},"video/celb":{source:"apache"},"video/dv":{source:"apache"},"video/encaprtp":{source:"apache"},"video/h261":{source:"apache",extensions:["h261"]},"video/h263":{source:"apache",extensions:["h263"]},"video/h263-1998":{source:"apache"},"video/h263-2000":{source:"apache"},"video/h264":{source:"apache",extensions:["h264"]},"video/h264-rcdo":{source:"apache"},"video/h264-svc":{source:"apache"},"video/h265":{source:"apache"},"video/iso.segment":{source:"apache"},"video/jpeg":{source:"apache",extensions:["jpgv"]},"video/jpeg2000":{source:"apache"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/mj2":{source:"apache",extensions:["mj2","mjp2"]},"video/mp1s":{source:"apache"},"video/mp2p":{source:"apache"},"video/mp2t":{source:"apache",extensions:["ts"]},"video/mp4":{source:"apache",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"apache"},"video/mpeg":{source:"apache",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"apache"},"video/mpv":{source:"apache"},"video/nv":{source:"apache"},"video/ogg":{source:"apache",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"apache"},"video/pointer":{source:"apache"},"video/quicktime":{source:"apache",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"apache"},"video/raw":{source:"apache"},"video/rtp-enc-aescm128":{source:"apache"},"video/rtploopback":{source:"apache"},"video/rtx":{source:"apache"},"video/smpte292m":{source:"apache"},"video/ulpfec":{source:"apache"},"video/vc1":{source:"apache"},"video/vnd.cctv":{source:"apache"},"video/vnd.dece.hd":{source:"apache",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"apache",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"apache"},"video/vnd.dece.pd":{source:"apache",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"apache",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"apache",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"apache"},"video/vnd.directv.mpeg-tts":{source:"apache"},"video/vnd.dlna.mpeg-tts":{source:"apache"},"video/vnd.dvb.file":{source:"apache",extensions:["dvb"]},"video/vnd.fvt":{source:"apache",extensions:["fvt"]},"video/vnd.hns.video":{source:"apache"},"video/vnd.iptvforum.1dparityfec-1010":{source:"apache"},"video/vnd.iptvforum.1dparityfec-2005":{source:"apache"},"video/vnd.iptvforum.2dparityfec-1010":{source:"apache"},"video/vnd.iptvforum.2dparityfec-2005":{source:"apache"},"video/vnd.iptvforum.ttsavc":{source:"apache"},"video/vnd.iptvforum.ttsmpeg2":{source:"apache"},"video/vnd.motorola.video":{source:"apache"},"video/vnd.motorola.videop":{source:"apache"},"video/vnd.mpegurl":{source:"apache",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"apache",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"apache"},"video/vnd.nokia.videovoip":{source:"apache"},"video/vnd.objectvideo":{source:"apache"},"video/vnd.radgamettools.bink":{source:"apache"},"video/vnd.radgamettools.smacker":{source:"apache"},"video/vnd.sealed.mpeg1":{source:"apache"},"video/vnd.sealed.mpeg4":{source:"apache"},"video/vnd.sealed.swf":{source:"apache"},"video/vnd.sealedmedia.softseal.mov":{source:"apache"},"video/vnd.uvvu.mp4":{source:"apache",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"apache",extensions:["viv"]},"video/vp8":{source:"apache"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}},{}],239:[function(require,module,exports){module.exports=require("./db.json")},{"./db.json":238}],240:[function(require,module,exports){function charset(type){if(!type||"string"!=typeof type)return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),mime=match&&db[match[1].toLowerCase()];return mime&&mime.charset?mime.charset:!(!match||!TEXT_TYPE_REGEXP.test(match[1]))&&"UTF-8"}function contentType(str){if(!str||"string"!=typeof str)return!1;var mime=-1===str.indexOf("/")?exports.lookup(str):str;if(!mime)return!1;if(-1===mime.indexOf("charset")){var charset=exports.charset(mime);charset&&(mime+="; charset="+charset.toLowerCase())}return mime}function extension(type){if(!type||"string"!=typeof type)return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),exts=match&&exports.extensions[match[1].toLowerCase()];return!(!exts||!exts.length)&&exts[0]}function lookup(path){if(!path||"string"!=typeof path)return!1;var extension=extname("x."+path).toLowerCase().substr(1);return!!extension&&(exports.types[extension]||!1)}function populateMaps(extensions,types){var preference=["nginx","apache",void 0,"iana"];Object.keys(db).forEach(function(type){var mime=db[type],exts=mime.extensions;if(exts&&exts.length){extensions[type]=exts;for(var i=0;i<exts.length;i++){var extension=exts[i];if(types[extension]){var from=preference.indexOf(db[types[extension]].source),to=preference.indexOf(mime.source);if("application/octet-stream"!==types[extension]&&(from>to||from===to&&"application/"===types[extension].substr(0,12)))continue}types[extension]=type}}})}var db=require("mime-db"),extname=require("path").extname,EXTRACT_TYPE_REGEXP=/^\s*([^;\s]*)(?:;|\s|$)/,TEXT_TYPE_REGEXP=/^text\//i;exports.charset=charset,exports.charsets={lookup:charset},exports.contentType=contentType,exports.extension=extension,exports.extensions=Object.create(null),exports.lookup=lookup,exports.types=Object.create(null),populateMaps(exports.extensions,exports.types)},{"mime-db":239,path:268}],241:[function(require,module,exports){(function(process){function Mime(){this.types=Object.create(null),this.extensions=Object.create(null)}var fs=(require("path"),require("fs"));Mime.prototype.define=function(map){for(var type in map){for(var exts=map[type],i=0;i<exts.length;i++)process.env.DEBUG_MIME&&this.types[exts[i]]&&console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+exts[i]+'" extension type from '+this.types[exts[i]]+" to "+type),this.types[exts[i]]=type;this.extensions[type]||(this.extensions[type]=exts[0])}},Mime.prototype.load=function(file){this._loading=file;var map={};fs.readFileSync(file,"ascii").split(/[\r\n]+/).forEach(function(line){var fields=line.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);map[fields.shift()]=fields}),this.define(map),this._loading=null},Mime.prototype.lookup=function(path,fallback){var ext=path.replace(/.*[\.\/\\]/,"").toLowerCase();return this.types[ext]||fallback||this.default_type},Mime.prototype.extension=function(mimeType){var type=mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[type]};var mime=new Mime;mime.define(require("./types.json")),mime.default_type=mime.lookup("bin"),mime.Mime=Mime,mime.charsets={lookup:function(mimeType,fallback){return/^text\/|^application\/(javascript|json)/.test(mimeType)?"UTF-8":fallback}},module.exports=mime}).call(this,require("_process"))},{"./types.json":242,_process:105,fs:104,path:268}],242:[function(require,module,exports){module.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment