diff --git a/decidim-bulletin_board-app/Gemfile.lock b/decidim-bulletin_board-app/Gemfile.lock index 9e6ccc7d..304b99d2 100644 --- a/decidim-bulletin_board-app/Gemfile.lock +++ b/decidim-bulletin_board-app/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../decidim-bulletin_board-ruby specs: - decidim-bulletin_board (0.11.0) + decidim-bulletin_board (0.12.0) byebug (~> 11.0) graphlient (~> 0.4.0) jwt (~> 2.2.2) diff --git a/decidim-bulletin_board-ruby/CHANGELOG.md b/decidim-bulletin_board-ruby/CHANGELOG.md index 47041ab4..93d675ff 100644 --- a/decidim-bulletin_board-ruby/CHANGELOG.md +++ b/decidim-bulletin_board-ruby/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.12.0] - 2021-02-19 + ### Added - The `Voter` returns the ballot hash after encrpyting the plain vote and before auditing or casting it diff --git a/decidim-bulletin_board-ruby/Gemfile.lock b/decidim-bulletin_board-ruby/Gemfile.lock index 62ea9d5d..dfdaccfe 100644 --- a/decidim-bulletin_board-ruby/Gemfile.lock +++ b/decidim-bulletin_board-ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - decidim-bulletin_board (0.11.0) + decidim-bulletin_board (0.12.0) byebug (~> 11.0) graphlient (~> 0.4.0) jwt (~> 2.2.2) diff --git a/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js b/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js index 61628d08..73476b11 100644 --- a/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js +++ b/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js @@ -1,10 +1,10 @@ -window.decidimBulletinBoard=function(){var e={6665:function(e,t,r){"use strict";r.r(t),r.d(t,{Client:function(){return y},Election:function(){return b},IdentificationKeys:function(){return te},KeyCeremonyComponent:function(){return re},MESSAGE_PROCESSED:function(){return Q},MESSAGE_RECEIVED:function(){return G},MessageIdentifier:function(){return m},TallyComponent:function(){return ne},Trustee:function(){return X},VoteComponent:function(){return ie},Voter:function(){return ee}});var n=r(1439),i=r(9312),a=r.n(i),o=r(9953),s=r.n(o),u=r(3718),c=r.n(u),l=r(6890),f=r.n(l),h=r(5313),p=r.n(h);class d{constructor({apiEndpointUrl:e,headers:t}){const r=new n.HttpLink({uri:e,headers:t});this.apolloClient=new n.fe({link:r,cache:new n.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:f(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:a(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:s(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:p(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:c(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class y{constructor(e){this.apiClient=new d(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const v="t",g=["a","b","v",v];class m{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!g.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class b{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=m.parse(r.messageId);if(n.author.type===v&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var E=r(655);function S(e){return"function"==typeof e}var C=!1,w={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;C=e},get useDeprecatedSynchronousErrorHandling(){return C}};function T(e){setTimeout((function(){throw e}),0)}var I={closed:!0,next:function(e){},error:function(e){if(w.useDeprecatedSynchronousErrorHandling)throw e;T(e)},complete:function(){}},A=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var k=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),_=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u{n.b[t.name]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.name]=t})));return await Promise.all(i),n}loadKey(e){return J.JWK.asKey(e.public_key,"json")}}class X{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new Z({authorityPublicKeyJSON:r}),this.events=new W,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}setup(){return this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e,t.messageId),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:m.format(this.election.uniqueId,e,v,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class ${constructor({voterId:e}){this.voterId=e,this.jointElectionKey=null,this.contests={}}processMessage(e,t){switch(e.type){case"create_election":this.contests=t.description.contests;break;case"end_key_ceremony":{const e=JSON.parse(t.content);this.jointElectionKey=e.joint_election_key;break}}}async encrypt(e){return new Promise((e=>setTimeout(e,500))).then((()=>{if(!this.jointElectionKey)return void console.warn("Invalid election status.");const t=this.createAuditableBallot(e),r=JSON.parse(JSON.stringify(t));return{auditableBallot:t,encryptedBallot:JSON.stringify(this.createEncryptedBallot(r))}}))}createAuditableBallot(e){return{ballot_style:"ballot-style",contests:this.contests.map((({object_id:t,ballot_selections:r})=>({object_id:t,ballot_selections:r.map((r=>{const n=Math.random(),i=e[t]&&e[t].includes(r.object_id)?1:0;return{object_id:r.object_id,ciphertext:i+Math.floor(500*n)*this.jointElectionKey,random:n,plaintext:i}}))})))}}createEncryptedBallot(e){return this.removeAuditInformation(e)}removeAuditInformation(e){return e.contests.map((e=>e.ballot_selections.map((e=>(delete e.random,delete e.plaintext,e))))),e}}class ee{constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapper=new $({voterId:n}),this.parser=new Z({authorityPublicKeyJSON:t})}setup(){return this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapper.processMessage(e,r)}}))}async encrypt(e){return this.wrapper.encrypt(e)}async encryptBallot(e){const t=e.encryptedBallot;return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((e=>{const r=Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("");return{encryptedBallot:t,encryptedBallotHash:r}}))}async auditBallot(e){const t=e.auditableBallot,r=await this.encryptBallot(e);return{encryptedBallot:r.encryptedBallot,encryptedBallotHash:r.encryptedBallotHash,plainVote:t}}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class te{constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Y(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s,onBackupNeeded:u,onBindBackupButton:c,onBackupStarted:l}){this.trustee.events.subscribe(t),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runKeyCeremony(),a())},r.readAsText(t)})),n((async e=>{if(e.preventDefault(),o(),await this.trustee.needsToBeRestored())s();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();u(),c(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{l(),await e.next(),await this.trustee.runKeyCeremony(),a()}))}})),await this.trustee.setup(),e()}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s}){this.trustee.events.subscribe(t),n((async e=>{e.preventDefault(),o(),await this.trustee.needsToBeRestored()?s():(await this.trustee.runTally(),a())})),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runTally(),a())},r.readAsText(t)})),await this.trustee.setup(),e()}}class ie{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n}){this.bulletinBoardClient=new y(e);const i=new b({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new ee({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:i,uniqueId:n})}async bindEvents({onSetup:e,onBindEncryptButton:t,onStart:r,onVoteEncryption:n,castOrAuditBallot:i,onAuditVote:a,onVoteAudition:o,onAuditComplete:s,onVoteValidation:u,onVoteEncrypted:c,onComplete:l,onInvalid:f}){t((()=>{r(),n((e=>{this.voter.encrypt(e).then((e=>{i(),a((()=>{this.voter.auditBallot(e).then((e=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`)})).then((()=>{s()}))}),(()=>{f()})),u((()=>{this.voter.encryptBallot(e).then((async e=>{c(e)})).then((()=>{l()}))}),(()=>{f()}))}))}))})),await this.voter.setup(),e()}}},2634:function(e,t,r){"use strict";r.d(t,{h4:function(){return Be},ab:function(){return ce}});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?A(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;I(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return A(t,e)}))}function I(e){e.parents.forEach((function(t){return k(t,e)}))}function A(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||I(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ee?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){q.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,V.pi)({dataIdFromObject:ve},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ie(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ie(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,I=e.name,A=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.9",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:I,version:A},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}()},6282:function(e,t,r){"use strict";r.d(t,{u:function(){return c}});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:function(e,t,r){"use strict";r.d(t,{fe:function(){return n.f},h4:function(){return a.h4},HttpLink:function(){return u.uG}});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(1466);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:function(e,t,r){"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:function(){return n},O:function(){return i}}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},2191:function(){},1498:function(e,t,r){"use strict";r.d(t,{M:function(){return a},c:function(){return o}});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},4957:function(e,t,r){"use strict";r(7222).i.concat},7325:function(e,t,r){"use strict";r(7222).i.empty},2550:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n=r(7222).i.execute},4674:function(e,t,r){"use strict";r(7222).i.from},1707:function(e,t,r){"use strict";r.d(t,{ht:function(){return n.h},i0:function(){return i.i}});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:function(e,t,r){"use strict";r(7222).i.split},9875:function(){},9950:function(e,t,r){"use strict";r.d(t,{uG:function(){return T}});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:function(e,t,r){"use strict";r.d(t,{zi:function(){return c},Qc:function(){return i},PW:function(){return o},DQ:function(){return l},Ak:function(){return s}});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),I=r(6589);function A(e,t){if(!Boolean(e))throw new Error(t)}var k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||A(0,"Body must be a string. Received: ".concat((0,I.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||A(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||A(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,J=!1;function Y(e){return e.replace(/[\s,]+/g," ").trim()}function Z(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Y((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Y(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:J});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(Z(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return v(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new i.ej(53);e[t.value]=null}}function g(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n1)for(var n=new J,i=1;i0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:function(e,t,r){"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:function(e,t,r){e.exports=r(2240).default,e.exports.default=e.exports},8764:function(e,t,r){"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null; +window.decidimBulletinBoard=function(){var e={735:function(e,t,r){"use strict";r.r(t),r.d(t,{Client:function(){return y},Election:function(){return b},IdentificationKeys:function(){return ee},KeyCeremonyComponent:function(){return te},MESSAGE_PROCESSED:function(){return Q},MESSAGE_RECEIVED:function(){return G},MessageIdentifier:function(){return m},TallyComponent:function(){return re},Trustee:function(){return X},VoteComponent:function(){return ne},Voter:function(){return $}});var n=r(1439),i=r(9312),a=r.n(i),o=r(9953),s=r.n(o),u=r(3718),c=r.n(u),l=r(6890),f=r.n(l),h=r(5313),p=r.n(h);class d{constructor({apiEndpointUrl:e,headers:t}){const r=new n.HttpLink({uri:e,headers:t});this.apolloClient=new n.fe({link:r,cache:new n.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:f(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:a(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:s(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:p(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:c(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class y{constructor(e){this.apiClient=new d(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const v="t",g=["a","b","v",v];class m{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!g.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class b{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=m.parse(r.messageId);if(n.author.type===v&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var E=r(655);function S(e){return"function"==typeof e}var C=!1,w={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;C=e},get useDeprecatedSynchronousErrorHandling(){return C}};function T(e){setTimeout((function(){throw e}),0)}var A={closed:!0,next:function(e){},error:function(e){if(w.useDeprecatedSynchronousErrorHandling)throw e;T(e)},complete:function(){}},I=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var k=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),_=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u{n.b[t.name]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.name]=t})));return await Promise.all(i),n}loadKey(e){return Y.JWK.asKey(e.public_key,"json")}}class X{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new J({authorityPublicKeyJSON:r}),this.events=new W,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}setup(){return this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e,t.messageId),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:m.format(this.election.uniqueId,e,v,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class ${constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new J({authorityPublicKeyJSON:t})}setup(){return this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e){const t=await this.wrapperAdapter.encrypt(e);return{ballot:t,ballotHash:await this.generateBallotHash(t)}}async generateBallotHash(e){const t=e.encryptedBallot;return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ee{constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Z(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s,onBackupNeeded:u,onBindBackupButton:c,onBackupStarted:l}){this.trustee.events.subscribe(t),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runKeyCeremony(),a())},r.readAsText(t)})),n((async e=>{if(e.preventDefault(),o(),await this.trustee.needsToBeRestored())s();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();u(),c(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{l(),await e.next(),await this.trustee.runKeyCeremony(),a()}))}})),await this.trustee.setup(),e()}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s}){this.trustee.events.subscribe(t),n((async e=>{e.preventDefault(),o(),await this.trustee.needsToBeRestored()?s():(await this.trustee.runTally(),a())})),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runTally(),a())},r.readAsText(t)})),await this.trustee.setup(),e()}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new y(e);const a=new b({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new $({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onSetup:e,onBindEncryptButton:t,onStart:r,onVoteEncryption:n,castOrAuditBallot:i,onBindAuditBallotButton:a,onBindCastBallotButton:o,onAuditBallot:s,onCastBallot:u,onAuditComplete:c,onCastComplete:l,onInvalid:f}){t((()=>{r(),n((e=>{this.voter.encrypt(e).then((e=>(i(e),e))).then((e=>{a((()=>{const t={plainVote:e.ballot.auditableBallot,ballotHash:e.ballotHash,encryptedBallot:e};s(t,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),c()})),o((()=>{u(e.ballot.encryptedBallot),l()}))}))}),(()=>{f()}))})),await this.voter.setup(),e()}}},2634:function(e,t,r){"use strict";r.d(t,{h4:function(){return Be},ab:function(){return ce}});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ee?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){q.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,V.pi)({dataIdFromObject:ve},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.9",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}()},6282:function(e,t,r){"use strict";r.d(t,{u:function(){return c}});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:function(e,t,r){"use strict";r.d(t,{fe:function(){return n.f},h4:function(){return a.h4},HttpLink:function(){return u.uG}});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(1466);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:function(e,t,r){"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:function(){return n},O:function(){return i}}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},2191:function(){},1498:function(e,t,r){"use strict";r.d(t,{M:function(){return a},c:function(){return o}});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},4957:function(e,t,r){"use strict";r(7222).i.concat},7325:function(e,t,r){"use strict";r(7222).i.empty},2550:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n=r(7222).i.execute},4674:function(e,t,r){"use strict";r(7222).i.from},1707:function(e,t,r){"use strict";r.d(t,{ht:function(){return n.h},i0:function(){return i.i}});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:function(e,t,r){"use strict";r(7222).i.split},9875:function(){},9950:function(e,t,r){"use strict";r.d(t,{uG:function(){return T}});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:function(e,t,r){"use strict";r.d(t,{zi:function(){return c},Qc:function(){return i},PW:function(){return o},DQ:function(){return l},Ak:function(){return s}});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}var k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return v(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new i.ej(53);e[t.value]=null}}function g(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n1)for(var n=new Y,i=1;i0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:function(e,t,r){"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:function(e,t,r){e.exports=r(2240).default,e.exports.default=e.exports},8764:function(e,t,r){"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */t.lW=u,t.h2=50;var o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),n=s(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||M(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=s(t),n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nn.length?u.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),l=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function j(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function M(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},2702:function(e,t,r){ + */t.lW=u,t.h2=50;var o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),n=s(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||M(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=s(t),n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nn.length?u.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),l=e.slice(t,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function j(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function M(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},2702:function(e,t,r){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) @@ -12,9 +12,9 @@ window.decidimBulletinBoard=function(){var e={6665:function(e,t,r){"use strict"; * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ -e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},6890:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5313:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9953:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},3718:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:function(e,t){"use strict";var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.Z=r},1807:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:function(e,t,r){"use strict";r.d(t,{Ye:function(){return a},WU:function(){return o},UG:function(){return s}});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:function(e,t,r){"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;oa&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:function(){return n},LZ:function(){return a}})},285:function(e,t,r){"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},6890:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5313:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9953:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},3718:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:function(e,t){"use strict";var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.Z=r},1807:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:function(e,t,r){"use strict";r.d(t,{Ye:function(){return a},WU:function(){return o},UG:function(){return s}});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:function(e,t,r){"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;oa&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:function(){return n},LZ:function(){return a}})},285:function(e,t,r){"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C */ -t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:function(e,t,r){var n=r(852)(r(5639),"DataView");e.exports=n},1989:function(e,t,r){var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1}},1196:function(e){e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n=t?e:t)),e}},5990:function(e,t,r){var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),I="[object Arguments]",A="[object Function]",k="[object Object]",_={};_[I]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[A]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==A||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==I||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:function(e,t,r){var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:function(e,t,r){var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:function(e,t,r){var n=r(5063)();e.exports=n},7786:function(e,t,r){var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++mi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n1&&_.reverse(),E&&m1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:function(e,t,r){var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e-1}},4705:function(e,t,r){var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:function(e,t,r){var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:function(e,t,r){var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:function(e,t,r){var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:function(e,t,r){var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:function(e,t,r){var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:function(e,t,r){var n=r(577),i=n&&new n;e.exports=i},4536:function(e,t,r){var n=r(852)(Object,"create");e.exports=n},6916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:function(e,t,r){e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},5357:function(e,t,r){var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:function(e,t,r){var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,r){var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:function(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,r){var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8630:function(e,t,r){var n=r(4239),i=r(5924),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:function(e,t,r){var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:function(e,t,r){var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:function(e,t,r){var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:function(e,t,r){var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:function(e,t,r){var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:function(e,t,r){var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:function(e,t,r){var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:function(e){e.exports=function(){}},7557:function(e,t,r){var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:function(e,t,r){var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:function(e,t,r){var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},8601:function(e,t,r){var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:function(e,t,r){var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:function(e,t,r){var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:function(e,t,r){var n=r(3218),i=r(3448),a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:function(e,t,r){var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:function(e,t,r){var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:function(e,t,r){var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:function(e,t,r){var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:function(e,t,r){var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i>>=2;for(i=0;i>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:function(e,t,r){var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;ut){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u0&&(a+="\n");for(var o="",u=0;u1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:function(e){var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f4){var r=e;e=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],I=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(I>>>16^T),g[b++]=T^t,g[b++]=I^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[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],o=[-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],s=[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],u=[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],c=[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],l=[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],f=[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],h=[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];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:function(e){e.exports={options:{usePureJavaScript:!1}}},6607:function(e,t,r){var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;ut.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function I(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-o):this.data[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<>n;for(var o=r+1;o>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(i=!0,a=f(r));o>=0;)s>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},I.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/A[A.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=A[A.length-1]){for(t=0;t=0;u--)B>>=8,B+=I.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=gl)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var I,A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(A).getBytes());var O=N.getMac();I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(A).getBytes())])]),I])},o.generateKey=n.pbe.generatePkcs12Key},9437:function(e,t,r){var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a=r&&o0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;fe&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:function(e,t,r){var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:function(e,t,r){var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(3906):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c0;){var l=0,f=n.random.getBytes(u);for(c=0;c1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||lf?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],I=e[5][1],A=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(A^C&(T^A))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(I^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=A,B=k,A=T,k=I,T=C,I=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+I,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+A+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:function(e,t,r){var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h=E&&e0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nl.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&vm.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:function(e,t,r){"use strict"; +t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:function(e,t,r){var n=r(852)(r(5639),"DataView");e.exports=n},1989:function(e,t,r){var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1}},1196:function(e){e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n=t?e:t)),e}},5990:function(e,t,r){var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),A="[object Arguments]",I="[object Function]",k="[object Object]",_={};_[A]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[I]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==I||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==A||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:function(e,t,r){var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:function(e,t,r){var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:function(e,t,r){var n=r(5063)();e.exports=n},7786:function(e,t,r){var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++mi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n1&&_.reverse(),E&&m1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:function(e,t,r){var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e-1}},4705:function(e,t,r){var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:function(e,t,r){var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:function(e,t,r){var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:function(e,t,r){var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:function(e,t,r){var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:function(e,t,r){var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:function(e,t,r){var n=r(577),i=n&&new n;e.exports=i},4536:function(e,t,r){var n=r(852)(Object,"create");e.exports=n},6916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:function(e,t,r){e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},5357:function(e,t,r){var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:function(e,t,r){var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,r){var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:function(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,r){var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8630:function(e,t,r){var n=r(4239),i=r(5924),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:function(e,t,r){var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:function(e,t,r){var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:function(e,t,r){var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:function(e,t,r){var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:function(e,t,r){var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:function(e,t,r){var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:function(e,t,r){var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:function(e){e.exports=function(){}},7557:function(e,t,r){var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:function(e,t,r){var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:function(e,t,r){var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},8601:function(e,t,r){var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:function(e,t,r){var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:function(e,t,r){var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:function(e,t,r){var n=r(3218),i=r(3448),a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:function(e,t,r){var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:function(e,t,r){var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:function(e,t,r){var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:function(e,t,r){var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:function(e,t,r){var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i>>=2;for(i=0;i>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:function(e,t,r){var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;ut){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u0&&(a+="\n");for(var o="",u=0;u1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:function(e){var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f4){var r=e;e=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(A>>>16^T),g[b++]=T^t,g[b++]=A^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[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],o=[-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],s=[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],u=[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],c=[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],l=[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],f=[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],h=[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];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:function(e){e.exports={options:{usePureJavaScript:!1}}},6607:function(e,t,r){var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;ut.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function A(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-o):this.data[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<>n;for(var o=r+1;o>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(i=!0,a=f(r));o>=0;)s>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t=0;u--)B>>=8,B+=A.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=gl)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(I).getBytes());var O=N.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},9437:function(e,t,r){var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a=r&&o0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;fe&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:function(e,t,r){var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:function(e,t,r){var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(3906):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c0;){var l=0,f=n.random.getBytes(u);for(c=0;c1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||lf?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(I^C&(T^I))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(A^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=I,B=k,I=T,k=A,T=C,A=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+A,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+I+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:function(e,t,r){var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h=E&&e0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nl.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&vm.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:function(e,t,r){"use strict"; /*! * algorithms/aes-cbc-hmac-sha2.js - AES-CBC-HMAC-SHA2 Composited Encryption * @@ -275,7 +275,7 @@ t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h= * util/utf8.js - Implementation of UTF-8 Encoder/Decoder * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. - */var r=t;r.encode=function(e){var t=encodeURIComponent(e||"");return t=t.replace(/%([0-9a-fA-F]{2})/g,(function(e,t){return t=parseInt(t,16),String.fromCharCode(t)}))},r.decode=function(e){var t=(e||"").replace(/[\u0080-\u00ff]/g,(function(e){return"%"+(256|e.charCodeAt(0)).toString(16).substring(1)}));return t=decodeURIComponent(t)}},9591:function(e,t,r){"use strict";var n={};(0,r(4236).assign)(n,r(4555),r(8843),r(1619)),e.exports=n},4555:function(e,t,r){"use strict";var n=r(405),i=r(4236),a=r(9373),o=r(8898),s=r(2292),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},8843:function(e,t,r){"use strict";var n=r(7948),i=r(4236),a=r(9373),o=r(1619),s=r(8898),u=r(2292),c=r(2401),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(h.output,h.next_out),c=h.next_out-u,f=a.buf2string(h.output,u),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},4236:function(e,t){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)c[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6069:function(e){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},1619:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:function(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^r[s])];return-1^e}},405:function(e,t,r){"use strict";var n,i=r(4236),a=r(342),o=r(6069),s=r(2869),u=r(8898),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function v(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.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 b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function E(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function C(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[a+o-1],v=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===v&&c[r+o-1]===y&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;y=c[a+o-1],v=c[a+o]}}}while((t=p[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,a,u,c,l,h,p,d,y=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=y+(y-f)){i.arraySet(e.window,e.window,y,y,0),e.match_start-=y,e.strstart-=y,e.block_start-=y,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=y?n-y:0}while(--r);t=r=y;do{n=e.prev[--t],e.prev[t]=n>=y?n-y:0}while(--r);a+=y}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=a,d=void 0,(d=c.avail_in)>p&&(d=p),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,l,d,h):2===c.state.wrap&&(c.adler=s(c.adler,l,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return y(e,c);8===n&&(n=9);var u=new k;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;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,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new A(4,4,8,4,T),new A(4,5,16,8,T),new A(4,6,32,32,T),new A(4,4,16,16,I),new A(8,16,32,32,I),new A(8,16,128,128,I),new A(8,32,128,256,I),new A(32,128,258,1024,I),new A(32,258,258,4096,I)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=B,t.deflateResetKeep=_,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,E(i,31),E(i,139),E(i,8),i.gzhead?(E(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),E(i,255&i.gzhead.time),E(i,i.gzhead.time>>8&255),E(i,i.gzhead.time>>16&255),E(i,i.gzhead.time>>24&255),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(E(i,255&i.gzhead.extra.length),E(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(E(i,0),E(i,0),E(i,0),E(i,0),E(i,0),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,S(i,f),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending!==i.pending_buf_size));)E(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(E(i,255&e.adler),E(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var C=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==C&&4!==C||(i.status=d),1===C||3===C)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===C&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(E(i,255&e.adler),E(i,e.adler>>8&255),E(i,e.adler>>16&255),E(i,e.adler>>24&255),E(i,255&e.total_in),E(i,e.total_in>>8&255),E(i,e.total_in>>16&255),E(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=E=b>>>24,d-=E,0===(E=b>>>16&255))A[a++]=65535&b;else{if(!(16&E)){if(0==(64&E)){b=y[(65535&b)+(p&(1<>>=E,d-=E),d<15&&(p+=I[n++]<>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(0==(64&E)){b=v[(65535&b)+(p&(1<u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,C>(E=a-o)){if((E=C-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,T=h,0===f){if(w+=c-E,E2;)A[a++]=T[w++],A[a++]=T[w++],A[a++]=T[w++],S-=3;S&&(A[a++]=T[w++],S>1&&(A[a++]=T[w++]))}else{w=a-C;do{A[a++]=A[w++],A[a++]=A[w++],A[a++]=A[w++],S-=3}while(S>2);S&&(A[a++]=A[w++],S>1&&(A[a++]=A[w++]))}break}}break}}while(n>3,p&=(1<<(d-=S<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(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=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var g,m,b=!0;function E(e){if(b){var t;for(g=new n.Buf32(512),m=new n.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(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function S(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=a(r.check,U,2,0),m=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=l;break}if(b-=4,x=8+(15&(m>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>v&&(T=v),T&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,T,x)),512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&T>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,m+=h[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){m>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,m+=h[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&m,m=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>v&&(T=v),T>g&&(T=g),0===T)break e;n.arraySet(p,h,d,T,y),v-=T,d+=T,g-=T,y+=T,r.length-=T;break}r.mode=c;break;case 17:for(;b<14;){if(0===v)break e;v--,m+=h[d++]<>>=5,b-=5,r.ndist=1+(31&m),m>>>=5,b-=5,r.ncode=4+(15&m),m>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},P=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=k,b-=k,r.lens[r.have++]=B;else{if(16===B){for(D=k+2;b>>=k,b-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}x=r.lens[r.have-1],T=3+(3&m),m>>>=2,b-=2}else if(17===B){for(D=k+3;b>>=k)),m>>>=3,b-=3}else{for(D=k+7;b>>=k)),m>>>=7,b-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;T--;)r.lens[r.have++]=x}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,F={bits:r.lenbits},P=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},P=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,P){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,o(e,w),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;_=(L=r.lencode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,r.length=B,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=c;break}if(64&_){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(L=r.distcode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,64&_){e.msg="invalid distance code",r.mode=l;break}r.offset=B,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===g)break e;if(T=w-g,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}T>r.wnext?(T-=r.wnext,I=r.wsize-T):I=r.wnext-T,T>r.length&&(T=r.length),A=r.window}else A=p,I=y-r.offset,T=r.length;T>g&&(T=g),g-=T,r.length-=T;do{p[y++]=A[I++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[y++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,m|=h[d++]<=1&&0===D[k];k--);if(_>k&&(_=k),0===k)return l[f++]=20971520,l[f++]=20971520,p.bits=1,0;for(A=1;A0&&(0===e||1!==k))return-1;for(L[1]=0,T=1;T852||2===e&&R>592)return 1;for(;;){E=T-N,h[I]b?(S=U[j+h[I]],C=P[F+h[I]]):(S=96,C=0),d=1<>N)+(y-=d)]=E<<24|S<<16|C|0}while(0!==y);for(d=1<>=1;if(0!==d?(x&=d-1,x+=d):x=0,I++,0==--D[T]){if(T===k)break;T=t[r+h[I]]}if(T>_&&(x&g)!==v){for(0===N&&(N=_),m+=A,O=1<<(B=T-N);B+N852||2===e&&R>592)return 1;l[v=x&g]=_<<24|B<<16|m-f|0}}return 0!==x&&(l[m+x]=T-N<<24|64<<16|0),p.bits=_,0}},8898:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:function(e,t,r){"use strict";var n=r(4236);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var y=new Array(512);i(y);var v=new Array(256);i(v);var g=new Array(29);i(g);var m,b,E,S=new Array(s);function C(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function w(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?y[e]:y[256+(e>>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function A(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=u;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=_(a[s]++,s))}}function N(e){var t;for(t=0;t8?I(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)x(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],x(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,x(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,v=0;for(a=0;a<=u;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(a=y,v++),c[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=c[2*n],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==v){do{for(a=y-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[y]--,v-=2}while(v>0);for(a=y;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}(e,t),B(a,l,e.bl_count)}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(A(e,2+(n?1:0),3),P(e,p,d)):(A(e,4+(n?1:0),3),function(e,t,r,n){var i;for(A(e,t-257,5),A(e,r-1,5),A(e,n-4,4),i=0;i>>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*(v[r]+a+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){A(e,2,3),k(e,256,p),function(e){16===e.bi_valid?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2292:function(e){"use strict";e.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}},4155:function(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r=f)return console[e].apply(console,arguments)}}function p(e){var t=l[f];return f=Math.max(0,l.indexOf(e)),t}!function(e){e.log=h("log"),e.warn=h("warn"),e.error=h("error")}(c||(c={}));var d=i.process||{env:{}};if(!i.process)try{Object.defineProperty(i,"process",{value:d})}catch(e){}},655:function(e,t,r){"use strict";r.d(t,{ZT:function(){return i},pi:function(){return a},_T:function(){return o},mG:function(){return s},Jh:function(){return u},pr:function(){return c}}); + */var r=t;r.encode=function(e){var t=encodeURIComponent(e||"");return t=t.replace(/%([0-9a-fA-F]{2})/g,(function(e,t){return t=parseInt(t,16),String.fromCharCode(t)}))},r.decode=function(e){var t=(e||"").replace(/[\u0080-\u00ff]/g,(function(e){return"%"+(256|e.charCodeAt(0)).toString(16).substring(1)}));return t=decodeURIComponent(t)}},9591:function(e,t,r){"use strict";var n={};(0,r(4236).assign)(n,r(4555),r(8843),r(1619)),e.exports=n},4555:function(e,t,r){"use strict";var n=r(405),i=r(4236),a=r(9373),o=r(8898),s=r(2292),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},8843:function(e,t,r){"use strict";var n=r(7948),i=r(4236),a=r(9373),o=r(1619),s=r(8898),u=r(2292),c=r(2401),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(h.output,h.next_out),c=h.next_out-u,f=a.buf2string(h.output,u),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},4236:function(e,t){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)c[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6069:function(e){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},1619:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:function(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^r[s])];return-1^e}},405:function(e,t,r){"use strict";var n,i=r(4236),a=r(342),o=r(6069),s=r(2869),u=r(8898),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function v(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.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 b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function E(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function C(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[a+o-1],v=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===v&&c[r+o-1]===y&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&ao){if(e.match_start=t,o=n,n>=s)break;y=c[a+o-1],v=c[a+o]}}}while((t=p[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,a,u,c,l,h,p,d,y=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=y+(y-f)){i.arraySet(e.window,e.window,y,y,0),e.match_start-=y,e.strstart-=y,e.block_start-=y,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=y?n-y:0}while(--r);t=r=y;do{n=e.prev[--t],e.prev[t]=n>=y?n-y:0}while(--r);a+=y}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=a,d=void 0,(d=c.avail_in)>p&&(d=p),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,l,d,h):2===c.state.wrap&&(c.adler=s(c.adler,l,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return y(e,c);8===n&&(n=9);var u=new k;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;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,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new I(4,4,8,4,T),new I(4,5,16,8,T),new I(4,6,32,32,T),new I(4,4,16,16,A),new I(8,16,32,32,A),new I(8,16,128,128,A),new I(8,32,128,256,A),new I(32,128,258,1024,A),new I(32,258,258,4096,A)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=B,t.deflateResetKeep=_,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,E(i,31),E(i,139),E(i,8),i.gzhead?(E(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),E(i,255&i.gzhead.time),E(i,i.gzhead.time>>8&255),E(i,i.gzhead.time>>16&255),E(i,i.gzhead.time>>24&255),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(E(i,255&i.gzhead.extra.length),E(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(E(i,0),E(i,0),E(i,0),E(i,0),E(i,0),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,S(i,f),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending!==i.pending_buf_size));)E(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(E(i,255&e.adler),E(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var C=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==C&&4!==C||(i.status=d),1===C||3===C)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===C&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(E(i,255&e.adler),E(i,e.adler>>8&255),E(i,e.adler>>16&255),E(i,e.adler>>24&255),E(i,255&e.total_in),E(i,e.total_in>>8&255),E(i,e.total_in>>16&255),E(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=E=b>>>24,d-=E,0===(E=b>>>16&255))I[a++]=65535&b;else{if(!(16&E)){if(0==(64&E)){b=y[(65535&b)+(p&(1<>>=E,d-=E),d<15&&(p+=A[n++]<>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(0==(64&E)){b=v[(65535&b)+(p&(1<u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,C>(E=a-o)){if((E=C-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,T=h,0===f){if(w+=c-E,E2;)I[a++]=T[w++],I[a++]=T[w++],I[a++]=T[w++],S-=3;S&&(I[a++]=T[w++],S>1&&(I[a++]=T[w++]))}else{w=a-C;do{I[a++]=I[w++],I[a++]=I[w++],I[a++]=I[w++],S-=3}while(S>2);S&&(I[a++]=I[w++],S>1&&(I[a++]=I[w++]))}break}}break}}while(n>3,p&=(1<<(d-=S<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(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=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var g,m,b=!0;function E(e){if(b){var t;for(g=new n.Buf32(512),m=new n.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(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function S(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=a(r.check,U,2,0),m=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=l;break}if(b-=4,x=8+(15&(m>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>v&&(T=v),T&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,T,x)),512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&T>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,m+=h[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){m>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,m+=h[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&m,m=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>v&&(T=v),T>g&&(T=g),0===T)break e;n.arraySet(p,h,d,T,y),v-=T,d+=T,g-=T,y+=T,r.length-=T;break}r.mode=c;break;case 17:for(;b<14;){if(0===v)break e;v--,m+=h[d++]<>>=5,b-=5,r.ndist=1+(31&m),m>>>=5,b-=5,r.ncode=4+(15&m),m>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},P=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=k,b-=k,r.lens[r.have++]=B;else{if(16===B){for(D=k+2;b>>=k,b-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}x=r.lens[r.have-1],T=3+(3&m),m>>>=2,b-=2}else if(17===B){for(D=k+3;b>>=k)),m>>>=3,b-=3}else{for(D=k+7;b>>=k)),m>>>=7,b-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;T--;)r.lens[r.have++]=x}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,F={bits:r.lenbits},P=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},P=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,P){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,o(e,w),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;_=(L=r.lencode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,r.length=B,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=c;break}if(64&_){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(L=r.distcode[m&(1<>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,64&_){e.msg="invalid distance code",r.mode=l;break}r.offset=B,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(D=r.extra;b>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===g)break e;if(T=w-g,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}T>r.wnext?(T-=r.wnext,A=r.wsize-T):A=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=p,A=y-r.offset,T=r.length;T>g&&(T=g),g-=T,r.length-=T;do{p[y++]=I[A++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[y++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,m|=h[d++]<=1&&0===D[k];k--);if(_>k&&(_=k),0===k)return l[f++]=20971520,l[f++]=20971520,p.bits=1,0;for(I=1;I0&&(0===e||1!==k))return-1;for(L[1]=0,T=1;T852||2===e&&R>592)return 1;for(;;){E=T-N,h[A]b?(S=U[j+h[A]],C=P[F+h[A]]):(S=96,C=0),d=1<>N)+(y-=d)]=E<<24|S<<16|C|0}while(0!==y);for(d=1<>=1;if(0!==d?(x&=d-1,x+=d):x=0,A++,0==--D[T]){if(T===k)break;T=t[r+h[A]]}if(T>_&&(x&g)!==v){for(0===N&&(N=_),m+=I,O=1<<(B=T-N);B+N852||2===e&&R>592)return 1;l[v=x&g]=_<<24|B<<16|m-f|0}}return 0!==x&&(l[m+x]=T-N<<24|64<<16|0),p.bits=_,0}},8898:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:function(e,t,r){"use strict";var n=r(4236);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var y=new Array(512);i(y);var v=new Array(256);i(v);var g=new Array(29);i(g);var m,b,E,S=new Array(s);function C(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function w(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?y[e]:y[256+(e>>>7)]}function A(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=u;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=_(a[s]++,s))}}function N(e){var t;for(t=0;t8?A(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,a=2*r;return e[i]>1;r>=1;r--)x(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],x(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,x(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,v=0;for(a=0;a<=u;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(a=y,v++),c[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=c[2*n],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==v){do{for(a=y-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[y]--,v-=2}while(v>0);for(a=y;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}(e,t),B(a,l,e.bl_count)}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s>=7;n0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(I(e,2+(n?1:0),3),P(e,p,d)):(I(e,4+(n?1:0),3),function(e,t,r,n){var i;for(I(e,t-257,5),I(e,r-1,5),I(e,n-4,4),i=0;i>>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*(v[r]+a+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){I(e,2,3),k(e,256,p),function(e){16===e.bi_valid?(A(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2292:function(e){"use strict";e.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}},4155:function(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r=f)return console[e].apply(console,arguments)}}function p(e){var t=l[f];return f=Math.max(0,l.indexOf(e)),t}!function(e){e.log=h("log"),e.warn=h("warn"),e.error=h("error")}(c||(c={}));var d=i.process||{env:{}};if(!i.process)try{Object.defineProperty(i,"process",{value:d})}catch(e){}},655:function(e,t,r){"use strict";r.d(t,{ZT:function(){return i},pi:function(){return a},_T:function(){return o},mG:function(){return s},Jh:function(){return u},pr:function(){return c}}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -290,4 +290,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n=function(e,t){return(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])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]>>((3&t)<<3)&255;return n}}},3570:function(e,t,r){var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:function(e,t,r){var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:function(e,t,r){e.exports=r(516).Observable},516:function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]>>((3&t)<<3)&255;return n}}},3570:function(e,t,r){var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:function(e,t,r){var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:function(e,t,r){e.exports=r(516).Observable},516:function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r