From 46b2d0ca4982ac7c938d92310db8c1aa20bf391c Mon Sep 17 00:00:00 2001 From: CMEONE Date: Tue, 4 May 2021 14:55:27 -0700 Subject: [PATCH] Fix dependency issue --- node/tenvoy.js | 2 +- node/tenvoy.min.js | 2 +- package-lock.json | 26 +++----------------------- package.json | 5 ++--- tenvoy.js | 2 +- tenvoy.min.js | 2 +- 6 files changed, 9 insertions(+), 30 deletions(-) diff --git a/node/tenvoy.js b/node/tenvoy.js index 0517d389..376b8063 100644 --- a/node/tenvoy.js +++ b/node/tenvoy.js @@ -16,7 +16,7 @@ function tEnvoy(openpgpRef = openpgp, naclRef = nacl, sjclRef = sjcl) { Object.defineProperty(this, "version", { get: () => { - return "v6.0.5"; + return "v6.0.6"; } }); diff --git a/node/tenvoy.min.js b/node/tenvoy.min.js index bcf91d9a..413275e2 100644 --- a/node/tenvoy.min.js +++ b/node/tenvoy.min.js @@ -1,2 +1,2 @@ -const openpgp=require("../openpgpjs/dist/openpgp.js"),nacl=require("../tweetnacljs/nacl.js"),sjcl=require("../sjcl/sjcl.js");var TogaTech={};function tEnvoy(e=openpgp,t=nacl,r=sjcl){let c=e,l=t,i=r;this.dictionary="abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon badge bag balance balcony ball bamboo banana banner bar barely bargain barrel base basic basket battle beach bean beauty because become beef before begin behave behind believe below belt bench benefit best betray better between beyond bicycle bid bike bind biology bird birth bitter black blade blame blanket blast bleak bless blind blood blossom blouse blue blur blush board boat body boil bomb bone bonus book boost border boring borrow boss bottom bounce box boy bracket brain brand brass brave bread breeze brick bridge brief bright bring brisk broccoli broken bronze broom brother brown brush bubble buddy budget buffalo build bulb bulk bullet bundle bunker burden burger burst bus business busy butter buyer buzz cabbage cabin cable cactus cage cake call calm camera camp can canal cancel candy cannon canoe canvas canyon capable capital captain car carbon card cargo carpet carry cart case cash casino castle casual cat catalog catch category cattle caught cause caution cave ceiling celery cement census century cereal certain chair chalk champion change chaos chapter charge chase chat cheap check cheese chef cherry chest chicken chief child chimney choice choose chronic chuckle chunk churn cigar cinnamon circle citizen city civil claim clap clarify claw clay clean clerk clever click client cliff climb clinic clip clock clog close cloth cloud clown club clump cluster clutch coach coast coconut code coffee coil coin collect color column combine come comfort comic common company concert conduct confirm congress connect consider control convince cook cool copper copy coral core corn correct cost cotton couch country couple course cousin cover coyote crack cradle craft cram crane crash crater crawl crazy cream credit creek crew cricket crime crisp critic crop cross crouch crowd crucial cruel cruise crumble crunch crush cry crystal cube culture cup cupboard curious current curtain curve cushion custom cute cycle dad damage damp dance danger daring dash daughter dawn day deal debate debris decade december decide decline decorate decrease deer defense define defy degree delay deliver demand demise denial dentist deny depart depend deposit depth deputy derive describe desert design desk despair destroy detail detect develop device devote diagram dial diamond diary dice diesel diet differ digital dignity dilemma dinner dinosaur direct dirt disagree discover disease dish dismiss disorder display distance divert divide divorce dizzy doctor document dog doll dolphin domain donate donkey donor door dose double dove draft dragon drama drastic draw dream dress drift drill drink drip drive drop drum dry duck dumb dune during dust dutch duty dwarf dynamic eager eagle early earn earth easily east easy echo ecology economy edge edit educate effort egg eight either elbow elder electric elegant element elephant elevator elite else embark embody embrace emerge emotion employ empower empty enable enact end endless endorse enemy energy enforce engage engine enhance enjoy enlist enough enrich enroll ensure enter entire entry envelope episode equal equip era erase erode erosion error erupt escape essay essence estate eternal ethics evidence evil evoke evolve exact example excess exchange excite exclude excuse execute exercise exhaust exhibit exile exist exit exotic expand expect expire explain expose express extend extra eye eyebrow fabric face faculty fade faint faith fall false fame family famous fan fancy fantasy farm fashion fat fatal father fatigue fault favorite feature february federal fee feed feel female fence festival fetch fever few fiber fiction field figure file film filter final find fine finger finish fire firm first fiscal fish fit fitness fix flag flame flash flat flavor flee flight flip float flock floor flower fluid flush fly foam focus fog foil fold follow food foot force forest forget fork fortune forum forward fossil foster found fox fragile frame frequent fresh friend fringe frog front frost frown frozen fruit fuel fun funny furnace fury future gadget gain galaxy gallery game gap garage garbage garden garlic garment gas gasp gate gather gauge gaze general genius genre gentle genuine gesture ghost giant gift giggle ginger giraffe girl give glad glance glare glass glide glimpse globe gloom glory glove glow glue goat goddess gold good goose gorilla gospel gossip govern gown grab grace grain grant grape grass gravity great green grid grief grit grocery group grow grunt guard guess guide guilt guitar gun gym habit hair half hammer hamster hand happy harbor hard harsh harvest hat have hawk hazard head health heart heavy hedgehog height hello helmet help hen hero hidden high hill hint hip hire history hobby hockey hold hole holiday hollow home honey hood hope horn horror horse hospital host hotel hour hover hub huge human humble humor hundred hungry hunt hurdle hurry hurt husband hybrid ice icon idea identify idle ignore ill illegal illness image imitate immense immune impact impose improve impulse inch include income increase index indicate indoor industry infant inflict inform inhale inherit initial inject injury inmate inner innocent input inquiry insane insect inside inspire install intact interest into invest invite involve iron island isolate issue item ivory jacket jaguar jar jazz jealous jeans jelly jewel job join joke journey joy judge juice jump jungle junior junk just kangaroo keen keep ketchup key kick kid kidney kind kingdom kiss kit kitchen kite kitten kiwi knee knife knock know lab label labor ladder lady lake lamp language laptop large later latin laugh laundry lava law lawn lawsuit layer lazy leader leaf learn leave lecture left leg legal legend leisure lemon lend length lens leopard lesson letter level liar liberty library license life lift light like limb limit link lion liquid list little live lizard load loan lobster local lock logic lonely long loop lottery loud lounge love loyal lucky luggage lumber lunar lunch luxury lyrics machine mad magic magnet maid mail main major make mammal man manage mandate mango mansion manual maple marble march margin marine market marriage mask mass master match material math matrix matter maximum maze meadow mean measure meat mechanic medal media melody melt member memory mention menu mercy merge merit merry mesh message metal method middle midnight milk million mimic mind minimum minor minute miracle mirror misery miss mistake mix mixed mixture mobile model modify mom moment monitor monkey monster month moon moral more morning mosquito mother motion motor mountain mouse move movie much muffin mule multiply muscle museum mushroom music must mutual myself mystery myth naive name napkin narrow nasty nation nature near neck need negative neglect neither nephew nerve nest net network neutral never news next nice night noble noise nominee noodle normal north nose notable note nothing notice novel now nuclear number nurse nut oak obey object oblige obscure observe obtain obvious occur ocean october odor off offer office often oil okay old olive olympic omit once one onion online only open opera opinion oppose option orange orbit orchard order ordinary organ orient original orphan ostrich other outdoor outer output outside oval oven over own owner oxygen oyster ozone pact paddle page pair palace palm panda panel panic panther paper parade parent park parrot party pass patch path patient patrol pattern pause pave payment peace peanut pear peasant pelican pen penalty pencil people pepper perfect permit person pet phone photo phrase physical piano picnic picture piece pig pigeon pill pilot pink pioneer pipe pistol pitch pizza place planet plastic plate play please pledge pluck plug plunge poem poet point polar pole police pond pony pool popular portion position possible post potato pottery poverty powder power practice praise predict prefer prepare present pretty prevent price pride primary print priority prison private prize problem process produce profit program project promote proof property prosper protect proud provide public pudding pull pulp pulse pumpkin punch pupil puppy purchase purity purpose purse push put puzzle pyramid quality quantum quarter question quick quit quiz quote rabbit raccoon race rack radar radio rail rain raise rally ramp ranch random range rapid rare rate rather raven raw razor ready real reason rebel rebuild recall receive recipe record recycle reduce reflect reform refuse region regret regular reject relax release relief rely remain remember remind remove render renew rent reopen repair repeat replace report require rescue resemble resist resource response result retire retreat return reunion reveal review reward rhythm rib ribbon rice rich ride ridge rifle right rigid ring riot ripple risk ritual rival river road roast robot robust rocket romance roof rookie room rose rotate rough round route royal rubber rude rug rule run runway rural sad saddle sadness safe sail salad salmon salon salt salute same sample sand satisfy satoshi sauce sausage save say scale scan scare scatter scene scheme school science scissors scorpion scout scrap screen script scrub sea search season seat second secret section security seed seek segment select sell seminar senior sense sentence series service session settle setup seven shadow shaft shallow share shed shell sheriff shield shift shine ship shiver shock shoe shoot shop short shoulder shove shrimp shrug shuffle shy sibling sick side siege sight sign silent silk silly silver similar simple since sing siren sister situate six size skate sketch ski skill skin skirt skull slab slam sleep slender slice slide slight slim slogan slot slow slush small smart smile smoke smooth snack snake snap sniff snow soap soccer social sock soda soft solar soldier solid solution solve someone song soon sorry sort soul sound soup source south space spare spatial spawn speak special speed spell spend sphere spice spider spike spin spirit split spoil sponsor spoon sport spot spray spread spring spy square squeeze squirrel stable stadium staff stage stairs stamp stand start state stay steak steel stem step stereo stick still sting stock stomach stone stool story stove strategy street strike strong struggle student stuff stumble style subject submit subway success such sudden suffer sugar suggest suit summer sun sunny sunset super supply supreme sure surface surge surprise surround survey suspect sustain swallow swamp swap swarm swear sweet swift swim swing switch sword symbol symptom syrup system table tackle tag tail talent talk tank tape target task taste tattoo taxi teach team tell ten tenant tennis tent term test text thank that theme then theory there they thing this thought three thrive throw thumb thunder ticket tide tiger tilt timber time tiny tip tired tissue title toast tobacco today toddler toe together toilet token tomato tomorrow tone tongue tonight tool tooth top topic topple torch tornado tortoise toss total tourist toward tower town toy track trade traffic tragic train transfer trap trash travel tray treat tree trend trial tribe trick trigger trim trip trophy trouble truck true truly trumpet trust truth try tube tuition tumble tuna tunnel turkey turn turtle twelve twenty twice twin twist two type typical ugly umbrella unable unaware uncle uncover under undo unfair unfold unhappy uniform unique unit universe unknown unlock until unusual unveil update upgrade uphold upon upper upset urban urge usage use used useful useless usual utility vacant vacuum vague valid valley valve van vanish vapor various vast vault vehicle velvet vendor venture venue verb verify version very vessel veteran viable vibrant vicious victory video view village vintage violin virtual virus visa visit visual vital vivid vocal voice void volcano volume vote voyage wage wagon wait walk wall walnut want warfare warm warrior wash wasp waste water wave way wealth weapon wear weasel weather web wedding weekend weird welcome west wet whale what wheat wheel when where whip whisper wide width wife wild will win window wine wing wink winner winter wire wisdom wise wish witness wolf woman wonder wood wool word work world worry worth wrap wreck wrestle wrist write wrong yard year yellow you young youth zebra zero zone zoo",this.wordsList=this.dictionary.split(" "),Object.defineProperty(this,"version",{get:()=>"v6.0.5"}),Object.defineProperty(this,"PGPKey",{get:()=>tEnvoyPGPKey}),Object.defineProperty(this,"NaClKey",{get:()=>tEnvoyNaClKey}),Object.defineProperty(this,"NaClSigningKey",{get:()=>tEnvoyNaClSigningKey}),this.core={},Object.defineProperty(this.core,"openpgp",{get:()=>c}),Object.defineProperty(this.core,"nacl",{get:()=>l}),Object.defineProperty(this.core,"sjcl",{get:()=>i}),this.util={},this.util.utf8encode=e=>{if(null==e)throw"tEnvoy Fatal Error: argument string of method util.utf8encode is required and does not have a default value.";return c.util.encode_utf8(e)},this.util.utf8decode=e=>{if(null==e)throw"tEnvoy Fatal Error: argument bytes of method util.utf8decode is required and does not have a default value.";return e instanceof Uint8Array||(e=this.util.mixedToUint8Array(e,!1)),c.util.decode_utf8(e)},this.util.stringToBytes=e=>{if(null==e)throw"tEnvoy Fatal Error: argument string of method util.stringToBytes is required and does not have a default value.";return c.util.str_to_Uint8Array(e)},this.util.bytesToString=e=>{if(null==e)throw"tEnvoy Fatal Error: argument bytes of method util.bytesToString is required and does not have a default value.";return e instanceof Uint8Array||(e=this.util.mixedToUint8Array(e,!1)),c.util.Uint8Array_to_str(e)},this.util.stringToHex=r=>{if(null==r)throw"tEnvoy Fatal Error: argument string of method util.stringToHex is required and does not have a default value.";let a="";for(let t=0;t{if(null==t)throw"tEnvoy Fatal Error: argument hex of method util.hexToString is required and does not have a default value.";let r=new Uint8Array(t.length/2);for(let e=0;e{if(null==t)throw"tEnvoy Fatal Error: argument bytes of method util.bytesToHex is required and does not have a default value.";t instanceof Uint8Array||(t=this.util.mixedToUint8Array(t,!1));let r="";for(let e=0;e{if(null==t)throw"tEnvoy Fatal Error: argument hex of method util.hexToBytes is required and does not have a default value.";let r=new Uint8Array(t.length/2);for(let e=0;e{if(null==r)return r;var i=(r,e)=>{if(r.length==e||null==e)return r;if(r.length>e){let t=new Uint8Array(e);for(let e=0;e{for(let e=0;e{if(null==o)return null;if(e){let t=!1,r=0;for(let e=0;ethis.util.mixedToUint8Array(e,!0,t),this.util.unpack=e=>this.util.uint8ArrayToMixed(e,!0),this.util.objectEquals=(e,t)=>{return(()=>{var e,t,a,i;let n=(e,t)=>{if(isNaN(e)&&isNaN(t)&&"number"==typeof e&&"number"==typeof t)return!0;if(e===t)return!0;if("function"==typeof e&&"function"==typeof t||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e))return!1;if(e.constructor!==t.constructor)return!1;if(e.prototype!==t.prototype)return!1;if(-1{for(e=e.replace("Version: OpenPGP.js v4.10.10","Version: tEnvoy "+this.version).replace("Comment: https://openpgpjs.org","Comment: https://togatech.org/ (TogaTech tEnvoy)");"-"!=e[0];)e=e.substring(1);return e},this.hash=(e,t="sha256")=>{if("function"==typeof this.hash[t=null==t?"sha256":t])return this.hash[t](e);throw"tEnvoy Fatal Error: argument mixed of method hash is invalid."},this.hash.sha256=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha256 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha256(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha1=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha1 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha1(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha224=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha224 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha224(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha384=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha384 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha384(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha512=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha512 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha512(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.md5=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.md5 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.md5(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.ripemd160=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.ripemd160 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.ripemd(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha256Compound=(a,i=16)=>new Promise(async(e,t)=>{null==i&&(i=16),i=isNaN(parseInt(i))?16:parseInt(i),null==a&&t("tEnvoy Fatal Error: argument mixed of method hash.sha256Compound is required and does not have a default value.");let r=a;for(let e=0;enew Promise(async(e,t)=>{null==i&&(i=16),i=isNaN(parseInt(i))?16:parseInt(i),e(await this.hash.sha256Compound(await this.keyFactory.genSeedFromCredentials(r,a,i)))}),this.random={},this.random.bytes=(r=1)=>new Promise(async(e,t)=>{null==r&&(r=1),r=isNaN(parseInt(r))?0:parseInt(r),e(await c.crypto.random.getRandomBytes(r).catch(e=>{t(e)}))}),this.random.number=(r=0,a=1)=>new Promise(async(e,t)=>{null==r&&(r=0),r=isNaN(parseFloat(r))?0:parseFloat(r),null==a&&(a=0),a=isNaN(parseFloat(a))?0:parseFloat(a),e((await this.random.bytes(1).catch(e=>{t(e)}))[0]/255*(a-r)+r)}),this.random.string=(i=10)=>new Promise(async(e,t)=>{null==i&&(i=10),i=isNaN(parseInt(i))?10:parseInt(i);let r="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let e=0;e{t(e)})));e(r)}),this.random.words=(a=12)=>new Promise(async(e,t)=>{null==a&&(a=12),a=isNaN(parseInt(a))?12:parseInt(a);let r="";for(let e=0;e{t(e)}))],e+1!=a&&(r+=" ");e(r)}),this.keyFactory={},this.keyFactory.pbkdf2=(e,t,r=25e3,a=256)=>{if(null==e)throw"tEnvoy Fatal Error: argument password of method keyFactory.pbkdf2 is required and does not have a default value.";if(null==t)throw"tEnvoy Fatal Error: argument salt of method keyFactory.pbkdf2 is required and does not have a default value.";return null==r&&(r=25e3),r=isNaN(parseInt(r))?25e3:parseInt(r),null==a&&(a=256),a=isNaN(parseInt(a))?256:parseInt(a),i.misc.pbkdf2(e,t,r,a)},this.keyFactory.pbkdf2hex=(i,n,o=25e3,s=256)=>new Promise(async(e,t)=>{let r=this.keyFactory.pbkdf2(i,n,o,s);var a=r.join(",");e(await this.hash.sha512(a))}),this.keyFactory.genSeedFromCredentials=(i,n,o=25e3,s=32)=>new Promise(async(e,t)=>{null==i&&t("tEnvoy Fatal Error: argument username of method keyFactory.genSeedFromCredentials is required and does not have a default value."),null==n&&t("tEnvoy Fatal Error: argument password of method keyFactory.genSeedFromCredentials is required and does not have a default value."),null==s&&(s=32),s=isNaN(parseInt(s))?32:parseInt(s);let r=await this.keyFactory.pbkdf2hex(n,i,o,256);for(;r.length<2*s;)r+=await this.hash.sha512(r);let a=this.util.hexToBytes(r);e(a.slice(0,s))}),this.keyFactory.genPGPKeys=u=>new Promise(async(e,t)=>{null==(u=null==u?{}:u).passwordProtected&&(u.passwordProtected=[]);let r,a;null==u.options&&(u.options={curve:"curve25519"}),null==u.users&&null==u.options.userIds&&(u.users=[{}]),null==u.users&&null!=u.options.userIds&&(u.users=u.options.userIds),null!=u.users&&null!=u.options.userIds&&(u.options.userIds=u.options.userIds.filter(t=>null==u.users.find(e=>e.name==t.name&&e.email==t.email&&e.comment==t.comment)),u.users=u.users.concat(u.options.userIds));for(let e=0;e{t(e)}),l=this.util.fixArmor(s.privateKeyArmored),s=this.util.fixArmor(s.publicKeyArmored);a=null==u.password?(r=new tEnvoyPGPKey(l,"private",null,u.passwordProtected,this),new tEnvoyPGPKey(s,"public",null,u.passwordProtected,this)):(l=await c.encrypt({message:await c.message.fromText(l),passwords:[u.password]}).catch(e=>{t(e)}),s=await c.encrypt({message:await c.message.fromText(s),passwords:[u.password]}).catch(e=>{t(e)}),r=new tEnvoyPGPKey(this.util.fixArmor(l.data),"private",u.password,u.passwordProtected,this),new tEnvoyPGPKey(this.util.fixArmor(s.data),"public",u.password,u.passwordProtected,this)),e({privateKey:r,publicKey:a})}),this.keyFactory.genPGPSymmetricKey=a=>new Promise(async(e,t)=>{var r;null==(a=null==a?{}:a).passwordProtected&&(a.passwordProtected=[]),null==a.key&&t("tEnvoy Fatal Error: argument key of object args of method genPGPSymmetricKey is required and does not have a default value."),null==a.password?e(new tEnvoyPGPKey(a.key,"aes",null,a.passwordProtected,this)):(r=await c.encrypt({message:await c.message.fromText(a.key),passwords:[a.password]}).catch(e=>{t(e)}),e(new tEnvoyPGPKey(this.util.fixArmor(r.data),"aes",a.password,a.passwordProtected,this)))}),this.keyFactory.genNaClKeys=e=>{null==(e=null==e?{}:e).passwordProtected&&(e.passwordProtected=[]);let t;let r;r=null==e.seed?l.box.keyPair():l.box.keyPair.fromSecretKey(e.seed),t=new tEnvoyNaClKey(r.secretKey,"private",e.password,e.passwordProtected,this);var a=new tEnvoyNaClKey(r.publicKey,"public",e.password,e.passwordProtected,this),i=t.genSigningKeys(e.password),e=i.privateKey,i=i.publicKey;return{privateKey:t,publicKey:a,privateSigningKey:e,publicSigningKey:i}},this.keyFactory.genNaClSymmetricKey=e=>{if(null==(e=null==e?{}:e).passwordProtected&&(e.passwordProtected=[]),null==e.key)throw"tEnvoy Fatal Error: argument key of object args of method genNaClSymmetricKey is required and does not have a default value.";return new tEnvoyNaClKey(e.key,"secret",e.password,e.passwordProtected,this)}}function tEnvoyPGPKey(i,e="aes",r=null,a=[],t=TogaTech.tEnvoy){let o,s,n,l,u,c=t,d=c.core.openpgp;if(this.toString=()=>`[tEnvoyPGPKey ${l}]`,this.getType=()=>l,this.getId=(a=null)=>new Promise(async(t,e)=>{if("private"==l||"public"==l){var r=u("getId",a);if(r.proceed){let e=await this.getPublic(s);t(e.getKeyId().toHex())}else e(r.error)}else e("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component.")}),this.getKey=(a=null)=>new Promise(async(e,t)=>{var r;"aes"==l?null==s?e(o):(r=u("getKey",a)).proceed?e((await d.decrypt({message:await d.message.readArmored(o),passwords:[s]}).catch(e=>{t(e)})).data):t(r.error):t("tEnvoyPGPKey Fatal Error: Key does not have a symmetric component.")}),this.getPrivate=(a=null)=>new Promise(async(e,t)=>{var r=await this.getPrivateArmored(a).catch(e=>{t(e)});e((await d.key.readArmored(r).catch(e=>{t(e)})).keys[0])}),this.setPrivate=(r,a=null)=>new Promise(async(e,t)=>{await this.setPrivateArmored(r.armor(),a).catch(e=>{t(e)}),e()}),this.getPrivateArmored=(a=null)=>new Promise(async(e,t)=>{var r;"private"==l?null==s?e(o):(r=u("getPrivate",a)).proceed?e((await d.decrypt({message:await d.message.readArmored(i),passwords:[s]}).catch(e=>{t(e)})).data):t(r.error):t("tEnvoyPGPKey Fatal Error: Key does not have a private component.")}),this.setPrivateArmored=(i,n=null)=>new Promise(async(e,t)=>{var r,a;"private"==l?(null==i&&t("tEnvoyPGPKey Fatal Error: argument keyArmored of method setPrivateArmored is required and does not have a default value."),i=c.util.fixArmor(i),null==s?(o=i,e()):(r=u("setPrivate",n)).proceed?(a=await d.encrypt({message:await d.message.fromText(i),passwords:[s]}).catch(e=>{t(e)}),o=c.util.fixArmor(a.data),e()):t(r.error)):t("tEnvoyPGPKey Fatal Error: Key does not have a private component.")}),this.getPublic=(a=null)=>new Promise(async(t,r)=>{var e=u("getPublic",a);if(e.proceed)if("private"==l){let e=await this.getPrivate(s);t(e.toPublic())}else if("public"==l){let e;e=null==s?o:(await d.decrypt({message:await d.message.readArmored(o),passwords:[s]}).catch(e=>{r(e)})).data,t((await d.key.readArmored(e).catch(e=>{r(e)})).keys[0])}else r("tEnvoyPGPKey Fatal Error: Key does not have a public component.");else r(e.error)}),this.setPublic=(i,n=null)=>new Promise(async(e,t)=>{var r,a=u("setPublic",n);a.proceed?"public"==l?(o=null==s?i.armor():(r=await d.encrypt({message:await d.message.fromText(i.armor()),passwords:[s]}).catch(e=>{t(e)}),c.util.fixArmor(r.data)),e()):"private"==l?t("tEnvoyPGPKey Fatal Error: Key has a public component that depends on the private component."):t("tEnvoyPGPKey Fatal Error: Key does not have a public component."):t(a.error)}),this.getPublicArmored=(a=null)=>new Promise(async(e,t)=>{let r=await this.getPublic(a).catch(e=>{t(e)});e(c.util.fixArmor(r.armor()))}),this.setPublicArmored=(a,i=null)=>new Promise(async(e,t)=>{var r;null==a?t("tEnvoyPGPKey Fatal Error: argument keyArmored of method setPublicArmored is required and does not have a default value."):(a=c.util.fixArmor(a).catch(e=>{t(e)}),r=await d.key.readArmored(a).catch(e=>{t(e)}),await this.setPublic(r.keys[0],i),e())}),this.encrypt=(i,e=null)=>new Promise(async(r,a)=>{if(u("encrypt",e).proceed){let e,t;t="aes"==l?(e=await this.getKey(s).catch(e=>{a(e)}),await d.encrypt({message:await d.message.fromText(i),passwords:[e]}).catch(e=>{a(e)})):(e=await this.getPublic(s).catch(e=>{a(e)}),await d.encrypt({message:d.message.fromText(i),publicKeys:e}).catch(e=>{a(e)})),r(c.util.fixArmor(t.data))}}),this.decrypt=(i,t=null)=>new Promise(async(r,a)=>{var e=u("decrypt",t);if(e.proceed){i=c.util.fixArmor(i);let e,t;t="aes"==l?(e=await this.getKey(s).catch(e=>{a(e)}),await d.decrypt({message:await d.message.readArmored(i),passwords:[e]}).catch(e=>{a(e)})):(e=await this.getPrivate(s).catch(e=>{a(e)}),await d.decrypt({message:await d.message.readArmored(i),privateKeys:e}).catch(e=>{a(e)})),r(t.data)}else a(e.error)}),this.sign=(i,n=null)=>new Promise(async(e,t)=>{var r,a=u("sign",n);a.proceed?"aes"==l?t("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component."):(r=await this.getPrivate(s),r=await d.sign({message:await d.cleartext.fromText(i),privateKeys:r}),e(c.util.fixArmor(r.data))):t(a.error)}),this.verify=(i,n=null)=>new Promise(async(t,e)=>{var r,a=u("verify",n);if(a.proceed)if(i=c.util.fixArmor(i),"aes"==l)e("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component.");else{r=await this.getPublic(s);let e=await d.verify({message:await d.cleartext.readArmored(i),publicKeys:r});e.signatures[0]&&e.signatures[0].valid?t({verified:!0,keyid:e.signatures[0].keyid.toHex(),signatures:e.signatures,content:i.split("\n")[3]}):t({verified:!1})}else e(a.error)}),this.toPublic=(r=null)=>new Promise(async(e,t)=>{e(new tEnvoyPGPKey(await this.getPublicArmored(r),"public",s,n,c))}),0==i.indexOf("-----BEGIN PGP PRIVATE KEY BLOCK-----")?(l="private",i=c.util.fixArmor(i)):0==i.indexOf("-----BEGIN PGP PUBLIC KEY BLOCK-----")?(l="public",i=c.util.fixArmor(i)):0==i.indexOf("-----BEGIN PGP MESSAGE-----")?(l=e||"aes",i=c.util.fixArmor(i)):l="aes",!["public","private","aes"].includes(l))throw"tEnvoyPGPKey Fatal Error: argument type of method constructor is invalid.";{s=r,o=i,n=[];let t=[];"private"==l?t=["getId","getPublic","encrypt","decrypt","sign","verify"]:"public"==l?t=["getId","encrypt","verify"]:"aes"==l&&(t=["encrypt","decrypt"]),null==a&&(a=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==l?e=["getPrivate","setPrivate"]:"public"==l?e=["getPublic","setPublic"]:"aes"==l&&(e=["getKey"]),e.includes(t)||n.includes(t)?null==r?{proceed:!1,error:"tEnvoyPGPKey Fatal Error: Key is password-protected, and no password was specified."}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyPGPKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}},"aes"!=l&&this.getPublic(s)}}function tEnvoyNaClKey(e,r="secret",a=null,i=[],t=TogaTech.tEnvoy){let n,o,s,l,u,c,d=t,h=d.core.nacl;if(this.toString=()=>`[tEnvoyNaClKey ${u}]`,this.getType=()=>u,this.getPrivate=(e=null)=>{var t=c("getPrivate",e);if(t.proceed){if("private"!=u&&"secret"!=u&&"shared"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a private, secret, or shared component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPrivate=(e,t=null)=>{t=c("setPrivate",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClKey Fatal Error: argument privateKey of method setPrivate is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClKey Fatal Error: argument privateKey of method setPrivate is invalid, length should be 32 (was "+e.length+").";if("private"!=u&&"secret"!=u&&"shared"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a private, secret, or shared component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.getPublic=(e=null)=>{var t=c("getPublic",e);if(t.proceed){if("private"==u)return h.box.keyPair.fromSecretKey(this.getPrivate(s)).publicKey;if("public"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a public component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPublic=(e,t=null)=>{t=c("setPublic",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClKey Fatal Error: argument publicKey of method setPublic is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClKey Fatal Error: argument publicKey of method setPublic is invalid, length should be 32 (was "+e.length+").";if("private"==u)throw"tEnvoyNaClKey Fatal Error: Key has a public component that depends on the private component.";if("public"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a public component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.encrypt=(e,t,r=null)=>{var a=c("encrypt",r);if(a.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument message of method encrypt is required and does not have a default value.";if(null==t)throw"tEnvoyNaClKey Fatal Error: argument nonce of method encrypt is required and does not have a default value.";var i=d.util.pack(e).length,r=h.randomBytes(1)[0]%16,i=32+32*parseInt(i/32);i+=r,e=d.util.pack(e,i);i=d.util.pack(t);if("shared"==u){if(i.length>h.box.nonceLength)throw"tEnvoyNaClKey Fatal Error: Nonce is too long, ensure that nonce length is under "+h.box.nonceLength+" (was "+i.length+").";t=d.util.pack(t,h.box.nonceLength)}else if("secret"==u){if(i.length>h.secretbox.nonceLength)throw"tEnvoyNaClKey Fatal Error: Nonce is too long, ensure that nonce length is under "+h.secretbox.nonceLength+" (was "+i.length+").";t=d.util.pack(t,h.secretbox.nonceLength)}if("shared"==u)return d.util.bytesToHex(t)+"::"+d.util.bytesToHex(h.box.after(e,t,this.getPrivate(s)));if("secret"==u)return d.util.bytesToHex(t)+"::"+d.util.bytesToHex(h.secretbox(e,t,d.util.pack(this.getPrivate(s),32)));throw"tEnvoyNaClKey Fatal Error: Key cannot be used for encryption, only secret or shared keys can be used to encrypt."}throw a.error},this.decrypt=(e,t=null)=>{var r=c("decrypt",t);if(r.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument encrypted of method decrypt is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClKey Fatal Error: Invalid encrypted message.";var a=d.util.mixedToUint8Array(d.util.hexToBytes(e.split("::")[0]),!1),t=d.util.hexToBytes(e.split("::")[1]);if("shared"==u)return{message:d.util.unpack(h.box.open.after(t,a,this.getPrivate(s))),nonce:d.util.unpack(d.util.hexToBytes(e.split("::")[0]))};if("secret"==u)return{message:d.util.unpack(h.secretbox.open(t,a,d.util.pack(this.getPrivate(s),32))),nonce:d.util.unpack(d.util.hexToBytes(e.split("::")[0]))};throw"tEnvoyNaClKey Fatal Error: Key cannot be used for decryption, only secret or shared keys can be used to decrypt."}throw r.error},this.genSigningKeys=(e=null)=>{var t=c("genSigningKey",e);if(t.proceed){if("secret"==u)throw"tEnvoyNaClKey Fatal Error: Secret key cannot be used to generate signing keys.";e=h.sign.keyPair.fromSeed(this.getPrivate(s));return{privateKey:new tEnvoyNaClSigningKey(e.secretKey,"private",s,l,d),publicKey:new tEnvoyNaClSigningKey(e.publicKey,"public",s,l,d)}}throw t.error},this.genSharedKey=(e,t=null,r=null)=>{r=c("genSharedKey",r);if(r.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument otherKey of method genSharedKey is required and does not have a default value.";if(e instanceof tEnvoyNaClKey){if("public"==u&&"private"==e.getType())return new tEnvoyNaClKey(h.box.before(this.getPublic(s),e.getPrivate(t)),"shared",s,l,d);if("private"!=u||"public"!=e.getType())throw"tEnvoyNaClKey Fatal Error: Incompatible key types, one key should be public, and the other should be private.";return new tEnvoyNaClKey(h.box.before(e.getPublic(t),this.getPrivate(s)),"shared",s,l,d)}throw"tEnvoyNaClKey Fatal Error: Incompatible key types, both keys shoulkd be of type tEnvoyNaClKey."}throw r.error},this.toPublic=(e=null)=>new tEnvoyNaClKey(this.getPublic(e),"public",s,l,d),!["public","private","secret","shared"].includes(r))throw"tEnvoyNaClKey Fatal Error: argument type of method constructor is invalid.";{s=a,"secret"==u&&(e=d.util.pack(e,32)),n=null==a?e:(o=h.randomBytes(12),new tEnvoyNaClKey(a,"secret",null,[],d).encrypt(e,o)),u=r,l=[];let t=[];"private"==u||"shared"==u||"secret"==u?t=["getPublic","encrypt","decrypt","genSigningKey","genSharedKey","sign","verify"]:"public"==u&&(t=["encrypt","genSharedKey","verify"]),null==i&&(i=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==u||"shared"==u||"secret"==u?e=["getPrivate","setPrivate"]:"public"==u&&(e=["getPublic","setPublic"]),e.includes(t)||l.includes(t)?null==r?{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and no password was specified"}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}}}}function tEnvoyNaClSigningKey(e,r="secret",a=null,i=[],t=TogaTech.tEnvoy){let n,o,s,l,u,c,d=t,h=d.core.nacl;if(this.toString=()=>`[tEnvoyNaClSigningKey ${u}]`,this.getType=()=>u,this.getPrivate=(e=null)=>{var t=c("getPrivate",e);if(t.proceed){if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClSigningKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPrivate=(e,t=null)=>{t=c("setPrivate",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument privateKey of method setPrivate is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClSigningKey Fatal Error: argument privateKey of method setPrivate is invalid, length should be 32 (was "+e.length+").";if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.getPublic=(e=null)=>{var t=c("getPublic",e);if(t.proceed){if("private"==u)return h.sign.keyPair.fromSecretKey(this.getPrivate(s)).publicKey;if("public"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a public component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClSigningKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPublic=(e,t=null)=>{t=c("setPublic",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument publicKey of method setPublic is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClSigningKey Fatal Error: argument publicKey of method setPublic is invalid, length should be 32 (was "+e.length+").";if("private"==u)throw"tEnvoyNaClSigningKey Fatal Error: Key has a public component that depends on the private component.";if("public"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a public component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClSigningKey(s,"secret",null,[],d).encrypt(e,o))},this.sign=(e,t=null)=>{var r=c("sign",t);if(r.proceed){if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument message of method sign is required and does not have a default value.";if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";e=d.util.pack(e);t=d.util.bytesToHex(h.hash(e));return{signature:t+"::"+d.util.bytesToHex(h.sign.detached(h.hash(e),this.getPrivate(s))),hash:t}}throw r.error},this.verify=(e,t=null)=>{var r=c("verify",t);if(r.proceed){if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument signed of method verify is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClSigningKey Fatal Error: Invalid signature.";var a=d.util.hexToBytes(e.split("::")[0]),t=d.util.hexToBytes(e.split("::")[1]);return{verified:h.sign.detached.verify(a,t,this.getPublic(s)),hash:e.split("::")[0]}}throw r.error},this.verifyWithMessage=(e,t,r=null)=>{if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument signed of method verifyWithMessage is required and does not have a default value.";if(null==t)throw"tEnvoyNaClSigningKey Fatal Error: argument message of method verifyWithMessage is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClSigningKey Fatal Error: Invalid signature.";var a=d.util.hexToBytes(e.split("::")[0]);return this.verify(e,r)&&d.util.bytesToHex(h.hash(d.util.pack(t)))==d.util.bytesToHex(a)},this.toPublic=(e=null)=>new tEnvoyNaClSigningKey(this.getPublic(e),"public",s,l,d),!["public","private"].includes(r))throw"tEnvoyNaClSigningKey Fatal Error: argument type of method constructor is invalid.";{s=a,n=null==a?e:(o=h.randomBytes(12),new tEnvoyNaClKey(a,"secret",null,[],d).encrypt(e,o)),u=r,l=[];let t=[];"private"==u?t=["getPublic","sign","verify"]:"public"==u&&(t=["verify"]),null==i&&(i=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==u?e=["getPrivate","setPrivate"]:"public"==u&&(e=["getPublic","setPublic"]),e.includes(t)||l.includes(t)?null==r?{proceed:!1,error:"tEnvoyNaClSigningKey Fatal Error: Key is password-protected, and no password was specified."}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}}}}TogaTech.tEnvoy=new tEnvoy(openpgp,nacl,sjcl),module.exports={tEnvoy:tEnvoy,tEnvoyPGPKey:tEnvoyPGPKey,tEnvoyNaClKey:tEnvoyNaClKey,tEnvoyNaClSigningKey:tEnvoyNaClSigningKey}; +const openpgp=require("../openpgpjs/dist/openpgp.js"),nacl=require("../tweetnacljs/nacl.js"),sjcl=require("../sjcl/sjcl.js");var TogaTech={};function tEnvoy(e=openpgp,t=nacl,r=sjcl){let c=e,l=t,i=r;this.dictionary="abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon badge bag balance balcony ball bamboo banana banner bar barely bargain barrel base basic basket battle beach bean beauty because become beef before begin behave behind believe below belt bench benefit best betray better between beyond bicycle bid bike bind biology bird birth bitter black blade blame blanket blast bleak bless blind blood blossom blouse blue blur blush board boat body boil bomb bone bonus book boost border boring borrow boss bottom bounce box boy bracket brain brand brass brave bread breeze brick bridge brief bright bring brisk broccoli broken bronze broom brother brown brush bubble buddy budget buffalo build bulb bulk bullet bundle bunker burden burger burst bus business busy butter buyer buzz cabbage cabin cable cactus cage cake call calm camera camp can canal cancel candy cannon canoe canvas canyon capable capital captain car carbon card cargo carpet carry cart case cash casino castle casual cat catalog catch category cattle caught cause caution cave ceiling celery cement census century cereal certain chair chalk champion change chaos chapter charge chase chat cheap check cheese chef cherry chest chicken chief child chimney choice choose chronic chuckle chunk churn cigar cinnamon circle citizen city civil claim clap clarify claw clay clean clerk clever click client cliff climb clinic clip clock clog close cloth cloud clown club clump cluster clutch coach coast coconut code coffee coil coin collect color column combine come comfort comic common company concert conduct confirm congress connect consider control convince cook cool copper copy coral core corn correct cost cotton couch country couple course cousin cover coyote crack cradle craft cram crane crash crater crawl crazy cream credit creek crew cricket crime crisp critic crop cross crouch crowd crucial cruel cruise crumble crunch crush cry crystal cube culture cup cupboard curious current curtain curve cushion custom cute cycle dad damage damp dance danger daring dash daughter dawn day deal debate debris decade december decide decline decorate decrease deer defense define defy degree delay deliver demand demise denial dentist deny depart depend deposit depth deputy derive describe desert design desk despair destroy detail detect develop device devote diagram dial diamond diary dice diesel diet differ digital dignity dilemma dinner dinosaur direct dirt disagree discover disease dish dismiss disorder display distance divert divide divorce dizzy doctor document dog doll dolphin domain donate donkey donor door dose double dove draft dragon drama drastic draw dream dress drift drill drink drip drive drop drum dry duck dumb dune during dust dutch duty dwarf dynamic eager eagle early earn earth easily east easy echo ecology economy edge edit educate effort egg eight either elbow elder electric elegant element elephant elevator elite else embark embody embrace emerge emotion employ empower empty enable enact end endless endorse enemy energy enforce engage engine enhance enjoy enlist enough enrich enroll ensure enter entire entry envelope episode equal equip era erase erode erosion error erupt escape essay essence estate eternal ethics evidence evil evoke evolve exact example excess exchange excite exclude excuse execute exercise exhaust exhibit exile exist exit exotic expand expect expire explain expose express extend extra eye eyebrow fabric face faculty fade faint faith fall false fame family famous fan fancy fantasy farm fashion fat fatal father fatigue fault favorite feature february federal fee feed feel female fence festival fetch fever few fiber fiction field figure file film filter final find fine finger finish fire firm first fiscal fish fit fitness fix flag flame flash flat flavor flee flight flip float flock floor flower fluid flush fly foam focus fog foil fold follow food foot force forest forget fork fortune forum forward fossil foster found fox fragile frame frequent fresh friend fringe frog front frost frown frozen fruit fuel fun funny furnace fury future gadget gain galaxy gallery game gap garage garbage garden garlic garment gas gasp gate gather gauge gaze general genius genre gentle genuine gesture ghost giant gift giggle ginger giraffe girl give glad glance glare glass glide glimpse globe gloom glory glove glow glue goat goddess gold good goose gorilla gospel gossip govern gown grab grace grain grant grape grass gravity great green grid grief grit grocery group grow grunt guard guess guide guilt guitar gun gym habit hair half hammer hamster hand happy harbor hard harsh harvest hat have hawk hazard head health heart heavy hedgehog height hello helmet help hen hero hidden high hill hint hip hire history hobby hockey hold hole holiday hollow home honey hood hope horn horror horse hospital host hotel hour hover hub huge human humble humor hundred hungry hunt hurdle hurry hurt husband hybrid ice icon idea identify idle ignore ill illegal illness image imitate immense immune impact impose improve impulse inch include income increase index indicate indoor industry infant inflict inform inhale inherit initial inject injury inmate inner innocent input inquiry insane insect inside inspire install intact interest into invest invite involve iron island isolate issue item ivory jacket jaguar jar jazz jealous jeans jelly jewel job join joke journey joy judge juice jump jungle junior junk just kangaroo keen keep ketchup key kick kid kidney kind kingdom kiss kit kitchen kite kitten kiwi knee knife knock know lab label labor ladder lady lake lamp language laptop large later latin laugh laundry lava law lawn lawsuit layer lazy leader leaf learn leave lecture left leg legal legend leisure lemon lend length lens leopard lesson letter level liar liberty library license life lift light like limb limit link lion liquid list little live lizard load loan lobster local lock logic lonely long loop lottery loud lounge love loyal lucky luggage lumber lunar lunch luxury lyrics machine mad magic magnet maid mail main major make mammal man manage mandate mango mansion manual maple marble march margin marine market marriage mask mass master match material math matrix matter maximum maze meadow mean measure meat mechanic medal media melody melt member memory mention menu mercy merge merit merry mesh message metal method middle midnight milk million mimic mind minimum minor minute miracle mirror misery miss mistake mix mixed mixture mobile model modify mom moment monitor monkey monster month moon moral more morning mosquito mother motion motor mountain mouse move movie much muffin mule multiply muscle museum mushroom music must mutual myself mystery myth naive name napkin narrow nasty nation nature near neck need negative neglect neither nephew nerve nest net network neutral never news next nice night noble noise nominee noodle normal north nose notable note nothing notice novel now nuclear number nurse nut oak obey object oblige obscure observe obtain obvious occur ocean october odor off offer office often oil okay old olive olympic omit once one onion online only open opera opinion oppose option orange orbit orchard order ordinary organ orient original orphan ostrich other outdoor outer output outside oval oven over own owner oxygen oyster ozone pact paddle page pair palace palm panda panel panic panther paper parade parent park parrot party pass patch path patient patrol pattern pause pave payment peace peanut pear peasant pelican pen penalty pencil people pepper perfect permit person pet phone photo phrase physical piano picnic picture piece pig pigeon pill pilot pink pioneer pipe pistol pitch pizza place planet plastic plate play please pledge pluck plug plunge poem poet point polar pole police pond pony pool popular portion position possible post potato pottery poverty powder power practice praise predict prefer prepare present pretty prevent price pride primary print priority prison private prize problem process produce profit program project promote proof property prosper protect proud provide public pudding pull pulp pulse pumpkin punch pupil puppy purchase purity purpose purse push put puzzle pyramid quality quantum quarter question quick quit quiz quote rabbit raccoon race rack radar radio rail rain raise rally ramp ranch random range rapid rare rate rather raven raw razor ready real reason rebel rebuild recall receive recipe record recycle reduce reflect reform refuse region regret regular reject relax release relief rely remain remember remind remove render renew rent reopen repair repeat replace report require rescue resemble resist resource response result retire retreat return reunion reveal review reward rhythm rib ribbon rice rich ride ridge rifle right rigid ring riot ripple risk ritual rival river road roast robot robust rocket romance roof rookie room rose rotate rough round route royal rubber rude rug rule run runway rural sad saddle sadness safe sail salad salmon salon salt salute same sample sand satisfy satoshi sauce sausage save say scale scan scare scatter scene scheme school science scissors scorpion scout scrap screen script scrub sea search season seat second secret section security seed seek segment select sell seminar senior sense sentence series service session settle setup seven shadow shaft shallow share shed shell sheriff shield shift shine ship shiver shock shoe shoot shop short shoulder shove shrimp shrug shuffle shy sibling sick side siege sight sign silent silk silly silver similar simple since sing siren sister situate six size skate sketch ski skill skin skirt skull slab slam sleep slender slice slide slight slim slogan slot slow slush small smart smile smoke smooth snack snake snap sniff snow soap soccer social sock soda soft solar soldier solid solution solve someone song soon sorry sort soul sound soup source south space spare spatial spawn speak special speed spell spend sphere spice spider spike spin spirit split spoil sponsor spoon sport spot spray spread spring spy square squeeze squirrel stable stadium staff stage stairs stamp stand start state stay steak steel stem step stereo stick still sting stock stomach stone stool story stove strategy street strike strong struggle student stuff stumble style subject submit subway success such sudden suffer sugar suggest suit summer sun sunny sunset super supply supreme sure surface surge surprise surround survey suspect sustain swallow swamp swap swarm swear sweet swift swim swing switch sword symbol symptom syrup system table tackle tag tail talent talk tank tape target task taste tattoo taxi teach team tell ten tenant tennis tent term test text thank that theme then theory there they thing this thought three thrive throw thumb thunder ticket tide tiger tilt timber time tiny tip tired tissue title toast tobacco today toddler toe together toilet token tomato tomorrow tone tongue tonight tool tooth top topic topple torch tornado tortoise toss total tourist toward tower town toy track trade traffic tragic train transfer trap trash travel tray treat tree trend trial tribe trick trigger trim trip trophy trouble truck true truly trumpet trust truth try tube tuition tumble tuna tunnel turkey turn turtle twelve twenty twice twin twist two type typical ugly umbrella unable unaware uncle uncover under undo unfair unfold unhappy uniform unique unit universe unknown unlock until unusual unveil update upgrade uphold upon upper upset urban urge usage use used useful useless usual utility vacant vacuum vague valid valley valve van vanish vapor various vast vault vehicle velvet vendor venture venue verb verify version very vessel veteran viable vibrant vicious victory video view village vintage violin virtual virus visa visit visual vital vivid vocal voice void volcano volume vote voyage wage wagon wait walk wall walnut want warfare warm warrior wash wasp waste water wave way wealth weapon wear weasel weather web wedding weekend weird welcome west wet whale what wheat wheel when where whip whisper wide width wife wild will win window wine wing wink winner winter wire wisdom wise wish witness wolf woman wonder wood wool word work world worry worth wrap wreck wrestle wrist write wrong yard year yellow you young youth zebra zero zone zoo",this.wordsList=this.dictionary.split(" "),Object.defineProperty(this,"version",{get:()=>"v6.0.6"}),Object.defineProperty(this,"PGPKey",{get:()=>tEnvoyPGPKey}),Object.defineProperty(this,"NaClKey",{get:()=>tEnvoyNaClKey}),Object.defineProperty(this,"NaClSigningKey",{get:()=>tEnvoyNaClSigningKey}),this.core={},Object.defineProperty(this.core,"openpgp",{get:()=>c}),Object.defineProperty(this.core,"nacl",{get:()=>l}),Object.defineProperty(this.core,"sjcl",{get:()=>i}),this.util={},this.util.utf8encode=e=>{if(null==e)throw"tEnvoy Fatal Error: argument string of method util.utf8encode is required and does not have a default value.";return c.util.encode_utf8(e)},this.util.utf8decode=e=>{if(null==e)throw"tEnvoy Fatal Error: argument bytes of method util.utf8decode is required and does not have a default value.";return e instanceof Uint8Array||(e=this.util.mixedToUint8Array(e,!1)),c.util.decode_utf8(e)},this.util.stringToBytes=e=>{if(null==e)throw"tEnvoy Fatal Error: argument string of method util.stringToBytes is required and does not have a default value.";return c.util.str_to_Uint8Array(e)},this.util.bytesToString=e=>{if(null==e)throw"tEnvoy Fatal Error: argument bytes of method util.bytesToString is required and does not have a default value.";return e instanceof Uint8Array||(e=this.util.mixedToUint8Array(e,!1)),c.util.Uint8Array_to_str(e)},this.util.stringToHex=r=>{if(null==r)throw"tEnvoy Fatal Error: argument string of method util.stringToHex is required and does not have a default value.";let a="";for(let t=0;t{if(null==t)throw"tEnvoy Fatal Error: argument hex of method util.hexToString is required and does not have a default value.";let r=new Uint8Array(t.length/2);for(let e=0;e{if(null==t)throw"tEnvoy Fatal Error: argument bytes of method util.bytesToHex is required and does not have a default value.";t instanceof Uint8Array||(t=this.util.mixedToUint8Array(t,!1));let r="";for(let e=0;e{if(null==t)throw"tEnvoy Fatal Error: argument hex of method util.hexToBytes is required and does not have a default value.";let r=new Uint8Array(t.length/2);for(let e=0;e{if(null==r)return r;var i=(r,e)=>{if(r.length==e||null==e)return r;if(r.length>e){let t=new Uint8Array(e);for(let e=0;e{for(let e=0;e{if(null==o)return null;if(e){let t=!1,r=0;for(let e=0;ethis.util.mixedToUint8Array(e,!0,t),this.util.unpack=e=>this.util.uint8ArrayToMixed(e,!0),this.util.objectEquals=(e,t)=>{return(()=>{var e,t,a,i;let n=(e,t)=>{if(isNaN(e)&&isNaN(t)&&"number"==typeof e&&"number"==typeof t)return!0;if(e===t)return!0;if("function"==typeof e&&"function"==typeof t||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e))return!1;if(e.constructor!==t.constructor)return!1;if(e.prototype!==t.prototype)return!1;if(-1{for(e=e.replace("Version: OpenPGP.js v4.10.10","Version: tEnvoy "+this.version).replace("Comment: https://openpgpjs.org","Comment: https://togatech.org/ (TogaTech tEnvoy)");"-"!=e[0];)e=e.substring(1);return e},this.hash=(e,t="sha256")=>{if("function"==typeof this.hash[t=null==t?"sha256":t])return this.hash[t](e);throw"tEnvoy Fatal Error: argument mixed of method hash is invalid."},this.hash.sha256=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha256 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha256(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha1=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha1 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha1(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha224=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha224 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha224(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha384=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha384 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha384(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha512=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.sha512 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.sha512(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.md5=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.md5 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.md5(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.ripemd160=r=>new Promise(async(e,t)=>{null==r&&t("tEnvoy Fatal Error: argument mixed of method hash.ripemd160 is required and does not have a default value."),e(this.util.stringToHex(this.util.bytesToString(await c.crypto.hash.ripemd(this.util.mixedToUint8Array(r,!1)).catch(e=>{t(e)}))))}),this.hash.sha256Compound=(a,i=16)=>new Promise(async(e,t)=>{null==i&&(i=16),i=isNaN(parseInt(i))?16:parseInt(i),null==a&&t("tEnvoy Fatal Error: argument mixed of method hash.sha256Compound is required and does not have a default value.");let r=a;for(let e=0;enew Promise(async(e,t)=>{null==i&&(i=16),i=isNaN(parseInt(i))?16:parseInt(i),e(await this.hash.sha256Compound(await this.keyFactory.genSeedFromCredentials(r,a,i)))}),this.random={},this.random.bytes=(r=1)=>new Promise(async(e,t)=>{null==r&&(r=1),r=isNaN(parseInt(r))?0:parseInt(r),e(await c.crypto.random.getRandomBytes(r).catch(e=>{t(e)}))}),this.random.number=(r=0,a=1)=>new Promise(async(e,t)=>{null==r&&(r=0),r=isNaN(parseFloat(r))?0:parseFloat(r),null==a&&(a=0),a=isNaN(parseFloat(a))?0:parseFloat(a),e((await this.random.bytes(1).catch(e=>{t(e)}))[0]/255*(a-r)+r)}),this.random.string=(i=10)=>new Promise(async(e,t)=>{null==i&&(i=10),i=isNaN(parseInt(i))?10:parseInt(i);let r="";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let e=0;e{t(e)})));e(r)}),this.random.words=(a=12)=>new Promise(async(e,t)=>{null==a&&(a=12),a=isNaN(parseInt(a))?12:parseInt(a);let r="";for(let e=0;e{t(e)}))],e+1!=a&&(r+=" ");e(r)}),this.keyFactory={},this.keyFactory.pbkdf2=(e,t,r=25e3,a=256)=>{if(null==e)throw"tEnvoy Fatal Error: argument password of method keyFactory.pbkdf2 is required and does not have a default value.";if(null==t)throw"tEnvoy Fatal Error: argument salt of method keyFactory.pbkdf2 is required and does not have a default value.";return null==r&&(r=25e3),r=isNaN(parseInt(r))?25e3:parseInt(r),null==a&&(a=256),a=isNaN(parseInt(a))?256:parseInt(a),i.misc.pbkdf2(e,t,r,a)},this.keyFactory.pbkdf2hex=(i,n,o=25e3,s=256)=>new Promise(async(e,t)=>{let r=this.keyFactory.pbkdf2(i,n,o,s);var a=r.join(",");e(await this.hash.sha512(a))}),this.keyFactory.genSeedFromCredentials=(i,n,o=25e3,s=32)=>new Promise(async(e,t)=>{null==i&&t("tEnvoy Fatal Error: argument username of method keyFactory.genSeedFromCredentials is required and does not have a default value."),null==n&&t("tEnvoy Fatal Error: argument password of method keyFactory.genSeedFromCredentials is required and does not have a default value."),null==s&&(s=32),s=isNaN(parseInt(s))?32:parseInt(s);let r=await this.keyFactory.pbkdf2hex(n,i,o,256);for(;r.length<2*s;)r+=await this.hash.sha512(r);let a=this.util.hexToBytes(r);e(a.slice(0,s))}),this.keyFactory.genPGPKeys=u=>new Promise(async(e,t)=>{null==(u=null==u?{}:u).passwordProtected&&(u.passwordProtected=[]);let r,a;null==u.options&&(u.options={curve:"curve25519"}),null==u.users&&null==u.options.userIds&&(u.users=[{}]),null==u.users&&null!=u.options.userIds&&(u.users=u.options.userIds),null!=u.users&&null!=u.options.userIds&&(u.options.userIds=u.options.userIds.filter(t=>null==u.users.find(e=>e.name==t.name&&e.email==t.email&&e.comment==t.comment)),u.users=u.users.concat(u.options.userIds));for(let e=0;e{t(e)}),l=this.util.fixArmor(s.privateKeyArmored),s=this.util.fixArmor(s.publicKeyArmored);a=null==u.password?(r=new tEnvoyPGPKey(l,"private",null,u.passwordProtected,this),new tEnvoyPGPKey(s,"public",null,u.passwordProtected,this)):(l=await c.encrypt({message:await c.message.fromText(l),passwords:[u.password]}).catch(e=>{t(e)}),s=await c.encrypt({message:await c.message.fromText(s),passwords:[u.password]}).catch(e=>{t(e)}),r=new tEnvoyPGPKey(this.util.fixArmor(l.data),"private",u.password,u.passwordProtected,this),new tEnvoyPGPKey(this.util.fixArmor(s.data),"public",u.password,u.passwordProtected,this)),e({privateKey:r,publicKey:a})}),this.keyFactory.genPGPSymmetricKey=a=>new Promise(async(e,t)=>{var r;null==(a=null==a?{}:a).passwordProtected&&(a.passwordProtected=[]),null==a.key&&t("tEnvoy Fatal Error: argument key of object args of method genPGPSymmetricKey is required and does not have a default value."),null==a.password?e(new tEnvoyPGPKey(a.key,"aes",null,a.passwordProtected,this)):(r=await c.encrypt({message:await c.message.fromText(a.key),passwords:[a.password]}).catch(e=>{t(e)}),e(new tEnvoyPGPKey(this.util.fixArmor(r.data),"aes",a.password,a.passwordProtected,this)))}),this.keyFactory.genNaClKeys=e=>{null==(e=null==e?{}:e).passwordProtected&&(e.passwordProtected=[]);let t;let r;r=null==e.seed?l.box.keyPair():l.box.keyPair.fromSecretKey(e.seed),t=new tEnvoyNaClKey(r.secretKey,"private",e.password,e.passwordProtected,this);var a=new tEnvoyNaClKey(r.publicKey,"public",e.password,e.passwordProtected,this),i=t.genSigningKeys(e.password),e=i.privateKey,i=i.publicKey;return{privateKey:t,publicKey:a,privateSigningKey:e,publicSigningKey:i}},this.keyFactory.genNaClSymmetricKey=e=>{if(null==(e=null==e?{}:e).passwordProtected&&(e.passwordProtected=[]),null==e.key)throw"tEnvoy Fatal Error: argument key of object args of method genNaClSymmetricKey is required and does not have a default value.";return new tEnvoyNaClKey(e.key,"secret",e.password,e.passwordProtected,this)}}function tEnvoyPGPKey(i,e="aes",r=null,a=[],t=TogaTech.tEnvoy){let o,s,n,l,u,c=t,d=c.core.openpgp;if(this.toString=()=>`[tEnvoyPGPKey ${l}]`,this.getType=()=>l,this.getId=(a=null)=>new Promise(async(t,e)=>{if("private"==l||"public"==l){var r=u("getId",a);if(r.proceed){let e=await this.getPublic(s);t(e.getKeyId().toHex())}else e(r.error)}else e("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component.")}),this.getKey=(a=null)=>new Promise(async(e,t)=>{var r;"aes"==l?null==s?e(o):(r=u("getKey",a)).proceed?e((await d.decrypt({message:await d.message.readArmored(o),passwords:[s]}).catch(e=>{t(e)})).data):t(r.error):t("tEnvoyPGPKey Fatal Error: Key does not have a symmetric component.")}),this.getPrivate=(a=null)=>new Promise(async(e,t)=>{var r=await this.getPrivateArmored(a).catch(e=>{t(e)});e((await d.key.readArmored(r).catch(e=>{t(e)})).keys[0])}),this.setPrivate=(r,a=null)=>new Promise(async(e,t)=>{await this.setPrivateArmored(r.armor(),a).catch(e=>{t(e)}),e()}),this.getPrivateArmored=(a=null)=>new Promise(async(e,t)=>{var r;"private"==l?null==s?e(o):(r=u("getPrivate",a)).proceed?e((await d.decrypt({message:await d.message.readArmored(i),passwords:[s]}).catch(e=>{t(e)})).data):t(r.error):t("tEnvoyPGPKey Fatal Error: Key does not have a private component.")}),this.setPrivateArmored=(i,n=null)=>new Promise(async(e,t)=>{var r,a;"private"==l?(null==i&&t("tEnvoyPGPKey Fatal Error: argument keyArmored of method setPrivateArmored is required and does not have a default value."),i=c.util.fixArmor(i),null==s?(o=i,e()):(r=u("setPrivate",n)).proceed?(a=await d.encrypt({message:await d.message.fromText(i),passwords:[s]}).catch(e=>{t(e)}),o=c.util.fixArmor(a.data),e()):t(r.error)):t("tEnvoyPGPKey Fatal Error: Key does not have a private component.")}),this.getPublic=(a=null)=>new Promise(async(t,r)=>{var e=u("getPublic",a);if(e.proceed)if("private"==l){let e=await this.getPrivate(s);t(e.toPublic())}else if("public"==l){let e;e=null==s?o:(await d.decrypt({message:await d.message.readArmored(o),passwords:[s]}).catch(e=>{r(e)})).data,t((await d.key.readArmored(e).catch(e=>{r(e)})).keys[0])}else r("tEnvoyPGPKey Fatal Error: Key does not have a public component.");else r(e.error)}),this.setPublic=(i,n=null)=>new Promise(async(e,t)=>{var r,a=u("setPublic",n);a.proceed?"public"==l?(o=null==s?i.armor():(r=await d.encrypt({message:await d.message.fromText(i.armor()),passwords:[s]}).catch(e=>{t(e)}),c.util.fixArmor(r.data)),e()):"private"==l?t("tEnvoyPGPKey Fatal Error: Key has a public component that depends on the private component."):t("tEnvoyPGPKey Fatal Error: Key does not have a public component."):t(a.error)}),this.getPublicArmored=(a=null)=>new Promise(async(e,t)=>{let r=await this.getPublic(a).catch(e=>{t(e)});e(c.util.fixArmor(r.armor()))}),this.setPublicArmored=(a,i=null)=>new Promise(async(e,t)=>{var r;null==a?t("tEnvoyPGPKey Fatal Error: argument keyArmored of method setPublicArmored is required and does not have a default value."):(a=c.util.fixArmor(a).catch(e=>{t(e)}),r=await d.key.readArmored(a).catch(e=>{t(e)}),await this.setPublic(r.keys[0],i),e())}),this.encrypt=(i,e=null)=>new Promise(async(r,a)=>{if(u("encrypt",e).proceed){let e,t;t="aes"==l?(e=await this.getKey(s).catch(e=>{a(e)}),await d.encrypt({message:await d.message.fromText(i),passwords:[e]}).catch(e=>{a(e)})):(e=await this.getPublic(s).catch(e=>{a(e)}),await d.encrypt({message:d.message.fromText(i),publicKeys:e}).catch(e=>{a(e)})),r(c.util.fixArmor(t.data))}}),this.decrypt=(i,t=null)=>new Promise(async(r,a)=>{var e=u("decrypt",t);if(e.proceed){i=c.util.fixArmor(i);let e,t;t="aes"==l?(e=await this.getKey(s).catch(e=>{a(e)}),await d.decrypt({message:await d.message.readArmored(i),passwords:[e]}).catch(e=>{a(e)})):(e=await this.getPrivate(s).catch(e=>{a(e)}),await d.decrypt({message:await d.message.readArmored(i),privateKeys:e}).catch(e=>{a(e)})),r(t.data)}else a(e.error)}),this.sign=(i,n=null)=>new Promise(async(e,t)=>{var r,a=u("sign",n);a.proceed?"aes"==l?t("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component."):(r=await this.getPrivate(s),r=await d.sign({message:await d.cleartext.fromText(i),privateKeys:r}),e(c.util.fixArmor(r.data))):t(a.error)}),this.verify=(i,n=null)=>new Promise(async(t,e)=>{var r,a=u("verify",n);if(a.proceed)if(i=c.util.fixArmor(i),"aes"==l)e("tEnvoyPGPKey Fatal Error: Key does not have an asymmetric component.");else{r=await this.getPublic(s);let e=await d.verify({message:await d.cleartext.readArmored(i),publicKeys:r});e.signatures[0]&&e.signatures[0].valid?t({verified:!0,keyid:e.signatures[0].keyid.toHex(),signatures:e.signatures,content:i.split("\n")[3]}):t({verified:!1})}else e(a.error)}),this.toPublic=(r=null)=>new Promise(async(e,t)=>{e(new tEnvoyPGPKey(await this.getPublicArmored(r),"public",s,n,c))}),0==i.indexOf("-----BEGIN PGP PRIVATE KEY BLOCK-----")?(l="private",i=c.util.fixArmor(i)):0==i.indexOf("-----BEGIN PGP PUBLIC KEY BLOCK-----")?(l="public",i=c.util.fixArmor(i)):0==i.indexOf("-----BEGIN PGP MESSAGE-----")?(l=e||"aes",i=c.util.fixArmor(i)):l="aes",!["public","private","aes"].includes(l))throw"tEnvoyPGPKey Fatal Error: argument type of method constructor is invalid.";{s=r,o=i,n=[];let t=[];"private"==l?t=["getId","getPublic","encrypt","decrypt","sign","verify"]:"public"==l?t=["getId","encrypt","verify"]:"aes"==l&&(t=["encrypt","decrypt"]),null==a&&(a=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==l?e=["getPrivate","setPrivate"]:"public"==l?e=["getPublic","setPublic"]:"aes"==l&&(e=["getKey"]),e.includes(t)||n.includes(t)?null==r?{proceed:!1,error:"tEnvoyPGPKey Fatal Error: Key is password-protected, and no password was specified."}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyPGPKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}},"aes"!=l&&this.getPublic(s)}}function tEnvoyNaClKey(e,r="secret",a=null,i=[],t=TogaTech.tEnvoy){let n,o,s,l,u,c,d=t,h=d.core.nacl;if(this.toString=()=>`[tEnvoyNaClKey ${u}]`,this.getType=()=>u,this.getPrivate=(e=null)=>{var t=c("getPrivate",e);if(t.proceed){if("private"!=u&&"secret"!=u&&"shared"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a private, secret, or shared component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPrivate=(e,t=null)=>{t=c("setPrivate",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClKey Fatal Error: argument privateKey of method setPrivate is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClKey Fatal Error: argument privateKey of method setPrivate is invalid, length should be 32 (was "+e.length+").";if("private"!=u&&"secret"!=u&&"shared"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a private, secret, or shared component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.getPublic=(e=null)=>{var t=c("getPublic",e);if(t.proceed){if("private"==u)return h.box.keyPair.fromSecretKey(this.getPrivate(s)).publicKey;if("public"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a public component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPublic=(e,t=null)=>{t=c("setPublic",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClKey Fatal Error: argument publicKey of method setPublic is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClKey Fatal Error: argument publicKey of method setPublic is invalid, length should be 32 (was "+e.length+").";if("private"==u)throw"tEnvoyNaClKey Fatal Error: Key has a public component that depends on the private component.";if("public"!=u)throw"tEnvoyNaClKey Fatal Error: Key does not have a public component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.encrypt=(e,t,r=null)=>{var a=c("encrypt",r);if(a.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument message of method encrypt is required and does not have a default value.";if(null==t)throw"tEnvoyNaClKey Fatal Error: argument nonce of method encrypt is required and does not have a default value.";var i=d.util.pack(e).length,r=h.randomBytes(1)[0]%16,i=32+32*parseInt(i/32);i+=r,e=d.util.pack(e,i);i=d.util.pack(t);if("shared"==u){if(i.length>h.box.nonceLength)throw"tEnvoyNaClKey Fatal Error: Nonce is too long, ensure that nonce length is under "+h.box.nonceLength+" (was "+i.length+").";t=d.util.pack(t,h.box.nonceLength)}else if("secret"==u){if(i.length>h.secretbox.nonceLength)throw"tEnvoyNaClKey Fatal Error: Nonce is too long, ensure that nonce length is under "+h.secretbox.nonceLength+" (was "+i.length+").";t=d.util.pack(t,h.secretbox.nonceLength)}if("shared"==u)return d.util.bytesToHex(t)+"::"+d.util.bytesToHex(h.box.after(e,t,this.getPrivate(s)));if("secret"==u)return d.util.bytesToHex(t)+"::"+d.util.bytesToHex(h.secretbox(e,t,d.util.pack(this.getPrivate(s),32)));throw"tEnvoyNaClKey Fatal Error: Key cannot be used for encryption, only secret or shared keys can be used to encrypt."}throw a.error},this.decrypt=(e,t=null)=>{var r=c("decrypt",t);if(r.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument encrypted of method decrypt is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClKey Fatal Error: Invalid encrypted message.";var a=d.util.mixedToUint8Array(d.util.hexToBytes(e.split("::")[0]),!1),t=d.util.hexToBytes(e.split("::")[1]);if("shared"==u)return{message:d.util.unpack(h.box.open.after(t,a,this.getPrivate(s))),nonce:d.util.unpack(d.util.hexToBytes(e.split("::")[0]))};if("secret"==u)return{message:d.util.unpack(h.secretbox.open(t,a,d.util.pack(this.getPrivate(s),32))),nonce:d.util.unpack(d.util.hexToBytes(e.split("::")[0]))};throw"tEnvoyNaClKey Fatal Error: Key cannot be used for decryption, only secret or shared keys can be used to decrypt."}throw r.error},this.genSigningKeys=(e=null)=>{var t=c("genSigningKey",e);if(t.proceed){if("secret"==u)throw"tEnvoyNaClKey Fatal Error: Secret key cannot be used to generate signing keys.";e=h.sign.keyPair.fromSeed(this.getPrivate(s));return{privateKey:new tEnvoyNaClSigningKey(e.secretKey,"private",s,l,d),publicKey:new tEnvoyNaClSigningKey(e.publicKey,"public",s,l,d)}}throw t.error},this.genSharedKey=(e,t=null,r=null)=>{r=c("genSharedKey",r);if(r.proceed){if(null==e)throw"tEnvoyNaClKey Fatal Error: argument otherKey of method genSharedKey is required and does not have a default value.";if(e instanceof tEnvoyNaClKey){if("public"==u&&"private"==e.getType())return new tEnvoyNaClKey(h.box.before(this.getPublic(s),e.getPrivate(t)),"shared",s,l,d);if("private"!=u||"public"!=e.getType())throw"tEnvoyNaClKey Fatal Error: Incompatible key types, one key should be public, and the other should be private.";return new tEnvoyNaClKey(h.box.before(e.getPublic(t),this.getPrivate(s)),"shared",s,l,d)}throw"tEnvoyNaClKey Fatal Error: Incompatible key types, both keys shoulkd be of type tEnvoyNaClKey."}throw r.error},this.toPublic=(e=null)=>new tEnvoyNaClKey(this.getPublic(e),"public",s,l,d),!["public","private","secret","shared"].includes(r))throw"tEnvoyNaClKey Fatal Error: argument type of method constructor is invalid.";{s=a,"secret"==u&&(e=d.util.pack(e,32)),n=null==a?e:(o=h.randomBytes(12),new tEnvoyNaClKey(a,"secret",null,[],d).encrypt(e,o)),u=r,l=[];let t=[];"private"==u||"shared"==u||"secret"==u?t=["getPublic","encrypt","decrypt","genSigningKey","genSharedKey","sign","verify"]:"public"==u&&(t=["encrypt","genSharedKey","verify"]),null==i&&(i=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==u||"shared"==u||"secret"==u?e=["getPrivate","setPrivate"]:"public"==u&&(e=["getPublic","setPublic"]),e.includes(t)||l.includes(t)?null==r?{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and no password was specified"}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}}}}function tEnvoyNaClSigningKey(e,r="secret",a=null,i=[],t=TogaTech.tEnvoy){let n,o,s,l,u,c,d=t,h=d.core.nacl;if(this.toString=()=>`[tEnvoyNaClSigningKey ${u}]`,this.getType=()=>u,this.getPrivate=(e=null)=>{var t=c("getPrivate",e);if(t.proceed){if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClSigningKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPrivate=(e,t=null)=>{t=c("setPrivate",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument privateKey of method setPrivate is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClSigningKey Fatal Error: argument privateKey of method setPrivate is invalid, length should be 32 (was "+e.length+").";if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClKey(s,"secret",null,[],d).encrypt(e,o))},this.getPublic=(e=null)=>{var t=c("getPublic",e);if(t.proceed){if("private"==u)return h.sign.keyPair.fromSecretKey(this.getPrivate(s)).publicKey;if("public"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a public component.";if(null==s)return n;e=new tEnvoyNaClKey(s,"secret",null,[],d).decrypt(n);if(d.util.bytesToHex(e.nonce)==d.util.bytesToHex(o))return e.message;throw"tEnvoyNaClSigningKey Fatal Error: The encrypted key was tampered with, and the nonce is invalid."}throw t.error},this.setPublic=(e,t=null)=>{t=c("setPublic",t);if(!t.proceed)throw t.error;if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument publicKey of method setPublic is required and does not have a default value.";if(32!=(e=d.util.mixedToUint8Array(e,!1)).length)throw"tEnvoyNaClSigningKey Fatal Error: argument publicKey of method setPublic is invalid, length should be 32 (was "+e.length+").";if("private"==u)throw"tEnvoyNaClSigningKey Fatal Error: Key has a public component that depends on the private component.";if("public"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a public component.";n=null==s?e:(o=h.randomBytes(12),new tEnvoyNaClSigningKey(s,"secret",null,[],d).encrypt(e,o))},this.sign=(e,t=null)=>{var r=c("sign",t);if(r.proceed){if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument message of method sign is required and does not have a default value.";if("private"!=u)throw"tEnvoyNaClSigningKey Fatal Error: Key does not have a private component.";e=d.util.pack(e);t=d.util.bytesToHex(h.hash(e));return{signature:t+"::"+d.util.bytesToHex(h.sign.detached(h.hash(e),this.getPrivate(s))),hash:t}}throw r.error},this.verify=(e,t=null)=>{var r=c("verify",t);if(r.proceed){if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument signed of method verify is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClSigningKey Fatal Error: Invalid signature.";var a=d.util.hexToBytes(e.split("::")[0]),t=d.util.hexToBytes(e.split("::")[1]);return{verified:h.sign.detached.verify(a,t,this.getPublic(s)),hash:e.split("::")[0]}}throw r.error},this.verifyWithMessage=(e,t,r=null)=>{if(null==e)throw"tEnvoyNaClSigningKey Fatal Error: argument signed of method verifyWithMessage is required and does not have a default value.";if(null==t)throw"tEnvoyNaClSigningKey Fatal Error: argument message of method verifyWithMessage is required and does not have a default value.";if(2!=e.split("::").length)throw"tEnvoyNaClSigningKey Fatal Error: Invalid signature.";var a=d.util.hexToBytes(e.split("::")[0]);return this.verify(e,r)&&d.util.bytesToHex(h.hash(d.util.pack(t)))==d.util.bytesToHex(a)},this.toPublic=(e=null)=>new tEnvoyNaClSigningKey(this.getPublic(e),"public",s,l,d),!["public","private"].includes(r))throw"tEnvoyNaClSigningKey Fatal Error: argument type of method constructor is invalid.";{s=a,n=null==a?e:(o=h.randomBytes(12),new tEnvoyNaClKey(a,"secret",null,[],d).encrypt(e,o)),u=r,l=[];let t=[];"private"==u?t=["getPublic","sign","verify"]:"public"==u&&(t=["verify"]),null==i&&(i=[]);for(let e=0;e{if(null==s)return{proceed:!0};{let e;return"private"==u?e=["getPrivate","setPrivate"]:"public"==u&&(e=["getPublic","setPublic"]),e.includes(t)||l.includes(t)?null==r?{proceed:!1,error:"tEnvoyNaClSigningKey Fatal Error: Key is password-protected, and no password was specified."}:((t,r)=>{let a=!0;for(let e=0;e=r.length||t[e]!=r[e])&&(a=!1);return t.length!=r.length&&(a=!1),a})(r,s)?{proceed:!0}:{proceed:!1,error:"tEnvoyNaClKey Fatal Error: Key is password-protected, and an incorrect password was specified."}:{proceed:!0}}}}}TogaTech.tEnvoy=new tEnvoy(openpgp,nacl,sjcl),module.exports={tEnvoy:tEnvoy,tEnvoyPGPKey:tEnvoyPGPKey,tEnvoyNaClKey:tEnvoyNaClKey,tEnvoyNaClSigningKey:tEnvoyNaClSigningKey}; //# sourceMappingURL=tenvoy.min.js.map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f2a790a0..d2bdc0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,15 @@ { "name": "tenvoy", - "version": "6.0.3", + "version": "6.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tenvoy", - "version": "6.0.3", + "version": "6.0.5", "license": "LGPL-3.0+", "dependencies": { - "asn1.js": "^5.0.0", - "tenvoy": "^6.0.3" + "asn1.js": "^5.0.0" }, "engines": { "node": ">= 10.0.0" @@ -46,17 +45,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/tenvoy": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/tenvoy/-/tenvoy-6.0.3.tgz", - "integrity": "sha512-7s6SUUSLmp60r/Hr/EdoOo4bke2RVeNM9emh7j0q2mdbgFa+42ZXR5I7MRj99wOwVcUcZgJ0fNhMGsSeo09bEA==", - "dependencies": { - "asn1.js": "^5.0.0" - }, - "engines": { - "node": ">= 10.0.0" - } } }, "dependencies": { @@ -90,14 +78,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "tenvoy": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/tenvoy/-/tenvoy-6.0.3.tgz", - "integrity": "sha512-7s6SUUSLmp60r/Hr/EdoOo4bke2RVeNM9emh7j0q2mdbgFa+42ZXR5I7MRj99wOwVcUcZgJ0fNhMGsSeo09bEA==", - "requires": { - "asn1.js": "^5.0.0" - } } } } diff --git a/package.json b/package.json index 7afe9d9c..3e365da6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tenvoy", - "version": "6.0.5", + "version": "6.0.6", "description": "PGP, NaCl, and PBKDF2 in node.js and the browser (hashing, random, encryption, decryption, signatures, conversions), used by TogaTech.org", "main": "./node/tenvoy.min.js", "browser": { @@ -45,8 +45,7 @@ "url": "https://github.com/TogaTech/tEnvoy/issues" }, "dependencies": { - "asn1.js": "^5.0.0", - "tenvoy": "^6.0.3" + "asn1.js": "^5.0.0" }, "homepage": "https://github.com/TogaTech/tEnvoy#readme" } diff --git a/tenvoy.js b/tenvoy.js index c9e0779b..7cd209c2 100644 --- a/tenvoy.js +++ b/tenvoy.js @@ -45665,7 +45665,7 @@ function tEnvoy(openpgpRef = openpgp, naclRef = nacl, sjclRef = sjcl) { Object.defineProperty(this, "version", { get: () => { - return "v6.0.5"; + return "v6.0.6"; } }); diff --git a/tenvoy.min.js b/tenvoy.min.js index 8eb3b04f..d152f214 100644 --- a/tenvoy.min.js +++ b/tenvoy.min.js @@ -1,2 +1,2 @@ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).openpgp=e()}(function(){return function n(a,i,s){function o(t,e){if(!i[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=i[t]={exports:{}},a[t][0].call(r.exports,function(e){return o(a[t][1][e]||e)},r,r.exports,n,a,i,s)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e`Symbol(${e})`,r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==zt?zt:void 0,n=Number.isNaN||function(e){return e!=e};function a(e){return"object"==typeof e&&null!==e||"function"==typeof e}function i(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function h(e){return e.slice()}function s(e){return!1!=("number"==typeof(t=e)&&(!n(t)&&!(t<0)))&&e!==1/0;var t}function o(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function p(t,e,r,n){const a=t[e];if(void 0!==a){if("function"!=typeof a)throw new TypeError(`${a} is not a method`);switch(r){case 0:return()=>b(a,t,n);case 1:return e=>{e=[e].concat(n);return b(a,t,e)}}}return()=>Promise.resolve()}function y(e,t,r){t=e[t];if(void 0!==t)return o(t,e,r)}function b(e,t,r){try{return Promise.resolve(o(e,t,r))}catch(e){return Promise.reject(e)}}function m(e){if(e=Number(e),n(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function g(t){if(void 0===t)return()=>1;if("function"!=typeof t)throw new TypeError("size property of a queuing strategy must be a function");return e=>t(e)}function _(e,f,r){let d,h;var t=new Promise((e,t)=>{d=e,h=t});return void 0===r&&(r=e=>{throw e}),function(t,r){let n=!1;var e,a,i,s=e=>{!1===n&&(n=!0,r(e))};let o=0,u=0;const c=t.length,l=new Array(c);for(const r of t){const t=o;e=r,a=e=>{l[t]=e,++u===c&&(e=>{try{const t=f(e);d(t)}catch(e){h(e)}})(l)},i=s,Promise.prototype.then.call(e,a,i),++o}}(e,e=>{try{var t=r(e);d(t)}catch(e){h(e)}}),t}function u(e){}function k(e){e&&e instanceof u.AssertionError&&setTimeout(()=>{throw e},0)}function c(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function l(e,t,r){if(!s(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function f(e){e._queue=[],e._queueTotalSize=0}u.AssertionError=function(){};const d=t("[[AbortSteps]]"),w=t("[[ErrorSteps]]");class v{constructor(e={},t={}){S(this);var r=t.size;let n=t.highWaterMark;if(void 0!==e.type)throw new RangeError("Invalid type is specified");r=g(r);void 0===n&&(n=1),function(e,t,r,n){const a=Object.create(N.prototype);var i=p(t,"write",1,[a]),s=p(t,"close",0,[]),o=p(t,"abort",1,[]);F(e,a,function(){return y(t,"start",[a])},i,s,o,r,n)}(this,e,n=m(n),r)}get locked(){if(!1===E(this))throw Z("locked");return P(this)}abort(e){return!1===E(this)?Promise.reject(Z("abort")):!0===P(this)?Promise.reject(new TypeError("Cannot abort a stream that already has a writer")):x(this,e)}getWriter(){if(!1===E(this))throw Z("getWriter");return A(this)}}function A(e){return new B(e)}function S(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=[],e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function E(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function P(e){return void 0!==e._writer}function x(r,n){var e=r._state;if("closed"===e||"errored"===e)return Promise.resolve(void 0);if(void 0!==r._pendingAbortRequest)return r._pendingAbortRequest._promise;let a=!1;"erroring"===e&&(a=!0,n=void 0);e=new Promise((e,t)=>{r._pendingAbortRequest={_promise:void 0,_resolve:e,_reject:t,_reason:n,_wasAlreadyErroring:a}});return r._pendingAbortRequest._promise=e,!1===a&&K(r,n),e}function M(e,t){"writable"!==e._state?C(e):K(e,t)}function K(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&O(n,t),!1==(void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest)&&!0===r._started&&C(e)}function C(t){t._state="errored",t._writableStreamController[w]();var e=t._storedError;for(const r of t._writeRequests)r._reject(e);if(t._writeRequests=[],void 0!==t._pendingAbortRequest){const r=t._pendingAbortRequest;if(!(t._pendingAbortRequest=void 0)===r._wasAlreadyErroring)return r._reject(e),void U(t);t._writableStreamController[d](r._reason).then(()=>{r._resolve(),U(t)},e=>{r._reject(e),U(t)})}else U(t)}function j(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function U(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&Q(t,e._storedError)}function T(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(!0===t?te:ie)(r),e._backpressure=t}class B{constructor(e){if(!1===E(e))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===P(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");(this._ownerWritableStream=e)._writer=this;const t=e._state;if("writable"===t)(!1===j(e)&&!0===e._backpressure?te:ne)(this),J(this);else if("erroring"===t)re(this,e._storedError),J(this);else if("closed"===t)ne(this),J(r=this),ee(r);else{const t=e._storedError;re(this,t),X(this,t)}var r}get closed(){return!1===R(this)?Promise.reject(Y("closed")):this._closedPromise}get desiredSize(){if(!1===R(this))throw Y("desiredSize");if(void 0===this._ownerWritableStream)throw $("desiredSize");return"errored"===(e=(t=(e=this)._ownerWritableStream)._state)||"erroring"===e?null:"closed"===e?0:L(t._writableStreamController);var e,t}get ready(){return!1===R(this)?Promise.reject(Y("ready")):this._readyPromise}abort(e){return!1===R(this)?Promise.reject(Y("abort")):void 0===this._ownerWritableStream?Promise.reject($("abort")):x(this._ownerWritableStream,e)}close(){if(!1===R(this))return Promise.reject(Y("close"));var e=this._ownerWritableStream;return void 0===e?Promise.reject($("close")):!0===j(e)?Promise.reject(new TypeError("cannot close an already-closing stream")):I(this)}releaseLock(){if(!1===R(this))throw Y("releaseLock");void 0!==this._ownerWritableStream&&z(this)}write(e){return!1===R(this)?Promise.reject(Y("write")):void 0===this._ownerWritableStream?Promise.reject($("write to")):D(this,e)}}function R(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function I(e){const r=e._ownerWritableStream,t=r._state;if("closed"===t||"errored"===t)return Promise.reject(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));var n=new Promise((e,t)=>{t={_resolve:e,_reject:t};r._closeRequest=t});return!0===r._backpressure&&"writable"===t&&ie(e),l(e=r._writableStreamController,"close",0),H(e),n}function O(e,t){("pending"===e._readyPromiseState?ae:re)(e,t)}function z(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");var n,a;O(e,r),a=r,("pending"===(n=e)._closedPromiseState?Q:X)(n,a),t._writer=void 0,e._ownerWritableStream=void 0}function D(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,a=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return W(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return Promise.reject($("write to"));e=r._state;if("errored"===e)return Promise.reject(r._storedError);if(!0===j(r)||"closed"===e)return Promise.reject(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===e)return Promise.reject(r._storedError);var i,r=(i=r,new Promise((e,t)=>{i._writeRequests.push({_resolve:e,_reject:t})}));return function(e,t,r){var n={chunk:t};try{l(e,n,r)}catch(t){return W(e,t)}r=e._controlledWritableStream;if(!1===j(r)&&"writable"===r._state){const t=G(e);T(r,t)}H(e)}(n,t,a),r}class N{constructor(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}error(e){if(!1==(!!a(t=this)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");var t;"writable"===this._controlledWritableStream._state&&V(this,e)}[d](e){e=this._abortAlgorithm(e);return q(this),e}[w](){f(this)}}function F(t,r,e,n,a,i,s,o){((r._controlledWritableStream=t)._writableStreamController=r)._queue=void 0,r._queueTotalSize=void 0,f(r),r._started=!1,r._strategySizeAlgorithm=o,r._strategyHWM=s,r._writeAlgorithm=n,r._closeAlgorithm=a,r._abortAlgorithm=i;i=G(r);T(t,i);e=e();Promise.resolve(e).then(()=>{r._started=!0,H(r)},e=>{r._started=!0,M(t,e)}).catch(k)}function q(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function L(e){return e._strategyHWM-e._queueTotalSize}function H(e){var t=e._controlledWritableStream;if(!1!==e._started&&void 0===t._inFlightWriteRequest){var r=t._state;if("closed"!==r&&"errored"!==r){if("erroring"===r)return C(t),0;0!==e._queue.length&&("close"===(t=e._queue[0].value)?function(e){const r=e._controlledWritableStream;var t;(t=r)._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0,c(e);const n=e._closeAlgorithm();q(e),n.then(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"!==e._state||(e._storedError=void 0)!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0),e._state="closed";e=e._writer;void 0!==e&&ee(e)}(r)},e=>{var t;t=r,e=e,t._inFlightCloseRequest._reject(e),(t._inFlightCloseRequest=void 0)!==t._pendingAbortRequest&&(t._pendingAbortRequest._reject(e),t._pendingAbortRequest=void 0),M(t,e)}).catch(k)}(e):function(r,e){const n=r._controlledWritableStream;var t;(t=n)._inFlightWriteRequest=t._writeRequests.shift(),r._writeAlgorithm(e).then(()=>{var e;(e=n)._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0;const t=n._state;if(c(r),!1===j(n)&&"writable"===t){const t=G(r);T(n,t)}H(r)},e=>{var t;"writable"===n._state&&q(r),t=n,e=e,t._inFlightWriteRequest._reject(e),t._inFlightWriteRequest=void 0,M(t,e)}).catch(k)}(e,t.chunk))}}}function W(e,t){"writable"===e._controlledWritableStream._state&&V(e,t)}function G(e){return L(e)<=0}function V(e,t){var r=e._controlledWritableStream;q(e),K(r,t)}function Z(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Y(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function $(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function J(r){r._closedPromise=new Promise((e,t)=>{r._closedPromise_resolve=e,r._closedPromise_reject=t,r._closedPromiseState="pending"})}function X(e,t){J(e),Q(e,t)}function Q(e,t){e._closedPromise.catch(()=>{}),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function ee(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function te(r){r._readyPromise=new Promise((e,t)=>{r._readyPromise_resolve=e,r._readyPromise_reject=t}),r._readyPromiseState="pending"}function re(e,t){te(e),ae(e,t)}function ne(e){te(e),ie(e)}function ae(e,t){e._readyPromise.catch(()=>{}),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function ie(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}const se=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},oe=t("[[CancelSteps]]"),ue=t("[[PullSteps]]");class ce{constructor(e={},t={}){de(this);var r=t.size;let n=t.highWaterMark;t=e.type;if("bytes"===String(t)){if(void 0!==r)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===n&&(n=0),function(e,s,t){const o=Object.create(Ve.prototype);var r=p(s,"pull",0,[o]),n=p(s,"cancel",1,[]);let a=s.autoAllocateChunkSize;if(void 0!==a&&(a=Number(a),!1===se(a)||a<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(e,t,r,n,a,i){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,Je(t),t._queue=t._queueTotalSize=void 0,f(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=m(a),t._pullAlgorithm=r,t._cancelAlgorithm=n,t._autoAllocateChunkSize=i,t._pendingPullIntos=[],e._readableStreamController=t;e=y(s,"start",[o]);Promise.resolve(e).then(()=>{t._started=!0,$e(t)},e=>{ct(t,e)}).catch(k)}(e,o,r,n,t,a)}(this,e,n=m(n))}else{if(void 0!==t)throw new RangeError("Invalid type is specified");{const a=g(r);void 0===n&&(n=1),function(e,t,r,n){const a=Object.create(Re.prototype);var i=p(t,"pull",0,[a]),s=p(t,"cancel",1,[]);We(e,a,function(){return y(t,"start",[a])},i,s,r,n)}(this,e,n=m(n),a)}}}get locked(){if(!1===he(this))throw dt("locked");return pe(this)}cancel(e){return!1===he(this)?Promise.reject(dt("cancel")):!0===pe(this)?Promise.reject(new TypeError("Cannot cancel a stream that already has a reader")):ge(this,e)}getReader({mode:e}={}){if(!1===he(this))throw dt("getReader");if(void 0===e)return le(this);if("byob"===(e=String(e)))return e=this,new Me(e);throw new RangeError("Invalid mode is specified")}pipeThrough({writable:e,readable:t},{preventClose:r,preventAbort:n,preventCancel:a,signal:i}={}){if(!1===he(this))throw dt("pipeThrough");if(!1===E(e))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===he(t))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(r=Boolean(r),n=Boolean(n),a=Boolean(a),void 0!==i&&!ft(i))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===pe(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===P(e))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return ye(this,e,r,n,a,i).catch(()=>{}),t}pipeTo(e,{preventClose:t,preventAbort:r,preventCancel:n,signal:a}={}){return!1===he(this)?Promise.reject(dt("pipeTo")):!1===E(e)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(t=Boolean(t),r=Boolean(r),n=Boolean(n),void 0===a||ft(a)?!0===pe(this)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===P(e)?Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ye(this,e,t,r,n,a):Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))}tee(){if(!1===he(this))throw dt("tee");var e=function(r){const e=le(r);let n,a,i,s,o,u=!1,c=!1,l=!1;const f=new Promise(e=>{o=e});function t(){return Be(e).then(e=>{var t=e.value;!0===e.done&&!1===u&&(!1===c&&Ne(i._readableStreamController),!1===l&&Ne(s._readableStreamController),u=!0),!0!==u&&(t=e=t,!1===c&&Fe(i._readableStreamController,e),!1===l&&Fe(s._readableStreamController,t))})}function d(){}return i=fe(d,t,function(e){if(c=!0,n=e,!0===l){const e=h([n,a]),t=ge(r,e);o(t)}return f}),s=fe(d,t,function(e){if(l=!0,a=e,!0===c){const e=h([n,a]),t=ge(r,e);o(t)}return f}),e._closedPromise.catch(e=>{!0!==u&&(qe(i._readableStreamController,e),qe(s._readableStreamController,e),u=!0)}),[i,s]}(this);return h(e)}}function le(e){return new xe(e)}function fe(e,t,r,n=1,a=()=>1){var i=Object.create(ce.prototype);return de(i),We(i,Object.create(Re.prototype),e,t,r,n,a),i}function de(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function he(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function pe(e){return void 0!==e._reader}function ye(f,d,h,p,y,b){const m=le(f),g=A(d);let w=!1,v=Promise.resolve();return new Promise((r,n)=>{let a;if(void 0!==b){if(a=()=>{const e=new DOMException("Aborted","AbortError"),t=[];!1===p&&t.push(()=>"writable"===d._state?x(d,e):Promise.resolve()),!1===y&&t.push(()=>"readable"===f._state?ge(f,e):Promise.resolve()),u(()=>_(t.map(e=>e()),e=>e),!0,e)},!0===b.aborted)return void a();b.addEventListener("abort",a)}if(o(f,m._closedPromise,e=>{!1===p?u(()=>x(d,e),!0,e):c(!0,e)}),o(d,g._closedPromise,e=>{!1===y?u(()=>ge(f,e),!0,e):c(!0,e)}),e=f,t=m._closedPromise,i=()=>{!1===h?u(()=>function(e){var t=e._ownerWritableStream,r=t._state;return!0===j(t)||"closed"===r?Promise.resolve():"errored"===r?Promise.reject(t._storedError):I(e)}(g)):c()},"closed"===e._state?i():t.then(i).catch(k),!0===j(d)||"closed"===d._state){const d=new TypeError("the destination writable stream closed before all data could be piped to it");!1===y?u(()=>ge(f,d),!0,d):c(!0,d)}var e,t,i;function s(){const e=v;return v.then(()=>e!==v?s():void 0)}function o(e,t,r){"errored"===e._state?r(e._storedError):t.catch(r).catch(k)}function u(e,t,r){function n(){e().then(()=>l(t,r),e=>l(!0,e)).catch(k)}!0!==w&&(w=!0,"writable"===d._state&&!1===j(d)?s().then(n):n())}function c(e,t){!0!==w&&(w=!0,"writable"===d._state&&!1===j(d)?s().then(()=>l(e,t)).catch(k):l(e,t))}function l(e,t){z(g),Te(m),void 0!==b&&b.removeEventListener("abort",a),e?n(t):r(void 0)}new Promise((r,n)=>{!function e(t){t?r():(!0===w?Promise.resolve(!0):g._readyPromise.then(()=>Be(m).then(({value:e,done:t})=>!0===t||(v=D(g,e).catch(()=>{}),!1)))).then(e,n)}(!1)}).catch(e=>{v=Promise.resolve(),k(e)})})}function be(r,n){return new Promise((e,t)=>{r._reader._readIntoRequests.push({_resolve:e,_reject:t,_forAuthorCode:n})})}function me(r,n){return new Promise((e,t)=>{r._reader._readRequests.push({_resolve:e,_reject:t,_forAuthorCode:n})})}function ge(e,t){return e._disturbed=!0,"closed"===e._state?Promise.resolve(void 0):"errored"===e._state?Promise.reject(e._storedError):(we(e),e._readableStreamController[oe](t).then(()=>{}))}function we(e){e._state="closed";const t=e._reader;if(void 0!==t){if(Ce(t)){for(const n of t._readRequests){const e=n._resolve;var r=n._forAuthorCode;e(ve(void 0,!0,r))}t._readRequests=[]}gt(t)}}function ve(e,t,r){let n=null;!0===r&&(n=Object.prototype);r=Object.create(n);return Object.defineProperty(r,"value",{value:e,enumerable:!0,writable:!0,configurable:!0}),Object.defineProperty(r,"done",{value:t,enumerable:!0,writable:!0,configurable:!0}),r}function _e(e,t){e._state="errored",e._storedError=t;const r=e._reader;if(void 0!==r){if(Ce(r)){for(const e of r._readRequests)e._reject(t);r._readRequests=[]}else{for(const e of r._readIntoRequests)e._reject(t);r._readIntoRequests=[]}mt(r,t)}}function ke(e,t,r){const n=e._reader._readRequests.shift();n._resolve(ve(t,r,n._forAuthorCode))}function Ae(e){return e._reader._readIntoRequests.length}function Se(e){return e._reader._readRequests.length}function Ee(e){e=e._reader;return void 0!==e&&!!Ke(e)}function Pe(e){e=e._reader;return void 0!==e&&!!Ce(e)}class xe{constructor(e){if(!1===he(e))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===pe(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");je(this,e),this._readRequests=[]}get closed(){return Ce(this)?this._closedPromise:Promise.reject(pt("closed"))}cancel(e){return Ce(this)?void 0===this._ownerReadableStream?Promise.reject(ht("cancel")):Ue(this,e):Promise.reject(pt("cancel"))}read(){return Ce(this)?void 0===this._ownerReadableStream?Promise.reject(ht("read from")):Be(this,!0):Promise.reject(pt("read"))}releaseLock(){if(!Ce(this))throw pt("releaseLock");if(void 0!==this._ownerReadableStream){if(0{if(!(t._pulling=!1)===t._pullAgain)return t._pullAgain=!1,Oe(t)},e=>{qe(t,e)}).catch(k)):t._pullAgain=!0)}function ze(e){var t=e._controlledReadableStream;return!1!==He(e)&&!1!==e._started&&(!0===pe(t)&&0{t._started=!0,Oe(t)},e=>{qe(t,e)}).catch(k)}class Ge{constructor(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}get view(){if(!1===Ye(this))throw _t("view");return this._view}respond(e){if(!1===Ye(this))throw _t("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,t){if(!1===s(t=Number(t)))throw new RangeError("bytesWritten must be a finite");st(e,t)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!1===Ye(this))throw _t("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");e.buffer,function(e,t){const r=e._pendingPullIntos[0];if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,st(e,t.byteLength)}(this._associatedReadableByteStreamController,e)}}class Ve{constructor(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}get byobRequest(){if(!1===Ze(this))throw kt("byobRequest");var e,t,r,n;return void 0===this._byobRequest&&0{!(t._pulling=!1)===t._pullAgain&&(t._pullAgain=!1,$e(t))},e=>{ct(t,e)}).catch(k)):t._pullAgain=!0)}function Je(e){at(e),e._pendingPullIntos=[]}function Xe(e,t){let r=!1;"closed"===e._state&&(r=!0);var n=Qe(t);("default"===t.readerType?ke:function(e,t,r){const n=e._reader._readIntoRequests.shift();n._resolve(ve(t,r,n._forAuthorCode))})(e,n,r)}function Qe(e){var t=e.bytesFilled,r=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,t/r)}function et(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function tt(e,t){const r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,a=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+a,s=i-i%r;let o=a,u=!1;s>n&&(o=s-t.bytesFilled,u=!0);const c=e._queue;for(;0r.byteLength)throw new RangeError("bytesWritten out of range");if(rt(e,t,r),!(r.bytesFilled{r._closedPromise_resolve=e,r._closedPromise_reject=t})}function bt(e,t){yt(e),mt(e,t)}function mt(e,t){e._closedPromise.catch(()=>{}),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function gt(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function wt(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function vt(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function _t(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function kt(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}class At{constructor({highWaterMark:e}){i(this,"highWaterMark",e)}size(e){return e.byteLength}}class St{constructor({highWaterMark:e}){i(this,"highWaterMark",e)}size(){return 1}}class Et{constructor(e={},t={},r={}){var n=t.size;let a=t.highWaterMark;var i=r.size;let s=r.highWaterMark;if(void 0!==e.writableType)throw new RangeError("Invalid writable type specified");var o=g(n);if(void 0===a&&(a=1),a=m(a),void 0!==e.readableType)throw new RangeError("Invalid readable type specified");var u,c,l=g(i);let f;function d(){return c}void 0===s&&(s=0),s=m(s),u=this,c=new Promise(e=>{f=e}),t=a,r=o,n=s,i=l,u._writable=([o,l=1,t=()=>1]=[d,t,r],S(r=Object.create(v.prototype)),F(r,Object.create(N.prototype),o,function(e){return function(r,n){const a=r._transformStreamController;if(!0===r._backpressure){const e=r._backpressureChangePromise;return e.then(()=>{const e=r._writable,t=e._state;if("erroring"===t)throw e._storedError;return Bt(a,n)})}return Bt(a,n)}(u,e)},function(){return function(t){const r=t._readable,e=t._transformStreamController,n=e._flushAlgorithm();return Ut(e),n.then(()=>{if("errored"===r._state)throw r._storedError;const e=r._readableStreamController;!0===He(e)&&Ne(e)}).catch(e=>{throw xt(t,e),r._storedError})}(u)},function(e){return function(e,t){return xt(e,t),Promise.resolve()}(u,e)},l,t),r),u._readable=fe(d,function(){return Kt(e=u,!1),e._backpressureChangePromise;var e},function(e){return Mt(u,e),Promise.resolve()},n,i),u._backpressure=void 0,u._backpressureChangePromise=void 0,u._backpressureChangePromise_resolve=void 0,Kt(u,!0),u._transformStreamController=void 0,function(e,t){const r=Object.create(Ct.prototype);let n=e=>{try{return Tt(r,e),Promise.resolve()}catch(e){return Promise.reject(e)}};const a=t.transform;if(void 0!==a){if("function"!=typeof a)throw new TypeError("transform is not a method");n=e=>b(a,t,[e,r])}var i,s,o=p(t,"flush",0,[r]);i=e,s=r,e=n,o=o,((s._controlledTransformStream=i)._transformStreamController=s)._transformAlgorithm=e,s._flushAlgorithm=o}(this,e);e=y(e,"start",[this._transformStreamController]);f(e)}get readable(){if(!1===Pt(this))throw It("readable");return this._readable}get writable(){if(!1===Pt(this))throw It("writable");return this._writable}}function Pt(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function xt(e,t){qe(e._readable._readableStreamController,t),Mt(e,t)}function Mt(e,t){Ut(e._transformStreamController),W(e._writable._writableStreamController,t),!0===e._backpressure&&Kt(e,!1)}function Kt(t,e){void 0!==t._backpressureChangePromise&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=new Promise(e=>{t._backpressureChangePromise_resolve=e}),t._backpressure=e}class Ct{constructor(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}get desiredSize(){if(!1===jt(this))throw Rt("desiredSize");return Le(this._controlledTransformStream._readable._readableStreamController)}enqueue(e){if(!1===jt(this))throw Rt("enqueue");Tt(this,e)}error(e){if(!1===jt(this))throw Rt("error");xt(this._controlledTransformStream,e)}terminate(){if(!1===jt(this))throw Rt("terminate");var e,t;!0===He(e=(t=(e=this)._controlledTransformStream)._readable._readableStreamController)&&Ne(e),Mt(t,new TypeError("TransformStream terminated"))}}function jt(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Ut(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Tt(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!1===He(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{Fe(n,t)}catch(e){throw Mt(r,e),r._readable._storedError}!0!==ze(n)!==r._backpressure&&Kt(r,!0)}function Bt(t,e){return t._transformAlgorithm(e).catch(e=>{throw xt(t._controlledTransformStream,e),e})}function Rt(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function It(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}var Ot={ReadableStream:ce,WritableStream:v,ByteLengthQueuingStrategy:At,CountQueuingStrategy:St,TransformStream:Et};void 0!==r&&Object.assign(r,Ot),e.ReadableStream=ce,e.WritableStream=v,e.ByteLengthQueuingStrategy=At,e.CountQueuingStrategy=St,e.TransformStream=Et,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof r&&void 0!==t?r:(e=e||self).WebStreamsPolyfill={})}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i,s,a,g,o,u,w,c;r.AES_asm=(c=a=!1,f.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},f.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},f.MAC={CBC:0,GCM:1},f.HEAP_DATA=16384,f);function l(e,t){var r=i[(s[e]+s[t])%255];return r=0===e||0===t?0:r}function n(){function e(e){var t,r,n,a;for(e=i[255-s[a=e]],r=n=e=0===a?0:e,t=0;t<4;t++)n^=r=255&(r<<1|r>>>7);return n^=99}a||function(){i=[],s=[];for(var e,t=1,r=0;r<255;r++)e=128&(i[r]=t),t<<=1,t&=255,128==e&&(t^=27),t^=i[r],s[i[r]]=r;i[255]=i[0],s[0]=0,a=!0}(),g=[],o=[],u=[[],[],[],[]],w=[[],[],[],[]];for(var t=0;t<256;t++){var r=e(t);g[t]=r,o[r]=t,u[0][t]=l(2,r)<<24|r<<16|r<<8|l(3,r),w[0][r]=l(14,t)<<24|l(9,t)<<16|l(13,t)<<8|l(11,t);for(var n=1;n<4;n++)u[n][t]=u[n-1][t]>>>8|u[n-1][t]<<24,w[n][r]=w[n-1][r]>>>8|w[n-1][r]<<24}c=!0}function f(e,t){c||n();var b=new Uint32Array(t);b.set(g,512),b.set(o,768);for(var r=0;r<4;r++)b.set(u[r],4096+1024*r>>2),b.set(w[r],8192+1024*r>>2);var m=function(e,t){"use asm";var b=0,m=0,g=0,w=0,p=0,y=0,v=0,_=0,a=0,i=0,s=0,o=0,u=0,c=0,l=0,f=0,k=0,A=0,S=0,E=0,d=0;var P=new e.Uint32Array(t),h=new e.Uint8Array(t);function x(e,t,r,n,a,i,s,o){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;o=o|0;var u=0,c=0,l=0,f=0,d=0,h=0,p=0,y=0;u=r|0x400,c=r|0x800,l=r|0xc00;a=a^P[(e|0)>>2],i=i^P[(e|4)>>2],s=s^P[(e|8)>>2],o=o^P[(e|12)>>2];for(y=16;(y|0)<=n<<4;y=y+16|0){f=P[(r|a>>22&1020)>>2]^P[(u|i>>14&1020)>>2]^P[(c|s>>6&1020)>>2]^P[(l|o<<2&1020)>>2]^P[(e|y|0)>>2],d=P[(r|i>>22&1020)>>2]^P[(u|s>>14&1020)>>2]^P[(c|o>>6&1020)>>2]^P[(l|a<<2&1020)>>2]^P[(e|y|4)>>2],h=P[(r|s>>22&1020)>>2]^P[(u|o>>14&1020)>>2]^P[(c|a>>6&1020)>>2]^P[(l|i<<2&1020)>>2]^P[(e|y|8)>>2],p=P[(r|o>>22&1020)>>2]^P[(u|a>>14&1020)>>2]^P[(c|i>>6&1020)>>2]^P[(l|s<<2&1020)>>2]^P[(e|y|12)>>2];a=f,i=d,s=h,o=p}b=P[(t|a>>22&1020)>>2]<<24^P[(t|i>>14&1020)>>2]<<16^P[(t|s>>6&1020)>>2]<<8^P[(t|o<<2&1020)>>2]^P[(e|y|0)>>2],m=P[(t|i>>22&1020)>>2]<<24^P[(t|s>>14&1020)>>2]<<16^P[(t|o>>6&1020)>>2]<<8^P[(t|a<<2&1020)>>2]^P[(e|y|4)>>2],g=P[(t|s>>22&1020)>>2]<<24^P[(t|o>>14&1020)>>2]<<16^P[(t|a>>6&1020)>>2]<<8^P[(t|i<<2&1020)>>2]^P[(e|y|8)>>2],w=P[(t|o>>22&1020)>>2]<<24^P[(t|a>>14&1020)>>2]<<16^P[(t|i>>6&1020)>>2]<<8^P[(t|s<<2&1020)>>2]^P[(e|y|12)>>2]}function M(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,e,t,r,n)}function K(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;x(0x0400,0x0c00,0x2000,d,e,n,r,t);a=m,m=w,w=a}function C(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,p^e,y^t,v^r,_^n);p=b,y=m,v=g,_=w}function j(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0;x(0x0400,0x0c00,0x2000,d,e,n,r,t);a=m,m=w,w=a;b=b^p,m=m^y,g=g^v,w=w^_;p=e,y=t,v=r,_=n}function U(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,p,y,v,_);p=b=b^e,y=m=m^t,v=g=g^r,_=w=w^n}function T(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,p,y,v,_);b=b^e,m=m^t,g=g^r,w=w^n;p=e,y=t,v=r,_=n}function B(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,p,y,v,_);p=b,y=m,v=g,_=w;b=b^e,m=m^t,g=g^r,w=w^n}function R(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;x(0x0000,0x0800,0x1000,d,a,i,s,o);o=~f&o|f&o+1;s=~l&s|l&s+((o|0)==0);i=~c&i|c&i+((s|0)==0);a=~u&a|u&a+((i|0)==0);b=b^e;m=m^t;g=g^r;w=w^n}function I(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0,i=0,s=0,o=0,u=0,c=0,l=0,f=0,d=0,h=0;e=e^p,t=t^y,r=r^v,n=n^_;a=k|0,i=A|0,s=S|0,o=E|0;for(;(d|0)<128;d=d+1|0){if(a>>>31)u=u^e,c=c^t,l=l^r,f=f^n;a=a<<1|i>>>31,i=i<<1|s>>>31,s=s<<1|o>>>31,o=o<<1;h=n&1;n=n>>>1|r<<31,r=r>>>1|t<<31,t=t>>>1|e<<31,e=e>>>1;if(h)e=e^0xe1000000}p=u,y=c,v=l,_=f}function r(e){e=e|0;d=e}function O(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;b=e,m=t,g=r,w=n}function z(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;p=e,y=t,v=r,_=n}function D(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;a=e,i=t,s=r,o=n}function N(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;u=e,c=t,l=r,f=n}function F(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;o=~f&o|f&n,s=~l&s|l&r,i=~c&i|c&t,a=~u&a|u&e}function n(e){e=e|0;if(e&15)return-1;h[e|0]=b>>>24,h[e|1]=b>>>16&255,h[e|2]=b>>>8&255,h[e|3]=b&255,h[e|4]=m>>>24,h[e|5]=m>>>16&255,h[e|6]=m>>>8&255,h[e|7]=m&255,h[e|8]=g>>>24,h[e|9]=g>>>16&255,h[e|10]=g>>>8&255,h[e|11]=g&255,h[e|12]=w>>>24,h[e|13]=w>>>16&255,h[e|14]=w>>>8&255,h[e|15]=w&255;return 16}function q(e){e=e|0;if(e&15)return-1;h[e|0]=p>>>24,h[e|1]=p>>>16&255,h[e|2]=p>>>8&255,h[e|3]=p&255,h[e|4]=y>>>24,h[e|5]=y>>>16&255,h[e|6]=y>>>8&255,h[e|7]=y&255,h[e|8]=v>>>24,h[e|9]=v>>>16&255,h[e|10]=v>>>8&255,h[e|11]=v&255,h[e|12]=_>>>24,h[e|13]=_>>>16&255,h[e|14]=_>>>8&255,h[e|15]=_&255;return 16}function L(){M(0,0,0,0);k=b,A=m,S=g,E=w}function H(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){G[e&7](h[t|0]<<24|h[t|1]<<16|h[t|2]<<8|h[t|3],h[t|4]<<24|h[t|5]<<16|h[t|6]<<8|h[t|7],h[t|8]<<24|h[t|9]<<16|h[t|10]<<8|h[t|11],h[t|12]<<24|h[t|13]<<16|h[t|14]<<8|h[t|15]);h[t|0]=b>>>24,h[t|1]=b>>>16&255,h[t|2]=b>>>8&255,h[t|3]=b&255,h[t|4]=m>>>24,h[t|5]=m>>>16&255,h[t|6]=m>>>8&255,h[t|7]=m&255,h[t|8]=g>>>24,h[t|9]=g>>>16&255,h[t|10]=g>>>8&255,h[t|11]=g&255,h[t|12]=w>>>24,h[t|13]=w>>>16&255,h[t|14]=w>>>8&255,h[t|15]=w&255;n=n+16|0,t=t+16|0,r=r-16|0}return n|0}function W(e,t,r){e=e|0;t=t|0;r=r|0;var n=0;if(t&15)return-1;while((r|0)>=16){V[e&1](h[t|0]<<24|h[t|1]<<16|h[t|2]<<8|h[t|3],h[t|4]<<24|h[t|5]<<16|h[t|6]<<8|h[t|7],h[t|8]<<24|h[t|9]<<16|h[t|10]<<8|h[t|11],h[t|12]<<24|h[t|13]<<16|h[t|14]<<8|h[t|15]);n=n+16|0,t=t+16|0,r=r-16|0}return n|0}var G=[M,K,C,j,U,T,B,R];var V=[C,I];return{set_rounds:r,set_state:O,set_iv:z,set_nonce:D,set_mask:N,set_counter:F,get_state:n,get_iv:q,gcm_init:L,cipher:H,mac:W}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},t);return m.set_key=function(e,t,r,n,a,i,s,o,u){var c=b.subarray(0,60),l=b.subarray(256,316);c.set([t,r,n,a,i,s,o,u]);for(var f=e,d=1;f<4*e+28;f++){var h=c[f-1];(f%e==0||8===e&&f%e==4)&&(h=g[h>>>24]<<24^g[h>>>16&255]<<16^g[h>>>8&255]<<8^g[255&h]),f%e==0&&(h=h<<8^h>>>24^d<<24,d=d<<1^(128&d?27:0)),c[f]=c[f-e]^h}for(var p=0;p>>24]]^w[1][g[h>>>16&255]]^w[2][g[h>>>8&255]]^w[3][g[255&h]]}m.set_rounds(e+5)},m}},{}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES=void 0;var p=e("./aes.asm"),y=e("../other/utils"),l=e("../other/errors"),n=[],a=[],e=(i.prototype.acquire_asm=function(){void 0===this.heap&&void 0===this.asm&&(this.heap=n.pop()||(0,y._heap_init)().subarray(p.AES_asm.HEAP_DATA),this.asm=a.pop()||(0,p.AES_asm)(null,this.heap.buffer),this.reset(this.key,this.iv))},i.prototype.release_asm=function(){n.push(this.heap),a.push(this.asm),this.heap=void 0,this.asm=void 0},i.prototype.reset=function(e,t){var r=e.length;if(16!==r&&24!==r&&32!==r)throw new l.IllegalArgumentError("illegal key size");e=new DataView(e.buffer,e.byteOffset,e.byteLength);if(this.asm.set_key(r>>2,e.getUint32(0),e.getUint32(4),e.getUint32(8),e.getUint32(12),16=Math.pow(2,r))throw new s.IllegalArgumentError("illegal counter value");this.asm.set_counter(0,0,t/4294967296|0,0|t)}},u);function u(e,t){e=a.call(this,e,void 0,!1,"CTR")||this;return delete e.padding,e.AES_CTR_set_options(t),e}r.AES_CTR=e},{"../other/errors":14,"../other/utils":15,"./aes":3}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_ECB=void 0;var n,a,i=e("./aes"),s=e("../other/utils"),e=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),e=(a=i.AES,e(o,a),o.encrypt=function(e,t,r){return new o(t,r=void 0===r?!1:r).encrypt(e)},o.decrypt=function(e,t,r){return new o(t,r=void 0===r?!1:r).decrypt(e)},o.prototype.encrypt=function(e){var t=this.AES_Encrypt_process(e),e=this.AES_Encrypt_finish();return(0,s.joinBytes)(t,e)},o.prototype.decrypt=function(e){var t=this.AES_Decrypt_process(e),e=this.AES_Decrypt_finish();return(0,s.joinBytes)(t,e)},o);function o(e,t){return a.call(this,e,void 0,t=void 0===t?!1:t,"ECB")||this}r.AES_ECB=e},{"../other/utils":15,"./aes":3}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AES_GCM=void 0;var n,i,h=e("../other/errors"),p=e("../other/utils"),a=e("./aes"),y=e("./aes.asm"),e=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=68719476704,e=(i=a.AES,e(s,i),s.encrypt=function(e,t,r,n,a){return new s(t,r,n,a).encrypt(e)},s.decrypt=function(e,t,r,n,a){return new s(t,r,n,a).decrypt(e)},s.prototype.encrypt=function(e){return this.AES_GCM_encrypt(e)},s.prototype.decrypt=function(e){return this.AES_GCM_decrypt(e)},s.prototype.AES_GCM_Encrypt_process=function(e){var t,r=0,n=e.length||0,a=this.asm,i=this.heap,s=this.counter,o=this.pos,u=this.len,c=0,l=u+n&-16;if(b<(s-1<<4)+u+n)throw new RangeError("counter overflow");for(var f=new Uint8Array(l);0>>4,c+=t,t>>29,t[4]=a>>>21,t[5]=a>>>13&255,t[6]=a>>>5&255,t[7]=a<<3&255,t[8]=t[9]=t[10]=0,t[11]=r>>>29,t[12]=r>>>21&255,t[13]=r>>>13&255,t[14]=r>>>5&255,t[15]=r<<3&255,e.mac(y.AES_asm.MAC.GCM,y.AES_asm.HEAP_DATA,16),e.get_iv(y.AES_asm.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(y.AES_asm.ENC.CTR,y.AES_asm.HEAP_DATA,16),o.set(t.subarray(0,n),s),this.counter=1,this.pos=0,this.len=0,o},s.prototype.AES_GCM_Decrypt_process=function(e){var t,r=0,n=e.length||0,a=this.asm,i=this.heap,s=this.counter,o=this.tagSize,u=this.pos,c=this.len,l=0,o=o>>4,l+=t,c=u=0;return 0>>29,t[4]=n>>>21,t[5]=n>>>13&255,t[6]=n>>>5&255,t[7]=n<<3&255,t[8]=t[9]=t[10]=0,t[11]=s>>>29,t[12]=s>>>21&255,t[13]=s>>>13&255,t[14]=s>>>5&255,t[15]=s<<3&255,e.mac(y.AES_asm.MAC.GCM,y.AES_asm.HEAP_DATA,16),e.get_iv(y.AES_asm.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(y.AES_asm.ENC.CTR,y.AES_asm.HEAP_DATA,16);for(var f=0,d=0;d>>29,a.heap[12]=e>>>21&255,a.heap[13]=e>>>13&255,a.heap[14]=e>>>5&255,a.heap[15]=e<<3&255,a.asm.mac(y.AES_asm.MAC.GCM,y.AES_asm.HEAP_DATA,16),a.asm.get_iv(y.AES_asm.HEAP_DATA),a.asm.set_iv(0,0,0,0),n.set(a.heap.subarray(0,16))):(n.set(t),n[15]=1);n=new DataView(n.buffer);if(a.gamma0=n.getUint32(12),a.asm.set_nonce(n.getUint32(0),n.getUint32(4),n.getUint32(8),0),a.asm.set_mask(0,0,0,4294967295),void 0!==r){if(r.length>b)throw new h.IllegalArgumentError("illegal adata length");r.length?(a.adata=r,a._gcm_mac_process(r)):a.adata=void 0}else a.adata=void 0;if(a.counter<1||4294967295>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=t+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=r+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=n+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=a+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=i+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=s+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=o+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=u+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=c+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=l+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=f+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=d+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=h+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=p+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;k=y+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=h^u^r^e;A=_<<1|_>>>31;k=A+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=p^c^n^t;S=_<<1|_>>>31;k=S+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=y^l^a^r;E=_<<1|_>>>31;k=E+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=A^f^i^n;P=_<<1|_>>>31;k=P+(b<<5|b>>>27)+v+(m&g|~m&w)+0x5a827999|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=S^d^s^a;x=_<<1|_>>>31;k=x+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=E^h^o^i;M=_<<1|_>>>31;k=M+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=P^p^u^s;K=_<<1|_>>>31;k=K+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=x^y^c^o;C=_<<1|_>>>31;k=C+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=M^A^l^u;j=_<<1|_>>>31;k=j+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=K^S^f^c;U=_<<1|_>>>31;k=U+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=C^E^d^l;T=_<<1|_>>>31;k=T+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=j^P^h^f;B=_<<1|_>>>31;k=B+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=U^x^p^d;R=_<<1|_>>>31;k=R+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=T^M^y^h;I=_<<1|_>>>31;k=I+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=B^K^A^p;O=_<<1|_>>>31;k=O+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=R^C^S^y;z=_<<1|_>>>31;k=z+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=I^j^E^A;D=_<<1|_>>>31;k=D+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=O^U^P^S;N=_<<1|_>>>31;k=N+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=z^T^x^E;F=_<<1|_>>>31;k=F+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=D^B^M^P;q=_<<1|_>>>31;k=q+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=N^R^K^x;L=_<<1|_>>>31;k=L+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=F^I^C^M;H=_<<1|_>>>31;k=H+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=q^O^j^K;W=_<<1|_>>>31;k=W+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=L^z^U^C;G=_<<1|_>>>31;k=G+(b<<5|b>>>27)+v+(m^g^w)+0x6ed9eba1|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=H^D^T^j;V=_<<1|_>>>31;k=V+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=W^N^B^U;Z=_<<1|_>>>31;k=Z+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=G^F^R^T;Y=_<<1|_>>>31;k=Y+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=V^q^I^B;$=_<<1|_>>>31;k=$+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Z^L^O^R;J=_<<1|_>>>31;k=J+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Y^H^z^I;X=_<<1|_>>>31;k=X+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=$^W^D^O;Q=_<<1|_>>>31;k=Q+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=J^G^N^z;ee=_<<1|_>>>31;k=ee+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=X^V^F^D;te=_<<1|_>>>31;k=te+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Q^Z^q^N;re=_<<1|_>>>31;k=re+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ee^Y^L^F;ne=_<<1|_>>>31;k=ne+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=te^$^H^q;ae=_<<1|_>>>31;k=ae+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=re^J^W^L;ie=_<<1|_>>>31;k=ie+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ne^X^G^H;se=_<<1|_>>>31;k=se+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ae^Q^V^W;oe=_<<1|_>>>31;k=oe+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ie^ee^Z^G;ue=_<<1|_>>>31;k=ue+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=se^te^Y^V;ce=_<<1|_>>>31;k=ce+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=oe^re^$^Z;le=_<<1|_>>>31;k=le+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ue^ne^J^Y;fe=_<<1|_>>>31;k=fe+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ce^ae^X^$;de=_<<1|_>>>31;k=de+(b<<5|b>>>27)+v+(m&g|m&w|g&w)-0x70e44324|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=le^ie^Q^J;he=_<<1|_>>>31;k=he+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=fe^se^ee^X;pe=_<<1|_>>>31;k=pe+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=de^oe^te^Q;ye=_<<1|_>>>31;k=ye+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=he^ue^re^ee;be=_<<1|_>>>31;k=be+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=pe^ce^ne^te;me=_<<1|_>>>31;k=me+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ye^le^ae^re;ge=_<<1|_>>>31;k=ge+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=be^fe^ie^ne;we=_<<1|_>>>31;k=we+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=me^de^se^ae;ve=_<<1|_>>>31;k=ve+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ge^he^oe^ie;_e=_<<1|_>>>31;k=_e+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=we^pe^ue^se;ke=_<<1|_>>>31;k=ke+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ve^ye^ce^oe;Ae=_<<1|_>>>31;k=Ae+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=_e^be^le^ue;Se=_<<1|_>>>31;k=Se+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=ke^me^fe^ce;Ee=_<<1|_>>>31;k=Ee+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Ae^ge^de^le;Pe=_<<1|_>>>31;k=Pe+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Se^we^he^fe;xe=_<<1|_>>>31;k=xe+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Ee^ve^pe^de;Me=_<<1|_>>>31;k=Me+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Pe^_e^ye^he;Ke=_<<1|_>>>31;k=Ke+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=xe^ke^be^pe;Ce=_<<1|_>>>31;k=Ce+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Me^Ae^me^ye;je=_<<1|_>>>31;k=je+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;_=Ke^Se^ge^be;Ue=_<<1|_>>>31;k=Ue+(b<<5|b>>>27)+v+(m^g^w)-0x359d3e2a|0;v=w;w=g;g=m<<30|m>>>2;m=b;b=k;Te=Te+b|0;Be=Be+m|0;Re=Re+g|0;Ie=Ie+w|0;Oe=Oe+v|0}function i(e){e=e|0;ze(y[e|0]<<24|y[e|1]<<16|y[e|2]<<8|y[e|3],y[e|4]<<24|y[e|5]<<16|y[e|6]<<8|y[e|7],y[e|8]<<24|y[e|9]<<16|y[e|10]<<8|y[e|11],y[e|12]<<24|y[e|13]<<16|y[e|14]<<8|y[e|15],y[e|16]<<24|y[e|17]<<16|y[e|18]<<8|y[e|19],y[e|20]<<24|y[e|21]<<16|y[e|22]<<8|y[e|23],y[e|24]<<24|y[e|25]<<16|y[e|26]<<8|y[e|27],y[e|28]<<24|y[e|29]<<16|y[e|30]<<8|y[e|31],y[e|32]<<24|y[e|33]<<16|y[e|34]<<8|y[e|35],y[e|36]<<24|y[e|37]<<16|y[e|38]<<8|y[e|39],y[e|40]<<24|y[e|41]<<16|y[e|42]<<8|y[e|43],y[e|44]<<24|y[e|45]<<16|y[e|46]<<8|y[e|47],y[e|48]<<24|y[e|49]<<16|y[e|50]<<8|y[e|51],y[e|52]<<24|y[e|53]<<16|y[e|54]<<8|y[e|55],y[e|56]<<24|y[e|57]<<16|y[e|58]<<8|y[e|59],y[e|60]<<24|y[e|61]<<16|y[e|62]<<8|y[e|63])}function M(e){e=e|0;y[e|0]=Te>>>24;y[e|1]=Te>>>16&255;y[e|2]=Te>>>8&255;y[e|3]=Te&255;y[e|4]=Be>>>24;y[e|5]=Be>>>16&255;y[e|6]=Be>>>8&255;y[e|7]=Be&255;y[e|8]=Re>>>24;y[e|9]=Re>>>16&255;y[e|10]=Re>>>8&255;y[e|11]=Re&255;y[e|12]=Ie>>>24;y[e|13]=Ie>>>16&255;y[e|14]=Ie>>>8&255;y[e|15]=Ie&255;y[e|16]=Oe>>>24;y[e|17]=Oe>>>16&255;y[e|18]=Oe>>>8&255;y[e|19]=Oe&255}function K(){Te=0x67452301;Be=0xefcdab89;Re=0x98badcfe;Ie=0x10325476;Oe=0xc3d2e1f0;b=m=0}function o(e,t,r,n,a,i,s){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;Te=e;Be=t;Re=r;Ie=n;Oe=a;b=i;m=s}function s(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){i(e);e=e+64|0;t=t-64|0;r=r+64|0}b=b+r|0;if(b>>>0>>0)m=m+1|0;return r|0}function c(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=s(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;b=b+t|0;if(b>>>0>>0)m=m+1|0;y[e|t]=0x80;if((t|0)>=56){for(a=t+1|0;(a|0)<64;a=a+1|0)y[e|a]=0x00;i(e);t=0;y[e|0]=0}for(a=t+1|0;(a|0)<59;a=a+1|0)y[e|a]=0;y[e|56]=m>>>21&255;y[e|57]=m>>>13&255;y[e|58]=m>>>5&255;y[e|59]=m<<3&255|b>>>29;y[e|60]=b>>>21&255;y[e|61]=b>>>13&255;y[e|62]=b>>>5&255;y[e|63]=b<<3&255;i(e);if(~r)M(r);return n|0}function C(){Te=g;Be=w;Re=v;Ie=_;Oe=k;b=64;m=0}function j(){Te=A;Be=S;Re=E;Ie=P;Oe=x;b=64;m=0}function U(e,t,r,n,a,i,s,o,u,c,l,f,d,h,p,y){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;o=o|0;u=u|0;c=c|0;l=l|0;f=f|0;d=d|0;h=h|0;p=p|0;y=y|0;K();ze(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,n^0x5c5c5c5c,a^0x5c5c5c5c,i^0x5c5c5c5c,s^0x5c5c5c5c,o^0x5c5c5c5c,u^0x5c5c5c5c,c^0x5c5c5c5c,l^0x5c5c5c5c,f^0x5c5c5c5c,d^0x5c5c5c5c,h^0x5c5c5c5c,p^0x5c5c5c5c,y^0x5c5c5c5c);A=Te;S=Be;E=Re;P=Ie;x=Oe;K();ze(e^0x36363636,t^0x36363636,r^0x36363636,n^0x36363636,a^0x36363636,i^0x36363636,s^0x36363636,o^0x36363636,u^0x36363636,c^0x36363636,l^0x36363636,f^0x36363636,d^0x36363636,h^0x36363636,p^0x36363636,y^0x36363636);g=Te;w=Be;v=Re;_=Ie;k=Oe;b=64;m=0}function T(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0,i=0,s=0,o=0,u=0;if(e&63)return-1;if(~r)if(r&31)return-1;u=c(e,t,-1)|0;n=Te,a=Be,i=Re,s=Ie,o=Oe;j();ze(n,a,i,s,o,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~r)M(r);return u|0}function B(e,t,r,n,a){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;var i=0,s=0,o=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0;if(e&63)return-1;if(~a)if(a&31)return-1;y[e+t|0]=r>>>24;y[e+t+1|0]=r>>>16&255;y[e+t+2|0]=r>>>8&255;y[e+t+3|0]=r&255;T(e,t+4|0,-1)|0;i=l=Te,s=f=Be,o=d=Re,u=h=Ie,c=p=Oe;n=n-1|0;while((n|0)>0){C();ze(l,f,d,h,p,0x80000000,0,0,0,0,0,0,0,0,0,672);l=Te,f=Be,d=Re,h=Ie,p=Oe;j();ze(l,f,d,h,p,0x80000000,0,0,0,0,0,0,0,0,0,672);l=Te,f=Be,d=Re,h=Ie,p=Oe;i=i^Te;s=s^Be;o=o^Re;u=u^Ie;c=c^Oe;n=n-1|0}Te=i;Be=s;Re=o;Ie=u;Oe=c;if(~a)M(a);return 0}return{reset:K,init:o,process:s,finish:c,hmac_reset:C,hmac_init:U,hmac_finish:T,pbkdf2_generate_block:B}}},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Sha1=r._sha1_hash_size=r._sha1_block_size=void 0;var n,a,i=e("./sha1.asm"),s=e("../hash"),e=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=(r._sha1_block_size=64,r._sha1_hash_size=20,a=s.Hash,e(o,a),o.bytes=function(e){return(new o).process(e).finish().result},o.NAME="sha1",o.heap_pool=[],o.asm_pool=[],o.asm_function=i.sha1_asm,o);function o(){var e=null!==a&&a.apply(this,arguments)||this;return e.NAME="sha1",e.BLOCK_SIZE=64,e.HASH_SIZE=20,e}r.Sha1=i},{"../hash":9,"./sha1.asm":10}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.sha256_asm=function(e,t,r){"use asm";var S=0,E=0,P=0,x=0,M=0,K=0,C=0,j=0,b=0,m=0;var g=0,w=0,v=0,_=0,k=0,A=0,U=0,T=0,B=0,R=0,I=0,O=0,z=0,D=0,N=0,F=0;var q=new e.Uint8Array(r);function L(e,t,r,n,a,i,s,o,u,c,l,f,d,h,p,y){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;o=o|0;u=u|0;c=c|0;l=l|0;f=f|0;d=d|0;h=h|0;p=p|0;y=y|0;var b=0,m=0,g=0,w=0,v=0,_=0,k=0,A=0;b=S;m=E;g=P;w=x;v=M;_=K;k=C;A=j;A=e+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0x428a2f98|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;k=t+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0x71374491|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;_=r+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0xb5c0fbcf|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;v=n+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0xe9b5dba5|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;w=a+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x3956c25b|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;g=i+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0x59f111f1|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;m=s+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x923f82a4|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;b=o+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0xab1c5ed5|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;A=u+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0xd807aa98|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;k=c+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0x12835b01|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;_=l+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0x243185be|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;v=f+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0x550c7dc3|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;w=d+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x72be5d74|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;g=h+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0x80deb1fe|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;m=p+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x9bdc06a7|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;b=y+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0xc19bf174|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+e+c|0;A=e+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0xe49b69c1|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+t+l|0;k=t+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0xefbe4786|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;r=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+f|0;_=r+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0x0fc19dc6|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;n=(a>>>7^a>>>18^a>>>3^a<<25^a<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+n+d|0;v=n+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0x240ca1cc|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;a=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+a+h|0;w=a+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x2de92c6f|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;i=(s>>>7^s>>>18^s>>>3^s<<25^s<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+i+p|0;g=i+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0x4a7484aa|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;s=(o>>>7^o>>>18^o>>>3^o<<25^o<<14)+(a>>>17^a>>>19^a>>>10^a<<15^a<<13)+s+y|0;m=s+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x5cb0a9dc|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;o=(u>>>7^u>>>18^u>>>3^u<<25^u<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+o+e|0;b=o+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0x76f988da|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;u=(c>>>7^c>>>18^c>>>3^c<<25^c<<14)+(s>>>17^s>>>19^s>>>10^s<<15^s<<13)+u+t|0;A=u+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0x983e5152|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;c=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(o>>>17^o>>>19^o>>>10^o<<15^o<<13)+c+r|0;k=c+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0xa831c66d|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(u>>>17^u>>>19^u>>>10^u<<15^u<<13)+l+n|0;_=l+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0xb00327c8|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+f+a|0;v=f+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0xbf597fc7|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;d=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+i|0;w=d+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0xc6e00bf3|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+h+s|0;g=h+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0xd5a79147|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+o|0;m=p+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x06ca6351|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;y=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+y+u|0;b=y+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0x14292967|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+e+c|0;A=e+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0x27b70a85|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+t+l|0;k=t+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0x2e1b2138|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;r=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+f|0;_=r+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0x4d2c6dfc|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;n=(a>>>7^a>>>18^a>>>3^a<<25^a<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+n+d|0;v=n+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0x53380d13|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;a=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+a+h|0;w=a+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x650a7354|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;i=(s>>>7^s>>>18^s>>>3^s<<25^s<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+i+p|0;g=i+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0x766a0abb|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;s=(o>>>7^o>>>18^o>>>3^o<<25^o<<14)+(a>>>17^a>>>19^a>>>10^a<<15^a<<13)+s+y|0;m=s+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x81c2c92e|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;o=(u>>>7^u>>>18^u>>>3^u<<25^u<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+o+e|0;b=o+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0x92722c85|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;u=(c>>>7^c>>>18^c>>>3^c<<25^c<<14)+(s>>>17^s>>>19^s>>>10^s<<15^s<<13)+u+t|0;A=u+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0xa2bfe8a1|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;c=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(o>>>17^o>>>19^o>>>10^o<<15^o<<13)+c+r|0;k=c+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0xa81a664b|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(u>>>17^u>>>19^u>>>10^u<<15^u<<13)+l+n|0;_=l+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0xc24b8b70|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+f+a|0;v=f+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0xc76c51a3|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;d=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+i|0;w=d+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0xd192e819|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+h+s|0;g=h+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0xd6990624|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+o|0;m=p+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0xf40e3585|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;y=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+y+u|0;b=y+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0x106aa070|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;e=(t>>>7^t>>>18^t>>>3^t<<25^t<<14)+(p>>>17^p>>>19^p>>>10^p<<15^p<<13)+e+c|0;A=e+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0x19a4c116|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;t=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(y>>>17^y>>>19^y>>>10^y<<15^y<<13)+t+l|0;k=t+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0x1e376c08|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;r=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+r+f|0;_=r+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0x2748774c|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;n=(a>>>7^a>>>18^a>>>3^a<<25^a<<14)+(t>>>17^t>>>19^t>>>10^t<<15^t<<13)+n+d|0;v=n+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0x34b0bcb5|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;a=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+a+h|0;w=a+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x391c0cb3|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;i=(s>>>7^s>>>18^s>>>3^s<<25^s<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+i+p|0;g=i+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0x4ed8aa4a|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;s=(o>>>7^o>>>18^o>>>3^o<<25^o<<14)+(a>>>17^a>>>19^a>>>10^a<<15^a<<13)+s+y|0;m=s+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0x5b9cca4f|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;o=(u>>>7^u>>>18^u>>>3^u<<25^u<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+o+e|0;b=o+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0x682e6ff3|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;u=(c>>>7^c>>>18^c>>>3^c<<25^c<<14)+(s>>>17^s>>>19^s>>>10^s<<15^s<<13)+u+t|0;A=u+A+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(k^v&(_^k))+0x748f82ee|0;w=w+A|0;A=A+(b&m^g&(b^m))+(b>>>2^b>>>13^b>>>22^b<<30^b<<19^b<<10)|0;c=(l>>>7^l>>>18^l>>>3^l<<25^l<<14)+(o>>>17^o>>>19^o>>>10^o<<15^o<<13)+c+r|0;k=c+k+(w>>>6^w>>>11^w>>>25^w<<26^w<<21^w<<7)+(_^w&(v^_))+0x78a5636f|0;g=g+k|0;k=k+(A&b^m&(A^b))+(A>>>2^A>>>13^A>>>22^A<<30^A<<19^A<<10)|0;l=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(u>>>17^u>>>19^u>>>10^u<<15^u<<13)+l+n|0;_=l+_+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(v^g&(w^v))+0x84c87814|0;m=m+_|0;_=_+(k&A^b&(k^A))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+f+a|0;v=f+v+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(w^m&(g^w))+0x8cc70208|0;b=b+v|0;v=v+(_&k^A&(_^k))+(_>>>2^_>>>13^_>>>22^_<<30^_<<19^_<<10)|0;d=(h>>>7^h>>>18^h>>>3^h<<25^h<<14)+(l>>>17^l>>>19^l>>>10^l<<15^l<<13)+d+i|0;w=d+w+(b>>>6^b>>>11^b>>>25^b<<26^b<<21^b<<7)+(g^b&(m^g))+0x90befffa|0;A=A+w|0;w=w+(v&_^k&(v^_))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0;h=(p>>>7^p>>>18^p>>>3^p<<25^p<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+h+s|0;g=h+g+(A>>>6^A>>>11^A>>>25^A<<26^A<<21^A<<7)+(m^A&(b^m))+0xa4506ceb|0;k=k+g|0;g=g+(w&v^_&(w^v))+(w>>>2^w>>>13^w>>>22^w<<30^w<<19^w<<10)|0;p=(y>>>7^y>>>18^y>>>3^y<<25^y<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+p+o|0;m=p+m+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(b^k&(A^b))+0xbef9a3f7|0;_=_+m|0;m=m+(g&w^v&(g^w))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10)|0;y=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(h>>>17^h>>>19^h>>>10^h<<15^h<<13)+y+u|0;b=y+b+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(A^_&(k^A))+0xc67178f2|0;v=v+b|0;b=b+(m&g^w&(m^g))+(m>>>2^m>>>13^m>>>22^m<<30^m<<19^m<<10)|0;S=S+b|0;E=E+m|0;P=P+g|0;x=x+w|0;M=M+v|0;K=K+_|0;C=C+k|0;j=j+A|0}function i(e){e=e|0;L(q[e|0]<<24|q[e|1]<<16|q[e|2]<<8|q[e|3],q[e|4]<<24|q[e|5]<<16|q[e|6]<<8|q[e|7],q[e|8]<<24|q[e|9]<<16|q[e|10]<<8|q[e|11],q[e|12]<<24|q[e|13]<<16|q[e|14]<<8|q[e|15],q[e|16]<<24|q[e|17]<<16|q[e|18]<<8|q[e|19],q[e|20]<<24|q[e|21]<<16|q[e|22]<<8|q[e|23],q[e|24]<<24|q[e|25]<<16|q[e|26]<<8|q[e|27],q[e|28]<<24|q[e|29]<<16|q[e|30]<<8|q[e|31],q[e|32]<<24|q[e|33]<<16|q[e|34]<<8|q[e|35],q[e|36]<<24|q[e|37]<<16|q[e|38]<<8|q[e|39],q[e|40]<<24|q[e|41]<<16|q[e|42]<<8|q[e|43],q[e|44]<<24|q[e|45]<<16|q[e|46]<<8|q[e|47],q[e|48]<<24|q[e|49]<<16|q[e|50]<<8|q[e|51],q[e|52]<<24|q[e|53]<<16|q[e|54]<<8|q[e|55],q[e|56]<<24|q[e|57]<<16|q[e|58]<<8|q[e|59],q[e|60]<<24|q[e|61]<<16|q[e|62]<<8|q[e|63])}function H(e){e=e|0;q[e|0]=S>>>24;q[e|1]=S>>>16&255;q[e|2]=S>>>8&255;q[e|3]=S&255;q[e|4]=E>>>24;q[e|5]=E>>>16&255;q[e|6]=E>>>8&255;q[e|7]=E&255;q[e|8]=P>>>24;q[e|9]=P>>>16&255;q[e|10]=P>>>8&255;q[e|11]=P&255;q[e|12]=x>>>24;q[e|13]=x>>>16&255;q[e|14]=x>>>8&255;q[e|15]=x&255;q[e|16]=M>>>24;q[e|17]=M>>>16&255;q[e|18]=M>>>8&255;q[e|19]=M&255;q[e|20]=K>>>24;q[e|21]=K>>>16&255;q[e|22]=K>>>8&255;q[e|23]=K&255;q[e|24]=C>>>24;q[e|25]=C>>>16&255;q[e|26]=C>>>8&255;q[e|27]=C&255;q[e|28]=j>>>24;q[e|29]=j>>>16&255;q[e|30]=j>>>8&255;q[e|31]=j&255}function W(){S=0x6a09e667;E=0xbb67ae85;P=0x3c6ef372;x=0xa54ff53a;M=0x510e527f;K=0x9b05688c;C=0x1f83d9ab;j=0x5be0cd19;b=m=0}function l(e,t,r,n,a,i,s,o,u,c){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;o=o|0;u=u|0;c=c|0;S=e;E=t;P=r;x=n;M=a;K=i;C=s;j=o;b=u;m=c}function s(e,t){e=e|0;t=t|0;var r=0;if(e&63)return-1;while((t|0)>=64){i(e);e=e+64|0;t=t-64|0;r=r+64|0}b=b+r|0;if(b>>>0>>0)m=m+1|0;return r|0}function d(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0;if(e&63)return-1;if(~r)if(r&31)return-1;if((t|0)>=64){n=s(e,t)|0;if((n|0)==-1)return-1;e=e+n|0;t=t-n|0}n=n+t|0;b=b+t|0;if(b>>>0>>0)m=m+1|0;q[e|t]=0x80;if((t|0)>=56){for(a=t+1|0;(a|0)<64;a=a+1|0)q[e|a]=0x00;i(e);t=0;q[e|0]=0}for(a=t+1|0;(a|0)<59;a=a+1|0)q[e|a]=0;q[e|56]=m>>>21&255;q[e|57]=m>>>13&255;q[e|58]=m>>>5&255;q[e|59]=m<<3&255|b>>>29;q[e|60]=b>>>21&255;q[e|61]=b>>>13&255;q[e|62]=b>>>5&255;q[e|63]=b<<3&255;i(e);if(~r)H(r);return n|0}function G(){S=g;E=w;P=v;x=_;M=k;K=A;C=U;j=T;b=64;m=0}function V(){S=B;E=R;P=I;x=O;M=z;K=D;C=N;j=F;b=64;m=0}function Z(e,t,r,n,a,i,s,o,u,c,l,f,d,h,p,y){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;i=i|0;s=s|0;o=o|0;u=u|0;c=c|0;l=l|0;f=f|0;d=d|0;h=h|0;p=p|0;y=y|0;W();L(e^0x5c5c5c5c,t^0x5c5c5c5c,r^0x5c5c5c5c,n^0x5c5c5c5c,a^0x5c5c5c5c,i^0x5c5c5c5c,s^0x5c5c5c5c,o^0x5c5c5c5c,u^0x5c5c5c5c,c^0x5c5c5c5c,l^0x5c5c5c5c,f^0x5c5c5c5c,d^0x5c5c5c5c,h^0x5c5c5c5c,p^0x5c5c5c5c,y^0x5c5c5c5c);B=S;R=E;I=P;O=x;z=M;D=K;N=C;F=j;W();L(e^0x36363636,t^0x36363636,r^0x36363636,n^0x36363636,a^0x36363636,i^0x36363636,s^0x36363636,o^0x36363636,u^0x36363636,c^0x36363636,l^0x36363636,f^0x36363636,d^0x36363636,h^0x36363636,p^0x36363636,y^0x36363636);g=S;w=E;v=P;_=x;k=M;A=K;U=C;T=j;b=64;m=0}function Y(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,a=0,i=0,s=0,o=0,u=0,c=0,l=0,f=0;if(e&63)return-1;if(~r)if(r&31)return-1;f=d(e,t,-1)|0;n=S,a=E,i=P,s=x,o=M,u=K,c=C,l=j;V();L(n,a,i,s,o,u,c,l,0x80000000,0,0,0,0,0,0,768);if(~r)H(r);return f|0}function $(e,t,r,n,a){e=e|0;t=t|0;r=r|0;n=n|0;a=a|0;var i=0,s=0,o=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,y=0,b=0,m=0,g=0,w=0,v=0;if(e&63)return-1;if(~a)if(a&31)return-1;q[e+t|0]=r>>>24;q[e+t+1|0]=r>>>16&255;q[e+t+2|0]=r>>>8&255;q[e+t+3|0]=r&255;Y(e,t+4|0,-1)|0;i=h=S,s=p=E,o=y=P,u=b=x,c=m=M,l=g=K,f=w=C,d=v=j;n=n-1|0;while((n|0)>0){G();L(h,p,y,b,m,g,w,v,0x80000000,0,0,0,0,0,0,768);h=S,p=E,y=P,b=x,m=M,g=K,w=C,v=j;V();L(h,p,y,b,m,g,w,v,0x80000000,0,0,0,0,0,0,768);h=S,p=E,y=P,b=x,m=M,g=K,w=C,v=j;i=i^S;s=s^E;o=o^P;u=u^x;c=c^M;l=l^K;f=f^C;d=d^j;n=n-1|0}S=i;E=s;P=o;x=u;M=c;K=l;C=f;j=d;if(~a)H(a);return 0}return{reset:W,init:l,process:s,finish:d,hmac_reset:G,hmac_init:Z,hmac_finish:Y,pbkdf2_generate_block:$}}},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Sha256=r._sha256_hash_size=r._sha256_block_size=void 0;var n,a,i=e("./sha256.asm"),s=e("../hash"),e=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=(r._sha256_block_size=64,r._sha256_hash_size=32,a=s.Hash,e(o,a),o.bytes=function(e){return(new o).process(e).finish().result},o.NAME="sha256",o.heap_pool=[],o.asm_pool=[],o.asm_function=i.sha256_asm,o);function o(){var e=null!==a&&a.apply(this,arguments)||this;return e.NAME="sha256",e.BLOCK_SIZE=64,e.HASH_SIZE=32,e}r.Sha256=i},{"../hash":9,"./sha256.asm":12}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a,i=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=(a=Error,i(o,a),o);function o(){for(var e=[],t=0;t>1),n=0;n>1]=parseInt(e.substr(n,2),16);return r},r.base64_to_bytes=function(e){return i(n(e))},r.bytes_to_string=s,r.bytes_to_hex=function(e){for(var t="",r=0;r>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+=1},r.is_number=function(e){return"number"==typeof e},r.is_string=function(e){return"string"==typeof e},r.is_buffer=function(e){return e instanceof ArrayBuffer},r.is_bytes=function(e){return e instanceof Uint8Array},r.is_typed_array=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},r._heap_init=function(e,t){t=e?e.byteLength:t||65536;if(4095&t||t<=0)throw new Error("heap size must be a positive integer and a multiple of 4096");return e=e||new Uint8Array(new ArrayBuffer(t))},r._heap_write=function(e,t,r,n,a){var i=e.length-t,a=i=r)throw new Error("Malformed string, low surrogate expected at position "+a);s=(55296^s)<<10|65536|56320^e.charCodeAt(a)}else if(!t&&s>>>8)throw new Error("Wide characters are not allowed.");!t||s<=127?n[i++]=s:(s<=2047?n[i++]=192|s>>6:(s<=65535?n[i++]=224|s>>12:(n[i++]=240|s>>18,n[i++]=128|s>>12&63),n[i++]=128|s>>6&63),n[i++]=128|63&s)}return n.subarray(0,i)}function s(e,t){void 0===t&&(t=!1);for(var r=e.length,n=new Array(r),a=0,i=0;a>10,n[i++]=56320|1023&s)}}for(var o="",a=0;a>>26-s&67108863,26<=(s+=24)&&(s-=26,n++);else if("le"===r)for(n=i=0;i>>26-s&67108863,26<=(s+=24)&&(s-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r,n=0;n>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);n+6!==t&&(r=s(e,t,n+6),this.words[i]|=r<>>26-a&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var n=0,a=this.length=1;a<=67108863;a*=t)n++;for(var a=a/t|0,i=e.length-r,s=i%--n,o=Math.min(i,i-s)+r,u=0,c=r;c"};var d=["","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"],h=[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],p=[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];function a(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0,n=(r.length=n)-1|0,a=(s=(0|e.words[0])*(0|t.words[0]))/67108864|0;r.words[0]=67108863&s;for(var i=1;i>>26,u=67108863&a,c=Math.min(i,t.length-1),l=Math.max(0,i-e.length+1);l<=c;l++)o+=(s=(0|e.words[i-l|0])*(0|t.words[l])+u)/67108864|0,u=67108863&s;r.words[i]=0|u,a=0|o}return 0!==a?r.words[i]=0|a:r.length--,r.strip()}b.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){o="";for(var r=0,n=0,a=0;a>>24-r&16777215)||a!==this.length-1?d[6-s.length]+s+o:s+o;26<=(r+=2)&&(r-=26,a--)}for(0!==n&&(o=n.toString(16)+o);o.length%t!=0;)o="0"+o;return o=0!==this.negative?"-"+o:o}if(e===(0|e)&&2<=e&&e<=36){var u=h[e],c=p[e];for(o="",(l=this.clone()).negative=0;!l.isZero();){var l,f=l.modn(c).toString(e);o=(l=l.idivn(c)).isZero()?f+o:d[u-f.length]+f+o}for(this.isZero()&&(o="0"+o);o.length%t!=0;)o="0"+o;return o=0!==this.negative?"-"+o:o}y(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(e+=7,t>>>=7),8<=t&&(e+=4,t>>>=4),2<=t&&(e+=2,t>>>=2),e+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,e=0;return 0==(8191&t)&&(e+=13,t>>>=13),0==(127&t)&&(e+=7,t>>>=7),0==(15&t)&&(e+=4,t>>>=4),0==(3&t)&&(e+=2,t>>>=2),0==(1&t)&&e++,e},b.prototype.bitLength=function(){var e=this.words[this.length-1],e=this._countBits(e);return 26*(this.length-1)+e},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,r=0;re.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){for(var t,r=this.length>e.length?(t=this,e):(t=e,this),n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){y("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),e=e%26;this._expand(t),0>26-e),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){y("number"==typeof e&&0<=e);var r=e/26|0,e=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this),a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;for(var a=0>26,this.words[s]=67108863&t;for(;0!==i&&s>26,this.words[s]=67108863&t;if(0===i&&s>>13,c=0|n[1],l=8191&c,f=c>>>13,d=0|n[2],h=8191&d,p=d>>>13,y=0|n[3],b=8191&y,m=y>>>13,g=0|n[4],w=8191&g,v=g>>>13,_=0|n[5],k=8191&_,A=_>>>13,S=0|n[6],E=8191&S,P=S>>>13,x=0|n[7],M=8191&x,K=x>>>13,C=0|n[8],j=8191&C,U=C>>>13,T=0|n[9],B=8191&T,R=T>>>13,I=0|a[0],O=8191&I,z=I>>>13,D=0|a[1],N=8191&D,F=D>>>13,q=0|a[2],L=8191&q,H=q>>>13,W=0|a[3],G=8191&W,V=W>>>13,Z=0|a[4],Y=8191&Z,$=Z>>>13,J=0|a[5],X=8191&J,Q=J>>>13,s=0|a[6],c=8191&s,d=s>>>13,y=0|a[7],g=8191&y,_=y>>>13,S=0|a[8],x=8191&S,C=S>>>13,n=0|a[9],T=8191&n,I=n>>>13;r.negative=e.negative^t.negative,r.length=19;var W=(0+Math.imul(o,O)|0)+((8191&(q=(q=Math.imul(o,z))+Math.imul(u,O)|0))<<13)|0,ee=((Z=Math.imul(u,z))+(q>>>13)|0)+(W>>>26)|0;W&=67108863,D=Math.imul(l,O),q=(q=Math.imul(l,z))+Math.imul(f,O)|0,Z=Math.imul(f,z);J=(ee+(D+Math.imul(o,N)|0)|0)+((8191&(q=(q=q+Math.imul(o,F)|0)+Math.imul(u,N)|0))<<13)|0;ee=((Z=Z+Math.imul(u,F)|0)+(q>>>13)|0)+(J>>>26)|0,J&=67108863,D=Math.imul(h,O),q=(q=Math.imul(h,z))+Math.imul(p,O)|0,Z=Math.imul(p,z),D=D+Math.imul(l,N)|0,q=(q=q+Math.imul(l,F)|0)+Math.imul(f,N)|0,Z=Z+Math.imul(f,F)|0;s=(ee+(D+Math.imul(o,L)|0)|0)+((8191&(q=(q=q+Math.imul(o,H)|0)+Math.imul(u,L)|0))<<13)|0;ee=((Z=Z+Math.imul(u,H)|0)+(q>>>13)|0)+(s>>>26)|0,s&=67108863,D=Math.imul(b,O),q=(q=Math.imul(b,z))+Math.imul(m,O)|0,Z=Math.imul(m,z),D=D+Math.imul(h,N)|0,q=(q=q+Math.imul(h,F)|0)+Math.imul(p,N)|0,Z=Z+Math.imul(p,F)|0,D=D+Math.imul(l,L)|0,q=(q=q+Math.imul(l,H)|0)+Math.imul(f,L)|0,Z=Z+Math.imul(f,H)|0;y=(ee+(D+Math.imul(o,G)|0)|0)+((8191&(q=(q=q+Math.imul(o,V)|0)+Math.imul(u,G)|0))<<13)|0;ee=((Z=Z+Math.imul(u,V)|0)+(q>>>13)|0)+(y>>>26)|0,y&=67108863,D=Math.imul(w,O),q=(q=Math.imul(w,z))+Math.imul(v,O)|0,Z=Math.imul(v,z),D=D+Math.imul(b,N)|0,q=(q=q+Math.imul(b,F)|0)+Math.imul(m,N)|0,Z=Z+Math.imul(m,F)|0,D=D+Math.imul(h,L)|0,q=(q=q+Math.imul(h,H)|0)+Math.imul(p,L)|0,Z=Z+Math.imul(p,H)|0,D=D+Math.imul(l,G)|0,q=(q=q+Math.imul(l,V)|0)+Math.imul(f,G)|0,Z=Z+Math.imul(f,V)|0;S=(ee+(D+Math.imul(o,Y)|0)|0)+((8191&(q=(q=q+Math.imul(o,$)|0)+Math.imul(u,Y)|0))<<13)|0;ee=((Z=Z+Math.imul(u,$)|0)+(q>>>13)|0)+(S>>>26)|0,S&=67108863,D=Math.imul(k,O),q=(q=Math.imul(k,z))+Math.imul(A,O)|0,Z=Math.imul(A,z),D=D+Math.imul(w,N)|0,q=(q=q+Math.imul(w,F)|0)+Math.imul(v,N)|0,Z=Z+Math.imul(v,F)|0,D=D+Math.imul(b,L)|0,q=(q=q+Math.imul(b,H)|0)+Math.imul(m,L)|0,Z=Z+Math.imul(m,H)|0,D=D+Math.imul(h,G)|0,q=(q=q+Math.imul(h,V)|0)+Math.imul(p,G)|0,Z=Z+Math.imul(p,V)|0,D=D+Math.imul(l,Y)|0,q=(q=q+Math.imul(l,$)|0)+Math.imul(f,Y)|0,Z=Z+Math.imul(f,$)|0;a=(ee+(D+Math.imul(o,X)|0)|0)+((8191&(q=(q=q+Math.imul(o,Q)|0)+Math.imul(u,X)|0))<<13)|0;ee=((Z=Z+Math.imul(u,Q)|0)+(q>>>13)|0)+(a>>>26)|0,a&=67108863,D=Math.imul(E,O),q=(q=Math.imul(E,z))+Math.imul(P,O)|0,Z=Math.imul(P,z),D=D+Math.imul(k,N)|0,q=(q=q+Math.imul(k,F)|0)+Math.imul(A,N)|0,Z=Z+Math.imul(A,F)|0,D=D+Math.imul(w,L)|0,q=(q=q+Math.imul(w,H)|0)+Math.imul(v,L)|0,Z=Z+Math.imul(v,H)|0,D=D+Math.imul(b,G)|0,q=(q=q+Math.imul(b,V)|0)+Math.imul(m,G)|0,Z=Z+Math.imul(m,V)|0,D=D+Math.imul(h,Y)|0,q=(q=q+Math.imul(h,$)|0)+Math.imul(p,Y)|0,Z=Z+Math.imul(p,$)|0,D=D+Math.imul(l,X)|0,q=(q=q+Math.imul(l,Q)|0)+Math.imul(f,X)|0,Z=Z+Math.imul(f,Q)|0;n=(ee+(D+Math.imul(o,c)|0)|0)+((8191&(q=(q=q+Math.imul(o,d)|0)+Math.imul(u,c)|0))<<13)|0;ee=((Z=Z+Math.imul(u,d)|0)+(q>>>13)|0)+(n>>>26)|0,n&=67108863,D=Math.imul(M,O),q=(q=Math.imul(M,z))+Math.imul(K,O)|0,Z=Math.imul(K,z),D=D+Math.imul(E,N)|0,q=(q=q+Math.imul(E,F)|0)+Math.imul(P,N)|0,Z=Z+Math.imul(P,F)|0,D=D+Math.imul(k,L)|0,q=(q=q+Math.imul(k,H)|0)+Math.imul(A,L)|0,Z=Z+Math.imul(A,H)|0,D=D+Math.imul(w,G)|0,q=(q=q+Math.imul(w,V)|0)+Math.imul(v,G)|0,Z=Z+Math.imul(v,V)|0,D=D+Math.imul(b,Y)|0,q=(q=q+Math.imul(b,$)|0)+Math.imul(m,Y)|0,Z=Z+Math.imul(m,$)|0,D=D+Math.imul(h,X)|0,q=(q=q+Math.imul(h,Q)|0)+Math.imul(p,X)|0,Z=Z+Math.imul(p,Q)|0,D=D+Math.imul(l,c)|0,q=(q=q+Math.imul(l,d)|0)+Math.imul(f,c)|0,Z=Z+Math.imul(f,d)|0;e=(ee+(D+Math.imul(o,g)|0)|0)+((8191&(q=(q=q+Math.imul(o,_)|0)+Math.imul(u,g)|0))<<13)|0;ee=((Z=Z+Math.imul(u,_)|0)+(q>>>13)|0)+(e>>>26)|0,e&=67108863,D=Math.imul(j,O),q=(q=Math.imul(j,z))+Math.imul(U,O)|0,Z=Math.imul(U,z),D=D+Math.imul(M,N)|0,q=(q=q+Math.imul(M,F)|0)+Math.imul(K,N)|0,Z=Z+Math.imul(K,F)|0,D=D+Math.imul(E,L)|0,q=(q=q+Math.imul(E,H)|0)+Math.imul(P,L)|0,Z=Z+Math.imul(P,H)|0,D=D+Math.imul(k,G)|0,q=(q=q+Math.imul(k,V)|0)+Math.imul(A,G)|0,Z=Z+Math.imul(A,V)|0,D=D+Math.imul(w,Y)|0,q=(q=q+Math.imul(w,$)|0)+Math.imul(v,Y)|0,Z=Z+Math.imul(v,$)|0,D=D+Math.imul(b,X)|0,q=(q=q+Math.imul(b,Q)|0)+Math.imul(m,X)|0,Z=Z+Math.imul(m,Q)|0,D=D+Math.imul(h,c)|0,q=(q=q+Math.imul(h,d)|0)+Math.imul(p,c)|0,Z=Z+Math.imul(p,d)|0,D=D+Math.imul(l,g)|0,q=(q=q+Math.imul(l,_)|0)+Math.imul(f,g)|0,Z=Z+Math.imul(f,_)|0;t=(ee+(D+Math.imul(o,x)|0)|0)+((8191&(q=(q=q+Math.imul(o,C)|0)+Math.imul(u,x)|0))<<13)|0;ee=((Z=Z+Math.imul(u,C)|0)+(q>>>13)|0)+(t>>>26)|0,t&=67108863,D=Math.imul(B,O),q=(q=Math.imul(B,z))+Math.imul(R,O)|0,Z=Math.imul(R,z),D=D+Math.imul(j,N)|0,q=(q=q+Math.imul(j,F)|0)+Math.imul(U,N)|0,Z=Z+Math.imul(U,F)|0,D=D+Math.imul(M,L)|0,q=(q=q+Math.imul(M,H)|0)+Math.imul(K,L)|0,Z=Z+Math.imul(K,H)|0,D=D+Math.imul(E,G)|0,q=(q=q+Math.imul(E,V)|0)+Math.imul(P,G)|0,Z=Z+Math.imul(P,V)|0,D=D+Math.imul(k,Y)|0,q=(q=q+Math.imul(k,$)|0)+Math.imul(A,Y)|0,Z=Z+Math.imul(A,$)|0,D=D+Math.imul(w,X)|0,q=(q=q+Math.imul(w,Q)|0)+Math.imul(v,X)|0,Z=Z+Math.imul(v,Q)|0,D=D+Math.imul(b,c)|0,q=(q=q+Math.imul(b,d)|0)+Math.imul(m,c)|0,Z=Z+Math.imul(m,d)|0,D=D+Math.imul(h,g)|0,q=(q=q+Math.imul(h,_)|0)+Math.imul(p,g)|0,Z=Z+Math.imul(p,_)|0,D=D+Math.imul(l,x)|0,q=(q=q+Math.imul(l,C)|0)+Math.imul(f,x)|0,Z=Z+Math.imul(f,C)|0;o=(ee+(D+Math.imul(o,T)|0)|0)+((8191&(q=(q=q+Math.imul(o,I)|0)+Math.imul(u,T)|0))<<13)|0;ee=((Z=Z+Math.imul(u,I)|0)+(q>>>13)|0)+(o>>>26)|0,o&=67108863,D=Math.imul(B,N),q=(q=Math.imul(B,F))+Math.imul(R,N)|0,Z=Math.imul(R,F),D=D+Math.imul(j,L)|0,q=(q=q+Math.imul(j,H)|0)+Math.imul(U,L)|0,Z=Z+Math.imul(U,H)|0,D=D+Math.imul(M,G)|0,q=(q=q+Math.imul(M,V)|0)+Math.imul(K,G)|0,Z=Z+Math.imul(K,V)|0,D=D+Math.imul(E,Y)|0,q=(q=q+Math.imul(E,$)|0)+Math.imul(P,Y)|0,Z=Z+Math.imul(P,$)|0,D=D+Math.imul(k,X)|0,q=(q=q+Math.imul(k,Q)|0)+Math.imul(A,X)|0,Z=Z+Math.imul(A,Q)|0,D=D+Math.imul(w,c)|0,q=(q=q+Math.imul(w,d)|0)+Math.imul(v,c)|0,Z=Z+Math.imul(v,d)|0,D=D+Math.imul(b,g)|0,q=(q=q+Math.imul(b,_)|0)+Math.imul(m,g)|0,Z=Z+Math.imul(m,_)|0,D=D+Math.imul(h,x)|0,q=(q=q+Math.imul(h,C)|0)+Math.imul(p,x)|0,Z=Z+Math.imul(p,C)|0;l=(ee+(D+Math.imul(l,T)|0)|0)+((8191&(q=(q=q+Math.imul(l,I)|0)+Math.imul(f,T)|0))<<13)|0;ee=((Z=Z+Math.imul(f,I)|0)+(q>>>13)|0)+(l>>>26)|0,l&=67108863,D=Math.imul(B,L),q=(q=Math.imul(B,H))+Math.imul(R,L)|0,Z=Math.imul(R,H),D=D+Math.imul(j,G)|0,q=(q=q+Math.imul(j,V)|0)+Math.imul(U,G)|0,Z=Z+Math.imul(U,V)|0,D=D+Math.imul(M,Y)|0,q=(q=q+Math.imul(M,$)|0)+Math.imul(K,Y)|0,Z=Z+Math.imul(K,$)|0,D=D+Math.imul(E,X)|0,q=(q=q+Math.imul(E,Q)|0)+Math.imul(P,X)|0,Z=Z+Math.imul(P,Q)|0,D=D+Math.imul(k,c)|0,q=(q=q+Math.imul(k,d)|0)+Math.imul(A,c)|0,Z=Z+Math.imul(A,d)|0,D=D+Math.imul(w,g)|0,q=(q=q+Math.imul(w,_)|0)+Math.imul(v,g)|0,Z=Z+Math.imul(v,_)|0,D=D+Math.imul(b,x)|0,q=(q=q+Math.imul(b,C)|0)+Math.imul(m,x)|0,Z=Z+Math.imul(m,C)|0;h=(ee+(D+Math.imul(h,T)|0)|0)+((8191&(q=(q=q+Math.imul(h,I)|0)+Math.imul(p,T)|0))<<13)|0;ee=((Z=Z+Math.imul(p,I)|0)+(q>>>13)|0)+(h>>>26)|0,h&=67108863,D=Math.imul(B,G),q=(q=Math.imul(B,V))+Math.imul(R,G)|0,Z=Math.imul(R,V),D=D+Math.imul(j,Y)|0,q=(q=q+Math.imul(j,$)|0)+Math.imul(U,Y)|0,Z=Z+Math.imul(U,$)|0,D=D+Math.imul(M,X)|0,q=(q=q+Math.imul(M,Q)|0)+Math.imul(K,X)|0,Z=Z+Math.imul(K,Q)|0,D=D+Math.imul(E,c)|0,q=(q=q+Math.imul(E,d)|0)+Math.imul(P,c)|0,Z=Z+Math.imul(P,d)|0,D=D+Math.imul(k,g)|0,q=(q=q+Math.imul(k,_)|0)+Math.imul(A,g)|0,Z=Z+Math.imul(A,_)|0,D=D+Math.imul(w,x)|0,q=(q=q+Math.imul(w,C)|0)+Math.imul(v,x)|0,Z=Z+Math.imul(v,C)|0;b=(ee+(D+Math.imul(b,T)|0)|0)+((8191&(q=(q=q+Math.imul(b,I)|0)+Math.imul(m,T)|0))<<13)|0;ee=((Z=Z+Math.imul(m,I)|0)+(q>>>13)|0)+(b>>>26)|0,b&=67108863,D=Math.imul(B,Y),q=(q=Math.imul(B,$))+Math.imul(R,Y)|0,Z=Math.imul(R,$),D=D+Math.imul(j,X)|0,q=(q=q+Math.imul(j,Q)|0)+Math.imul(U,X)|0,Z=Z+Math.imul(U,Q)|0,D=D+Math.imul(M,c)|0,q=(q=q+Math.imul(M,d)|0)+Math.imul(K,c)|0,Z=Z+Math.imul(K,d)|0,D=D+Math.imul(E,g)|0,q=(q=q+Math.imul(E,_)|0)+Math.imul(P,g)|0,Z=Z+Math.imul(P,_)|0,D=D+Math.imul(k,x)|0,q=(q=q+Math.imul(k,C)|0)+Math.imul(A,x)|0,Z=Z+Math.imul(A,C)|0;w=(ee+(D+Math.imul(w,T)|0)|0)+((8191&(q=(q=q+Math.imul(w,I)|0)+Math.imul(v,T)|0))<<13)|0;ee=((Z=Z+Math.imul(v,I)|0)+(q>>>13)|0)+(w>>>26)|0,w&=67108863,D=Math.imul(B,X),q=(q=Math.imul(B,Q))+Math.imul(R,X)|0,Z=Math.imul(R,Q),D=D+Math.imul(j,c)|0,q=(q=q+Math.imul(j,d)|0)+Math.imul(U,c)|0,Z=Z+Math.imul(U,d)|0,D=D+Math.imul(M,g)|0,q=(q=q+Math.imul(M,_)|0)+Math.imul(K,g)|0,Z=Z+Math.imul(K,_)|0,D=D+Math.imul(E,x)|0,q=(q=q+Math.imul(E,C)|0)+Math.imul(P,x)|0,Z=Z+Math.imul(P,C)|0;k=(ee+(D+Math.imul(k,T)|0)|0)+((8191&(q=(q=q+Math.imul(k,I)|0)+Math.imul(A,T)|0))<<13)|0;ee=((Z=Z+Math.imul(A,I)|0)+(q>>>13)|0)+(k>>>26)|0,k&=67108863,D=Math.imul(B,c),q=(q=Math.imul(B,d))+Math.imul(R,c)|0,Z=Math.imul(R,d),D=D+Math.imul(j,g)|0,q=(q=q+Math.imul(j,_)|0)+Math.imul(U,g)|0,Z=Z+Math.imul(U,_)|0,D=D+Math.imul(M,x)|0,q=(q=q+Math.imul(M,C)|0)+Math.imul(K,x)|0,Z=Z+Math.imul(K,C)|0;E=(ee+(D+Math.imul(E,T)|0)|0)+((8191&(q=(q=q+Math.imul(E,I)|0)+Math.imul(P,T)|0))<<13)|0;ee=((Z=Z+Math.imul(P,I)|0)+(q>>>13)|0)+(E>>>26)|0,E&=67108863,D=Math.imul(B,g),q=(q=Math.imul(B,_))+Math.imul(R,g)|0,Z=Math.imul(R,_),D=D+Math.imul(j,x)|0,q=(q=q+Math.imul(j,C)|0)+Math.imul(U,x)|0,Z=Z+Math.imul(U,C)|0;M=(ee+(D+Math.imul(M,T)|0)|0)+((8191&(q=(q=q+Math.imul(M,I)|0)+Math.imul(K,T)|0))<<13)|0;ee=((Z=Z+Math.imul(K,I)|0)+(q>>>13)|0)+(M>>>26)|0,M&=67108863,D=Math.imul(B,x),q=(q=Math.imul(B,C))+Math.imul(R,x)|0,Z=Math.imul(R,C);j=(ee+(D+Math.imul(j,T)|0)|0)+((8191&(q=(q=q+Math.imul(j,I)|0)+Math.imul(U,T)|0))<<13)|0;ee=((Z=Z+Math.imul(U,I)|0)+(q>>>13)|0)+(j>>>26)|0,j&=67108863;T=(ee+Math.imul(B,T)|0)+((8191&(q=(q=Math.imul(B,I))+Math.imul(R,T)|0))<<13)|0;return ee=((Z=Math.imul(R,I))+(q>>>13)|0)+(T>>>26)|0,T&=67108863,i[0]=W,i[1]=J,i[2]=s,i[3]=y,i[4]=S,i[5]=a,i[6]=n,i[7]=e,i[8]=t,i[9]=o,i[10]=l,i[11]=h,i[12]=b,i[13]=w,i[14]=k,i[15]=E,i[16]=M,i[17]=j,i[18]=T,0!=ee&&(i[19]=ee,r.length++),r};function o(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(i=a),b.prototype.mulTo=function(e,t){var r=this.length+e.length,t=(10===this.length&&10===e.length?i:r<63?a:r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}r.words[i]=o,n=s,s=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}:o)(this,e,t);return t},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,n=0;n>=1;return n},u.prototype.permute=function(e,t,r,n,a,i){for(var s=0;s>>=1)r++;return 1<>>=13),a>>>=13;for(i=2*t;i>=26,t+=n/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,n=0;n>>26-t<<26-t;if(0!=t){for(var a=0,i=0;i>>26-t}a&&(this.words[i]=a,this.length++)}if(0!=r){for(i=this.length-1;0<=i;i--)this.words[i+r]=this.words[i];for(i=0;i>>a<i)for(this.length-=i,u=0;u>>a,c=l&s}return o&&0!==c&&(o.words[o.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return y(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){y("number"==typeof e&&0<=e);var t=e%26,e=(e-t)/26;return!(this.length<=e)&&!!(this.words[e]&1<>>t<>26)-(o/67108864|0);this.words[i+r]=67108863&s}for(;i>26,this.words[i+r]=67108863&s;if(0===a)return this.strip();for(y(-1===a),i=a=0;i>26,this.words[i]=67108863&s;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),a=e,i=0|a.words[a.length-1];0!=(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var s,o=n.length-a.length;if("mod"!==t){(s=new b(null)).length=1+o,s.words=new Array(s.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),e=e.andln(1),n=r.cmp(n);return n<0||1===e&&0===n?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){y(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;0<=n;n--)r=(t*r+(0|this.words[n]))%e;return r},b.prototype.idivn=function(e){y(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){y(0===e.negative),y(!e.isZero());for(var t=this,r=e.clone(),t=0!==t.negative?t.umod(e):t.clone(),n=new b(1),a=new b(0),i=new b(0),s=new b(1),o=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++o;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26;a&=67108863,this.words[n]=a}return 0!==r&&(this.words[n]=r,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t=e<0;return 0===this.negative||t?0===this.negative&&t?1:(this.strip(),e=1e.length)return 1;if(this.lengththis.n;);e=t>>22,a=i}0===(e.words[n-10]=a>>>=22)&&10>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new g;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new v}return c[e]=t},_.prototype._verify1=function(e){y(0===e.negative,"red works only with positives"),y(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){y(0==(e.negative|t.negative),"red works only with positives"),y(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return(this.prime?this.prime.ireduce(e):e.umod(this.m))._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);t=e.add(t);return 0<=t.cmp(this.m)&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);t=e.iadd(t);return 0<=t.cmp(this.m)&&t.isub(this.m),t},_.prototype.sub=function(e,t){this._verify2(e,t);t=e.sub(t);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);t=e.isub(t);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(y(t%2==1),3===t){t=this.m.add(new b(1)).iushrn(2);return this.pow(e,t)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);y(!r.isZero());for(var a=new b(1).toRed(this),i=a.redNeg(),s=this.m.subn(1).iushrn(1),o=new b(2*(o=this.m.bitLength())*o).toRed(this);0!==this.pow(o,s).cmp(i);)o.redIAdd(i);for(var u=this.pow(o,r),c=this.pow(e,r.addn(1).iushrn(1)),l=this.pow(e,r),f=n;0!==l.cmp(a);){for(var d=l,h=0;0!==d.cmp(a);h++)d=d.redSqr();y(h>c&1;a!==r[0]&&(a=this.sqr(a)),0!=l||0!==i?(i<<=1,i|=l,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[i]),i=s=0)):s=0}o=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){e=e.clone();return e.red=null,e},b.mont=function(e){return new k(e)},r(k,_),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){e=this.imod(e.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;e=e.imul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);e=e.mul(t),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=e.isub(t).iushrn(this.shift),t=e;return 0<=e.cmp(this.m)?t=e.isub(this.m):e.cmpn(0)<0&&(t=e.iadd(this.m)),t._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:"buffer"}],17:[function(e,t,r){var n;function a(e){this.rand=e}if(t.exports=function(e){return(n=n||new a(null)).generate(e)},(t.exports.Rand=a).prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>1]):s.mixedAdd(a[-u-1>>1].neg()):0>1]):s.add(a[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},i.prototype._wnafMulAdd=function(e,t,r,n,a){for(var i=this._wnafT1,s=this._wnafT2,o=this._wnafT3,u=0,c=0;c>1]:S<0&&(A=s[b][-S-1>>1].neg()),w="affine"===A.type?w.mixedAdd(A):w.add(A))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=(r=this.z.redSqr()).redIAdd(r),n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),e=i.redSub(r),r=n.redSub(t),n=a.redMul(e),t=i.redMul(r),r=a.redMul(r),i=e.redMul(i);return this.curve.point(n,t,i,r)},c.prototype._projDbl=function(){var e,t,r,n,a,i,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),u=this.y.redSqr();return i=this.curve.twisted?(e=(n=this.curve._mulA(o)).redAdd(u),this.zOne?(t=s.redSub(o).redSub(u).redMul(e.redSub(this.curve.two)),r=e.redMul(n.redSub(u)),e.redSqr().redSub(e).redSub(e)):(a=this.z.redSqr(),i=e.redSub(a).redISub(a),t=s.redSub(o).redISub(u).redMul(i),r=e.redMul(n.redSub(u)),e.redMul(i))):(n=o.redAdd(u),a=this.curve._mulC(this.z).redSqr(),i=n.redSub(a).redSub(a),t=this.curve._mulC(s.redISub(n)).redMul(i),r=this.curve._mulC(n).redMul(o.redISub(u)),n.redMul(i)),this.curve.point(t,r,i)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),e=a.redSub(n),a=a.redAdd(n),n=r.redAdd(t),r=i.redMul(e),t=a.redMul(n),n=i.redMul(n),a=e.redMul(a);return this.curve.point(r,t,a,n)},c.prototype._projAdd=function(e){var t,r=this.z.redMul(e.z),n=r.redSqr(),a=this.x.redMul(e.x),i=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(i),o=n.redSub(s),s=n.redAdd(s),e=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(i),e=r.redMul(o).redMul(e),s=this.curve.twisted?(t=r.redMul(s).redMul(i.redSub(this.curve._mulA(a))),o.redMul(s)):(t=r.redMul(s).redMul(i.redSub(a)),this.curve._mulC(o).redMul(s));return this.curve.point(e,t,s)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../utils":32,"./base":19,"bn.js":16,inherits:47}],21:[function(e,t,r){"use strict";r.base=e("./base"),r.short=e("./short"),r.mont=e("./mont"),r.edwards=e("./edwards")},{"./base":19,"./edwards":20,"./mont":22,"./short":23}],22:[function(e,t,r){"use strict";var s=e("bn.js"),n=e("inherits"),a=e("./base"),i=e("../utils");function o(e){a.call(this,"mont",e),this.a=new s(e.a,16).toRed(this.red),this.b=new s(e.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(t,16),this.z=new s(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(o,a),(t.exports=o).prototype.validate=function(e){var t=e.normalize().x,e=t.redSqr(),t=e.redMul(t).redAdd(e.redMul(this.a)).redAdd(t);return 0===t.redSqrt().redSqr().cmp(t)},n(u,a.BasePoint),o.prototype.decodePoint=function(e,t){if(32!==(e=33===(e=i.toArray(e,t)).length&&64===e[0]?e.slice(1,33).reverse():e).length)throw new Error("Unknown point compression format");return this.point(e,1)},o.prototype.point=function(e,t){return new u(this,e,t)},o.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(e){var t=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",t)):this.getX().toArray("be",t)},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),e=e.redMul(t),r=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(e,r)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),r=e.x.redSub(e.z).redMul(r),a=a.redMul(n),n=t.z.redMul(r.redAdd(a).redSqr()),a=t.x.redMul(r.redISub(a).redSqr());return this.curve.point(n,a)},u.prototype.mul=function(e){for(var t=(e=new s(e,16)).clone(),r=this,n=this.curve.point(null,null),a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var i=a.length-1;0<=i;i--)0===a[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":32,"./base":19,"bn.js":16,inherits:47}],23:[function(e,t,r){"use strict";var n=e("../utils"),w=e("bn.js"),a=e("inherits"),i=e("./base"),s=n.assert;function o(e){i.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){i.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),n&&(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 c(e,t,r,n){i.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(n,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}a(o,i),(t.exports=o).prototype._getEndomorphism=function(e){var t,r,n;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=(e.beta?new w(e.beta,16):r=(n=this._getEndoRoots(this.p))[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red),e.lambda?t=new w(e.lambda,16):(n=this._getEndoRoots(this.n),0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(r))?t=n[0]:(t=n[1],s(0===this.g.mul(t).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:t,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(t)}},o.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),e=r.redNeg(),r=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[e.redAdd(r).fromRed(),e.redSub(r).fromRed()]},o.prototype._getEndoBasis=function(e){for(var t,r,n,a,i,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),o=e,u=this.n.clone(),c=new w(1),l=new w(0),f=new w(0),d=new w(1),h=0;0!==o.cmpn(0);){var p=u.div(o),y=u.sub(p.mul(o)),b=f.sub(p.mul(c)),p=d.sub(p.mul(l));if(!n&&y.cmp(s)<0)t=i.neg(),r=c,n=y.neg(),a=b;else if(n&&2==++h)break;u=o,o=i=y,f=c,c=b,d=l,l=p}var m=y.neg(),g=b,e=n.sqr().add(a.sqr());return 0<=m.sqr().add(g.sqr()).cmp(e)&&(m=t,g=r),n.negative&&(n=n.neg(),a=a.neg()),m.negative&&(m=m.neg(),g=g.neg()),[{a:n,b:a},{a:m,b:g}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=a.mul(r.a),t=i.mul(n.a),r=a.mul(r.b),n=i.mul(n.b);return{k1:e.sub(s).sub(t),k2:r.add(n).neg()}},o.prototype.pointFromX=function(e,t){var r=(e=!(e=new w(e,16)).red?e.toRed(this.red):e).redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");r=n.fromRed().isOdd();return(t&&!r||!t&&r)&&(n=n.redNeg()),this.point(e,n)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,e=this.a.redMul(t),e=t.redSqr().redMul(t).redIAdd(e).redIAdd(this.b);return 0===r.redSqr().redISub(e).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y),e=(t=0!==t.cmpn(0)?t.redMul(this.x.redSub(e.x).redInvm()):t).redSqr().redISub(this.x).redISub(e.x),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),e=e.redInvm(),t=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(e),e=t.redSqr().redISub(this.x.redAdd(this.x)),t=t.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){t=[this,t],r=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,r):this.curve._wnafMulAdd(1,t,r,2)},u.prototype.jmulAdd=function(e,t,r){t=[this,t],r=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(t,r,!0):this.curve._wnafMulAdd(1,t,r,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t,r=this.curve.point(this.x,this.y.redNeg());return e&&this.precomputed&&(t=this.precomputed,e=function(e){return e.neg()},r.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(e)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(e)}}),r},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(c,i.BasePoint),o.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),e=this.y.redMul(t).redMul(e);return this.curve.point(r,e)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),t=n.redSub(a),r=i.redSub(s);if(0===t.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();a=t.redSqr(),s=a.redMul(t),n=n.redMul(a),a=r.redSqr().redIAdd(s).redISub(n).redISub(n),s=r.redMul(n.redISub(a)).redISub(i.redMul(s)),t=this.z.redMul(e.z).redMul(t);return this.curve.jpoint(a,s,t)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),e=r.redSub(n),t=a.redSub(i);if(0===e.cmpn(0))return 0!==t.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();n=e.redSqr(),i=n.redMul(e),r=r.redMul(n),n=t.redSqr().redIAdd(i).redISub(r).redISub(r),i=t.redMul(r.redISub(n)).redISub(a.redMul(i)),e=this.z.redMul(e);return this.curve.jpoint(n,i,e)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":32,"./base":19,"bn.js":16,inherits:47}],24:[function(e,t,r){"use strict";var n,a=r,r=e("hash.js"),i=e("./curve"),s=e("./utils").assert;function o(e){if("short"===e.type)this.curve=new i.short(e);else if("edwards"===e.type)this.curve=new i.edwards(e);else{if("mont"!==e.type)throw new Error("Unknown curve type.");this.curve=new i.mont(e)}this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, n*G != O")}function u(t,r){Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:function(){var e=new o(r);return Object.defineProperty(a,t,{configurable:!0,enumerable:!0,value:e}),e}})}a.PresetCurve=o,u("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:r.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"]}),u("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:r.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:r.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}),u("brainpoolP256r1",{type:"short",prime:null,p:"A9FB57DB A1EEA9BC 3E660A90 9D838D72 6E3BF623 D5262028 2013481D 1F6E5377",a:"7D5A0975 FC2C3057 EEF67530 417AFFE7 FB8055C1 26DC5C6C E94A4B44 F330B5D9",b:"26DC5C6C E94A4B44 F330B5D9 BBD77CBF 95841629 5CF7E1CE 6BCCDC18 FF8C07B6",n:"A9FB57DB A1EEA9BC 3E660A90 9D838D71 8C397AA3 B561A6F7 901E0E82 974856A7",hash:r.sha256,gRed:!1,g:["8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262","547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997"]}),u("brainpoolP384r1",{type:"short",prime:null,p:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B4 12B1DA19 7FB71123ACD3A729 901D1A71 87470013 3107EC53",a:"7BC382C6 3D8C150C 3C72080A CE05AFA0 C2BEA28E 4FB22787 139165EF BA91F90F8AA5814A 503AD4EB 04A8C7DD 22CE2826",b:"04A8C7DD 22CE2826 8B39B554 16F0447C 2FB77DE1 07DCD2A6 2E880EA5 3EEB62D57CB43902 95DBC994 3AB78696 FA504C11",n:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B3 1F166E6C AC0425A7CF3AB6AF 6B7FC310 3B883202 E9046565",hash:r.sha384,gRed:!1,g:["1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E","8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315"]}),u("brainpoolP512r1",{type:"short",prime:null,p:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 703308717D4D9B00 9BC66842 AECDA12A E6A380E6 2881FF2F 2D82C685 28AA6056 583A48F3",a:"7830A331 8B603B89 E2327145 AC234CC5 94CBDD8D 3DF91610 A83441CA EA9863BC2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7 2BF2C7B9 E7C1AC4D 77FC94CA",b:"3DF91610 A83441CA EA9863BC 2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A72BF2C7B9 E7C1AC4D 77FC94CA DC083E67 984050B7 5EBAE5DD 2809BD63 8016F723",n:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330870553E5C41 4CA92619 41866119 7FAC1047 1DB1D381 085DDADD B5879682 9CA90069",hash:r.sha512,gRed:!1,g:["81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822","7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}u("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":21,"./precomputed/secp256k1":31,"./utils":32,"hash.js":34}],25:[function(e,t,r){"use strict";var d=e("bn.js"),h=e("hmac-drbg"),n=e("../utils"),a=e("../curves"),i=e("brorand"),o=n.assert,s=e("./key"),p=e("./signature");function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(a.hasOwnProperty(e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=u).prototype.keyPair=function(e){return new s(this,e)},u.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){var t=new h({hash:this.hash,pers:(e=e||{}).pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||i(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var r=new d(t.generate(32));return this.keyFromPrivate(r)}for(var n=this.n.byteLength(),a=this.n.sub(new d(2));;)if(!(0<(r=new d(t.generate(n))).cmp(a)))return r.iaddn(1),this.keyFromPrivate(r)},u.prototype._truncateToN=function(e,t,r){r=(r=r||8*e.byteLength())-this.n.bitLength();return 0>1;if(0<=s.cmp(this.curve.p.umod(this.curve.n))&&r)throw new Error("Unable to find sencond key candinate");s=r?this.curve.pointFromX(s.add(this.curve.n),e):this.curve.pointFromX(s,e),t=t.r.invm(a),i=a.sub(i).mul(t).umod(a),a=n.mul(t).umod(a);return this.g.mulAdd(i,s,a)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new p(t,n)).recoveryParam)return t.recoveryParam;for(var a,i=0;i<4;i++){try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":24,"../utils":32,"./key":26,"./signature":27,"bn.js":16,brorand:17,"hmac-drbg":46}],26:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../utils").assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=i).fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},i.prototype.getPublic=function(e,t){return this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),"mont"===this.ec.curve.type?(t=(e=this.ec.curve.one).ushln(252).sub(e).ushln(3),this.priv=this.priv.or(e.ushln(254)),this.priv=this.priv.and(t)):this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?a(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return""}},{"../utils":32,"bn.js":16}],27:[function(e,t,r){"use strict";var a=e("bn.js"),i=e("../utils"),n=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(n(e.r&&e.s,"Signature without r or s"),this.r=new a(e.r,16),this.s=new a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,a=0,i=0,s=t.place;i>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=s).prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;if(u(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=u(e,r),t=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;n=u(e,r);if(e.length!==n+r.place)return!1;r=e.slice(r.place,n+r.place);return 0===t[0]&&128&t[1]&&(t=t.slice(1)),0===r[0]&&128&r[1]&&(r=r.slice(1)),this.r=new a(t),this.s=new a(r),!(this.recoveryParam=null)},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);t=n.concat(r),n=[48];return l(n,t.length),n=n.concat(t),i.encode(n,e)}},{"../utils":32,"bn.js":16}],28:[function(e,t,r){"use strict";var n=e("hash.js"),a=e("hmac-drbg"),i=e("brorand"),s=e("../curves"),o=e("../utils"),u=o.assert,c=o.parseBytes,l=e("./key"),f=e("./signature");function d(e){if(u("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof d))return new d(e);e=s[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}(t.exports=d).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),a=this.g.mul(n),t=this.encodePoint(a),r=this.hashInt(t,r.pubBytes(),e).mul(r.priv()),r=n.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:r,Rencoded:t})},d.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),r=this.hashInt(t.Rencoded(),n.pubBytes(),e),e=this.g.mul(t.S());return t.R().add(n.pub().mul(r)).eq(e)},d.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-r:r)):r=0,n.push(r);for(var s=0!==i.cmpn(0)&&0===i.andln(a-1)?t+1:1,o=1;o"),d(f(K))),ae)())}function q(){return r("group",s(L,a(":"),f(G),a(";"),d(f(K)))())}function L(){return r("display-name",(null!==(e=r("phrase",l(re,p(O,1))()))&&(e.semantic=e.semantic.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")),e));var e}function H(){return r("mailbox-list",l(s(D,p(s(a(","),D))),oe)())}function W(){return r("address-list",l(s(z,p(s(a(","),z))),ue)())}function G(){return r("group-list",l(H,d(K),ce)())}function V(){return r("local-part",l(le,T,I)())}function Z(){return r("dtext",l(function(){return n(function(e){var t=e.charCodeAt(0),t=33<=t&&t<=90||94<=t&&t<=126;return t=i.rfc6532?t||y(e):t})},de)())}function Y(){return r("domain-literal",s(d(f(K)),a("["),p(s(f(E),Z)),f(E),a("]"),d(f(K)))())}function $(){return r("domain",(e=l(fe,T,Y)(),i.rejectTLD&&e&&e.semantic&&e.semantic.indexOf(".")<0?null:(e&&(e.semantic=e.semantic.replace(/\s+/g,"")),e)));var e}function J(){return r("addr-spec",s(V,a("@"),$)())}function X(){return i.strict?null:r("obs-NO-WS-CTL",n(function(e){e=e.charCodeAt(0);return 1<=e&&e<=8||11===e||12===e||14<=e&&e<=31||127===e}))}function Q(){return i.strict?null:r("obs-ctext",X())}function ee(){return i.strict?null:r("obs-qtext",X())}function te(){return i.strict?null:r("obs-qp",s(a("\\"),l(a("\0"),X,v,b))())}function re(){return i.strict?null:i.atInDisplayName?r("obs-phrase",s(O,p(l(O,a("."),a("@"),h(K))))()):r("obs-phrase",s(O,p(l(O,a("."),h(K))))())}function ne(){return i.strict?null:r("obs-FWS",p(s(d(f(m)),A),1)())}function ae(){return i.strict?null:r("obs-angle-addr",s(d(f(K)),a("<"),ie,J,a(">"),d(f(K)))())}function ie(){return i.strict?null:r("obs-route",s(se,a(":"))())}function se(){return i.strict?null:r("obs-domain-list",s(p(l(d(K),a(","))),a("@"),$,p(s(a(","),d(f(K)),f(s(a("@"),$)))))())}function oe(){return i.strict?null:r("obs-mbox-list",s(p(s(d(f(K)),a(","))),D,p(s(a(","),f(s(D,d(K))))))())}function ue(){return i.strict?null:r("obs-addr-list",s(p(s(d(f(K)),a(","))),z,p(s(a(","),f(s(z,d(K))))))())}function ce(){return i.strict?null:r("obs-group-list",s(p(s(d(f(K)),a(",")),1),d(f(K)))())}function le(){return i.strict?null:r("obs-local-part",s(O,p(s(a("."),O)))())}function fe(){return i.strict?null:r("obs-domain",s(j,p(s(a("."),j)))())}function de(){return i.strict?null:r("obs-dtext",l(X,S)())}function he(e,t){var r,n,a;if(null==t)return null;for(n=[t];0=this._delta8){t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-t,this.endian);for(var r=0;r>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;ithis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":45}],45:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),e=e("inherits");function i(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=e,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,a=255&a;i?r.push(i,a):r.push(a)}else for(n=0;n>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},r.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},r.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0;e[t]=(i>>0,e[t+1]=i},r.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},r.sum64_lo=function(e,t,r,n){return t+n>>>0},r.sum64_4_hi=function(e,t,r,n,a,i,s,o){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,n,a,i,s,o){return t+n+i+o>>>0},r.sum64_5_hi=function(e,t,r,n,a,i,s,o,u,c){var l=0,f=t;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,n,a,i,s,o,u,c){return t+n+i+o+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:47,"minimalistic-assert":48}],46:[function(e,t,r){"use strict";var n=e("hash.js"),i=e("minimalistic-crypto-utils"),a=e("minimalistic-assert");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),e=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,e)}(t.exports=s).prototype._init=function(e,t,r){r=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length>8,a=255&a;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}},{}],50:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":51,"./lib/inflate":52,"./lib/utils/common":53,"./lib/zlib/constants":56}],51:[function(e,t,r){"use strict";var s=e("./zlib/deflate"),o=e("./utils/common"),u=e("./utils/strings"),n=e("./zlib/messages"),a=e("./zlib/zstream"),c=Object.prototype.toString,l=0,i=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=o.assign({level:i,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;if(t.raw&&0>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new u.Buf8(e.length),r=0,n=t.length;r>10&1023,i[s++]=56320|1023&r)}return l(i,s)},r.utf8border=function(e,t){for(var r=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+c[e[r]]>t?r:t}},{"./common":53}],55:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var a=65535&e|0,i=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3>>1:r>>>1;e[t]=r}return e}();t.exports=function(e,t,r,n){var a=o,i=n+r;e^=-1;for(var s=n;s>>8^a[255&(e^t[s])];return-1^e}},{}],58:[function(e,t,r){"use strict";var o,f=e("../utils/common"),u=e("./trees"),d=e("./adler32"),h=e("./crc32"),n=e("./messages"),c=0,l=4,p=0,y=-2,b=-1,m=4,a=2,g=8,w=9,i=286,s=30,v=19,_=2*i+1,k=15,A=3,S=258,E=S+A+1,P=42,x=113,M=1,K=2,C=3,j=4;function U(e,t){return e.msg=n[t],t}function T(e){return(e<<1)-(4e.avail_out?e.avail_out:r)&&(f.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function I(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function O(e,t){e.pending_buf[e.pending++]=t}function z(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,a=e.max_chain_length,i=e.strstart,s=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-E?e.strstart-(e.w_size-E):0,c=e.window,l=e.w_mask,f=e.prev,d=e.strstart+S,h=c[i+s-1],p=c[i+s];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(c[(r=t)+s]===p&&c[r+s-1]===h&&c[r]===c[i]&&c[++r]===c[i+1]){for(i+=2,r++;c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&iu&&0!=--a);return s<=e.lookahead?s:e.lookahead}function N(e){var t,r,n,a,i,s,o,u,c,l=e.w_size;do{if(c=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-E)){for(f.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;n=e.head[--t],e.head[t]=l<=n?n-l:0,--r;);for(t=r=l;n=e.prev[--t],e.prev[t]=l<=n?n-l:0,--r;);c+=l}if(0===e.strm.avail_in)break;if(i=e.strm,s=e.window,o=e.strstart+e.lookahead,u=c,c=void 0,c=i.avail_in,r=0===(c=u=A)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-A),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=A){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A&&e.match_length<=e.prev_length){for(a=e.strstart+e.lookahead-A,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-A),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=a&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(N(e),0===e.lookahead&&t===c)return M;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,I(e,!1),0===e.strm.avail_out))return M;if(e.strstart-e.block_start>=e.w_size-E&&(I(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===l?(I(e,!0),0===e.strm.avail_out?C:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),M)}),new L(4,4,8,4,F),new L(4,5,16,8,F),new L(4,6,32,32,F),new L(4,4,16,16,q),new L(8,16,32,32,q),new L(8,16,128,128,q),new L(8,32,128,256,q),new L(32,128,258,1024,q),new L(32,258,258,4096,q)],r.deflateInit=function(e,t){return V(e,t,g,15,8,0)},r.deflateInit2=V,r.deflateReset=G,r.deflateResetKeep=W,r.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?y:(e.state.gzhead=t,p)},r.deflate=function(e,t){var r,n,a,i;if(!e||!e.state||5>8&255),O(r,r.gzhead.time>>16&255),O(r,r.gzhead.time>>24&255),O(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),O(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(O(r,255&r.gzhead.extra.length),O(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=h(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(O(r,0),O(r,0),O(r,0),O(r,0),O(r,0),O(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),O(r,3),r.status=x)):(i=g+(r.w_bits-8<<4)<<8,i|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(i|=32),i+=31-i%31,r.status=x,z(r,i),0!==r.strstart&&(z(r,e.adler>>>16),z(r,65535&e.adler)),e.adler=1)),69===r.status)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),R(e),n=r.pending,r.pending!==r.pending_buf_size));)O(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),R(e),n=r.pending,r.pending===r.pending_buf_size)){a=1;break}}while(a=r.gzindexn&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),0===a&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),R(e),n=r.pending,r.pending===r.pending_buf_size)){a=1;break}}while(a=r.gzindexn&&(e.adler=h(e.adler,r.pending_buf,r.pending-n,n)),0===a&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&R(e),r.pending+2<=r.pending_buf_size&&(O(r,255&e.adler),O(r,e.adler>>8&255),e.adler=0,r.status=x)):r.status=x),0!==r.pending){if(R(e),0===e.avail_out)return r.last_flush=-1,p}else if(0===e.avail_in&&T(t)<=T(s)&&t!==l)return U(e,-5);if(666===r.status&&0!==e.avail_in)return U(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==c&&666!==r.status){var s=2===r.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(N(e),0===e.lookahead)){if(t===c)return M;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(I(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===l?(I(e,!0),0===e.strm.avail_out?C:j):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?M:K}(r,t):3===r.strategy?function(e,t){for(var r,n,a,i,s=e.window;;){if(e.lookahead<=S){if(N(e),e.lookahead<=S&&t===c)return M;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=A&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=A?(r=u._tr_tally(e,1,e.match_length-A),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(I(e,!1),0===e.strm.avail_out))return M}return e.insert=0,t===l?(I(e,!0),0===e.strm.avail_out?C:j):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?M:K}(r,t):o[r.level].func(r,t);if(s!==C&&s!==j||(r.status=666),s===M||s===C)return 0===e.avail_out&&(r.last_flush=-1),p;if(s===K&&(1===t?u._tr_align(r):5!==t&&(u._tr_stored_block(r,0,0,!1),3===t&&(B(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),R(e),0===e.avail_out))return r.last_flush=-1,p}return t!==l?p:r.wrap<=0?1:(2===r.wrap?(O(r,255&e.adler),O(r,e.adler>>8&255),O(r,e.adler>>16&255),O(r,e.adler>>24&255),O(r,255&e.total_in),O(r,e.total_in>>8&255),O(r,e.total_in>>16&255),O(r,e.total_in>>24&255)):(z(r,e.adler>>>16),z(r,65535&e.adler)),R(e),0=r.w_size&&(0===i&&(B(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new f.Buf8(r.w_size),f.arraySet(u,t,c-r.w_size,r.w_size,0),t=u,c=r.w_size),s=e.avail_in,o=e.next_in,u=e.input,e.avail_in=c,e.next_in=0,e.input=t,N(r);r.lookahead>=A;){for(n=r.strstart,a=r.lookahead-(A-1);r.ins_h=(r.ins_h<>>=n=r>>>24,k-=n,0===(n=r>>>16&255))h[d++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=A[(65535&r)+(_&(1<>>=n,k-=n),k<15&&(_+=l[c++]<>>=n=r>>>24,k-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=S[(65535&r)+(_&(1<>>=n,k-=n,(n=d-p)>3)<<3))-1,e.next_in=c-=a,e.next_out=d,e.avail_in=c>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new K.Buf16(320),this.work=new K.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function s(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=z,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new K.Buf32(n),t.distcode=t.distdyn=new K.Buf32(a),t.sane=1,t.back=-1,I):O}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,s(e)):O}function u(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(K.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(e=a.wsize-a.wnext,K.arraySet(a.window,t,r-n,e=n>>8&255,r.check=j(r.check,x,2,0),l=c=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&c)){e.msg="unknown compression method",r.mode=30;break}if(l-=4,k=8+(15&(c>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(x[0]=255&c,x[1]=c>>>8&255,r.check=j(r.check,x,2,0)),l=c=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,c+=n[i++]<>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=j(r.check,x,4,0)),l=c=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,c+=n[i++]<>8),512&r.flags&&(x[0]=255&c,x[1]=c>>>8&255,r.check=j(r.check,x,2,0)),l=c=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,c+=n[i++]<>>8&255,r.check=j(r.check,x,2,0)),l=c=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=o<(h=r.length)?o:h)&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),K.arraySet(r.head.extra,n,i,h,k)),512&r.flags&&(r.check=j(r.check,n,h,i)),o-=h,i+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(h=0;k=n[i+h++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,c+=n[i++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,c+=n[i++]<>>=1)){case 0:r.mode=14;break;case 1:if(!function(e){if(q){var t;for(N=new K.Buf32(512),F=new K.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(T(B,e.lens,0,288,N,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;T(R,e.lens,0,32,F,0,e.work,{bits:5}),q=!1}e.lencode=N,e.lenbits=9,e.distcode=F,e.distbits=5}(r),r.mode=20,6!==t)break;c>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,c+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&c,l=c=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(0===(h=u<(h=o>>=5,l-=5,r.ndist=1+(31&c),c>>>=5,l-=5,r.ncode=4+(15&c),c>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},A=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,A){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,g=65535&P,!((b=P>>>24)<=l);){if(0===o)break e;o--,c+=n[i++]<>>=b,l-=b,r.lens[r.have++]=g;else{if(16===g){for(E=b+2;l>>=b,l-=b,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],h=3+(3&c),c>>>=2,l-=2}else if(17===g){for(E=b+3;l>>=b)),c>>>=3,l-=3}else{for(E=b+7;l>>=b)),c>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;h--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},A=T(B,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,A){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},A=T(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,A){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=u){e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=o,r.hold=c,r.bits=l,U(e,d),s=e.next_out,a=e.output,u=e.avail_out,i=e.next_in,n=e.input,o=e.avail_in,c=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;m=(P=r.lencode[c&(1<>>16&255,g=65535&P,!((b=P>>>24)<=l);){if(0===o)break e;o--,c+=n[i++]<>w)])>>>16&255,g=65535&P,!(w+(b=P>>>24)<=l);){if(0===o)break e;o--,c+=n[i++]<>>=w,l-=w,r.back+=w}if(c>>>=b,l-=b,r.back+=b,r.length=g,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=12;break}if(64&m){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(E=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(P=r.distcode[c&(1<>>16&255,g=65535&P,!((b=P>>>24)<=l);){if(0===o)break e;o--,c+=n[i++]<>w)])>>>16&255,g=65535&P,!(w+(b=P>>>24)<=l);){if(0===o)break e;o--,c+=n[i++]<>>=w,l-=w,r.back+=w}if(c>>>=b,l-=b,r.back+=b,64&m){e.msg="invalid distance code",r.mode=30;break}r.offset=g,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(E=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===u)break e;if(r.offset>(h=d-u)){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=h>r.wnext?(h-=r.wnext,r.wsize-h):r.wnext-h,h>r.length&&(h=r.length),y=r.window}else y=a,p=s-r.offset,h=r.length;for(u-=h=uh?(y=U[T+s[w]],M[K+s[w]]):(y=96,0),u=1<<(p=g-S),v=c=1<>S)+(c-=u)]=p<<24|y<<16|b|0,0!==c;);for(u=1<>=1;if(0!==u?(x&=u-1,x+=u):x=0,w++,0==--C[g]){if(g===_)break;g=t[r+s[w]]}if(k>>7)]}function O(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>h-r?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=r-h):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function F(e,t,r){for(var n,a=new Array(m+1),i=0,s=1;s<=m;s++)a[s]=i=i+r[s-1]<<1;for(n=0;n<=t;n++){var o=e[2*n+1];0!==o&&(e[2*n]=N(a[o]++,o))}}function q(e){for(var t=0;t>1;1<=r;r--)W(e,i,r);for(a=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],W(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,i[2*a]=i[2*r]+i[2*n],e.depth[a]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,i[2*r+1]=i[2*n+1]=a,e.heap[1]=a++,W(e,i,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){for(var r,n,a,i,s,o=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,h=t.stat_desc.max_length,p=0,y=0;y<=m;y++)e.bl_count[y]=0;for(o[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&t&&0!==e.dyn_ltree[2*r])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(r=32;r>>3,(i=e.static_len+3+7>>>3)<=a&&(a=i)):a=i=r+5,r+4<=a&&-1!==t?J(e,t,r,n):4===e.strategy||i===a?(z(e,2+(n?1:0),3),G(e,E,P)):(z(e,4+(n?1:0),3),function(e,t,r,n){var a;for(z(e,t-257,5),z(e,r-1,5),z(e,n-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(M[r]+c+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){z(e,2,3),D(e,y,E),16===(e=e).bi_valid?(O(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":53}],65:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],66:[function(e,t,r){var n,a,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=o(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f>r,this.bitOffset+=e,e=0)}return t},n.prototype.seek=function(e){var t=e%8,e=(e-t)/8;this.bitOffset=t,this.stream.seek(e),this.hasByte=!1},n.prototype.pi=function(){for(var e,t=new Uint8Array(6),r=0;r("00"+e.toString(16)).slice(-2)).join("")},t.exports=n},{}],68:[function(e,t,r){"use strict";var n;t.exports=(n=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),function(){var r=4294967295;this.getCRC=function(){return~r>>>0},this.updateCRC=function(e){r=r<<8^n[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;0>>24^e)]}})},{}],69:[function(e,t,r){"use strict";function j(e,t){for(var r=e[t],n=t;0>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,e.read(1)&&T(U.OBSOLETE_INPUT);var r=e.read(24);r>this.dbufSize&&T(U.DATA_ERROR,"initial position out of bounds");var n=e.read(16),a=new Uint8Array(256),i=0;for(v=0;v<16;v++)if(n&1<<15-v)for(var s=16*v,o=e.read(16),u=0;u<16;u++)o&1<<15-u&&(a[i++]=s+u);var c=e.read(3);(c<2||6m?m=g[v]:g[v]h.maxLen&&T(U.DATA_ERROR),!(u<=h.limit[v]);v++)u=u<<1|e.read(1);((u-=h.base[v])<0||258<=u)&&T(U.DATA_ERROR);var M=h.permute[u];if(0!==M&&1!==M){if(S)for(S=0,E+n>this.dbufSize&&T(U.DATA_ERROR),k[A=a[f[0]]]+=n;n--;)x[E++]=A;if(i=this.dbufSize&&T(U.DATA_ERROR),k[A=a[A=j(f,v=M-1)]]++,x[E++]=A}else S||(S=1,n=0),n+=0===M?S:2*S,S<<=1}for((r<0||E<=r)&&T(U.DATA_ERROR),v=u=0;v<256;v++)o=u+k[v],k[v]=u,u=o;for(v=0;v>=8,t=-1),this.writePos=K,this.writeCurrent=C,this.writeCount=E,this.writeRun=t,!0},l.prototype._read_bunzip=function(e,t){var r,n,a;if(this.writeCount<0)return 0;for(var i=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount,c=(this.outputsize,this.writeRun);u;){for(u--,n=o,o=255&(s=i[s]),s>>=8,3==c++?(r=o,a=n,o=-1):(r=1,a=o),this.blockCRC.updateCRCRun(a,r);r--;)this.outputStream.writeByte(a),this.nextoutput++;o!=n&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&T(U.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};function f(e){if("readByte"in e)return e;var t=new c;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t}function o(e){var t=new c,r=!0;if(e)if("number"==typeof e)t.buffer=new Uint8Array(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Uint8Array(16384);return t.pos=0,t.writeByte=function(e){var t;r&&this.pos>=this.buffer.length&&((t=new Uint8Array(2*this.buffer.length)).set(this.buffer),this.buffer=t),this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var e=new Uint8Array(this.pos);e.set(this.buffer.subarray(0,this.pos)),this.buffer=e}return this.buffer},t._coerced=!0,t}l.Err=U,l.decode=function(e,t,r){for(var n=f(e),a=o(t),i=new l(n,a);!("eof"in n&&n.eof());)if(i._init_block())i._read_bunzip();else{var s=i.reader.read(32)>>>0;if(s!==i.streamCRC&&T(U.DATA_ERROR,"Bad stream CRC (got "+i.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!(r&&"eof"in n)||n.eof())break;i._start_bunzip(n,a)}if("getBuffer"in a)return a.getBuffer()},l.decodeBlock=function(e,t,r){e=f(e),r=o(r),e=new l(e,r);if(e.reader.seek(t),e._get_next_block()&&(e.blockCRC=new a,e.writeCopies=0,e._read_bunzip()),"getBuffer"in r)return r.getBuffer()},l.table=function(e,t,r){var n=new c;n.delegate=f(e),n.pos=0,n.readByte=function(){return this.pos++,this.delegate.readByte()},n.delegate.eof&&(n.eof=n.delegate.eof.bind(n.delegate));var a=new c;a.pos=0,a.writeByte=function(){this.pos++};for(var i=new l(n,a),s=i.dbufSize;!("eof"in n&&n.eof());){var o=8*n.pos+i.reader.bitOffset;if(i.reader.hasByte&&(o-=8),i._init_block()){var u=a.pos;i._read_bunzip(),t(o,a.pos-u)}else{i.reader.read(32);if(!(r&&"eof"in n)||n.eof())break;i._start_bunzip(n,a),console.assert(i.dbufSize===s,"shouldn't change block size within multistream file")}}},l.Stream=c,t.exports=l},{"./bitreader":67,"./crc32":68,"./stream":70}],70:[function(e,t,r){"use strict";function n(){}n.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")},n.prototype.read=function(e,t,r){for(var n=0;n>6*r)+n];0>6*(r-1)),--r;return a}}a.prototype={decode:function(e,t){e="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0);t=i(t),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,n=new s(e),a=[];!n.endOfStream()&&-1!==(r=this._decoder.handler(n,n.read()));)null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r));if(!this._streaming){for(;-1!==(r=this._decoder.handler(n,n.read()))&&(null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r)),!n.endOfStream()););this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(e){for(var t="",r=0;r>10),56320+(1023&n)))}return t}(a)}},o.prototype={encode:function(e,t){e=e?String(e):"",t=i(t),this._streaming||(this._encoder=new f(this._options)),this._streaming=Boolean(t.stream);for(var r,n=[],a=new s(function(e){for(var t=String(e),r=t.length,n=0,a=[];n>>8)-1}(e,t,r,n,32)}function g(e,t){for(var r=0;r<16;r++)e[r]=0|t[r]}function o(e){for(var t,r=1,n=0;n<16;n++)t=e[n]+r+65535,r=Math.floor(t/65536),e[n]=t-65536*r;e[0]+=r-1+37*(r-1)}function w(e,t,r){for(var n,a=~(r-1),i=0;i<16;i++)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function v(e,t){for(var r,n,a=p(),i=p(),s=0;s<16;s++)i[s]=t[s];for(o(i),o(i),o(i),r=0;r<2;r++){for(a[0]=i[0]-65517,s=1;s<15;s++)a[s]=i[s]-65535-(a[s-1]>>16&1),a[s-1]&=65535;a[15]=i[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,w(i,a,1-n)}for(s=0;s<16;s++)e[2*s]=255&i[s],e[2*s+1]=i[s]>>8}function _(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return v(r,e),v(n,t),m(r,0,n,0)}function k(e){var t=new Uint8Array(32);return v(t,e),1&t[0]}function A(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function S(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function E(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function P(e,t,r){var n=0,a=0,i=0,s=0,o=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,y=0,b=0,m=0,g=0,w=0,v=0,_=0,k=0,A=0,S=0,E=0,P=0,x=0,M=0,K=0,C=0,j=0,U=0,T=0,B=r[0],R=r[1],I=r[2],O=r[3],z=r[4],D=r[5],N=r[6],F=r[7],q=r[8],L=r[9],H=r[10],W=r[11],G=r[12],V=r[13],Z=r[14],Y=r[15],r=t[0];n+=r*B,a+=r*R,i+=r*I,s+=r*O,o+=r*z,u+=r*D,c+=r*N,l+=r*F,f+=r*q,d+=r*L,h+=r*H,p+=r*W,y+=r*G,b+=r*V,m+=r*Z,g+=r*Y,a+=(r=t[1])*B,i+=r*R,s+=r*I,o+=r*O,u+=r*z,c+=r*D,l+=r*N,f+=r*F,d+=r*q,h+=r*L,p+=r*H,y+=r*W,b+=r*G,m+=r*V,g+=r*Z,w+=r*Y,i+=(r=t[2])*B,s+=r*R,o+=r*I,u+=r*O,c+=r*z,l+=r*D,f+=r*N,d+=r*F,h+=r*q,p+=r*L,y+=r*H,b+=r*W,m+=r*G,g+=r*V,w+=r*Z,v+=r*Y,s+=(r=t[3])*B,o+=r*R,u+=r*I,c+=r*O,l+=r*z,f+=r*D,d+=r*N,h+=r*F,p+=r*q,y+=r*L,b+=r*H,m+=r*W,g+=r*G,w+=r*V,v+=r*Z,_+=r*Y,o+=(r=t[4])*B,u+=r*R,c+=r*I,l+=r*O,f+=r*z,d+=r*D,h+=r*N,p+=r*F,y+=r*q,b+=r*L,m+=r*H,g+=r*W,w+=r*G,v+=r*V,_+=r*Z,k+=r*Y,u+=(r=t[5])*B,c+=r*R,l+=r*I,f+=r*O,d+=r*z,h+=r*D,p+=r*N,y+=r*F,b+=r*q,m+=r*L,g+=r*H,w+=r*W,v+=r*G,_+=r*V,k+=r*Z,A+=r*Y,c+=(r=t[6])*B,l+=r*R,f+=r*I,d+=r*O,h+=r*z,p+=r*D,y+=r*N,b+=r*F,m+=r*q,g+=r*L,w+=r*H,v+=r*W,_+=r*G,k+=r*V,A+=r*Z,S+=r*Y,l+=(r=t[7])*B,f+=r*R,d+=r*I,h+=r*O,p+=r*z,y+=r*D,b+=r*N,m+=r*F,g+=r*q,w+=r*L,v+=r*H,_+=r*W,k+=r*G,A+=r*V,S+=r*Z,E+=r*Y,f+=(r=t[8])*B,d+=r*R,h+=r*I,p+=r*O,y+=r*z,b+=r*D,m+=r*N,g+=r*F,w+=r*q,v+=r*L,_+=r*H,k+=r*W,A+=r*G,S+=r*V,E+=r*Z,P+=r*Y,d+=(r=t[9])*B,h+=r*R,p+=r*I,y+=r*O,b+=r*z,m+=r*D,g+=r*N,w+=r*F,v+=r*q,_+=r*L,k+=r*H,A+=r*W,S+=r*G,E+=r*V,P+=r*Z,x+=r*Y,h+=(r=t[10])*B,p+=r*R,y+=r*I,b+=r*O,m+=r*z,g+=r*D,w+=r*N,v+=r*F,_+=r*q,k+=r*L,A+=r*H,S+=r*W,E+=r*G,P+=r*V,x+=r*Z,M+=r*Y,p+=(r=t[11])*B,y+=r*R,b+=r*I,m+=r*O,g+=r*z,w+=r*D,v+=r*N,_+=r*F,k+=r*q,A+=r*L,S+=r*H,E+=r*W,P+=r*G,x+=r*V,M+=r*Z,K+=r*Y,y+=(r=t[12])*B,b+=r*R,m+=r*I,g+=r*O,w+=r*z,v+=r*D,_+=r*N,k+=r*F,A+=r*q,S+=r*L,E+=r*H,P+=r*W,x+=r*G,M+=r*V,K+=r*Z,C+=r*Y,b+=(r=t[13])*B,m+=r*R,g+=r*I,w+=r*O,v+=r*z,_+=r*D,k+=r*N,A+=r*F,S+=r*q,E+=r*L,P+=r*H,x+=r*W,M+=r*G,K+=r*V,C+=r*Z,j+=r*Y,m+=(r=t[14])*B,g+=r*R,w+=r*I,v+=r*O,_+=r*z,k+=r*D,A+=r*N,S+=r*F,E+=r*q,P+=r*L,x+=r*H,M+=r*W,K+=r*G,C+=r*V,j+=r*Z,U+=r*Y,g+=(r=t[15])*B,a+=38*(v+=r*I),i+=38*(_+=r*O),s+=38*(k+=r*z),o+=38*(A+=r*D),u+=38*(S+=r*N),c+=38*(E+=r*F),l+=38*(P+=r*q),f+=38*(x+=r*L),d+=38*(M+=r*H),h+=38*(K+=r*W),p+=38*(C+=r*G),y+=38*(j+=r*V),b+=38*(U+=r*Z),m+=38*(T+=r*Y),n=(r=1+(n+=38*(w+=r*R))+65535)-65536*(T=Math.floor(r/65536)),a=(r=a+T+65535)-65536*(T=Math.floor(r/65536)),i=(r=i+T+65535)-65536*(T=Math.floor(r/65536)),s=(r=s+T+65535)-65536*(T=Math.floor(r/65536)),o=(r=o+T+65535)-65536*(T=Math.floor(r/65536)),u=(r=u+T+65535)-65536*(T=Math.floor(r/65536)),c=(r=c+T+65535)-65536*(T=Math.floor(r/65536)),l=(r=l+T+65535)-65536*(T=Math.floor(r/65536)),f=(r=f+T+65535)-65536*(T=Math.floor(r/65536)),d=(r=d+T+65535)-65536*(T=Math.floor(r/65536)),h=(r=h+T+65535)-65536*(T=Math.floor(r/65536)),p=(r=p+T+65535)-65536*(T=Math.floor(r/65536)),y=(r=y+T+65535)-65536*(T=Math.floor(r/65536)),b=(r=b+T+65535)-65536*(T=Math.floor(r/65536)),m=(r=m+T+65535)-65536*(T=Math.floor(r/65536)),g=(r=g+T+65535)-65536*(T=Math.floor(r/65536)),n+=T-1+37*(T-1),n=(r=1+n+65535)-65536*(T=Math.floor(r/65536)),a=(r=a+T+65535)-65536*(T=Math.floor(r/65536)),i=(r=i+T+65535)-65536*(T=Math.floor(r/65536)),s=(r=s+T+65535)-65536*(T=Math.floor(r/65536)),o=(r=o+T+65535)-65536*(T=Math.floor(r/65536)),u=(r=u+T+65535)-65536*(T=Math.floor(r/65536)),c=(r=c+T+65535)-65536*(T=Math.floor(r/65536)),l=(r=l+T+65535)-65536*(T=Math.floor(r/65536)),f=(r=f+T+65535)-65536*(T=Math.floor(r/65536)),d=(r=d+T+65535)-65536*(T=Math.floor(r/65536)),h=(r=h+T+65535)-65536*(T=Math.floor(r/65536)),p=(r=p+T+65535)-65536*(T=Math.floor(r/65536)),y=(r=y+T+65535)-65536*(T=Math.floor(r/65536)),b=(r=b+T+65535)-65536*(T=Math.floor(r/65536)),m=(r=m+T+65535)-65536*(T=Math.floor(r/65536)),g=(r=g+T+65535)-65536*(T=Math.floor(r/65536)),e[0]=n+=T-1+37*(T-1),e[1]=a,e[2]=i,e[3]=s,e[4]=o,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=d,e[10]=h,e[11]=p,e[12]=y,e[13]=b,e[14]=m,e[15]=g}function x(e,t){P(e,t,t)}function M(e,t){for(var r=p(),n=0;n<16;n++)r[n]=t[n];for(n=253;0<=n;n--)x(r,r),2!==n&&4!==n&&P(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function s(e,t,r){for(var n,a=new Uint8Array(32),i=new Float64Array(80),s=p(),o=p(),u=p(),c=p(),l=p(),f=p(),d=0;d<31;d++)a[d]=t[d];for(a[31]=127&t[31]|64,a[0]&=248,A(i,r),d=0;d<16;d++)o[d]=i[d],c[d]=s[d]=u[d]=0;for(s[0]=c[0]=1,d=254;0<=d;--d)w(s,o,n=a[d>>>3]>>>(7&d)&1),w(u,c,n),S(l,s,u),E(s,s,u),S(u,o,c),E(o,o,c),x(c,l),x(f,s),P(s,u,s),P(u,o,l),S(l,s,u),E(s,s,u),x(o,s),E(u,c,f),P(s,u,y),S(s,s,c),P(u,u,s),P(s,c,f),P(c,o,i),x(o,l),w(s,o,n),w(u,c,n);for(d=0;d<16;d++)i[d+16]=s[d],i[d+32]=u[d],i[d+48]=o[d],i[d+64]=c[d];var h=i.subarray(32),r=i.subarray(16);return M(h,h),P(r,r,h),v(e,r),0}function u(e,t){return s(e,t,r)}function K(e,t){var r=p(),n=p(),a=p(),i=p(),s=p(),o=p(),u=p(),c=p(),l=p();E(r,e[1],e[0]),E(l,t[1],t[0]),P(r,r,l),S(n,e[0],e[1]),S(l,t[0],t[1]),P(n,n,l),P(a,e[3],t[3]),P(a,a,h),P(i,e[2],t[2]),S(i,i,i),E(s,n,r),E(o,i,a),S(u,i,a),S(c,n,r),P(e[0],s,o),P(e[1],c,u),P(e[2],u,o),P(e[3],s,c)}function C(e,t,r){for(var n=0;n<4;n++)w(e[n],t[n],r)}function j(e,t){var r=p(),n=p(),a=p();M(a,t[2]),P(r,t[0],a),P(n,t[1],a),v(e,n),e[31]^=k(r)<<7}function U(e,t,r){var n,a;for(g(e[0],c),g(e[1],l),g(e[2],l),g(e[3],c),a=255;0<=a;--a)C(e,t,n=r[a/8|0]>>(7&a)&1),K(t,e),K(e,e),C(e,t,n)}function T(e,t){var r=[p(),p(),p(),p()];g(r[0],n),g(r[1],a),g(r[2],l),P(r[3],n,a),U(e,r,t)}function B(e,t,r){var n,a=[p(),p(),p(),p()];for(r||i(t,32),(r=d.hash(t.subarray(0,32)))[0]&=248,r[31]&=127,r[31]|=64,T(a,r),j(e,a),n=0;n<32;n++)t[n+32]=e[n]}var R=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function I(e,t){for(var r,n,a,i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>4)*R[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*R[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function O(e){for(var t=new Float64Array(64),r=0;r<64;r++)t[r]=e[r];for(r=0;r<64;r++)e[r]=0;I(e,t)}function z(e,t){var r=p(),n=p(),a=p(),i=p(),s=p(),o=p(),u=p();if(g(e[2],l),A(e[1],t),x(a,e[1]),P(i,a,f),E(a,a,e[2]),S(i,e[2],i),x(s,i),x(o,s),P(u,o,s),P(r,u,a),P(r,r,i),function(e,t){for(var r=p(),n=0;n<16;n++)r[n]=t[n];for(n=250;0<=n;n--)x(r,r),1!==n&&P(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(r,r),P(r,r,a),P(r,r,i),P(r,r,i),P(e[0],r,i),x(n,e[0]),P(n,n,i),_(n,a)&&P(e[0],e[0],b),x(n,e[0]),P(n,n,i),_(n,a))return 1;k(e[0])===t[31]>>7&&E(e[0],c,e[0]),P(e[3],e[0],e[1])}var D;function N(){for(var e=0;e{t.enqueue(e),r.pause()}),r.on("end",()=>t.close()),r.on("error",e=>t.error(e))},pull(){r.resume()},cancel(e){if(r.pause(),r.cancel)return r.cancel(e)}})};class t extends e{constructor(e,t){super(t),this._webStream=e,this._reader=s.default.getReader(e),this._reading=!1,this._doneReadingPromise=Promise.resolve(),this._cancelling=!1}_read(e){this._reading||this._cancelling||(this._reading=!0,this._doneReadingPromise=(async()=>{try{for(;;){var e=await this._reader.read(),t=e.done,r=e.value;if(t){this.push(null);break}if(!this.push(r)||this._cancelling){this._reading=!1;break}}}catch(e){this.emit("error",e)}})())}async cancel(e){return this._cancelling=!0,await this._doneReadingPromise,this._reader.releaseLock(),this._webStream.cancel(e)}}r.webToNode=u=function(e){return new t(e)}}r.nodeToWeb=o,r.webToNode=u},{"./streams":75,"./util":76,stream:"stream"}],74:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.externalBuffer=r.Reader=void 0;var n,a=e("./streams"),i=(n=a)&&n.__esModule?n:{default:n};const s=new WeakSet,o=Symbol("externalBuffer");function u(e){(this.stream=e)[o]&&(this[o]=e[o].slice());var t=i.default.isStream(e);if("node"===t&&(e=i.default.nodeToWeb(e)),t){const n=e.getReader();return this._read=n.read.bind(n),void(this._releaseLock=()=>{n.closed.catch(function(){}),n.releaseLock()})}let r=!1;this._read=async()=>r||s.has(e)?{value:void 0,done:!0}:(r=!0,{value:e,done:!1}),this._releaseLock=()=>{if(r)try{s.add(e)}catch(e){}}}u.prototype.read=async function(){return this[o]&&this[o].length?{done:!1,value:this[o].shift()}:this._read()},u.prototype.releaseLock=function(){this[o]&&(this.stream[o]=this[o]),this._releaseLock()},u.prototype.readLine=async function(){let r=[],n;for(;!n;){var a=await this.read();let e=a.done,t=a.value;if(t+="",e)return r.length?i.default.concat(r):void 0;a=t.indexOf("\n")+1;a&&(n=i.default.concat(r.concat(t.substr(0,a))),r=[]),a!==t.length&&r.push(t.substr(a))}return this.unshift(...r),n},u.prototype.readByte=async function(){var e=await this.read(),t=e.done,e=e.value;if(!t){t=e[0];return this.unshift(i.default.slice(e,1)),t}},u.prototype.readBytes=async function(e){const t=[];let r=0;for(;;){var n=await this.read(),a=n.done,n=n.value;if(a)return t.length?i.default.concat(t):void 0;if(t.push(n),r+=n.length,r>=e){n=i.default.concat(t);return this.unshift(i.default.slice(n,e)),i.default.slice(n,0,e)}}},u.prototype.peekBytes=async function(e){e=await this.readBytes(e);return this.unshift(e),e},u.prototype.unshift=function(...e){this[o]||(this[o]=[]),this[o].unshift(...e.filter(e=>e&&e.length))},u.prototype.readToEnd=async function(e=i.default.concat){const t=[];for(;;){var r=await this.read(),n=r.done,r=r.value;if(n)break;t.push(r)}return e(t)},r.Reader=u,r.externalBuffer=o},{"./streams":75}],75:[function(v,e,_){!function(e){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var i=v("./util"),r=v("./node-conversions"),s=v("./reader");const t=i.isNode&&v("buffer").Buffer;function o(t){var e=(0,i.isStream)(t);return"node"===e?(0,r.nodeToWeb)(t):e?t:new ReadableStream({start(e){e.enqueue(t),e.close()}})}function u(e){return e.some(i.isStream)?n(e):"string"==typeof e[0]?e.join(""):t&&t.isBuffer(e[0])?t.concat(e):(0,i.concatUint8Array)(e)}function n(n){n=n.map(o);const a=h(async function(t){await Promise.all(e.map(e=>g(e,t)))});let i=Promise.resolve();const e=n.map((e,r)=>y(e,(e,t)=>(i=i.then(()=>f(e,a.writable,{preventClose:r!==n.length-1})),i)));return a.readable}function c(e){return new s.Reader(e)}function l(e){const t=e.getWriter(),r=t.releaseLock;return t.releaseLock=()=>{t.closed.catch(function(){}),r.call(t)},t}async function f(t,e,r){t=o(t);try{if(t[s.externalBuffer]){const n=l(e);for(let e=0;e{r=e}),r=null)},close:n.close.bind(n),abort:n.error.bind(n)})}}function p(e,n=()=>{},r=()=>{}){if((0,i.isStream)(e))return d(e,{async transform(e,t){try{var r=await n(e);void 0!==r&&t.enqueue(r)}catch(e){t.error(e)}},async flush(t){try{var e=await r();void 0!==e&&t.enqueue(e)}catch(e){t.error(e)}}});var t=n(e),e=r();return void 0!==t&&void 0!==e?u([t,e]):void 0!==t?t:e}function y(e,t){let r;var n=new TransformStream({start(e){r=e}});const a=f(e,n.writable);e=h(async function(){r.error(new Error("Readable side was canceled.")),await a,await new Promise(setTimeout)});return t(n.readable,e.writable),e.readable}function a(r,n){Object.entries(Object.getOwnPropertyDescriptors(ReadableStream.prototype)).forEach(([e,t])=>{"constructor"!==e&&(t.value?t.value=t.value.bind(n):t.get=t.get.bind(n),Object.defineProperty(r,e,t))})}function b(e,n=0,a=1/0){if((0,i.isStream)(e)){if(0<=n&&0<=a){let r=0;return d(e,{transform(e,t){r=n&&t.enqueue(b(e,Math.max(n-r,0),a-r)),r+=e.length):t.terminate()}})}if(n<0&&(a<0||a===1/0)){let t=[];return p(e,e=>{e.length>=-n?t=[e]:t.push(e)},()=>b(u(t),n,a))}if(0===n&&a<0){let t;return p(e,e=>{e=t?u([t,e]):e;if(e.length>=-a)return t=b(e,a),b(e,n,a);t=e})}return console.warn(`stream.slice(input, ${n}, ${a}) not implemented efficiently.`),w(async()=>b(await m(e),n,a))}return e[s.externalBuffer]&&(e=u(e[s.externalBuffer].concat([e]))),!(0,i.isUint8Array)(e)||t&&t.isBuffer(e)?e.slice(n,a):(a===1/0&&(a=e.length),e.subarray(n,a))}async function m(e,t){return(0,i.isStream)(e)?c(e).readToEnd(t):e}async function g(e,t){if((0,i.isStream)(e)&&e.cancel)return e.cancel(t)}function w(e){return new ReadableStream({pull:async t=>{try{t.enqueue(await e()),t.close()}catch(e){t.error(e)}}})}_.default={isStream:i.isStream,isUint8Array:i.isUint8Array,toStream:o,concatUint8Array:i.concatUint8Array,concatStream:n,concat:u,getReader:c,getWriter:l,pipe:f,transformRaw:d,transform:p,transformPair:y,parse:function(e,n){let a;const i=y(e,(e,t)=>{const r=c(e);r.remainder=()=>(r.releaseLock(),f(e,t),i),a=n(r)});return a},clone:function(e){if((0,i.isStream)(e)){var t=function(e){if((0,i.isStream)(e)){const t=o(e).tee();return t[0][s.externalBuffer]=t[1][s.externalBuffer]=e[s.externalBuffer],t}return[b(e),b(e)]}(e);return a(e,t[0]),t[1]}return b(e)},passiveClone:function(t){return(0,i.isStream)(t)?new ReadableStream({start(o){var e=y(t,async(e,t)=>{const r=c(e),n=l(t);try{for(;;){await n.ready;var a=await r.read(),i=a.done,s=a.value;if(i){try{o.close()}catch(e){}return void await n.close()}try{o.enqueue(s)}catch(e){}await n.write(s)}}catch(e){o.error(e),await n.abort(e)}});a(t,e)}}):b(t)},slice:b,readToEnd:m,cancel:g,fromAsync:w,nodeToWeb:r.nodeToWeb,webToNode:r.webToNode}}.call(this,v("_process"))},{"./node-conversions":73,"./reader":74,"./util":76,_process:66,buffer:"buffer"}],76:[function(r,e,n){!function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});e="object"==typeof e.process&&"object"==typeof e.process.versions;const t=e&&r("stream").Readable;function i(e){return Uint8Array.prototype.isPrototypeOf(e)}n.isNode=e,n.isStream=function(e){return ReadableStream.prototype.isPrototypeOf(e)?"web":!(!t||!t.prototype.isPrototypeOf(e))&&"node"},n.isUint8Array=i,n.concatUint8Array=function(t){if(1===t.length)return t[0];let r=0;for(let e=0;ee=>t.hashAlgorithm===e)(r[e])))return;return 1}let n=null,a=[];{if(e.forEach(function(e){if(n=e.match(/Hash: (.+)/),!n)throw new Error('Only "Hash" header allowed in cleartext signed message');n=n[1].replace(/\s/g,""),n=n.split(","),n=n.map(function(t){t=t.toLowerCase();try{return i.default.write(i.default.hash,t)}catch(e){throw new Error("Unknown hash algorithm in armor header: "+t)}}),a=a.concat(n)}),!a.length&&!t([i.default.hash.md5]))throw new Error('If no "Hash" header in cleartext signed message, then only MD5 signatures allowed');if(a.length&&!t(a))throw new Error("Hash algorithm mismatch in armor header and signature")}}(t.headers,r);e=new o.Signature(r);return new l(t.text,e)},r.fromText=function(e){return new l(e)};var n=c(e("./encoding/armor")),i=c(e("./enums")),a=c(e("./util")),s=c(e("./packet")),o=e("./signature"),u=e("./message");function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(this instanceof l))return new l(e,t);if(this.text=a.default.removeTrailingSpaces(e).replace(/\r?\n/g,"\r\n"),t&&!(t instanceof o.Signature))throw new Error("Invalid signature input");this.signature=t||new o.Signature(new s.default.List)}l.prototype.getSigningKeyIds=function(){const t=[],e=this.signature.packets;return e.forEach(function(e){t.push(e.issuerKeyId)}),t},l.prototype.sign=async function(e,t=null,r=new Date,n=[]){return new l(this.text,await this.signDetached(e,t,r,n))},l.prototype.signDetached=async function(e,t=null,r=new Date,n=[]){const a=new s.default.Literal;return a.setText(this.text),new o.Signature(await(0,u.createSignaturePackets)(a,e,t,r,n,!0))},l.prototype.verify=function(e,t=new Date){return this.verifyDetached(this.signature,e,t)},l.prototype.verifyDetached=function(e,t,r=new Date){e=e.packets;const n=new s.default.Literal;return n.setText(this.text),(0,u.createVerificationObjects)(e,[n],t,r,!0)},l.prototype.getText=function(){return this.text.replace(/\r\n/g,"\n")},l.prototype.armor=function(){let e=this.signature.packets.map(function(e){return i.default.read(i.default.hash,e.hashAlgorithm).toUpperCase()});e=e.filter(function(e,t,r){return r.indexOf(e)===t});var t={hash:e.join(),text:this.text,data:this.signature.packets.write()};return n.default.encode(i.default.armor.signed,t)}},{"./encoding/armor":111,"./enums":113,"./message":126,"./packet":131,"./signature":151,"./util":158}],78:[function(a,e,i){!function(e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t,r=a("../enums"),n=(t=r)&&t.__esModule?t:{default:t};i.default={prefer_hash_algorithm:n.default.hash.sha256,encryption_cipher:n.default.symmetric.aes256,compression:n.default.compression.uncompressed,deflate_level:6,aead_protect:!1,aead_mode:n.default.aead.eax,aead_chunk_size_byte:12,v5_keys:!1,s2k_iteration_count_byte:224,integrity_protect:!0,ignore_mdc_error:!1,allow_unauthenticated_stream:!1,checksum_required:!1,rsa_blinding:!0,password_collision_check:!1,revocations_expire:!1,allow_insecure_decryption_with_signing_keys:!1,use_native:!0,min_bytes_for_web_crypto:1e3,zero_copy:!1,debug:!1,tolerant:!0,show_version:!0,show_comment:!0,versionstring:"OpenPGP.js v4.10.10",commentstring:"https://openpgpjs.org",keyserver:"https://keyserver.ubuntu.com",node_store:"./openpgp.store",max_userid_length:5120,known_notations:["preferred-email-encoding@pgp.com","pka-address@gnupg.org"],use_indutny_elliptic:!0,external_indutny_elliptic:!1,indutny_elliptic_path:"./elliptic.min.js",indutny_elliptic_fetch_options:{},reject_hash_algorithms:new e.Set([n.default.hash.md5,n.default.hash.ripemd]),reject_message_hash_algorithms:new e.Set([n.default.hash.md5,n.default.hash.ripemd,n.default.hash.sha1])}}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../enums":113}],79:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./config.js");Object.defineProperty(r,"default",{enumerable:!0,get:function(){return((e=n)&&e.__esModule?e:{default:e}).default;var e}})},{"./config.js":78}],80:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var c=n(e("./cipher")),a=n(e("../util"));function n(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=e.length,e=function(t){if(a.default.isString(t)){var r=t.length,e=new ArrayBuffer(r);const n=new Uint8Array(e);for(let e=0;enew Uint8Array(a.update(b.from(e))))}(e,t,r,n);if("aes"===e.substr(0,3))return function(e,t,r,n){if(h.default.getWebCrypto()&&24!==t.length&&!h.default.isStream(r)&&r.length>=3e3*d.default.min_bytes_for_web_crypto)return async function(e,t,r,n){t=await p.importKey("raw",t,{name:"AES-CBC"},!1,["encrypt"]),e=f.default[e].blockSize,e=h.default.concatUint8Array([new Uint8Array(e),r]),e=new Uint8Array(await p.encrypt({name:"AES-CBC",iv:n},t,e)).subarray(0,r.length);return function(t,r){for(let e=0;ea.AES_Encrypt_process(e),()=>a.AES_Encrypt_finish())}(e,t,r,n);const i=new f.default[e](t),s=i.blockSize,o=n.slice();let u=new Uint8Array;n=e=>{e&&(u=h.default.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){var a=i.encrypt(o);for(r=0;rnew Uint8Array(a.update(b.from(e))))}(e,t,r,n);if("aes"===e.substr(0,3))return function(e,t,r){if(h.default.isStream(t)){const n=new c.AES_CFB(e,r);return l.default.transform(t,e=>n.AES_Decrypt_process(e),()=>n.AES_Decrypt_finish())}return c.AES_CFB.decrypt(t,e,r)}(t,r,n);const i=new f.default[e](t),s=i.blockSize;let o=n,u=new Uint8Array;n=e=>{e&&(u=h.default.concatUint8Array([u,e]));const t=new Uint8Array(u.length);let r,n=0;for(;e?u.length>=s:u.length;){var a=i.encrypt(o);for(o=u,r=0;r>>=8),n=255&(e>>>=8),n=this.sboxes[0][255&(e>>>=8)]+this.sboxes[1][n];return n^=this.sboxes[2][r],n+=this.sboxes[3][t]},n.prototype._encrypt_block=function(e){let t=e[0],r=e[1],n;for(n=0;n>>24-8*t&255,a[t+n]=r[1]>>>24-8*t&255;return a},n.prototype._decrypt_block=function(e){let t=e[0],r=e[1],n;for(n=this.NN+1;1=r.length&&(n=0);this.parray[e]=this.PARRAY[e]^t}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],n=0;n<256;++n)this.sboxes[e][n]=this.SBOXES[e][n];var t=[0,0];for(e=0;e>>24&255,r[e+1]=i>>>16&255,r[e+2]=i>>>8&255,r[e+3]=255&i,r[e+4]=n>>>24&255,r[e+5]=n>>>16&255,r[e+6]=n>>>8&255,r[e+7]=255&n}return r},this.decrypt=function(t){const r=new Array(t.length);for(let e=0;e>>24&255,r[e+1]=i>>>16&255,r[e+2]=i>>>8&255,r[e+3]=255&i,r[e+4]=n>>>24&255,r[e+5]=n>>16&255,r[e+6]=n>>8&255,r[e+7]=255&n}return r};const l=new Array(4);l[0]=new Array(4),l[0][0]=[4,0,13,15,12,14,8],l[0][1]=[5,2,16,18,17,19,10],l[0][2]=[6,3,23,22,21,20,9],l[0][3]=[7,1,26,25,27,24,11],l[1]=new Array(4),l[1][0]=[0,6,21,23,20,22,16],l[1][1]=[1,4,0,2,1,3,18],l[1][2]=[2,5,7,6,5,4,17],l[1][3]=[3,7,10,9,11,8,19],l[2]=new Array(4),l[2][0]=[4,0,13,15,12,14,8],l[2][1]=[5,2,16,18,17,19,10],l[2][2]=[6,3,23,22,21,20,9],l[2][3]=[7,1,26,25,27,24,11],l[3]=new Array(4),l[3][0]=[0,6,21,23,20,22,16],l[3][1]=[1,4,0,2,1,3,18],l[3][2]=[2,5,7,6,5,4,17],l[3][3]=[3,7,10,9,11,8,19];const f=new Array(4);function s(e,t,r){e=t+e,r=e<>>32-r;return(d[0][r>>>24]^d[1][r>>>16&255])-d[2][r>>>8&255]+d[3][255&r]}function o(e,t,r){e^=t,r=e<>>32-r;return d[0][r>>>24]-d[1][r>>>16&255]+d[2][r>>>8&255]^d[3][255&r]}function u(e,t,r){e=t-e,r=e<>>32-r;return(d[0][r>>>24]+d[1][r>>>16&255]^d[2][r>>>8&255])-d[3][255&r]}f[0]=new Array(4),f[0][0]=[24,25,23,22,18],f[0][1]=[26,27,21,20,22],f[0][2]=[28,29,19,18,25],f[0][3]=[30,31,17,16,28],f[1]=new Array(4),f[1][0]=[3,2,12,13,8],f[1][1]=[1,0,14,15,13],f[1][2]=[7,6,8,9,3],f[1][3]=[5,4,10,11,7],f[2]=new Array(4),f[2][0]=[19,18,28,29,25],f[2][1]=[17,16,30,31,28],f[2][2]=[23,22,24,25,18],f[2][3]=[21,20,26,27,22],f[3]=new Array(4),f[3][0]=[8,9,7,6,3],f[3][1]=[10,11,5,4,7],f[3][2]=[12,13,3,2,8],f[3][3]=[14,15,1,0,13],this.keySchedule=function(t){const r=new Array(8),n=new Array(32);let a;for(let e=0;e<4;e++)a=4*e,r[e]=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3];var i=[6,7,4,5];let s=0,o;for(let e=0;e<2;e++)for(let e=0;e<4;e++){for(a=0;a<4;a++){var u=l[e][a];o=r[u[1]],o^=d[4][r[u[2]>>>2]>>>24-8*(3&u[2])&255],o^=d[5][r[u[3]>>>2]>>>24-8*(3&u[3])&255],o^=d[6][r[u[4]>>>2]>>>24-8*(3&u[4])&255],o^=d[7][r[u[5]>>>2]>>>24-8*(3&u[5])&255],o^=d[i[a]][r[u[6]>>>2]>>>24-8*(3&u[6])&255],r[u[0]]=o}for(a=0;a<4;a++){var c=f[e][a];o=d[4][r[c[0]>>>2]>>>24-8*(3&c[0])&255],o^=d[5][r[c[1]>>>2]>>>24-8*(3&c[1])&255],o^=d[6][r[c[2]>>>2]>>>24-8*(3&c[2])&255],o^=d[7][r[c[3]>>>2]>>>24-8*(3&c[3])&255],o^=d[4+a][r[c[4]>>>2]>>>24-8*(3&c[4])&255],n[s]=o,s++}}for(let e=0;e<16;e++)this.masking[e]=n[e],this.rotate[e]=31&n[16+e]};const d=new Array(8);d[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],d[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],d[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],d[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],d[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],d[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],d[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],d[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function a(e){this.cast5=new n,this.cast5.setKey(e),this.encrypt=function(e){return this.cast5.encrypt(e)}}Object.defineProperty(r,"__esModule",{value:!0}),a.blockSize=a.prototype.blockSize=8,a.keySize=a.prototype.keySize=16,r.default=a},{}],85:[function(e,t,r){"use strict";function n(e,t,r,n,a,i){var s,o,u,c,l=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],f=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],d=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],h=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],p=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],y=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],b=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],m=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let g=0,w,v,_,k,A,S,E,P,x,M,K=t.length;var C=32===e.length?3:9;S=3==C?r?[0,32,2]:[30,-2,-2]:r?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],r&&(t=function(t,e){var r=8-t.length%8;let n;if(2===e&&r<8)n=" ".charCodeAt(0);else if(1===e)n=r;else{if(e||!(r<8)){if(8==r)return t;throw new Error("des: invalid padding")}n=0}const a=new Uint8Array(t.length+r);for(let e=0;e>>4^A),A^=_,k^=_<<4,_=65535&(k>>>16^A),A^=_,k^=_<<16,_=858993459&(A>>>2^k),k^=_,A^=_<<2,_=16711935&(A>>>8^k),k^=_,A^=_<<8,_=1431655765&(k>>>1^A),A^=_,k^=_<<1,k=k<<1|k>>>31,A=A<<1|A>>>31,v=0;v>>4|A<<28)^e[w+1],_=k,k=A,A=_^(f[s>>>24&63]|h[s>>>16&63]|y[s>>>8&63]|m[63&s]|l[o>>>24&63]|d[o>>>16&63]|p[o>>>8&63]|b[63&o]);_=k,k=A,A=_}k=k>>>1|k<<31,A=A>>>1|A<<31,_=1431655765&(k>>>1^A),A^=_,k^=_<<1,_=16711935&(A>>>8^k),k^=_,A^=_<<8,_=858993459&(A>>>2^k),k^=_,A^=_<<2,_=65535&(k>>>16^A),A^=_,k^=_<<16,_=252645135&(k>>>4^A),A^=_,k^=_<<4,1===n&&(r?(E=k,x=A):(k^=P,A^=M)),j[U++]=k>>>24,j[U++]=k>>>16&255,j[U++]=k>>>8&255,j[U++]=255&k,j[U++]=A>>>24,j[U++]=A>>>16&255,j[U++]=A>>>8&255,j[U++]=255&A}return r||(j=function(e,t){let r=null,n;if(2===t)n=" ".charCodeAt(0);else if(1===t)r=e[e.length-1];else{if(t)throw new Error("des: invalid padding");n=0}if(!r){for(r=1;e[e.length-r]===n;)r++;r--}return e.subarray(0,e.length-r)}(j,i)),j}function a(n){var a=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],i=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],s=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],u=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],y=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],b=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],t=8>>4^r),r^=_,t^=_<<4,_=65535&(r>>>-16^t),t^=_,r^=_<<-16,_=858993459&(t>>>2^r),r^=_,t^=_<<2,_=65535&(r>>>-16^t),t^=_,r^=_<<-16,_=1431655765&(t>>>1^r),r^=_,t^=_<<1,_=16711935&(r>>>8^t),t^=_,r^=_<<8,_=1431655765&(t>>>1^r),r^=_,t^=_<<1,_=t<<8|r>>>20&240,t=r<<24|r<<8&16711680|r>>>8&65280|r>>>24&240,r=_;for(let e=0;e>>26,r<<2|r>>>26):(t=t<<1|t>>>27,r<<1|r>>>27),t&=-15,r&=-15,w=a[t>>>28]|i[t>>>24&15]|s[t>>>20&15]|o[t>>>16&15]|u[t>>>12&15]|c[t>>>8&15]|l[t>>>4&15],_=65535&((v=f[r>>>28]|d[r>>>24&15]|h[r>>>20&15]|p[r>>>16&15]|y[r>>>12&15]|b[r>>>8&15]|m[r>>>4&15])>>>16^w),g[S++]=w^_,g[S++]=v^_<<16}return g}function i(t){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(t.subarray(8*e,8*e+8)));this.encrypt=function(e){return n(a(this.key[2]),n(a(this.key[1]),n(a(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}Object.defineProperty(r,"__esModule",{value:!0}),i.keySize=i.prototype.keySize=24,i.blockSize=i.prototype.blockSize=8,r.default={DES:function(e){this.key=e,this.encrypt=function(e,t){return n(a(this.key),e,!0,0,null,t)},this.decrypt=function(e,t){return n(a(this.key),e,!1,0,null,t)}},TripleDES:i}},{}],86:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(e("./aes")),a=o(e("./des.js")),i=o(e("./cast5")),s=o(e("./twofish")),e=o(e("./blowfish"));function o(e){return e&&e.__esModule?e:{default:e}}r.default={aes128:(0,n.default)(128),aes192:(0,n.default)(192),aes256:(0,n.default)(256),des:a.default.DES,tripledes:a.default.TripleDES,"3des":a.default.TripleDES,cast5:i.default,twofish:s.default,blowfish:e.default,idea:function(){throw new Error("IDEA symmetric-key algorithm not implemented")}}},{"./aes":82,"./blowfish":83,"./cast5":84,"./des.js":85,"./twofish":87}],87:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const K=4294967295;function C(e,t){return(e<>>32-t)&K}function j(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function f(e,t,r){e.splice(t,4,255&r,r>>>8&255,r>>>16&255,r>>>24&255)}function U(e,t){return e>>>8*t&255}function n(){let P=null,o=null,u=-1,x=[],M=[[],[],[],[]];function c(e){return M[0][U(e,0)]^M[1][U(e,1)]^M[2][U(e,2)]^M[3][U(e,3)]}function l(e){return M[0][U(e,3)]^M[1][U(e,0)]^M[2][U(e,1)]^M[3][U(e,2)]}return{name:"twofish",blocksize:16,open:function(e){P=e;let t,r,n,a,i;const s=[],o=[],u=[];let c;const l=[];var f,d,h;const p=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],y=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],b=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],m=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],g=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],w=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],v=[[],[]],_=[[],[],[],[]];function k(e){return e^e>>2^[0,90,180,238][3&e]}function A(e){return e^e>>1^e>>2^[0,238,180,90][3&e]}function S(e,t){var r=t>>4,n=15&t,t=p[e][r^n],r=y[e][g[n]^w[r]];return m[e][g[r]^w[t]]<<4|b[e][t^r]}function E(e,t){let r=U(e,0),n=U(e,1),a=U(e,2),i=U(e,3);switch(c){case 4:r=v[1][r]^U(t[3],0),n=v[0][n]^U(t[3],1),a=v[0][a]^U(t[3],2),i=v[1][i]^U(t[3],3);case 3:r=v[1][r]^U(t[2],0),n=v[1][n]^U(t[2],1),a=v[0][a]^U(t[2],2),i=v[0][i]^U(t[2],3);case 2:r=v[0][v[0][r]^U(t[1],0)]^U(t[0],0),n=v[0][v[1][n]^U(t[1],1)]^U(t[0],1),a=v[1][v[0][a]^U(t[1],2)]^U(t[0],2),i=v[1][v[1][i]^U(t[1],3)]^U(t[0],3)}return _[0][r]^_[1][n]^_[2][a]^_[3][i]}for(P=P.slice(0,32),t=P.length;16!==t&&24!==t&&32!==t;)P[t++]=0;for(t=0;t>2]=j(P,t);for(t=0;t<256;t++)v[0][t]=S(0,t),v[1][t]=S(1,t);for(t=0;t<256;t++)d=k(f=v[1][t]),h=A(f),_[0][t]=f+(d<<8)+(h<<16)+(h<<24),_[2][t]=d+(h<<8)+(f<<16)+(h<<24),d=k(f=v[0][t]),h=A(f),_[1][t]=h+(h<<8)+(d<<16)+(f<<24),_[3][t]=d+(f<<8)+(h<<16)+(d<<24);for(c=u.length/2,t=0;t>>24,t=t<<8&K|e>>>24,e=e<<8&K,a=n<<1,128&n&&(a^=333),t^=n^a<<16,a^=n>>>1,1&n&&(a^=166),t^=a<<24|a<<8;return t}(r,n);for(t=0;t<40;t+=2)r=16843009*t,n=r+16843009,r=E(r,s),n=C(E(n,o),8),x[t]=r+n&K,x[t+1]=C(r+2*n,9);for(t=0;t<256;t++)switch(r=n=a=i=t,c){case 4:r=v[1][r]^U(l[3],0),n=v[0][n]^U(l[3],1),a=v[0][a]^U(l[3],2),i=v[1][i]^U(l[3],3);case 3:r=v[1][r]^U(l[2],0),n=v[1][n]^U(l[2],1),a=v[0][a]^U(l[2],2),i=v[0][i]^U(l[2],3);case 2:M[0][t]=_[0][v[0][v[0][r]^U(l[1],0)]^U(l[0],0)],M[1][t]=_[1][v[0][v[1][n]^U(l[1],1)]^U(l[0],1)],M[2][t]=_[2][v[1][v[0][a]^U(l[1],2)]^U(l[0],2)],M[3][t]=_[3][v[1][v[1][i]^U(l[1],3)]^U(l[0],3)]}},close:function(){x=[],M=[[],[],[],[]]},encrypt:function(e,t){o=e,u=t;var r,n,a,i,s=[j(o,u)^x[0],j(o,u+4)^x[1],j(o,u+8)^x[2],j(o,u+12)^x[3]];for(let e=0;e<8;e++)r=e,i=a=void 0,a=c((n=s)[0]),i=l(n[1]),n[2]=C(n[2]^a+i+x[4*r+8]&K,31),n[3]=C(n[3],1)^a+2*i+x[4*r+9]&K,a=c(n[2]),i=l(n[3]),n[0]=C(n[0]^a+i+x[4*r+10]&K,31),n[1]=C(n[1],1)^a+2*i+x[4*r+11]&K;return f(o,u,s[2]^x[4]),f(o,u+4,s[3]^x[5]),f(o,u+8,s[0]^x[6]),f(o,u+12,s[1]^x[7]),u+=16,o},decrypt:function(e,t){o=e,u=t;var r,n,a,i,s=[j(o,u)^x[4],j(o,u+4)^x[5],j(o,u+8)^x[6],j(o,u+12)^x[7]];for(let e=7;0<=e;e--)r=e,i=a=void 0,a=c((n=s)[0]),i=l(n[1]),n[2]=C(n[2],1)^a+i+x[4*r+10]&K,n[3]=C(n[3]^a+2*i+x[4*r+11]&K,31),a=c(n[2]),i=l(n[3]),n[0]=C(n[0],1)^a+i+x[4*r+8]&K,n[1]=C(n[1]^a+2*i+x[4*r+9]&K,31);f(o,u,s[2]^x[0]),f(o,u+4,s[3]^x[1]),f(o,u+8,s[0]^x[2]),f(o,u+12,s[1]^x[3]),u+=16},finalize:function(){return o}}}function a(e){this.tf=n(),this.tf.open(Array.from(e),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}a.keySize=a.prototype.keySize=32,a.blockSize=a.prototype.blockSize=16,r.default=a},{}],88:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=e("asmcrypto.js/dist_es5/aes/cbc"),i=e("../util"),s=(n=i)&&n.__esModule?n:{default:n};const o=s.default.getWebCrypto(),u=s.default.getNodeCrypto(),c=s.default.getNodeBuffer(),l=16;function f(t,r){var n=t.length-l;for(let e=0;e{t.update(b.from(e))},()=>new Uint8Array(t.digest()))}}function g(r,n){return async function(e){if(!d.default.isStream(e)&&p&&n&&e.length>=f.default.min_bytes_for_web_crypto)return new Uint8Array(await p.digest(n,e));const t=r();return c.default.transform(e,e=>{t.update(e)},()=>new Uint8Array(t.digest()))}}function w(r,n){return async function(e){if(d.default.isStream(e)){const t=new r;return c.default.transform(e,e=>{t.process(e)},()=>t.finish().result)}return p&&n&&e.length>=f.default.min_bytes_for_web_crypto?new Uint8Array(await p.digest(n,e)):r.bytes(e)}}let v;v=y?{md5:m("md5"),sha1:m("sha1"),sha224:m("sha224"),sha256:m("sha256"),sha384:m("sha384"),sha512:m("sha512"),ripemd:m("ripemd160")}:{md5:l.default,sha1:w(n.Sha1,-1===navigator.userAgent.indexOf("Edge")&&"SHA-1"),sha224:g(i.default),sha256:w(a.Sha256,"SHA-256"),sha384:g(s.default,"SHA-384"),sha512:g(o.default,"SHA-512"),ripemd:g(u.ripemd160)},r.default={md5:v.md5,sha1:v.sha1,sha224:v.sha224,sha256:v.sha256,sha384:v.sha384,sha512:v.sha512,ripemd:v.ripemd,digest:function(e,t){switch(e){case 1:return this.md5(t);case 2:return this.sha1(t);case 3:return this.ripemd(t);case 8:return this.sha256(t);case 9:return this.sha384(t);case 10:return this.sha512(t);case 11:return this.sha224(t);default:throw new Error("Invalid hash function.")}},getHashByteLength:function(e){switch(e){case 1:return 16;case 2:case 3:return 20;case 8:return 32;case 9:return 48;case 10:return 64;case 11:return 28;default:throw new Error("Invalid hash algorithm.")}}}},{"../../config":79,"../../util":158,"./md5":93,"asmcrypto.js/dist_es5/hash/sha1/sha1":11,"asmcrypto.js/dist_es5/hash/sha256/sha256":13,"hash.js/lib/hash/ripemd":37,"hash.js/lib/hash/sha/224":40,"hash.js/lib/hash/sha/384":42,"hash.js/lib/hash/sha/512":43,"web-stream-tools":75}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=e("../../util"),i=(n=a)&&n.__esModule?n:{default:n};function s(e,t){var r=u(r=e[0],i=e[1],a=e[2],n=e[3],t[0],7,-680876936),n=u(n,r,i,a,t[1],12,-389564586),a=u(a,n,r,i,t[2],17,606105819),i=u(i,a,n,r,t[3],22,-1044525330);r=u(r,i,a,n,t[4],7,-176418897),n=u(n,r,i,a,t[5],12,1200080426),a=u(a,n,r,i,t[6],17,-1473231341),i=u(i,a,n,r,t[7],22,-45705983),r=u(r,i,a,n,t[8],7,1770035416),n=u(n,r,i,a,t[9],12,-1958414417),a=u(a,n,r,i,t[10],17,-42063),i=u(i,a,n,r,t[11],22,-1990404162),r=u(r,i,a,n,t[12],7,1804603682),n=u(n,r,i,a,t[13],12,-40341101),a=u(a,n,r,i,t[14],17,-1502002290),r=c(r,i=u(i,a,n,r,t[15],22,1236535329),a,n,t[1],5,-165796510),n=c(n,r,i,a,t[6],9,-1069501632),a=c(a,n,r,i,t[11],14,643717713),i=c(i,a,n,r,t[0],20,-373897302),r=c(r,i,a,n,t[5],5,-701558691),n=c(n,r,i,a,t[10],9,38016083),a=c(a,n,r,i,t[15],14,-660478335),i=c(i,a,n,r,t[4],20,-405537848),r=c(r,i,a,n,t[9],5,568446438),n=c(n,r,i,a,t[14],9,-1019803690),a=c(a,n,r,i,t[3],14,-187363961),i=c(i,a,n,r,t[8],20,1163531501),r=c(r,i,a,n,t[13],5,-1444681467),n=c(n,r,i,a,t[2],9,-51403784),a=c(a,n,r,i,t[7],14,1735328473),r=l(r,i=c(i,a,n,r,t[12],20,-1926607734),a,n,t[5],4,-378558),n=l(n,r,i,a,t[8],11,-2022574463),a=l(a,n,r,i,t[11],16,1839030562),i=l(i,a,n,r,t[14],23,-35309556),r=l(r,i,a,n,t[1],4,-1530992060),n=l(n,r,i,a,t[4],11,1272893353),a=l(a,n,r,i,t[7],16,-155497632),i=l(i,a,n,r,t[10],23,-1094730640),r=l(r,i,a,n,t[13],4,681279174),n=l(n,r,i,a,t[0],11,-358537222),a=l(a,n,r,i,t[3],16,-722521979),i=l(i,a,n,r,t[6],23,76029189),r=l(r,i,a,n,t[9],4,-640364487),n=l(n,r,i,a,t[12],11,-421815835),a=l(a,n,r,i,t[15],16,530742520),r=f(r,i=l(i,a,n,r,t[2],23,-995338651),a,n,t[0],6,-198630844),n=f(n,r,i,a,t[7],10,1126891415),a=f(a,n,r,i,t[14],15,-1416354905),i=f(i,a,n,r,t[5],21,-57434055),r=f(r,i,a,n,t[12],6,1700485571),n=f(n,r,i,a,t[3],10,-1894986606),a=f(a,n,r,i,t[10],15,-1051523),i=f(i,a,n,r,t[1],21,-2054922799),r=f(r,i,a,n,t[8],6,1873313359),n=f(n,r,i,a,t[15],10,-30611744),a=f(a,n,r,i,t[6],15,-1560198380),i=f(i,a,n,r,t[13],21,1309151649),r=f(r,i,a,n,t[4],6,-145523070),n=f(n,r,i,a,t[11],10,-1120210379),a=f(a,n,r,i,t[2],15,718787259),i=f(i,a,n,r,t[9],21,-343485551),e[0]=h(r,e[0]),e[1]=h(i,e[1]),e[2]=h(a,e[2]),e[3]=h(n,e[3])}function o(e,t,r,n,a,i){return t=h(h(t,e),h(n,i)),h(t<>>32-a,r)}function u(e,t,r,n,a,i,s){return o(t&r|~t&n,e,t,a,i,s)}function c(e,t,r,n,a,i,s){return o(t&n|r&~n,e,t,a,i,s)}function l(e,t,r,n,a,i,s){return o(t^r^n,e,t,a,i,s)}function f(e,t,r,n,a,i,s){return o(r^(t|~n),e,t,a,i,s)}const d="0123456789abcdef".split("");function h(e,t){return e+t&4294967295}r.default=async function(e){return e=function(e){var t=e.length,r=[1732584193,-271733879,-1732584194,271733878];let n;for(n=64;n<=e.length;n+=64)s(r,function(e){const t=[];let r;for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}(e.substring(n-64,n)));e=e.substring(n-64);const a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),55>8*r+4&15]+d[e>>8*r&15];return t}(t[e]);return t.join("")}(e))}},{"../../util":158}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=y(e("./cipher")),a=y(e("./hash")),i=y(e("./cfb")),s=y(e("./gcm")),o=y(e("./eax")),u=y(e("./ocb")),c=y(e("./public_key")),l=y(e("./signature")),f=y(e("./random")),d=y(e("./pkcs1")),h=y(e("./pkcs5")),p=y(e("./crypto")),e=y(e("./aes_kw"));function y(e){return e&&e.__esModule?e:{default:e}}e={cipher:n.default,hash:a.default,cfb:i.default,gcm:s.default,experimental_gcm:s.default,eax:o.default,ocb:u.default,publicKey:c.default,signature:l.default,random:f.default,pkcs1:d.default,pkcs5:h.default,aes_kw:e.default};Object.assign(e,p.default),r.default=e},{"./aes_kw":80,"./cfb":81,"./cipher":86,"./crypto":89,"./eax":90,"./gcm":91,"./hash":92,"./ocb":95,"./pkcs1":96,"./pkcs5":97,"./public_key":106,"./random":109,"./signature":110}],95:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("./cipher")),m=a(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}function g(t){let r=0;for(let e=1;0==(t&e);e<<=1)r++;return r}function w(t,r){for(let e=0;e>3,17+(r>>3)),8-(7&r)).subarray(1),c=new Uint8Array(16);const l=new Uint8Array(t.length+16);let f,d=0;for(f=0;fnew Uint8Array((0,n.default)().update(e).digest());r.default={sign:async function(e,t,r,n,a,i){n=u.default.concatUint8Array([a,n.subarray(1)]);const s=o.default.sign.detached(i,n);return{R:s.subarray(0,32),S:s.subarray(32)}},verify:async function(e,t,{R:r,S:n},a,i,s){return n=u.default.concatUint8Array([r,n]),o.default.sign.detached.verify(s,n,i.subarray(1))},validateParams:async function(e,t,r){return"ed25519"===e.getName()&&(r=o.default.sign.keyPair.fromSeed(r).publicKey,r=new Uint8Array([64,...r]),u.default.equalsUint8Array(t,r))},parseParams:function(e){if(e.length<2||3(0,s.dl)(e,t)),n=await r,a=URL.createObjectURL(new Blob([n],{type:"text/javascript"}));if(await(0,s.loadScript)(a),URL.revokeObjectURL(a),i.openpgp.elliptic)return i.openpgp.elliptic;throw new Error("Elliptic library failed to load correctly")}().catch(e=>{throw n=void 0,e});return n}();return new t.ec(e)};var s=a("../../../lightweight_helper"),o=e(a("../../../config")),r=e(a("../../../util"));function e(e){return e&&e.__esModule?e:{default:e}}let n}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../../config":79,"../../../lightweight_helper":125,"../../../util":158,elliptic:18}],106:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(e("tweetnacl/nacl-fast-light.js")),a=o(e("./rsa")),i=o(e("./elgamal")),s=o(e("./elliptic")),e=o(e("./dsa"));function o(e){return e&&e.__esModule?e:{default:e}}r.default={rsa:a.default,elgamal:i.default,elliptic:s.default,dsa:e.default,nacl:n.default}},{"./dsa":98,"./elgamal":99,"./elliptic":104,"./rsa":108,"tweetnacl/nacl-fast-light.js":72}],107:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var f=n(e("bn.js")),d=n(e("../random"));function n(e){return e&&e.__esModule?e:{default:e}}r.default={randomProbablePrime:async function(e,t,r){const n=new f.default(1).shln(e-1),a=new f.default(30),i=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2];let s=await d.default.getRandomBN(n,n.shln(1)),o=s.mod(a).toNumber();for(;s.iaddn(i[o]),o=(o+i[o])%i.length,s.bitLength()>e&&(s=s.mod(n.shln(1)).iadd(n),o=s.mod(a).toNumber()),!await u(s,t,r););return s},isProbablePrime:u,fermat:a,millerRabin:o,divisionTest:i};async function u(e,t,r){return!(t&&!e.subn(1).gcd(t).eqn(1))&&(!!i(e)&&(!!a(e)&&!!await o(e,r)))}function a(e,t){return 0===(t=t||new f.default(2)).toRed(f.default.mont(e)).redPow(e.subn(1)).fromRed().cmpn(1)}function i(t){return s.every(e=>0!==t.modn(e))}const s=[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,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999];async function o(e,t,r){var n=e.bitLength(),a=f.default.mont(e),i=new f.default(1).toRed(a);t=t||Math.max(1,n/48|0);const s=e.subn(1);var o=s.toRed(a);let u=0;for(;!s.testn(u);)u++;for(var c=e.shrn(u);0_.generateKeyPair("rsa",o,(e,t,r)=>{e?a(e):n(k.decode(r,"der"))}));return{n:e.modulus,e:e.publicExponent,d:e.privateExponent,p:e.prime2,q:e.prime1,u:e.coefficient}}let t=await c.default.randomProbablePrime(n-(n>>1),a,40),r=await c.default.randomProbablePrime(n>>1,a,40);t.cmp(r)<0&&(s=[t,r],r=s[0],t=s[1]);var s=r.subn(1).mul(t.subn(1));return{n:r.mul(t),e:a,d:a.invm(s),p:r,q:t,u:r.invm(t)}},validateParams:async function(e,t,r,n,a,i){if(e=new y.default(e),n=new y.default(n),a=new y.default(a),!n.mul(a).eq(e))return!1;var s=new y.default(1);const o=new y.default(2);if(i=new y.default(i),!n.mul(i).umod(a).eq(s))return!1;t=new y.default(t),r=new y.default(r);const u=await b.default.getRandomBN(o,o.shln(e.bitLength()/3)),c=u.mul(r).mul(t);return!(!c.umod(n.sub(s)).eq(u)||!c.umod(a.sub(s)).eq(u))},bnSign:async function(e,t,r,n){t=new y.default(t);const a=new y.default(await w.default.emsa.encode(e,n,t.byteLength()),16);if(r=new y.default(r),t.cmp(a)<=0)throw new Error("Message size cannot exceed modulus size");n=new y.default.red(t);return a.toRed(n).redPow(r).toArrayLike(Uint8Array,"be",t.byteLength())},webSign:async function(e,t,r,n,a,i,s,o){s=function(e,t,r,n,a,i){const s=new y.default(n),o=new y.default(a),u=new y.default(r);let c=u.mod(o.subn(1)),l=u.mod(s.subn(1));return l=l.toArrayLike(Uint8Array),c=c.toArrayLike(Uint8Array),{kty:"RSA",n:g.default.Uint8Array_to_b64(e,!0),e:g.default.Uint8Array_to_b64(t,!0),d:g.default.Uint8Array_to_b64(r,!0),p:g.default.Uint8Array_to_b64(a,!0),q:g.default.Uint8Array_to_b64(n,!0),dp:g.default.Uint8Array_to_b64(c,!0),dq:g.default.Uint8Array_to_b64(l,!0),qi:g.default.Uint8Array_to_b64(i,!0),ext:!0}}(r,n,a,i,s,o),o={name:"RSASSA-PKCS1-v1_5",hash:{name:e}},o=await l.importKey("jwk",s,o,!1,["sign"]);return new Uint8Array(await l.sign({name:"RSASSA-PKCS1-v1_5",hash:e},o,t))},nodeSign:async function(e,t,r,n,a,i,s,o){const u=new y.default(i),c=new y.default(s),l=new y.default(a);var f=l.mod(c.subn(1)),d=l.mod(u.subn(1));const h=_.createSign(p.default.read(p.default.hash,e));h.write(t),h.end();d={version:0,modulus:new y.default(r),publicExponent:new y.default(n),privateExponent:new y.default(a),prime1:new y.default(s),prime2:new y.default(i),exponent1:f,exponent2:d,coefficient:new y.default(o)};if(void 0!==_.createPrivateKey){o=k.encode(d,"der");return new Uint8Array(h.sign({key:o,format:"der",type:"pkcs1"}))}d=k.encode(d,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(h.sign(d))},bnVerify:async function(e,t,r,n,a){if(r=new y.default(r),t=new y.default(t),n=new y.default(n),r.cmp(t)<=0)throw new Error("Signature size cannot exceed modulus size");var i=new y.default.red(r),n=t.toRed(i).redPow(n).toArrayLike(Uint8Array,"be",r.byteLength()),r=await w.default.emsa.encode(e,a,r.byteLength());return g.default.Uint8Array_to_hex(n)===r},webVerify:async function(e,t,r,n,a){n=n,a=a,a={kty:"RSA",n:g.default.Uint8Array_to_b64(n,!0),e:g.default.Uint8Array_to_b64(a,!0),ext:!0},a=await l.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:{name:e}},!1,["verify"]);return l.verify({name:"RSASSA-PKCS1-v1_5",hash:e},a,r,t)},nodeVerify:async function(e,t,r,n,a){const i=_.createVerify(p.default.read(p.default.hash,e));i.write(t),i.end();a={modulus:new y.default(n),publicExponent:new y.default(a)};let s;s=void 0!==_.createPrivateKey?{key:o.encode(a,"der"),format:"der",type:"pkcs1"}:o.encode(a,"pem",{label:"RSA PUBLIC KEY"});try{return await i.verify(s,r)}catch(e){return!1}},nodeEncrypt:async function(e,t,r){r={modulus:new y.default(t),publicExponent:new y.default(r)};let n;return n=void 0!==_.createPrivateKey?{key:o.encode(r,"der"),format:"der",type:"pkcs1",padding:_.constants.RSA_PKCS1_PADDING}:{key:o.encode(r,"pem",{label:"RSA PUBLIC KEY"}),padding:_.constants.RSA_PKCS1_PADDING},new Uint8Array(_.publicEncrypt(n,e))},bnEncrypt:async function(e,t,r){if(t=new y.default(t),e=(e=new v.default(await w.default.eme.encode(g.default.Uint8Array_to_str(e),t.byteLength()))).toBN(),r=new y.default(r),t.cmp(e)<=0)throw new Error("Message size cannot exceed modulus size");var n=new y.default.red(t);return e.toRed(n).redPow(r).toArrayLike(Uint8Array,"be",t.byteLength())},nodeDecrypt:function(e,t,r,n,a,i,s){const o=new y.default(a),u=new y.default(i),c=new y.default(n);var l=c.mod(u.subn(1)),f=c.mod(o.subn(1)),s={version:0,modulus:new y.default(t),publicExponent:new y.default(r),privateExponent:new y.default(n),prime1:new y.default(i),prime2:new y.default(a),exponent1:l,exponent2:f,coefficient:new y.default(s)};let d;d=void 0!==_.createPrivateKey?{key:k.encode(s,"der"),format:"der",type:"pkcs1",padding:_.constants.RSA_PKCS1_PADDING}:{key:k.encode(s,"pem",{label:"RSA PRIVATE KEY"}),padding:_.constants.RSA_PKCS1_PADDING};try{return g.default.Uint8Array_to_str(_.privateDecrypt(d,e))}catch(e){throw new Error("Decryption error")}},bnDecrypt:async function(e,t,r,n,a,i,s){if(e=new y.default(e),t=new y.default(t),r=new y.default(r),n=new y.default(n),a=new y.default(a),i=new y.default(i),s=new y.default(s),t.cmp(e)<=0)throw new Error("Data too large.");var o=n.mod(i.subn(1)),u=n.mod(a.subn(1)),c=new y.default.red(a),n=new y.default.red(i),i=new y.default.red(t);let l;m.default.rsa_blinding&&(l=(await b.default.getRandomBN(new y.default(2),t)).toRed(i),r=l.redInvm().redPow(r),e=e.toRed(i).redMul(r).fromRed());const f=e.toRed(c).redPow(u),d=e.toRed(n).redPow(o);o=d.redSub(f.fromRed().toRed(n));const h=s.toRed(n).redMul(o).fromRed();let p=h.mul(a).add(f).toRed(i);return m.default.rsa_blinding&&(p=p.redMul(l)),p=new v.default(p).toUint8Array("be",t.byteLength()),w.default.eme.decode(g.default.Uint8Array_to_str(p))},prime:c.default}}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../config":79,"../../enums":113,"../../type/mpi":155,"../../util":158,"../pkcs1":96,"../random":109,"./prime":107,"asn1.js":"asn1.js","bn.js":16}],109:[function(i,e,s){!function(r){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a=e(i("bn.js"));function e(e){return e&&e.__esModule?e:{default:e}}const n=e(i("../util")).default.detectNode()&&i("crypto");function t(){this.buffer=null,this.size=null,this.callback=null}s.default={getRandomBytes:async function(e){const t=new Uint8Array(e);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else if(void 0!==r&&"object"==typeof r.msCrypto&&"function"==typeof r.msCrypto.getRandomValues)r.msCrypto.getRandomValues(t);else if(n){e=n.randomBytes(t.length);t.set(e)}else{if(!this.randomBuffer.buffer)throw new Error("No secure random number generator available.");await this.randomBuffer.get(t)}return t},getRandomBN:async function(e,t){if(t.cmp(e)<=0)throw new Error("Illegal parameter value: max <= min");const r=t.sub(e);t=r.byteLength();const n=new a.default(await this.getRandomBytes(t+8));return n.mod(r).add(e)},randomBuffer:new t},t.prototype.init=function(e,t){this.buffer=new Uint8Array(e),this.size=0,this.callback=t},t.prototype.set=function(e){if(!this.buffer)throw new Error("RandomBuffer is not initialized");if(!(e instanceof Uint8Array))throw new Error("Invalid type: buf not an Uint8Array");var t=this.buffer.length-this.size;e.length>t&&(e=e.subarray(0,t)),this.buffer.set(e,this.size),this.size+=e.length},t.prototype.get=async function(t){if(!this.buffer)throw new Error("RandomBuffer is not initialized");if(!(t instanceof Uint8Array))throw new Error("Invalid type: buf not an Uint8Array");if(this.size{var r=o?Math.floor(t.length/4):0,n=new Uint32Array(t.buffer,t.byteOffset,r);for(let e=0;e>24&255]^s[1][a>>16&255]^s[2][a>>8&255]^s[3][a>>0&255];for(let e=4*r;e>8^s[0][255&a^t[e]]},()=>new Uint8Array([a,a>>8,a>>16]))}(e);return c.default.encode(e)}const s=[new Array(255),new Array(255),new Array(255),new Array(255)];for(let e=0;e<=255;e++){let t=e<<16;for(let e=0;e<8;e++)t=t<<1^(0!=(8388608&t)?8801531:0);s[0][e]=(16711680&t)>>16|65280&t|(255&t)<<16}for(let e=0;e<=255;e++)s[1][e]=s[0][e]>>8^s[0][255&s[0][e]];for(let e=0;e<=255;e++)s[2][e]=s[1][e]>>8^s[0][255&s[1][e]];for(let e=0;e<=255;e++)s[3][e]=s[2][e]>>8^s[0][255&s[2][e]];const o=(e=new ArrayBuffer(2),new DataView(e).setInt16(0,255,!0),255===new Int16Array(e)[0]);function P(t){for(let e=0;e{try{const w=/^-----[^-]+-----$/m,v=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let l;const _=[];let f=_,d,h=[],p,y,b=c.default.decode(k.default.transformPair(e,async(e,t)=>{const r=k.default.getReader(e);try{for(;;){let e=await r.readLine();if(void 0===e)throw new Error("Misformed armored text");if(e=S.default.removeTrailingSpaces(e.replace(/[\r\n]/g,"")),l)if(d)p||2!==l||(w.test(e)?(h=h.join("\r\n"),p=!0,P(f),f=[],d=!1):h.push(e.replace(/^- /,"")));else if(w.test(e)&&g(new Error("Mandatory blank line missing between armor headers and armor data")),v.test(e)){if(P(f),d=!0,p||2!==l){m({text:h,data:b,headers:_,type:l});break}}else f.push(e);else w.test(e)&&(l=function(e){if(!(e=e.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m)))throw new Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?A.default.armor.multipart_section:/MESSAGE, PART \d+/.test(e[1])?A.default.armor.multipart_last:/SIGNED MESSAGE/.test(e[1])?A.default.armor.signed:/MESSAGE/.test(e[1])?A.default.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?A.default.armor.public_key:/PRIVATE KEY BLOCK/.test(e[1])?A.default.armor.private_key:/SIGNATURE/.test(e[1])?A.default.armor.signature:void 0}(e))}}catch(e){return void g(e)}const n=k.default.getWriter(t);try{for(;;){await n.ready;var a=await r.read(),i=a.done,s=a.value;if(i)throw new Error("Misformed armored text");const u=s+"";if(-1!==u.indexOf("=")||-1!==u.indexOf("-")){let e=await r.readToEnd();e.length||(e=""),e=u+e,e=S.default.removeTrailingSpaces(e.replace(/\r/g,""));const c=e.split(w);if(1===c.length)throw new Error("Misformed armored text");var o=function(e){let t=e,r="";var n=e.lastIndexOf("=");return 0<=n&&n!==e.length-1&&(t=e.slice(0,n),r=e.slice(n+1).substr(0,4)),{body:t,checksum:r}}(c[0].slice(0,-1));y=o.checksum,await n.write(o.body);break}await n.write(u)}await n.ready,await n.close()}catch(e){await n.abort(e)}}));b=k.default.transformPair(b,async(e,t)=>{const r=k.default.readToEnd(E(k.default.passiveClone(e)));r.catch(()=>{}),await k.default.pipe(e,t,{preventClose:!0});const n=k.default.getWriter(t);try{var a=(await r).replace("\r\n","");if(y!==a&&(y||i.default.checksum_required))throw new Error("Ascii armor integrity check on message failed: '"+y+"' should be '"+a+"'");await n.ready,await n.close()}catch(e){await n.abort(e)}})}catch(e){g(e)}})}}},{"../config":79,"../enums.js":113,"../util":158,"./base64.js":112,"web-stream-tools":75}],112:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("web-stream-tools")),i=a(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}const s=i.default.getNodeBuffer();let o,u;u=s?(o=e=>s.from(e).toString("base64"),e=>{e=s.from(e,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(o=e=>btoa(i.default.Uint8Array_to_str(e)),e=>i.default.str_to_Uint8Array(atob(e))),r.default={encode:function(e){let a=new Uint8Array;return n.default.transform(e,e=>{a=i.default.concatUint8Array([a,e]);const t=[];var r=Math.floor(a.length/45),e=45*r;const n=o(a.subarray(0,e));for(let e=0;ea.length?o(a)+"\r\n":"")},decode:function(e){let i="";return n.default.transform(e,e=>{i+=e;let t=0;const r=[" ","\t","\r","\n"];for(let e=0;eu(i))}}},{"../util":158,"web-stream-tools":75}],113:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=Symbol("byValue");r.default={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsa_encrypt_sign:1,rsa_encrypt:2,rsa_sign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsa:22,aedh:23,aedsa:24},symmetric:{plaintext:0,idea:1,"3des":2,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimental_gcm:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressed:8,symmetricallyEncrypted:9,marker:10,literal:11,trust:12,userid:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtected:18,modificationDetectionCode:19,symEncryptedAEADProtected:20},literal:{binary:"b".charCodeAt(),text:"t".charCodeAt(),utf8:"u".charCodeAt(),mime:"m".charCodeAt()},signature:{binary:0,text:1,standalone:2,cert_generic:16,cert_persona:17,cert_casual:18,cert_positive:19,cert_revocation:48,subkey_binding:24,key_binding:25,key:31,key_revocation:32,subkey_revocation:40,timestamp:64,third_party:80},signatureSubpacket:{signature_creation_time:2,signature_expiration_time:3,exportable_certification:4,trust_signature:5,regular_expression:6,revocable:7,key_expiration_time:9,placeholder_backwards_compatibility:10,preferred_symmetric_algorithms:11,revocation_key:12,issuer:16,notation_data:20,preferred_hash_algorithms:21,preferred_compression_algorithms:22,key_server_preferences:23,preferred_key_server:24,primary_user_id:25,policy_uri:26,key_flags:27,signers_user_id:28,reason_for_revocation:29,features:30,signature_target:31,embedded_signature:32,issuer_fingerprint:33,preferred_aead_algorithms:34},keyFlags:{certify_keys:1,sign_data:2,encrypt_communication:4,encrypt_storage:8,split_private_key:16,authentication:32,shared_private_key:128},armor:{multipart_section:0,multipart_last:1,signed:2,message:3,public_key:4,private_key:5,signature:6},reasonForRevocation:{no_reason:0,key_superseded:1,key_compromised:2,key_retired:3,userid_invalid:32},features:{modification_detection:1,aead:2,v5_keys:4},write:function(e,t){if(void 0!==e[t="number"==typeof t?this.read(e,t):t])return e[t];throw new Error("Invalid enum value.")},read:function(r,e){if(r[n]||(r[n]=[],Object.entries(r).forEach(([e,t])=>{r[n][t]=e})),void 0!==r[n][e])return r[n][e];throw new Error("Invalid enum value.")}}},{}],114:[function(i,e,s){!function(t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var e,r=i("./config"),n=(e=r)&&e.__esModule?e:{default:e};function a(e){this._baseUrl=e||n.default.keyserver,this._fetch="function"==typeof t.fetch?t.fetch:i("node-fetch")}a.prototype.lookup=function(e){let t=this._baseUrl+"/pks/lookup?op=get&options=mr&search=";const r=this._fetch;if(e.keyId)t+="0x"+encodeURIComponent(e.keyId);else{if(!e.query)throw new Error("You must provide a query parameter!");t+=encodeURIComponent(e.query)}return r(t).then(function(e){if(200===e.status)return e.text()}).then(function(e){if(e&&!(e.indexOf("-----END PGP PUBLIC KEY BLOCK-----")<0))return e.trim()})},a.prototype.upload=function(e){var t=this._baseUrl+"/pks/add";const r=this._fetch;return r(t,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:"keytext="+encodeURIComponent(e)})},s.default=a}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./config":79,"node-fetch":"node-fetch"}],115:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.lightweight=r.WKD=r.HKP=r.AsyncProxy=r.Keyring=r.crypto=r.config=r.enums=r.armor=r.stream=r.OID=r.KDFParams=r.ECDHSymmetricKey=r.Keyid=r.S2K=r.MPI=r.packet=r.util=r.cleartext=r.message=r.signature=r.key=r.destroyWorker=r.getWorker=r.initWorker=r.decryptSessionKeys=r.encryptSessionKey=r.decryptKey=r.revokeKey=r.reformatKey=r.generateKey=r.verify=r.sign=r.decrypt=r.encrypt=void 0;var n=e("./openpgp");Object.defineProperty(r,"encrypt",{enumerable:!0,get:function(){return n.encrypt}}),Object.defineProperty(r,"decrypt",{enumerable:!0,get:function(){return n.decrypt}}),Object.defineProperty(r,"sign",{enumerable:!0,get:function(){return n.sign}}),Object.defineProperty(r,"verify",{enumerable:!0,get:function(){return n.verify}}),Object.defineProperty(r,"generateKey",{enumerable:!0,get:function(){return n.generateKey}}),Object.defineProperty(r,"reformatKey",{enumerable:!0,get:function(){return n.reformatKey}}),Object.defineProperty(r,"revokeKey",{enumerable:!0,get:function(){return n.revokeKey}}),Object.defineProperty(r,"decryptKey",{enumerable:!0,get:function(){return n.decryptKey}}),Object.defineProperty(r,"encryptSessionKey",{enumerable:!0,get:function(){return n.encryptSessionKey}}),Object.defineProperty(r,"decryptSessionKeys",{enumerable:!0,get:function(){return n.decryptSessionKeys}}),Object.defineProperty(r,"initWorker",{enumerable:!0,get:function(){return n.initWorker}}),Object.defineProperty(r,"getWorker",{enumerable:!0,get:function(){return n.getWorker}}),Object.defineProperty(r,"destroyWorker",{enumerable:!0,get:function(){return n.destroyWorker}});var a=e("./util");Object.defineProperty(r,"util",{enumerable:!0,get:function(){return x(a).default}});var i=e("./packet");Object.defineProperty(r,"packet",{enumerable:!0,get:function(){return x(i).default}});var s=e("./type/mpi");Object.defineProperty(r,"MPI",{enumerable:!0,get:function(){return x(s).default}});var o=e("./type/s2k");Object.defineProperty(r,"S2K",{enumerable:!0,get:function(){return x(o).default}});var u=e("./type/keyid");Object.defineProperty(r,"Keyid",{enumerable:!0,get:function(){return x(u).default}});var c=e("./type/ecdh_symkey");Object.defineProperty(r,"ECDHSymmetricKey",{enumerable:!0,get:function(){return x(c).default}});var l=e("./type/kdf_params");Object.defineProperty(r,"KDFParams",{enumerable:!0,get:function(){return x(l).default}});var f=e("./type/oid");Object.defineProperty(r,"OID",{enumerable:!0,get:function(){return x(f).default}});var d=e("web-stream-tools");Object.defineProperty(r,"stream",{enumerable:!0,get:function(){return x(d).default}});var h=e("./encoding/armor");Object.defineProperty(r,"armor",{enumerable:!0,get:function(){return x(h).default}});var p=e("./enums");Object.defineProperty(r,"enums",{enumerable:!0,get:function(){return x(p).default}});var y=e("./config/config");Object.defineProperty(r,"config",{enumerable:!0,get:function(){return x(y).default}});var b=e("./crypto");Object.defineProperty(r,"crypto",{enumerable:!0,get:function(){return x(b).default}});var m=e("./keyring");Object.defineProperty(r,"Keyring",{enumerable:!0,get:function(){return x(m).default}});var g=e("./worker/async_proxy");Object.defineProperty(r,"AsyncProxy",{enumerable:!0,get:function(){return x(g).default}});var w=e("./hkp");Object.defineProperty(r,"HKP",{enumerable:!0,get:function(){return x(w).default}});var v=e("./wkd");Object.defineProperty(r,"WKD",{enumerable:!0,get:function(){return x(v).default}});var _=P(n),k=P(e("./key")),A=P(e("./signature")),S=P(e("./message")),E=P(e("./cleartext")),e=P(e("./lightweight_helper"));function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}r.default=_;r.key=k,r.signature=A,r.message=S,r.cleartext=E,r.lightweight=e},{"./cleartext":77,"./config/config":78,"./crypto":94,"./encoding/armor":111,"./enums":113,"./hkp":114,"./key":118,"./keyring":122,"./lightweight_helper":125,"./message":126,"./openpgp":127,"./packet":131,"./signature":151,"./type/ecdh_symkey":152,"./type/kdf_params":153,"./type/keyid":154,"./type/mpi":155,"./type/oid":156,"./type/s2k":157,"./util":158,"./wkd":159,"./worker/async_proxy":160,"web-stream-tools":75}],116:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.generate=async function(r){r.sign=!0,(r=l.sanitizeKeyOptions(r)).subkeys=r.subkeys.map(function(e,t){return l.sanitizeKeyOptions(r.subkeys[t],r)});let e=[l.generateSecretKey(r)];return e=e.concat(r.subkeys.map(l.generateSecretSubkey)),Promise.all(e).then(e=>o(e[0],e.slice(1),r))},r.reformat=async function(r){r=i(r);try{r.privateKey.getKeys().every(e=>e.isDecrypted())||await r.privateKey.decrypt()}catch(e){throw new Error("Key not decrypted")}var t=r.privateKey.toPacketlist();let n;const a=[];for(let e=0;e({sign:await r.privateKey.getSigningKey(e.getKeyId(),null).catch(()=>{})&&!await r.privateKey.getEncryptionKey(e.getKeyId(),null).catch(()=>{})}))));if(r.subkeys.length===a.length)return r.subkeys=r.subkeys.map(function(e,t){return i(r.subkeys[t],r)}),o(n,a,r);throw new Error("Number of subkey options does not match number of subkeys");function i(e,t={}){return e.keyExpirationTime=e.keyExpirationTime||t.keyExpirationTime,e.passphrase=(s.default.isString(e.passphrase)?e:t).passphrase,e.date=e.date||t.date,e}},r.read=i,r.readArmored=async function(e){try{var t=await n.default.decode(e);if(t.type!==f.default.armor.public_key&&t.type!==f.default.armor.private_key)throw new Error("Armored text not of type key");return i(t.data)}catch(e){const r={keys:[],err:[]};return r.err.push(e),r}};var u=a(e("../packet")),c=a(e("./key")),l=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./helper")),f=a(e("../enums")),s=a(e("../util")),d=a(e("../config")),n=a(e("../encoding/armor"));function a(e){return e&&e.__esModule?e:{default:e}}async function o(s,e,o){o.passphrase&&await s.encrypt(o.passphrase),await Promise.all(e.map(async function(e,t){t=o.subkeys[t].passphrase;t&&await e.encrypt(t)}));const r=new u.default.List;return r.push(s),await Promise.all(o.userIds.map(async function(e,t){function r(e,t){var r;return t&&(1<=(r=e.indexOf(t))&&e.splice(r,1),0!==r&&e.unshift(t)),e}const n=new u.default.Userid;n.format(e);const a={};a.userId=n,a.key=s;const i=new u.default.Signature(o.date);return i.signatureType=f.default.signature.cert_generic,i.publicKeyAlgorithm=s.algorithm,i.hashAlgorithm=await l.getPreferredHashAlgo(null,s),i.keyFlags=[f.default.keyFlags.certify_keys|f.default.keyFlags.sign_data],i.preferredSymmetricAlgorithms=r([f.default.symmetric.aes256,f.default.symmetric.aes128,f.default.symmetric.aes192,f.default.symmetric.cast5,f.default.symmetric.tripledes],d.default.encryption_cipher),d.default.aead_protect&&(i.preferredAeadAlgorithms=r([f.default.aead.eax,f.default.aead.ocb],d.default.aead_mode)),i.preferredHashAlgorithms=r([f.default.hash.sha256,f.default.hash.sha512,f.default.hash.sha1],d.default.prefer_hash_algorithm),i.preferredCompressionAlgorithms=r([f.default.compression.zlib,f.default.compression.zip,f.default.compression.uncompressed],d.default.compression),0===t&&(i.isPrimaryUserID=!0),d.default.integrity_protect&&(i.features=[0],i.features[0]|=f.default.features.modification_detection),d.default.aead_protect&&(i.features||(i.features=[0]),i.features[0]|=f.default.features.aead),d.default.v5_keys&&(i.features||(i.features=[0]),i.features[0]|=f.default.features.v5_keys),0{e.forEach(({userIdPacket:e,signaturePacket:t})=>{r.push(e),r.push(t)})}),await Promise.all(e.map(async function(e,t){t=o.subkeys[t];return{secretSubkeyPacket:e,subkeySignaturePacket:await l.createBindingSignature(e,s,t)}})).then(e=>{e.forEach(({secretSubkeyPacket:e,subkeySignaturePacket:t})=>{r.push(e),r.push(t)})}),r.push(await l.createSignaturePacket({key:s},null,s,{signatureType:f.default.signature.key_revocation,reasonForRevocationFlag:f.default.reasonForRevocation.no_reason,reasonForRevocationString:""},o.date)),o.passphrase&&s.clearPrivateParams(),await Promise.all(e.map(async function(e,t){o.subkeys[t].passphrase&&e.clearPrivateParams()})),new c.default(r)}async function i(e){const t={keys:[]},r=[];try{const s=new u.default.List;await s.read(e);var n=s.indexOfTag(f.default.packet.publicKey,f.default.packet.secretKey);if(0===n.length)throw new Error("No key packet found");for(let e=0;e=s.created)||t[e].isExpired(i)||!t[e].verified&&!await t[e].verify(r,n,a)||(s=t[e])}catch(e){o=e}if(s)return s;throw d.default.wrapError(`Could not find valid ${f.default.read(f.default.signature,n)} signature in key ${r.getKeyId().toHex()}`.replace("cert_generic ","self-").replace("_"," "),o)},r.isDataExpired=function(e,t,r=new Date){var n=d.default.normalizeDate(r);if(null===n)return!1;{var a=u(e,t);return!(e.created<=n&&n<=a)||t&&t.isExpired(r)}},r.createBindingSignature=async function(e,t,r){const n={};n.key=t,n.bind=e;const a=new c.default.Signature(r.date);a.signatureType=f.default.signature.subkey_binding,a.publicKeyAlgorithm=t.algorithm,a.hashAlgorithm=await h(null,e),r.sign?(a.keyFlags=[f.default.keyFlags.sign_data],a.embeddedSignature=await i(n,null,e,{signatureType:f.default.signature.key_binding},r.date)):a.keyFlags=[f.default.keyFlags.encrypt_communication|f.default.keyFlags.encrypt_storage];0>t,r.count++})}));let l={prio:0,algo:u};return Object.values(c).forEach(({prio:e,count:t,algo:r})=>{try{r!==f.default[n].plaintext&&r!==f.default[n].idea&&f.default.read(f.default[n],r)&&t===a.length&&e>l.prio&&(l=c[r])}catch(e){}}),l.algo},r.createSignaturePacket=i,r.mergeSignatures=async function(e,r,n,a){(e=e[n])&&(r[n].length?await Promise.all(e.map(async function(t){t.isExpired()||a&&!await a(t)||r[n].some(function(e){return d.default.equalsUint8Array(e.signature,t.signature)})||r[n].push(t)})):r[n]=e)},r.isDataRevoked=async function(e,t,r,n,a,i,s=new Date){i=i||e;const o=d.default.normalizeDate(s),u=[];if(await Promise.all(n.map(async function(e){try{a&&!e.issuerKeyId.equals(a.issuerKeyId)||l.default.revocations_expire&&e.isExpired(o)||!e.verified&&!await e.verify(i,t,r)||u.push(e.issuerKeyId)}catch(e){}})),a)return a.revoked=!!u.some(e=>e.equals(a.issuerKeyId))||(a.revoked||!1),a.revoked;return 0t.concat(e.toPacketlist())),this.subKeys.map(e=>t.concat(e.toPacketlist())),t},c.prototype.getSubkeys=function(t=null){const r=[];return this.subKeys.forEach(e=>{t&&!e.getKeyId().equals(t,!0)||r.push(e)}),r},c.prototype.getKeys=function(e=null){const t=[];return e&&!this.getKeyId().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))},c.prototype.getKeyIds=function(){return this.getKeys().map(e=>e.getKeyId())},c.prototype.getUserIds=function(){return this.users.map(e=>e.userId?e.userId.userid:null).filter(e=>null!==e)},c.prototype.isPublic=function(){return this.keyPacket.tag===l.default.packet.publicKey},c.prototype.isPrivate=function(){return this.keyPacket.tag===l.default.packet.secretKey},c.prototype.toPublic=function(){const t=new s.default.List,r=this.toPacketlist();let n,a,i;for(let e=0;et.keyPacket.created-e.keyPacket.created);let i;for(let e=0;et.keyPacket.created-e.keyPacket.created);let i;for(let e=0;e!0===e)},c.prototype.validate=async function(){if(!this.isPrivate())throw new Error("Cannot validate a public key");let e;if(this.primaryKey.isDummy()){const t=await this.getSigningKey(null,null);t&&!t.keyPacket.isDummy()&&(e=t.keyPacket)}else e=this.primaryKey;if(e)return e.validate();{const r=this.getKeys();if(r.map(e=>e.keyPacket.isDummy()).every(Boolean))throw new Error("Cannot validate an all-gnu-dummy key");return Promise.all(r.map(async e=>e.keyPacket.validate()))}},c.prototype.clearPrivateParams=function(){if(!this.isPrivate())throw new Error("Can't clear private parameters of a public key");this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})},c.prototype.isRevoked=async function(e,t,r=new Date){return f.isDataRevoked(this.keyPacket,l.default.signature.key_revocation,{key:this.keyPacket},this.revocationSignatures,e,t,r)},c.prototype.verifyPrimaryKey=async function(e=new Date,t={}){var r=this.keyPacket;if(await this.isRevoked(null,null,e))throw new Error("Primary key is revoked");if(!this.users.some(e=>e.userId&&e.selfCertifications.length))throw new Error("No self-certifications");t=(await this.getPrimaryUser(e,t)).selfCertification;if(f.isDataExpired(r,t,e))throw new Error("Primary key is expired")},c.prototype.getExpirationTime=async function(e,t,r){const n=(await this.getPrimaryUser(null,r)).selfCertification;var a=f.getExpirationTime(this.keyPacket,n),i=n.getExpirationTime();let s=a{})||await this.getEncryptionKey(t,null,r).catch(()=>{});if(!o)return null;i=await o.getExpirationTime(this.keyPacket);i{})||await this.getSigningKey(t,null,r).catch(()=>{});if(!u)return null;r=await u.getExpirationTime(this.keyPacket);rr.subKeys.some(e=>t.hasSameFingerprintAs(e)))))throw new Error("Cannot update public key with private key if subkey mismatch");this.keyPacket=r.keyPacket}await f.mergeSignatures(r,this,"revocationSignatures",e=>f.isDataRevoked(this.keyPacket,l.default.signature.key_revocation,this,[e],null,r.keyPacket)),await f.mergeSignatures(r,this,"directSignatures"),await Promise.all(r.users.map(async t=>{let r=!1;await Promise.all(this.users.map(async e=>{(t.userId&&e.userId&&t.userId.userid===e.userId.userid||t.userAttribute&&t.userAttribute.equals(e.userAttribute))&&(await e.update(t,this.keyPacket),r=!0)})),r||this.users.push(t)})),await Promise.all(r.subKeys.map(async t=>{let r=!1;await Promise.all(this.subKeys.map(async e=>{e.hasSameFingerprintAs(t)&&(await e.update(t,this.keyPacket),r=!0)})),r||this.subKeys.push(t)}))},c.prototype.revoke=async function({flag:e=l.default.reasonForRevocation.no_reason,string:t=""}={},r=new Date){if(this.isPublic())throw new Error("Need private key for revoking");var n={key:this.keyPacket};const a=new c(this.toPacketlist());return a.revocationSignatures.push(await f.createSignaturePacket(n,null,this.keyPacket,{signatureType:l.default.signature.key_revocation,reasonForRevocationFlag:l.default.write(l.default.reasonForRevocation,e),reasonForRevocationString:t},r)),a},c.prototype.getRevocationCertificate=async function(e=new Date){var t={key:this.keyPacket},e=await f.getLatestValidSignature(this.revocationSignatures,this.keyPacket,l.default.signature.key_revocation,t,e);const r=new s.default.List;return r.push(e),a.default.encode(l.default.armor.public_key,r.write(),null,null,"This is a revocation certificate")},c.prototype.applyRevocationCertificate=async function(e){e=await a.default.decode(e);const t=new s.default.List;await t.read(e.data);const r=t.findPacket(l.default.packet.signature);if(!r||r.signatureType!==l.default.signature.key_revocation)throw new Error("Could not find revocation signature packet");if(!r.issuerKeyId.equals(this.getKeyId()))throw new Error("Revocation signature does not match key");if(r.isExpired())throw new Error("Revocation signature is expired");try{await r.verify(this.keyPacket,l.default.signature.key_revocation,{key:this.keyPacket})}catch(e){throw u.default.wrapError("Could not verify revocation signature",e)}const n=new c(this.toPacketlist());return n.revocationSignatures.push(r),n},c.prototype.signPrimaryUser=async function(e,t,r){r=await this.getPrimaryUser(t,r);const n=r.index,a=r.user;e=await a.sign(this.keyPacket,e);const i=new c(this.toPacketlist());return i.users[n]=e,i},c.prototype.signAllUsers=async function(t){const r=this,e=new c(this.toPacketlist());return e.users=await Promise.all(this.users.map(function(e){return e.sign(r.keyPacket,t)})),e},c.prototype.verifyPrimaryUser=async function(e,t,r){var n=this.keyPacket;const a=(await this.getPrimaryUser(t,r)).user;return e?await a.verifyAllCertifications(n,e):[{keyid:n.keyid,valid:await a.verify(n).catch(()=>!1)}]},c.prototype.verifyAllUsers=async function(r){const n=[],a=this.keyPacket;return await Promise.all(this.users.map(async function(t){const e=r?await t.verifyAllCertifications(a,r):[{keyid:a.keyid,valid:await t.verify(a).catch(()=>!1)}];e.forEach(e=>{n.push({userid:t.userId.userid,keyid:e.keyid,valid:e.valid})})})),n},c.prototype.addSubkey=async function(e={}){if(!this.isPrivate())throw new Error("Cannot add a subkey to a public key");if(e.passphrase)throw new Error("Subkey could not be encrypted here, please encrypt whole key");if(u.default.getWebCryptoAll()&&e.rsaBits<2048)throw new Error("When using webCrypto rsaBits should be 2048 or 4096, found: "+e.rsaBits);const t=this.primaryKey;if(!t.isDecrypted())throw new Error("Key is not decrypted");var r=t.getAlgorithmInfo();e=f.sanitizeKeyOptions(e,r);r=await f.generateSecretSubkey(e),e=await f.createBindingSignature(r,t,e);const n=this.toPacketlist();return n.push(r),n.push(e),new c(n)},["getKeyId","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted","hasSameFingerprintAs"].forEach(e=>{c.prototype[e]=o.default.prototype[e]})},{"../encoding/armor":111,"../enums":113,"../packet":131,"../util":158,"./helper":117,"./subkey":120,"./user":121}],120:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=u;var s=a(e("../enums")),o=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./helper")),n=a(e("../packet"));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){if(!(this instanceof u))return new u(e);this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[]}u.prototype.toPacketlist=function(){const e=new n.default.List;return e.push(this.keyPacket),e.concat(this.revocationSignatures),e.concat(this.bindingSignatures),e},u.prototype.isRevoked=async function(e,t,r,n=new Date){return o.isDataRevoked(e,s.default.signature.subkey_revocation,{key:e,bind:this.keyPacket},this.revocationSignatures,t,r,n)},u.prototype.verify=async function(e,t=new Date){var r={key:e,bind:this.keyPacket},r=await o.getLatestValidSignature(this.bindingSignatures,e,s.default.signature.subkey_binding,r,t);if(r.revoked||await this.isRevoked(e,r,null,t))throw new Error("Subkey is revoked");if(o.isDataExpired(this.keyPacket,r,t))throw new Error("Subkey is expired")},u.prototype.getExpirationTime=async function(e,t=new Date){var r={key:e,bind:this.keyPacket};let n;try{n=await o.getLatestValidSignature(this.bindingSignatures,e,s.default.signature.subkey_binding,r,t)}catch(e){return null}r=o.getExpirationTime(this.keyPacket,n),t=n.getExpirationTime();return rn.bindingSignatures[e].created&&(n.bindingSignatures[e]=t),!1;try{return t.verified||await t.verify(r,s.default.signature.subkey_binding,a)}catch(e){return!1}}),await o.mergeSignatures(e,this,"revocationSignatures",function(e){return o.isDataRevoked(r,s.default.signature.subkey_revocation,a,[e])})},u.prototype.revoke=async function(e,{flag:t=s.default.reasonForRevocation.no_reason,string:r=""}={},n=new Date){var a={key:e,bind:this.keyPacket};const i=new u(this.keyPacket);return i.revocationSignatures.push(await o.createSignaturePacket(a,null,e,{signatureType:s.default.signature.subkey_revocation,reasonForRevocationFlag:s.default.write(s.default.reasonForRevocation,t),reasonForRevocationString:r},n)),await i.update(this,e),i},["getKeyId","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(e=>{u.prototype[e]=function(){return this.keyPacket[e]()}}),u.prototype.hasSameFingerprintAs=function(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}},{"../enums":113,"../packet":131,"./helper":117}],121:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=s;var u=i(e("../enums")),c=i(e("../util")),n=i(e("../packet")),a=e("./helper");function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if(!(this instanceof s))return new s(e);this.userId=e.tag===u.default.packet.userid?e:null,this.userAttribute=e.tag===u.default.packet.userAttribute?e:null,this.selfCertifications=[],this.otherCertifications=[],this.revocationSignatures=[]}s.prototype.toPacketlist=function(){const e=new n.default.List;return e.push(this.userId||this.userAttribute),e.concat(this.revocationSignatures),e.concat(this.selfCertifications),e.concat(this.otherCertifications),e},s.prototype.sign=async function(r,e){const n={userId:this.userId,userAttribute:this.userAttribute,key:r},t=new s(n.userId||n.userAttribute);return t.otherCertifications=await Promise.all(e.map(async function(e){if(e.isPublic())throw new Error("Need private key for signing");if(e.hasSameFingerprintAs(r))throw new Error("Not implemented for self signing");var t=await e.getSigningKey();return(0,a.createSignaturePacket)(n,e,t.keyPacket,{signatureType:u.default.signature.cert_generic,keyFlags:[u.default.keyFlags.certify_keys|u.default.keyFlags.sign_data]})})),await t.update(this,r),t},s.prototype.isRevoked=async function(e,t,r,n=new Date){return(0,a.isDataRevoked)(e,u.default.signature.cert_revocation,{key:e,userId:this.userId,userAttribute:this.userAttribute},this.revocationSignatures,t,r,n)},s.prototype.verifyCertificate=async function(t,r,e,n=new Date){const a=this,i=r.issuerKeyId,s={userId:this.userId,userAttribute:this.userAttribute,key:t},o=await Promise.all(e.map(async function(e){if(!e.getKeyIds().some(e=>e.equals(i)))return null;e=await e.getSigningKey(i,n);if(r.revoked||await a.isRevoked(t,r,e.keyPacket,n))throw new Error("User certificate is revoked");try{r.verified||await r.verify(e.keyPacket,u.default.signature.cert_generic,s)}catch(e){throw c.default.wrapError("User certificate is invalid",e)}if(r.isExpired(n))throw new Error("User certificate is expired");return!0}));return o.find(e=>null!==e)||null},s.prototype.verifyAllCertifications=async function(t,r,n=new Date){const a=this,e=this.selfCertifications.concat(this.otherCertifications);return Promise.all(e.map(async function(e){return{keyid:e.issuerKeyId,valid:await a.verifyCertificate(t,e,r,n).catch(()=>!1)}}))},s.prototype.verify=async function(t,r=new Date){if(!this.selfCertifications.length)throw new Error("No self-certifications");var n={userId:this.userId,userAttribute:this.userAttribute,key:t};let a;for(let e=this.selfCertifications.length-1;0<=e;e--)try{const i=this.selfCertifications[e];if(i.revoked||await this.isRevoked(t,i,void 0,r))throw new Error("Self-certification is revoked");try{i.verified||await i.verify(t,u.default.signature.cert_generic,n)}catch(e){throw c.default.wrapError("Self-certification is invalid",e)}if(i.isExpired(r))throw new Error("Self-certification is expired");return!0}catch(e){a=e}throw a},s.prototype.update=async function(e,t){const r={userId:this.userId,userAttribute:this.userAttribute,key:t};await(0,a.mergeSignatures)(e,this,"selfCertifications",async function(e){try{return e.verified||e.verify(t,u.default.signature.cert_generic,r)}catch(e){return!1}}),await(0,a.mergeSignatures)(e,this,"otherCertifications"),await(0,a.mergeSignatures)(e,this,"revocationSignatures",function(e){return(0,a.isDataRevoked)(t,u.default.signature.cert_revocation,r,[e])})}},{"../enums":113,"../packet":131,"../util":158,"./helper":117}],122:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("./keyring.js")),e=a(e("./localstore.js"));function a(e){return e&&e.__esModule?e:{default:e}}n.default.localstore=e.default,r.default=n.default},{"./keyring.js":123,"./localstore.js":124}],123:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("../key"),a=e("./localstore"),s=(n=a)&&n.__esModule?n:{default:n};function o(e){this.storeHandler=e||new s.default}function u(e){this.keys=e}function c(e,t){return 16===e.length?e===t.getKeyId().toHex():e===t.getFingerprint()}o.prototype.load=async function(){this.publicKeys=new u(await this.storeHandler.loadPublic()),this.privateKeys=new u(await this.storeHandler.loadPrivate())},o.prototype.store=async function(){await Promise.all([this.storeHandler.storePublic(this.publicKeys.keys),this.storeHandler.storePrivate(this.privateKeys.keys)])},o.prototype.clear=function(){this.publicKeys.keys=[],this.privateKeys.keys=[]},o.prototype.getKeysForId=function(e,t){let r=[];return r=r.concat(this.publicKeys.getForId(e,t)||[]),r=r.concat(this.privateKeys.getForId(e,t)||[]),r.length?r:null},o.prototype.removeKeysForId=function(e){let t=[];return t=t.concat(this.publicKeys.removeForId(e)||[]),t=t.concat(this.privateKeys.removeForId(e)||[]),t.length?t:null},o.prototype.getAllKeys=function(){return this.publicKeys.keys.concat(this.privateKeys.keys)},u.prototype.getForAddress=function(t){const r=[];for(let e=0;e"),a=e.getUserIds();for(let e=0;en.default.readToEnd(e.armor()))),e.setItem(t,JSON.stringify(r))):e.removeItem(t)}l.default=a}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../config":79,"../key":118,"../util":158,"node-localstorage":"node-localstorage","web-stream-tools":75}],125:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.loadScript=n=>"undefined"!=typeof importScripts?importScripts(n):new Promise((e,t)=>{const r=document.createElement("script");r.src=n,r.onload=()=>e(),r.onerror=e=>t(new Error(e.message)),document.head.appendChild(r)}),r.dl=async function(e,t){const r=await fetch(e,t);return r.arrayBuffer()}},{}],126:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Message=g,r.encryptSessionKey=w,r.createSignaturePackets=v,r.createVerificationObjects=o,r.readArmored=async function(e){var t=y.default.isStream(e);"node"===t&&(e=u.default.nodeToWeb(e));e=await n.default.decode(e);return i(e.data,t)},r.read=i,r.fromText=function(e,t,r=new Date,n="utf8"){var a=y.default.isStream(e);"node"===a&&(e=u.default.nodeToWeb(e));const i=new b.default.Literal(r);i.setText(e,n),void 0!==t&&i.setFilename(t);const s=new b.default.List;s.push(i);const o=new g(s);return o.fromStream=a,o},r.fromBinary=function(e,t,r=new Date,n="binary"){var a=y.default.isStream(e);if(!y.default.isUint8Array(e)&&!a)throw new Error("Data must be in the form of a Uint8Array or Stream");"node"===a&&(e=u.default.nodeToWeb(e));const i=new b.default.Literal(r);i.setBytes(e,n),void 0!==t&&i.setFilename(t);const s=new b.default.List;s.push(i);const o=new g(s);return o.fromStream=a,o};var u=a(e("web-stream-tools")),n=a(e("./encoding/armor")),d=a(e("./type/keyid")),h=a(e("./config")),f=a(e("./crypto")),p=a(e("./enums")),y=a(e("./util")),b=a(e("./packet")),l=e("./signature"),m=e("./key");function a(e){return e&&e.__esModule?e:{default:e}}function g(e){if(!(this instanceof g))return new g(e);this.packets=e||new b.default.List}g.prototype.getEncryptionKeyIds=function(){const t=[],e=this.packets.filterByTag(p.default.packet.publicKeyEncryptedSessionKey);return e.forEach(function(e){t.push(e.publicKeyId)}),t},g.prototype.getSigningKeyIds=function(){const t=[],e=this.unwrapCompressed(),r=e.packets.filterByTag(p.default.packet.onePassSignature);if(r.forEach(function(e){t.push(e.issuerKeyId)}),!t.length){const n=e.packets.filterByTag(p.default.packet.signature);n.forEach(function(e){t.push(e.issuerKeyId)})}return t},g.prototype.decrypt=async function(e,t,r,n){const a=r||await this.decryptSessionKeys(e,t);t=this.packets.filterByTag(p.default.packet.symmetricallyEncrypted,p.default.packet.symEncryptedIntegrityProtected,p.default.packet.symEncryptedAEADProtected);if(0===t.length)return this;const i=t[0];let s=null;t=Promise.all(a.map(async e=>{if(!e||!y.default.isUint8Array(e.data)||!y.default.isString(e.algorithm))throw new Error("Invalid session key for decryption.");try{await i.decrypt(e.algorithm,e.data,n)}catch(e){y.default.print_debug_error(e),s=e}}));if(u.default.cancel(i.encrypted),i.encrypted=null,await t,!i.packets||!i.packets.length)throw s||new Error("Decryption failed.");t=new g(i.packets);return i.packets=new b.default.List,t},g.prototype.decryptSessionKeys=async function(e,t){let i=[],s;if(t){const n=this.packets.filterByTag(p.default.packet.symEncryptedSessionKey);if(!n)throw new Error("No symmetrically encrypted session key packet found.");await Promise.all(t.map(async function(t,e){let r;e?(r=new b.default.List,await r.read(n.write())):r=n,await Promise.all(r.map(async function(e){try{await e.decrypt(t),i.push(e)}catch(e){y.default.print_debug_error(e)}}))}))}else{if(!e)throw new Error("No key or password specified.");{const r=this.packets.filterByTag(p.default.packet.publicKeyEncryptedSessionKey);if(!r)throw new Error("No public key encrypted session key packet found.");await Promise.all(r.map(async function(a){await Promise.all(e.map(async function(e){let t=[p.default.symmetric.aes256,p.default.symmetric.aes128,p.default.symmetric.tripledes,p.default.symmetric.cast5];try{var r=await e.getPrimaryUser();r.selfCertification.preferredSymmetricAlgorithms&&(t=t.concat(r.selfCertification.preferredSymmetricAlgorithms))}catch(e){}const n=(await e.getDecryptionKeys(a.publicKeyId,null)).map(e=>e.keyPacket);await Promise.all(n.map(async function(e){if(e){if(!e.isDecrypted())throw new Error("Private key is not decrypted.");try{if(await a.decrypt(e),!t.includes(p.default.write(p.default.symmetric,a.sessionKeyAlgorithm)))throw new Error("A non-preferred symmetric algorithm was used.");i.push(a)}catch(e){y.default.print_debug_error(e),s=e}}}))})),u.default.cancel(a.encrypted),a.encrypted=null}))}}if(i.length){if(1({data:e.sessionKey,algorithm:e.sessionKeyAlgorithm}))}throw s||new Error("Session key decryption failed.")},g.prototype.getLiteralData=function(){const e=this.unwrapCompressed(),t=e.packets.findPacket(p.default.packet.literal);return t&&t.getBytes()||null},g.prototype.getFilename=function(){const e=this.unwrapCompressed(),t=e.packets.findPacket(p.default.packet.literal);return t&&t.getFilename()||null},g.prototype.getText=function(){const e=this.unwrapCompressed(),t=e.packets.findPacket(p.default.packet.literal);return t?t.getText():null},g.prototype.encrypt=async function(e,t,r,n=!1,a=new Date,i=[],s){let o,u,c;if(r){if(!y.default.isUint8Array(r.data)||!y.default.isString(r.algorithm))throw new Error("Invalid session key for encryption.");o=r.algorithm,u=r.aeadAlgorithm,r=r.data}else if(e&&e.length)o=p.default.read(p.default.symmetric,await(0,m.getPreferredAlgo)("symmetric",e,a,i)),h.default.aead_protect&&await(0,m.isAeadSupported)(e,a,i)&&(u=p.default.read(p.default.aead,await(0,m.getPreferredAlgo)("aead",e,a,i)));else{if(!t||!t.length)throw new Error("No keys, passwords, or session key provided.");o=p.default.read(p.default.symmetric,h.default.encryption_cipher),u=p.default.read(p.default.aead,h.default.aead_mode)}const l=await w(r=r||await f.default.generateSessionKey(o),o,u,e,t,n,a,i);return h.default.aead_protect&&u?(c=new b.default.SymEncryptedAEADProtected,c.aeadAlgorithm=u):c=new(h.default.integrity_protect?b.default.SymEncryptedIntegrityProtected:b.default.SymmetricallyEncrypted),c.packets=this.packets,await c.encrypt(o,r,s),l.packets.push(c),c.packets=new b.default.List,{message:l,sessionKey:{data:r,algorithm:o,aeadAlgorithm:u}}};async function w(n,a,t,e,o,i=!1,s=new Date,u=[]){const r=new b.default.List;if(e&&(c=await Promise.all(e.map(async function(e){const t=await e.getEncryptionKey(void 0,s,u),r=new b.default.PublicKeyEncryptedSessionKey;return r.publicKeyId=i?d.default.wildcard():t.getKeyId(),r.publicKeyAlgorithm=t.keyPacket.algorithm,r.sessionKey=n,r.sessionKeyAlgorithm=a,await r.encrypt(t.keyPacket),delete r.sessionKey,r})),r.concat(c)),o){const l=(e,t)=>e+t,f=async function e(t,r,n,a){const i=new b.default.SymEncryptedSessionKey;if(i.sessionKey=t,i.sessionKeyAlgorithm=r,n&&(i.aeadAlgorithm=n),await i.encrypt(a),h.default.password_collision_check){const s=await Promise.all(o.map(e=>async function(e,t){try{return await e.decrypt(t),1}catch(e){return 0}}(i,e)));if(1!==s.reduce(l))return e(t,r,a)}return delete i.sessionKey,i};var c=await Promise.all(o.map(e=>f(n,a,t,e)));r.concat(c)}return new g(r)}g.prototype.sign=async function(a=[],e=null,i=new Date,s=[],t=!1){const r=new b.default.List;var n,o=this.packets.findPacket(p.default.packet.literal);if(!o)throw new Error("No literal data packet to sign.");let u;const c=null===o.text?p.default.signature.binary:p.default.signature.text;if(e)for(n=e.packets.filterByTag(p.default.packet.signature),u=n.length-1;0<=u;u--){var l=n[u];const f=new b.default.OnePassSignature;f.signatureType=l.signatureType,f.hashAlgorithm=l.hashAlgorithm,f.publicKeyAlgorithm=l.publicKeyAlgorithm,f.issuerKeyId=l.issuerKeyId,a.length||0!==u||(f.flags=1),r.push(f)}return await Promise.all(Array.from(a).reverse().map(async function(e,t){if(e.isPublic())throw new Error("Need private key for signing");const r=await e.getSigningKey(void 0,i,s),n=new b.default.OnePassSignature;return n.signatureType=c,n.hashAlgorithm=await(0,m.getPreferredHashAlgo)(e,r.keyPacket,i,s),n.publicKeyAlgorithm=r.keyPacket.algorithm,n.issuerKeyId=r.getKeyId(),t===a.length-1&&(n.flags=1),n})).then(e=>{e.forEach(e=>r.push(e))}),r.push(o),r.concat(await v(o,a,e,i,s,!1,t)),new g(r)},g.prototype.compress=function(e){if(e===p.default.compression.uncompressed)return this;const t=new b.default.Compressed;t.packets=this.packets,t.algorithm=p.default.read(p.default.compression,e);const r=new b.default.List;return r.push(t),new g(r)},g.prototype.signDetached=async function(e=[],t=null,r=new Date,n=[],a=!1){var i=this.packets.findPacket(p.default.packet.literal);if(!i)throw new Error("No literal data packet to sign.");return new l.Signature(await v(i,e,t,r,n,!0,a))};async function v(n,e,t=null,a=new Date,i=[],s=!1,o=!1){const r=new b.default.List,u=null===n.text?p.default.signature.binary:p.default.signature.text;return await Promise.all(e.map(async(e,t)=>{var r=i[t];if(e.isPublic())throw new Error("Need private key for signing");t=await e.getSigningKey(void 0,a,r);return(0,m.createSignaturePacket)(n,e,t.keyPacket,{signatureType:u},a,r,s,o)})).then(e=>{e.forEach(e=>r.push(e))}),t&&(t=t.packets.filterByTag(p.default.packet.signature),r.concat(t)),r}g.prototype.verify=async function(e,t=new Date,n){const r=this.unwrapCompressed(),a=r.packets.filterByTag(p.default.packet.literal);if(1!==a.length)throw new Error("Can only verify message with one literal data packet.");n||r.packets.concat(await u.default.readToEnd(r.packets.stream,e=>e));const i=r.packets.filterByTag(p.default.packet.onePassSignature).reverse();var s=r.packets.filterByTag(p.default.packet.signature);return n&&i.length&&!s.length&&r.packets.stream?(await Promise.all(i.map(async r=>{r.correspondingSig=new Promise((e,t)=>{r.correspondingSigResolve=e,r.correspondingSigReject=t}),r.signatureData=u.default.fromAsync(async()=>(await r.correspondingSig).signatureData),r.hashed=u.default.readToEnd(await r.hash(r.signatureType,a[0],void 0,!1,n)),r.hashed.catch(()=>{})})),r.packets.stream=u.default.transformPair(r.packets.stream,async(e,t)=>{const r=u.default.getReader(e),n=u.default.getWriter(t);try{for(let e=0;e{e.correspondingSigReject(t)}),await n.abort(t)}}),o(i,a,e,t,!1,n)):o(s,a,e,t,!1,n)},g.prototype.verifyDetached=function(e,t,r=new Date){const n=this.unwrapCompressed();var a=n.packets.filterByTag(p.default.packet.literal);if(1!==a.length)throw new Error("Can only verify message with one literal data packet.");return o(e.packets,a,t,r,!0)};async function o(e,t,r,n=new Date,a=!1,i=!1){return Promise.all(e.filter(function(e){return["text","binary"].includes(p.default.read(p.default.signature,e.signatureType))}).map(async function(e){return async function(r,n,e,a=new Date,i=!1,s=!1){let o=null,u=null;await Promise.all(e.map(async function(e){try{u=await e.getSigningKey(r.issuerKeyId,null),o=e}catch(e){}}));const c=r.correspondingSig||r,t={keyid:r.issuerKeyId,verified:(async()=>{if(!u)return null;var e=await r.verify(u.keyPacket,r.signatureType,n[0],i,s);const t=await c;if(t.isExpired(a)||!(t.created>=u.getCreationTime()&&t.created{var e=await c;const t=new b.default.List;return t.push(e),new l.Signature(t)})()};return t.signature.catch(()=>{}),t.verified.catch(()=>{}),t}(e,t,r,n,a,i)}))}g.prototype.unwrapCompressed=function(){var e=this.packets.filterByTag(p.default.packet.compressed);return e.length?new g(e[0].packets):this},g.prototype.appendSignature=async function(e){await this.packets.read(y.default.isUint8Array(e)?e:(await n.default.decode(e)).data)},g.prototype.armor=function(){return n.default.encode(p.default.armor.message,this.packets.write())};async function i(e,t=y.default.isStream(e)){"node"===y.default.isStream(e)&&(e=u.default.nodeToWeb(e));const r=new b.default.List;await r.read(e,t);const n=new g(r);return n.fromStream=t,n}},{"./config":79,"./crypto":94,"./encoding/armor":111,"./enums":113,"./key":118,"./packet":131,"./signature":151,"./type/keyid":154,"./util":158,"web-stream-tools":75}],127:[function(r,e,n){!function(a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initWorker=async function({path:e="openpgp.worker.js",n:t=1,workers:r=[]}={}){if(r.length||void 0!==a&&a.Worker&&a.MessageChannel){const n=new i.default({path:e,n:t,workers:r,config:m.default});if(await n.loaded())return g=n,!0}return!1},n.getWorker=function(){return g},n.destroyWorker=async function(){const e=g;g=void 0,e&&(await e.clearKeyCache(),e.terminate())},n.generateKey=function({userIds:e=[],passphrase:t="",numBits:r=2048,rsaBits:n=r,keyExpirationTime:a=0,curve:i="",date:s=new Date,subkeys:o=[{}]}){o={userIds:e=v(e),passphrase:t,rsaBits:n,keyExpirationTime:a,curve:i,date:s,subkeys:o};if(f.default.getWebCryptoAll()&&n<2048)throw new Error("rsaBits should be 2048 or 4096, found: "+n);return f.default.getWebCryptoAll()||!g?(0,l.generate)(o).then(async e=>{var t=await e.getRevocationCertificate(s);return e.revocationSignatures=[],_({key:e,privateKeyArmored:e.armor(),publicKeyArmored:e.toPublic().armor(),revocationCertificate:t})}).catch(k.bind(null,"Error generating keypair")):g.delegate("generateKey",o)},n.reformatKey=function({privateKey:e,userIds:t=[],passphrase:r="",keyExpirationTime:n=0,date:a}){t=v(t);n={privateKey:e,userIds:t,passphrase:r,keyExpirationTime:n,date:a};if(g)return g.delegate("reformatKey",n);return(0,l.reformat)(n).then(async e=>{var t=await e.getRevocationCertificate(a);return e.revocationSignatures=[],_({key:e,privateKeyArmored:e.armor(),publicKeyArmored:e.toPublic().armor(),revocationCertificate:t})}).catch(k.bind(null,"Error reformatting keypair"))},n.revokeKey=function({key:e,revocationCertificate:t,reasonForRevocation:r}={}){var n={key:e,revocationCertificate:t,reasonForRevocation:r};return f.default.getWebCryptoAll()||!g?Promise.resolve().then(()=>t?e.applyRevocationCertificate(t):e.revoke(r)).then(async e=>{if(await _(e),e.isPrivate()){const t=e.toPublic();return{privateKey:e,privateKeyArmored:e.armor(),publicKey:t,publicKeyArmored:t.armor()}}return{publicKey:e,publicKeyArmored:e.armor()}}).catch(k.bind(null,"Error revoking key")):g.delegate("revokeKey",n)},n.decryptKey=function({privateKey:e,passphrase:t}){if(g)return g.delegate("decryptKey",{privateKey:e,passphrase:t});return Promise.resolve().then(async function(){return await e.decrypt(t),{key:e}}).catch(k.bind(null,"Error decrypting private key"))},n.encryptKey=function({privateKey:e,passphrase:t}){if(g)return g.delegate("encryptKey",{privateKey:e,passphrase:t});return Promise.resolve().then(async function(){return await e.encrypt(t),{key:e}}).catch(k.bind(null,"Error decrypting private key"))},n.encrypt=function({message:t,publicKeys:r,privateKeys:n,passwords:a,sessionKey:i,compression:s=m.default.compression,armor:o=!0,streaming:u=t&&t.fromStream,detached:c=!1,signature:l=null,returnSessionKey:f=!1,wildcard:d=!1,date:h=new Date,fromUserIds:p=[],toUserIds:y=[]}){if(w(t),r=v(r),n=v(n),a=v(a),p=v(p),y=v(y),!A()&&g)return g.delegate("encrypt",{message:t,publicKeys:r,privateKeys:n,passwords:a,sessionKey:i,compression:s,armor:o,streaming:u,detached:c,signature:l,returnSessionKey:f,wildcard:d,date:h,fromUserIds:p,toUserIds:y});const b={};return Promise.resolve().then(async function(){if((n=n||[]).length||l)if(c){const e=await t.signDetached(n,l,h,p,t.fromStream);b.signature=o?e.armor():e}else t=await t.sign(n,l,h,p,t.fromStream);return(t=t.compress(s)).encrypt(r,a,i,d,h,y,u)}).then(async e=>(o?b.data=e.message.armor():b.message=e.message,f&&(b.sessionKey=e.sessionKey),_(b,u,o?["signature","data"]:[]))).catch(k.bind(null,"Error encrypting message"))},n.decrypt=function({message:r,privateKeys:e,passwords:t,sessionKeys:n,publicKeys:a,format:i="utf8",streaming:s=r&&r.fromStream,signature:o=null,date:u=new Date}){return w(r),a=v(a),e=v(e),t=v(t),n=v(n),A()||!g?r.decrypt(e,t,n,s).then(async function(e){a=a||[];const t={};return t.signatures=o?await e.verifyDetached(o,a,u,s):await e.verify(a,u,s),t.data="binary"===i?e.getLiteralData():e.getText(),t.filename=e.getFilename(),s&&p(t,r),t.data=await h(t.data,s),s||await y(t.signatures),t}).catch(k.bind(null,"Error decrypting message")):g.delegate("decrypt",{message:r,privateKeys:e,passwords:t,sessionKeys:n,publicKeys:a,format:i,streaming:s,signature:o,date:u})},n.sign=function({message:t,privateKeys:r,armor:n=!0,streaming:a=t&&t.fromStream,detached:i=!1,date:s=new Date,fromUserIds:o=[]}){if(d(t),r=v(r),o=v(o),g)return g.delegate("sign",{message:t,privateKeys:r,armor:n,streaming:a,detached:i,date:s,fromUserIds:o});const u={};return Promise.resolve().then(async function(){if(i){const e=await t.signDetached(r,void 0,s,o,t.fromStream);u.signature=n?e.armor():e,t.packets&&(u.signature=c.default.transformPair(t.packets.write(),async(e,t)=>{await Promise.all([c.default.pipe(u.signature,t),c.default.readToEnd(e).catch(()=>{})])}))}else t=await t.sign(r,void 0,s,o,t.fromStream),n?u.data=t.armor():u.message=t;return _(u,a,n?["signature","data"]:[])}).catch(k.bind(null,"Error signing cleartext message"))},n.verify=function({message:t,publicKeys:r,streaming:n=t&&t.fromStream,signature:a=null,date:i=new Date}){if(d(t),r=v(r),g)return g.delegate("verify",{message:t,publicKeys:r,streaming:n,signature:a,date:i});return Promise.resolve().then(async function(){const e={};return e.signatures=a?await t.verifyDetached(a,r,i,n):await t.verify(r,i,n),e.data=t instanceof s.CleartextMessage?t.getText():t.getLiteralData(),n&&p(e,t),e.data=await h(e.data,n),n||await y(e.signatures),e}).catch(k.bind(null,"Error verifying cleartext signed message"))},n.encryptSessionKey=function({data:e,algorithm:t,aeadAlgorithm:r,publicKeys:n,passwords:a,wildcard:i=!1,date:s=new Date,toUserIds:o=[]}){if(function(e,t){if(!f.default.isUint8Array(e))throw new Error("Parameter ["+(t||"data")+"] must be of type Uint8Array")}(e),function(e,t){if(!f.default.isString(e))throw new Error("Parameter ["+(t||"data")+"] must be of type String")}(t,"algorithm"),n=v(n),a=v(a),o=v(o),g)return g.delegate("encryptSessionKey",{data:e,algorithm:t,aeadAlgorithm:r,publicKeys:n,passwords:a,wildcard:i,date:s,toUserIds:o});return Promise.resolve().then(async function(){return{message:await u.encryptSessionKey(e,t,r,n,a,i,s,o)}}).catch(k.bind(null,"Error encrypting session key"))},n.decryptSessionKeys=function({message:e,privateKeys:t,passwords:r}){if(w(e),t=v(t),r=v(r),g)return g.delegate("decryptSessionKeys",{message:e,privateKeys:t,passwords:r});return Promise.resolve().then(async function(){return e.decryptSessionKeys(t,r)}).catch(k.bind(null,"Error decrypting session keys"))};var c=t(r("web-stream-tools")),u=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(r("./message")),s=r("./cleartext"),l=r("./key"),m=t(r("./config/config")),e=t(r("./enums"));r("./polyfills");var f=t(r("./util")),i=t(r("./worker/async_proxy"));function t(e){return e&&e.__esModule?e:{default:e}}let g;function w(e){if(!(e instanceof u.Message))throw new Error("Parameter [message] needs to be of type Message")}function d(e){if(!(e instanceof s.CleartextMessage||e instanceof u.Message))throw new Error("Parameter [message] needs to be of type Message or CleartextMessage")}function v(e){return e=e&&!f.default.isArray(e)?[e]:e}async function h(t,e){return!e&&f.default.isStream(t)?c.default.readToEnd(t):(e&&!f.default.isStream(t)&&(t=new ReadableStream({start(e){e.enqueue(t),e.close()}})),t="node"===e?c.default.webToNode(t):t)}async function _(r,n,a=[]){return Object.prototype.isPrototypeOf(r)&&!Uint8Array.prototype.isPrototypeOf(r)&&await Promise.all(Object.entries(r).map(async([e,t])=>{f.default.isStream(t)||a.includes(e)?r[e]=await h(t,n):await _(r[e],n)})),r}function p(r,e){r.data=c.default.transformPair(e.packets.stream,async(e,t)=>{await c.default.pipe(r.data,t)})}async function y(e){await Promise.all(e.map(async t=>{t.signature=await t.signature;try{t.valid=await t.verified}catch(e){t.valid=!1,t.error=e,f.default.print_debug_error(e)}}))}function k(e,t){f.default.print_debug_error(t);try{t.message=e+": "+t.message}catch(e){}throw t}function A(){return m.default.aead_protect&&(m.default.aead_mode===e.default.aead.eax||m.default.aead_mode===e.default.aead.experimental_gcm)&&f.default.getWebCrypto()}}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cleartext":77,"./config/config":78,"./enums":113,"./key":118,"./message":126,"./polyfills":150,"./util":158,"./worker/async_proxy":160,"web-stream-tools":75}],128:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Trust=r.Signature=r.SecretSubkey=r.Userid=r.SecretKey=r.OnePassSignature=r.UserAttribute=r.PublicSubkey=r.Marker=r.SymmetricallyEncrypted=r.PublicKey=r.Literal=r.SymEncryptedSessionKey=r.PublicKeyEncryptedSessionKey=r.SymEncryptedAEADProtected=r.SymEncryptedIntegrityProtected=r.Compressed=void 0;var n=e("./compressed.js");Object.defineProperty(r,"Compressed",{enumerable:!0,get:function(){return k(n).default}});var a=e("./sym_encrypted_integrity_protected.js");Object.defineProperty(r,"SymEncryptedIntegrityProtected",{enumerable:!0,get:function(){return k(a).default}});var i=e("./sym_encrypted_aead_protected.js");Object.defineProperty(r,"SymEncryptedAEADProtected",{enumerable:!0,get:function(){return k(i).default}});var s=e("./public_key_encrypted_session_key.js");Object.defineProperty(r,"PublicKeyEncryptedSessionKey",{enumerable:!0,get:function(){return k(s).default}});var o=e("./sym_encrypted_session_key.js");Object.defineProperty(r,"SymEncryptedSessionKey",{enumerable:!0,get:function(){return k(o).default}});var u=e("./literal.js");Object.defineProperty(r,"Literal",{enumerable:!0,get:function(){return k(u).default}});var c=e("./public_key.js");Object.defineProperty(r,"PublicKey",{enumerable:!0,get:function(){return k(c).default}});var l=e("./symmetrically_encrypted.js");Object.defineProperty(r,"SymmetricallyEncrypted",{enumerable:!0,get:function(){return k(l).default}});var f=e("./marker.js");Object.defineProperty(r,"Marker",{enumerable:!0,get:function(){return k(f).default}});var d=e("./public_subkey.js");Object.defineProperty(r,"PublicSubkey",{enumerable:!0,get:function(){return k(d).default}});var h=e("./user_attribute.js");Object.defineProperty(r,"UserAttribute",{enumerable:!0,get:function(){return k(h).default}});var p=e("./one_pass_signature.js");Object.defineProperty(r,"OnePassSignature",{enumerable:!0,get:function(){return k(p).default}});var y=e("./secret_key.js");Object.defineProperty(r,"SecretKey",{enumerable:!0,get:function(){return k(y).default}});var b=e("./userid.js");Object.defineProperty(r,"Userid",{enumerable:!0,get:function(){return k(b).default}});var m=e("./secret_subkey.js");Object.defineProperty(r,"SecretSubkey",{enumerable:!0,get:function(){return k(m).default}});var g=e("./signature.js");Object.defineProperty(r,"Signature",{enumerable:!0,get:function(){return k(g).default}});var w=e("./trust.js");Object.defineProperty(r,"Trust",{enumerable:!0,get:function(){return k(w).default}}),r.newPacketFromTag=A,r.fromStructuredClone=function(e){const t=v.default.read(v.default.packet,e.tag),r=A(t);Object.assign(r,e),r.postCloneTypeFix&&r.postCloneTypeFix();return r};var v=k(e("../enums.js")),_=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./all_packets.js"));function k(e){return e&&e.__esModule?e:{default:e}}function A(e){return new _[(e=e).substr(0,1).toUpperCase()+e.substr(1)]}},{"../enums.js":113,"./all_packets.js":128,"./compressed.js":130,"./literal.js":132,"./marker.js":133,"./one_pass_signature.js":134,"./public_key.js":137,"./public_key_encrypted_session_key.js":138,"./public_subkey.js":139,"./secret_key.js":140,"./secret_subkey.js":141,"./signature.js":142,"./sym_encrypted_aead_protected.js":143,"./sym_encrypted_integrity_protected.js":144,"./sym_encrypted_session_key.js":145,"./symmetrically_encrypted.js":146,"./trust.js":147,"./user_attribute.js":148,"./userid.js":149}],129:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.clonePackets=function(e){e.publicKeys&&(e.publicKeys=e.publicKeys.map(e=>e.toPacketlist()));e.privateKeys&&(e.privateKeys=e.privateKeys.map(e=>e.toPacketlist()));e.publicKey&&(e.publicKey=e.publicKey.toPacketlist());e.privateKey&&(e.privateKey=e.privateKey.toPacketlist());e.key&&(e.key=e.key.toPacketlist());e.message&&(e.message instanceof i.Message?e.message={packets:e.message.packets,fromStream:e.message.fromStream}:e.message instanceof s.CleartextMessage&&(e.message={text:e.message.text,signature:e.message.signature.packets}));e.signature&&e.signature instanceof o.Signature&&(e.signature=e.signature.packets);e.signatures&&e.signatures.forEach(d);return e},r.parseClonedPackets=function(e){e.publicKeys&&(e.publicKeys=e.publicKeys.map(h));e.privateKeys&&(e.privateKeys=e.privateKeys.map(h));e.publicKey&&(e.publicKey=h(e.publicKey));e.privateKey&&(e.privateKey=h(e.privateKey));e.key&&(e.key=h(e.key));e.message&&e.message.signature?e.message=function(e){var t=u.default.fromStructuredClone(e.signature);return new s.CleartextMessage(e.text,new o.Signature(t))}(e.message):e.message&&(e.message=function(e){const t=u.default.fromStructuredClone(e.packets),r=new i.Message(t);return r.fromStream=e.fromStream,r}(e.message));e.signatures&&(e.signatures=e.signatures.map(p));e.signature&&(e.signature=function(e){if(l.default.isString(e)||l.default.isStream(e))return e;e=u.default.fromStructuredClone(e);return new o.Signature(e)}(e.signature));return e};var n=f(e("web-stream-tools")),a=e("../key"),i=e("../message"),s=e("../cleartext"),o=e("../signature"),u=f(e("./packetlist")),c=f(e("../type/keyid")),l=f(e("../util"));function f(e){return e&&e.__esModule?e:{default:e}}function d(e){const t=e.verified;if(e.verified=n.default.fromAsync(()=>t),e.signature instanceof Promise){const r=e.signature;e.signature=n.default.fromAsync(async()=>{const e=(await r).packets;try{await t}catch(e){}return e&&e[0]&&(delete e[0].signature,delete e[0].hashed),e})}else e.signature=e.signature.packets;return e.error&&(e.error=e.error.message),e}function h(e){e=u.default.fromStructuredClone(e);return new a.Key(e)}function p(e){return e.keyid=c.default.fromClone(e.keyid),l.default.isStream(e.signature)?(e.signature=n.default.readToEnd(e.signature,([e])=>new o.Signature(u.default.fromStructuredClone(e))),e.signature.catch(()=>{})):e.signature=new o.Signature(u.default.fromStructuredClone(e.signature)),e.verified=n.default.readToEnd(e.verified,([e])=>e),e.verified.catch(()=>{}),e.error&&(e.error=new Error(e.error)),e}},{"../cleartext":77,"../key":118,"../message":126,"../signature":151,"../type/keyid":154,"../util":158,"./packetlist":136,"web-stream-tools":75}],130:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=c(e("pako")),n=c(e("seek-bzip")),i=c(e("web-stream-tools")),s=c(e("../config")),o=c(e("../enums")),u=c(e("../util"));function c(e){return e&&e.__esModule?e:{default:e}}function l(){this.tag=o.default.packet.compressed,this.packets=null,this.algorithm="zip",this.compressed=null}l.prototype.read=async function(e,t){await i.default.parse(e,async e=>{this.algorithm=o.default.read(o.default.compression,await e.readByte()),this.compressed=e.remainder(),await this.decompress(t)})},l.prototype.write=function(){return null===this.compressed&&this.compress(),u.default.concat([new Uint8Array([o.default.write(o.default.compression,this.algorithm)]),this.compressed])},l.prototype.decompress=async function(e){if(!b[this.algorithm])throw new Error(this.algorithm+" decompression not supported");await this.packets.read(b[this.algorithm](this.compressed),e)},l.prototype.compress=function(){if(!y[this.algorithm])throw new Error(this.algorithm+" compression not supported");this.compressed=y[this.algorithm](this.packets.write())},r.default=l;r=u.default.getNodeZlib();function f(e){return e}function d(t,r={}){return function(e){return i.default.nodeToWeb(i.default.webToNode(e).pipe(t(r)))}}function h(r,n={}){return function(e){const t=new r(n);return i.default.transform(e,e=>{if(e.length)return t.push(e,a.default.Z_SYNC_FLUSH),t.result},()=>{if(r===a.default.Deflate)return t.push([],a.default.Z_FINISH),t.result})}}function p(t){return function(e){return i.default.fromAsync(async()=>t(await i.default.readToEnd(e)))}}let y,b;b=r?(y={zip:d(r.createDeflateRaw,{level:s.default.deflate_level}),zlib:d(r.createDeflate,{level:s.default.deflate_level})},{uncompressed:f,zip:d(r.createInflateRaw),zlib:d(r.createInflate),bzip2:p(n.default.decode)}):(y={zip:h(a.default.Deflate,{raw:!0,level:s.default.deflate_level}),zlib:h(a.default.Deflate,{level:s.default.deflate_level})},{uncompressed:f,zip:h(a.default.Inflate,{raw:!0}),zlib:h(a.default.Inflate),bzip2:p(n.default.decode)})},{"../config":79,"../enums":113,"../util":158,pako:50,"seek-bzip":69,"web-stream-tools":75}],131:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=o(e("./all_packets")),i=o(e("./clone")),s=e("./packetlist");function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}i={List:((n=s)&&n.__esModule?n:{default:n}).default,clone:i};Object.assign(i,a),r.default=i},{"./all_packets":128,"./clone":129,"./packetlist":136}],132:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=s(e("web-stream-tools")),a=s(e("../enums")),i=s(e("../util"));function s(e){return e&&e.__esModule?e:{default:e}}function o(e=new Date){this.tag=a.default.packet.literal,this.format="utf8",this.date=i.default.normalizeDate(e),this.text=null,this.data=null,this.filename="msg.txt"}o.prototype.setText=function(e,t="utf8"){this.format=t,this.text=e,this.data=null},o.prototype.getText=function(e=!1){return null!==this.text&&!i.default.isStream(this.text)||(this.text=i.default.decode_utf8(i.default.nativeEOL(this.getBytes(e)))),this.text},o.prototype.setBytes=function(e,t){this.format=t,this.data=e,this.text=null},o.prototype.getBytes=function(e=!1){return null===this.data&&(this.data=i.default.canonicalizeEOL(i.default.encode_utf8(this.text))),e?n.default.passiveClone(this.data):this.data},o.prototype.setFilename=function(e){this.filename=e},o.prototype.getFilename=function(){return this.filename},o.prototype.read=async function(e){await n.default.parse(e,async e=>{var t=a.default.read(a.default.literal,await e.readByte()),r=await e.readByte();this.filename=i.default.decode_utf8(await e.readBytes(r)),this.date=i.default.readDate(await e.readBytes(4));e=e.remainder();this.setBytes(e,t)})},o.prototype.writeHeader=function(){var e=i.default.encode_utf8(this.filename),t=new Uint8Array([e.length]),r=new Uint8Array([a.default.write(a.default.literal,this.format)]),n=i.default.writeDate(this.date);return i.default.concatUint8Array([r,t,e,n])},o.prototype.write=function(){var e=this.writeHeader(),t=this.getBytes();return i.default.concat([e,t])},r.default=o},{"../enums":113,"../util":158,"web-stream-tools":75}],133:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=e("../enums"),i=(n=a)&&n.__esModule?n:{default:n};function s(){this.tag=i.default.packet.marker}s.prototype.read=function(e){return 80===e[0]&&71===e[1]&&80===e[2]},r.default=s},{"../enums":113}],134:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=u(e("web-stream-tools")),a=u(e("./signature")),i=u(e("../type/keyid")),s=u(e("../enums")),o=u(e("../util"));function u(e){return e&&e.__esModule?e:{default:e}}function c(){this.tag=s.default.packet.onePassSignature,this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.issuerKeyId=null,this.flags=null}c.prototype.read=function(e){var t=0;return this.version=e[t++],this.signatureType=e[t++],this.hashAlgorithm=e[t++],this.publicKeyAlgorithm=e[+t],this.issuerKeyId=new i.default,this.issuerKeyId.read(e.subarray(4,12)),this.flags=e[12],this},c.prototype.write=function(){var e=new Uint8Array([3,s.default.write(s.default.signature,this.signatureType),s.default.write(s.default.hash,this.hashAlgorithm),s.default.write(s.default.publicKey,this.publicKeyAlgorithm)]),t=new Uint8Array([this.flags]);return o.default.concatUint8Array([e,this.issuerKeyId.write(),t])},c.prototype.postCloneTypeFix=function(){this.issuerKeyId=i.default.fromClone(this.issuerKeyId)},c.prototype.hash=a.default.prototype.hash,c.prototype.toHash=a.default.prototype.toHash,c.prototype.toSign=a.default.prototype.toSign,c.prototype.calculateTrailer=function(...e){return n.default.fromAsync(async()=>a.default.prototype.calculateTrailer.apply(await this.correspondingSig,e))},c.prototype.verify=async function(){const e=await this.correspondingSig;if(!e||e.tag!==s.default.packet.signature)throw new Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyId.equals(this.issuerKeyId))throw new Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)},r.default=c},{"../enums":113,"../type/keyid":154,"../util":158,"./signature":142,"web-stream-tools":75}],135:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},_=a(e("web-stream-tools")),n=a(e("../enums")),k=a(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}r.default={readSimpleLength:function(e){let t=0,r;var n,a=e[0];return a<192?(n=i(e,1),t=n[0],r=1):a<255?(t=(e[0]-192<<8)+e[1]+192,r=2):255===a&&(t=k.default.readNumber(e.subarray(1,5)),r=5),{len:t,offset:r}},writeSimpleLength:function(e){return e<192?new Uint8Array([e]):191>8),e-192&255]):k.default.concatUint8Array([new Uint8Array([255]),k.default.writeNumber(e,4)])},writePartialLength:function(e){if(e<0||30>2,n=3&d);var h,p=this.supportsStreaming(e);let a=null;s&&p?(h=new TransformStream,c=_.default.getWriter(h.writable),a=h.readable,l=o({tag:e,packet:a})):a=[];let i;do{if(t){var y=await u.readByte();if(i=!1,y<192)r=y;else if(192<=y&&y<224)r=(y-192<<8)+await u.readByte()+192;else if(223=r){u.unshift(v.subarray(r-e+v.length));break}}}}while(i);var g=await u.peekBytes(p?1/0:2);return c?(await c.ready,await c.close()):(a=k.default.concatUint8Array(a),await o({tag:e,packet:a})),!g||!g.length}catch(e){if(c)return await c.abort(e),!0;throw e}finally{c&&await l,u.releaseLock()}}}},{"../enums":113,"../util":158,"web-stream-tools":75}],136:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=n(e("web-stream-tools")),i=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(e("./all_packets")),o=n(e("./packet")),u=n(e("../config")),c=n(e("../enums")),l=n(e("../util"));function n(e){return e&&e.__esModule?e:{default:e}}function f(){this.length=0}(f.prototype=[]).read=async function(e,a){this.stream=s.default.transformPair(e,async(e,t)=>{const n=s.default.getWriter(t);try{for(;;)if(await n.ready,await o.default.read(e,a,async t=>{try{var e=c.default.read(c.default.packet,t.tag);const r=i.newPacketFromTag(e);r.packets=new f,r.fromStream=l.default.isStream(t.packet),await r.read(t.packet,a),await n.write(r)}catch(e){u.default.tolerant&&!o.default.supportsStreaming(t.tag)||await n.abort(e),l.default.print_debug_error(e)}}))return await n.ready,void await n.close()}catch(e){await n.abort(e)}});const t=s.default.getReader(this.stream);for(;;){var r=await t.read(),n=r.done,r=r.value;if(n?this.stream=null:this.push(r),n||o.default.supportsStreaming(r.tag))break}t.releaseLock()},f.prototype.write=function(){const r=[];for(let e=0;e{if(n.push(e),a+=e.length,512<=a){var t=Math.min(Math.log(a)/Math.LN2|0,30),e=2**t;const r=l.default.concat([o.default.writePartialLength(t)].concat(n));return n=[r.subarray(1+e)],a=n[0].length,r.subarray(0,1+e)}},()=>l.default.concat([o.default.writeSimpleLength(a)].concat(n))))}else{if(l.default.isStream(i)){let t=0;r.push(s.default.transform(s.default.clone(i),e=>{t+=e.length},()=>o.default.writeHeader(this[e].tag,t)))}else r.push(o.default.writeHeader(this[e].tag,i.length));r.push(i)}}return l.default.concat(r)},f.prototype.push=function(e){e&&(e.packets=e.packets||new f,this[this.length]=e,this.length++)},f.prototype.filterByTag=function(...t){const r=new f;for(let e=0;ee=>t===e)(this[e].tag))&&r.push(this[e]);return r},f.prototype.findPacket=function(t){return this.find(e=>e.tag===t)},f.prototype.indexOfTag=function(...t){const r=[];for(let e=0;ee=>t===e)(this[e].tag))&&r.push(e);return r},f.prototype.concat=function(t){if(t)for(let e=0;ei.fromStructuredClone(e))),r},r.default=f},{"../config":79,"../enums":113,"../util":158,"./all_packets":128,"./packet":135,"web-stream-tools":75}],137:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("asmcrypto.js/dist_es5/hash/sha1/sha1"),a=e("asmcrypto.js/dist_es5/hash/sha256/sha256"),i=f(e("../type/keyid")),s=f(e("../type/mpi")),o=f(e("../config")),u=f(e("../crypto")),c=f(e("../enums")),l=f(e("../util"));function f(e){return e&&e.__esModule?e:{default:e}}function d(e=new Date){this.tag=c.default.packet.publicKey,this.version=o.default.v5_keys?5:4,this.created=l.default.normalizeDate(e),this.algorithm=null,this.params=[],this.expirationTimeV3=0,this.fingerprint=null,this.keyid=null}d.prototype.readPublicKey=d.prototype.read=function(t){let r=0;if(this.version=t[r++],4!==this.version&&5!==this.version)throw new Error("Version "+this.version+" of the key packet is unsupported.");this.created=l.default.readDate(t.subarray(r,r+4)),r+=4,this.algorithm=c.default.read(c.default.publicKey,t[r++]);var e=c.default.write(c.default.publicKey,this.algorithm);5===this.version&&(r+=4);var n=u.default.getPubKeyParamTypes(e);this.params=u.default.constructParams(n);for(let e=0;et.length)throw new Error("Error reading MPI @:"+r);return r},d.prototype.writePublicKey=d.prototype.write=function(){const e=[];e.push(new Uint8Array([this.version])),e.push(l.default.writeDate(this.created));var t=c.default.write(c.default.publicKey,this.algorithm);e.push(new Uint8Array([t]));t=u.default.getPubKeyParamTypes(t).length,t=l.default.concatUint8Array(this.params.slice(0,t).map(e=>e.write()));return 5===this.version&&e.push(l.default.writeNumber(t.length,4)),e.push(t),l.default.concatUint8Array(e)},d.prototype.writeForHash=function(e){var t=this.writePublicKey();return 5===e?l.default.concatUint8Array([new Uint8Array([154]),l.default.writeNumber(t.length,4),t]):l.default.concatUint8Array([new Uint8Array([153]),l.default.writeNumber(t.length,2),t])},d.prototype.isDecrypted=function(){return null},d.prototype.getCreationTime=function(){return this.created},d.prototype.getKeyId=function(){return this.keyid||(this.keyid=new i.default,5===this.version?this.keyid.read(l.default.hex_to_Uint8Array(this.getFingerprint()).subarray(0,8)):4===this.version&&this.keyid.read(l.default.hex_to_Uint8Array(this.getFingerprint()).subarray(12,20)),this.keyid)},d.prototype.getFingerprintBytes=function(){if(this.fingerprint)return this.fingerprint;var e=this.writeForHash(this.version);return 5===this.version?this.fingerprint=a.Sha256.bytes(e):4===this.version&&(this.fingerprint=n.Sha1.bytes(e)),this.fingerprint},d.prototype.getFingerprint=function(){return l.default.Uint8Array_to_hex(this.getFingerprintBytes())},d.prototype.hasSameFingerprintAs=function(e){return this.version===e.version&&l.default.equalsUint8Array(this.writePublicKey(),e.writePublicKey())},d.prototype.getAlgorithmInfo=function(){const e={};return e.algorithm=this.algorithm,this.params[0]instanceof s.default?(e.rsaBits=8*this.params[0].byteLength(),e.bits=e.rsaBits):e.curve=this.params[0].getName(),e},d.prototype.postCloneTypeFix=function(){var e=c.default.write(c.default.publicKey,this.algorithm);const t=u.default.getPubKeyParamTypes(e);for(let e=0;et.length)throw new Error("Error reading param @:"+a);return n}function d(t,r){const n=[];r=s.default.write(s.default.publicKey,r);for(let e=o.default.getPubKeyParamTypes(r).length;e{e.data.fill(0)}),this.params.length=e),this.isEncrypted=!0},l.prototype.postCloneTypeFix=function(){var e=s.default.write(s.default.publicKey,this.algorithm);const t=[].concat(o.default.getPubKeyParamTypes(e),o.default.getPrivKeyParamTypes(e));for(let e=0;ey.default.signature.sign(i,s,l,u,await h.default.readToEnd(c));return n?this.signature=h.default.fromAsync(e):(this.signature=await e(),this.verified=!0),!0},d.prototype.write_hashed_sub_packets=function(){const n=b.default.signatureSubpacket,a=[];let i;null!==this.created&&a.push(s(n.signature_creation_time,f.default.writeDate(this.created))),null!==this.signatureExpirationTime&&a.push(s(n.signature_expiration_time,f.default.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&a.push(s(n.exportable_certification,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(i=new Uint8Array([this.trustLevel,this.trustAmount]),a.push(s(n.trust_signature,i))),null!==this.regularExpression&&a.push(s(n.regular_expression,this.regularExpression)),null!==this.revocable&&a.push(s(n.revocable,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&a.push(s(n.key_expiration_time,f.default.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.preferredSymmetricAlgorithms)),a.push(s(n.preferred_symmetric_algorithms,i))),null!==this.revocationKeyClass&&(i=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),i=f.default.concat([i,this.revocationKeyFingerprint]),a.push(s(n.revocation_key,i))),this.rawNotations.forEach(([{name:e,value:t,humanReadable:r}])=>{i=[new Uint8Array([r?128:0,0,0,0])],i.push(f.default.writeNumber(e.length,2)),i.push(f.default.writeNumber(t.length,2)),i.push(f.default.str_to_Uint8Array(e)),i.push(t),i=f.default.concat(i),a.push(s(n.notation_data,i))}),null!==this.preferredHashAlgorithms&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.preferredHashAlgorithms)),a.push(s(n.preferred_hash_algorithms,i))),null!==this.preferredCompressionAlgorithms&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.preferredCompressionAlgorithms)),a.push(s(n.preferred_compression_algorithms,i))),null!==this.keyServerPreferences&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.keyServerPreferences)),a.push(s(n.key_server_preferences,i))),null!==this.preferredKeyServer&&a.push(s(n.preferred_key_server,f.default.str_to_Uint8Array(this.preferredKeyServer))),null!==this.isPrimaryUserID&&a.push(s(n.primary_user_id,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&a.push(s(n.policy_uri,f.default.str_to_Uint8Array(this.policyURI))),null!==this.keyFlags&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.keyFlags)),a.push(s(n.key_flags,i))),null!==this.signersUserId&&a.push(s(n.signers_user_id,f.default.str_to_Uint8Array(this.signersUserId))),null!==this.reasonForRevocationFlag&&(i=f.default.str_to_Uint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),a.push(s(n.reason_for_revocation,i))),null!==this.features&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.features)),a.push(s(n.features,i))),null!==this.signatureTargetPublicKeyAlgorithm&&(i=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],i.push(f.default.str_to_Uint8Array(this.signatureTargetHash)),i=f.default.concat(i),a.push(s(n.signature_target,i))),null!==this.preferredAeadAlgorithms&&(i=f.default.str_to_Uint8Array(f.default.Uint8Array_to_str(this.preferredAeadAlgorithms)),a.push(s(n.preferred_aead_algorithms,i)));var e=f.default.concat(a),t=f.default.writeNumber(e.length,2);return f.default.concat([t,e])},d.prototype.write_unhashed_sub_packets=function(){var e=b.default.signatureSubpacket;const t=[];this.issuerKeyId.isNull()||5===this.issuerKeyVersion||t.push(s(e.issuer,this.issuerKeyId.write())),null!==this.embeddedSignature&&t.push(s(e.embedded_signature,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(r=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],r=f.default.concat(r),t.push(s(e.issuer_fingerprint,r))),this.unhashedSubpackets.forEach(e=>{t.push(i.default.writeSimpleLength(e.length)),t.push(e)});var e=f.default.concat(t),r=f.default.writeNumber(e.length,2);return f.default.concat([r,e])},d.prototype.read_sub_packet=function(e,t=!0){let r=0;var n=(t,r)=>{this[t]=[];for(let e=0;e{n+=e.length},()=>{const e=[];return 5!==this.version||this.signatureType!==b.default.signature.binary&&this.signatureType!==b.default.signature.text||(r?e.push(new Uint8Array(6)):e.push(t.writeHeader())),e.push(new Uint8Array([this.version,255])),5===this.version&&e.push(new Uint8Array(4)),e.push(f.default.writeNumber(n,4)),f.default.concat(e)})},d.prototype.toHash=function(e,t,r=!1){e=this.toSign(e,t);return f.default.concat([e,this.signatureData,this.calculateTrailer(t,r)])},d.prototype.hash=async function(e,t,r,n=!1,a=!0){var i=b.default.write(b.default.hash,this.hashAlgorithm);return r=r||this.toHash(e,t,n),!a&&f.default.isStream(r)?h.default.fromAsync(async()=>this.hash(e,t,await h.default.readToEnd(r),n)):y.default.hash.digest(i,r)},d.prototype.verify=async function(e,t,r,n=!1,a=!1){var i=b.default.write(b.default.publicKey,this.publicKeyAlgorithm),s=b.default.write(b.default.hash,this.hashAlgorithm);if(i!==b.default.write(b.default.publicKey,e.algorithm))throw new Error("Public key algorithm used to sign signature does not match issuer key algorithm.");let o,u;if(u=this.hashed?await this.hashed:(o=this.toHash(t,r,n),a||(o=await h.default.readToEnd(o)),await this.hash(t,r,o)),u=await h.default.readToEnd(u),this.signedHashValue[0]!==u[0]||this.signedHashValue[1]!==u[1])throw new Error("Message digest did not match");let c=0;0{if(1!==await e.readByte())throw new Error("Invalid packet version.");this.cipherAlgo=await e.readByte(),this.aeadAlgo=await e.readByte(),this.chunkSizeByte=await e.readByte();var t=a.default[i.default.read(i.default.aead,this.aeadAlgo)];this.iv=await e.readBytes(t.ivLength),this.encrypted=e.remainder()})},o.prototype.write=function(){return k.default.concat([new Uint8Array([this.version,this.cipherAlgo,this.aeadAlgo,this.chunkSizeByte]),this.iv,this.encrypted])},o.prototype.decrypt=async function(e,t,r){return await this.packets.read(await this.crypt("decrypt",t,_.default.clone(this.encrypted),r),r),!0},o.prototype.encrypt=async function(e,t,r){this.cipherAlgo=i.default.write(i.default.symmetric,e),this.aeadAlgo=i.default.write(i.default.aead,this.aeadAlgorithm);e=a.default[i.default.read(i.default.aead,this.aeadAlgo)];this.iv=await a.default.random.getRandomBytes(e.ivLength),this.chunkSizeByte=n.default.aead_chunk_size_byte;e=this.packets.write();this.encrypted=await this.crypt("encrypt",t,e,r)},o.prototype.crypt=async function(s,e,t,r){var n=i.default.read(i.default.symmetric,this.cipherAlgo);const o=a.default[i.default.read(i.default.aead,this.aeadAlgo)],u=await o(n,e),c="decrypt"===s?o.tagLength:0,l="encrypt"===s?o.tagLength:0,f=2**(this.chunkSizeByte+6)+c;e=new ArrayBuffer(21);const d=new Uint8Array(e,0,13),h=new Uint8Array(e),p=new DataView(e),y=new Uint8Array(e,5,8);d.set([192|this.tag,this.version,this.cipherAlgo,this.aeadAlgo,this.chunkSizeByte],0);let b=0,m=Promise.resolve(),g=0,w=0;const v=this.iv;return _.default.transformPair(t,async(e,t)=>{const n=_.default.getReader(e);e=new TransformStream({},{highWaterMark:r?k.default.getHardwareConcurrency()*2**(this.chunkSizeByte+6):1/0,size:e=>e.length});_.default.pipe(e.readable,t);const a=_.default.getWriter(e.writable);try{for(;;){let e=await n.readBytes(f+c)||new Uint8Array;var i=e.subarray(e.length-c);e=e.subarray(0,e.length-c);let t,r;if(!b||e.length?(n.unshift(i),t=u[s](e,o.getNonce(v,y),d),w+=e.length-c+l):(p.setInt32(17,g),t=u[s](i,o.getNonce(v,y),h),w+=l,r=!0),g+=e.length-c,m=m.then(()=>t).then(async e=>{await a.ready,await a.write(e),w-=e.length}).catch(e=>a.abort(e)),(r||w>a.desiredSize)&&await m,r){await a.close();break}p.setInt32(9,++b)}}catch(e){await a.abort(e)}})}},{"../config":79,"../crypto":94,"../enums":113,"../util":158,"web-stream-tools":75}],144:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=a(e("web-stream-tools")),u=a(e("../config")),c=a(e("../crypto")),n=a(e("../enums")),l=a(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}function i(){this.tag=n.default.packet.symEncryptedIntegrityProtected,this.version=1,this.encrypted=null,this.modification=!1,this.packets=null}i.prototype.read=async function(e){await o.default.parse(e,async e=>{if(1!==await e.readByte())throw new Error("Invalid packet version.");this.encrypted=e.remainder()})},i.prototype.write=function(){return l.default.concat([new Uint8Array([1]),this.encrypted])},i.prototype.encrypt=async function(e,t,r){let n=this.packets.write();r||(n=await o.default.readToEnd(n));var a=await c.default.getPrefixRandom(e),r=new Uint8Array([211,20]),a=l.default.concat([a,n,r]),r=await c.default.hash.sha1(o.default.passiveClone(a)),r=l.default.concat([a,r]);return this.encrypted=await c.default.cfb.encrypt(e,t,r,new Uint8Array(c.default.cipher[e].blockSize)),!0},i.prototype.decrypt=async function(e,t,r){let n=o.default.clone(this.encrypted);r||(n=await o.default.readToEnd(n));var a=await c.default.cfb.decrypt(e,t,n,new Uint8Array(c.default.cipher[e].blockSize)),t=o.default.slice(o.default.passiveClone(a),-20),a=o.default.slice(a,0,-20);const i=Promise.all([o.default.readToEnd(await c.default.hash.sha1(o.default.passiveClone(a))),o.default.readToEnd(t)]).then(([e,t])=>{if(!l.default.equalsUint8Array(e,t))throw new Error("Modification detected.");return new Uint8Array});e=o.default.slice(a,c.default.cipher[e].blockSize+2);let s=o.default.slice(e,0,-2);return s=o.default.concat([s,o.default.fromAsync(()=>i)]),l.default.isStream(n)&&u.default.allow_unauthenticated_stream||(s=await o.default.readToEnd(s)),await this.packets.read(s,r),!0},r.default=i},{"../config":79,"../crypto":94,"../enums":113,"../util":158,"web-stream-tools":75}],145:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=a(e("../type/s2k")),n=a(e("../config")),o=a(e("../crypto")),u=a(e("../enums")),c=a(e("../util"));function a(e){return e&&e.__esModule?e:{default:e}}function i(){this.tag=u.default.packet.symEncryptedSessionKey,this.version=n.default.aead_protect?5:4,this.sessionKey=null,this.sessionKeyEncryptionAlgorithm=null,this.sessionKeyAlgorithm="aes256",this.aeadAlgorithm=u.default.read(u.default.aead,n.default.aead_mode),this.encrypted=null,this.s2k=null,this.iv=null}i.prototype.read=function(e){let t=0;this.version=e[t++];var r,n=u.default.read(u.default.symmetric,e[t++]);5===this.version&&(this.aeadAlgorithm=u.default.read(u.default.aead,e[t++])),this.s2k=new s.default,t+=this.s2k.read(e.subarray(t,e.length)),5===this.version&&(r=o.default[this.aeadAlgorithm],this.iv=e.subarray(t,t+=r.ivLength)),5===this.version||t=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw new Error("Invalid symmetric key")},s.prototype.write=function(){return i.default.concatUint8Array([new Uint8Array([this.data.length]),this.data])},s.fromClone=function(e){return new s(e.data)},r.default=s},{"../util":158}],153:[function(e,t,r){"use strict";function n(e){var t;e?(t=e.hash,e=e.cipher,this.hash=t,this.cipher=e):(this.hash=null,this.cipher=null)}Object.defineProperty(r,"__esModule",{value:!0}),n.prototype.read=function(e){if(e.length<4||3!==e[0]||1!==e[1])throw new Error("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4},n.prototype.write=function(){return new Uint8Array([3,1,this.hash,this.cipher])},n.fromClone=function(e){return new n({hash:e.hash,cipher:e.cipher})},r.default=n},{}],154:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,a=e("../util.js"),i=(n=a)&&n.__esModule?n:{default:n};function s(){this.bytes=""}s.prototype.read=function(e){this.bytes=i.default.Uint8Array_to_str(e.subarray(0,8))},s.prototype.write=function(){return i.default.str_to_Uint8Array(this.bytes)},s.prototype.toHex=function(){return i.default.str_to_hex(this.bytes)},s.prototype.equals=function(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes},s.prototype.isNull=function(){return""===this.bytes},s.prototype.isWildcard=function(){return/^0+$/.test(this.toHex())},s.mapToHex=function(e){return e.toHex()},s.fromClone=function(e){const t=new s;return t.bytes=e.bytes,t},s.fromId=function(e){const t=new s;return t.read(i.default.hex_to_Uint8Array(e)),t},s.wildcard=function(){const e=new s;return e.read(new Uint8Array(8)),e},r.default=s},{"../util.js":158}],155:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=i(e("bn.js")),a=i(e("../util"));function i(e){return e&&e.__esModule?e:{default:e}}function s(e){e instanceof s?this.data=e.data:n.default.isBN(e)?this.fromBN(e):a.default.isUint8Array(e)?this.fromUint8Array(e):a.default.isString(e)?this.fromString(e):this.data=null}s.prototype.read=function(e,t="be"){var r=7+((e=a.default.isString(e)?a.default.str_to_Uint8Array(e):e)[0]<<8|e[1])>>>3,e=e.subarray(2,2+r);return this.fromUint8Array(e,t),2+r},s.prototype.write=function(e,t){return a.default.Uint8Array_to_MPI(this.toUint8Array(e,t))},s.prototype.bitLength=function(){return 8*(this.data.length-1)+a.default.nbits(this.data[0])},s.prototype.byteLength=function(){return this.data.length},s.prototype.toUint8Array=function(e,t){e=e||"be",t=t||this.data.length;const r=new Uint8Array(t);t="le"===e?0:t-this.data.length;return r.set(this.data,t),"le"===e&&r.reverse(),r},s.prototype.fromUint8Array=function(e,t="be"){this.data=new Uint8Array(e.length),this.data.set(e),"le"===t&&this.data.reverse()},s.prototype.toString=function(){return a.default.Uint8Array_to_str(this.toUint8Array())},s.prototype.fromString=function(e,t="be"){this.fromUint8Array(a.default.str_to_Uint8Array(e),t)},s.prototype.toBN=function(){return new n.default(this.toUint8Array())},s.prototype.fromBN=function(e){this.data=e.toArrayLike(Uint8Array)},s.fromClone=function(e){return new s(e.data)},r.default=s},{"../util":158,"bn.js":16}],156:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=i(e("../util")),a=i(e("../enums"));function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e instanceof s)this.oid=e.oid;else if(n.default.isArray(e)||n.default.isUint8Array(e)){if(6===(e=new Uint8Array(e))[0]){if(e[1]!==e.length-2)throw new Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}s.prototype.read=function(e){if(1<=e.length){var t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw new Error("Invalid oid")},s.prototype.write=function(){return n.default.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])},s.prototype.toHex=function(){return n.default.Uint8Array_to_hex(this.oid)},s.prototype.getName=function(){var e=this.toHex();if(a.default.curve[e])return a.default.write(a.default.curve,e);throw new Error("Unknown curve object identifier.")},s.fromClone=function(e){return new s(e.oid)},r.default=s},{"../enums":113,"../util":158}],157:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("../config")),l=a(e("../crypto")),f=a(e("../enums.js")),d=a(e("../util.js"));function a(e){return e&&e.__esModule?e:{default:e}}function i(){this.algorithm="sha256",this.type="iterated",this.c=n.default.s2k_iteration_count_byte,this.salt=null}i.prototype.get_count=function(){return 16+(15&this.c)<<6+(this.c>>4)},i.prototype.read=function(e){let t=0;switch(this.type=f.default.read(f.default.s2k,e[t++]),this.algorithm=e[t++],"gnu"!==this.type&&(this.algorithm=f.default.read(f.default.hash,this.algorithm)),this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if("GNU"!==d.default.Uint8Array_to_str(e.subarray(t,t+3)))throw new Error("Unknown s2k type.");if(t+=3,1001!==1e3+e[t++])throw new Error("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new Error("Unknown s2k type.")}return t},i.prototype.write=function(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...d.default.str_to_Uint8Array("GNU"),1]);const e=[new Uint8Array([f.default.write(f.default.s2k,this.type),f.default.write(f.default.hash,this.algorithm)])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw new Error("GNU s2k type not supported.");default:throw new Error("Unknown s2k type.")}return d.default.concatUint8Array(e)},i.prototype.produce_key=async function(e,t){e=d.default.encode_utf8(e);var n=f.default.write(f.default.hash,this.algorithm);const a=[];let i=0,s=0;for(;i{if(c.default.isStream(e))if(e.locked)s[a]=null;else{const i=u.default.transformPair(e,async e=>{const r=u.default.getReader(e);e=new MessageChannel;const n=e.port1,t=e.port2;n.onmessage=async function({data:{action:e}}){if("read"===e)try{var t=await r.read();n.postMessage(t,c.default.getTransferables(t))}catch(e){n.postMessage({error:e.message})}else"cancel"===e&&(await i.cancel(),n.postMessage())},s[a]=t,o.push(t)})}else{if("[object MessagePort]"===Object.prototype.toString.call(e))throw new Error("Can't transfer the same stream twice.");c.default.collectTransferables(e,o,t)}}))},restoreStreams:function(r){return Object.prototype.isPrototypeOf(r)&&!Uint8Array.prototype.isPrototypeOf(r)&&Object.entries(r).forEach(([e,t])=>{"[object MessagePort]"!==Object.prototype.toString.call(t)?c.default.restoreStreams(t):r[e]=new ReadableStream({pull(a){return new Promise(n=>{t.onmessage=e=>{var t=e.data,r=t.done,e=t.value,t=t.error;t?a.error(new Error(t)):r?a.close():a.enqueue(e),n()},t.postMessage({action:"read"})})},cancel(){return new Promise(e=>{t.onmessage=e,t.postMessage({action:"cancel"})})}},{highWaterMark:0})}),r},readNumber:function(t){let r=0;for(let e=0;e>8*(r-e-1)&255;return n},readDate:function(e){e=c.default.readNumber(e);return new Date(1e3*e)},writeDate:function(e){e=Math.floor(e.getTime()/1e3);return c.default.writeNumber(e,4)},normalizeDate:function(e=Date.now()){return null===e||e===1/0?e:new Date(1e3*Math.floor(+e/1e3))},str_to_hex:function(e){if(null===e)return"";const t=[];var r=e.length;let n=0,a;for(;n>8,255&t]);return c.default.concatUint8Array([t,e])},b64_to_Uint8Array:function(e){return n.default.decode(e.replace(/-/g,"+").replace(/_/g,"/"))},Uint8Array_to_b64:function(e,t){let r=n.default.encode(e).replace(/[\r\n]/g,"");return t&&(r=r.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),r},hex_to_Uint8Array:function(t){const r=new Uint8Array(t.length>>1);for(let e=0;e>1;e++)r[e]=parseInt(t.substr(e<<1,2),16);return r},Uint8Array_to_hex:function(e){const t=[];var r=e.length;let n=0,a;for(;n{if(!c.default.isString(t))throw new Error("str_to_Uint8Array: Data must be in the form of a string");const r=new Uint8Array(t.length);for(let e=0;et("",!0))},decode_utf8:function(e){const r=new TextDecoder("utf-8");function t(e,t=!1){return r.decode(e,{stream:!t})}return u.default.transform(e,t,()=>t(new Uint8Array,!0))},concat:u.default.concat,concatUint8Array:u.default.concatUint8Array,equalsUint8Array:function(t,r){if(!c.default.isUint8Array(t)||!c.default.isUint8Array(r))throw new Error("Data must be in the form of a Uint8Array");if(t.length!==r.length)return!1;for(let e=0;e{console.log(t+": ",e)})},nbits:function(e){let t=1,r=e>>>16;return 0!==r&&(e=r,t+=16),r=e>>8,0!==r&&(e=r,t+=8),r=e>>4,0!==r&&(e=r,t+=4),r=e>>2,0!==r&&(e=r,t+=2),r=e>>1,0!==r&&(e=r,t+=1),t},double:function(t){const r=new Uint8Array(t.length);var n=t.length-1;for(let e=0;e>7;return r[n]=t[n]<<1^135*(t[0]>>7),r},shiftRight:function(t,r){if(r)for(let e=t.length-1;0<=e;e--)t[e]>>=r,0()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}|xn--[a-zA-Z\-0-9]+)))$/.test(e)},formatUserId:function(e){if(e.name&&!c.default.isString(e.name)||e.email&&!c.default.isEmailAddress(e.email)||e.comment&&!c.default.isString(e.comment))throw new Error("Invalid user id format");const t=[];return e.name&&t.push(e.name),e.comment&&t.push(`(${e.comment})`),e.email&&t.push(`<${e.email}>`),t.join(" ")},parseUserId:function(e){if(e.length>s.default.max_userid_length)throw new Error("User id string is too long");try{var t=i.default.parseOneAddress({input:e,atInDisplayName:!0});const r=t.name,n=t.address,a=t.comments;return{name:r,email:n,comment:a.replace(/^\(|\)$/g,"")}}catch(e){throw new Error("Invalid user id format")}},canonicalizeEOL:function(e){let o=!1;return u.default.transform(e,t=>{13===(t=o?c.default.concatUint8Array([new Uint8Array([13]),t]):t)[t.length-1]?(o=!0,t=t.subarray(0,-1)):o=!1;let r;const n=[];for(let e=0;r=t.indexOf(10,e)+1,r;e=r)13!==t[r-2]&&n.push(r);if(!n.length)return t;const a=new Uint8Array(t.length+n.length);let i=0;for(let e=0;eo?new Uint8Array([13]):void 0)},nativeEOL:function(e){let i=!1;return u.default.transform(e,t=>{13===(t=i&&10!==t[0]?c.default.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]?(i=!0,t=t.subarray(0,-1)):i=!1;let r,n=0;for(let e=0;e!==t.length;e=r){r=t.indexOf(13,e)+1,r=r||t.length;var a=r-(10===t[r]?1:0);e&&t.copyWithin(n,e,a),n+=a-e}return t.subarray(0,n)},()=>i?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(e){return e.split("\n").map(e=>{let t=e.length-1;for(;0<=t&&(" "===e[t]||"\t"===e[t]);t--);return e.substr(0,t+1)}).join("\n")},encodeZBase32:function(e){if(0===e.length)return"";var t;let r=e[0],n=1,a=8,i="";for(;0>a];return i},wrapError:function(e,t){if(!t)return new Error(e);try{t.message=e+": "+t.message}catch(e){}return t}}}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./config":79,"./encoding/base64":112,"./util":158,"email-addresses":33,"web-stream-tools":75}],159:[function(n,e,a){!function(e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=t(n("./util")),c=t(n("./crypto")),l=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(n("./key"));function t(e){return e&&e.__esModule?e:{default:e}}function r(){this._fetch="function"==typeof e.fetch?e.fetch:n("node-fetch")}r.prototype.lookup=async function(e){const t=this._fetch;if(!e.email)throw new Error("You must provide an email parameter!");if(!u.default.isEmailAddress(e.email))throw new Error("Invalid e-mail address.");var r=/(.*)@(.*)/.exec(e.email),n=o(r,3);const a=n[1],i=n[2];r=u.default.encodeZBase32(await c.default.hash.sha1(u.default.str_to_Uint8Array(a.toLowerCase()))),n=`https://openpgpkey.${i}/.well-known/openpgpkey/${i}/hu/${r}`,r=`https://${i}/.well-known/openpgpkey/hu/${r}`;let s;try{if(s=await t(n),200!==s.status)throw new Error("Advanced WKD lookup failed: "+s.statusText)}catch(e){if(u.default.print_debug_error(e),s=await t(r),200!==s.status)throw new Error("Direct WKD lookup failed: "+s.statusText)}r=new Uint8Array(await s.arrayBuffer());return e.rawBytes?r:l.read(r)},a.default=r}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./crypto":94,"./key":118,"./util":158,"node-fetch":"node-fetch"}],160:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=a(e("../util.js")),o=a(e("../config")),n=a(e("../crypto")),u=a(e("../packet"));function a(e){return e&&e.__esModule?e:{default:e}}function i({path:e="openpgp.worker.js",n:t=1,workers:r=[],config:n}={}){const a=n=>e=>{var t=e.data;switch(t.event){case"loaded":this.workers[n].loadedResolve(!0);break;case"method-return":if(t.err){const r=new Error(t.err);r.workerStack=t.stack,this.tasks[t.id].reject(r)}else this.tasks[t.id].resolve(t.data);delete this.tasks[t.id],this.workers[n].requests--;break;case"request-seed":this.seedRandom(n,t.amount);break;default:throw new Error("Unknown Worker Event.")}};if(r.length)this.workers=r;else for(this.workers=[];this.workers.length{t.loadedPromise=new Promise(e=>{t.loadedResolve=e}),t.requests=0,t.onmessage=a(i++),t.onerror=e=>(t.loadedResolve(!1),console.error("Unhandled error in openpgp worker: "+e.message+" ("+e.filename+":"+e.lineno+")"),!1),n&&t.postMessage({event:"configure",config:n})}),this.tasks={},this.currentID=0}i.prototype.loaded=async function(){const e=await Promise.all(this.workers.map(e=>e.loadedPromise));return e.every(Boolean)},i.prototype.getID=function(){return this.currentID++},i.prototype.seedRandom=async function(e,t){t=await n.default.random.getRandomBytes(t);this.workers[e].postMessage({event:"seed-random",buf:t},s.default.getTransferables(t,!0))},i.prototype.clearKeyCache=async function(){await Promise.all(this.workers.map(n=>new Promise((e,t)=>{var r=this.getID();n.postMessage({id:r,event:"clear-key-cache"}),this.tasks[r]={resolve:e,reject:t}})))},i.prototype.terminate=function(){this.workers.forEach(e=>{e.terminate()})},i.prototype.delegate=function(r,n){const a=this.getID();var e=this.workers.map(e=>e.requests),t=Math.min(...e);let i=0;for(;i{this.workers[i].postMessage({id:a,event:r,options:u.default.clone.clonePackets(n)},s.default.getTransferables(n,o.default.zero_copy)),this.workers[i].requests++,this.tasks[a]={resolve:e=>t(u.default.clone.parseClonedPackets(s.default.restoreStreams(e),r)),reject:e}})},r.default=i},{"../config":79,"../crypto":94,"../packet":131,"../util.js":158}]},{},[115])(115)}),function(i){"use strict";var b=function(e,t){this.hi=0|e,this.lo=0|t},p=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>>32-t}function g(e,t){var r=255&e[t+3];return(r=(r=r<<8|255&e[t+2])<<8|255&e[t+1])<<8|255&e[t+0]}function w(e,t){var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t=e[t+4]<<24|e[t+5]<<16|e[t+6]<<8|e[t+7];return new b(r,t)}function v(e,t,r){for(var n=0;n<4;n++)e[t+n]=255&r,r>>>=8}function _(e,t,r){e[t]=r.hi>>24&255,e[t+1]=r.hi>>16&255,e[t+2]=r.hi>>8&255,e[t+3]=255&r.hi,e[t+4]=r.lo>>24&255,e[t+5]=r.lo>>16&255,e[t+6]=r.lo>>8&255,e[t+7]=255&r.lo}function u(e,t,r,n,a){for(var i=0,s=0;s>>8)-1}function k(e,t,r,n){return u(e,t,r,n,16)}function A(e,t,r,n){return u(e,t,r,n,32)}function S(e,t,r,n,a){for(var i,s,o=new Uint32Array(16),u=new Uint32Array(16),c=new Uint32Array(16),l=new Uint32Array(4),f=0;f<4;f++)u[5*f]=g(n,4*f),u[1+f]=g(r,4*f),u[6+f]=g(t,4*f),u[11+f]=g(r,16+4*f);for(f=0;f<16;f++)c[f]=u[f];for(f=0;f<20;f++){for(i=0;i<4;i++){for(s=0;s<4;s++)l[s]=u[(5*i+4*s)%16];for(l[1]^=m(l[0]+l[3]|0,7),l[2]^=m(l[1]+l[0]|0,9),l[3]^=m(l[2]+l[1]|0,13),l[0]^=m(l[3]+l[2]|0,18),s=0;s<4;s++)o[4*i+(i+s)%4]=l[s]}for(s=0;s<16;s++)u[s]=o[s]}if(a){for(f=0;f<16;f++)u[f]=u[f]+c[f]|0;for(f=0;f<4;f++)u[5*f]=u[5*f]-g(n,4*f)|0,u[6+f]=u[6+f]-g(t,4*f)|0;for(f=0;f<4;f++)v(e,4*f,u[5*f]),v(e,16+4*f,u[6+f])}else for(f=0;f<16;f++)v(e,4*f,u[f]+c[f]|0)}function E(e,t,r,n){S(e,t,r,n,!1)}function P(e,t,r,n){return S(e,t,r,n,!0),0}var x=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function M(e,t,r,n,a,i,s){var o,u,c=new Uint8Array(16),l=new Uint8Array(64);if(!a)return 0;for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=i[u];for(;64<=a;){for(E(l,c,s,x),u=0;u<64;u++)e[t+u]=(r?r[n+u]:0)^l[u];for(o=1,u=8;u<16;u++)o=o+(255&c[u])|0,c[u]=255&o,o>>>=8;a-=64,t+=64,r&&(n+=64)}if(0>>=8}var T=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]);function B(e,t,r,n,a,i){for(var s,o,u,c=new Uint32Array(17),l=new Uint32Array(17),f=new Uint32Array(17),d=new Uint32Array(17),h=new Uint32Array(17),p=0;p<17;p++)l[p]=f[p]=0;for(p=0;p<16;p++)l[p]=i[p];for(l[3]&=15,l[4]&=252,l[7]&=15,l[8]&=252,l[11]&=15,l[12]&=252,l[15]&=15;0>>=8;for(u=u+f[16]|0,f[16]=3&u,u=5*(u>>>2)|0,p=0;p<16;p++)u=u+f[p]|0,f[p]=255&u,u>>>=8;u=u+f[16]|0,f[16]=u}for(p=0;p<17;p++)h[p]=f[p];for(U(f,T),s=0|-(f[16]>>>7),p=0;p<17;p++)f[p]^=s&(h[p]^f[p]);for(p=0;p<16;p++)d[p]=i[p+16];for(d[16]=0,U(f,d),p=0;p<16;p++)e[t+p]=f[p];return 0}function R(e,t,r,n,a,i){var s=new Uint8Array(16);return B(s,0,r,n,a,i),k(e,t,s,0)}function I(e,t,r,n,a){var i;if(r<32)return-1;for(j(e,0,t,0,r,n,a),B(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function O(e,t,r,n,a){var i,s=new Uint8Array(32);if(r<32)return-1;if(C(s,0,32,n,a),0!==R(t,16,t,32,r-32,s))return-1;for(j(e,0,t,0,r,n,a),i=0;i<32;i++)e[i]=0;return 0}function z(e,t){for(var r=0;r<16;r++)e[r]=0|t[r]}function D(e){for(var t,r=0;r<16;r++)e[r]+=65536,t=Math.floor(e[r]/65536),e[(r+1)*(r<15?1:0)]+=t-1+37*(t-1)*(15===r?1:0),e[r]-=65536*t}function N(e,t,r){for(var n,a=~(r-1),i=0;i<16;i++)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function F(e,t){for(var r,n,a=p(),i=p(),s=0;s<16;s++)i[s]=t[s];for(D(i),D(i),D(i),r=0;r<2;r++){for(a[0]=i[0]-65517,s=1;s<15;s++)a[s]=i[s]-65535-(a[s-1]>>16&1),a[s-1]&=65535;a[15]=i[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,N(i,a,1-n)}for(s=0;s<16;s++)e[2*s]=255&i[s],e[2*s+1]=i[s]>>8}function q(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return F(r,e),F(n,t),A(r,0,n,0)}function L(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function H(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function W(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]|0}function G(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]|0}function V(e,t,r){for(var n,a=new Float64Array(31),i=0;i<31;i++)a[i]=0;for(i=0;i<16;i++)for(n=0;n<16;n++)a[i+n]+=t[i]*r[n];for(i=0;i<15;i++)a[i]+=38*a[i+16];for(i=0;i<16;i++)e[i]=a[i];D(e),D(e)}function Z(e,t){V(e,t,t)}function Y(e,t){for(var r=p(),n=0;n<16;n++)r[n]=t[n];for(n=253;0<=n;n--)Z(r,r),2!==n&&4!==n&&V(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function $(e,t){for(var r=p(),n=0;n<16;n++)r[n]=t[n];for(n=250;0<=n;n--)Z(r,r),1!==n&&V(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function J(e,t,r){for(var n,a=new Uint8Array(32),i=new Float64Array(80),s=p(),o=p(),u=p(),c=p(),l=p(),f=p(),d=0;d<31;d++)a[d]=t[d];for(a[31]=127&t[31]|64,a[0]&=248,H(i,r),d=0;d<16;d++)o[d]=i[d],c[d]=s[d]=u[d]=0;for(s[0]=c[0]=1,d=254;0<=d;--d)N(s,o,n=a[d>>>3]>>>(7&d)&1),N(u,c,n),W(l,s,u),G(s,s,u),W(u,o,c),G(o,o,c),Z(c,l),Z(f,s),V(s,u,s),V(u,o,l),W(l,s,u),G(s,s,u),Z(o,s),G(u,c,f),V(s,u,y),W(s,s,c),V(u,u,s),V(s,c,f),V(c,o,i),Z(o,l),N(s,o,n),N(u,c,n);for(d=0;d<16;d++)i[d+16]=s[d],i[d+32]=u[d],i[d+48]=o[d],i[d+64]=c[d];var h=i.subarray(32),r=i.subarray(16);return Y(h,h),V(r,r,h),F(e,r),0}function X(e,t){return J(e,t,r)}function Q(e,t){return s(t,32),X(e,t)}function ee(e,t,r){var n=new Uint8Array(32);return J(n,r,t),P(e,a,n,x)}var te=I,re=O;function ne(){for(var e,t=0,r=0,n=0,a=0,i=0;i>>16,n+=65535&(e=arguments[i].hi),a+=e>>>16;return new b(65535&(n+=(r+=t>>>16)>>>16)|(a+=n>>>16)<<16,65535&t|r<<16)}function ae(e,t){return new b(e.hi>>>t,e.lo>>>t|e.hi<<32-t)}function ie(){for(var e=0,t=0,r=0;r>>t|e.lo<>>t|e.hi<>>t|e.hi<>>t|e.lo<>(7&a)&1),fe(t,e),fe(e,e),de(e,t,n)}function ye(e,t){var r=[p(),p(),p(),p()];z(r[0],n),z(r[1],o),z(r[2],l),V(r[3],n,o),pe(e,r,t)}function be(e,t,r){var n,a=new Uint8Array(64),i=[p(),p(),p(),p()];for(r||s(t,32),le(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,ye(i,a),he(e,i),n=0;n<32;n++)t[n+32]=e[n];return 0}var me=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ge(e,t){for(var r,n,a,i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>4)*me[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*me[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function we(e){for(var t=new Float64Array(64),r=0;r<64;r++)t[r]=e[r];for(r=0;r<64;r++)e[r]=0;ge(e,t)}function ve(e,t,r,n){var a,i=new Uint8Array(64),s=new Uint8Array(64),o=new Uint8Array(64),u=new Float64Array(64),c=[p(),p(),p(),p()];le(i,n,32),i[0]&=248,i[31]&=127,i[31]|=64;for(var l=r+64,f=0;f>7&&G(e[0],c,e[0]),V(e[3],e[0],e[1])}(u,n))return-1;for(a=0;a>>24]^h[i>>16&255]^p[s>>8&255]^y[255&t]^n[l],o=e[i>>>24]^h[s>>16&255]^p[t>>8&255]^y[255&a]^n[l+1],u=e[s>>>24]^h[t>>16&255]^p[a>>8&255]^y[255&i]^n[l+2],t=e[t>>>24]^h[a>>16&255]^p[i>>8&255]^y[255&s]^n[l+3],l+=4,a=d,i=o,s=u;for(m=0;m<4;m++)f[r?3&-m:m]=b[a>>>24]<<24^b[i>>16&255]<<16^b[s>>8&255]<<8^b[255&t]^n[l++],d=a,a=i,i=s,s=t,t=d;return f}function u(e,t){for(var r,n,a=e.F,i=e.b,s=a[0],o=a[1],u=a[2],c=a[3],l=a[4],f=a[5],d=a[6],h=a[7],p=0;p<64;p++)r=(r=p<16?t[p]:(r=t[p+1&15],n=t[p+14&15],t[15&p]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+t[15&p]+t[p+9&15]|0))+h+(l>>>6^l>>>11^l>>>25^l<<26^l<<21^l<<7)+(d^l&(f^d))+i[p],h=d,d=f,f=l,l=c+r|0,c=u,u=o,s=r+((o=s)&u^c&(o^u))+(o>>>2^o>>>13^o>>>22^o<<30^o<<19^o<<10)|0;a[0]=a[0]+s|0,a[1]=a[1]+o|0,a[2]=a[2]+u|0,a[3]=a[3]+c|0,a[4]=a[4]+l|0,a[5]=a[5]+f|0,a[6]=a[6]+d|0,a[7]=a[7]+h|0}function A(e,t){var r,n=sjcl.random.K[e],a=[];for(r in n)n.hasOwnProperty(r)&&a.push(n[r]);for(r=0;r>>24]<<24^a[t>>16&255]<<16^a[t>>8&255]<<8^a[255&t],0==e%s&&(t=t<<8^t>>>24^o<<24,o=o<<1^283*(o>>7))),r[e]=r[e-s]^t;for(s=0;e;s++,e--)t=r[3&s?e:e-4],n[s]=e<=4||s<4?t:i[0][a[t>>>24]]^i[1][a[t>>16&255]]^i[2][a[t>>8&255]]^i[3][a[255&t]]},sjcl.cipher.aes.prototype={encrypt:function(e){return t(this,e,0)},decrypt:function(e){return t(this,e,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){for(var e,t,r,n,a,i,s=this.s[0],o=this.s[1],u=s[4],c=o[4],l=[],f=[],d=0;d<256;d++)f[(l[d]=d<<1^283*(d>>7))^d]=d;for(e=t=0;!u[e];e^=r||1,t=f[t]||1)for(i=16843009*(n=l[d=l[r=l[c[u[e]=a=(a=t^t<<1^t<<2^t<<3^t<<4)>>8^255&a^99]=e]]])^65537*d^257*r^16843008*e,n=257*l[a]^16843008*a,d=0;d<4;d++)s[d][e]=n=n<<24^n>>>8,o[d][a]=i=i<<24^i>>>8;for(d=0;d<5;d++)s[d]=s[d].slice(0),o[d]=o[d].slice(0)}},sjcl.bitArray={bitSlice:function(e,t,r){return e=sjcl.bitArray.$(e.slice(t/32),32-(31&t)).slice(1),void 0===r?e:sjcl.bitArray.clamp(e,r-t)},extract:function(e,t,r){var n=Math.floor(-t-r&31);return(-32&(t+r-1^t)?e[t/32|0]<<32-n^e[t/32+1|0]>>>n:e[t/32|0]>>>n)&(1<>t-1,1)),e},partial:function(e,t,r){return 32===e?t:(r?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(sjcl.bitArray.bitLength(e)!==sjcl.bitArray.bitLength(t))return!1;for(var r=0,n=0;n>>t),r=e[a]<<32-t;return a=e.length?e[e.length-1]:0,e=sjcl.bitArray.getPartial(a),n.push(sjcl.bitArray.partial(t+e&31,32>>24|t>>>8&65280|(65280&t)<<8|t<<24;return e}},sjcl.codec.utf8String={fromBits:function(e){for(var t,r="",n=sjcl.bitArray.bitLength(e),a=0;a>>8>>>8>>>8),t<<=8;return decodeURIComponent(escape(r))},toBits:function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0,n=0;n>>s)>>>a),s>>u),l=n<>>a)>>>26),a<6?(s=e[r]<<6-a,a+=26,r++):(s<<=6,a-=6);for(;3&n.length&&!t;)n+="=";return n},toBits:function(e,t){e=e.replace(/\s|=/g,"");var r,n,a=[],i=0,s=sjcl.codec.base64.B,o=0;for(t&&(s=s.substr(0,62)+"-_"),r=0;r>>i),o=n<<32-i):o^=n<<32-(i+=6)}return 56&i&&a.push(sjcl.bitArray.partial(56&i,o,1)),a}},sjcl.codec.base64url={fromBits:function(e){return sjcl.codec.base64.fromBits(e,1,1)},toBits:function(e){return sjcl.codec.base64.toBits(e,1)}},sjcl.hash.sha256=function(e){this.b[0]||this.O(),e?(this.F=e.F.slice(0),this.A=e.A.slice(0),this.l=e.l):this.reset()},sjcl.hash.sha256.hash=function(e){return(new sjcl.hash.sha256).update(e).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(e){"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e));var t=this.A=sjcl.bitArray.concat(this.A,e);if(a=this.l,9007199254740991<(e=this.l=a+sjcl.bitArray.bitLength(e)))throw new sjcl.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){for(var r=new Uint32Array(t),n=0,a=512+a-(512+a&511);a<=e;a+=512)u(this,r.subarray(16*n,16*(n+1))),n+=1;t.splice(0,16*n)}else for(a=512+a-(512+a&511);a<=e;a+=512)u(this,t.splice(0,16));return this},finalize:function(){for(var e=this.A,t=this.F,r=(e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)])).length+2;15&r;r++)e.push(0);for(e.push(Math.floor(this.l/4294967296)),e.push(0|this.l);e.length;)u(this,e.splice(0,16));return this.reset(),t},Y:[],b:[],O:function(){function e(e){return 4294967296*(e-Math.floor(e))|0}for(var t,r,n=0,a=2;n<64;a++){for(r=!0,t=2;t*t<=a;t++)if(0==a%t){r=!1;break}r&&(n<8&&(this.Y[n]=e(Math.pow(a,.5))),this.b[n]=e(Math.pow(a,1/3)),n++)}}},sjcl.mode.ccm={name:"ccm",G:[],listenProgress:function(e){sjcl.mode.ccm.G.push(e)},unListenProgress:function(e){-1<(e=sjcl.mode.ccm.G.indexOf(e))&&sjcl.mode.ccm.G.splice(e,1)},fa:function(e){for(var t=sjcl.mode.ccm.G.slice(),r=0;r>>8*i;i++);return r=o.clamp(r,8*(15-(i=i<15-u?15-u:i))),t=sjcl.mode.ccm.V(e,t,r,n,a,i),s=sjcl.mode.ccm.C(e,s,r,t,a,i),o.concat(s.data,s.tag)},decrypt:function(e,t,r,n,a){a=a||64,n=n||[];var i=sjcl.bitArray,s=i.bitLength(r)/8,o=i.bitLength(t),u=i.clamp(t,o-a),c=i.bitSlice(t,o-a),o=(o-a)/8;if(s<7)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(t=2;t<4&&o>>>8*t;t++);if(r=i.clamp(r,8*(15-(t=t<15-s?15-s:t))),u=sjcl.mode.ccm.C(e,u,r,c,a,t),e=sjcl.mode.ccm.V(e,u.data,r,n,a,t),!i.equal(u.tag,e))throw new sjcl.exception.corrupt("ccm: tag doesn't match");return u.data},na:function(e,t,r,n,a,i){var s=[],o=sjcl.bitArray,u=o.i;if(n=[o.partial(8,(t.length?64:0)|n-2<<2|i-1)],(n=o.concat(n,r))[3]|=a,n=e.encrypt(n),t.length)for((r=o.bitLength(t)/8)<=65279?s=[o.partial(16,r)]:r<=4294967295&&(s=o.concat([o.partial(16,65534)],[r])),s=o.concat(s,t),t=0;t>>31,e[1]<<1^e[2]>>>31,e[2]<<1^e[3]>>>31,e[3]<<1^135*(e[0]>>>31)]}},sjcl.mode.gcm={name:"gcm",encrypt:function(e,t,r,n,a){var i=t.slice(0);return t=sjcl.bitArray,e=sjcl.mode.gcm.C(!0,e,i,n=n||[],r,a||128),t.concat(e.data,e.tag)},decrypt:function(e,t,r,n,a){var i=t.slice(0),s=sjcl.bitArray,o=s.bitLength(i);if(n=n||[],i=(a=a||128)<=o?(t=s.bitSlice(i,o-a),s.bitSlice(i,0,o-a)):(t=i,[]),e=sjcl.mode.gcm.C(!1,e,i,n,r,a),!s.equal(e.tag,t))throw new sjcl.exception.corrupt("gcm: tag doesn't match");return e.data},ka:function(e,t){for(var r,n,a=sjcl.bitArray.i,i=[0,0,0,0],s=t.slice(0),o=0;o<128;o++){for((r=0!=(e[Math.floor(o/32)]&1<<31-o%32))&&(i=a(i,s)),n=0!=(1&s[3]),r=3;0>>1|(1&s[r-1])<<31;s[0]>>>=1,n&&(s[0]^=-520093696)}return i},j:function(e,t,r){var n,a=r.length;for(t=t.slice(0),n=0;na&&(e=t.hash(e)),r=0;r=1<this.o&&(this.o=s),this.P++,this.b=sjcl.hash.sha256.hash(this.b.concat(n)),this.L=new sjcl.cipher.aes(this.b),i=0;i<4&&(this.h[i]=this.h[i]+1|0,!this.h[i]);i++);}for(i=0;i>>=1;this.c[i].update([u,this.N++,2,t,a,e.length].concat(e))}break;case"string":void 0===t&&(t=e.length),this.c[i].update([u,this.N++,3,t,a,e.length]),this.c[i].update(e);break;default:o=1}if(o)throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[i]+=t,this.f+=t,s===this.u&&(this.isReady()!==this.u&&A("seeded",Math.max(this.o,this.f)),A("progress",this.getProgress()))},isReady:function(e){return e=this.T[void 0!==e?e:this.M],this.o&&this.o>=e?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=e?this.J|this.u:this.u},getProgress:function(e){return e=this.T[e||this.M],this.o>=e||this.f>e?1:this.f/e},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new sjcl.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(e,t){this.K[e][this.ga++]=t},removeEventListener:function(e,t){var r,n,a=this.K[e],i=[];for(n in a)a.hasOwnProperty(n)&&a[n]===t&&i.push(n);for(r=0;r