From 7bdbb047c9aaddbf113994a6802ff4012fca897c Mon Sep 17 00:00:00 2001 From: Dwynr Date: Tue, 27 Feb 2024 05:00:15 +0100 Subject: [PATCH] 0.1.7 --- dist/bundle.browser.js | 2 +- dist/bundle.browser.js.map | 2 +- dist/bundle.node.js | 2 +- dist/bundle.node.js.map | 2 +- dist/fs/index.js | 206 ++++++++-------- dist/fs/index.js.map | 2 +- dist/index.js | 4 +- dist/index.js.map | 2 +- dist/types/fs/index.d.ts | 5 - docs/assets/search.js | 2 +- docs/classes/FilenSDK.html | 36 +-- docs/classes/_internal_.API.html | 4 +- docs/classes/_internal_.APIClient.html | 20 +- docs/classes/_internal_.AuthInfo.html | 6 +- .../classes/_internal_.ChatConversations.html | 6 +- .../_internal_.ChatConversationsCreate.html | 6 +- .../_internal_.ChatConversationsDelete.html | 6 +- .../_internal_.ChatConversationsLeave.html | 6 +- .../_internal_.ChatConversationsNameEdit.html | 6 +- .../_internal_.ChatConversationsOnline.html | 6 +- ...nal_.ChatConversationsParticipantsAdd.html | 6 +- ..._.ChatConversationsParticipantsRemove.html | 6 +- .../_internal_.ChatConversationsRead.html | 6 +- .../_internal_.ChatConversationsUnread.html | 6 +- docs/classes/_internal_.ChatDelete.html | 6 +- docs/classes/_internal_.ChatEdit.html | 6 +- docs/classes/_internal_.ChatLastFocus.html | 6 +- .../_internal_.ChatLastFocusUpdate.html | 6 +- .../_internal_.ChatMessageEmbedDisable.html | 6 +- docs/classes/_internal_.ChatMessages.html | 6 +- docs/classes/_internal_.ChatSend.html | 6 +- docs/classes/_internal_.ChatTyping.html | 6 +- docs/classes/_internal_.ChatUnread.html | 6 +- docs/classes/_internal_.Chats.html | 48 ++-- docs/classes/_internal_.Cloud.html | 98 ++++---- docs/classes/_internal_.Contacts-1.html | 6 +- docs/classes/_internal_.Contacts.html | 28 +-- docs/classes/_internal_.ContactsBlocked.html | 6 +- .../_internal_.ContactsBlockedAdd.html | 6 +- .../_internal_.ContactsBlockedDelete.html | 6 +- docs/classes/_internal_.ContactsDelete.html | 6 +- .../_internal_.ContactsRequestsAccept.html | 6 +- .../_internal_.ContactsRequestsDeny.html | 6 +- .../_internal_.ContactsRequestsIn.html | 6 +- .../_internal_.ContactsRequestsInCount.html | 6 +- .../_internal_.ContactsRequestsOut.html | 6 +- .../_internal_.ContactsRequestsOutDelete.html | 6 +- .../_internal_.ContactsRequestsSend.html | 6 +- docs/classes/_internal_.Crypto.html | 10 +- docs/classes/_internal_.Decrypt.html | 44 ++-- docs/classes/_internal_.DirColor.html | 6 +- docs/classes/_internal_.DirContent.html | 6 +- docs/classes/_internal_.DirCreate.html | 6 +- .../_internal_.DirDeletePermanent.html | 6 +- docs/classes/_internal_.DirDownload.html | 6 +- docs/classes/_internal_.DirExists.html | 6 +- docs/classes/_internal_.DirLinkAdd.html | 6 +- docs/classes/_internal_.DirLinkContent.html | 6 +- docs/classes/_internal_.DirLinkEdit.html | 6 +- docs/classes/_internal_.DirLinkInfo.html | 6 +- docs/classes/_internal_.DirLinkRemove.html | 6 +- docs/classes/_internal_.DirLinkStatus.html | 6 +- docs/classes/_internal_.DirLinked.html | 6 +- docs/classes/_internal_.DirMove.html | 6 +- docs/classes/_internal_.DirPresent.html | 6 +- docs/classes/_internal_.DirRename.html | 6 +- docs/classes/_internal_.DirRestore.html | 6 +- docs/classes/_internal_.DirShared.html | 6 +- docs/classes/_internal_.DirSize.html | 6 +- docs/classes/_internal_.DirSizeLink.html | 6 +- docs/classes/_internal_.DirTrash.html | 6 +- docs/classes/_internal_.Encrypt.html | 24 +- docs/classes/_internal_.FS.html | 45 ++-- .../_internal_.FileDeletePermanent.html | 6 +- .../_internal_.FileDownloadChunkBuffer.html | 6 +- .../_internal_.FileDownloadChunkLocal.html | 6 +- .../_internal_.FileDownloadChunkStream.html | 6 +- docs/classes/_internal_.FileExists.html | 6 +- docs/classes/_internal_.FileLinkEdit.html | 6 +- docs/classes/_internal_.FileLinkInfo.html | 6 +- docs/classes/_internal_.FileLinkPassword.html | 6 +- docs/classes/_internal_.FileLinkStatus.html | 6 +- docs/classes/_internal_.FileMove.html | 6 +- docs/classes/_internal_.FileRename.html | 6 +- docs/classes/_internal_.FileRestore.html | 6 +- docs/classes/_internal_.FileTrash.html | 6 +- .../_internal_.FileUploadChunkBuffer.html | 6 +- .../_internal_.FileVersionRestore.html | 6 +- docs/classes/_internal_.FileVersions.html | 6 +- docs/classes/_internal_.Health.html | 6 +- docs/classes/_internal_.ItemFavorite.html | 6 +- docs/classes/_internal_.ItemLinked.html | 6 +- docs/classes/_internal_.ItemLinkedRename.html | 6 +- docs/classes/_internal_.ItemShare.html | 6 +- docs/classes/_internal_.ItemShared.html | 6 +- .../_internal_.ItemSharedInRemove.html | 6 +- .../_internal_.ItemSharedOutRemove.html | 6 +- docs/classes/_internal_.ItemSharedRename.html | 6 +- docs/classes/_internal_.Login.html | 6 +- docs/classes/_internal_.NoteTitleEdit.html | 6 +- docs/classes/_internal_.Notes-1.html | 6 +- docs/classes/_internal_.Notes.html | 72 +++--- docs/classes/_internal_.NotesArchive.html | 6 +- docs/classes/_internal_.NotesContent.html | 6 +- docs/classes/_internal_.NotesContentEdit.html | 6 +- docs/classes/_internal_.NotesCreate.html | 6 +- docs/classes/_internal_.NotesDelete.html | 6 +- docs/classes/_internal_.NotesFavorite.html | 6 +- docs/classes/_internal_.NotesHistory.html | 6 +- .../_internal_.NotesHistoryRestore.html | 6 +- .../_internal_.NotesParticipantsAdd.html | 6 +- ...nternal_.NotesParticipantsPermissions.html | 6 +- .../_internal_.NotesParticipantsRemove.html | 6 +- docs/classes/_internal_.NotesPinned.html | 6 +- docs/classes/_internal_.NotesRestore.html | 6 +- docs/classes/_internal_.NotesTag.html | 6 +- docs/classes/_internal_.NotesTags.html | 6 +- docs/classes/_internal_.NotesTagsCreate.html | 6 +- docs/classes/_internal_.NotesTagsDelete.html | 6 +- .../classes/_internal_.NotesTagsFavorite.html | 6 +- docs/classes/_internal_.NotesTagsRename.html | 6 +- docs/classes/_internal_.NotesTrash.html | 6 +- docs/classes/_internal_.NotesTypeChange.html | 6 +- docs/classes/_internal_.NotesUntag.html | 6 +- docs/classes/_internal_.PauseSignal.html | 12 +- docs/classes/_internal_.SharedIn.html | 6 +- docs/classes/_internal_.SharedOut.html | 6 +- docs/classes/_internal_.TrashEmpty.html | 6 +- docs/classes/_internal_.UploadDone.html | 6 +- docs/classes/_internal_.User.html | 58 ++--- docs/classes/_internal_.User2FADisable.html | 6 +- docs/classes/_internal_.User2FAEnable.html | 6 +- docs/classes/_internal_.UserAccount.html | 6 +- .../_internal_.UserAffiliatePayout.html | 6 +- .../classes/_internal_.UserAppearOffline.html | 6 +- docs/classes/_internal_.UserAvatar.html | 6 +- docs/classes/_internal_.UserBaseFolder.html | 6 +- docs/classes/_internal_.UserDelete.html | 6 +- docs/classes/_internal_.UserDeleteAll.html | 6 +- .../_internal_.UserDeleteVersions.html | 6 +- docs/classes/_internal_.UserEvent.html | 6 +- docs/classes/_internal_.UserEvents.html | 6 +- docs/classes/_internal_.UserGDPR.html | 6 +- docs/classes/_internal_.UserInfo.html | 6 +- docs/classes/_internal_.UserInvoice.html | 6 +- docs/classes/_internal_.UserKeyPairInfo.html | 6 +- docs/classes/_internal_.UserKeyPairSet.html | 6 +- .../classes/_internal_.UserKeyPairUpdate.html | 6 +- .../_internal_.UserLastActiveDesktop.html | 6 +- docs/classes/_internal_.UserLoginAlerts.html | 6 +- docs/classes/_internal_.UserMasterKeys.html | 6 +- docs/classes/_internal_.UserNickname.html | 6 +- .../_internal_.UserPersonalUpdate.html | 6 +- docs/classes/_internal_.UserProfile.html | 6 +- docs/classes/_internal_.UserPublicKey.html | 6 +- docs/classes/_internal_.UserSettings.html | 6 +- .../_internal_.UserSettingsEmailChange.html | 6 +- ..._internal_.UserSettingsPasswordChange.html | 6 +- docs/classes/_internal_.UserSubCancel.html | 6 +- docs/classes/_internal_.UserSubCreate.html | 6 +- docs/classes/_internal_.UserVersioning.html | 6 +- docs/interfaces/_internal_.ISemaphore.html | 4 +- docs/types/FilenSDKConfig.html | 2 +- docs/types/_internal_.APIClientConfig.html | 2 +- docs/types/_internal_.APIConfig.html | 2 +- docs/types/_internal_.AuthInfoResponse.html | 2 +- docs/types/_internal_.AuthVersion.html | 2 +- .../_internal_.BaseRequestParameters.html | 2 +- docs/types/_internal_.BlockedContact.html | 2 +- docs/types/_internal_.ChatConversation.html | 2 +- ...internal_.ChatConversationParticipant.html | 2 +- ...rnal_.ChatConversationsOnlineResponse.html | 2 +- ...internal_.ChatConversationsOnlineUser.html | 2 +- ...rnal_.ChatConversationsUnreadResponse.html | 2 +- .../types/_internal_.ChatLastFocusValues.html | 2 +- docs/types/_internal_.ChatMessage.html | 2 +- docs/types/_internal_.ChatTypingType.html | 2 +- docs/types/_internal_.ChatUnreadResponse.html | 2 +- docs/types/_internal_.ChatsConfig.html | 2 +- docs/types/_internal_.CloudConfig.html | 2 +- docs/types/_internal_.CloudItem.html | 2 +- docs/types/_internal_.CloudItemBase.html | 2 +- .../types/_internal_.CloudItemBaseShared.html | 2 +- docs/types/_internal_.CloudItemDirectory.html | 2 +- docs/types/_internal_.CloudItemFile.html | 2 +- .../types/_internal_.CloudItemFileShared.html | 2 +- docs/types/_internal_.CloudItemShared.html | 2 +- .../types/_internal_.CloudItemSharedBase.html | 2 +- .../_internal_.CloudItemSharedReceiver.html | 2 +- docs/types/_internal_.CloudItemTree.html | 2 +- docs/types/_internal_.Contact.html | 2 +- docs/types/_internal_.ContactRequest.html | 2 +- .../_internal_.ContactsBlockedResponse.html | 2 +- docs/types/_internal_.ContactsConfig.html | 2 +- ..._internal_.ContactsRequestsInResponse.html | 2 +- ...internal_.ContactsRequestsOutResponse.html | 2 +- docs/types/_internal_.ContactsResponse.html | 2 +- docs/types/_internal_.CryptoConfig.html | 2 +- .../_internal_.DeriveKeyFromPasswordBase.html | 2 +- docs/types/_internal_.DirColors.html | 2 +- docs/types/_internal_.DirContentFolder.html | 2 +- docs/types/_internal_.DirContentResponse.html | 2 +- docs/types/_internal_.DirContentUpload.html | 2 +- docs/types/_internal_.DirCreateResponse.html | 2 +- docs/types/_internal_.DirDownloadFile.html | 2 +- docs/types/_internal_.DirDownloadFolder.html | 2 +- .../types/_internal_.DirDownloadResponse.html | 2 +- docs/types/_internal_.DirDownloadType.html | 2 +- docs/types/_internal_.DirExistsResponse.html | 2 +- .../_internal_.DirLinkContentResponse.html | 2 +- .../types/_internal_.DirLinkInfoResponse.html | 2 +- .../_internal_.DirLinkStatusResponse.html | 2 +- docs/types/_internal_.DirLinkedResponse.html | 2 +- docs/types/_internal_.DirPresentResponse.html | 2 +- docs/types/_internal_.DirSharedLink.html | 2 +- docs/types/_internal_.DirSharedResponse.html | 2 +- docs/types/_internal_.DirSharedUser.html | 2 +- .../types/_internal_.DirSizeLinkResponse.html | 2 +- docs/types/_internal_.DirSizeResponse.html | 2 +- docs/types/_internal_.FSConfig.html | 2 +- docs/types/_internal_.FSItem.html | 2 +- docs/types/_internal_.FSItemBase.html | 2 +- docs/types/_internal_.FSItemFileBase.html | 2 +- docs/types/_internal_.FSItemType.html | 2 +- docs/types/_internal_.FSItems.html | 2 +- docs/types/_internal_.FSStats.html | 2 +- docs/types/_internal_.FSStatsBase.html | 2 +- .../_internal_.FileEncryptionVersion.html | 2 +- docs/types/_internal_.FileExistsResponse.html | 2 +- .../_internal_.FileLinkInfoResponse.html | 2 +- .../_internal_.FileLinkPasswordResponse.html | 2 +- .../_internal_.FileLinkStatusResponse.html | 2 +- docs/types/_internal_.FileMetadata.html | 2 +- docs/types/_internal_.FileVersion.html | 2 +- .../_internal_.FileVersionsResponse.html | 2 +- docs/types/_internal_.FolderMetadata.html | 2 +- .../_internal_.GetRequestParameters.html | 2 +- docs/types/_internal_.ItemLinkedLink.html | 2 +- docs/types/_internal_.ItemLinkedResponse.html | 2 +- docs/types/_internal_.ItemSharedResponse.html | 2 +- docs/types/_internal_.ItemSharedUser.html | 2 +- docs/types/_internal_.LoginResponse.html | 2 +- docs/types/_internal_.Note.html | 2 +- docs/types/_internal_.NoteContent.html | 2 +- docs/types/_internal_.NoteHistory.html | 2 +- docs/types/_internal_.NoteParticipant.html | 2 +- docs/types/_internal_.NoteTag.html | 2 +- docs/types/_internal_.NoteType.html | 2 +- docs/types/_internal_.NotesConfig.html | 2 +- .../_internal_.NotesHistoryResponse.html | 2 +- docs/types/_internal_.NotesResponse.html | 2 +- .../_internal_.NotesTagsCreateResponse.html | 2 +- docs/types/_internal_.NotesTagsResponse.html | 2 +- docs/types/_internal_.PaymentMethods.html | 2 +- .../_internal_.PostRequestParameters.html | 2 +- docs/types/_internal_.ProgressCallback.html | 2 +- .../_internal_.PublicLinkExpiration.html | 2 +- docs/types/_internal_.RequestParameters.html | 2 +- docs/types/_internal_.SharedInFolder.html | 2 +- docs/types/_internal_.SharedInResponse.html | 2 +- docs/types/_internal_.SharedInUpload.html | 2 +- docs/types/_internal_.SharedOutFolder.html | 2 +- docs/types/_internal_.SharedOutResponse.html | 2 +- docs/types/_internal_.SharedOutUpload.html | 2 +- docs/types/_internal_.StatFS.html | 2 +- .../types/_internal_.UploadChunkResponse.html | 2 +- docs/types/_internal_.UploadDoneResponse.html | 2 +- .../_internal_.User2FAEnableResponse.html | 2 +- docs/types/_internal_.UserAccountPlan.html | 2 +- .../types/_internal_.UserAccountResponse.html | 2 +- docs/types/_internal_.UserAccountSubs.html | 2 +- .../_internal_.UserAccountSubsInvoices.html | 2 +- .../_internal_.UserBaseFolderResponse.html | 2 +- docs/types/_internal_.UserConfig.html | 2 +- docs/types/_internal_.UserEvent-1.html | 2 +- docs/types/_internal_.UserEventResponse.html | 2 +- docs/types/_internal_.UserGDPRResponse.html | 2 +- docs/types/_internal_.UserInfoResponse.html | 2 +- .../_internal_.UserKeyPairInfoResponse.html | 2 +- .../_internal_.UserMasterKeysResponse.html | 2 +- .../types/_internal_.UserProfileResponse.html | 2 +- .../_internal_.UserPublicKeyResponse.html | 2 +- ...l_.UserSettingsPasswordChangeResponse.html | 2 +- .../_internal_.UserSettingsResponse.html | 2 +- .../_internal_.UserSubCreateResponse.html | 2 +- package.json | 2 +- src/fs/index.ts | 219 ++++++++---------- src/index.ts | 4 +- 288 files changed, 994 insertions(+), 1037 deletions(-) diff --git a/dist/bundle.browser.js b/dist/bundle.browser.js index 91e8c655..6ef3ba48 100644 --- a/dist/bundle.browser.js +++ b/dist/bundle.browser.js @@ -1,3 +1,3 @@ /*! For license information please see bundle.browser.js.LICENSE.txt */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(globalThis,(()=>(()=>{var t={39809:(t,e,i)=>{"use strict";const r=e;r.bignum=i(4590),r.define=i(22500).define,r.base=i(71979),r.constants=i(36826),r.decoders=i(78307),r.encoders=i(56579)},22500:(t,e,i)=>{"use strict";const r=i(56579),n=i(78307),o=i(35717);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){const e=this.name;function i(t){this._initNamed(t,e)}return o(i,t),i.prototype._initNamed=function(e,i){t.call(this,e,i)},new i(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},a.prototype.decode=function(t,e,i){return this._getDecoder(e).decode(t,i)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(r[t])),this.encoders[t]},a.prototype.encode=function(t,e,i){return this._getEncoder(e).encode(t,i)}},36625:(t,e,i)=>{"use strict";const r=i(35717),n=i(98465).b,o=i(2399).Buffer;function a(t,e){n.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function s(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return s.isEncoderBuffer(t)||(t=new s(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}r(a,n),e.C=a,a.isDecoderBuffer=function(t){if(t instanceof a)return!0;return"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},a.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},a.prototype.restore=function(t){const e=new a(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},a.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const i=new a(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+t,this.offset+=t,i},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=s,s.isEncoderBuffer=function(t){if(t instanceof s)return!0;return"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},s.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(t,e),e+=i.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},71979:(t,e,i)=>{"use strict";const r=e;r.Reporter=i(98465).b,r.DecoderBuffer=i(36625).C,r.EncoderBuffer=i(36625).R,r.Node=i(41949)},41949:(t,e,i)=>{"use strict";const r=i(98465).b,n=i(36625).R,o=i(36625).C,a=i(79746),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function u(t,e,i){const r={};this._baseState=r,r.name=i,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=u;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const t=this._baseState,e={};l.forEach((function(i){e[i]=t[i]}));const i=new this.constructor(e.parent);return i._baseState=e,i},u.prototype._wrap=function(){const t=this._baseState;c.forEach((function(e){this[e]=function(){const i=new this.constructor(this);return t.children.push(i),i[e].apply(i,arguments)}}),this)},u.prototype._init=function(t){const e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){const e=this._baseState,i=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==i.length&&(a(null===e.children),e.children=i,i.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(i){i==(0|i)&&(i|=0);const r=t[i];e[r]=i})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),s.forEach((function(t){u.prototype[t]=function(){const e=this._baseState,i=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(i),this}})),u.prototype.use=function(t){a(t);const e=this._baseState;return a(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){const e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){const e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){const e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){const e=this._baseState;return a(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){const e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){const e=this._baseState;return a(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,e));let r,n=i.default,a=!0,s=null;if(null!==i.key&&(s=t.enterKey(i.key)),i.optional){let r=null;if(null!==i.explicit?r=i.explicit:null!==i.implicit?r=i.implicit:null!==i.tag&&(r=i.tag),null!==r||i.any){if(a=this._peekTag(t,r,i.any),t.isError(a))return a}else{const r=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e),a=!0}catch(t){a=!1}t.restore(r)}}if(i.obj&&a&&(r=t.enterObject()),a){if(null!==i.explicit){const e=this._decodeTag(t,i.explicit);if(t.isError(e))return e;t=e}const r=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());const r=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(r))return r;i.any?n=t.raw(e):t=r}if(e&&e.track&&null!==i.tag&&e.track(t.path(),r,t.length,"tagged"),e&&e.track&&null!==i.tag&&e.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(t,e)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const r=new o(n);n=this._getUse(i.contains,t._reporterState.obj)._decode(r,e)}}return i.obj&&a&&(n=t.leaveObject(r)),null===i.key||null===n&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,i.key,n),n},u.prototype._decodeGeneric=function(t,e,i){const r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0],i):/str$/.test(t)?this._decodeStr(e,t,i):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1],i):"objid"===t?this._decodeObjid(e,null,null,i):"gentime"===t||"utctime"===t?this._decodeTime(e,t,i):"null_"===t?this._decodeNull(e,i):"bool"===t?this._decodeBool(e,i):"objDesc"===t?this._decodeStr(e,t,i):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0],i):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e,i):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){const i=this._baseState;return i.useDecoder=this._use(t,e),a(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},u.prototype._decodeChoice=function(t,e){const i=this._baseState;let r=null,n=!1;return Object.keys(i.choice).some((function(o){const a=t.save(),s=i.choice[o];try{const i=s._decode(t,e);if(t.isError(i))return!1;r={type:o,value:i},n=!0}catch(e){return t.restore(a),!1}return!0}),this),n?r:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},u.prototype._encode=function(t,e,i){const r=this._baseState;if(null!==r.default&&r.default===t)return;const n=this._encodeValue(t,e,i);return void 0===n||this._skipDefault(n,e,i)?void 0:n},u.prototype._encodeValue=function(t,e,i){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new r);let o=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}let a=null,s=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,e);else if(n.contains)a=this._getUse(n.contains,i)._encode(t,e),s=!0;else if(n.children)a=n.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,e,t);if(null===i._baseState.key)return e.error("Child should have a key");const r=e.enterKey(i._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=i._encode(t[i._baseState.key],e,t);return e.leaveKey(r),n}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(i){const r=this._baseState;return this._getUse(r.args[0],t)._encode(i,e)}),i))}else null!==n.use?o=this._getUse(n.use,i)._encode(t,e):(a=this._encodePrimitive(n.tag,t),s=!0);if(!n.any&&null===n.choice){const t=null!==n.implicit?n.implicit:n.tag,i=null===n.implicit?"universal":"context";null===t?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(t,s,i,a))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){const i=this._baseState,r=i.choice[t.type];return r||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(i.choice))),r._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){const i=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&i.args)return this._encodeObjid(e,i.reverseArgs[0],i.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,i.args&&i.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},98465:(t,e,i)=>{"use strict";const r=i(35717);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=n,n.prototype.isError=function(t){return t instanceof o},n.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,i){const r=this._reporterState;this.exitKey(t),null!==r.obj&&(r.obj[e]=i)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){const e=this._reporterState,i=e.obj;return e.obj=t,i},n.prototype.error=function(t){let e;const i=this._reporterState,r=t instanceof o;if(e=r?t:new o(i.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!i.options.partial)throw e;return r||i.errors.push(e),e},n.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},r(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},70160:(t,e)=>{"use strict";function i(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i(e.tag)},36826:(t,e,i)=>{"use strict";const r=e;r._reverse=function(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e},r.der=i(70160)},41671:(t,e,i)=>{"use strict";const r=i(35717),n=i(4590),o=i(36625).C,a=i(41949),s=i(70160);function c(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){a.call(this,"der",t)}function l(t,e){let i=t.readUInt8(e);if(t.isError(i))return i;const r=s.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let r=i;for(i=0;128==(128&r);){if(r=t.readUInt8(e),t.isError(r))return r;i<<=7,i|=127&r}}else i&=31;return{cls:r,primitive:n,tag:i,tagStr:s.tag[i]}}function h(t,e,i){let r=t.readUInt8(i);if(t.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;const n=127&r;if(n>4)return t.error("length octect is too long");r=0;for(let e=0;e{"use strict";const r=e;r.der=i(41671),r.pem=i(59631)},59631:(t,e,i)=>{"use strict";const r=i(35717),n=i(2399).Buffer,o=i(41671);function a(t){o.call(this,t),this.enc="pem"}r(a,o),t.exports=a,a.prototype.decode=function(t,e){const i=t.toString().split(/[\r\n]+/g),r=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,c=-1;for(let t=0;t{"use strict";const r=i(35717),n=i(2399).Buffer,o=i(41949),a=i(70160);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){o.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},r(c,o),c.prototype._encodeComposite=function(t,e,i,r){const o=function(t,e,i,r){let n;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))n=a.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return r.error("Unknown tag: "+t);n=t}if(n>=31)return r.error("Multi-octet tag encoding unsupported");e||(n|=32);return n|=a.tagClassByName[i||"universal"]<<6,n}(t,e,i,this.reporter);if(r.length<128){const t=n.alloc(2);return t[0]=o,t[1]=r.length,this._createEncoderBuffer([t,r])}let s=1;for(let t=r.length;t>=256;t>>=8)s++;const c=n.alloc(2+s);c[0]=o,c[1]=128|s;for(let t=1+s,e=r.length;e>0;t--,e>>=8)c[t]=255&e;return this._createEncoderBuffer([c,r])},c.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=n.alloc(2*t.length);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let r=0;for(let e=0;e=128;i>>=7)r++}const o=n.alloc(r);let a=o.length-1;for(let e=t.length-1;e>=0;e--){let i=t[e];for(o[a--]=127&i;(i>>=7)>0;)o[a--]=128|127&i}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(t,e){let i;const r=new Date(t);return"gentime"===e?i=[u(r.getUTCFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?i=[u(r.getUTCFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=n.from(e)}if(n.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=n.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let i=1;for(let e=t;e>=256;e>>=8)i++;const r=new Array(i);for(let e=r.length-1;e>=0;e--)r[e]=255&t,t>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(n.from(r))},c.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},c.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},c.prototype._skipDefault=function(t,e,i){const r=this._baseState;let n;if(null===r.default)return!1;const o=t.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,e,i).join()),o.length!==r.defaultBuffer.length)return!1;for(n=0;n{"use strict";const r=e;r.der=i(66984),r.pem=i(2883)},2883:(t,e,i)=>{"use strict";const r=i(35717),n=i(66984);function o(t){n.call(this,t),this.enc="pem"}r(o,n),t.exports=o,o.prototype.encode=function(t,e){const i=n.prototype.encode.call(this,t).toString("base64"),r=["-----BEGIN "+e.label+"-----"];for(let t=0;t=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},69282:(t,e,i)=>{"use strict";var r=i(34155),n=i(25108);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n1?i-1:0),n=1;n{"use strict";var r=i(34155);function n(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function o(t){for(var e=1;et.length)&&(i=t.length),t.substring(i-e.length,i)===e}var w="",_="",S="",x="",M={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(t){var e=Object.keys(t),i=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){i[e]=t[e]})),Object.defineProperty(i,"message",{value:t.message}),i}function k(t){return v(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(t,e,i){var n="",o="",a=0,s="",c=!1,u=k(t),l=u.split("\n"),h=k(e).split("\n"),f=0,p="";if("strictEqual"===i&&"object"===y(t)&&"object"===y(e)&&null!==t&&null!==e&&(i="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var d=l[0].length+h[0].length;if(d<=10){if(!("object"===y(t)&&null!==t||"object"===y(e)&&null!==e||0===t&&0===e))return"".concat(M[i],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==i){if(d<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var i=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,i-t.length)}(" ",f),"^"),f=0)}}}for(var m=l[l.length-1],v=h[h.length-1];m===v&&(f++<2?s="\n ".concat(m).concat(s):n=m,l.pop(),h.pop(),0!==l.length&&0!==h.length);)m=l[l.length-1],v=h[h.length-1];var g=Math.max(l.length,h.length);if(0===g){var E=u.split("\n");if(E.length>30)for(E[26]="".concat(w,"...").concat(x);E.length>27;)E.pop();return"".concat(M.notIdentical,"\n\n").concat(E.join("\n"),"\n")}f>3&&(s="\n".concat(w,"...").concat(x).concat(s),c=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var O=0,C=M[i]+"\n".concat(_,"+ actual").concat(x," ").concat(S,"- expected").concat(x),A=" ".concat(w,"...").concat(x," Lines skipped");for(f=0;f1&&f>2&&(P>4?(o+="\n".concat(w,"...").concat(x),c=!0):P>3&&(o+="\n ".concat(h[f-2]),O++),o+="\n ".concat(h[f-1]),O++),a=f,n+="\n".concat(S,"-").concat(x," ").concat(h[f]),O++;else if(h.length1&&f>2&&(P>4?(o+="\n".concat(w,"...").concat(x),c=!0):P>3&&(o+="\n ".concat(l[f-2]),O++),o+="\n ".concat(l[f-1]),O++),a=f,o+="\n".concat(_,"+").concat(x," ").concat(l[f]),O++;else{var j=h[f],T=l[f],R=T!==j&&(!b(T,",")||T.slice(0,-1)!==j);R&&b(j,",")&&j.slice(0,-1)===T&&(R=!1,T+=","),R?(P>1&&f>2&&(P>4?(o+="\n".concat(w,"...").concat(x),c=!0):P>3&&(o+="\n ".concat(l[f-2]),O++),o+="\n ".concat(l[f-1]),O++),a=f,o+="\n".concat(_,"+").concat(x," ").concat(T),n+="\n".concat(S,"-").concat(x," ").concat(j),O+=2):(o+=n,n="",1!==P&&0!==f||(o+="\n ".concat(T),O++))}if(O>20&&f30)for(p[26]="".concat(w,"...").concat(x);p.length>27;)p.pop();e=1===p.length?f.call(this,"".concat(h," ").concat(p[0])):f.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var d=k(a),m="",v=M[n];"notDeepEqual"===n||"notEqual"===n?(d="".concat(M[n],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(m="".concat(k(s)),d.length>512&&(d="".concat(d.slice(0,509),"...")),m.length>512&&(m="".concat(m.slice(0,509),"...")),"deepEqual"===n||"equal"===n?d="".concat(v,"\n\n").concat(d,"\n\nshould equal\n\n"):m=" ".concat(n," ").concat(m)),e=f.call(this,"".concat(d).concat(m))}return Error.stackTraceLimit=c,e.generatedMessage=!i,Object.defineProperty(l(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=s,e.operator=n,Error.captureStackTrace&&Error.captureStackTrace(l(e),o),e.stack,e.name="AssertionError",u(e)}return a=b,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return v(this,o(o({},e),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,c),h&&s(a,h),Object.defineProperty(a,"prototype",{writable:!1}),b}(h(Error),v.custom);t.exports=C},62136:(t,e,i)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var i=0;i2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}h("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),h("ERR_INVALID_ARG_TYPE",(function(t,e,n){var o,a,s,u;if(void 0===c&&(c=i(69282)),c("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!s||s<0?0:+s,a.length)===a)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}(t," argument"))u="The ".concat(t," ").concat(o," ").concat(f(e,"type"));else{var l=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+e.length>t.length)&&-1!==t.indexOf(e,i)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(l," ").concat(o," ").concat(f(e,"type"))}return u+=". Received type ".concat(r(n))}),TypeError),h("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=i(89539));var n=u.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),h("ERR_INVALID_RETURN_VALUE",(function(t,e,i){var n;return n=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(r(i)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(n,".")}),TypeError),h("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r0,"At least one arg needs to be specified");var n="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,o-1).join(", "),n+=", and ".concat(e[o-1]," arguments")}return"".concat(n," must be specified")}),TypeError),t.exports.codes=l},19158:(t,e,i)=>{"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,n,o,a,s=[],c=!0,u=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;c=!1}else for(;!(c=(r=o.call(i)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){u=!0,n=t}finally{try{if(!c&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function R(t){return Object.keys(t).filter(T).concat(l(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function I(t,e){if(t===e)return 0;for(var i=t.length,r=e.length,n=0,o=Math.min(i,r);n=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,n){for(var o=0,a=0,s=Math.min(t.length,i),c=e;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),i=0!==o||a!==this.length-1?f[6-c.length]+c+i:c+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=p[t],l=d[t];i="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(l).toString(t);i=(h=h.idivn(l)).isZero()?m+i:f[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i._strip()}o.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var i=0,r=0,n=0,o=0;n>8&255),i>16&255),6===o?(i>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(i=0&&(t[i--]=a>>8&255),i>=0&&(t[i--]=a>>16&255),6===o?(i>=0&&(t[i--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(i>=0)for(t[i--]=r;i>=0;)t[i--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function v(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i._strip()}function g(t,e,i){return v(t,e,i)}function b(t,e){this.x=t,this.y=e}Math.imul||(y=m),o.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):i<63?m(this,t,e):i<1024?v(this,t,e):g(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},b.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,i+=o/67108864|0,i+=a>>>26,this.words[n]=67108863&a}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n&1}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s._strip(),r._strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function O(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},n(S,_),S.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},S.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new x;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return w[t]=e,e},k.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new O(t)},n(O,k),O.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},O.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},O.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},29931:(t,e,i)=>{var r;function n(t){this.rand=t}if(t.exports=function(t){return r||(r=new n(null)),r.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),i=0;i=0)throw new h(a.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new h(a.EINVAL,"Path must not be empty.");return c.resolve(t)}function _(t,e,i,r){switch(typeof t){case"object":return{encoding:void 0!==t.encoding?t.encoding:e,flag:void 0!==t.flag?t.flag:i,mode:g(t.mode,r)};case"string":return{encoding:t,flag:i,mode:r};default:return{encoding:e,flag:i,mode:r}}}function S(){}var x=function(){this.F_OK=0,this.R_OK=4,this.W_OK=2,this.X_OK=1,this.root=null,this.fdMap={},this.nextFd=100};x.prototype.initialize=function(t){if(!t.constructor.isAvailable())throw new h(a.EINVAL,"Tried to instantiate BrowserFS with an unavailable file system.");return this.root=t},x.prototype._toUnixTimestamp=function(t){if("number"==typeof t)return t;if(t instanceof Date)return t.getTime()/1e3;throw new Error("Cannot parse time: "+t)},x.prototype.getRootFS=function(){return this.root?this.root:null},x.prototype.rename=function(t,e,i){void 0===i&&(i=S);var r=y(i,1);try{v(this.root).rename(w(t),w(e),r)}catch(t){r(t)}},x.prototype.renameSync=function(t,e){v(this.root).renameSync(w(t),w(e))},x.prototype.exists=function(t,e){void 0===e&&(e=S);var i=y(e,1);try{return v(this.root).exists(w(t),i)}catch(t){return i(!1)}},x.prototype.existsSync=function(t){try{return v(this.root).existsSync(w(t))}catch(t){return!1}},x.prototype.stat=function(t,e){void 0===e&&(e=S);var i=y(e,2);try{return v(this.root).stat(w(t),!1,i)}catch(t){return i(t)}},x.prototype.statSync=function(t){return v(this.root).statSync(w(t),!1)},x.prototype.lstat=function(t,e){void 0===e&&(e=S);var i=y(e,2);try{return v(this.root).stat(w(t),!0,i)}catch(t){return i(t)}},x.prototype.lstatSync=function(t){return v(this.root).statSync(w(t),!0)},x.prototype.truncate=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=S);var r=0;"function"==typeof e?i=e:"number"==typeof e&&(r=e);var n=y(i,1);try{if(r<0)throw new h(a.EINVAL);return v(this.root).truncate(w(t),r,n)}catch(t){return n(t)}},x.prototype.truncateSync=function(t,e){if(void 0===e&&(e=0),e<0)throw new h(a.EINVAL);return v(this.root).truncateSync(w(t),e)},x.prototype.unlink=function(t,e){void 0===e&&(e=S);var i=y(e,1);try{return v(this.root).unlink(w(t),i)}catch(t){return i(t)}},x.prototype.unlinkSync=function(t){return v(this.root).unlinkSync(w(t))},x.prototype.open=function(t,e,i,r){var n=this;void 0===r&&(r=S);var o=g(i,420),a=y(r="function"==typeof i?i:r,2);try{v(this.root).open(w(t),d.getFileFlag(e),o,(function(t,e){e?a(t,n.getFdForFile(e)):a(t)}))}catch(t){a(t)}},x.prototype.openSync=function(t,e,i){return void 0===i&&(i=420),this.getFdForFile(v(this.root).openSync(w(t),d.getFileFlag(e),g(i,420)))},x.prototype.readFile=function(t,e,i){void 0===e&&(e={}),void 0===i&&(i=S);var r=_(e,null,"r",null),n=y(i="function"==typeof e?e:i,2);try{var o=d.getFileFlag(r.flag);return o.isReadable()?v(this.root).readFile(w(t),r.encoding,o,n):n(new h(a.EINVAL,"Flag passed to readFile must allow for reading."))}catch(t){return n(t)}},x.prototype.readFileSync=function(t,e){void 0===e&&(e={});var i=_(e,null,"r",null),r=d.getFileFlag(i.flag);if(!r.isReadable())throw new h(a.EINVAL,"Flag passed to readFile must allow for reading.");return v(this.root).readFileSync(w(t),i.encoding,r)},x.prototype.writeFile=function(t,e,i,r){void 0===i&&(i={}),void 0===r&&(r=S);var n=_(i,"utf8","w",420),o=y(r="function"==typeof i?i:r,1);try{var s=d.getFileFlag(n.flag);return s.isWriteable()?v(this.root).writeFile(w(t),e,n.encoding,s,n.mode,o):o(new h(a.EINVAL,"Flag passed to writeFile must allow for writing."))}catch(t){return o(t)}},x.prototype.writeFileSync=function(t,e,i){var r=_(i,"utf8","w",420),n=d.getFileFlag(r.flag);if(!n.isWriteable())throw new h(a.EINVAL,"Flag passed to writeFile must allow for writing.");return v(this.root).writeFileSync(w(t),e,r.encoding,n,r.mode)},x.prototype.appendFile=function(t,e,i,r){void 0===r&&(r=S);var n=_(i,"utf8","a",420),o=y(r="function"==typeof i?i:r,1);try{var s=d.getFileFlag(n.flag);if(!s.isAppendable())return o(new h(a.EINVAL,"Flag passed to appendFile must allow for appending."));v(this.root).appendFile(w(t),e,n.encoding,s,n.mode,o)}catch(t){o(t)}},x.prototype.appendFileSync=function(t,e,i){var r=_(i,"utf8","a",420),n=d.getFileFlag(r.flag);if(!n.isAppendable())throw new h(a.EINVAL,"Flag passed to appendFile must allow for appending.");return v(this.root).appendFileSync(w(t),e,r.encoding,n,r.mode)},x.prototype.fstat=function(t,e){void 0===e&&(e=S);var i=y(e,2);try{this.fd2file(t).stat(i)}catch(t){i(t)}},x.prototype.fstatSync=function(t){return this.fd2file(t).statSync()},x.prototype.close=function(t,e){var i=this;void 0===e&&(e=S);var r=y(e,1);try{this.fd2file(t).close((function(e){e||i.closeFd(t),r(e)}))}catch(t){r(t)}},x.prototype.closeSync=function(t){this.fd2file(t).closeSync(),this.closeFd(t)},x.prototype.ftruncate=function(t,e,i){void 0===i&&(i=S);var r="number"==typeof e?e:0,n=y(i="function"==typeof e?e:i,1);try{var o=this.fd2file(t);if(r<0)throw new h(a.EINVAL);o.truncate(r,n)}catch(t){n(t)}},x.prototype.ftruncateSync=function(t,e){void 0===e&&(e=0);var i=this.fd2file(t);if(e<0)throw new h(a.EINVAL);i.truncateSync(e)},x.prototype.fsync=function(t,e){void 0===e&&(e=S);var i=y(e,1);try{this.fd2file(t).sync(i)}catch(t){i(t)}},x.prototype.fsyncSync=function(t){this.fd2file(t).syncSync()},x.prototype.fdatasync=function(t,e){void 0===e&&(e=S);var i=y(e,1);try{this.fd2file(t).datasync(i)}catch(t){i(t)}},x.prototype.fdatasyncSync=function(t){this.fd2file(t).datasyncSync()},x.prototype.write=function(e,i,r,n,o,s){void 0===s&&(s=S);var c,u,l,f=null;if("string"==typeof i){var p="utf8";switch(typeof r){case"function":s=r;break;case"number":f=r,p="string"==typeof n?n:"utf8",s="function"==typeof o?o:s;break;default:return(s="function"==typeof n?n:"function"==typeof o?o:s)(new h(a.EINVAL,"Invalid arguments."))}u=0,l=(c=t.from(i,p)).length}else c=i,u=r,l=n,f="number"==typeof o?o:null,s="function"==typeof o?o:s;var d=y(s,3);try{var m=this.fd2file(e);null==f&&(f=m.getPos()),m.write(c,u,l,f,d)}catch(t){d(t)}},x.prototype.writeSync=function(e,i,r,n,o){var a,s,c,u=0;if("string"==typeof i){c="number"==typeof r?r:null;var l="string"==typeof n?n:"utf8";u=0,s=(a=t.from(i,l)).length}else a=i,u=r,s=n,c="number"==typeof o?o:null;var h=this.fd2file(e);return null==c&&(c=h.getPos()),h.writeSync(a,u,s,c)},x.prototype.read=function(e,i,r,n,o,a){var s,c,u,l,h;if(void 0===a&&(a=S),"number"==typeof i){u=i,s=r;var f=n;a="function"==typeof o?o:a,c=0,l=t.alloc(u),h=y((function(t,e,i){if(t)return a(t);a(t,i.toString(f),e)}),3)}else l=i,c=r,u=n,s=o,h=y(a,3);try{var p=this.fd2file(e);null==s&&(s=p.getPos()),p.read(l,c,u,s,h)}catch(t){h(t)}},x.prototype.readSync=function(e,i,r,n,o){var a,s,c,u,l=!1,h="utf8";"number"==typeof i?(c=i,u=r,h=n,s=0,a=t.alloc(c),l=!0):(a=i,s=r,c=n,u=o);var f=this.fd2file(e);null==u&&(u=f.getPos());var p=f.readSync(a,s,c,u);return l?[a.toString(h),p]:p},x.prototype.fchown=function(t,e,i,r){void 0===r&&(r=S);var n=y(r,1);try{this.fd2file(t).chown(e,i,n)}catch(t){n(t)}},x.prototype.fchownSync=function(t,e,i){this.fd2file(t).chownSync(e,i)},x.prototype.fchmod=function(t,e,i){var r=y(i,1);try{var n="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmod(n,r)}catch(t){r(t)}},x.prototype.fchmodSync=function(t,e){var i="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmodSync(i)},x.prototype.futimes=function(t,e,i,r){void 0===r&&(r=S);var n=y(r,1);try{var o=this.fd2file(t);"number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof i&&(i=new Date(1e3*i)),o.utimes(e,i,n)}catch(t){n(t)}},x.prototype.futimesSync=function(t,e,i){this.fd2file(t).utimesSync(b(e),b(i))},x.prototype.rmdir=function(t,e){void 0===e&&(e=S);var i=y(e,1);try{t=w(t),v(this.root).rmdir(t,i)}catch(t){i(t)}},x.prototype.rmdirSync=function(t){return t=w(t),v(this.root).rmdirSync(t)},x.prototype.mkdir=function(t,e,i){void 0===i&&(i=S),"function"==typeof e&&(i=e,e=511);var r=y(i,1);try{t=w(t),v(this.root).mkdir(t,e,r)}catch(t){r(t)}},x.prototype.mkdirSync=function(t,e){v(this.root).mkdirSync(w(t),g(e,511))},x.prototype.readdir=function(t,e){void 0===e&&(e=S);var i=y(e,2);try{t=w(t),v(this.root).readdir(t,i)}catch(t){i(t)}},x.prototype.readdirSync=function(t){return t=w(t),v(this.root).readdirSync(t)},x.prototype.link=function(t,e,i){void 0===i&&(i=S);var r=y(i,1);try{t=w(t),e=w(e),v(this.root).link(t,e,r)}catch(t){r(t)}},x.prototype.linkSync=function(t,e){return t=w(t),e=w(e),v(this.root).linkSync(t,e)},x.prototype.symlink=function(t,e,i,r){void 0===r&&(r=S);var n="string"==typeof i?i:"file",o=y(r="function"==typeof i?i:r,1);try{if("file"!==n&&"dir"!==n)return o(new h(a.EINVAL,"Invalid type: "+n));t=w(t),e=w(e),v(this.root).symlink(t,e,n,o)}catch(t){o(t)}},x.prototype.symlinkSync=function(t,e,i){if(i){if("file"!==i&&"dir"!==i)throw new h(a.EINVAL,"Invalid type: "+i)}else i="file";return t=w(t),e=w(e),v(this.root).symlinkSync(t,e,i)},x.prototype.readlink=function(t,e){void 0===e&&(e=S);var i=y(e,2);try{t=w(t),v(this.root).readlink(t,i)}catch(t){i(t)}},x.prototype.readlinkSync=function(t){return t=w(t),v(this.root).readlinkSync(t)},x.prototype.chown=function(t,e,i,r){void 0===r&&(r=S);var n=y(r,1);try{t=w(t),v(this.root).chown(t,!1,e,i,n)}catch(t){n(t)}},x.prototype.chownSync=function(t,e,i){t=w(t),v(this.root).chownSync(t,!1,e,i)},x.prototype.lchown=function(t,e,i,r){void 0===r&&(r=S);var n=y(r,1);try{t=w(t),v(this.root).chown(t,!0,e,i,n)}catch(t){n(t)}},x.prototype.lchownSync=function(t,e,i){t=w(t),v(this.root).chownSync(t,!0,e,i)},x.prototype.chmod=function(t,e,i){void 0===i&&(i=S);var r=y(i,1);try{var n=g(e,-1);if(n<0)throw new h(a.EINVAL,"Invalid mode.");v(this.root).chmod(w(t),!1,n,r)}catch(t){r(t)}},x.prototype.chmodSync=function(t,e){var i=g(e,-1);if(i<0)throw new h(a.EINVAL,"Invalid mode.");t=w(t),v(this.root).chmodSync(t,!1,i)},x.prototype.lchmod=function(t,e,i){void 0===i&&(i=S);var r=y(i,1);try{var n=g(e,-1);if(n<0)throw new h(a.EINVAL,"Invalid mode.");v(this.root).chmod(w(t),!0,n,r)}catch(t){r(t)}},x.prototype.lchmodSync=function(t,e){var i=g(e,-1);if(i<1)throw new h(a.EINVAL,"Invalid mode.");v(this.root).chmodSync(w(t),!0,i)},x.prototype.utimes=function(t,e,i,r){void 0===r&&(r=S);var n=y(r,1);try{v(this.root).utimes(w(t),b(e),b(i),n)}catch(t){n(t)}},x.prototype.utimesSync=function(t,e,i){v(this.root).utimesSync(w(t),b(e),b(i))},x.prototype.realpath=function(t,e,i){void 0===i&&(i=S);var r="object"==typeof e?e:{},n=y(i="function"==typeof e?e:S,2);try{t=w(t),v(this.root).realpath(t,r,n)}catch(t){n(t)}},x.prototype.realpathSync=function(t,e){return void 0===e&&(e={}),t=w(t),v(this.root).realpathSync(t,e)},x.prototype.watchFile=function(t,e,i){throw void 0===i&&(i=S),new h(a.ENOTSUP)},x.prototype.unwatchFile=function(t,e){throw void 0===e&&(e=S),new h(a.ENOTSUP)},x.prototype.watch=function(t,e,i){throw void 0===i&&(i=S),new h(a.ENOTSUP)},x.prototype.access=function(t,e,i){throw void 0===i&&(i=S),new h(a.ENOTSUP)},x.prototype.accessSync=function(t,e){throw new h(a.ENOTSUP)},x.prototype.createReadStream=function(t,e){throw new h(a.ENOTSUP)},x.prototype.createWriteStream=function(t,e){throw new h(a.ENOTSUP)},x.prototype.wrapCallbacks=function(t){y=t},x.prototype.getFdForFile=function(t){var e=this.nextFd++;return this.fdMap[e]=t,e},x.prototype.fd2file=function(t){var e=this.fdMap[t];if(e)return e;throw new h(a.EBADF,"Invalid file descriptor.")},x.prototype.closeFd=function(t){delete this.fdMap[t]},x.Stats=m;var M=new x,E={},k=x.prototype;function O(t,e,i,r,n){return ti?i+1:t+1:r===n?e:e+1}function C(t,e){if(t===e)return 0;if(t.length>e.length){var i=t;t=e,e=i}for(var r=t.length,n=e.length;r>0&&t.charCodeAt(r-1)===e.charCodeAt(n-1);)r--,n--;for(var o=0;o_?_+1:M+1:S===h[r+x]?s:s+1,s=M}}return _}function A(t,e,i){t&&console.warn("["+e+"] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '"+e+".Create("+JSON.stringify(i)+", callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.")}Object.keys(k).forEach((function(t){"function"==typeof M[t]?E[t]=function(){return M[t].apply(M,arguments)}:E[t]=M[t]})),E.changeFSModule=function(t){M=t},E.getFSModule=function(){return M},E.FS=x;var P="undefined"!=typeof navigator&&!(!/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())&&-1===navigator.userAgent.indexOf("Trident")),j="undefined"==typeof window;function T(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function R(t,e,i){i.existsSync(t)||(R(c.dirname(t),e,i),i.mkdirSync(t,e))}function I(t){var e=N(t),i=e.byteOffset,r=e.byteLength;return 0===i&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(i,i+r)}function N(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function D(e){return e instanceof t?e:e instanceof Uint8Array?L(e):t.from(e)}function L(e){return e instanceof t?e:0===e.byteOffset&&e.byteLength===e.buffer.byteLength?B(e.buffer):t.from(e.buffer,e.byteOffset,e.byteLength)}function B(e){return t.from(e)}function F(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=t.length),e<0||i<0||i>t.length||e>i)throw new TypeError("Invalid slice bounds on buffer of length "+t.length+": ["+e+", "+i+"]");if(0===t.length)return z();var r=N(t),n=t[0],o=(n+1)%255;return t[0]=o,r[0]===o?(r[0]=n,L(r.slice(e,i))):(t[0]=n,L(r.subarray(e,i)))}var U=null;function z(){return U||(U=t.alloc(0))}function q(e,i){t.isBuffer(e)?i():i(new h(a.EINVAL,"option must be a Buffer."))}function K(t,e,i){var r=t.Options,n=t.Name,o=0,s=!1,c=!1;function u(t){s||(t&&(s=!0,i(t)),0==--o&&c&&i())}var l=function(t){if(r.hasOwnProperty(t)){var c=r[t],l=e[t];if(null==l){if(!c.optional){var f=Object.keys(e).filter((function(t){return!(t in r)})).map((function(e){return{str:e,distance:C(t,e)}})).filter((function(t){return t.distance<5})).sort((function(t,e){return t.distance-e.distance}));return s?{}:(s=!0,{v:i(new h(a.EINVAL,"["+n+"] Required option '"+t+"' not provided."+(f.length>0?" You provided unrecognized option '"+f[0].str+"'; perhaps you meant to type '"+t+"'.":"")+"\nOption description: "+c.description))})}}else{if(!(Array.isArray(c.type)?-1!==c.type.indexOf(typeof l):typeof l===c.type))return s?{}:(s=!0,{v:i(new h(a.EINVAL,"["+n+"] Value provided for option "+t+" is not the proper type. Expected "+(Array.isArray(c.type)?"one of {"+c.type.join(", ")+"}":c.type)+", but received "+typeof l+"\nOption description: "+c.description))});c.validator&&(o++,c.validator(l,u))}}};for(var f in r){var p=l(f);if(p)return p.v}c=!0,0!==o||s||i()}var H=Object.freeze({deprecationMessage:A,isIE:P,isWebWorker:j,fail:T,mkdirpSync:R,buffer2ArrayBuffer:I,buffer2Uint8array:N,arrayish2Buffer:D,uint8Array2Buffer:L,arrayBuffer2Buffer:B,copyingSlice:F,emptyBuffer:z,bufferValidator:q,checkOptions:K}),W=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};W.prototype.open=function(t){var e=this.fs.realPath(t.node),i=this.FS;try{i.isFile(t.node.mode)&&(t.nfd=this.nodefs.openSync(e,this.fs.flagsToPermissionString(t.flags)))}catch(t){if(!t.code)throw t;throw new i.ErrnoError(this.ERRNO_CODES[t.code])}},W.prototype.close=function(t){var e=this.FS;try{e.isFile(t.node.mode)&&t.nfd&&this.nodefs.closeSync(t.nfd)}catch(t){if(!t.code)throw t;throw new e.ErrnoError(this.ERRNO_CODES[t.code])}},W.prototype.read=function(t,e,i,r,n){try{return this.nodefs.readSync(t.nfd,L(e),i,r,n)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},W.prototype.write=function(t,e,i,r,n){try{return this.nodefs.writeSync(t.nfd,L(e),i,r,n)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},W.prototype.llseek=function(t,e,i){var r=e;if(1===i)r+=t.position;else if(2===i&&this.FS.isFile(t.node.mode))try{r+=this.nodefs.fstatSync(t.nfd).size}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(r<0)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return t.position=r,r};var G=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};G.prototype.getattr=function(t){var e,i=this.fs.realPath(t);try{e=this.nodefs.lstatSync(i)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},G.prototype.setattr=function(t,e){var i=this.fs.realPath(t);try{if(void 0!==e.mode&&(this.nodefs.chmodSync(i,e.mode),t.mode=e.mode),void 0!==e.timestamp){var r=new Date(e.timestamp);this.nodefs.utimesSync(i,r,r)}}catch(t){if(!t.code)throw t;if("ENOTSUP"!==t.code)throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(void 0!==e.size)try{this.nodefs.truncateSync(i,e.size)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.lookup=function(t,e){var i=this.PATH.join2(this.fs.realPath(t),e),r=this.fs.getMode(i);return this.fs.createNode(t,e,r)},G.prototype.mknod=function(t,e,i,r){var n=this.fs.createNode(t,e,i,r),o=this.fs.realPath(n);try{this.FS.isDir(n.mode)?this.nodefs.mkdirSync(o,n.mode):this.nodefs.writeFileSync(o,"",{mode:n.mode})}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return n},G.prototype.rename=function(t,e,i){var r=this.fs.realPath(t),n=this.PATH.join2(this.fs.realPath(e),i);try{this.nodefs.renameSync(r,n),t.name=i,t.parent=e}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.unlink=function(t,e){var i=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.unlinkSync(i)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.rmdir=function(t,e){var i=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.rmdirSync(i)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.readdir=function(t){var e=this.fs.realPath(t);try{var i=this.nodefs.readdirSync(e);return i.push(".",".."),i}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.symlink=function(t,e,i){var r=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.symlinkSync(i,r)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},G.prototype.readlink=function(t){var e=this.fs.realPath(t);try{return this.nodefs.readlinkSync(e)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}};var V=function(t,e,i,r){void 0===t&&(t=self.FS),void 0===e&&(e=self.PATH),void 0===i&&(i=self.ERRNO_CODES),void 0===r&&(r=E),this.flagsToPermissionStringMap={0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},this.nodefs=r,this.FS=t,this.PATH=e,this.ERRNO_CODES=i,this.node_ops=new G(this),this.stream_ops=new W(this)};V.prototype.mount=function(t){return this.createNode(null,"/",this.getMode(t.opts.root),0)},V.prototype.createNode=function(t,e,i,r){var n=this.FS;if(!n.isDir(i)&&!n.isFile(i)&&!n.isLink(i))throw new n.ErrnoError(this.ERRNO_CODES.EINVAL);var o=n.createNode(t,e,i);return o.node_ops=this.node_ops,o.stream_ops=this.stream_ops,o},V.prototype.getMode=function(t){var e;try{e=this.nodefs.lstatSync(t)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return e.mode},V.prototype.realPath=function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),this.PATH.join.apply(null,e)},V.prototype.flagsToPermissionString=function(t){var e="string"==typeof t?parseInt(t,10):t;return(e&=8191)in this.flagsToPermissionStringMap?this.flagsToPermissionStringMap[e]:t},V.prototype.getNodeFS=function(){return this.nodefs},V.prototype.getFS=function(){return this.FS},V.prototype.getPATH=function(){return this.PATH},V.prototype.getERRNO_CODES=function(){return this.ERRNO_CODES};var Z=function(){};Z.prototype.supportsLinks=function(){return!1},Z.prototype.diskSpace=function(t,e){e(0,0)},Z.prototype.openFile=function(t,e,i){throw new h(a.ENOTSUP)},Z.prototype.createFile=function(t,e,i,r){throw new h(a.ENOTSUP)},Z.prototype.open=function(t,e,i,r){var n=this;this.stat(t,!1,(function(o,s){if(o)switch(e.pathNotExistsAction()){case l.CREATE_FILE:return n.stat(c.dirname(t),!1,(function(o,a){o?r(o):a&&!a.isDirectory()?r(h.ENOTDIR(c.dirname(t))):n.createFile(t,e,i,r)}));case l.THROW_EXCEPTION:return r(h.ENOENT(t));default:return r(new h(a.EINVAL,"Invalid FileFlag object."))}else{if(s&&s.isDirectory())return r(h.EISDIR(t));switch(e.pathExistsAction()){case l.THROW_EXCEPTION:return r(h.EEXIST(t));case l.TRUNCATE_FILE:return n.openFile(t,e,(function(t,e){t?r(t):e?e.truncate(0,(function(){e.sync((function(){r(null,e)}))})):T()}));case l.NOP:return n.openFile(t,e,r);default:return r(new h(a.EINVAL,"Invalid FileFlag object."))}}}))},Z.prototype.rename=function(t,e,i){i(new h(a.ENOTSUP))},Z.prototype.renameSync=function(t,e){throw new h(a.ENOTSUP)},Z.prototype.stat=function(t,e,i){i(new h(a.ENOTSUP))},Z.prototype.statSync=function(t,e){throw new h(a.ENOTSUP)},Z.prototype.openFileSync=function(t,e,i){throw new h(a.ENOTSUP)},Z.prototype.createFileSync=function(t,e,i){throw new h(a.ENOTSUP)},Z.prototype.openSync=function(t,e,i){var r;try{r=this.statSync(t,!1)}catch(r){switch(e.pathNotExistsAction()){case l.CREATE_FILE:if(!this.statSync(c.dirname(t),!1).isDirectory())throw h.ENOTDIR(c.dirname(t));return this.createFileSync(t,e,i);case l.THROW_EXCEPTION:throw h.ENOENT(t);default:throw new h(a.EINVAL,"Invalid FileFlag object.")}}if(r.isDirectory())throw h.EISDIR(t);switch(e.pathExistsAction()){case l.THROW_EXCEPTION:throw h.EEXIST(t);case l.TRUNCATE_FILE:return this.unlinkSync(t),this.createFileSync(t,e,r.mode);case l.NOP:return this.openFileSync(t,e,i);default:throw new h(a.EINVAL,"Invalid FileFlag object.")}},Z.prototype.unlink=function(t,e){e(new h(a.ENOTSUP))},Z.prototype.unlinkSync=function(t){throw new h(a.ENOTSUP)},Z.prototype.rmdir=function(t,e){e(new h(a.ENOTSUP))},Z.prototype.rmdirSync=function(t){throw new h(a.ENOTSUP)},Z.prototype.mkdir=function(t,e,i){i(new h(a.ENOTSUP))},Z.prototype.mkdirSync=function(t,e){throw new h(a.ENOTSUP)},Z.prototype.readdir=function(t,e){e(new h(a.ENOTSUP))},Z.prototype.readdirSync=function(t){throw new h(a.ENOTSUP)},Z.prototype.exists=function(t,e){this.stat(t,null,(function(t){e(!t)}))},Z.prototype.existsSync=function(t){try{return this.statSync(t,!0),!0}catch(t){return!1}},Z.prototype.realpath=function(t,e,i){if(this.supportsLinks())for(var r=t.split(c.sep),n=0;nthis._buffer.length){var i=t.alloc(e-this._buffer.length,0);return this.writeSync(i,0,i.length,this._buffer.length),void(this._flag.isSynchronous()&&E.getRootFS().supportsSynch()&&this.syncSync())}this._stat.size=e;var r=t.alloc(e);this._buffer.copy(r,0,0,e),this._buffer=r,this._flag.isSynchronous()&&E.getRootFS().supportsSynch()&&this.syncSync()},i.prototype.write=function(t,e,i,r,n){try{n(null,this.writeSync(t,e,i,r),t)}catch(t){n(t)}},i.prototype.writeSync=function(e,i,r,n){if(this._dirty=!0,null==n&&(n=this.getPos()),!this._flag.isWriteable())throw new h(a.EPERM,"File not opened with a writeable mode.");var o=n+r;if(o>this._stat.size&&(this._stat.size=o,o>this._buffer.length)){var s=t.alloc(o);this._buffer.copy(s),this._buffer=s}var c=e.copy(this._buffer,n,i,i+r);return this._stat.mtime=new Date,this._flag.isSynchronous()?(this.syncSync(),c):(this.setPos(n+c),c)},i.prototype.read=function(t,e,i,r,n){try{n(null,this.readSync(t,e,i,r),t)}catch(t){n(t)}},i.prototype.readSync=function(t,e,i,r){if(!this._flag.isReadable())throw new h(a.EPERM,"File not opened with a readable mode.");null==r&&(r=this.getPos()),r+i>this._stat.size&&(i=this._stat.size-r);var n=this._buffer.copy(t,e,r,r+i);return this._stat.atime=new Date,this._pos=r+i,n},i.prototype.chmod=function(t,e){try{this.chmodSync(t),e()}catch(t){e(t)}},i.prototype.chmodSync=function(t){if(!this._fs.supportsProps())throw new h(a.ENOTSUP);this._dirty=!0,this._stat.chmod(t),this.syncSync()},i.prototype.isDirty=function(){return this._dirty},i.prototype.resetDirty=function(){this._dirty=!1},i}(J),Y=function(t){function e(e,i,r,n,o){t.call(this,e,i,r,n,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.close=function(t){t()},e.prototype.closeSync=function(){},e}(X),Q=function(t){function e(e,i,r,n,o){t.call(this,e,i,r,n,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(X),tt=function(t){function e(i,r,n){if(void 0===n&&(n=!0),t.call(this),this._queue=[],this._queueRunning=!1,this._isInitialized=!1,this._initializeCallbacks=[],this._sync=i,this._async=r,!i.supportsSynch())throw new Error("The first argument to AsyncMirror needs to be a synchronous file system.");A(n,e.Name,{sync:"sync file system instance",async:"async file system instance"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){try{var r=new e(t.sync,t.async,!1);r.initialize((function(t){t?i(t):i(null,r)}),!1)}catch(t){i(t)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){return e.Name},e.prototype._syncSync=function(t){this._sync.writeFileSync(t.getPath(),t.getBuffer(),null,d.getFileFlag("w"),t.getStats().mode),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),null,t.getFlag(),t.getStats().mode]})},e.prototype.initialize=function(t,e){var i=this;void 0===e&&(e=!0),e&&console.warn("[AsyncMirror] AsyncMirror.initialize() is deprecated and will be removed in the next major version. Please use 'AsyncMirror.Create({ sync: (sync file system instance), async: (async file system instance)}, cb)' to create and initialize AsyncMirror instances.");var r=this._initializeCallbacks;if(this._isInitialized)t();else if(1===r.push(t)){var n=function(t,e,r){"/"!==t&&i._sync.mkdirSync(t,e),i._async.readdir(t,(function(e,i){var n=0;e?r(e):function e(a){a?r(a):n0){var r=e._queue.shift(),n=r.arguments;n.push(i),e._async[r.apiMethod].apply(e._async,n)}else e._queueRunning=!1};i()}},e}($);tt.Name="AsyncMirror",tt.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to."},async:{type:"object",description:"The asynchronous file system to mirror."}};var et=Math.max;function it(t){return t}function rt(t,e){return function(t,e,i){return e=et(void 0===e?t.length-1:e,0),function(){for(var r=arguments,n=-1,o=et(r.length-e,0),a=Array(o);++n-1&&t%1==0&&t<=xt}function Et(t){return null!=t&&Mt(t.length)&&!function(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=gt(t);return e==wt||e==_t||e==bt||e==St}(t)}var kt={};function Ot(){}function Ct(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var At="function"==typeof Symbol&&Symbol.iterator,Pt=function(t){return At&&t[At]&&t[At]()};function jt(t){return null!=t&&"object"==typeof t}function Tt(t){return jt(t)&&"[object Arguments]"==gt(t)}var Rt=Object.prototype,It=Rt.hasOwnProperty,Nt=Rt.propertyIsEnumerable,Dt=Tt(function(){return arguments}())?Tt:function(t){return jt(t)&&It.call(t,"callee")&&!Nt.call(t,"callee")},Lt=Array.isArray,Bt="object"==typeof e&&e&&!e.nodeType&&e,Ft=Bt&&"object"==typeof n&&n&&!n.nodeType&&n,Ut=Ft&&Ft.exports===Bt?ct.Buffer:void 0,zt=(Ut?Ut.isBuffer:void 0)||function(){return!1},qt=9007199254740991,Kt=/^(?:0|[1-9]\d*)$/;function Ht(t,e){return!!(e=null==e?qt:e)&&("number"==typeof t||Kt.test(t))&&t>-1&&t%1==0&&t++i)switch(n.status){case Dropbox.ApiError.SERVER_ERROR:case Dropbox.ApiError.NETWORK_ERROR:case Dropbox.ApiError.RATE_LIMITED:setTimeout((function(){t(r)}),2e3);break;default:e.apply(null,arguments)}else e.apply(null,arguments)};t(r)},Te.prototype.getCachedInfo=function(t){return this._cache[t.toLowerCase()]},Te.prototype.putCachedInfo=function(t,e){this._cache[t.toLowerCase()]=e},Te.prototype.deleteCachedInfo=function(t){delete this._cache[t.toLowerCase()]},Te.prototype.getCachedDirInfo=function(t){var e,i=this.getCachedInfo(t);return(e=i)&&e.stat.isFolder?i:null},Te.prototype.getCachedFileInfo=function(t){var e,i=this.getCachedInfo(t);return(e=i)&&e.stat.isFile?i:null},Te.prototype.updateCachedDirInfo=function(t,e,i){void 0===i&&(i=null);var r=this.getCachedInfo(t);null===e.contentHash||void 0!==r&&r.stat.contentHash===e.contentHash||this.putCachedInfo(t,{stat:e,contents:i})},Te.prototype.updateCachedFileInfo=function(t,e,i){void 0===i&&(i=null);var r=this.getCachedInfo(t);null===e.versionTag||void 0!==r&&r.stat.versionTag===e.versionTag||this.putCachedInfo(t,{stat:e,contents:i})},Te.prototype.updateCachedInfo=function(t,e,i){var r;void 0===i&&(i=null),e.isFile&&(null==(r=i)||"object"==typeof r&&"number"==typeof r.byteLength)?this.updateCachedFileInfo(t,e,i):e.isFolder&&Array.isArray(i)&&this.updateCachedDirInfo(t,e,i)};var Re=function(t){function e(e,i,r,n,o){t.call(this,e,i,r,n,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(this.isDirty()){var i=I(this.getBuffer());this._fs._writeFileStrict(this.getPath(),i,(function(i){i||e.resetDirty(),t(i)}))}else t()},e.prototype.close=function(t){this.sync(t)},e}(X),Ie=function(t){function e(i,r){void 0===r&&(r=!0),t.call(this),this._client=new Te(i),A(r,e.Name,{client:"authenticated dropbox client instance"}),Oe||((Oe={})[Dropbox.ApiError.NETWORK_ERROR]=a.EIO,Oe[Dropbox.ApiError.INVALID_PARAM]=a.EINVAL,Oe[Dropbox.ApiError.INVALID_TOKEN]=a.EPERM,Oe[Dropbox.ApiError.OAUTH_ERROR]=a.EPERM,Oe[Dropbox.ApiError.NOT_FOUND]=a.ENOENT,Oe[Dropbox.ApiError.INVALID_METHOD]=a.EINVAL,Oe[Dropbox.ApiError.NOT_ACCEPTABLE]=a.EINVAL,Oe[Dropbox.ApiError.CONFLICT]=a.EINVAL,Oe[Dropbox.ApiError.RATE_LIMITED]=a.EBUSY,Oe[Dropbox.ApiError.SERVER_ERROR]=a.EBUSY,Oe[Dropbox.ApiError.OVER_QUOTA]=a.ENOSPC)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){i(null,new e(t.client,!1))},e.isAvailable=function(){return"undefined"!=typeof Dropbox},e.prototype.getName=function(){return e.Name},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.empty=function(t){var e=this;this._client.readdir("/",(function(i,r){i?t(e.convert(i,"/")):je(r,(function(t,i){var r=c.join("/",t);e._client.remove(r,(function(t){i(t?e.convert(t,r):null)}))}),(function(e){e?t(e):t()}))}))},e.prototype.rename=function(t,e,i){var r=this;this._client.move(t,e,(function(n){n?r._client.stat(e,(function(o,a){if(o||a.isFolder){var s=n.response.error.indexOf(t)>-1?t:e;i(r.convert(n,s))}else r._client.remove(e,(function(n){n?i(r.convert(n,e)):r.rename(t,e,i)}))})):i()}))},e.prototype.stat=function(t,e,i){var r=this;this._client.stat(t,(function(e,n){if(e)i(r.convert(e,t));else{if(!n||!n.isRemoved){var o=new m(r._statType(n),n.size);return i(null,o)}i(h.FileError(a.ENOENT,t))}}))},e.prototype.open=function(t,e,i,r){var n=this;this._client.readFile(t,(function(i,o,a){if(!i){var s;s=null===o?z():B(o);var c=n._makeFile(t,e,a,s);return r(null,c)}if(!e.isReadable()){if(i.status===Dropbox.ApiError.NOT_FOUND){var u=new ArrayBuffer(0);return n._writeFileStrict(t,u,(function(i,o){if(i)r(i);else{var a=n._makeFile(t,e,o,B(u));r(null,a)}}))}return r(n.convert(i,t))}r(n.convert(i,t))}))},e.prototype._writeFileStrict=function(t,e,i){var r=this,n=c.dirname(t);this.stat(n,!1,(function(o,s){o?i(h.FileError(a.ENOENT,n)):r._client.writeFile(t,e,(function(e,n){e?i(r.convert(e,t)):i(null,n)}))}))},e.prototype._statType=function(t){return t.isFile?p.FILE:p.DIRECTORY},e.prototype._makeFile=function(t,e,i,r){var n=this._statType(i),o=new m(n,i.size);return new Re(this,t,e,o,r)},e.prototype._remove=function(t,e,i){var r=this;this._client.stat(t,(function(n,o){n?e(r.convert(n,t)):o.isFile&&!i?e(h.FileError(a.ENOTDIR,t)):!o.isFile&&i?e(h.FileError(a.EISDIR,t)):r._client.remove(t,(function(i){e(i?r.convert(i,t):null)}))}))},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){this._remove(t,e,!1)},e.prototype.mkdir=function(t,e,i){var r=this,n=c.dirname(t);this._client.stat(n,(function(e,o){e?i(r.convert(e,n)):r._client.mkdir(t,(function(e){i(e?h.FileError(a.EEXIST,t):null)}))}))},e.prototype.readdir=function(t,e){var i=this;this._client.readdir(t,(function(t,r){return t?e(i.convert(t)):e(null,r)}))},e.prototype.convert=function(t,e){void 0===e&&(e=null);var i=Oe[t.status];return void 0===i&&(i=a.EIO),e?h.FileError(i,e):new h(i)},e}(Z);function Ne(t,e){void 0===e&&(e="");for(var i=t.errno,r=t.node,n=[];r&&(n.unshift(r.name),r!==r.parent);)r=r.parent;return new h(i,u[i],n.length>0?"/"+n.join("/"):e)}Ie.Name="Dropbox",Ie.Options={client:{type:"object",description:"An *authenticated* Dropbox client. Must be from the 0.10 JS SDK.",validator:function(t,e){t.isAuthenticated&&t.isAuthenticated()?e():e(new h(a.EINVAL,"'client' option must be an authenticated Dropbox client from the v0.10 JS SDK."))}}};var De=function(t){function e(e,i,r,n){t.call(this),this._fs=e,this._FS=i,this._path=r,this._stream=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPos=function(){},e.prototype.close=function(t){var e=null;try{this.closeSync()}catch(t){e=t}finally{t(e)}},e.prototype.closeSync=function(){try{this._FS.close(this._stream)}catch(t){throw Ne(t,this._path)}},e.prototype.stat=function(t){try{t(null,this.statSync())}catch(e){t(e)}},e.prototype.statSync=function(){try{return this._fs.statSync(this._path,!1)}catch(t){throw Ne(t,this._path)}},e.prototype.truncate=function(t,e){var i=null;try{this.truncateSync(t)}catch(t){i=t}finally{e(i)}},e.prototype.truncateSync=function(t){try{this._FS.ftruncate(this._stream.fd,t)}catch(t){throw Ne(t,this._path)}},e.prototype.write=function(t,e,i,r,n){try{n(null,this.writeSync(t,e,i,r),t)}catch(t){n(t)}},e.prototype.writeSync=function(t,e,i,r){try{var n=N(t),o=null===r?void 0:r;return this._FS.write(this._stream,n,e,i,o)}catch(t){throw Ne(t,this._path)}},e.prototype.read=function(t,e,i,r,n){try{n(null,this.readSync(t,e,i,r),t)}catch(t){n(t)}},e.prototype.readSync=function(t,e,i,r){try{var n=N(t),o=null===r?void 0:r;return this._FS.read(this._stream,n,e,i,o)}catch(t){throw Ne(t,this._path)}},e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.chown=function(t,e,i){var r=null;try{this.chownSync(t,e)}catch(t){r=t}finally{i(r)}},e.prototype.chownSync=function(t,e){try{this._FS.fchown(this._stream.fd,t,e)}catch(t){throw Ne(t,this._path)}},e.prototype.chmod=function(t,e){var i=null;try{this.chmodSync(t)}catch(t){i=t}finally{e(i)}},e.prototype.chmodSync=function(t){try{this._FS.fchmod(this._stream.fd,t)}catch(t){throw Ne(t,this._path)}},e.prototype.utimes=function(t,e,i){var r=null;try{this.utimesSync(t,e)}catch(t){r=t}finally{i(r)}},e.prototype.utimesSync=function(t,e){this._fs.utimesSync(this._path,t,e)},e}(J),Le=function(e){function i(t){e.call(this),this._FS=t}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.Create=function(t,e){e(null,new i(t.FS))},i.isAvailable=function(){return!0},i.prototype.getName=function(){return this._FS.DB_NAME()},i.prototype.isReadOnly=function(){return!1},i.prototype.supportsLinks=function(){return!0},i.prototype.supportsProps=function(){return!0},i.prototype.supportsSynch=function(){return!0},i.prototype.renameSync=function(t,e){try{this._FS.rename(t,e)}catch(i){throw i.errno===a.ENOENT?Ne(i,this.existsSync(t)?e:t):Ne(i)}},i.prototype.statSync=function(t,e){try{var i=e?this._FS.lstat(t):this._FS.stat(t),r=this.modeToFileType(i.mode);return new m(r,i.size,i.mode,i.atime,i.mtime,i.ctime)}catch(e){throw Ne(e,t)}},i.prototype.openSync=function(t,e,i){try{var r=this._FS.open(t,e.getFlagString(),i);if(this._FS.isDir(r.node.mode))throw this._FS.close(r),h.EISDIR(t);return new De(this,this._FS,t,r)}catch(e){throw Ne(e,t)}},i.prototype.unlinkSync=function(t){try{this._FS.unlink(t)}catch(e){throw Ne(e,t)}},i.prototype.rmdirSync=function(t){try{this._FS.rmdir(t)}catch(e){throw Ne(e,t)}},i.prototype.mkdirSync=function(t,e){try{this._FS.mkdir(t,e)}catch(e){throw Ne(e,t)}},i.prototype.readdirSync=function(t){try{return this._FS.readdir(t).filter((function(t){return"."!==t&&".."!==t}))}catch(e){throw Ne(e,t)}},i.prototype.truncateSync=function(t,e){try{this._FS.truncate(t,e)}catch(e){throw Ne(e,t)}},i.prototype.readFileSync=function(t,e,i){try{var r=L(this._FS.readFile(t,{flags:i.getFlagString()}));return e?r.toString(e):r}catch(e){throw Ne(e,t)}},i.prototype.writeFileSync=function(e,i,r,n,o){try{r&&(i=t.from(i,r));var a=N(i);this._FS.writeFile(e,a,{flags:n.getFlagString(),encoding:"binary"}),this._FS.chmod(e,o)}catch(t){throw Ne(t,e)}},i.prototype.chmodSync=function(t,e,i){try{e?this._FS.lchmod(t,i):this._FS.chmod(t,i)}catch(e){throw Ne(e,t)}},i.prototype.chownSync=function(t,e,i,r){try{e?this._FS.lchown(t,i,r):this._FS.chown(t,i,r)}catch(e){throw Ne(e,t)}},i.prototype.symlinkSync=function(t,e,i){try{this._FS.symlink(t,e)}catch(t){throw Ne(t)}},i.prototype.readlinkSync=function(t){try{return this._FS.readlink(t)}catch(e){throw Ne(e,t)}},i.prototype.utimesSync=function(t,e,i){try{this._FS.utime(t,e.getTime(),i.getTime())}catch(e){throw Ne(e,t)}},i.prototype.modeToFileType=function(t){if(this._FS.isDir(t))return p.DIRECTORY;if(this._FS.isFile(t))return p.FILE;if(this._FS.isLink(t))return p.SYMLINK;throw h.EPERM("Invalid mode: "+t)},i}($);Le.Name="EmscriptenFileSystem",Le.Options={FS:{type:"object",description:"The Emscripten file system to use (the `FS` variable)"}};var Be=function(t){function e(e,i){t.call(this),this._folder=e,this._wrapped=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){i(null,new e(t.folder,t.wrapped))},e.isAvailable=function(){return!0},e.prototype.initialize=function(t){var e=this;this._wrapped.exists(this._folder,(function(i){i?t():e._wrapped.isReadOnly()?t(h.ENOENT(e._folder)):e._wrapped.mkdir(e._folder,511,t)}))},e.prototype.getName=function(){return this._wrapped.getName()},e.prototype.isReadOnly=function(){return this._wrapped.isReadOnly()},e.prototype.supportsProps=function(){return this._wrapped.supportsProps()},e.prototype.supportsSynch=function(){return this._wrapped.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e}(Z);function Fe(t,e){if(null!==e&&"object"==typeof e){var i=e,r=i.path;r&&(r="/"+c.relative(t,r),i.message=i.message.replace(i.path,r),i.path=r)}return e}function Ue(t,e,i){return"Sync"!==t.slice(t.length-4)?function(){var r,n;return arguments.length>0&&(e&&(arguments[0]=c.join(this._folder,arguments[0])),i&&(arguments[1]=c.join(this._folder,arguments[1])),arguments[arguments.length-1]=(r=this._folder,"function"==typeof(n=arguments[arguments.length-1])?function(t){arguments.length>0&&(arguments[0]=Fe(r,t)),n.apply(null,arguments)}:n)),this._wrapped[t].apply(this._wrapped,arguments)}:function(){try{return e&&(arguments[0]=c.join(this._folder,arguments[0])),i&&(arguments[1]=c.join(this._folder,arguments[1])),this._wrapped[t].apply(this._wrapped,arguments)}catch(t){throw Fe(this._folder,t)}}}Be.Name="FolderAdapter",Be.Options={folder:{type:"string",description:"The folder to use as the root directory"},wrapped:{type:"object",description:"The file system to wrap"}},["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach((function(t){Be.prototype[t]=Ue(t,!0,!1)})),["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach((function(t){Be.prototype[t]=Ue(t,!0,!0)}));var ze="undefined"!=typeof window?window:"undefined"!=typeof self?self:r,qe=ze.webkitRequestFileSystem||ze.requestFileSystem||null;function Ke(t,e,i){switch(t.name){case"PathExistsError":return h.EEXIST(e);case"QuotaExceededError":return h.FileError(a.ENOSPC,e);case"NotFoundError":return h.ENOENT(e);case"SecurityError":return h.FileError(a.EACCES,e);case"InvalidModificationError":return h.FileError(a.EPERM,e);case"TypeMismatchError":return h.FileError(i?a.ENOTDIR:a.EISDIR,e);default:return h.FileError(a.EINVAL,e)}}var He=function(t){function e(e,i,r,n,o,a){t.call(this,e,r,n,o,a),this._entry=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(!this.isDirty())return t();this._entry.createWriter((function(i){var r=e.getBuffer(),n=new Blob([I(r)]),o=n.size;i.onwriteend=function(r){i.onwriteend=null,i.onerror=null,i.truncate(o),e.resetDirty(),t()},i.onerror=function(i){t(Ke(i,e.getPath(),!1))},i.write(n)}))},e.prototype.close=function(t){this.sync(t)},e}(X),We=function(t){function e(i,r,n){void 0===i&&(i=5),void 0===r&&(r=ze.PERSISTENT),void 0===n&&(n=!0),t.call(this),this.size=1048576*i,this.type=r,A(n,e.Name,{size:i,type:r})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){var r=new e(t.size,t.type,!1);r.allocate((function(t){return t?i(t):i(null,r)}),!1)},e.isAvailable=function(){return!!qe},e.prototype.getName=function(){return e.Name},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.allocate=function(t,e){var i=this;void 0===t&&(t=function(){}),void 0===e&&(e=!0),e&&console.warn("[HTML5FS] HTML5FS.allocate() is deprecated and will be removed in the next major release. Please use 'HTML5FS.Create({type: "+this.type+", size: "+this.size+"}, cb)' to create and allocate HTML5FS instances.");var r=function(e){i.fs=e,t()},n=function(e){t(Ke(e,"/",!0))};this.type===ze.PERSISTENT?function(t,e,i,r){if(void 0!==navigator.webkitPersistentStorage)switch(t){case ze.PERSISTENT:navigator.webkitPersistentStorage.requestQuota(e,i,r);break;case ze.TEMPORARY:navigator.webkitTemporaryStorage.requestQuota(e,i,r);break;default:r(new TypeError("Invalid storage type: "+t))}else ze.webkitStorageInfo.requestQuota(t,e,i,r)}(this.type,this.size,(function(t){qe(i.type,t,r,n)}),n):qe(this.type,this.size,r,n)},e.prototype.empty=function(t){this._readdir("/",(function(e,i){e?(console.error("Failed to empty FS"),t(e)):je(i,(function(t,e){var i=function(){e()},r=function(i){e(Ke(i,t.fullPath,!t.isDirectory))};!function(t){return t.isDirectory}(t)?t.remove(i,r):t.removeRecursively(i,r)}),(function(i){e?(console.error("Failed to empty FS"),t(e)):t()}))}))},e.prototype.rename=function(t,e,i){var r=this,n=2,o=0,s=this.fs.root,u=t,l=function(t){--n<=0&&i(Ke(t,u,!1))},f=function(n){return 2==++o?i(new h(a.EINVAL,"Something was identified as both a file and a directory. This should never happen.")):t===e?i():(u=c.dirname(e),void s.getDirectory(u,{},(function(o){u=c.basename(e),n.moveTo(o,u,(function(t){i()}),(function(o){n.isDirectory?(u=e,r.unlink(e,(function(n){n?l(o):r.rename(t,e,i)}))):l(o)}))}),l))};s.getFile(t,{},f,l),s.getDirectory(t,{},f,l)},e.prototype.stat=function(t,e,i){var r=this,n={create:!1},o=function(t){var e=new m(p.DIRECTORY,4096);i(null,e)},a=function(e){i(Ke(e,t,!1))};this.fs.root.getFile(t,n,(function(t){t.file((function(t){var e=new m(p.FILE,t.size);i(null,e)}),a)}),(function(){r.fs.root.getDirectory(t,n,o,a)}))},e.prototype.open=function(t,e,i,r){var n=this,o=function(i){"InvalidModificationError"===i.name&&e.isExclusive()?r(h.EEXIST(t)):r(Ke(i,t,!1))};this.fs.root.getFile(t,{create:e.pathNotExistsAction()===l.CREATE_FILE,exclusive:e.isExclusive()},(function(i){i.file((function(a){var s=new FileReader;s.onloadend=function(o){var c=n._makeFile(t,i,e,a,s.result);r(null,c)},s.onerror=function(t){o(s.error)},s.readAsArrayBuffer(a)}),o)}),o)},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){var i=this;this.readdir(t,(function(r,n){r?e(r):n.length>0?e(h.ENOTEMPTY(t)):i._remove(t,e,!1)}))},e.prototype.mkdir=function(t,e,i){this.fs.root.getDirectory(t,{create:!0,exclusive:!0},(function(t){i()}),(function(e){i(Ke(e,t,!0))}))},e.prototype.readdir=function(t,e){this._readdir(t,(function(t,i){if(!i)return e(t);for(var r=[],n=0,o=i;n0)throw h.ENOTEMPTY(t);this.removeEntry(t,!0)},i.prototype.mkdirSync=function(e,i){var r=this.store.beginTransaction("readwrite"),n=t.from("{}");this.commitNewFile(r,e,p.DIRECTORY,i,n)},i.prototype.readdirSync=function(t){var e=this.store.beginTransaction("readonly");return Object.keys(this.getDirListing(e,t,this.findINode(e,t)))},i.prototype._syncSync=function(t,e,i){var r=this.store.beginTransaction("readwrite"),n=this._findINode(r,c.dirname(t),c.basename(t)),o=this.getINode(r,t,n),a=o.update(i);try{r.put(o.id,e,!0),a&&r.put(n,o.toBuffer(),!0)}catch(t){throw r.abort(),t}r.commit()},i.prototype.makeRootDirectory=function(){var t=this.store.beginTransaction("readwrite");if(void 0===t.get(Ve)){var e=(new Date).getTime(),i=new Ge(Je(),4096,511|p.DIRECTORY,e,e,e);t.put(i.id,$e(),!1),t.put(Ve,i.toBuffer(),!1),t.commit()}},i.prototype._findINode=function(t,e,i){var r=this,n=function(n){var o=r.getDirListing(t,e,n);if(o[i])return o[i];throw h.ENOENT(c.resolve(e,i))};return"/"===e?""===i?Ve:n(this.getINode(t,e,Ve)):n(this.getINode(t,e+c.sep+i,this._findINode(t,c.dirname(e),c.basename(e))))},i.prototype.findINode=function(t,e){return this.getINode(t,e,this._findINode(t,c.dirname(e),c.basename(e)))},i.prototype.getINode=function(t,e,i){var r=t.get(i);if(void 0===r)throw h.ENOENT(e);return Ge.fromBuffer(r)},i.prototype.getDirListing=function(t,e,i){if(!i.isDirectory())throw h.ENOTDIR(e);var r=t.get(i.id);if(void 0===r)throw h.ENOENT(e);return JSON.parse(r.toString())},i.prototype.addNewNode=function(t,e){for(var i;;)try{return i=Je(),t.put(i,e,!1),i}catch(t){}throw new h(a.EIO,"Unable to commit data to key-value store.")},i.prototype.commitNewFile=function(e,i,r,n,o){var a,s=c.dirname(i),u=c.basename(i),l=this.findINode(e,s),f=this.getDirListing(e,s,l),p=(new Date).getTime();if("/"===i)throw h.EEXIST(i);if(f[u])throw h.EEXIST(i);try{var d=this.addNewNode(e,o);a=new Ge(d,o.length,n|r,p,p,p);var m=this.addNewNode(e,a.toBuffer());f[u]=m,e.put(l.id,t.from(JSON.stringify(f)),!0)}catch(t){throw e.abort(),t}return e.commit(),a},i.prototype.removeEntry=function(e,i){var r=this.store.beginTransaction("readwrite"),n=c.dirname(e),o=this.findINode(r,n),a=this.getDirListing(r,n,o),s=c.basename(e);if(!a[s])throw h.ENOENT(e);var u=a[s];delete a[s];var l=this.getINode(r,e,u);if(!i&&l.isDirectory())throw h.EISDIR(e);if(i&&!l.isDirectory())throw h.ENOTDIR(e);try{r.del(l.id),r.del(u),r.put(o.id,t.from(JSON.stringify(a)),!0)}catch(t){throw r.abort(),t}r.commit()},i}($),ii=function(t){function e(e,i,r,n,o){t.call(this,e,i,r,n,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;this.isDirty()?this._fs._sync(this.getPath(),this.getBuffer(),this.getStats(),(function(i){i||e.resetDirty(),t(i)})):t()},e.prototype.close=function(t){this.sync(t)},e}(X),ri=function(e){function i(){e.apply(this,arguments)}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.isAvailable=function(){return!0},i.prototype.init=function(t,e){this.store=t,this.makeRootDirectory(e)},i.prototype.getName=function(){return this.store.name()},i.prototype.isReadOnly=function(){return!1},i.prototype.supportsSymlinks=function(){return!1},i.prototype.supportsProps=function(){return!1},i.prototype.supportsSynch=function(){return!1},i.prototype.empty=function(t){var e=this;this.store.clear((function(i){Xe(i,t)&&e.makeRootDirectory(t)}))},i.prototype.rename=function(e,i,r){var n=this,o=this.store.beginTransaction("readwrite"),s=c.dirname(e),u=c.basename(e),l=c.dirname(i),f=c.basename(i),p={},d={},m=!1;if(0===(l+"/").indexOf(e+"/"))return r(new h(a.EBUSY,s));var y=function(a){n.findINodeAndDirListing(o,a,(function(c,y,v){c?m||(m=!0,o.abort((function(){r(c)}))):(p[a]=y,d[a]=v,function(){if(!m&&d.hasOwnProperty(s)&&d.hasOwnProperty(l)){var a=d[s],c=p[s],y=d[l],v=p[l];if(a[u]){var g=a[u];delete a[u];var b=function(){y[f]=g,o.put(c.id,t.from(JSON.stringify(a)),!0,(function(e){Ye(e,o,r)&&(s===l?o.commit(r):o.put(v.id,t.from(JSON.stringify(y)),!0,(function(t){Ye(t,o,r)&&o.commit(r)})))}))};y[f]?n.getINode(o,i,y[f],(function(t,e){Ye(t,o,r)&&(e.isFile()?o.del(e.id,(function(t){Ye(t,o,r)&&o.del(y[f],(function(t){Ye(t,o,r)&&b()}))})):o.abort((function(t){r(h.EPERM(i))})))})):b()}else r(h.ENOENT(e))}}())}))};y(s),s!==l&&y(l)},i.prototype.stat=function(t,e,i){var r=this.store.beginTransaction("readonly");this.findINode(r,t,(function(t,e){Xe(t,i)&&i(null,e.toStats())}))},i.prototype.createFile=function(t,e,i,r){var n=this,o=this.store.beginTransaction("readwrite"),a=z();this.commitNewFile(o,t,p.FILE,i,a,(function(i,o){Xe(i,r)&&r(null,new ii(n,t,e,o.toStats(),a))}))},i.prototype.openFile=function(t,e,i){var r=this,n=this.store.beginTransaction("readonly");this.findINode(n,t,(function(o,a){Xe(o,i)&&n.get(a.id,(function(n,o){Xe(n,i)&&(void 0===o?i(h.ENOENT(t)):i(null,new ii(r,t,e,a.toStats(),o)))}))}))},i.prototype.unlink=function(t,e){this.removeEntry(t,!1,e)},i.prototype.rmdir=function(t,e){var i=this;this.readdir(t,(function(r,n){r?e(r):n.length>0?e(h.ENOTEMPTY(t)):i.removeEntry(t,!0,e)}))},i.prototype.mkdir=function(e,i,r){var n=this.store.beginTransaction("readwrite"),o=t.from("{}");this.commitNewFile(n,e,p.DIRECTORY,i,o,r)},i.prototype.readdir=function(t,e){var i=this,r=this.store.beginTransaction("readonly");this.findINode(r,t,(function(n,o){Xe(n,e)&&i.getDirListing(r,t,o,(function(t,i){Xe(t,e)&&e(null,Object.keys(i))}))}))},i.prototype._sync=function(t,e,i,r){var n=this,o=this.store.beginTransaction("readwrite");this._findINode(o,c.dirname(t),c.basename(t),(function(a,s){Ye(a,o,r)&&n.getINode(o,t,s,(function(t,n){if(Ye(t,o,r)){var a=n.update(i);o.put(n.id,e,!0,(function(t){Ye(t,o,r)&&(a?o.put(s,n.toBuffer(),!0,(function(t){Ye(t,o,r)&&o.commit(r)})):o.commit(r))}))}}))}))},i.prototype.makeRootDirectory=function(t){var e=this.store.beginTransaction("readwrite");e.get(Ve,(function(i,r){if(i||void 0===r){var n=(new Date).getTime(),o=new Ge(Je(),4096,511|p.DIRECTORY,n,n,n);e.put(o.id,$e(),!1,(function(i){Ye(i,e,t)&&e.put(Ve,o.toBuffer(),!1,(function(i){i?e.abort((function(){t(i)})):e.commit(t)}))}))}else e.commit(t)}))},i.prototype._findINode=function(t,e,i,r){var n=this,o=function(t,n,o){t?r(t):o[i]?r(null,o[i]):r(h.ENOENT(c.resolve(e,i)))};"/"===e?""===i?r(null,Ve):this.getINode(t,e,Ve,(function(i,a){Xe(i,r)&&n.getDirListing(t,e,a,(function(t,e){o(t,0,e)}))})):this.findINodeAndDirListing(t,e,o)},i.prototype.findINode=function(t,e,i){var r=this;this._findINode(t,c.dirname(e),c.basename(e),(function(n,o){Xe(n,i)&&r.getINode(t,e,o,i)}))},i.prototype.getINode=function(t,e,i,r){t.get(i,(function(t,i){Xe(t,r)&&(void 0===i?r(h.ENOENT(e)):r(null,Ge.fromBuffer(i)))}))},i.prototype.getDirListing=function(t,e,i,r){i.isDirectory()?t.get(i.id,(function(t,i){if(Xe(t,r))try{r(null,JSON.parse(i.toString()))}catch(t){r(h.ENOENT(e))}})):r(h.ENOTDIR(e))},i.prototype.findINodeAndDirListing=function(t,e,i){var r=this;this.findINode(t,e,(function(n,o){Xe(n,i)&&r.getDirListing(t,e,o,(function(t,e){Xe(t,i)&&i(null,o,e)}))}))},i.prototype.addNewNode=function(t,e,i){var r,n=0,o=function(){5==++n?i(new h(a.EIO,"Unable to commit data to key-value store.")):(r=Je(),t.put(r,e,!1,(function(t,e){t||!e?o():i(null,r)})))};o()},i.prototype.commitNewFile=function(e,i,r,n,o,a){var s=this,u=c.dirname(i),l=c.basename(i),f=(new Date).getTime();if("/"===i)return a(h.EEXIST(i));this.findINodeAndDirListing(e,u,(function(c,u,p){Ye(c,e,a)&&(p[l]?e.abort((function(){a(h.EEXIST(i))})):s.addNewNode(e,o,(function(i,c){if(Ye(i,e,a)){var h=new Ge(c,o.length,n|r,f,f,f);s.addNewNode(e,h.toBuffer(),(function(i,r){Ye(i,e,a)&&(p[l]=r,e.put(u.id,t.from(JSON.stringify(p)),!0,(function(t){Ye(t,e,a)&&e.commit((function(t){Ye(t,e,a)&&a(null,h)}))})))}))}})))}))},i.prototype.removeEntry=function(e,i,r){var n=this,o=this.store.beginTransaction("readwrite"),a=c.dirname(e),s=c.basename(e);this.findINodeAndDirListing(o,a,(function(a,c,u){if(Ye(a,o,r))if(u[s]){var l=u[s];delete u[s],n.getINode(o,e,l,(function(n,a){Ye(n,o,r)&&(!i&&a.isDirectory()?o.abort((function(){r(h.EISDIR(e))})):i&&!a.isDirectory()?o.abort((function(){r(h.ENOTDIR(e))})):o.del(a.id,(function(e){Ye(e,o,r)&&o.del(l,(function(e){Ye(e,o,r)&&o.put(c.id,t.from(JSON.stringify(u)),!0,(function(t){Ye(t,o,r)&&o.commit(r)}))}))})))}))}else o.abort((function(){r(h.ENOENT(e))}))}))},i}(Z),ni=function(){this.store={}};ni.prototype.name=function(){return oi.Name},ni.prototype.clear=function(){this.store={}},ni.prototype.beginTransaction=function(t){return new Qe(this)},ni.prototype.get=function(t){return this.store[t]},ni.prototype.put=function(t,e,i){return!(!i&&this.store.hasOwnProperty(t)||(this.store[t]=e,0))},ni.prototype.del=function(t){delete this.store[t]};var oi=function(t){function e(){t.call(this,{store:new ni})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){i(null,new e)},e}(ei);oi.Name="InMemory",oi.Options={};var ai=ze.indexedDB||ze.mozIndexedDB||ze.webkitIndexedDB||ze.msIndexedDB;function si(t,e){switch(void 0===e&&(e=t.toString()),t.name){case"NotFoundError":return new h(a.ENOENT,e);case"QuotaExceededError":return new h(a.ENOSPC,e);default:return new h(a.EIO,e)}}function ci(t,e,i){return void 0===e&&(e=a.EIO),void 0===i&&(i=null),function(r){r.preventDefault(),t(new h(e,null!==i?i:void 0))}}var ui=function(t,e){this.tx=t,this.store=e};ui.prototype.get=function(t,e){try{var i=this.store.get(t);i.onerror=ci(e),i.onsuccess=function(t){var i=t.target.result;e(null,void 0===i?i:B(i))}}catch(t){e(si(t))}};var li=function(t){function e(e,i){t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e,i,r){try{var n,o=I(e);(n=i?this.store.put(o,t):this.store.add(o,t)).onerror=ci(r),n.onsuccess=function(t){r(null,!0)}}catch(t){r(si(t))}},e.prototype.del=function(t,e){try{var i=this.store.delete(t);i.onerror=ci(e),i.onsuccess=function(t){e()}}catch(t){e(si(t))}},e.prototype.commit=function(t){setTimeout(t,0)},e.prototype.abort=function(t){var e=null;try{this.tx.abort()}catch(t){e=si(t)}finally{t(e)}},e}(ui),hi=function(t,e){var i=this;void 0===e&&(e="browserfs"),this.storeName=e;var r=ai.open(this.storeName,1);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(i.storeName)&&e.deleteObjectStore(i.storeName),e.createObjectStore(i.storeName)},r.onsuccess=function(e){i.db=e.target.result,t(null,i)},r.onerror=ci(t,a.EACCES)};hi.prototype.name=function(){return fi.Name+" - "+this.storeName},hi.prototype.clear=function(t){try{var e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).clear();e.onsuccess=function(e){setTimeout(t,0)},e.onerror=ci(t)}catch(e){t(si(e))}},hi.prototype.beginTransaction=function(t){void 0===t&&(t="readonly");var e=this.db.transaction(this.storeName,t),i=e.objectStore(this.storeName);if("readwrite"===t)return new li(e,i);if("readonly"===t)return new ui(e,i);throw new h(a.EINVAL,"Invalid transaction type.")};var fi=function(t){function e(i,r,n){var o=this;void 0===n&&(n=!0),t.call(this),this.store=new hi((function(t){t?i(t):o.init(o.store,(function(t){i(t,o)}))}),r),A(n,e.Name,{storeName:r})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){new e(i,t.storeName,!1)},e.isAvailable=function(){try{return void 0!==ai&&null!==ai.open("__browserfs_test__")}catch(t){return!1}},e}(ri);fi.Name="IndexedDB",fi.Options={storeName:{type:"string",optional:!0,description:"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name."}};var pi,di=!1;try{ze.localStorage.setItem("__test__",String.fromCharCode(55296)),di=ze.localStorage.getItem("__test__")===String.fromCharCode(55296)}catch(t){di=!1}pi=di?"binary_string":"binary_string_ie",t.isEncoding(pi)||(pi="base64");var mi=function(){};mi.prototype.name=function(){return yi.Name},mi.prototype.clear=function(){ze.localStorage.clear()},mi.prototype.beginTransaction=function(t){return new Qe(this)},mi.prototype.get=function(e){try{var i=ze.localStorage.getItem(e);if(null!==i)return t.from(i,pi)}catch(t){}},mi.prototype.put=function(t,e,i){try{return!(!i&&null!==ze.localStorage.getItem(t)||(ze.localStorage.setItem(t,e.toString(pi)),0))}catch(t){throw new h(a.ENOSPC,"LocalStorage is full.")}},mi.prototype.del=function(t){try{ze.localStorage.removeItem(t)}catch(e){throw new h(a.EIO,"Unable to delete key "+t+": "+e)}};var yi=function(t){function e(){t.call(this,{store:new mi})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){i(null,new e)},e.isAvailable=function(){return void 0!==ze.localStorage},e}(ei);yi.Name="LocalStorage",yi.Options={};var vi=function(t){function e(){t.call(this),this.mountList=[],this.mntMap={},this.rootFs=new oi}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){var r=new e;Object.keys(t).forEach((function(e){r.mount(e,t[e])})),i(null,r)},e.isAvailable=function(){return!0},e.prototype.mount=function(t,e){if("/"!==t[0]&&(t="/"+t),t=c.resolve(t),this.mntMap[t])throw new h(a.EINVAL,"Mount point "+t+" is already taken.");R(t,511,this.rootFs),this.mntMap[t]=e,this.mountList.push(t),this.mountList=this.mountList.sort((function(t,e){return e.length-t.length}))},e.prototype.umount=function(t){if("/"!==t[0]&&(t="/"+t),t=c.resolve(t),!this.mntMap[t])throw new h(a.EINVAL,"Mount point "+t+" is already unmounted.");for(delete this.mntMap[t],this.mountList.splice(this.mountList.indexOf(t),1);"/"!==t&&0===this.rootFs.readdirSync(t).length;)this.rootFs.rmdirSync(t),t=c.dirname(t)},e.prototype._getFs=function(t){for(var e=this.mountList,i=e.length,r=0;r1?n.length:0))&&(t="/"),{fs:this.mntMap[n],path:t}}return{fs:this.rootFs,path:t}},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.standardizeError=function(t,e,i){var r=t.message.indexOf(e);return-1!==r&&(t.message=t.message.substr(0,r)+i+t.message.substr(r+e.length),t.path=i),t},e.prototype.rename=function(t,e,i){var r=this,n=this._getFs(t),o=this._getFs(e);return n.fs===o.fs?n.fs.rename(n.path,o.path,(function(a){a&&r.standardizeError(r.standardizeError(a,n.path,t),o.path,e),i(a)})):E.readFile(t,(function(r,n){if(r)return i(r);E.writeFile(e,n,(function(e){if(e)return i(e);E.unlink(t,i)}))}))},e.prototype.renameSync=function(t,e){var i=this._getFs(t),r=this._getFs(e);if(i.fs===r.fs)try{return i.fs.renameSync(i.path,r.path)}catch(n){throw this.standardizeError(this.standardizeError(n,i.path,t),r.path,e),n}var n=E.readFileSync(t);return E.writeFileSync(e,n),E.unlinkSync(t)},e.prototype.readdirSync=function(t){var e=this._getFs(t),i=null;if(e.fs!==this.rootFs)try{i=this.rootFs.readdirSync(t)}catch(t){}try{var r=e.fs.readdirSync(e.path);return null===i?r:r.concat(i.filter((function(t){return-1===r.indexOf(t)})))}catch(r){if(null===i)throw this.standardizeError(r,e.path,t);return i}},e.prototype.readdir=function(t,e){var i=this,r=this._getFs(t);r.fs.readdir(r.path,(function(n,o){if(r.fs!==i.rootFs)try{var a=i.rootFs.readdirSync(t);o=o?o.concat(a.filter((function(t){return-1===o.indexOf(t)}))):a}catch(o){if(n)return e(i.standardizeError(n,r.path,t))}else if(n)return e(i.standardizeError(n,r.path,t));e(null,o)}))},e.prototype.rmdirSync=function(t){var e=this._getFs(t);if(this._containsMountPt(t))throw h.ENOTEMPTY(t);try{e.fs.rmdirSync(e.path)}catch(i){throw this.standardizeError(i,e.path,t)}},e.prototype.rmdir=function(t,e){var i=this,r=this._getFs(t);this._containsMountPt(t)?e(h.ENOTEMPTY(t)):r.fs.rmdir(r.path,(function(n){e(n?i.standardizeError(n,r.path,t):null)}))},e.prototype._containsMountPt=function(t){for(var e=this.mountList,i=e.length,r=0;r=t.length&&n.slice(0,t.length)===t)return!0}return!1},e}(Z);function gi(t,e,i){return e?function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];var r=e[0],n=this._getFs(r);e[0]=n.path;try{return n.fs[t].apply(n.fs,e)}catch(t){throw this.standardizeError(t,n.path,r),t}}:function(){for(var e=this,i=[],r=arguments.length;r--;)i[r]=arguments[r];var n=i[0],o=this._getFs(n);if(i[0]=o.path,"function"==typeof i[i.length-1]){var a=i[i.length-1];i[i.length-1]=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];t.length>0&&t[0]instanceof h&&e.standardizeError(t[0],o.path,n),a.apply(null,t)}}return o.fs[t].apply(o.fs,i)}}vi.Name="MountableFileSystem",vi.Options={};for(var bi,wi=[["exists","unlink","readlink"],["stat","mkdir","realpath","truncate"],["open","readFile","chmod","utimes"],["chown"],["writeFile","appendFile"]],_i=0;_i0))return ki.shift()()};Ei.addEventListener?Ei.addEventListener("message",Ci,!0):Ei.attachEvent("onmessage",Ci)}else if(Ei.MessageChannel){var Ai=new Ei.MessageChannel;Ai.port1.onmessage=function(t){if(ki.length>0)return ki.shift()()},bi=function(t){ki.push(t),Ai.port2.postMessage("")}}else bi=function(t){return setTimeout(t,0)}}var Pi=bi,ji=function(){this._locked=!1,this._waiters=[]};ji.prototype.lock=function(t){this._locked?this._waiters.push(t):(this._locked=!0,t())},ji.prototype.unlock=function(){if(!this._locked)throw new Error("unlock of a non-locked mutex");var t=this._waiters.shift();t?Pi(t):this._locked=!1},ji.prototype.tryLock=function(){return!this._locked&&(this._locked=!0,!0)},ji.prototype.isLocked=function(){return this._locked};var Ti=function(t){this._fs=t,this._mu=new ji};Ti.prototype.getName=function(){return"LockedFS<"+this._fs.getName()+">"},Ti.prototype.getFSUnlocked=function(){return this._fs},Ti.prototype.initialize=function(t){this._fs.initialize(t)},Ti.prototype.diskSpace=function(t,e){this._fs.diskSpace(t,e)},Ti.prototype.isReadOnly=function(){return this._fs.isReadOnly()},Ti.prototype.supportsLinks=function(){return this._fs.supportsLinks()},Ti.prototype.supportsProps=function(){return this._fs.supportsProps()},Ti.prototype.supportsSynch=function(){return this._fs.supportsSynch()},Ti.prototype.rename=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.rename(t,e,(function(t){r._mu.unlock(),i(t)}))}))},Ti.prototype.renameSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.renameSync(t,e)},Ti.prototype.stat=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.stat(t,e,(function(t,e){r._mu.unlock(),i(t,e)}))}))},Ti.prototype.statSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.statSync(t,e)},Ti.prototype.open=function(t,e,i,r){var n=this;this._mu.lock((function(){n._fs.open(t,e,i,(function(t,e){n._mu.unlock(),r(t,e)}))}))},Ti.prototype.openSync=function(t,e,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.openSync(t,e,i)},Ti.prototype.unlink=function(t,e){var i=this;this._mu.lock((function(){i._fs.unlink(t,(function(t){i._mu.unlock(),e(t)}))}))},Ti.prototype.unlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.unlinkSync(t)},Ti.prototype.rmdir=function(t,e){var i=this;this._mu.lock((function(){i._fs.rmdir(t,(function(t){i._mu.unlock(),e(t)}))}))},Ti.prototype.rmdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.rmdirSync(t)},Ti.prototype.mkdir=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.mkdir(t,e,(function(t){r._mu.unlock(),i(t)}))}))},Ti.prototype.mkdirSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.mkdirSync(t,e)},Ti.prototype.readdir=function(t,e){var i=this;this._mu.lock((function(){i._fs.readdir(t,(function(t,r){i._mu.unlock(),e(t,r)}))}))},Ti.prototype.readdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readdirSync(t)},Ti.prototype.exists=function(t,e){var i=this;this._mu.lock((function(){i._fs.exists(t,(function(t){i._mu.unlock(),e(t)}))}))},Ti.prototype.existsSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.existsSync(t)},Ti.prototype.realpath=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.realpath(t,e,(function(t,e){r._mu.unlock(),i(t,e)}))}))},Ti.prototype.realpathSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.realpathSync(t,e)},Ti.prototype.truncate=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.truncate(t,e,(function(t){r._mu.unlock(),i(t)}))}))},Ti.prototype.truncateSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.truncateSync(t,e)},Ti.prototype.readFile=function(t,e,i,r){var n=this;this._mu.lock((function(){n._fs.readFile(t,e,i,(function(t,e){n._mu.unlock(),r(t,e)}))}))},Ti.prototype.readFileSync=function(t,e,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readFileSync(t,e,i)},Ti.prototype.writeFile=function(t,e,i,r,n,o){var a=this;this._mu.lock((function(){a._fs.writeFile(t,e,i,r,n,(function(t){a._mu.unlock(),o(t)}))}))},Ti.prototype.writeFileSync=function(t,e,i,r,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.writeFileSync(t,e,i,r,n)},Ti.prototype.appendFile=function(t,e,i,r,n,o){var a=this;this._mu.lock((function(){a._fs.appendFile(t,e,i,r,n,(function(t){a._mu.unlock(),o(t)}))}))},Ti.prototype.appendFileSync=function(t,e,i,r,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,i,r,n)},Ti.prototype.chmod=function(t,e,i,r){var n=this;this._mu.lock((function(){n._fs.chmod(t,e,i,(function(t){n._mu.unlock(),r(t)}))}))},Ti.prototype.chmodSync=function(t,e,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chmodSync(t,e,i)},Ti.prototype.chown=function(t,e,i,r,n){var o=this;this._mu.lock((function(){o._fs.chown(t,e,i,r,(function(t){o._mu.unlock(),n(t)}))}))},Ti.prototype.chownSync=function(t,e,i,r){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chownSync(t,e,i,r)},Ti.prototype.utimes=function(t,e,i,r){var n=this;this._mu.lock((function(){n._fs.utimes(t,e,i,(function(t){n._mu.unlock(),r(t)}))}))},Ti.prototype.utimesSync=function(t,e,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.utimesSync(t,e,i)},Ti.prototype.link=function(t,e,i){var r=this;this._mu.lock((function(){r._fs.link(t,e,(function(t){r._mu.unlock(),i(t)}))}))},Ti.prototype.linkSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.linkSync(t,e)},Ti.prototype.symlink=function(t,e,i,r){var n=this;this._mu.lock((function(){n._fs.symlink(t,e,i,(function(t){n._mu.unlock(),r(t)}))}))},Ti.prototype.symlinkSync=function(t,e,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,i)},Ti.prototype.readlink=function(t,e){var i=this;this._mu.lock((function(){i._fs.readlink(t,(function(t,r){i._mu.unlock(),e(t,r)}))}))},Ti.prototype.readlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readlinkSync(t)};var Ri="/.deletedFiles.log";function Ii(t){return 146|t}function Ni(t){return d.getFileFlag(t)}var Di,Li=function(t){function e(e,i,r,n,o){t.call(this,e,i,r,n,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;this.isDirty()?this._fs._syncAsync(this,(function(i){e.resetDirty(),t(i)})):t(null)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.close=function(t){this.sync(t)},e.prototype.closeSync=function(){this.syncSync()},e}(X),Bi=function(t){function e(e,i){if(t.call(this),this._isInitialized=!1,this._initializeCallbacks=[],this._deletedFiles={},this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this._deleteLogError=null,this._writable=e,this._readable=i,this._writable.isReadOnly())throw new h(a.EINVAL,"Writable file system must be writable.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getOverlayedFileSystems=function(){return{readable:this._readable,writable:this._writable}},e.prototype._syncAsync=function(t,e){var i=this;this.createParentDirectoriesAsync(t.getPath(),(function(r){if(r)return e(r);i._writable.writeFile(t.getPath(),t.getBuffer(),null,Ni("w"),t.getStats().mode,e)}))},e.prototype._syncSync=function(t){this.createParentDirectories(t.getPath()),this._writable.writeFileSync(t.getPath(),t.getBuffer(),null,Ni("w"),t.getStats().mode)},e.prototype.getName=function(){return Fi.Name},e.prototype.initialize=function(t){var e=this,i=this._initializeCallbacks,r=function(t){e._isInitialized=!t,e._initializeCallbacks=[],i.forEach((function(e){return e(t)}))};if(this._isInitialized)return t();i.push(t),1===i.length&&this._writable.readFile(Ri,"utf8",Ni("r"),(function(t,i){if(t){if(t.errno!==a.ENOENT)return r(t)}else e._deleteLog=i;e._reparseDeletionLog(),r()}))},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return this._readable.supportsSynch()&&this._writable.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._readable.supportsProps()&&this._writable.supportsProps()},e.prototype.getDeletionLog=function(){return this._deleteLog},e.prototype.restoreDeletionLog=function(t){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("")},e.prototype.rename=function(t,e,i){var r=this;if(this.checkInitAsync(i)&&!this.checkPathAsync(t,i)&&!this.checkPathAsync(e,i))return t===Ri||e===Ri?i(h.EPERM("Cannot rename deletion log.")):t===e?i():void this.stat(t,!1,(function(n,o){return n?i(n):r.stat(e,!1,(function(n,s){var u=r;function l(r){var n=r.shift();if(!n)return i();var o=c.resolve(t,n),a=c.resolve(e,n);u.rename(o,a,(function(t){if(t)return i(t);l(r)}))}var f=511;if(o.isDirectory()){if(n)return n.errno!==a.ENOENT?i(n):r._writable.exists(t,(function(n){if(n)return r._writable.rename(t,e,i);r._writable.mkdir(e,f,(function(e){if(e)return i(e);r._readable.readdir(t,(function(t,e){if(t)return i();l(e)}))}))}));if(f=s.mode,!s.isDirectory())return i(h.ENOTDIR(e));r.readdir(e,(function(n,o){if(o&&o.length)return i(h.ENOTEMPTY(e));r._readable.readdir(t,(function(t,e){if(t)return i();l(e)}))}))}if(s&&s.isDirectory())return i(h.EISDIR(e));r.readFile(t,null,Ni("r"),(function(n,a){return n?i(n):r.writeFile(e,a,null,Ni("w"),o.mode,(function(e){return e?i(e):r.unlink(t,i)}))}))}))}))},e.prototype.renameSync=function(t,e){var i=this;if(this.checkInitialized(),this.checkPath(t),this.checkPath(e),t===Ri||e===Ri)throw h.EPERM("Cannot rename deletion log.");var r=this.statSync(t,!1);if(r.isDirectory()){if(t===e)return;var n=511;if(this.existsSync(e)){var o=this.statSync(e,!1);if(n=o.mode,!o.isDirectory())throw h.ENOTDIR(e);if(this.readdirSync(e).length>0)throw h.ENOTEMPTY(e)}this._writable.existsSync(t)?this._writable.renameSync(t,e):this._writable.existsSync(e)||this._writable.mkdirSync(e,n),this._readable.existsSync(t)&&this._readable.readdirSync(t).forEach((function(r){i.renameSync(c.resolve(t,r),c.resolve(e,r))}))}else{if(this.existsSync(e)&&this.statSync(e,!1).isDirectory())throw h.EISDIR(e);this.writeFileSync(e,this.readFileSync(t,null,Ni("r")),null,Ni("w"),r.mode)}t!==e&&this.existsSync(t)&&this.unlinkSync(t)},e.prototype.stat=function(t,e,i){var r=this;this.checkInitAsync(i)&&this._writable.stat(t,e,(function(n,o){n&&n.errno===a.ENOENT?(r._deletedFiles[t]&&i(h.ENOENT(t)),r._readable.stat(t,e,(function(t,e){e&&((e=e.clone()).mode=Ii(e.mode)),i(t,e)}))):i(n,o)}))},e.prototype.statSync=function(t,e){this.checkInitialized();try{return this._writable.statSync(t,e)}catch(r){if(this._deletedFiles[t])throw h.ENOENT(t);var i=this._readable.statSync(t,e).clone();return i.mode=Ii(i.mode),i}},e.prototype.open=function(t,e,i,r){var n=this;this.checkInitAsync(r)&&!this.checkPathAsync(t,r)&&this.stat(t,!1,(function(o,a){if(!a)return e.pathNotExistsAction()===l.CREATE_FILE?n.createParentDirectoriesAsync(t,(function(o){return o?r(o):n._writable.open(t,e,i,r)})):r(h.ENOENT(t));switch(e.pathExistsAction()){case l.TRUNCATE_FILE:return n.createParentDirectoriesAsync(t,(function(o){if(o)return r(o);n._writable.open(t,e,i,r)}));case l.NOP:return n._writable.exists(t,(function(o){o?n._writable.open(t,e,i,r):((a=a.clone()).mode=i,n._readable.readFile(t,null,Ni("r"),(function(i,o){if(i)return r(i);-1===a.size&&(a.size=o.length);var s=new Li(n,t,e,a,o);r(null,s)})))}));default:return r(h.EEXIST(t))}}))},e.prototype.openSync=function(t,e,i){if(this.checkInitialized(),this.checkPath(t),t===Ri)throw h.EPERM("Cannot open deletion log.");if(!this.existsSync(t)){if(e.pathNotExistsAction()===l.CREATE_FILE)return this.createParentDirectories(t),this._writable.openSync(t,e,i);throw h.ENOENT(t)}switch(e.pathExistsAction()){case l.TRUNCATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,i);case l.NOP:if(this._writable.existsSync(t))return this._writable.openSync(t,e,i);var r=this._readable.readFileSync(t,null,Ni("r")),n=this._readable.statSync(t,!1).clone();return n.mode=i,new Li(this,t,e,n,r);default:throw h.EEXIST(t)}},e.prototype.unlink=function(t,e){var i=this;this.checkInitAsync(e)&&!this.checkPathAsync(t,e)&&this.exists(t,(function(r){if(!r)return e(h.ENOENT(t));i._writable.exists(t,(function(r){if(r)return i._writable.unlink(t,(function(r){if(r)return e(r);i.exists(t,(function(r){r&&i.deletePath(t),e(null)}))}));i.deletePath(t),e(null)}))}))},e.prototype.unlinkSync=function(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw h.ENOENT(t);this._writable.existsSync(t)&&this._writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)},e.prototype.rmdir=function(t,e){var i=this;if(this.checkInitAsync(e)){var r=function(){i.readdir(t,(function(r,n){return r?e(r):n.length?e(h.ENOTEMPTY(t)):(i.deletePath(t),void e(null))}))};this.exists(t,(function(n){if(!n)return e(h.ENOENT(t));i._writable.exists(t,(function(n){n?i._writable.rmdir(t,(function(n){if(n)return e(n);i._readable.exists(t,(function(t){t?r():e()}))})):r()}))}))}},e.prototype.rmdirSync=function(t){if(this.checkInitialized(),!this.existsSync(t))throw h.ENOENT(t);if(this._writable.existsSync(t)&&this._writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length>0)throw h.ENOTEMPTY(t);this.deletePath(t)}},e.prototype.mkdir=function(t,e,i){var r=this;this.checkInitAsync(i)&&this.exists(t,(function(n){if(n)return i(h.EEXIST(t));r.createParentDirectoriesAsync(t,(function(n){if(n)return i(n);r._writable.mkdir(t,e,i)}))}))},e.prototype.mkdirSync=function(t,e){if(this.checkInitialized(),this.existsSync(t))throw h.EEXIST(t);this.createParentDirectories(t),this._writable.mkdirSync(t,e)},e.prototype.readdir=function(t,e){var i=this;this.checkInitAsync(e)&&this.stat(t,!1,(function(r,n){return r?e(r):n.isDirectory()?void i._writable.readdir(t,(function(r,n){if(r&&"ENOENT"!==r.code)return e(r);!r&&n||(n=[]),i._readable.readdir(t,(function(r,o){!r&&o||(o=[]);var a={},s=n.concat(o.filter((function(e){return!i._deletedFiles[t+"/"+e]}))).filter((function(t){var e=!a[t];return a[t]=!0,e}));e(null,s)}))})):e(h.ENOTDIR(t))}))},e.prototype.readdirSync=function(t){var e=this;if(this.checkInitialized(),!this.statSync(t,!1).isDirectory())throw h.ENOTDIR(t);var i=[];try{i=i.concat(this._writable.readdirSync(t))}catch(t){}try{i=i.concat(this._readable.readdirSync(t).filter((function(i){return!e._deletedFiles[t+"/"+i]})))}catch(t){}var r={};return i.filter((function(t){var e=!r[t];return r[t]=!0,e}))},e.prototype.exists=function(t,e){var i=this;this.checkInitialized(),this._writable.exists(t,(function(r){if(r)return e(!0);i._readable.exists(t,(function(r){e(r&&!0!==i._deletedFiles[t])}))}))},e.prototype.existsSync=function(t){return this.checkInitialized(),this._writable.existsSync(t)||this._readable.existsSync(t)&&!0!==this._deletedFiles[t]},e.prototype.chmod=function(t,e,i,r){var n=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,(function(o){if(o)return r(o);n._writable.chmod(t,e,i,r)}))},e.prototype.chmodSync=function(t,e,i){var r=this;this.checkInitialized(),this.operateOnWritable(t,(function(){r._writable.chmodSync(t,e,i)}))},e.prototype.chown=function(t,e,i,r,n){var o=this;this.checkInitAsync(n)&&this.operateOnWritableAsync(t,(function(a){if(a)return n(a);o._writable.chown(t,e,i,r,n)}))},e.prototype.chownSync=function(t,e,i,r){var n=this;this.checkInitialized(),this.operateOnWritable(t,(function(){n._writable.chownSync(t,e,i,r)}))},e.prototype.utimes=function(t,e,i,r){var n=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,(function(o){if(o)return r(o);n._writable.utimes(t,e,i,r)}))},e.prototype.utimesSync=function(t,e,i){var r=this;this.checkInitialized(),this.operateOnWritable(t,(function(){r._writable.utimesSync(t,e,i)}))},e.prototype.deletePath=function(t){this._deletedFiles[t]=!0,this.updateLog("d"+t+"\n")},e.prototype.updateLog=function(t){var e=this;this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Ri,this._deleteLog,"utf8",d.getFileFlag("w"),420,(function(t){e._deleteLogUpdatePending=!1,t?e._deleteLogError=t:e._deleteLogUpdateNeeded&&(e._deleteLogUpdateNeeded=!1,e.updateLog(""))})))},e.prototype._reparseDeletionLog=function(){var t=this;this._deletedFiles={},this._deleteLog.split("\n").forEach((function(e){t._deletedFiles[e.slice(1)]="d"===e.slice(0,1)}))},e.prototype.checkInitialized=function(){if(!this._isInitialized)throw new h(a.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(null!==this._deleteLogError){var t=this._deleteLogError;throw this._deleteLogError=null,t}},e.prototype.checkInitAsync=function(t){if(!this._isInitialized)return t(new h(a.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")),!1;if(null!==this._deleteLogError){var e=this._deleteLogError;return this._deleteLogError=null,t(e),!1}return!0},e.prototype.checkPath=function(t){if(t===Ri)throw h.EPERM(t)},e.prototype.checkPathAsync=function(t,e){return t===Ri&&(e(h.EPERM(t)),!0)},e.prototype.createParentDirectoriesAsync=function(t,e){var i=c.dirname(t),r=[],n=this;function o(){if(!r.length)return e();var t=r.pop();n._readable.stat(t,!1,(function(i,r){if(!r)return e();n._writable.mkdir(t,r.mode,(function(t){if(t)return e(t);o()}))}))}this._writable.stat(i,!1,(function t(e,a){e?(r.push(i),i=c.dirname(i),n._writable.stat(i,!1,t)):o()}))},e.prototype.createParentDirectories=function(t){for(var e=this,i=c.dirname(t),r=[];!this._writable.existsSync(i);)r.push(i),i=c.dirname(i);(r=r.reverse()).forEach((function(t){e._writable.mkdirSync(t,e.statSync(t,!1).mode)}))},e.prototype.operateOnWritable=function(t,e){if(!this.existsSync(t))throw h.ENOENT(t);this._writable.existsSync(t)||this.copyToWritable(t),e()},e.prototype.operateOnWritableAsync=function(t,e){var i=this;this.exists(t,(function(r){if(!r)return e(h.ENOENT(t));i._writable.exists(t,(function(r){if(!r)return i.copyToWritableAsync(t,e);e()}))}))},e.prototype.copyToWritable=function(t){var e=this.statSync(t,!1);e.isDirectory()?this._writable.mkdirSync(t,e.mode):this.writeFileSync(t,this._readable.readFileSync(t,null,Ni("r")),null,Ni("w"),this.statSync(t,!1).mode)},e.prototype.copyToWritableAsync=function(t,e){var i=this;this.stat(t,!1,(function(r,n){return r?e(r):n.isDirectory()?i._writable.mkdir(t,n.mode,e):void i._readable.readFile(t,null,Ni("r"),(function(r,o){if(r)return e(r);i.writeFile(t,o,null,Ni("w"),n.mode,e)}))}))},e}(Z),Fi=function(t){function e(i,r,n){void 0===n&&(n=!0),t.call(this,new Bi(i,r)),A(n,e.Name,{readable:"readable file system",writable:"writable file system"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){try{var r=new e(t.writable,t.readable,!1);r.initialize((function(t){i(t,r)}),!1)}catch(t){i(t)}},e.isAvailable=function(){return Bi.isAvailable()},e.prototype.initialize=function(e,i){void 0===i&&(i=!0),i&&console.warn("[OverlayFS] OverlayFS.initialize() is deprecated and will be removed in the next major release. Please use 'OverlayFS.Create({readable: readable file system instance, writable: writable file system instance}, cb)' to create and initialize OverlayFS instances."),t.prototype.initialize.call(this,e)},e.prototype.getOverlayedFileSystems=function(){return t.prototype.getFSUnlocked.call(this).getOverlayedFileSystems()},e.prototype.unwrap=function(){return t.prototype.getFSUnlocked.call(this)},e}(Ti);Fi.Name="OverlayFS",Fi.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}},function(t){t[t.CB=0]="CB",t[t.FD=1]="FD",t[t.API_ERROR=2]="API_ERROR",t[t.STATS=3]="STATS",t[t.PROBE=4]="PROBE",t[t.FILEFLAG=5]="FILEFLAG",t[t.BUFFER=6]="BUFFER",t[t.ERROR=7]="ERROR"}(Di||(Di={}));var Ui=function(){this._callbacks={},this._nextId=0};Ui.prototype.toRemoteArg=function(t){var e=this._nextId++;return this._callbacks[e]=t,{type:Di.CB,id:e}},Ui.prototype.toLocalArg=function(t){var e=this._callbacks[t];return delete this._callbacks[t],e};var zi=function(){this._fileDescriptors={},this._nextId=0};function qi(t){return{type:Di.API_ERROR,errorData:Ji(t.writeToBuffer())}}function Ki(t){return h.fromBuffer(Xi(t.errorData))}function Hi(t){return{type:Di.ERROR,name:t.name,message:t.message,stack:t.stack}}function Wi(t){var e=ze[t.name];"function"!=typeof e&&(e=Error);var i=new e(t.message);return i.stack=t.stack,i}function Gi(t){return{type:Di.STATS,statsData:Ji(t.toBuffer())}}function Vi(t){return m.fromBuffer(Xi(t.statsData))}function Zi(t){return{type:Di.FILEFLAG,flagStr:t.getFlagString()}}function $i(t){return d.getFileFlag(t.flagStr)}function Ji(t){return I(t)}function Xi(t){return B(t)}function Yi(t){return{type:Di.BUFFER,data:Ji(t)}}function Qi(t){return Xi(t.data)}zi.prototype.toRemoteArg=function(e,i,r,n){var o,a,s=this._nextId++;this._fileDescriptors[s]=e,e.stat((function(c,u){c?n(c):(a=Ji(u.toBuffer()),r.isReadable()?e.read(t.alloc(u.size),0,u.size,0,(function(t,e,c){t?n(t):(o=Ji(c),n(null,{type:Di.FD,id:s,data:o,stat:a,path:i,flag:r.getFlagString()}))})):n(null,{type:Di.FD,id:s,data:new ArrayBuffer(0),stat:a,path:i,flag:r.getFlagString()}))}))},zi.prototype.applyFdAPIRequest=function(t,e){var i=this,r=t.args[0];this._applyFdChanges(r,(function(n,o){n?e(n):o[t.method]((function(n){"close"===t.method&&delete i._fileDescriptors[r.id],e(n)}))}))},zi.prototype._applyFdChanges=function(t,e){var i=this._fileDescriptors[t.id],r=Xi(t.data),n=m.fromBuffer(Xi(t.stat)),o=d.getFileFlag(t.flag);o.isWriteable()?i.write(r,0,r.length,o.isAppendable()?i.getPos():0,(function(t){function a(){i.stat((function(t,r){t?e(t):r.mode!==n.mode?i.chmod(n.mode,(function(t){e(t,i)})):e(t,i)}))}t?e(t):o.isAppendable()?a():i.truncate(r.length,(function(){a()}))})):e(null,i)};var tr=function(t){function e(e,i,r,n,o,a){t.call(this,e,i,r,n,a),this._remoteFdId=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getRemoteFdId=function(){return this._remoteFdId},e.prototype.toRemoteArg=function(){return{type:Di.FD,id:this._remoteFdId,data:Ji(this.getBuffer()),stat:Ji(this.getStats().toBuffer()),path:this.getPath(),flag:this.getFlag().getFlagString()}},e.prototype.sync=function(t){this._syncClose("sync",t)},e.prototype.close=function(t){this._syncClose("close",t)},e.prototype._syncClose=function(t,e){var i=this;this.isDirty()?this._fs.syncClose(t,this,(function(t){t||i.resetDirty(),e(t)})):e()},e}(X),er=function(e){function i(t,r){var n=this;void 0===r&&(r=!0),e.call(this),this._callbackConverter=new Ui,this._isInitialized=!1,this._isReadOnly=!1,this._supportLinks=!1,this._supportProps=!1,this._worker=t,A(r,i.Name,{worker:"Web Worker instance"}),this._worker.addEventListener("message",(function(t){var e,i=t.data;if((e=i)&&"object"==typeof e&&e.hasOwnProperty("browserfsMessage")&&e.browserfsMessage){var r,o=i.args,a=new Array(o.length);for(r=0;r0&&(c=-1,n={browserfsMessage:!0,cbId:o,args:[qi(t)]},e.postMessage(n))}for(t=0;t0;){var n=void 0,o=r.pop(),a=o[0],s=o[1],c=o[2];for(var u in s)if(s.hasOwnProperty(u)){var l=s[u],h=a+"/"+u;l?(e._index[h]=n=new sr,r.push([h,l,n])):n=new ar(new m(p.FILE,-1,365)),c&&(c._ls[u]=n)}}return e},or.prototype.fileIterator=function(t){var e=this;for(var i in e._index)if(e._index.hasOwnProperty(i))for(var r=e._index[i],n=0,o=r.getListing();n0&&"/"!==r.charAt(r.length-1)&&(r+="/"),this.prefixUrl=r;var o=null;if("string"==typeof i){if(!(o=this._requestFileSync(i,"json")))throw new Error("Unable to find listing at URL: ${listingUrlOrObj}")}else o=i;A(n,e.Name,{index:"string"==typeof i?i:"file index as an object",baseUrl:r}),this._index=or.fromListing(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){void 0===t.index&&(t.index="index.json"),"string"==typeof t.index?e.FromURL(t.index,i,t.baseUrl,!1):i(null,new e(t.index,t.baseUrl,!1))},e.isAvailable=function(){return"undefined"!=typeof XMLHttpRequest&&null!==XMLHttpRequest},e.FromURL=function(t,i,r,n){void 0===r&&(r=t.slice(0,t.lastIndexOf("/")+1)),void 0===n&&(n=!0),n&&console.warn("[XmlHttpRequest] XmlHttpRequest.FromURL() is deprecated and will be removed in the next major release. Please use 'XmlHttpRequest.Create({ index: \""+t+'", baseUrl: "'+r+"\" }, cb)' instead."),rr(t,"json",(function(t,n){t?i(t):i(null,new e(n,r,!1))}))},e.prototype.empty=function(){this._index.fileIterator((function(t){t.fileData=null}))},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.preloadFile=function(t,e){var i=this._index.getInode(t);if(!cr(i))throw h.EISDIR(t);if(null===i)throw h.ENOENT(t);var r=i.getData();r.size=e.length,r.fileData=e},e.prototype.stat=function(t,e,i){var r,n=this._index.getInode(t);if(null===n)return i(h.ENOENT(t));cr(n)?(r=n.getData()).size<0?this._requestFileSizeAsync(t,(function(t,e){if(t)return i(t);r.size=e,i(null,r.clone())})):i(null,r.clone()):ur(n)?(r=n.getStats(),i(null,r)):i(h.FileError(a.EINVAL,t))},e.prototype.statSync=function(t,e){var i,r=this._index.getInode(t);if(null===r)throw h.ENOENT(t);if(cr(r))(i=r.getData()).size<0&&(i.size=this._requestFileSizeSync(t));else{if(!ur(r))throw h.FileError(a.EINVAL,t);i=r.getStats()}return i},e.prototype.open=function(t,e,i,r){if(e.isWriteable())return r(new h(a.EPERM,t));var n=this,o=this._index.getInode(t);if(null===o)return r(h.ENOENT(t));if(!cr(o))return r(h.EISDIR(t));var s=o.getData();switch(e.pathExistsAction()){case l.THROW_EXCEPTION:case l.TRUNCATE_FILE:return r(h.EEXIST(t));case l.NOP:if(s.fileData)return r(null,new Y(n,t,e,s.clone(),s.fileData));this._requestFileAsync(t,"buffer",(function(i,o){return i?r(i):(s.size=o.length,s.fileData=o,r(null,new Y(n,t,e,s.clone(),o)))}));break;default:return r(new h(a.EINVAL,"Invalid FileMode object."))}},e.prototype.openSync=function(t,e,i){if(e.isWriteable())throw new h(a.EPERM,t);var r=this._index.getInode(t);if(null===r)throw h.ENOENT(t);if(!cr(r))throw h.EISDIR(t);var n=r.getData();switch(e.pathExistsAction()){case l.THROW_EXCEPTION:case l.TRUNCATE_FILE:throw h.EEXIST(t);case l.NOP:if(n.fileData)return new Y(this,t,e,n.clone(),n.fileData);var o=this._requestFileSync(t,"buffer");return n.size=o.length,n.fileData=o,new Y(this,t,e,n.clone(),o);default:throw new h(a.EINVAL,"Invalid FileMode object.")}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(null===e)throw h.ENOENT(t);if(ur(e))return e.getListing();throw h.ENOTDIR(t)},e.prototype.readFile=function(t,e,i,r){var n=r;this.open(t,i,420,(function(t,i){if(t)return r(t);r=function(t,e){i.close((function(i){return t||(t=i),n(t,e)}))};var o=i.getBuffer();null===e?r(t,F(o)):function(t,e,i){try{i(null,t.toString(e))}catch(t){i(t)}}(o,e,r)}))},e.prototype.readFileSync=function(t,e,i){var r=this.openSync(t,i,420);try{var n=r.getBuffer();return null===e?F(n):n.toString(e)}finally{r.closeSync()}},e.prototype.getXhrPath=function(t){return"/"===t.charAt(0)&&(t=t.slice(1)),this.prefixUrl+t},e.prototype._requestFileAsync=function(t,e,i){rr(this.getXhrPath(t),e,i)},e.prototype._requestFileSync=function(t,e){return nr(this.getXhrPath(t),e)},e.prototype._requestFileSizeAsync=function(t,e){!function(t,e){ir(!0,t,e)}(this.getXhrPath(t),e)},e.prototype._requestFileSizeSync=function(t){return e=this.getXhrPath(t),i=-1,ir(!1,e,(function(t,e){if(t)throw t;i=e})),i;var e,i},e}(Z);lr.Name="XmlHttpRequest",lr.Options={index:{type:["string","object"],optional:!0,description:"URL to a file index as a JSON file or the file index object itself, generated with the make_xhrfs_index script. Defaults to `index.json`."},baseUrl:{type:"string",optional:!0,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}};var hr=function(){};hr.str2byte=function(t,e){for(var i=t.length>e.length?e.length:t.length,r=0;r127){var o=hr.extendedChars.indexOf(t.charAt(r));o>-1&&(n=o+128)}e[n]=r}return i},hr.byte2str=function(t){for(var e=new Array(t.length),i=0;i127?hr.extendedChars[r-128]:String.fromCharCode(r)}return e.join("")},hr.byteLength=function(t){return t.length},hr.extendedChars=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];var fr,pr,dr=i(31).inflateRaw,mr={};function yr(t,e){return new Date(1980+(e>>9),(e>>5&15)-1,31&e,t>>11,t>>5&63,31&t)}function vr(t,e,i,r){return 0===r?"":e?t.toString("utf8",i,i+r):hr.byte2str(t.slice(i,i+r))}!function(t){t[t.MSDOS=0]="MSDOS",t[t.AMIGA=1]="AMIGA",t[t.OPENVMS=2]="OPENVMS",t[t.UNIX=3]="UNIX",t[t.VM_CMS=4]="VM_CMS",t[t.ATARI_ST=5]="ATARI_ST",t[t.OS2_HPFS=6]="OS2_HPFS",t[t.MAC=7]="MAC",t[t.Z_SYSTEM=8]="Z_SYSTEM",t[t.CP_M=9]="CP_M",t[t.NTFS=10]="NTFS",t[t.MVS=11]="MVS",t[t.VSE=12]="VSE",t[t.ACORN_RISC=13]="ACORN_RISC",t[t.VFAT=14]="VFAT",t[t.ALT_MVS=15]="ALT_MVS",t[t.BEOS=16]="BEOS",t[t.TANDEM=17]="TANDEM",t[t.OS_400=18]="OS_400",t[t.OSX=19]="OSX"}(fr||(fr={})),function(t){t[t.STORED=0]="STORED",t[t.SHRUNK=1]="SHRUNK",t[t.REDUCED_1=2]="REDUCED_1",t[t.REDUCED_2=3]="REDUCED_2",t[t.REDUCED_3=4]="REDUCED_3",t[t.REDUCED_4=5]="REDUCED_4",t[t.IMPLODE=6]="IMPLODE",t[t.DEFLATE=8]="DEFLATE",t[t.DEFLATE64=9]="DEFLATE64",t[t.TERSE_OLD=10]="TERSE_OLD",t[t.BZIP2=12]="BZIP2",t[t.LZMA=14]="LZMA",t[t.TERSE_NEW=18]="TERSE_NEW",t[t.LZ77=19]="LZ77",t[t.WAVPACK=97]="WAVPACK",t[t.PPMD=98]="PPMD"}(pr||(pr={}));var gr=function(t){if(this.data=t,67324752!==t.readUInt32LE(0))throw new h(a.EINVAL,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))};gr.prototype.versionNeeded=function(){return this.data.readUInt16LE(4)},gr.prototype.flags=function(){return this.data.readUInt16LE(6)},gr.prototype.compressionMethod=function(){return this.data.readUInt16LE(8)},gr.prototype.lastModFileTime=function(){return yr(this.data.readUInt16LE(10),this.data.readUInt16LE(12))},gr.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(10)},gr.prototype.crc32=function(){return this.data.readUInt32LE(14)},gr.prototype.fileNameLength=function(){return this.data.readUInt16LE(26)},gr.prototype.extraFieldLength=function(){return this.data.readUInt16LE(28)},gr.prototype.fileName=function(){return vr(this.data,this.useUTF8(),30,this.fileNameLength())},gr.prototype.extraField=function(){var t=30+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},gr.prototype.totalSize=function(){return 30+this.fileNameLength()+this.extraFieldLength()},gr.prototype.useUTF8=function(){return 2048==(2048&this.flags())};var br=function(t,e,i){this.header=t,this.record=e,this.data=i};br.prototype.decompress=function(){var t=this.header.compressionMethod(),e=mr[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());var i=pr[t];throw i||(i="Unknown: "+t),new h(a.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+i)},br.prototype.getHeader=function(){return this.header},br.prototype.getRecord=function(){return this.record},br.prototype.getRawData=function(){return this.data};var wr=function(t){this.data=t};wr.prototype.crc32=function(){return this.data.readUInt32LE(0)},wr.prototype.compressedSize=function(){return this.data.readUInt32LE(4)},wr.prototype.uncompressedSize=function(){return this.data.readUInt32LE(8)};var _r=function(t){if(this.data=t,134630224!==this.data.readUInt32LE(0))throw new h(a.EINVAL,"Invalid archive extra data record signature: "+this.data.readUInt32LE(0))};_r.prototype.length=function(){return this.data.readUInt32LE(4)},_r.prototype.extraFieldData=function(){return this.data.slice(8,8+this.length())};var Sr=function(t){if(this.data=t,84233040!==this.data.readUInt32LE(0))throw new h(a.EINVAL,"Invalid digital signature signature: "+this.data.readUInt32LE(0))};Sr.prototype.size=function(){return this.data.readUInt16LE(4)},Sr.prototype.signatureData=function(){return this.data.slice(6,6+this.size())};var xr=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new h(a.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};xr.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},xr.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},xr.prototype.flag=function(){return this.data.readUInt16LE(8)},xr.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},xr.prototype.lastModFileTime=function(){return yr(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},xr.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},xr.prototype.crc32=function(){return this.data.readUInt32LE(16)},xr.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},xr.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},xr.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},xr.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},xr.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},xr.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},xr.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},xr.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},xr.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},xr.prototype.produceFilename=function(){return vr(this.data,this.useUTF8(),46,this.fileNameLength()).replace(/\\/g,"/")},xr.prototype.fileName=function(){return this._filename},xr.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},xr.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},xr.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return vr(this.data,this.useUTF8(),t,this.fileCommentLength())},xr.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},xr.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},xr.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},xr.prototype.isFile=function(){return!this.isDirectory()},xr.prototype.useUTF8=function(){return 2048==(2048&this.flag())},xr.prototype.isEncrypted=function(){return 1==(1&this.flag())},xr.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new gr(this.zipData.slice(t));return new br(e,this,this.zipData.slice(t+e.totalSize()))},xr.prototype.getData=function(){return this.getFileData().decompress()},xr.prototype.getRawData=function(){return this.getFileData().getRawData()},xr.prototype.getStats=function(){return new m(p.FILE,this.uncompressedSize(),365,new Date,this.lastModFileTime())};var Mr=function(t){if(this.data=t,101010256!==this.data.readUInt32LE(0))throw new h(a.EINVAL,"Invalid Zip file: End of central directory record has invalid signature: "+this.data.readUInt32LE(0))};Mr.prototype.diskNumber=function(){return this.data.readUInt16LE(4)},Mr.prototype.cdDiskNumber=function(){return this.data.readUInt16LE(6)},Mr.prototype.cdDiskEntryCount=function(){return this.data.readUInt16LE(8)},Mr.prototype.cdTotalEntryCount=function(){return this.data.readUInt16LE(10)},Mr.prototype.cdSize=function(){return this.data.readUInt32LE(12)},Mr.prototype.cdOffset=function(){return this.data.readUInt32LE(16)},Mr.prototype.cdZipCommentLength=function(){return this.data.readUInt16LE(20)},Mr.prototype.cdZipComment=function(){return vr(this.data,!0,22,this.cdZipCommentLength())},Mr.prototype.rawCdZipComment=function(){return this.data.slice(22,22+this.cdZipCommentLength())};var Er=function(t,e,i,r){this.index=t,this.directoryEntries=e,this.eocd=i,this.data=r},kr=function(t){function e(i,r,n){void 0===r&&(r=""),void 0===n&&(n=!0),t.call(this),this.name=r,this._index=new or,this._directoryEntries=[],this._eocd=null,A(n,e.Name,{zipData:"zip data as a Buffer",name:r}),i instanceof Er?(this._index=i.index,this._directoryEntries=i.directoryEntries,this._eocd=i.eocd,this.data=i.data):(this.data=i,this.populateIndex())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,i){try{e.computeIndex(t.zipData,(function(r){var n=new e(r,t.name,!1);i(null,n)}),!1)}catch(t){i(t)}},e.isAvailable=function(){return!0},e.RegisterDecompressionMethod=function(t,e){mr[t]=e},e.computeIndex=function(t,i,r){void 0===r&&(r=!0),r&&console.warn("[ZipFS] ZipFS.computeIndex is now deprecated, and will be removed in the next major release. Please update your code to use 'ZipFS.Create({ zipData: zip file as a Buffer}, cb)' instead.");var n=new or,o=e.getEOCD(t);if(o.diskNumber()!==o.cdDiskNumber())throw new h(a.EINVAL,"ZipFS does not support spanned zip files.");var s=o.cdOffset();if(4294967295===s)throw new h(a.EINVAL,"ZipFS does not support Zip64.");var c=s+o.cdSize();e.computeIndexResponsive(t,n,s,c,i,[],o)},e.getEOCD=function(t){for(var e=Math.min(65557,t.length-1),i=22;i-1},Lr.prototype.getRockRidgeOffset=function(){return this._rockRidgeOffset},Lr.prototype.rootCheckForRockRidge=function(t){var e=this.getDirectory(t);this._rockRidgeOffset=e.getDotEntry(t)._getRockRidgeOffset(t),this._rockRidgeOffset>-1&&(this._fileOrDir=null)},Lr.prototype.length=function(){return this._data[0]},Lr.prototype.extendedAttributeRecordLength=function(){return this._data[1]},Lr.prototype.lba=function(){return 2048*this._data.readUInt32LE(2)},Lr.prototype.dataLength=function(){return this._data.readUInt32LE(10)},Lr.prototype.recordingDate=function(){return Pr(this._data,18)},Lr.prototype.fileFlags=function(){return this._data[25]},Lr.prototype.fileUnitSize=function(){return this._data[26]},Lr.prototype.interleaveGapSize=function(){return this._data[27]},Lr.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(28)},Lr.prototype.identifier=function(){return this._getString(33,this._data[32])},Lr.prototype.fileName=function(t){if(this.hasRockRidge()){var e=this._rockRidgeFilename(t);if(null!==e)return e}var i=this.identifier();if(this.isDirectory(t))return i;var r=i.indexOf(";");return-1===r?i:"."===i[r-1]?i.slice(0,r-1):i.slice(0,r)},Lr.prototype.isDirectory=function(t){var e=!!(2&this.fileFlags());return!e&&this.hasRockRidge()&&(e=this.getSUEntries(t).filter((function(t){return t instanceof Qr})).length>0),e},Lr.prototype.isSymlink=function(t){return this.hasRockRidge()&&this.getSUEntries(t).filter((function(t){return t instanceof Jr})).length>0},Lr.prototype.getSymlinkPath=function(t){for(var e="",i=this.getSUEntries(t),r=this._getGetString(),n=0,o=i;n1&&"/"===e[e.length-1]?e.slice(0,e.length-1):e},Lr.prototype.getFile=function(t){if(this.isDirectory(t))throw new Error("Tried to get a File from a directory.");return null===this._fileOrDir&&(this._fileOrDir=t.slice(this.lba(),this.lba()+this.dataLength())),this._fileOrDir},Lr.prototype.getDirectory=function(t){if(!this.isDirectory(t))throw new Error("Tried to get a Directory from a file.");return null===this._fileOrDir&&(this._fileOrDir=this._constructDirectory(t)),this._fileOrDir},Lr.prototype.getSUEntries=function(t){return this._suEntries||this._constructSUEntries(t),this._suEntries},Lr.prototype._rockRidgeFilename=function(t){var e=this.getSUEntries(t).filter((function(t){return t instanceof Yr}));if(0===e.length||6&e[0].flags())return null;for(var i="",r=this._getGetString(),n=0,o=e;n0){var i=e[0];if(i instanceof Kr&&i.checkBytesPass())for(var r=1;ro)throw new RangeError("Invalid typed array length");var i=new Uint8Array(e);return i.__proto__=t.prototype,i}function t(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(t)}return s(t,e,i)}function s(e,i,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return F(e)?function(e,i,r){if(i<0||e.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function f(e,i){if(t.isBuffer(e))return e.length;if(U(e)||F(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(i){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(n)return D(e).length;i=(""+i).toLowerCase(),n=!0}}function p(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,i);case"utf8":case"utf-8":return M(this,e,i);case"ascii":return k(this,e,i);case"latin1":case"binary":return O(this,e,i);case"base64":return x(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function d(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function m(e,i,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof i&&(i=t.from(i,n)),t.isBuffer(i))return 0===i.length?-1:y(e,i,r,n,o);if("number"==typeof i)return i&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,i,r):Uint8Array.prototype.lastIndexOf.call(e,i,r):y(e,[i],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,r,n){var o,a=1,s=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,i/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var l=-1;for(o=i;os&&(i=s-c),o=i;o>=0;o--){for(var h=!0,f=0;fn&&(r=n):r=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,n=i%256,o.push(n),o.push(r);return o}(e,t.length-i),t,i,r)}function x(t,e,i){return 0===e&&i===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,i))}function M(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+h<=i)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[n+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=h}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var i="",r=0;r0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),""},t.prototype.compare=function(e,i,r,n,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),i<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&i>=r)return 0;if(n>=o)return-1;if(i>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(i>>>=0),c=Math.min(a,s),u=this.slice(n,o),l=e.slice(i,r),h=0;h>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,i);case"utf8":case"utf-8":return g(this,t,e,i);case"ascii":return b(this,t,e,i);case"latin1":case"binary":return w(this,t,e,i);case"base64":return _(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function k(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;nn)&&(i=n);for(var o="",a=e;ai)throw new RangeError("Trying to access beyond buffer length")}function j(e,i,r,n,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>o||ie.length)throw new RangeError("Index out of range")}function T(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function R(t,e,i,r,o){return e=+e,i>>>=0,o||T(t,0,i,4),n.write(t,e,i,r,23,4),i+4}function I(t,e,i,r,o){return e=+e,i>>>=0,o||T(t,0,i,8),n.write(t,e,i,r,52,8),i+8}t.prototype.slice=function(e,i){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(i=void 0===i?r:~~i)<0?(i+=r)<0&&(i=0):i>r&&(i=r),i>>=0,e>>>=0,i||P(t,e,this.length);for(var r=this[t],n=1,o=0;++o>>=0,e>>>=0,i||P(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(n*=256);)r+=this[t+--e]*n;return r},t.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);for(var r=this[t],n=1,o=0;++o=(n*=128)&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||P(t,e,this.length);for(var r=e,n=1,o=this[t+--r];r>0&&(n*=256);)o+=this[t+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},t.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},t.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},t.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),n.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),n.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||j(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,o=0;for(this[e]=255&t;++o>>=0,i>>>=0,r||j(this,t,e,i,Math.pow(2,8*i)-1,0);var n=i-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+i},t.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,1,255,0),this[e]=255&t,e+1},t.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},t.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},t.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},t.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},t.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);j(this,t,e,i,n-1,-n)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+i},t.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);j(this,t,e,i,n-1,-n)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},t.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},t.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},t.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},t.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},t.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},t.prototype.writeFloatLE=function(t,e,i){return R(this,t,e,!0,i)},t.prototype.writeFloatBE=function(t,e,i){return R(this,t,e,!1,i)},t.prototype.writeDoubleLE=function(t,e,i){return I(this,t,e,!0,i)},t.prototype.writeDoubleBE=function(t,e,i){return I(this,t,e,!1,i)},t.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--n)t[n+e]=this[n+i];else if(o<1e3)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=i;a55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function L(t){return r.toByteArray(function(t){if((t=t.trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,i,r){for(var n=0;n=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function F(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function U(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}}).call(e,i(1))},function(t,e){"use strict";e.byteLength=function(t){return 3*t.length/4-s(t)},e.toByteArray=function(t){var e,i,o,a,c,u,l=t.length;c=s(t),u=new n(3*l/4-c),o=c>0?l-4:l;var h=0;for(e=0,i=0;e>16&255,u[h++]=a>>8&255,u[h++]=255&a;return 2===c?(a=r[t.charCodeAt(e)]<<2|r[t.charCodeAt(e+1)]>>4,u[h++]=255&a):1===c&&(a=r[t.charCodeAt(e)]<<10|r[t.charCodeAt(e+1)]<<4|r[t.charCodeAt(e+2)]>>2,u[h++]=a>>8&255,u[h++]=255&a),u},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o="",a=[],s=16383,u=0,l=r-n;ul?l:u+s));return 1===n?(e=t[r-1],o+=i[e>>2],o+=i[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=i[e>>10],o+=i[e>>4&63],o+=i[e<<2&63],o+="="),a.push(o),a.join("")};for(var i=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t,e,r){for(var n,o,a=[],s=e;s>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,r,n){var o,a,s=8*n-r-1,c=(1<>1,l=-7,h=i?n-1:0,f=i?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,i,r,n,o){var a,s,c,u=8*o-n-1,l=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*c-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+p]=255&s,p+=d,s/=256,n-=8);for(a=a<0;t[i+p]=255&a,p+=d,a/=256,u-=8);t[i+p-d]|=128*m}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,i){"use strict";var r=new(i(7)),n={};function o(t){n[t]||("function"==typeof r[t]?n[t]=function(){return r[t].apply(r,arguments)}:n[t]=r[t])}for(var a in r)o(a);n.initializeTTYs=function(){null===r.stdin&&(r.initializeTTYs(),n.stdin=r.stdin,n.stdout=r.stdout,n.stderr=r.stderr)},r.nextTick((function(){n.initializeTTYs()})),t.exports=n},function(t,e,i){(function(e){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=i(8),o=null,a=function(){function t(t,e){this.fun=t,this.array=e}return t.prototype.run=function(){this.fun.apply(null,this.array)},t}(),s=function(){function t(){this._queue=[],this._draining=!1,this._currentQueue=null,this._queueIndex=-1}return t.prototype.push=function(t){var e=this;1!==this._queue.push(t)||this._draining||setTimeout((function(){return e._drainQueue()}),0)},t.prototype._cleanUpNextTick=function(){this._draining=!1,this._currentQueue&&this._currentQueue.length?this._queue=this._currentQueue.concat(this._queue):this._queueIndex=-1,this._queue.length&&this._drainQueue()},t.prototype._drainQueue=function(){var t=this;if(!this._draining){var e=setTimeout((function(){return t._cleanUpNextTick()}));this._draining=!0;for(var i=this._queue.length;i;){for(this._currentQueue=this._queue,this._queue=[];++this._queueIndex0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){if(!r(e))throw TypeError("listener must be a function");var i=!1;function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},i.prototype.removeListener=function(t,e){var i,o,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(i=this._events[t]).length,o=-1,i===e||r(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(n(i)){for(s=a;s-- >0;)if(i[s]===e||i[s].listener&&i[s].listener===e){o=s;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r(i=this._events[t]))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){(function(e){"use strict";var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,r=function(){function t(){}return t.normalize=function(e){""===e&&(e=".");for(var i=e.charAt(0)===t.sep,r=(e=t._removeDuplicateSeps(e)).split(t.sep),n=[],o=0;o0&&".."!==n[0])?n.pop():n.push(a))}return!i&&n.length<2&&(1===n.length?""===n[0]&&n.unshift("."):n.push(".")),e=n.join(t.sep),i&&e.charAt(0)!==t.sep&&(e=t.sep+e),e},t.join=function(){for(var e=[],i=0;i1&&s.charAt(s.length-1)===t.sep)return s.substr(0,s.length-1);if(s.charAt(0)!==t.sep){"."!==s.charAt(0)||1!==s.length&&s.charAt(1)!==t.sep||(s=1===s.length?"":s.substr(2));var c=e.cwd();s=""!==s?this.normalize(c+("/"!==c?t.sep:"")+s):c}return s},t.relative=function(e,i){var r;e=t.resolve(e),i=t.resolve(i);var n=e.split(t.sep),o=i.split(t.sep);o.shift(),n.shift();var a=0,s=[];for(r=0;rn.length&&(a=n.length);var c="";for(r=0;r1&&c.charAt(c.length-1)===t.sep&&(c=c.substr(0,c.length-1)),c},t.dirname=function(e){var i=(e=t._removeDuplicateSeps(e)).charAt(0)===t.sep,r=e.split(t.sep);return""===r.pop()&&r.length>0&&r.pop(),r.length>1||1===r.length&&!i?r.join(t.sep):i?t.sep:"."},t.basename=function(e,i){if(void 0===i&&(i=""),""===e)return e;var r=(e=t.normalize(e)).split(t.sep),n=r[r.length-1];return""===n&&r.length>1?r[r.length-2]:i.length>0&&n.substr(n.length-i.length)===i?n.substr(0,n.length-i.length):n},t.extname=function(e){var i=(e=t.normalize(e)).split(t.sep);if(""===(e=i.pop())&&i.length>0&&(e=i.pop()),".."===e)return"";var r=e.lastIndexOf(".");return-1===r||0===r?"":e.substr(r)},t.isAbsolute=function(e){return e.length>0&&e.charAt(0)===t.sep},t._makeLong=function(t){return t},t.parse=function(t){var e,r,n=(e=t,(r=i.exec(e)).shift(),r);return{root:n[0],dir:n[0]+n[1].slice(0,-1),base:n[2],ext:n[3],name:n[2].slice(0,n[2].length-n[3].length)}},t.format=function(e){if(null===e||"object"!=typeof e)throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);if("string"!=typeof(e.root||""))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+t.sep:"")+(e.base||"")},t._removeDuplicateSeps=function(t){return t=t.replace(this._replaceRegex,this.sep)},t.sep="/",t._replaceRegex=new RegExp("//+","g"),t.delimiter=":",t.posix=t,t.win32=t,t}();t.exports=r}).call(e,i(6))},function(t,e,i){(function(e){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=function(t){function i(){t.call(this),this.isRaw=!1,this.columns=80,this.rows=120,this.isTTY=!0,this._bufferedWrites=[],this._waitingForWrites=!1}return r(i,t),i.prototype.setRawMode=function(t){this.isRaw!==t&&(this.isRaw=t,this.emit("modeChange"))},i.prototype.changeColumns=function(t){t!==this.columns&&(this.columns=t,this.emit("resize"))},i.prototype.changeRows=function(t){t!==this.rows&&(this.rows=t,this.emit("resize"))},i.isatty=function(t){return t&&t instanceof i},i.prototype._write=function(t,i,r){var n;try{var o;o="string"==typeof t?new e(t,i):t,this._bufferedWrites.push(o),this._waitingForWrites&&this._read(1024)}catch(t){n=t}finally{r(n)}},i.prototype._read=function(t){if(0===this._bufferedWrites.length)this._waitingForWrites=!0;else for(;this._bufferedWrites.length>0&&(this._waitingForWrites=this.push(this._bufferedWrites.shift()),this._waitingForWrites););},i}(i(11).Duplex);t.exports=n}).call(e,i(1))},function(t,e,i){t.exports=n;var r=i(8).EventEmitter;function n(){r.call(this)}i(12)(n,r),n.Readable=i(13),n.Writable=i(27),n.Duplex=i(28),n.Transform=i(29),n.PassThrough=i(30),n.Stream=n,n.prototype.pipe=function(t,e){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(i.on("end",s),i.on("close",c));var a=!1;function s(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",s),i.removeListener("close",c),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",l),i.removeListener("close",l),t.removeListener("close",l)}return i.on("error",u),t.on("error",u),i.on("end",l),i.on("close",l),t.on("close",l),t.emit("pipe",i),t}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}},function(t,e,i){(function(r){var n=function(){try{return i(11)}catch(t){}}();(e=t.exports=i(14)).Stream=n||e,e.Readable=e,e.Writable=i(22),e.Duplex=i(21),e.Transform=i(25),e.PassThrough=i(26),!r.browser&&"disable"===r.env.READABLE_STREAM&&n&&(t.exports=n)}).call(e,i(6))},function(t,e,i){(function(e){"use strict";t.exports=y;var r,n=i(15),o=i(16);y.ReadableState=m,i(8).EventEmitter;var a,s=function(t,e){return t.listeners(e).length};!function(){try{a=i(11)}catch(t){}finally{a||(a=i(8).EventEmitter)}}();var c=i(2).Buffer,u=i(17),l=i(18);l.inherits=i(12);var h=i(19),f=void 0;f=h&&h.debuglog?h.debuglog("stream"):function(){};var p,d=i(20);function m(t,e){r=r||i(21),t=t||{},this.objectMode=!!t.objectMode,e instanceof r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:o,this.highWaterMark=~~this.highWaterMark,this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=i(24).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(r=r||i(21),!(this instanceof y))return new y(t);this._readableState=new m(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),a.call(this)}function v(t,e,i,r,o){var a=function(t,e){var i=null;return c.isBuffer(e)||"string"==typeof e||null==e||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i}(e,i);if(a)t.emit("error",a);else if(null===i)e.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,w(t)}}(t,e);else if(e.objectMode||i&&i.length>0)if(e.ended&&!o){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&o){var u=new Error("stream.unshift() after end event");t.emit("error",u)}else{var l;!e.decoder||o||r||(i=e.decoder.write(i),l=!e.objectMode&&0===i.length),o||(e.reading=!1),l||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",i),t.read(0)):(e.length+=e.objectMode?1:i.length,o?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&w(t))),function(t,e){e.readingMore||(e.readingMore=!0,n(S,t,e))}(t,e)}else o||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=g?t=g:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function w(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n(_,t):_(t))}function _(t){f("emit readable"),t.emit("readable"),E(t)}function S(t,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function(t,e,i){var r;return to.length?o.length:t;if(a===o.length?n+=o:n+=o.slice(0,t),0==(t-=a)){a===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(a));break}++r}return e.length-=r,n}(t,e):function(t,e){var i=u.allocUnsafe(t),r=e.head,n=1;for(r.data.copy(i),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),0==(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e),r}(t,e.buffer,e.decoder),i);var i}function O(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n(C,e,t))}function C(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function A(t,e){for(var i=0,r=t.length;i=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?O(this):w(this),null;if(0===(t=b(t,e))&&e.ended)return 0===e.length&&O(this),null;var r,n=e.needReadable;return f("need readable",n),(0===e.length||e.length-t0?k(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&O(this)),null!==r&&this.emit("data",r),r},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,i){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,f("pipe count=%d opts=%j",a.pipesCount,i);var c=i&&!1===i.end||t===e.stdout||t===e.stderr?d:l;function u(t){f("onunpipe"),t===r&&d()}function l(){f("onend"),t.end()}a.endEmitted?n(c):r.once("end",c),t.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,E(t))}}(r);t.on("drain",h);var p=!1;function d(){f("cleanup"),t.removeListener("close",g),t.removeListener("finish",b),t.removeListener("drain",h),t.removeListener("error",v),t.removeListener("unpipe",u),r.removeListener("end",l),r.removeListener("end",d),r.removeListener("data",y),p=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||h()}var m=!1;function y(e){f("ondata"),m=!1,!1!==t.write(e)||m||((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==A(a.pipes,t))&&!p&&(f("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,m=!0),r.pause())}function v(e){f("onerror",e),w(),t.removeListener("error",v),0===s(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",b),w()}function b(){f("onfinish"),t.removeListener("close",g),w()}function w(){f("unpipe"),r.unpipe(t)}return r.on("data",y),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?o(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",v),t.once("close",g),t.once("finish",b),t.emit("pipe",r),a.flowing||(f("pipe resume"),r.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;na)throw new RangeError("size is too large");var r=i,o=e;void 0===o&&(r=void 0,o=0);var s=new n(t);if("string"==typeof o)for(var c=new n(o,r),u=c.length,l=-1;++la)throw new RangeError("size is too large");return new n(t)},e.from=function(e,i,r){if("function"==typeof n.from&&(!t.Uint8Array||Uint8Array.from!==n.from))return n.from(e,i,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new n(e,i);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=i;if(1===arguments.length)return new n(e);void 0===o&&(o=0);var a=r;if(void 0===a&&(a=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(a>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new n(e.slice(o,o+a))}if(n.isBuffer(e)){var s=new n(e.length);return e.copy(s,0,0,e.length),s}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new n(e);if("Buffer"===e.type&&Array.isArray(e.data))return new n(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},e.allocUnsafeSlow=function(t){if("function"==typeof n.allocUnsafeSlow)return n.allocUnsafeSlow(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>=a)throw new RangeError("size is too large");return new o(t)}}).call(e,function(){return this}())},function(t,e,i){(function(t){function i(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===i(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===i(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===i(t)},e.isError=function(t){return"[object Error]"===i(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(e,i(1))},function(t,e){},function(t,e,i){"use strict";i(2).Buffer;var r=i(17);function n(){this.head=null,this.tail=null,this.length=0}t.exports=n,n.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},n.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},n.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},n.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e=r.allocUnsafe(t>>>0),i=this.head,n=0;i;)i.data.copy(e,n),n+=i.data.length,i=i.next;return e}},function(t,e,i){"use strict";var r=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=h;var n=i(15),o=i(18);o.inherits=i(12);var a=i(14),s=i(22);o.inherits(h,a);for(var c=r(s.prototype),u=0;u-1?setImmediate:n;m.WritableState=d;var a=i(18);a.inherits=i(12);var s,c={deprecate:i(23)};!function(){try{s=i(11)}catch(t){}finally{s||(s=i(8).EventEmitter)}}();var u,l=i(2).Buffer,h=i(17);function f(){}function p(t,e,i){this.chunk=t,this.encoding=e,this.callback=i,this.next=null}function d(t,e){r=r||i(21),t=t||{},this.objectMode=!!t.objectMode,e instanceof r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var a=t.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:s,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,a=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,o){--e.pendingcb,i?n(o,r):o(r),t._writableState.errorEmitted=!0,t.emit("error",r)}(t,i,r,e,a);else{var s=b(i);s||i.corked||i.bufferProcessing||!i.bufferedRequest||g(t,i),r?o(v,t,i,s,a):v(t,i,s,a)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new S(this)}function m(t){if(r=r||i(21),!(u.call(m,this)||this instanceof r))return new m(t);this._writableState=new d(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),s.call(this)}function y(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function v(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),_(t,e)}function g(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),o=e.corkedRequestsFree;o.entry=i;for(var a=0;i;)n[a]=i,i=i.next,a+=1;y(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new S(e)}else{for(;i;){var s=i.chunk,c=i.encoding,u=i.callback;if(y(t,e,!1,e.objectMode?1:s.length,s,c,u),i=i.next,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=i,e.bufferProcessing=!1}function b(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function w(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function _(t,e){var i=b(e);return i&&(0===e.pendingcb?(w(t,e),e.finished=!0,t.emit("finish")):w(t,e)),i}function S(t){var e=this;this.next=null,this.entry=null,this.finish=function(i){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(i),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}a.inherits(m,s),d.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(d.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||t&&t._writableState instanceof d}})):u=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,i){var r=this._writableState,o=!1,a=l.isBuffer(t);return"function"==typeof e&&(i=e,e=null),a?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof i&&(i=f),r.ended?function(t,e){var i=new Error("write after end");t.emit("error",i),n(e,i)}(this,i):(a||function(t,e,i,r){var o=!0,a=!1;return null===i?a=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),n(r,a),o=!1),o}(this,r,t,i))&&(r.pendingcb++,o=function(t,e,i,r,n,o){i||(r=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,i)),e}(e,r,n),l.isBuffer(r)&&(n="buffer"));var a=e.objectMode?1:r.length;e.length+=a;var s=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},m.prototype._write=function(t,e,i){i(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,i){var r=this._writableState;"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,i){e.ending=!0,_(t,e),i&&(e.finished?n(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i)}}).call(e,i(6))},function(t,e){(function(e){function i(t){try{if(!e.localStorage)return!1}catch(t){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(e,function(){return this}())},function(t,e,i){var r=i(2).Buffer,n=r.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},o=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!n(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=a)}this.charBuffer=new r(6),this.charReceived=0,this.charLength=0};function a(t){return t.toString(this.encoding)}function s(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function c(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(t){for(var e="";this.charLength;){var i=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,i),this.charReceived+=i,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var r,n=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,(r=e.charCodeAt(n))>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var i=t[t.length-e];if(1==e&&i>>5==6){this.charLength=2;break}if(e<=2&&i>>4==14){this.charLength=3;break}if(e<=3&&i>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var i=this.charReceived,r=this.charBuffer,n=this.encoding;e+=r.slice(0,i).toString(n)}return e}},function(t,e,i){"use strict";t.exports=a;var r=i(21),n=i(18);function o(t){this.afterTransform=function(e,i){return function(t,e,i){var r=t._transformState;r.transforming=!1;var n=r.writecb;if(!n)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=i&&t.push(i),n(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(s[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function f(t,e){var i=new h(e);if(i.push(t,!0),i.err)throw i.msg||s[i.err];return i.result}h.prototype.push=function(t,e){var i,s,c,u,h,f,p=this.strm,d=this.options.chunkSize,m=this.options.dictionary,y=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(d),p.next_out=0,p.avail_out=d),(i=r.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(f="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,i=r.inflateSetDictionary(this.strm,f)),i===a.Z_BUF_ERROR&&!0===y&&(i=a.Z_OK,y=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(c=o.utf8border(p.output,p.next_out),u=p.next_out-c,h=o.buf2string(p.output,c),p.next_out=u,p.avail_out=d-u,u&&n.arraySet(p.output,p.output,c,u,0),this.onData(h)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(y=!0)}while((p.avail_in>0||0===p.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),p.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=f,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},e.ungzip=f},function(t,e,i){"use strict";var r=i(33),n=i(34),o=i(35),a=i(36),s=i(37),c=1,u=2,l=0,h=-2,f=1,p=12,d=30,m=852,y=592;function v(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function g(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=f,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(m),e.distcode=e.distdyn=new r.Buf32(y),e.sane=1,e.back=-1,l):h}function w(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,b(t)):h}function _(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?h:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,w(t))):h}function S(t,e){var i,r;return t?(r=new g,t.state=r,r.window=null,(i=_(t,e))!==l&&(t.state=null),i):h}var x,M,E=!0;function k(t){if(E){var e;for(x=new r.Buf32(512),M=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(c,t.lens,0,288,x,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(u,t.lens,0,32,M,0,t.work,{bits:5}),E=!1}t.lencode=x,t.lenbits=9,t.distcode=M,t.distbits=5}function O(t,e,i,n){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(r.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>n&&(o=n),r.arraySet(a.window,e,i-n,o,a.wnext),(n-=o)?(r.arraySet(a.window,e,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,i.check=o(i.check,q,2,0),S=0,x=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&S)<<8)+(S>>8))%31){t.msg="incorrect header check",i.mode=d;break}if(8!=(15&S)){t.msg="unknown compression method",i.mode=d;break}if(x-=4,L=8+(15&(S>>>=4)),0===i.wbits)i.wbits=L;else if(L>i.wbits){t.msg="invalid window size",i.mode=d;break}i.dmax=1<>8&1),512&i.flags&&(q[0]=255&S,q[1]=S>>>8&255,i.check=o(i.check,q,2,0)),S=0,x=0,i.mode=3;case 3:for(;x<32;){if(0===w)break t;w--,S+=m[g++]<>>8&255,q[2]=S>>>16&255,q[3]=S>>>24&255,i.check=o(i.check,q,4,0)),S=0,x=0,i.mode=4;case 4:for(;x<16;){if(0===w)break t;w--,S+=m[g++]<>8),512&i.flags&&(q[0]=255&S,q[1]=S>>>8&255,i.check=o(i.check,q,2,0)),S=0,x=0,i.mode=5;case 5:if(1024&i.flags){for(;x<16;){if(0===w)break t;w--,S+=m[g++]<>>8&255,i.check=o(i.check,q,2,0)),S=0,x=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((C=i.length)>w&&(C=w),C&&(i.head&&(L=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,m,g,C,L)),512&i.flags&&(i.check=o(i.check,m,C,g)),w-=C,g+=C,i.length-=C),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===w)break t;C=0;do{L=m[g+C++],i.head&&L&&i.length<65536&&(i.head.name+=String.fromCharCode(L))}while(L&&C>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=p;break;case 10:for(;x<32;){if(0===w)break t;w--,S+=m[g++]<>>=7&x,x-=7&x,i.mode=27;break}for(;x<3;){if(0===w)break t;w--,S+=m[g++]<>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6===e){S>>>=2,x-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=d}S>>>=2,x-=2;break;case 14:for(S>>>=7&x,x-=7&x;x<32;){if(0===w)break t;w--,S+=m[g++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=d;break}if(i.length=65535&S,S=0,x=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(C=i.length){if(C>w&&(C=w),C>_&&(C=_),0===C)break t;r.arraySet(y,m,g,C,b),w-=C,g+=C,_-=C,b+=C,i.length-=C;break}i.mode=p;break;case 17:for(;x<14;){if(0===w)break t;w--,S+=m[g++]<>>=5,x-=5,i.ndist=1+(31&S),S>>>=5,x-=5,i.ncode=4+(15&S),S>>>=4,x-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=d;break}i.have=0,i.mode=18;case 18:for(;i.have>>=3,x-=3}for(;i.have<19;)i.lens[K[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,F={bits:i.lenbits},B=s(0,i.lens,0,19,i.lencode,0,i.work,F),i.lenbits=F.bits,B){t.msg="invalid code lengths set",i.mode=d;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,R=65535&z,!((j=z>>>24)<=x);){if(0===w)break t;w--,S+=m[g++]<>>=j,x-=j,i.lens[i.have++]=R;else{if(16===R){for(U=j+2;x>>=j,x-=j,0===i.have){t.msg="invalid bit length repeat",i.mode=d;break}L=i.lens[i.have-1],C=3+(3&S),S>>>=2,x-=2}else if(17===R){for(U=j+3;x>>=j)),S>>>=3,x-=3}else{for(U=j+7;x>>=j)),S>>>=7,x-=7}if(i.have+C>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=d;break}for(;C--;)i.lens[i.have++]=L}}if(i.mode===d)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=d;break}if(i.lenbits=9,F={bits:i.lenbits},B=s(c,i.lens,0,i.nlen,i.lencode,0,i.work,F),i.lenbits=F.bits,B){t.msg="invalid literal/lengths set",i.mode=d;break}if(i.distbits=6,i.distcode=i.distdyn,F={bits:i.distbits},B=s(u,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,F),i.distbits=F.bits,B){t.msg="invalid distances set",i.mode=d;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(w>=6&&_>=258){t.next_out=b,t.avail_out=_,t.next_in=g,t.avail_in=w,i.hold=S,i.bits=x,a(t,E),b=t.next_out,y=t.output,_=t.avail_out,g=t.next_in,m=t.input,w=t.avail_in,S=i.hold,x=i.bits,i.mode===p&&(i.back=-1);break}for(i.back=0;T=(z=i.lencode[S&(1<>>16&255,R=65535&z,!((j=z>>>24)<=x);){if(0===w)break t;w--,S+=m[g++]<>I)])>>>16&255,R=65535&z,!(I+(j=z>>>24)<=x);){if(0===w)break t;w--,S+=m[g++]<>>=I,x-=I,i.back+=I}if(S>>>=j,x-=j,i.back+=j,i.length=R,0===T){i.mode=26;break}if(32&T){i.back=-1,i.mode=p;break}if(64&T){t.msg="invalid literal/length code",i.mode=d;break}i.extra=15&T,i.mode=22;case 22:if(i.extra){for(U=i.extra;x>>=i.extra,x-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;T=(z=i.distcode[S&(1<>>16&255,R=65535&z,!((j=z>>>24)<=x);){if(0===w)break t;w--,S+=m[g++]<>I)])>>>16&255,R=65535&z,!(I+(j=z>>>24)<=x);){if(0===w)break t;w--,S+=m[g++]<>>=I,x-=I,i.back+=I}if(S>>>=j,x-=j,i.back+=j,64&T){t.msg="invalid distance code",i.mode=d;break}i.offset=R,i.extra=15&T,i.mode=24;case 24:if(i.extra){for(U=i.extra;x>>=i.extra,x-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=d;break}i.mode=25;case 25:if(0===_)break t;if(C=E-_,i.offset>C){if((C=i.offset-C)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=d;break}C>i.wnext?(C-=i.wnext,A=i.wsize-C):A=i.wnext-C,C>i.length&&(C=i.length),P=i.window}else P=y,A=b-i.offset,C=i.length;C>_&&(C=_),_-=C,i.length-=C;do{y[b++]=P[A++]}while(--C);0===i.length&&(i.mode=21);break;case 26:if(0===_)break t;y[b++]=i.length,_--,i.mode=21;break;case 27:if(i.wrap){for(;x<32;){if(0===w)break t;w--,S|=m[g++]<>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{o=o+(n=n+e[r++]|0)|0}while(--a);n%=65521,o%=65521}return n|o<<16|0}},function(t,e){"use strict";var i=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,e,r,n){var o=i,a=n+r;t^=-1;for(var s=n;s>>8^o[255&(t^e[s])];return-1^t}},function(t,e){"use strict";t.exports=function(t,e){var i,r,n,o,a,s,c,u,l,h,f,p,d,m,y,v,g,b,w,_,S,x,M,E,k;i=t.state,r=t.next_in,E=t.input,n=r+(t.avail_in-5),o=t.next_out,k=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),c=i.dmax,u=i.wsize,l=i.whave,h=i.wnext,f=i.window,p=i.hold,d=i.bits,m=i.lencode,y=i.distcode,v=(1<>>=w=b>>>24,d-=w,0==(w=b>>>16&255))k[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(p&(1<>>=w,d-=w),d<15&&(p+=E[r++]<>>=w=b>>>24,d-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=y[(65535&b)+(p&(1<c){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=w,d-=w,S>(w=o-a)){if((w=S-w)>l&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(x=0,M=f,0===h){if(x+=u-w,w<_){_-=w;do{k[o++]=f[x++]}while(--w);x=o-S,M=k}}else if(h2;)k[o++]=M[x++],k[o++]=M[x++],k[o++]=M[x++],_-=3;_&&(k[o++]=M[x++],_>1&&(k[o++]=M[x++]))}else{x=o-S;do{k[o++]=k[x++],k[o++]=k[x++],k[o++]=k[x++],_-=3}while(_>2);_&&(k[o++]=k[x++],_>1&&(k[o++]=k[x++]))}break}}break}}while(r>3,p&=(1<<(d-=_<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r=1&&0===D[O];O--);if(C>O&&(C=O),0===O)return l[h++]=20971520,l[h++]=20971520,p.bits=1,0;for(k=1;k0&&(0===t||1!==O))return-1;for(L[1]=0,M=1;M852||2===t&&T>592)return 1;for(;;){w=M-P,f[E]b?(_=B[F+f[E]],S=I[N+f[E]]):(_=96,S=0),d=1<>P)+(m-=d)]=w<<24|_<<16|S|0}while(0!==m);for(d=1<>=1;if(0!==d?(R&=d-1,R+=d):R=0,E++,0==--D[M]){if(M===O)break;M=e[i+f[E]]}if(M>C&&(R&v)!==y){for(0===P&&(P=C),g+=k,j=1<<(A=M-P);A+P852||2===t&&T>592)return 1;l[y=R&v]=C<<24|A<<16|g-h|0}}return 0!==R&&(l[g+R]=M-P<<24|64<<16|0),p.bits=C,0}},function(t,e,i){"use strict";var r=i(33),n=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function c(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var i="",a=0;a>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e},e.buf2binstring=function(t){return c(t,t.length)},e.binstring2buf=function(t){for(var e=new r.Buf8(t.length),i=0,n=e.length;i4)u[r++]=65533,i+=o-1;else{for(n&=2===o?31:3===o?15:7;o>1&&i1?u[r++]=65533:n<65536?u[r++]=n:(n-=65536,u[r++]=55296|n>>10&1023,u[r++]=56320|1023&n)}return c(u,r)},e.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},function(t,e){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){"use strict";t.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"}},function(t,e){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}}])},"object"==typeof e&&"object"==typeof t?t.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof e?e.BrowserFS=r():i.BrowserFS=r()},58609:(t,e,i)=>{var r=i(43229);t.exports=r.BFSRequire("buffer")},99649:(t,e,i)=>{var r=i(43229);t.exports=r.BFSRequire("buffer").Buffer},10978:(t,e,i)=>{var r=i(43229);t.exports=r.BFSRequire("fs")},1679:(t,e,i)=>{var r=i(43229);t.exports=r.BFSRequire("path")},74497:(t,e,i)=>{var r=i(89509).Buffer;function n(t){r.isBuffer(t)||(t=r.from(t));for(var e=t.length/4|0,i=new Array(e),n=0;n>>24]^l[d>>>16&255]^h[m>>>8&255]^f[255&y]^e[v++],a=u[d>>>24]^l[m>>>16&255]^h[y>>>8&255]^f[255&p]^e[v++],s=u[m>>>24]^l[y>>>16&255]^h[p>>>8&255]^f[255&d]^e[v++],c=u[y>>>24]^l[p>>>16&255]^h[d>>>8&255]^f[255&m]^e[v++],p=o,d=a,m=s,y=c;return o=(r[p>>>24]<<24|r[d>>>16&255]<<16|r[m>>>8&255]<<8|r[255&y])^e[v++],a=(r[d>>>24]<<24|r[m>>>16&255]<<16|r[y>>>8&255]<<8|r[255&p])^e[v++],s=(r[m>>>24]<<24|r[y>>>16&255]<<16|r[p>>>8&255]<<8|r[255&d])^e[v++],c=(r[y>>>24]<<24|r[p>>>16&255]<<16|r[d>>>8&255]<<8|r[255&m])^e[v++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var i=[],r=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,i[a]=u,r[u]=a;var l=t[a],h=t[l],f=t[h],p=257*t[u]^16843008*u;n[0][a]=p<<24|p>>>8,n[1][a]=p<<16|p>>>16,n[2][a]=p<<8|p>>>24,n[3][a]=p,p=16843009*f^65537*h^257*l^16843008*a,o[0][u]=p<<24|p>>>8,o[1][u]=p<<16|p>>>16,o[2][u]=p<<8|p>>>24,o[3][u]=p,0===a?a=s=1:(a=l^t[t[t[f^l]]],s^=t[t[s]])}return{SBOX:i,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:o}}();function u(t){this._key=n(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,i=e+6,r=4*(i+1),n=[],o=0;o>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),n[o]=n[o-e]^a}for(var u=[],l=0;l>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=i,this._keySchedule=n,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return a(t=n(t),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),i=r.allocUnsafe(16);return i.writeUInt32BE(e[0],0),i.writeUInt32BE(e[1],4),i.writeUInt32BE(e[2],8),i.writeUInt32BE(e[3],12),i},u.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var i=a(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=r.allocUnsafe(16);return o.writeUInt32BE(i[0],0),o.writeUInt32BE(i[3],4),o.writeUInt32BE(i[2],8),o.writeUInt32BE(i[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},62422:(t,e,i)=>{var r=i(74497),n=i(89509).Buffer,o=i(71027),a=i(35717),s=i(83288),c=i(67295),u=i(20685);function l(t,e,i,a){o.call(this);var c=n.alloc(4,0);this._cipher=new r.AES(e);var l=this._cipher.encryptBlock(c);this._ghash=new s(l),i=function(t,e,i){if(12===e.length)return t._finID=n.concat([e,n.from([0,0,0,1])]),n.concat([e,n.from([0,0,0,2])]);var r=new s(i),o=e.length,a=o%16;r.update(e),a&&(a=16-a,r.update(n.alloc(a,0))),r.update(n.alloc(8,0));var c=8*o,l=n.alloc(8);l.writeUIntBE(c,0,8),r.update(l),t._finID=r.state;var h=n.from(t._finID);return u(h),h}(this,i,l),this._prev=n.from(i),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(l,o),l.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=n.alloc(e,0),this._ghash.update(e))}this._called=!0;var i=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(i),this._len+=t.length,i},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var i=0;t.length!==e.length&&i++;for(var r=Math.min(t.length,e.length),n=0;n{var r=i(71494),n=i(66193),o=i(44946);e.createCipher=e.Cipher=r.createCipher,e.createCipheriv=e.Cipheriv=r.createCipheriv,e.createDecipher=e.Decipher=n.createDecipher,e.createDecipheriv=e.Decipheriv=n.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},66193:(t,e,i)=>{var r=i(62422),n=i(89509).Buffer,o=i(45),a=i(25969),s=i(71027),c=i(74497),u=i(13048);function l(t,e,i){s.call(this),this._cache=new h,this._last=void 0,this._cipher=new c.AES(e),this._prev=n.from(i),this._mode=t,this._autopadding=!0}function h(){this.cache=n.allocUnsafe(0)}function f(t,e,i){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=n.from(i)),"GCM"!==s.mode&&i.length!==s.iv)throw new TypeError("invalid iv length "+i.length);if("string"==typeof e&&(e=n.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,i,!0):"auth"===s.type?new r(s.module,e,i,!0):new l(s.module,e,i)}i(35717)(l,s),l.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,e),r.push(i);return n.concat(r)},l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var i=-1;for(;++i16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var i=o[t.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var r=u(e,!1,i.key,i.iv);return f(t,r.key,r.iv)},e.createDecipheriv=f},71494:(t,e,i)=>{var r=i(45),n=i(62422),o=i(89509).Buffer,a=i(25969),s=i(71027),c=i(74497),u=i(13048);function l(t,e,i){s.call(this),this._cache=new f,this._cipher=new c.AES(e),this._prev=o.from(i),this._mode=t,this._autopadding=!0}i(35717)(l,s),l.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get();)i=this._mode.encrypt(this,e),r.push(i);return o.concat(r)};var h=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function p(t,e,i){var s=r[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof i&&(i=o.from(i)),"GCM"!==s.mode&&i.length!==s.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===s.type?new a(s.module,e,i):"auth"===s.type?new n(s.module,e,i):new l(s.module,e,i)}l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=o.concat([this.cache,t])},f.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},f.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),i=-1;++i{var r=i(89509).Buffer,n=r.alloc(16,0);function o(t){var e=r.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,i&&(r[0]=r[0]^225<<24)}this.state=o(n)},a.prototype.update=function(t){var e;for(this.cache=r.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(r.concat([this.cache,n],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},20685:t=>{t.exports=function(t){for(var e,i=t.length;i--;){if(255!==(e=t.readUInt8(i))){e++,t.writeUInt8(e,i);break}t.writeUInt8(0,i)}}},25292:(t,e,i)=>{var r=i(67295);e.encrypt=function(t,e){var i=r(e,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},e.decrypt=function(t,e){var i=t._prev;t._prev=e;var n=t._cipher.decryptBlock(e);return r(n,i)}},86311:(t,e,i)=>{var r=i(89509).Buffer,n=i(67295);function o(t,e,i){var o=e.length,a=n(e,t._cache);return t._cache=t._cache.slice(o),t._prev=r.concat([t._prev,i?e:a]),a}e.encrypt=function(t,e,i){for(var n,a=r.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=r.allocUnsafe(0)),!(t._cache.length<=e.length)){a=r.concat([a,o(t,e,i)]);break}n=t._cache.length,a=r.concat([a,o(t,e.slice(0,n),i)]),e=e.slice(n)}return a}},21510:(t,e,i)=>{var r=i(89509).Buffer;function n(t,e,i){for(var r,n,a=-1,s=0;++a<8;)r=e&1<<7-a?128:0,s+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^r))>>a%8,t._prev=o(t._prev,i?r:n);return s}function o(t,e){var i=t.length,n=-1,o=r.allocUnsafe(t.length);for(t=r.concat([t,r.from([e])]);++n>7;return o}e.encrypt=function(t,e,i){for(var o=e.length,a=r.allocUnsafe(o),s=-1;++s{var r=i(89509).Buffer;function n(t,e,i){var n=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=r.concat([t._prev.slice(1),r.from([i?e:n])]),n}e.encrypt=function(t,e,i){for(var o=e.length,a=r.allocUnsafe(o),s=-1;++s{var r=i(67295),n=i(89509).Buffer,o=i(20685);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var i=Math.ceil(e.length/16),o=t._cache.length;t._cache=n.concat([t._cache,n.allocUnsafe(16*i)]);for(var s=0;s{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},45:(t,e,i)=>{var r={ECB:i(11084),CBC:i(25292),CFB:i(86311),CFB8:i(71964),CFB1:i(21510),OFB:i(18861),CTR:i(96009),GCM:i(96009)},n=i(44946);for(var o in n)n[o].module=r[n[o].mode];t.exports=n},18861:(t,e,i)=>{var r=i(99649),n=i(67295);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length{var r=i(74497),n=i(89509).Buffer,o=i(71027);function a(t,e,i,a){o.call(this),this._cipher=new r.AES(e),this._prev=n.from(i),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=a,this._mode=t}i(35717)(a,o),a.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},t.exports=a},53614:(t,e,i)=>{var r=i(47667),n=i(44696),o=i(45),a=i(99715),s=i(13048);function c(t,e,i){if(t=t.toLowerCase(),o[t])return n.createCipheriv(t,e,i);if(a[t])return new r({key:e,iv:i,mode:t});throw new TypeError("invalid suite type")}function u(t,e,i){if(t=t.toLowerCase(),o[t])return n.createDecipheriv(t,e,i);if(a[t])return new r({key:e,iv:i,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var i,r;if(t=t.toLowerCase(),o[t])i=o[t].key,r=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");i=8*a[t].key,r=a[t].iv}var n=s(e,!1,i,r);return c(t,n.key,n.iv)},e.createCipheriv=e.Cipheriv=c,e.createDecipher=e.Decipher=function(t,e){var i,r;if(t=t.toLowerCase(),o[t])i=o[t].key,r=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");i=8*a[t].key,r=a[t].iv}var n=s(e,!1,i,r);return u(t,n.key,n.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(a).concat(n.getCiphers())}},47667:(t,e,i)=>{var r=i(71027),n=i(15251),o=i(35717),a=i(89509).Buffer,s={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function c(t){r.call(this);var e,i=t.mode.toLowerCase(),n=s[i];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==i&&"des-ede-cbc"!==i||(o=a.concat([o,o.slice(0,8)]));var c=t.iv;a.isBuffer(c)||(c=a.from(c)),this._des=n.create({key:o,iv:c,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=c,o(c,r),c.prototype._update=function(t){return a.from(this._des.update(t))},c.prototype._final=function(){return a.from(this._des.final())}},99715:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},23663:(t,e,i)=>{var r=i(99649),n=i(13550),o=i(61798);function a(t){var e,i=t.modulus.byteLength();do{e=new n(o(i))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,e){var i=function(t){var e=a(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),s=new n(t).mul(i.blinder).umod(e.modulus),c=s.toRed(n.mont(e.prime1)),u=s.toRed(n.mont(e.prime2)),l=e.coefficient,h=e.prime1,f=e.prime2,p=c.redPow(e.exponent1).fromRed(),d=u.redPow(e.exponent2).fromRed(),m=p.isub(d).imul(l).umod(h).imul(f);return d.iadd(m).imul(i.unblinder).umod(e.modulus).toArrayLike(r,"be",o)}s.getr=a,t.exports=s},56042:(t,e,i)=>{"use strict";t.exports=i(75207)},64743:(t,e,i)=>{"use strict";var r=i(89509).Buffer,n=i(23482),o=i(88473),a=i(35717),s=i(82957),c=i(47753),u=i(75207);function l(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){return new l(t)}function p(t){return new h(t)}Object.keys(u).forEach((function(t){u[t].id=r.from(u[t].id,"hex"),u[t.toLowerCase()]=u[t]})),a(l,o.Writable),l.prototype._write=function(t,e,i){this._hash.update(t),i()},l.prototype.update=function(t,e){return this._hash.update("string"==typeof t?r.from(t,e):t),this},l.prototype.sign=function(t,e){this.end();var i=this._hash.digest(),r=s(i,t,this._hashType,this._signType,this._tag);return e?r.toString(e):r},a(h,o.Writable),h.prototype._write=function(t,e,i){this._hash.update(t),i()},h.prototype.update=function(t,e){return this._hash.update("string"==typeof t?r.from(t,e):t),this},h.prototype.verify=function(t,e,i){var n="string"==typeof e?r.from(e,i):e;this.end();var o=this._hash.digest();return c(n,o,t,this._signType,this._tag)},t.exports={Sign:f,Verify:p,createSign:f,createVerify:p}},82957:(t,e,i)=>{"use strict";var r=i(89509).Buffer,n=i(58355),o=i(23663),a=i(86266).ec,s=i(13550),c=i(70980),u=i(1308);function l(t,e,i,o){if((t=r.from(t.toArray())).length0&&i.ishrn(r),i}function f(t,e,i){var o,a;do{for(o=r.alloc(0);8*o.length{"use strict";var r=i(89509).Buffer,n=i(13550),o=i(86266).ec,a=i(70980),s=i(1308);function c(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=0)throw new Error("invalid sig")}t.exports=function(t,e,i,u,l){var h=a(i);if("ec"===h.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,i){var r=s[i.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var n=new o(r),a=i.data.subjectPrivateKey.data;return n.verify(e,t,a)}(t,e,h)}if("dsa"===h.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,i){var r=i.data.p,o=i.data.q,s=i.data.g,u=i.data.pub_key,l=a.signature.decode(t,"der"),h=l.s,f=l.r;c(h,o),c(f,o);var p=n.mont(r),d=h.invm(o),m=s.toRed(p).redPow(new n(e).mul(d).mod(o)).fromRed().mul(u.toRed(p).redPow(f.mul(d).mod(o)).fromRed()).mod(r).mod(o);return 0===m.cmp(f)}(t,e,h)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=r.concat([l,e]);for(var f=h.modulus.byteLength(),p=[1],d=0;e.length+p.length+2{var r=i(99649);t.exports=function(t,e){for(var i=Math.min(t.length,e.length),n=new r(i),o=0;o{t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},21924:(t,e,i)=>{"use strict";var r=i(40210),n=i(55559),o=n(r("String.prototype.indexOf"));t.exports=function(t,e){var i=r(t,!!e);return"function"==typeof i&&o(t,".prototype.")>-1?n(i):i}},55559:(t,e,i)=>{"use strict";var r=i(58612),n=i(40210),o=i(67771),a=i(14453),s=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),u=n("%Reflect.apply%",!0)||r.call(c,s),l=n("%Object.defineProperty%",!0),h=n("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=u(r,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(r,s,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},40487:t=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],i=0;i{var r=i(89509).Buffer,n=i(42830).Transform,o=i(32553).s;function a(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}i(35717)(a,n),a.prototype.update=function(t,e,i){"string"==typeof t&&(t=r.from(t,e));var n=this._update(t);return this.hashMode?this:(i&&(n=this._toString(n,i)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,i){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{i(r)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,i){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return i&&(r+=this._decoder.end()),r},t.exports=a},25108:(t,e,i)=>{var r=i(89539),n=i(69282);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==i.g&&i.g.console?i.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){c[t]=o()},"time"],[function(t){var e=c[t];if(!e)throw new Error("No such label: "+t);delete c[t];var i=o()-e;a.log(t+": "+i+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=r.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(r.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);n.ok(!1,r.format.apply(null,e))}},"assert"]],l=0;l{function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=i(58609).Buffer.isBuffer},76393:(t,e,i)=>{var r=i(99649),n=i(86266),o=i(16426);t.exports=function(t){return new s(t)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=a[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function c(t,e,i){Array.isArray(t)||(t=t.toArray());var n=new r(t);if(i&&n.length=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},23482:(t,e,i)=>{"use strict";var r=i(35717),n=i(62318),o=i(79785),a=i(89072),s=i(71027);function c(t){s.call(this,"digest"),this._hash=t}r(c,s),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new o:new c(a(t))}},78028:(t,e,i)=>{var r=i(62318);t.exports=function(t){return(new r).update(t).digest()}},58355:(t,e,i)=>{"use strict";var r=i(35717),n=i(51031),o=i(71027),a=i(89509).Buffer,s=i(78028),c=i(79785),u=i(89072),l=a.alloc(128);function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var i="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>i)?e=("rmd160"===t?new c:u(t)).update(e).digest():e.length{"use strict";var r=i(35717),n=i(89509).Buffer,o=i(71027),a=n.alloc(128),s=64;function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=n.from(e)),this._alg=t,this._key=e,e.length>s?e=t(e):e.length{var e,i;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&i.rotl(t,8)|4278255360&i.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],i=0,r=0;i>>5]|=t[i]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],i=0;i<32*t.length;i+=8)e.push(t[i>>>5]>>>24-i%32&255);return e},bytesToHex:function(t){for(var e=[],i=0;i>>4).toString(16)),e.push((15&t[i]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],i=0;i>>6*(3-o)&63)):i.push("=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],r=0,n=0;r>>6-2*n);return i}},t.exports=i},58292:t=>{(function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=40)})([function(t,e,i){"use strict";function r(t,e){return t<>>32-e|0}function n(t,e){return t>>>e|t<<32-e|0}function o(t,e,i){return 32===i?e:i>32?o(e,t,i-32):4294967295&(t>>>i|e<<32-i)}function a(t,e,i){return 32===i?t:i>32?a(e,t,i-32):4294967295&(e>>>i|t<<32-i)}i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return n})),i.d(e,"d",(function(){return a})),i.d(e,"c",(function(){return o}))},function(t,e,i){"use strict";function r(t){for(var e="",i=0,r=t.length;i>6),e+=String.fromCharCode(128|63&n)):n<55296||n>=57344?(e+=String.fromCharCode(224|n>>12),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|63&n)):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e+=String.fromCharCode(240|n>>18),e+=String.fromCharCode(128|n>>12&63),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|63&n))}return e}i.d(e,"a",(function(){return r}))},function(t,e,i){"use strict";function r(t){for(var e="",i=0,r=t.length;i=this.blockSizeInBytes;){this.blockUnits=[];for(var t=0;t>24&255)+String.fromCharCode(this.state.hash[i]>>16&255)+String.fromCharCode(this.state.hash[i]>>8&255)+String.fromCharCode(255&this.state.hash[i]);return e}},{key:"addLengthBits",value:function(){this.state.message+="\0\0\0"+String.fromCharCode(this.state.length>>29&255)+String.fromCharCode(this.state.length>>21&255)+String.fromCharCode(this.state.length>>13&255)+String.fromCharCode(this.state.length>>5&255)+String.fromCharCode(this.state.length<<3&255)}}])&&n(e.prototype,i),r&&n(e,r),c}(i(4).a);e.a=c},function(t,e,i){"use strict";function r(t,e){for(var i=0;i=this.blockSizeInBytes;){this.blockUnits=[];for(var t=0;t>8&255)+String.fromCharCode(this.state.hash[i]>>16&255)+String.fromCharCode(this.state.hash[i]>>24&255);return e}},{key:"addLengthBits",value:function(){this.state.message+=String.fromCharCode(this.state.length<<3&255)+String.fromCharCode(this.state.length>>5&255)+String.fromCharCode(this.state.length>>13&255)+String.fromCharCode(this.state.length>>21&255)+String.fromCharCode(this.state.length>>29&255)+"\0\0\0"}}])&&n(e.prototype,i),r&&n(e,r),c}(i(4).a);e.a=c},function(t,e,i){"use strict";var r=i(3),n=i(0);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i>>7,i=Object(n.d)(this.W[x-30],this.W[x-29],1)^Object(n.d)(this.W[x-30],this.W[x-29],8)^(this.W[x-29]>>>7|this.W[x-30]<<25),r=Object(n.c)(this.W[x-4],this.W[x-3],19)^Object(n.c)(this.W[x-4],this.W[x-3],61)^this.W[x-4]>>>6,o=Object(n.d)(this.W[x-4],this.W[x-3],19)^Object(n.d)(this.W[x-4],this.W[x-3],61)^(this.W[x-3]>>>6|this.W[x-4]<<26);var M=(65535&this.W[x-13])+(65535&this.W[x-31])+(65535&i)+(65535&o)|0,E=(this.W[x-13]>>>16)+(this.W[x-31]>>>16)+(i>>>16)+(o>>>16)+(M>>>16)|0,k=(65535&this.W[x-14])+(65535&this.W[x-32])+(65535&e)+(65535&r)+(E>>>16)|0,O=(this.W[x-14]>>>16)+(this.W[x-32]>>>16)+(e>>>16)+(r>>>16)+(k>>>16)|0;this.W[x]=4294967295&(O<<16|65535&k),this.W[x+1]=4294967295&(E<<16|65535&M)}e=Object(n.c)(a,s,28)^Object(n.c)(a,s,34)^Object(n.c)(a,s,39),i=Object(n.d)(a,s,28)^Object(n.d)(a,s,34)^Object(n.d)(a,s,39),r=Object(n.c)(m,y,14)^Object(n.c)(m,y,18)^Object(n.c)(m,y,41);var C=y&g^~y&w,A=a&c^a&l^c&l,P=s&u^s&f^u&f,j=S+(o=Object(n.d)(m,y,14)^Object(n.d)(m,y,18)^Object(n.d)(m,y,41))|0,T=_+r+(j>>>0>>0?1:0)|0;T=(T=T+(m&v^~m&b)+((j=j+C|0)>>>0>>0?1:0)|0)+h[x]+((j=j+h[x+1]|0)>>>0>>0?1:0)|0,j=j+this.W[x+1]|0;var R=i+P|0;_=b,S=w,b=v,w=g,v=m,g=y,m=p+(T=T+this.W[x]+(j>>>0>>0?1:0)|0)+((y=d+j|0)>>>0>>0?1:0)|0,p=l,d=f,l=c,f=u,c=a,u=s,a=T+(e+A+(R>>>0>>0?1:0)|0)+((s=j+R|0)>>>0>>0?1:0)|0}this.state.hash[1]=this.state.hash[1]+s|0,this.state.hash[0]=this.state.hash[0]+a+(this.state.hash[1]>>>0>>0?1:0)|0,this.state.hash[3]=this.state.hash[3]+u|0,this.state.hash[2]=this.state.hash[2]+c+(this.state.hash[3]>>>0>>0?1:0)|0,this.state.hash[5]=this.state.hash[5]+f|0,this.state.hash[4]=this.state.hash[4]+l+(this.state.hash[5]>>>0>>0?1:0)|0,this.state.hash[7]=this.state.hash[7]+d|0,this.state.hash[6]=this.state.hash[6]+p+(this.state.hash[7]>>>0>>0?1:0)|0,this.state.hash[9]=this.state.hash[9]+y|0,this.state.hash[8]=this.state.hash[8]+m+(this.state.hash[9]>>>0>>0?1:0)|0,this.state.hash[11]=this.state.hash[11]+g|0,this.state.hash[10]=this.state.hash[10]+v+(this.state.hash[11]>>>0>>0?1:0)|0,this.state.hash[13]=this.state.hash[13]+w|0,this.state.hash[12]=this.state.hash[12]+b+(this.state.hash[13]>>>0>>0?1:0)|0,this.state.hash[15]=this.state.hash[15]+S|0,this.state.hash[14]=this.state.hash[14]+_+(this.state.hash[15]>>>0>>0?1:0)|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<112?112-this.state.message.length|0:240-this.state.message.length|0),this.state.message+="\0\0\0\0\0\0\0\0",this.addLengthBits(),this.process(),this.getStateHash(this.options.length/32|0)}}])&&a(e.prototype,i),r&&a(e,r),f}(r.a);e.a=f},function(t,e,i){"use strict";var r=i(3),n=i(0);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i>>3)+this.W[l-7]+(Object(n.b)(this.W[l-2],17)^Object(n.b)(this.W[l-2],19)^this.W[l-2]>>>10)|0;var f=u+(Object(n.b)(a,6)^Object(n.b)(a,11)^Object(n.b)(a,25))+(a&s^~a&c)+h[l]+this.W[l]|0,p=(Object(n.b)(e,2)^Object(n.b)(e,13)^Object(n.b)(e,22))+(e&i^e&r^i&r)|0;u=c,c=s,s=a,a=o+f|0,o=r,r=i,i=e,e=f+p|0}this.state.hash[0]=this.state.hash[0]+e|0,this.state.hash[1]=this.state.hash[1]+i|0,this.state.hash[2]=this.state.hash[2]+r|0,this.state.hash[3]=this.state.hash[3]+o|0,this.state.hash[4]=this.state.hash[4]+a|0,this.state.hash[5]=this.state.hash[5]+s|0,this.state.hash[6]=this.state.hash[6]+c|0,this.state.hash[7]=this.state.hash[7]+u|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<56?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash(this.options.length/32|0)}}])&&a(e.prototype,i),r&&a(e,r),f}(r.a);e.a=f},function(t,e,i){"use strict";var r=i(5),n=i(0);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i=(n/i|0)*i);return t+r%i|0}!function(t){for(var e=0;e=0;r--)for(var n=0;n<255;n++){var o=255<<(r<<3),a=0|f[e][n],s=y(n,255);f[e][n]=f[e][n]&~o|f[e][s]&o|0,f[e][s]=f[e][s]&~o|a&o|0}}}(16);var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(h,t);var e,i,r,o=u(h);function h(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),(t=t||{}).length=t.length||128,t.rounds=t.rounds||8,(e=o.call(this,t)).blockSize=16-e.state.hash.length,e.blockSizeInBytes=e.blockSize*e.unitSize,e.W=new Array(16),e}return e=h,(i=[{key:"reset",value:function(){s(l(h.prototype),"reset",this).call(this),this.state.hash=new Array(this.options.length/32|0);for(var t=0;t>>0&15]^=s,this.W[a+1&15]^=s}for(var c=0;c<16;c++)this.W[c]=Object(n.b)(this.W[c],p[o])}for(var u=0;u0&&this.addPaddingZero(this.blockSizeInBytes-this.state.message.length|0),this.addPaddingZero(this.blockSizeInBytes-8|0),this.addLengthBits(),this.process(),this.getStateHash()}}])&&a(e.prototype,i),r&&a(e,r),h}(r.a);e.a=v},function(t,e,i){"use strict";var r=i(5),n=i(0);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i>0]|0;c=s<20?c+(i&r|~i&o)|0:s<40?c+(i^r^o)|0:s<60?c+(i&r|i&o|r&o)|0:c+(i^r^o)|0,a=o,o=r,r=0|Object(n.a)(i,30),i=e,e=c}this.state.hash[0]=this.state.hash[0]+e|0,this.state.hash[1]=this.state.hash[1]+i|0,this.state.hash[2]=this.state.hash[2]+r|0,this.state.hash[3]=this.state.hash[3]+o|0,this.state.hash[4]=this.state.hash[4]+a|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<56?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash()}}])&&a(e.prototype,i),r&&a(e,r),f}(r.a);e.a=f},function(t,e,i){"use strict";var r=i(0),n=i(3);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i=256&&(s[2]^=285),s[3]=s[2]^s[1],s[4]=s[2]<<1,s[4]>=256&&(s[4]^=285),s[5]=s[4]^s[1],s[8]=s[4]<<1,s[8]>=256&&(s[8]^=285),s[9]=s[8]^s[1],i[0][2*a]=s[e[0]]<<24|s[e[1]]<<16|s[e[2]]<<8|s[e[3]],i[0][2*a+1]=s[e[4]]<<24|s[e[5]]<<16|s[e[6]]<<8|s[e[7]];for(var c=1;c<8;c++)i[c][2*a]=Object(r.d)(i[0][2*a+1],i[0][2*a],c<<3),i[c][2*a+1]=Object(r.c)(i[0][2*a+1],i[0][2*a],c<<3)}n[0]=0,n[1]=0;for(var u=1;u<=10;u++)n[2*u]=4278190080&i[0][16*u-16]^16711680&i[1][16*u-14]^65280&i[2][16*u-12]^255&i[3][16*u-10],n[2*u+1]=4278190080&i[4][16*u-7]^16711680&i[5][16*u-5]^65280&i[6][16*u-3]^255&i[7][16*u-1];return[i,n]}!function(){!function(){for(var t=0;t<16;t++)m[p[t]]=0|t;for(var e=0;e<256;e++){var i=p[e>>4],r=m[15&e],n=d[i^r];h[e]=p[i^n]<<4|m[r^n]}}();var t=M(f,v);w=t[0],_=t[1],t=M(h,v),S=t[0],x=t[1],t=M(h,y),g=t[0],b=t[1]}();var E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(o,t);var e,i,r,n=u(o);function o(t){var e;switch(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=t||{}).type=t.type||"",t.rounds=t.rounds||10,(e=n.call(this,t)).options.type){case"0":case 0:e.C=w,e.RC=_;break;case"t":e.C=S,e.RC=x;break;default:e.C=g,e.RC=b}return e}return e=o,(i=[{key:"reset",value:function(){s(l(o.prototype),"reset",this).call(this),this.state.hash=new Array(16);for(var t=0;t<16;t++)this.state.hash[t]=0}},{key:"processBlock",value:function(t){for(var e=new Array(16),i=[],r=0;r<16;r++)i[r]=t[r]^(e[r]=this.state.hash[r])|0;for(var n=[],o=1;o<=this.options.rounds;o++){for(var a=0;a<8;a++){n[2*a]=0,n[2*a+1]=0;for(var s=0,c=56,u=0;s<8;s++,u=(c-=8)<32?1:0)n[2*a]^=this.C[s][2*(e[2*(a-s&7)+u]>>>c%32&255)],n[2*a+1]^=this.C[s][2*(e[2*(a-s&7)+u]>>>c%32&255)+1]}for(var l=0;l<16;l++)e[l]=n[l];e[0]^=this.RC[2*o],e[1]^=this.RC[2*o+1];for(var h=0;h<8;h++){n[2*h]=e[2*h],n[2*h+1]=e[2*h+1];for(var f=0,p=56,d=0;f<8;f++,d=(p-=8)<32?1:0)n[2*h]^=this.C[f][2*(i[2*(h-f&7)+d]>>>p%32&255)],n[2*h+1]^=this.C[f][2*(i[2*(h-f&7)+d]>>>p%32&255)+1]}for(var m=0;m<16;m++)i[m]=n[m]}for(var y=0;y<16;y++)this.state.hash[y]^=i[y]^t[y]}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<32?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash()}}])&&a(e.prototype,i),r&&a(e,r),o}(n.a);e.a=E},function(t,e,i){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){for(var i=0;i=this.blockSizeInBytes;){this.blockUnits=new Array(this.blockSizeInBytes);for(var t=0;t>0]|0;u=c<20?u+(i&r|~i&o)|0:c<40?u+(i^r^o)|0:c<60?u+(r^(i|~o))|0:u+(i^r^o)|0,a=o,o=r,r=0|Object(n.a)(i,p[c/20>>0]),i=e,e=u}this.state.hash[0]=this.state.hash[0]+e|0,this.state.hash[1]=this.state.hash[1]+i|0,this.state.hash[2]=this.state.hash[2]+r|0,this.state.hash[3]=this.state.hash[3]+o|0,this.state.hash[4]=this.state.hash[4]+a|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<56?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash()}}])&&a(e.prototype,i),r&&a(e,r),m}(r.a);e.a=m},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function n(t){for(var e="",i=t.length-t.length%3|0,n=0,o=0;o>18)+r.charAt(n>>12&63)+r.charAt(n>>6&63)+r.charAt(63&n);return t.length-i==2?(n=t.charCodeAt(i)<<16|t.charCodeAt(i+1)<<8,e+=r.charAt(n>>18)+r.charAt(n>>12&63)+r.charAt(n>>6&63)+"="):t.length-i==1&&(n=t.charCodeAt(i)<<16,e+=r.charAt(n>>18)+r.charAt(n>>12&63)+"=="),e}},function(t,e,i){"use strict";var r=i(5),n=i(0);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var i=0;i>0]|0;c=s<20?c+(i&r|~i&o)|0:s<40?c+(i^r^o)|0:s<60?c+(i&r|i&o|r&o)|0:c+(i^r^o)|0,a=o,o=r,r=0|Object(n.a)(i,30),i=e,e=c}this.state.hash[0]=this.state.hash[0]+e|0,this.state.hash[1]=this.state.hash[1]+i|0,this.state.hash[2]=this.state.hash[2]+r|0,this.state.hash[3]=this.state.hash[3]+o|0,this.state.hash[4]=this.state.hash[4]+a|0}},{key:"finalize",value:function(){return this.addPaddingISO7816(this.state.message.length<56?56-this.state.message.length|0:120-this.state.message.length|0),this.addLengthBits(),this.process(),this.getStateHash()}}])&&a(e.prototype,i),r&&a(e,r),f}(r.a);e.a=f},function(t,e,i){"use strict";function r(t){for(var e="",i=new Uint8Array(t),r=0;ri.blockSizeInBytes&&(i.update(e),e=i.finalize(),i.reset());for(var r=e.length;r{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=i(61798),e.createHash=e.Hash=i(23482),e.createHmac=e.Hmac=i(58355);var r=i(56042),n=Object.keys(r),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return o};var a=i(25632);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=i(53614);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var c=i(62607);e.DiffieHellmanGroup=c.DiffieHellmanGroup,e.createDiffieHellmanGroup=c.createDiffieHellmanGroup,e.getDiffieHellman=c.getDiffieHellman,e.createDiffieHellman=c.createDiffieHellman,e.DiffieHellman=c.DiffieHellman;var u=i(64743);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=i(76393);var l=i(7900);e.publicEncrypt=l.publicEncrypt,e.privateEncrypt=l.privateEncrypt,e.publicDecrypt=l.publicDecrypt,e.privateDecrypt=l.privateDecrypt;var h=i(77963);e.randomFill=h.randomFill,e.randomFillSync=h.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},40452:function(t,e,i){var r;t.exports=(r=i(78249),i(98269),i(68214),i(90888),i(75109),function(){var t=r,e=t.lib.BlockCipher,i=t.algo,n=[],o=[],a=[],s=[],c=[],u=[],l=[],h=[],f=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,r=0;for(e=0;e<256;e++){var d=r^r<<1^r<<2^r<<3^r<<4;d=d>>>8^255&d^99,n[i]=d,o[d]=i;var m=t[i],y=t[m],v=t[y],g=257*t[d]^16843008*d;a[i]=g<<24|g>>>8,s[i]=g<<16|g>>>16,c[i]=g<<8|g>>>24,u[i]=g,g=16843009*v^65537*y^257*m^16843008*i,l[d]=g<<24|g>>>8,h[d]=g<<16|g>>>16,f[d]=g<<8|g>>>24,p[d]=g,i?(i=m^t[t[t[v^m]]],r^=t[t[r]]):i=r=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4,r=4*((this._nRounds=i+6)+1),o=this._keySchedule=[],a=0;a6&&a%i==4&&(u=n[u>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u]):(u=n[(u=u<<8|u>>>24)>>>24]<<24|n[u>>>16&255]<<16|n[u>>>8&255]<<8|n[255&u],u^=d[a/i|0]<<24),o[a]=o[a-i]^u);for(var s=this._invKeySchedule=[],c=0;c>>24]]^h[n[u>>>16&255]]^f[n[u>>>8&255]]^p[n[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,c,u,n)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,l,h,f,p,o),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},_doCryptBlock:function(t,e,i,r,n,o,a,s){for(var c=this._nRounds,u=t[e]^i[0],l=t[e+1]^i[1],h=t[e+2]^i[2],f=t[e+3]^i[3],p=4,d=1;d>>24]^n[l>>>16&255]^o[h>>>8&255]^a[255&f]^i[p++],y=r[l>>>24]^n[h>>>16&255]^o[f>>>8&255]^a[255&u]^i[p++],v=r[h>>>24]^n[f>>>16&255]^o[u>>>8&255]^a[255&l]^i[p++],g=r[f>>>24]^n[u>>>16&255]^o[l>>>8&255]^a[255&h]^i[p++];u=m,l=y,h=v,f=g}m=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[h>>>8&255]<<8|s[255&f])^i[p++],y=(s[l>>>24]<<24|s[h>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^i[p++],v=(s[h>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^i[p++],g=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&h])^i[p++],t[e]=m,t[e+1]=y,t[e+2]=v,t[e+3]=g},keySize:8});t.AES=e._createHelper(m)}(),r.AES)},87407:function(t,e,i){var r;t.exports=(r=i(78249),i(98269),i(68214),i(90888),i(75109),function(){var t=r,e=t.lib.BlockCipher,i=t.algo;const n=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var s={pbox:[],sbox:[]};function c(t,e){let i=e>>24&255,r=e>>16&255,n=e>>8&255,o=255&e,a=t.sbox[0][i]+t.sbox[1][r];return a^=t.sbox[2][n],a+=t.sbox[3][o],a}function u(t,e,i){let r,o=e,a=i;for(let e=0;e1;--e)o^=t.pbox[e],a=c(t,o)^a,r=o,o=a,a=r;return r=o,o=a,a=r,a^=t.pbox[1],o^=t.pbox[0],{left:o,right:a}}function h(t,e,i){for(let e=0;e<4;e++){t.sbox[e]=[];for(let i=0;i<256;i++)t.sbox[e][i]=a[e][i]}let r=0;for(let a=0;a=i&&(r=0);let s=0,c=0,l=0;for(let e=0;e>>2];t.sigBytes-=e}},m=(i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:d}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,i&&i.words):(this._mode=t.call(r,this,i&&i.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),i.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?o.create([1398893684,1701076831]).concat(i).concat(e):e).toString(c)},parse:function(t){var e,i=c.parse(t),r=i.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=o.create(r.slice(2,4)),r.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},v=i.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var n=t.createEncryptor(i,r),o=n.finalize(e),a=n.cfg;return m.create({ciphertext:o,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(i,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),g=(e.kdf={}).OpenSSL={execute:function(t,e,i,r,n){if(r||(r=o.random(8)),n)a=u.create({keySize:e+i,hasher:n}).compute(t,r);else var a=u.create({keySize:e+i}).compute(t,r);var s=o.create(a.words.slice(e),4*i);return a.sigBytes=4*e,m.create({key:a,iv:s,salt:r})}},b=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:g}),encrypt:function(t,e,i,r){var n=(r=this.cfg.extend(r)).kdf.execute(i,t.keySize,t.ivSize,r.salt,r.hasher);r.iv=n.iv;var o=v.encrypt.call(this,t,e,n.key,r);return o.mixIn(n),o},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var n=r.kdf.execute(i,t.keySize,t.ivSize,e.salt,r.hasher);return r.iv=n.iv,v.decrypt.call(this,t,e,n.key,r)}})}()))},78249:function(t,e,i){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==i.g&&i.g.crypto&&(r=i.g.crypto),!r)try{r=i(42480)}catch(t){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),a={},s=a.lib={},c=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=c.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,n=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=i[s>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-n%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new u.init(i,e/2)}},f=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new u.init(i,e)}},p=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},d=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i,r=this._data,n=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,l=t.min(4*c,o);if(c){for(var h=0;h>>6-a%4*2;n[o>>>2]|=s<<24-o%4*8,o++}return e.create(n,o)}t.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var n=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=s<<24-o%4*8,o++}return e.create(n,o)}t.enc.Base64url={stringify:function(t,e){void 0===e&&(e=!0);var i=t.words,r=t.sigBytes,n=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(i[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|i[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c>>6*(3-c)&63));var u=n.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(t,e){void 0===e&&(e=!0);var r=t.length,n=e?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>16-n%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var i=t.length,r=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(r,2*i)}},i.Utf16LE={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(t){for(var i=t.length,r=[],o=0;o>>1]|=n(t.charCodeAt(o)<<16-o%2*16);return e.create(r,2*i)}}}(),r.enc.Utf16)},90888:function(t,e,i){var r,n,o,a,s,c,u,l;t.exports=(l=i(78249),i(62783),i(89824),n=(r=l).lib,o=n.Base,a=n.WordArray,s=r.algo,c=s.MD5,u=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var i,r=this.cfg,n=r.hasher.create(),o=a.create(),s=o.words,c=r.keySize,u=r.iterations;s.lengthr&&(e=t.finalize(e)),e.clamp();for(var n=this._oKey=e.clone(),o=this._iKey=e.clone(),s=n.words,c=o.words,u=0;u>>2]|=t[n]<<24-n%4*8;e.call(this,r,i)}else e.apply(this,arguments)};i.prototype=t}}(),r.lib.WordArray)},68214:function(t,e,i){var r;t.exports=(r=i(78249),function(t){var e=r,i=e.lib,n=i.WordArray,o=i.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,n=t[r];t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],p=t[e+2],d=t[e+3],m=t[e+4],y=t[e+5],v=t[e+6],g=t[e+7],b=t[e+8],w=t[e+9],_=t[e+10],S=t[e+11],x=t[e+12],M=t[e+13],E=t[e+14],k=t[e+15],O=o[0],C=o[1],A=o[2],P=o[3];O=u(O,C,A,P,a,7,s[0]),P=u(P,O,C,A,c,12,s[1]),A=u(A,P,O,C,p,17,s[2]),C=u(C,A,P,O,d,22,s[3]),O=u(O,C,A,P,m,7,s[4]),P=u(P,O,C,A,y,12,s[5]),A=u(A,P,O,C,v,17,s[6]),C=u(C,A,P,O,g,22,s[7]),O=u(O,C,A,P,b,7,s[8]),P=u(P,O,C,A,w,12,s[9]),A=u(A,P,O,C,_,17,s[10]),C=u(C,A,P,O,S,22,s[11]),O=u(O,C,A,P,x,7,s[12]),P=u(P,O,C,A,M,12,s[13]),A=u(A,P,O,C,E,17,s[14]),O=l(O,C=u(C,A,P,O,k,22,s[15]),A,P,c,5,s[16]),P=l(P,O,C,A,v,9,s[17]),A=l(A,P,O,C,S,14,s[18]),C=l(C,A,P,O,a,20,s[19]),O=l(O,C,A,P,y,5,s[20]),P=l(P,O,C,A,_,9,s[21]),A=l(A,P,O,C,k,14,s[22]),C=l(C,A,P,O,m,20,s[23]),O=l(O,C,A,P,w,5,s[24]),P=l(P,O,C,A,E,9,s[25]),A=l(A,P,O,C,d,14,s[26]),C=l(C,A,P,O,b,20,s[27]),O=l(O,C,A,P,M,5,s[28]),P=l(P,O,C,A,p,9,s[29]),A=l(A,P,O,C,g,14,s[30]),O=h(O,C=l(C,A,P,O,x,20,s[31]),A,P,y,4,s[32]),P=h(P,O,C,A,b,11,s[33]),A=h(A,P,O,C,S,16,s[34]),C=h(C,A,P,O,E,23,s[35]),O=h(O,C,A,P,c,4,s[36]),P=h(P,O,C,A,m,11,s[37]),A=h(A,P,O,C,g,16,s[38]),C=h(C,A,P,O,_,23,s[39]),O=h(O,C,A,P,M,4,s[40]),P=h(P,O,C,A,a,11,s[41]),A=h(A,P,O,C,d,16,s[42]),C=h(C,A,P,O,v,23,s[43]),O=h(O,C,A,P,w,4,s[44]),P=h(P,O,C,A,x,11,s[45]),A=h(A,P,O,C,k,16,s[46]),O=f(O,C=h(C,A,P,O,p,23,s[47]),A,P,a,6,s[48]),P=f(P,O,C,A,g,10,s[49]),A=f(A,P,O,C,E,15,s[50]),C=f(C,A,P,O,y,21,s[51]),O=f(O,C,A,P,x,6,s[52]),P=f(P,O,C,A,d,10,s[53]),A=f(A,P,O,C,_,15,s[54]),C=f(C,A,P,O,c,21,s[55]),O=f(O,C,A,P,b,6,s[56]),P=f(P,O,C,A,k,10,s[57]),A=f(A,P,O,C,v,15,s[58]),C=f(C,A,P,O,M,21,s[59]),O=f(O,C,A,P,m,6,s[60]),P=f(P,O,C,A,S,10,s[61]),A=f(A,P,O,C,p,15,s[62]),C=f(C,A,P,O,w,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+P|0},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;i[n>>>5]|=128<<24-n%32;var o=t.floor(r/4294967296),a=r;i[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i[14+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,i,r,n,o,a){var s=t+(e&i|~e&r)+n+a;return(s<>>32-o)+e}function l(t,e,i,r,n,o,a){var s=t+(e&r|i&~r)+n+a;return(s<>>32-o)+e}function h(t,e,i,r,n,o,a){var s=t+(e^i^r)+n+a;return(s<>>32-o)+e}function f(t,e,i,r,n,o,a){var s=t+(i^(e|~r))+n+a;return(s<>>32-o)+e}e.MD5=o._createHelper(c),e.HmacMD5=o._createHmacHelper(c)}(Math),r.MD5)},8568:function(t,e,i){var r;t.exports=(r=i(78249),i(75109),r.mode.CFB=function(){var t=r.lib.BlockCipherMode.extend();function e(t,e,i,r){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,r.encryptBlock(n,0);for(var a=0;a>24&255)){var e=t>>16&255,i=t>>8&255,r=255&t;255===e?(e=0,255===i?(i=0,255===r?r=0:++r):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=r}else t+=1<<24;return t}function i(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var n=t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),i(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Ansix923)},92807:function(t,e,i){var r;t.exports=(r=i(78249),i(75109),r.pad.Iso10126={pad:function(t,e){var i=4*e,n=i-t.sigBytes%i;t.concat(r.lib.WordArray.random(n-1)).concat(r.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Iso10126)},71077:function(t,e,i){var r;t.exports=(r=i(78249),i(75109),r.pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},16991:function(t,e,i){var r;t.exports=(r=i(78249),i(75109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},56475:function(t,e,i){var r;t.exports=(r=i(78249),i(75109),r.pad.ZeroPadding={pad:function(t,e){var i=4*e;t.clamp(),t.sigBytes+=i-(t.sigBytes%i||i)},unpad:function(t){var e=t.words,i=t.sigBytes-1;for(i=t.sigBytes-1;i>=0;i--)if(e[i>>>2]>>>24-i%4*8&255){t.sigBytes=i+1;break}}},r.pad.ZeroPadding)},2112:function(t,e,i){var r,n,o,a,s,c,u,l,h;t.exports=(h=i(78249),i(52153),i(89824),n=(r=h).lib,o=n.Base,a=n.WordArray,s=r.algo,c=s.SHA256,u=s.HMAC,l=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var i=this.cfg,r=u.create(i.hasher,t),n=a.create(),o=a.create([1]),s=n.words,c=o.words,l=i.keySize,h=i.iterations;s.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)r[n]^=i[n+4&7];if(e){var o=e.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,f=l<<16|65535&u;for(r[0]^=u,r[1]^=h,r[2]^=l,r[3]^=f,r[4]^=u,r[5]^=h,r[6]^=l,r[7]^=f,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),n[0]=i[0]^i[5]>>>16^i[3]<<16,n[1]=i[2]^i[7]>>>16^i[5]<<16,n[2]=i[4]^i[1]>>>16^i[7]<<16,n[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)n[r]=16711935&(n[r]<<8|n[r]>>>24)|4278255360&(n[r]<<24|n[r]>>>8),t[e+r]^=n[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)o[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],n=65535&r,s=r>>>16,c=((n*n>>>17)+n*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[i]=c^u}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),r.RabbitLegacy)},84454:function(t,e,i){var r;t.exports=(r=i(78249),i(98269),i(68214),i(90888),i(75109),function(){var t=r,e=t.lib.StreamCipher,i=t.algo,n=[],o=[],a=[],s=i.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(e){var o=e.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=h,n[6]^=l,n[7]^=f,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),n[0]=i[0]^i[5]>>>16^i[3]<<16,n[1]=i[2]^i[7]>>>16^i[5]<<16,n[2]=i[4]^i[1]>>>16^i[7]<<16,n[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)n[r]=16711935&(n[r]<<8|n[r]>>>24)|4278255360&(n[r]<<24|n[r]>>>8),t[e+r]^=n[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)o[i]=e[i];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,i=0;i<8;i++){var r=t[i]+e[i],n=65535&r,s=r>>>16,c=((n*n>>>17)+n*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[i]=c^u}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),r.Rabbit)},51857:function(t,e,i){var r;t.exports=(r=i(78249),i(98269),i(68214),i(90888),i(75109),function(){var t=r,e=t.lib.StreamCipher,i=t.algo,n=i.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes,r=this._S=[],n=0;n<256;n++)r[n]=n;n=0;for(var o=0;n<256;n++){var a=n%i,s=e[a>>>2]>>>24-a%4*8&255;o=(o+r[n]+s)%256;var c=r[n];r[n]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,i=this._j,r=0,n=0;n<4;n++){i=(i+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[i],t[i]=o,r|=t[(t[e]+t[i])%256]<<24-8*n}return this._i=e,this._j=i,r}t.RC4=e._createHelper(n);var a=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(a)}(),r.RC4)},30706:function(t,e,i){var r;t.exports=(r=i(78249),function(t){var e=r,i=e.lib,n=i.WordArray,o=i.Hasher,a=e.algo,s=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=n.create([0,1518500249,1859775393,2400959708,2840853838]),f=n.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,n=t[r];t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,a,p,w,_,S,x,M,E,k,O,C=this._hash.words,A=h.words,P=f.words,j=s.words,T=c.words,R=u.words,I=l.words;for(S=o=C[0],x=a=C[1],M=p=C[2],E=w=C[3],k=_=C[4],i=0;i<80;i+=1)O=o+t[e+j[i]]|0,O+=i<16?d(a,p,w)+A[0]:i<32?m(a,p,w)+A[1]:i<48?y(a,p,w)+A[2]:i<64?v(a,p,w)+A[3]:g(a,p,w)+A[4],O=(O=b(O|=0,R[i]))+_|0,o=_,_=w,w=b(p,10),p=a,a=O,O=S+t[e+T[i]]|0,O+=i<16?g(x,M,E)+P[0]:i<32?v(x,M,E)+P[1]:i<48?y(x,M,E)+P[2]:i<64?m(x,M,E)+P[3]:d(x,M,E)+P[4],O=(O=b(O|=0,I[i]))+k|0,S=k,k=E,E=b(M,10),M=x,x=O;O=C[1]+p+E|0,C[1]=C[2]+w+k|0,C[2]=C[3]+_+S|0,C[3]=C[4]+o+x|0,C[4]=C[0]+a+M|0,C[0]=O},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,i){return t^e^i}function m(t,e,i){return t&e|~t&i}function y(t,e,i){return(t|~e)^i}function v(t,e,i){return t&i|e&~i}function g(t,e,i){return t^(e|~i)}function b(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(p),e.HmacRIPEMD160=o._createHmacHelper(p)}(Math),r.RIPEMD160)},62783:function(t,e,i){var r,n,o,a,s,c,u,l;t.exports=(l=i(78249),n=(r=l).lib,o=n.WordArray,a=n.Hasher,s=r.algo,c=[],u=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],u=0;u<80;u++){if(u<16)c[u]=0|t[e+u];else{var l=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+s+c[u];h+=u<20?1518500249+(n&o|~n&a):u<40?1859775393+(n^o^a):u<60?(n&o|n&a|o&a)-1894007588:(n^o^a)-899497514,s=a,a=o,o=n<<30|n>>>2,n=r,r=h}i[0]=i[0]+r|0,i[1]=i[1]+n|0,i[2]=i[2]+o|0,i[3]=i[3]+a|0,i[4]=i[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(r+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=a._createHelper(u),r.HmacSHA1=a._createHmacHelper(u),l.SHA1)},87792:function(t,e,i){var r,n,o,a,s,c;t.exports=(c=i(78249),i(52153),n=(r=c).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),c.SHA224)},52153:function(t,e,i){var r;t.exports=(r=i(78249),function(t){var e=r,i=e.lib,n=i.WordArray,o=i.Hasher,a=e.algo,s=[],c=[];!function(){function e(e){for(var i=t.sqrt(e),r=2;r<=i;r++)if(!(e%r))return!1;return!0}function i(t){return 4294967296*(t-(0|t))|0}for(var r=2,n=0;n<64;)e(r)&&(n<8&&(s[n]=i(t.pow(r,.5))),c[n]=i(t.pow(r,1/3)),n++),r++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],h=i[6],f=i[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var d=u[p-15],m=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,y=u[p-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[p]=m+u[p-7]+v+u[p-16]}var g=r&n^r&o^n&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+c[p]+u[p];f=h,h=l,l=s,s=a+w|0,a=o,o=n,n=r,r=w+(b+g)|0}i[0]=i[0]+r|0,i[1]=i[1]+n|0,i[2]=i[2]+o|0,i[3]=i[3]+a|0,i[4]=i[4]+s|0,i[5]=i[5]+l|0,i[6]=i[6]+h|0,i[7]=i[7]+f|0},_doFinalize:function(){var e=this._data,i=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=t.floor(r/4294967296),i[15+(n+64>>>9<<4)]=r,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(l),e.HmacSHA256=o._createHmacHelper(l)}(Math),r.SHA256)},13327:function(t,e,i){var r;t.exports=(r=i(78249),i(64938),function(t){var e=r,i=e.lib,n=i.WordArray,o=i.Hasher,a=e.x64.Word,s=e.algo,c=[],u=[],l=[];!function(){for(var t=1,e=0,i=0;i<24;i++){c[t+5*e]=(i+1)*(i+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,o=0;o<24;o++){for(var s=0,h=0,f=0;f<7;f++){if(1&n){var p=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=i[n]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,d=0,m=0;m<5;m++)p^=(C=i[f+5*m]).high,d^=C.low;var y=h[f];y.high=p,y.low=d}for(f=0;f<5;f++){var v=h[(f+4)%5],g=h[(f+1)%5],b=g.high,w=g.low;for(p=v.high^(b<<1|w>>>31),d=v.low^(w<<1|b>>>31),m=0;m<5;m++)(C=i[f+5*m]).high^=p,C.low^=d}for(var _=1;_<25;_++){var S=(C=i[_]).high,x=C.low,M=c[_];M<32?(p=S<>>32-M,d=x<>>32-M):(p=x<>>64-M,d=S<>>64-M);var E=h[u[_]];E.high=p,E.low=d}var k=h[0],O=i[0];for(k.high=O.high,k.low=O.low,f=0;f<5;f++)for(m=0;m<5;m++){var C=i[_=f+5*m],A=h[_],P=h[(f+1)%5+5*m],j=h[(f+2)%5+5*m];C.high=A.high^~P.high&j.high,C.low=A.low^~P.low&j.low}C=i[0];var T=l[s];C.high^=T.high,C.low^=T.low}},_doFinalize:function(){var e=this._data,i=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;i[r>>>5]|=1<<24-r%32,i[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*i.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new n.init(u,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});e.SHA3=o._createHelper(f),e.HmacSHA3=o._createHmacHelper(f)}(Math),r.SHA3)},17460:function(t,e,i){var r,n,o,a,s,c,u,l;t.exports=(l=i(78249),i(64938),i(70034),n=(r=l).x64,o=n.Word,a=n.WordArray,s=r.algo,c=s.SHA512,u=s.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),r.SHA384=c._createHelper(u),r.HmacSHA384=c._createHmacHelper(u),l.SHA384)},70034:function(t,e,i){var r;t.exports=(r=i(78249),i(64938),function(){var t=r,e=t.lib.Hasher,i=t.x64,n=i.Word,o=i.WordArray,a=t.algo;function s(){return n.create.apply(n,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var t=0;t<80;t++)u[t]=s()}();var l=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],h=i[6],f=i[7],p=r.high,d=r.low,m=n.high,y=n.low,v=o.high,g=o.low,b=a.high,w=a.low,_=s.high,S=s.low,x=l.high,M=l.low,E=h.high,k=h.low,O=f.high,C=f.low,A=p,P=d,j=m,T=y,R=v,I=g,N=b,D=w,L=_,B=S,F=x,U=M,z=E,q=k,K=O,H=C,W=0;W<80;W++){var G,V,Z=u[W];if(W<16)V=Z.high=0|t[e+2*W],G=Z.low=0|t[e+2*W+1];else{var $=u[W-15],J=$.high,X=$.low,Y=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),tt=u[W-2],et=tt.high,it=tt.low,rt=(et>>>19|it<<13)^(et<<3|it>>>29)^et>>>6,nt=(it>>>19|et<<13)^(it<<3|et>>>29)^(it>>>6|et<<26),ot=u[W-7],at=ot.high,st=ot.low,ct=u[W-16],ut=ct.high,lt=ct.low;V=(V=(V=Y+at+((G=Q+st)>>>0>>0?1:0))+rt+((G+=nt)>>>0>>0?1:0))+ut+((G+=lt)>>>0>>0?1:0),Z.high=V,Z.low=G}var ht,ft=L&F^~L&z,pt=B&U^~B&q,dt=A&j^A&R^j&R,mt=P&T^P&I^T&I,yt=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),vt=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),gt=(L>>>14|B<<18)^(L>>>18|B<<14)^(L<<23|B>>>9),bt=(B>>>14|L<<18)^(B>>>18|L<<14)^(B<<23|L>>>9),wt=c[W],_t=wt.high,St=wt.low,xt=K+gt+((ht=H+bt)>>>0>>0?1:0),Mt=vt+mt;K=z,H=q,z=F,q=U,F=L,U=B,L=N+(xt=(xt=(xt=xt+ft+((ht+=pt)>>>0>>0?1:0))+_t+((ht+=St)>>>0>>0?1:0))+V+((ht+=G)>>>0>>0?1:0))+((B=D+ht|0)>>>0>>0?1:0)|0,N=R,D=I,R=j,I=T,j=A,T=P,A=xt+(yt+dt+(Mt>>>0>>0?1:0))+((P=ht+Mt|0)>>>0>>0?1:0)|0}d=r.low=d+P,r.high=p+A+(d>>>0

>>0?1:0),y=n.low=y+T,n.high=m+j+(y>>>0>>0?1:0),g=o.low=g+I,o.high=v+R+(g>>>0>>0?1:0),w=a.low=w+D,a.high=b+N+(w>>>0>>0?1:0),S=s.low=S+B,s.high=_+L+(S>>>0>>0?1:0),M=l.low=M+U,l.high=x+F+(M>>>0>>0?1:0),k=h.low=k+q,h.high=E+z+(k>>>0>>0?1:0),C=f.low=C+H,f.high=O+K+(C>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(r+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l)}(),r.SHA512)},94253:function(t,e,i){var r;t.exports=(r=i(78249),i(98269),i(68214),i(90888),i(75109),function(){var t=r,e=t.lib,i=e.WordArray,n=e.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],i=0;i<56;i++){var r=a[i]-1;e[i]=t[r>>>5]>>>31-r%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){var u=n[o]=[],l=c[o];for(i=0;i<24;i++)u[i/6|0]|=e[(s[i]-1+l)%28]<<31-i%6,u[4+(i/6|0)]|=e[28+(s[i+24]-1+l)%28]<<31-i%6;for(u[0]=u[0]<<1|u[0]>>>31,i=1;i<7;i++)u[i]=u[i]>>>4*(i-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(i=0;i<16;i++)h[i]=n[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var n=i[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^n[c])&l[c])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<192.");var e=t.slice(0,2),r=t.length<4?t.slice(0,2):t.slice(2,4),n=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(i.create(e)),this._des2=h.createEncryptor(i.create(r)),this._des3=h.createEncryptor(i.create(n))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=n._createHelper(d)}(),r.TripleDES)},64938:function(t,e,i){var r;t.exports=(r=i(78249),function(t){var e=r,i=e.lib,n=i.Base,o=i.WordArray,a=e.x64={};a.Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=n.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:8*e.length},toX32:function(){for(var t=this.words,e=t.length,i=[],r=0;r{"use strict";var r=i(31044)(),n=i(40210),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(t){o=!1}var a=n("%SyntaxError%"),s=n("%TypeError%"),c=i(27296);t.exports=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!c&&c(t,e);if(o)o(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===r&&h?h.enumerable:!r,value:i,writable:null===n&&h?h.writable:!n});else{if(!l&&(r||n||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=i}}},4289:(t,e,i)=>{"use strict";var r=i(82215),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=i(12296),c=i(31044)(),u=function(t,e,i,r){if(e in t)if(!0===r){if(t[e]===i)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;c?s(t,e,i,!0):s(t,e,i)},l=function(t,e){var i=arguments.length>2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s{"use strict";e.utils=i(11278),e.Cipher=i(55756),e.DES=i(70778),e.CBC=i(39051),e.EDE=i(50651)},39051:(t,e,i)=>{"use strict";var r=i(79746),n=i(35717),o={};function a(t){r.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e{"use strict";var r=i(79746);function n(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==t.padding}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},n.prototype._buffer=function(t,e){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-e),r=0;r0;r--)e+=this._buffer(t,e),i+=this._flushBuffer(n,i);return e+=this._buffer(t,e),n},n.prototype.final=function(t){var e,i;return t&&(e=this.update(t)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(i):i},n.prototype._pad=function(t,e){if(0===e)return!1;for(;e{"use strict";var r=i(79746),n=i(35717),o=i(11278),a=i(55756);function s(){this.tmp=new Array(2),this.keys=null}function c(t){a.call(this,t);var e=new s;this._desState=e,this.deriveKeys(e,t.key)}n(c,a),t.exports=c,c.create=function(t){return new c(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(t,e){t.keys=new Array(32),r.equal(e.length,this.blockSize,"Invalid key length");var i=o.readUInt32BE(e,0),n=o.readUInt32BE(e,4);o.pc1(i,n,t.tmp,0),i=t.tmp[0],n=t.tmp[1];for(var a=0;a>>1];i=o.r28shl(i,s),n=o.r28shl(n,s),o.pc2(i,n,t.keys,a)}},c.prototype._update=function(t,e,i,r){var n=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,s,n.tmp,0):this._decrypt(n,a,s,n.tmp,0),a=n.tmp[0],s=n.tmp[1],o.writeUInt32BE(i,a,r),o.writeUInt32BE(i,s,r+4)},c.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var i=t.length-e,r=e;r>>0,a=f}o.rip(s,a,r,n)},c.prototype._decrypt=function(t,e,i,r,n){for(var a=i,s=e,c=t.keys.length-2;c>=0;c-=2){var u=t.keys[c],l=t.keys[c+1];o.expand(a,t.tmp,0),u^=t.tmp[0],l^=t.tmp[1];var h=o.substitute(u,l),f=a;a=(s^o.permute(h))>>>0,s=f}o.rip(a,s,r,n)}},50651:(t,e,i)=>{"use strict";var r=i(79746),n=i(35717),o=i(55756),a=i(70778);function s(t,e){r.equal(e.length,24,"Invalid key length");var i=e.slice(0,8),n=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:n}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:n}),a.create({type:"decrypt",key:i})]}function c(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}n(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,i,r){var n=this._edeState;n.ciphers[0]._update(t,e,i,r),n.ciphers[1]._update(i,r,i,r),n.ciphers[2]._update(i,r,i,r)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},11278:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,i){t[0+i]=e>>>24,t[1+i]=e>>>16&255,t[2+i]=e>>>8&255,t[3+i]=255&e},e.ip=function(t,e,i,r){for(var n=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}i[r+0]=n>>>0,i[r+1]=o>>>0},e.rip=function(t,e,i,r){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=e>>>s+a&1,n<<=1,n|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;i[r+0]=n>>>0,i[r+1]=o>>>0},e.pc1=function(t,e,i,r){for(var n=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;i[r+0]=n>>>0,i[r+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var o=0,a=0,s=i.length>>>1,c=0;c>>i[c]&1;for(c=s;c>>i[c]&1;r[n+0]=o>>>0,r[n+1]=a>>>0},e.expand=function(t,e,i){var r=0,n=0;r=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)r<<=6,r|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[i+0]=r>>>0,e[i+1]=n>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var i=0,n=0;n<4;n++){i<<=4,i|=r[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=r[256+64*n+(e>>>18-6*n&63)]}return i>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,i=0;i>>n[i]&1;return e>>>0},e.padSplit=function(t,e,i){for(var r=t.toString(2);r.length{var r=i(99649),n=i(43590),o=i(29799),a=i(57426);var s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new r(o[t].prime,"hex"),i=new r(o[t].gen,"hex");return new a(e,i)},e.createDiffieHellman=e.DiffieHellman=function t(e,i,o,c){return r.isBuffer(i)||void 0===s[i]?t(e,"binary",i,o):(i=i||"binary",c=c||"binary",o=o||new r([2]),r.isBuffer(o)||(o=new r(o,c)),"number"==typeof e?new a(n(e,o),o,!0):(r.isBuffer(e)||(e=new r(e,i)),new a(e,o,!0)))}},57426:(t,e,i)=>{var r=i(99649),n=i(83620),o=new(i(63047)),a=new n(24),s=new n(11),c=new n(10),u=new n(3),l=new n(7),h=i(43590),f=i(61798);function p(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new n(t),this}function d(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new n(t),this}t.exports=y;var m={};function y(t,e,i){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=p,this.setPrivateKey=d):this._primeCode=8}function v(t,e){var i=new r(t.toArray());return e?i.toString(e):i}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var i=e.toString("hex"),r=[i,t.toString(16)].join("_");if(r in m)return m[r];var n,f=0;if(t.isEven()||!h.simpleSieve||!h.fermatTest(t)||!o.test(t))return f+=1,f+="02"===i||"05"===i?8:4,m[r]=f,f;switch(o.test(t.shrn(1))||(f+=2),i){case"02":t.mod(a).cmp(s)&&(f+=8);break;case"05":(n=t.mod(c)).cmp(u)&&n.cmp(l)&&(f+=8);break;default:f+=4}return m[r]=f,f}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(t){var e=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(e.toArray()),o=this.getPrime();if(i.length{var r=i(61798);t.exports=g,g.simpleSieve=y,g.fermatTest=v;var n=i(83620),o=new n(24),a=new(i(63047)),s=new n(1),c=new n(2),u=new n(5),l=(new n(16),new n(8),new n(10)),h=new n(3),f=(new n(7),new n(11)),p=new n(4),d=(new n(12),null);function m(){if(null!==d)return d;var t=[];t[0]=2;for(var e=1,i=3;i<1048576;i+=2){for(var r=Math.ceil(Math.sqrt(i)),n=0;nt;)i.ishrn(1);if(i.isEven()&&i.iadd(s),i.testn(1)||i.iadd(c),e.cmp(c)){if(!e.cmp(u))for(;i.mod(l).cmp(h);)i.iadd(p)}else for(;i.mod(o).cmp(f);)i.iadd(p);if(y(d=i.shrn(1))&&y(i)&&v(d)&&v(i)&&a.test(d)&&a.test(i))return i}}},83620:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function o(t,e,i){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(58609).Buffer}catch(t){}function s(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},86266:(t,e,i)=>{"use strict";var r=e;r.version=i(18597).i8,r.utils=i(80953),r.rand=i(29931),r.curve=i(88254),r.curves=i(45427),r.ec=i(57954),r.eddsa=i(65980)},4918:(t,e,i)=>{"use strict";var r=i(73785),n=i(80953),o=n.getNAF,a=n.getJSF,s=n.assert;function c(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){s(t.precomputed);var i=t._getDoubles(),r=o(e,1,this._bitLength),n=(1<=a;l--)c=(c<<1)+r[l];u.push(c)}for(var h=this.jpoint(null,null,null),f=this.jpoint(null,null,null),p=n;p>0;p--){for(a=0;a=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var h=a[u];s(0!==h),c="affine"===t.type?h>0?c.mixedAdd(n[h-1>>1]):c.mixedAdd(n[-h-1>>1].neg()):h>0?c.add(n[h-1>>1]):c.add(n[-h-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,i,r,n){var s,c,u,l=this._wnafT1,h=this._wnafT2,f=this._wnafT3,p=0;for(s=0;s=1;s-=2){var m=s-1,y=s;if(1===l[m]&&1===l[y]){var v=[e[m],null,null,e[y]];0===e[m].y.cmp(e[y].y)?(v[1]=e[m].add(e[y]),v[2]=e[m].toJ().mixedAdd(e[y].neg())):0===e[m].y.cmp(e[y].y.redNeg())?(v[1]=e[m].toJ().mixedAdd(e[y]),v[2]=e[m].add(e[y].neg())):(v[1]=e[m].toJ().mixedAdd(e[y]),v[2]=e[m].toJ().mixedAdd(e[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=a(i[m],i[y]);for(p=Math.max(b[0].length,p),f[m]=new Array(p),f[y]=new Array(p),c=0;c=0;s--){for(var M=0;s>=0;){var E=!0;for(c=0;c=0&&M++,S=S.dblp(M),s<0)break;for(c=0;c0?u=h[c][k-1>>1]:k<0&&(u=h[c][-k-1>>1].neg()),S="affine"===u.type?S.mixedAdd(u):S.add(u))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n{"use strict";var r=i(80953),n=i(73785),o=i(35717),a=i(4918),s=r.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,i,r,o){a.BasePoint.call(this,t,"projective"),null===e&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(i,16),this.z=r?new n(r,16):this.curve.one,this.t=o&&new n(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,a),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,i,r){return this.point(t,e,i,r)},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=r.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},c.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),i=t.y.redSqr(),r=e.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(i)));return 0===r.cmp(n)},o(u,a.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,i,r){return new u(this,t,e,i,r)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=r.redAdd(e),a=o.redSub(i),s=r.redSub(e),c=n.redMul(a),u=o.redMul(s),l=n.redMul(s),h=a.redMul(o);return this.curve.point(c,u,h,l)},u.prototype._projDbl=function(){var t,e,i,r,n,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(t=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(r.redSub(c)),i=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),o=u.redSub(n).redISub(n),t=a.redSub(s).redISub(c).redMul(o),e=u.redMul(r.redSub(c)),i=u.redMul(o))}else r=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),o=r.redSub(n).redSub(n),t=this.curve._mulC(a.redISub(r)).redMul(o),e=this.curve._mulC(r).redMul(s.redISub(c)),i=r.redMul(o);return this.curve.point(t,e,i)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=i.redSub(e),a=n.redSub(r),s=n.redAdd(r),c=i.redAdd(e),u=o.redMul(a),l=s.redMul(c),h=o.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,h)},u.prototype._projAdd=function(t){var e,i,r=this.z.redMul(t.z),n=r.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=n.redSub(s),u=n.redAdd(s),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=r.redMul(c).redMul(l);return this.curve.twisted?(e=r.redMul(u).redMul(a.redSub(this.curve._mulA(o))),i=c.redMul(u)):(e=r.redMul(u).redMul(a.redSub(o)),i=this.curve._mulC(c).redMul(u)),this.curve.point(h,e,i)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!1)},u.prototype.jmulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var i=t.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},88254:(t,e,i)=>{"use strict";var r=e;r.base=i(4918),r.short=i(6673),r.mont=i(22881),r.edwards=i(31138)},22881:(t,e,i)=>{"use strict";var r=i(73785),n=i(35717),o=i(4918),a=i(80953);function s(t){o.call(this,"mont",t),this.a=new r(t.a,16).toRed(this.red),this.b=new r(t.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(t,e,i){o.BasePoint.call(this,t,"projective"),null===e&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(e,16),this.z=new r(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,i=e.redSqr(),r=i.redMul(e).redAdd(i.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},n(c,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new c(this,t,e)},s.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),i=t.redSub(e),r=t.redMul(e),n=i.redMul(e.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(i),a=n.redMul(r),s=e.z.redMul(o.redAdd(a).redSqr()),c=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(t){for(var e=t.clone(),i=this,r=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,i)=>{"use strict";var r=i(80953),n=i(73785),o=i(35717),a=i(4918),s=r.assert;function c(t){a.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,i,r){a.BasePoint.call(this,t,"affine"),null===e&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(t,e,i,r){a.BasePoint.call(this,t,"jacobian"),null===e&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(i,16),this.z=new n(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,a),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,i;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)i=new n(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?i=o[0]:(i=o[1],s(0===this.g.mul(i).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:i,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(i)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),i=new n(2).toRed(e).redInvm(),r=i.redNeg(),o=new n(3).toRed(e).redNeg().redSqrt().redMul(i);return[r.redAdd(o).fromRed(),r.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,i,r,o,a,s,c,u,l,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,p=this.n.clone(),d=new n(1),m=new n(0),y=new n(0),v=new n(1),g=0;0!==f.cmpn(0);){var b=p.div(f);u=p.sub(b.mul(f)),l=y.sub(b.mul(d));var w=v.sub(b.mul(m));if(!r&&u.cmp(h)<0)e=c.neg(),i=d,r=u.neg(),o=l;else if(r&&2==++g)break;c=u,p=f,f=u,y=d,d=l,v=m,m=w}a=u.neg(),s=l;var _=r.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=i),r.negative&&(r=r.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:o},{a,b:s}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,i=e[0],r=e[1],n=r.b.mul(t).divRound(this.n),o=i.b.neg().mul(t).divRound(this.n),a=n.mul(i.a),s=o.mul(r.a),c=n.mul(i.b),u=o.mul(r.b);return{k1:t.sub(a).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(e&&!o||!e&&o)&&(r=r.redNeg()),this.point(t,r)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,i=t.y,r=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var i=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,i=this.x.redSqr(),r=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(r),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},u.prototype.jmulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),c.prototype.jpoint=function(t,e,i){return new l(this,t,e,i)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(i,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(e),n=t.x.redMul(i),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(i.redMul(this.z)),s=r.redSub(n),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(h).redISub(h),p=c.redMul(h.redISub(f)).redISub(o.redMul(l)),d=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(f,p,d)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),i=this.x,r=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),a=i.redSub(r),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=i.redMul(c),h=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(h)).redISub(n.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(h,f,p)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var i=this;for(e=0;e=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},45427:(t,e,i)=>{"use strict";var r,n=e,o=i(33715),a=i(88254),s=i(80953).assert;function c(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var i=new c(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:i}),i}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=i(91037)}catch(t){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},57954:(t,e,i)=>{"use strict";var r=i(73785),n=i(2156),o=i(80953),a=i(45427),s=i(29931),c=o.assert,u=i(31251),l=i(90611);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(c(Object.prototype.hasOwnProperty.call(a,t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),o=this.n.sub(new r(2));;){var a=new r(e.generate(i));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,i,o){"object"==typeof i&&(o=i,i=null),o||(o={}),e=this.keyFromPrivate(e,i),t=this._truncateToN(new r(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),c=t.toArray("be",a),u=new n({hash:this.hash,entropy:s,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new r(1)),f=0;;f++){var p=o.k?o.k(f):new r(u.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(h)>=0)){var d=this.g.mul(p);if(!d.isInfinity()){var m=d.getX(),y=m.umod(this.n);if(0!==y.cmpn(0)){var v=p.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(d.getY().isOdd()?1:0)|(0!==m.cmp(y)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new l({r:y,s:v,recoveryParam:g})}}}}}},h.prototype.verify=function(t,e,i,n){t=this._truncateToN(new r(t,16)),i=this.keyFromPublic(i,n);var o=(e=new l(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(t).umod(this.n),h=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,i.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,i.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,i,n){c((3&i)===i,"The recovery param is more than two bits"),e=new l(e,n);var o=this.n,a=new r(t),s=e.r,u=e.s,h=1&i,f=i>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=f?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var p=e.r.invm(o),d=o.sub(a).mul(p).umod(o),m=u.mul(p).umod(o);return this.g.mulAdd(d,s,m)},h.prototype.getKeyRecoveryParam=function(t,e,i,r){if(null!==(e=new l(e,r)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(i))return n}throw new Error("Unable to find valid recovery factor")}},31251:(t,e,i)=>{"use strict";var r=i(73785),n=i(80953).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,i){return e instanceof o?e:new o(t,{pub:e,pubEnc:i})},o.fromPrivate=function(t,e,i){return e instanceof o?e:new o(t,{priv:e,privEnc:i})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new r(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,i){return this.ec.sign(t,this,e,i)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},90611:(t,e,i)=>{"use strict";var r=i(73785),n=i(80953),o=n.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new r(t.r,16),this.s=new r(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function c(t,e){var i=t[e.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;for(var n=0,o=0,a=e.place;o>>=0;return!(n<=127)&&(e.place=a,n)}function u(t){for(var e=0,i=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|i);--i;)t.push(e>>>(i<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=n.toArray(t,e);var i=new s;if(48!==t[i.place++])return!1;var o=c(t,i);if(!1===o)return!1;if(o+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;var a=c(t,i);if(!1===a)return!1;var u=t.slice(i.place,a+i.place);if(i.place+=a,2!==t[i.place++])return!1;var l=c(t,i);if(!1===l)return!1;if(t.length!==l+i.place)return!1;var h=t.slice(i.place,l+i.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new r(u),this.s=new r(h),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),i=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&i[0]&&(i=[0].concat(i)),e=u(e),i=u(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];l(r,e.length),(r=r.concat(e)).push(2),l(r,i.length);var o=r.concat(i),a=[48];return l(a,o.length),a=a.concat(o),n.encode(a,t)}},65980:(t,e,i)=>{"use strict";var r=i(33715),n=i(45427),o=i(80953),a=o.assert,s=o.parseBytes,c=i(79087),u=i(23622);function l(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=r.sha512}t.exports=l,l.prototype.sign=function(t,e){t=s(t);var i=this.keyFromSecret(e),r=this.hashInt(i.messagePrefix(),t),n=this.g.mul(r),o=this.encodePoint(n),a=this.hashInt(o,i.pubBytes(),t).mul(i.priv()),c=r.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:o})},l.prototype.verify=function(t,e,i){t=s(t),e=this.makeSignature(e);var r=this.keyFromPublic(i),n=this.hashInt(e.Rencoded(),r.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(r.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var r=i(80953),n=r.assert,o=r.parseBytes,a=r.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),i=t.encodingLength-1,r=e.slice(0,t.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),t)},s.prototype.getPublic=function(t){return r.encode(this.pubBytes(),t)},t.exports=s},23622:(t,e,i)=>{"use strict";var r=i(73785),n=i(80953),o=n.assert,a=n.cachedProperty,s=n.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof r&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},91037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},80953:(t,e,i)=>{"use strict";var r=e,n=i(73785),o=i(79746),a=i(34504);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(t,e,i){var r=new Array(Math.max(t.bitLength(),i)+1);r.fill(0);for(var n=1<(n>>1)-1?(n>>1)-c:c,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},r.getJSF=function(t,e){var i=[[],[]];t=t.clone(),e=e.clone();for(var r,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var a,s,c=t.andln(3)+n&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(r=t.andln(7)+n&7)&&5!==r||2!==u?c:-c,i[0].push(a),s=0==(1&u)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==c?u:-u,i[1].push(s),2*n===a+1&&(n=1-n),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return i},r.cachedProperty=function(t,e,i){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new n(t,"hex","le")}},73785:function(t,e,i){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function o(t,e,i){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i(58609).Buffer}catch(t){}function s(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},53981:t=>{"use strict";t.exports=EvalError},81648:t=>{"use strict";t.exports=Error},24726:t=>{"use strict";t.exports=RangeError},26712:t=>{"use strict";t.exports=ReferenceError},33464:t=>{"use strict";t.exports=SyntaxError},14453:t=>{"use strict";t.exports=TypeError},43915:t=>{"use strict";t.exports=URIError},17187:(t,e,i)=>{"use strict";var r,n=i(25108),o="object"==typeof Reflect?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function c(){c.init.call(this)}t.exports=c,t.exports.once=function(t,e){return new Promise((function(i,r){function n(i){t.removeListener(e,o),r(i)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),i([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&g(t,"error",e,i)}(t,n,{once:!0})}))},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?c.defaultMaxListeners:t._maxListeners}function f(t,e,i,r){var o,a,s,c;if(l(i),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),a=t._events),s=a[e]),void 0===s)s=a[e]=i,++t._eventsCount;else if("function"==typeof s?s=a[e]=r?[i,s]:[s,i]:r?s.unshift(i):s.push(i),(o=h(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,c=u,n&&n.warn&&n.warn(c)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=p.bind(r);return n.listener=i,r.wrapFn=n,n}function m(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=n[t];if(void 0===c)return!1;if("function"==typeof c)a(c,this,e);else{var u=c.length,l=v(c,u);for(i=0;i=0;o--)if(i[o]===e||i[o].listener===e){a=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},c.prototype.listeners=function(t){return m(this,t,!0)},c.prototype.rawListeners=function(t){return m(this,t,!1)},c.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},c.prototype.listenerCount=y,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},13048:(t,e,i)=>{var r=i(89509).Buffer,n=i(62318);t.exports=function(t,e,i,o){if(r.isBuffer(t)||(t=r.from(t,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=i/8,s=r.alloc(a),c=r.alloc(o||0),u=r.alloc(0);a>0||o>0;){var l=new n;l.update(u),l.update(t),e&&l.update(e),u=l.digest();var h=0;if(a>0){var f=s.length-a;h=Math.min(a,u.length),u.copy(s,f,0,h),a-=h}if(h0){var p=c.length-o,d=Math.min(o,u.length-h);u.copy(c,p,h,h+d),o-=d}}return u.fill(0),{key:s,iv:c}}},94029:(t,e,i)=>{"use strict";var r=i(95320),n=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){if(!r(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=i),"[object Array]"===n.call(t)?function(t,e,i){for(var r=0,n=t.length;r{"use strict";var r=i(34155);const n=i(20077),o=i(1679),a=i(11381).mkdirsSync,s=i(80318).utimesMillisSync,c=i(42733);function u(t,e,i,a){const s=(a.dereference?n.statSync:n.lstatSync)(e);if(s.isDirectory())return function(t,e,i,r,o){return e?f(i,r,o):function(t,e,i,r){return n.mkdirSync(i),f(e,i,r),h(i,t)}(t.mode,i,r,o)}(s,t,e,i,a);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return function(t,e,i,r,o){return e?function(t,e,i,r){if(r.overwrite)return n.unlinkSync(i),l(t,e,i,r);if(r.errorOnExist)throw new Error(`'${i}' already exists`)}(t,i,r,o):l(t,i,r,o)}(s,t,e,i,a);if(s.isSymbolicLink())return function(t,e,i,a){let s=n.readlinkSync(e);a.dereference&&(s=o.resolve(r.cwd(),s));if(t){let t;try{t=n.readlinkSync(i)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return n.symlinkSync(s,i);throw t}if(a.dereference&&(t=o.resolve(r.cwd(),t)),c.isSrcSubdir(s,t))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${t}'.`);if(c.isSrcSubdir(t,s))throw new Error(`Cannot overwrite '${t}' with '${s}'.`);return function(t,e){return n.unlinkSync(e),n.symlinkSync(t,e)}(s,i)}return n.symlinkSync(s,i)}(t,e,i,a);if(s.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(s.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function l(t,e,i,r){return n.copyFileSync(e,i),r.preserveTimestamps&&function(t,e,i){(function(t){return 0==(128&t)})(t)&&function(t,e){h(t,128|e)}(i,t);(function(t,e){const i=n.statSync(t);s(e,i.atime,i.mtime)})(e,i)}(t.mode,e,i),h(i,t.mode)}function h(t,e){return n.chmodSync(t,e)}function f(t,e,i){n.readdirSync(t).forEach((r=>function(t,e,i,r){const n=o.join(e,t),a=o.join(i,t);if(r.filter&&!r.filter(n,a))return;const{destStat:s}=c.checkPathsSync(n,a,"copy",r);return u(s,n,a,r)}(r,t,e,i)))}t.exports=function(t,e,i){"function"==typeof i&&(i={filter:i}),(i=i||{}).clobber=!("clobber"in i)||!!i.clobber,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&"ia32"===r.arch&&r.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:s,destStat:l}=c.checkPathsSync(t,e,"copy",i);if(c.checkParentPathsSync(t,s,e,"copy"),i.filter&&!i.filter(t,e))return;const h=o.dirname(e);return n.existsSync(h)||a(h),u(l,t,e,i)}},67189:(t,e,i)=>{"use strict";var r=i(34155);const n=i(67749),o=i(1679),{mkdirs:a}=i(11381),{pathExists:s}=i(99257),{utimesMillis:c}=i(80318),u=i(42733);async function l(t,e,i){return!i.filter||i.filter(t,e)}async function h(t,e,i,a){const s=a.dereference?n.stat:n.lstat,c=await s(e);if(c.isDirectory())return async function(t,e,i,r,a){e||await n.mkdir(r);const s=await n.readdir(i);await Promise.all(s.map((async t=>{const e=o.join(i,t),n=o.join(r,t);if(!await l(e,n,a))return;const{destStat:s}=await u.checkPaths(e,n,"copy",a);return h(s,e,n,a)}))),e||await n.chmod(r,t.mode)}(c,t,e,i,a);if(c.isFile()||c.isCharacterDevice()||c.isBlockDevice())return async function(t,e,i,r,o){if(!e)return f(t,i,r,o);if(o.overwrite)return await n.unlink(r),f(t,i,r,o);if(o.errorOnExist)throw new Error(`'${r}' already exists`)}(c,t,e,i,a);if(c.isSymbolicLink())return async function(t,e,i,a){let s=await n.readlink(e);a.dereference&&(s=o.resolve(r.cwd(),s));if(!t)return n.symlink(s,i);let c=null;try{c=await n.readlink(i)}catch(t){if("EINVAL"===t.code||"UNKNOWN"===t.code)return n.symlink(s,i);throw t}a.dereference&&(c=o.resolve(r.cwd(),c));if(u.isSrcSubdir(s,c))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${c}'.`);if(u.isSrcSubdir(c,s))throw new Error(`Cannot overwrite '${c}' with '${s}'.`);return await n.unlink(i),n.symlink(s,i)}(t,e,i,a);if(c.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(c.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}async function f(t,e,i,r){if(await n.copyFile(e,i),r.preserveTimestamps){0==(128&t.mode)&&await function(t,e){return n.chmod(t,128|e)}(i,t.mode);const r=await n.stat(e);await c(i,r.atime,r.mtime)}return n.chmod(i,t.mode)}t.exports=async function(t,e,i={}){"function"==typeof i&&(i={filter:i}),i.clobber=!("clobber"in i)||!!i.clobber,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&"ia32"===r.arch&&r.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:n,destStat:c}=await u.checkPaths(t,e,"copy",i);if(await u.checkParentPaths(t,n,e,"copy"),!await l(t,e,i))return;const f=o.dirname(e);await s(f)||await a(f),await h(c,t,e,i)}},66464:(t,e,i)=>{"use strict";const r=i(38981).fromPromise;t.exports={copy:r(i(67189)),copySync:i(83873)}},15590:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(67749),o=i(1679),a=i(11381),s=i(54542),c=r((async function(t){let e;try{e=await n.readdir(t)}catch{return a.mkdirs(t)}return Promise.all(e.map((e=>s.remove(o.join(t,e)))))}));function u(t){let e;try{e=n.readdirSync(t)}catch{return a.mkdirsSync(t)}e.forEach((e=>{e=o.join(t,e),s.removeSync(e)}))}t.exports={emptyDirSync:u,emptydirSync:u,emptyDir:c,emptydir:c}},36530:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(1679),o=i(67749),a=i(11381);t.exports={createFile:r((async function(t){let e;try{e=await o.stat(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);let r=null;try{r=await o.stat(i)}catch(e){if("ENOENT"===e.code)return await a.mkdirs(i),void await o.writeFile(t,"");throw e}r.isDirectory()?await o.writeFile(t,""):await o.readdir(i)})),createFileSync:function(t){let e;try{e=o.statSync(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);try{o.statSync(i).isDirectory()||o.readdirSync(i)}catch(t){if(!t||"ENOENT"!==t.code)throw t;a.mkdirsSync(i)}o.writeFileSync(t,"")}}},21720:(t,e,i)=>{"use strict";const{createFile:r,createFileSync:n}=i(36530),{createLink:o,createLinkSync:a}=i(54147),{createSymlink:s,createSymlinkSync:c}=i(83635);t.exports={createFile:r,createFileSync:n,ensureFile:r,ensureFileSync:n,createLink:o,createLinkSync:a,ensureLink:o,ensureLinkSync:a,createSymlink:s,createSymlinkSync:c,ensureSymlink:s,ensureSymlinkSync:c}},54147:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(1679),o=i(67749),a=i(11381),{pathExists:s}=i(99257),{areIdentical:c}=i(42733);t.exports={createLink:r((async function(t,e){let i,r;try{i=await o.lstat(e)}catch{}try{r=await o.lstat(t)}catch(t){throw t.message=t.message.replace("lstat","ensureLink"),t}if(i&&c(r,i))return;const u=n.dirname(e);await s(u)||await a.mkdirs(u),await o.link(t,e)})),createLinkSync:function(t,e){let i;try{i=o.lstatSync(e)}catch{}try{const e=o.lstatSync(t);if(i&&c(e,i))return}catch(t){throw t.message=t.message.replace("lstat","ensureLink"),t}const r=n.dirname(e);return o.existsSync(r)||a.mkdirsSync(r),o.linkSync(t,e)}}},6072:(t,e,i)=>{"use strict";const r=i(1679),n=i(67749),{pathExists:o}=i(99257),a=i(38981).fromPromise;t.exports={symlinkPaths:a((async function(t,e){if(r.isAbsolute(t)){try{await n.lstat(t)}catch(t){throw t.message=t.message.replace("lstat","ensureSymlink"),t}return{toCwd:t,toDst:t}}const i=r.dirname(e),a=r.join(i,t);if(await o(a))return{toCwd:a,toDst:t};try{await n.lstat(t)}catch(t){throw t.message=t.message.replace("lstat","ensureSymlink"),t}return{toCwd:t,toDst:r.relative(i,t)}})),symlinkPathsSync:function(t,e){if(r.isAbsolute(t)){if(!n.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}const i=r.dirname(e),o=r.join(i,t);if(n.existsSync(o))return{toCwd:o,toDst:t};if(!n.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:r.relative(i,t)}}}},89259:(t,e,i)=>{"use strict";const r=i(67749),n=i(38981).fromPromise;t.exports={symlinkType:n((async function(t,e){if(e)return e;let i;try{i=await r.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"})),symlinkTypeSync:function(t,e){if(e)return e;let i;try{i=r.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}}},83635:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(1679),o=i(67749),{mkdirs:a,mkdirsSync:s}=i(11381),{symlinkPaths:c,symlinkPathsSync:u}=i(6072),{symlinkType:l,symlinkTypeSync:h}=i(89259),{pathExists:f}=i(99257),{areIdentical:p}=i(42733);t.exports={createSymlink:r((async function(t,e,i){let r;try{r=await o.lstat(e)}catch{}if(r&&r.isSymbolicLink()){const[i,r]=await Promise.all([o.stat(t),o.stat(e)]);if(p(i,r))return}const s=await c(t,e);t=s.toDst;const u=await l(s.toCwd,i),h=n.dirname(e);return await f(h)||await a(h),o.symlink(t,e,u)})),createSymlinkSync:function(t,e,i){let r;try{r=o.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const i=o.statSync(t),r=o.statSync(e);if(p(i,r))return}const a=u(t,e);t=a.toDst,i=h(a.toCwd,i);const c=n.dirname(e);return o.existsSync(c)||s(c),o.symlinkSync(t,e,i)}}},67749:(t,e,i)=>{"use strict";var r=i(34155);const n=i(38981).fromCallback,o=i(20077),a=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((t=>"function"==typeof o[t]));Object.assign(e,o),a.forEach((t=>{e[t]=n(o[t])})),e.exists=function(t,e){return"function"==typeof e?o.exists(t,e):new Promise((e=>o.exists(t,e)))},e.read=function(t,e,i,r,n,a){return"function"==typeof a?o.read(t,e,i,r,n,a):new Promise(((a,s)=>{o.read(t,e,i,r,n,((t,e,i)=>{if(t)return s(t);a({bytesRead:e,buffer:i})}))}))},e.write=function(t,e,...i){return"function"==typeof i[i.length-1]?o.write(t,e,...i):new Promise(((r,n)=>{o.write(t,e,...i,((t,e,i)=>{if(t)return n(t);r({bytesWritten:e,buffer:i})}))}))},e.readv=function(t,e,...i){return"function"==typeof i[i.length-1]?o.readv(t,e,...i):new Promise(((r,n)=>{o.readv(t,e,...i,((t,e,i)=>{if(t)return n(t);r({bytesRead:e,buffers:i})}))}))},e.writev=function(t,e,...i){return"function"==typeof i[i.length-1]?o.writev(t,e,...i):new Promise(((r,n)=>{o.writev(t,e,...i,((t,e,i)=>{if(t)return n(t);r({bytesWritten:e,buffers:i})}))}))},"function"==typeof o.realpath.native?e.realpath.native=n(o.realpath.native):r.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")},55674:(t,e,i)=>{"use strict";t.exports={...i(67749),...i(66464),...i(15590),...i(21720),...i(46573),...i(11381),...i(80530),...i(54670),...i(99257),...i(54542)}},46573:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(7183);n.outputJson=r(i(43508)),n.outputJsonSync=i(39578),n.outputJSON=n.outputJson,n.outputJSONSync=n.outputJsonSync,n.writeJSON=n.writeJson,n.writeJSONSync=n.writeJsonSync,n.readJSON=n.readJson,n.readJSONSync=n.readJsonSync,t.exports=n},7183:(t,e,i)=>{"use strict";const r=i(96813);t.exports={readJson:r.readFile,readJsonSync:r.readFileSync,writeJson:r.writeFile,writeJsonSync:r.writeFileSync}},39578:(t,e,i)=>{"use strict";const{stringify:r}=i(96780),{outputFileSync:n}=i(54670);t.exports=function(t,e,i){const o=r(e,i);n(t,o,i)}},43508:(t,e,i)=>{"use strict";const{stringify:r}=i(96780),{outputFile:n}=i(54670);t.exports=async function(t,e,i={}){const o=r(e,i);await n(t,o,i)}},11381:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,{makeDir:n,makeDirSync:o}=i(18233),a=r(n);t.exports={mkdirs:a,mkdirsSync:o,mkdirp:a,mkdirpSync:o,ensureDir:a,ensureDirSync:o}},18233:(t,e,i)=>{"use strict";const r=i(67749),{checkPath:n}=i(33468),o=t=>"number"==typeof t?t:{mode:511,...t}.mode;t.exports.makeDir=async(t,e)=>(n(t),r.mkdir(t,{mode:o(e),recursive:!0})),t.exports.makeDirSync=(t,e)=>(n(t),r.mkdirSync(t,{mode:o(e),recursive:!0}))},33468:(t,e,i)=>{"use strict";var r=i(34155);const n=i(1679);t.exports.checkPath=function(t){if("win32"===r.platform){if(/[<>:"|?*]/.test(t.replace(n.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}}},80530:(t,e,i)=>{"use strict";const r=i(38981).fromPromise;t.exports={move:r(i(436)),moveSync:i(43736)}},43736:(t,e,i)=>{"use strict";const r=i(20077),n=i(1679),o=i(66464).copySync,a=i(54542).removeSync,s=i(11381).mkdirpSync,c=i(42733);function u(t,e,i){try{r.renameSync(t,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(t,e,i){const r={overwrite:i,errorOnExist:!0,preserveTimestamps:!0};return o(t,e,r),a(t)}(t,e,i)}}t.exports=function(t,e,i){const o=(i=i||{}).overwrite||i.clobber||!1,{srcStat:l,isChangingCase:h=!1}=c.checkPathsSync(t,e,"move",i);return c.checkParentPathsSync(t,l,e,"move"),function(t){const e=n.dirname(t);return n.parse(e).root===e}(e)||s(n.dirname(e)),function(t,e,i,n){if(n)return u(t,e,i);if(i)return a(e),u(t,e,i);if(r.existsSync(e))throw new Error("dest already exists.");return u(t,e,i)}(t,e,o,h)}},436:(t,e,i)=>{"use strict";const r=i(67749),n=i(1679),{copy:o}=i(66464),{remove:a}=i(54542),{mkdirp:s}=i(11381),{pathExists:c}=i(99257),u=i(42733);t.exports=async function(t,e,i={}){const l=i.overwrite||i.clobber||!1,{srcStat:h,isChangingCase:f=!1}=await u.checkPaths(t,e,"move",i);await u.checkParentPaths(t,h,e,"move");const p=n.dirname(e);return n.parse(p).root!==p&&await s(p),async function(t,e,i,n){if(!n)if(i)await a(e);else if(await c(e))throw new Error("dest already exists.");try{await r.rename(t,e)}catch(r){if("EXDEV"!==r.code)throw r;await async function(t,e,i){const r={overwrite:i,errorOnExist:!0,preserveTimestamps:!0};return await o(t,e,r),a(t)}(t,e,i)}}(t,e,l,f)}},54670:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(67749),o=i(1679),a=i(11381),s=i(99257).pathExists;t.exports={outputFile:r((async function(t,e,i="utf-8"){const r=o.dirname(t);return await s(r)||await a.mkdirs(r),n.writeFile(t,e,i)})),outputFileSync:function(t,...e){const i=o.dirname(t);n.existsSync(i)||a.mkdirsSync(i),n.writeFileSync(t,...e)}}},99257:(t,e,i)=>{"use strict";const r=i(38981).fromPromise,n=i(67749);t.exports={pathExists:r((function(t){return n.access(t).then((()=>!0)).catch((()=>!1))})),pathExistsSync:n.existsSync}},54542:(t,e,i)=>{"use strict";const r=i(20077),n=i(38981).fromCallback;t.exports={remove:n((function(t,e){r.rm(t,{recursive:!0,force:!0},e)})),removeSync:function(t){r.rmSync(t,{recursive:!0,force:!0})}}},42733:(t,e,i)=>{"use strict";const r=i(67749),n=i(1679),o=i(38981).fromPromise;function a(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function s(t,e){const i=n.resolve(t).split(n.sep).filter((t=>t)),r=n.resolve(e).split(n.sep).filter((t=>t));return i.every(((t,e)=>r[e]===t))}function c(t,e,i){return`Cannot ${i} '${t}' to a subdirectory of itself, '${e}'.`}t.exports={checkPaths:o((async function(t,e,i,o){const{srcStat:u,destStat:l}=await function(t,e,i){const n=i.dereference?t=>r.stat(t,{bigint:!0}):t=>r.lstat(t,{bigint:!0});return Promise.all([n(t),n(e).catch((t=>{if("ENOENT"===t.code)return null;throw t}))]).then((([t,e])=>({srcStat:t,destStat:e})))}(t,e,o);if(l){if(a(u,l)){const r=n.basename(t),o=n.basename(e);if("move"===i&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:u,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!u.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(u.isDirectory()&&s(t,e))throw new Error(c(t,e,i));return{srcStat:u,destStat:l}})),checkPathsSync:function(t,e,i,o){const{srcStat:u,destStat:l}=function(t,e,i){let n;const o=i.dereference?t=>r.statSync(t,{bigint:!0}):t=>r.lstatSync(t,{bigint:!0}),a=o(t);try{n=o(e)}catch(t){if("ENOENT"===t.code)return{srcStat:a,destStat:null};throw t}return{srcStat:a,destStat:n}}(t,e,o);if(l){if(a(u,l)){const r=n.basename(t),o=n.basename(e);if("move"===i&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:u,destStat:l,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!l.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!u.isDirectory()&&l.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(u.isDirectory()&&s(t,e))throw new Error(c(t,e,i));return{srcStat:u,destStat:l}},checkParentPaths:o((async function t(e,i,o,s){const u=n.resolve(n.dirname(e)),l=n.resolve(n.dirname(o));if(l===u||l===n.parse(l).root)return;let h;try{h=await r.stat(l,{bigint:!0})}catch(t){if("ENOENT"===t.code)return;throw t}if(a(i,h))throw new Error(c(e,o,s));return t(e,i,l,s)})),checkParentPathsSync:function t(e,i,o,s){const u=n.resolve(n.dirname(e)),l=n.resolve(n.dirname(o));if(l===u||l===n.parse(l).root)return;let h;try{h=r.statSync(l,{bigint:!0})}catch(t){if("ENOENT"===t.code)return;throw t}if(a(i,h))throw new Error(c(e,o,s));return t(e,i,l,s)},isSrcSubdir:s,areIdentical:a}},80318:(t,e,i)=>{"use strict";const r=i(67749),n=i(38981).fromPromise;t.exports={utimesMillis:n((async function(t,e,i){const n=await r.open(t,"r+");let o=null;try{await r.futimes(n,e,i)}finally{try{await r.close(n)}catch(t){o=t}}if(o)throw o})),utimesMillisSync:function(t,e,i){const n=r.openSync(t,"r+");return r.futimesSync(n,e,i),r.closeSync(n)}}},17648:t=>{"use strict";var e=Object.prototype.toString,i=Math.max,r=function(t,e){for(var i=[],r=0;r{"use strict";var r=i(17648);t.exports=Function.prototype.bind||r},40210:(t,e,i)=>{"use strict";var r,n=i(81648),o=i(53981),a=i(24726),s=i(26712),c=i(33464),u=i(14453),l=i(43915),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},m=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,y=i(41405)(),v=i(28185)(),g=Object.getPrototypeOf||(v?function(t){return t.__proto__}:null),b={},w="undefined"!=typeof Uint8Array&&g?g(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":y&&g?g([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":b,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&g?g(g([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&y&&g?g((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&y&&g?g((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&g?g(""[Symbol.iterator]()):r,"%Symbol%":y?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":m,"%TypedArray%":w,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(g)try{null.error}catch(t){var S=g(g(t));_["%Error.prototype%"]=S}var x=function t(e){var i;if("%AsyncFunction%"===e)i=f("async function () {}");else if("%GeneratorFunction%"===e)i=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=f("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(i=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&g&&(i=g(n.prototype))}return _[e]=i,i},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=i(58612),k=i(48824),O=E.call(Function.call,Array.prototype.concat),C=E.call(Function.apply,Array.prototype.splice),A=E.call(Function.call,String.prototype.replace),P=E.call(Function.call,String.prototype.slice),j=E.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(t,e){var i,r=t;if(k(M,r)&&(r="%"+(i=M[r])[0]+"%"),k(_,r)){var n=_[r];if(n===b&&(n=x(r)),void 0===n&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:n}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=P(t,0,1),i=P(t,-1);if("%"===e&&"%"!==i)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return A(t,T,(function(t,e,i,n){r[r.length]=i?A(n,R,"$1"):e||t})),r}(t),r=i.length>0?i[0]:"",n=I("%"+r+"%",e),o=n.name,a=n.value,s=!1,l=n.alias;l&&(r=l[0],C(i,O([0,1],l)));for(var h=1,f=!0;h=i.length){var v=p(a,d);a=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[d]}else f=k(a,d),a=a[d];f&&!s&&(_[o]=a)}}return a}},27296:(t,e,i)=>{"use strict";var r=i(40210)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}t.exports=r},66458:t=>{"use strict";t.exports=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var i={__proto__:e(t)};else i=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))})),i};var e=Object.getPrototypeOf||function(t){return t.__proto__}},20077:(t,e,i)=>{var r,n,o=i(34155),a=i(25108),s=i(10978),c=i(72161),u=i(78520),l=i(66458),h=i(89539);function f(t,e){Object.defineProperty(t,r,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(r=Symbol.for("graceful-fs.queue"),n=Symbol.for("graceful-fs.previous")):(r="___graceful-fs.queue",n="___graceful-fs.previous");var p,d=function(){};if(h.debuglog?d=h.debuglog("gfs4"):/\bgfs4\b/i.test(o.env.NODE_DEBUG||"")&&(d=function(){var t=h.format.apply(h,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: "),a.error(t)}),!s[r]){var m=i.g[r]||[];f(s,m),s.close=function(t){function e(e,i){return t.call(s,e,(function(t){t||g(),"function"==typeof i&&i.apply(this,arguments)}))}return Object.defineProperty(e,n,{value:t}),e}(s.close),s.closeSync=function(t){function e(e){t.apply(s,arguments),g()}return Object.defineProperty(e,n,{value:t}),e}(s.closeSync),/\bgfs4\b/i.test(o.env.NODE_DEBUG||"")&&o.on("exit",(function(){d(s[r]),i(69282).equal(s[r].length,0)}))}function y(t){c(t),t.gracefulify=y,t.createReadStream=function(e,i){return new t.ReadStream(e,i)},t.createWriteStream=function(e,i){return new t.WriteStream(e,i)};var e=t.readFile;t.readFile=function(t,i,r){"function"==typeof i&&(r=i,i=null);return function t(i,r,n,o){return e(i,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):v([t,[i,r,n],e,o||Date.now(),Date.now()])}))}(t,i,r)};var i=t.writeFile;t.writeFile=function(t,e,r,n){"function"==typeof r&&(n=r,r=null);return function t(e,r,n,o,a){return i(e,r,n,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):v([t,[e,r,n,o],i,a||Date.now(),Date.now()])}))}(t,e,r,n)};var r=t.appendFile;r&&(t.appendFile=function(t,e,i,n){"function"==typeof i&&(n=i,i=null);return function t(e,i,n,o,a){return r(e,i,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):v([t,[e,i,n,o],r,a||Date.now(),Date.now()])}))}(t,e,i,n)});var n=t.copyFile;n&&(t.copyFile=function(t,e,i,r){"function"==typeof i&&(r=i,i=0);return function t(e,i,r,o,a){return n(e,i,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):v([t,[e,i,r,o],n,a||Date.now(),Date.now()])}))}(t,e,i,r)});var a=t.readdir;t.readdir=function(t,e,i){"function"==typeof e&&(i=e,e=null);var r=s.test(o.version)?function(t,e,i,r){return a(t,n(t,e,i,r))}:function(t,e,i,r){return a(t,e,n(t,e,i,r))};return r(t,e,i);function n(t,e,i,n){return function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(a&&a.sort&&a.sort(),"function"==typeof i&&i.call(this,o,a)):v([r,[t,e,i],o,n||Date.now(),Date.now()])}}};var s=/^v[0-5]\./;if("v0.8"===o.version.substr(0,4)){var l=u(t);m=l.ReadStream,g=l.WriteStream}var h=t.ReadStream;h&&(m.prototype=Object.create(h.prototype),m.prototype.open=function(){var t=this;w(t.path,t.flags,t.mode,(function(e,i){e?(t.autoClose&&t.destroy(),t.emit("error",e)):(t.fd=i,t.emit("open",i),t.read())}))});var f=t.WriteStream;f&&(g.prototype=Object.create(f.prototype),g.prototype.open=function(){var t=this;w(t.path,t.flags,t.mode,(function(e,i){e?(t.destroy(),t.emit("error",e)):(t.fd=i,t.emit("open",i))}))}),Object.defineProperty(t,"ReadStream",{get:function(){return m},set:function(t){m=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(t){g=t},enumerable:!0,configurable:!0});var p=m;Object.defineProperty(t,"FileReadStream",{get:function(){return p},set:function(t){p=t},enumerable:!0,configurable:!0});var d=g;function m(t,e){return this instanceof m?(h.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function g(t,e){return this instanceof g?(f.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(t,"FileWriteStream",{get:function(){return d},set:function(t){d=t},enumerable:!0,configurable:!0});var b=t.open;function w(t,e,i,r){return"function"==typeof i&&(r=i,i=null),function t(e,i,r,n,o){return b(e,i,r,(function(a,s){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?"function"==typeof n&&n.apply(this,arguments):v([t,[e,i,r,n],a,o||Date.now(),Date.now()])}))}(t,e,i,r)}return t.open=w,t}function v(t){d("ENQUEUE",t[0].name,t[1]),s[r].push(t),b()}function g(){for(var t=Date.now(),e=0;e2&&(s[r][e][3]=t,s[r][e][4]=t);b()}function b(){if(clearTimeout(p),p=void 0,0!==s[r].length){var t=s[r].shift(),e=t[0],i=t[1],n=t[2],o=t[3],a=t[4];if(void 0===o)d("RETRY",e.name,i),e.apply(null,i);else if(Date.now()-o>=6e4){d("TIMEOUT",e.name,i);var c=i.pop();"function"==typeof c&&c.call(null,n)}else{var u=Date.now()-a,l=Math.max(a-o,1);u>=Math.min(1.2*l,100)?(d("RETRY",e.name,i),e.apply(null,i.concat([o]))):s[r].push(t)}void 0===p&&(p=setTimeout(b,0))}}i.g[r]||f(i.g,s[r]),t.exports=y(l(s)),o.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched&&(t.exports=y(s),s.__patched=!0)},78520:(t,e,i)=>{var r=i(34155),n=i(42830).Stream;t.exports=function(t){return{ReadStream:function e(i,o){if(!(this instanceof e))return new e(i,o);n.call(this);var a=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,o=o||{};for(var s=Object.keys(o),c=0,u=s.length;cthis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void r.nextTick((function(){a._read()}));t.open(this.path,this.flags,this.mode,(function(t,e){if(t)return a.emit("error",t),void(a.readable=!1);a.fd=e,a.emit("open",e),a._read()}))},WriteStream:function e(i,r){if(!(this instanceof e))return new e(i,r);n.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var o=Object.keys(r),a=0,s=o.length;a= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},72161:(t,e,i)=>{var r=i(34155),n=i(83208),o=r.cwd,a=null,s=r.env.GRACEFUL_FS_PLATFORM||r.platform;r.cwd=function(){return a||(a=o.call(r)),a};try{r.cwd()}catch(t){}if("function"==typeof r.chdir){var c=r.chdir;r.chdir=function(t){a=null,c.call(r,t)},Object.setPrototypeOf&&Object.setPrototypeOf(r.chdir,c)}t.exports=function(t){n.hasOwnProperty("O_SYMLINK")&&r.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(e,i,r){t.open(e,n.O_WRONLY|n.O_SYMLINK,i,(function(e,n){e?r&&r(e):t.fchmod(n,i,(function(e){t.close(n,(function(t){r&&r(e||t)}))}))}))},t.lchmodSync=function(e,i){var r,o=t.openSync(e,n.O_WRONLY|n.O_SYMLINK,i),a=!0;try{r=t.fchmodSync(o,i),a=!1}finally{if(a)try{t.closeSync(o)}catch(t){}else t.closeSync(o)}return r}}(t);t.lutimes||function(t){n.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(e,i,r,o){t.open(e,n.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,i,r,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(e,i,r){var o,a=t.openSync(e,n.O_SYMLINK),s=!0;try{o=t.futimesSync(a,i,r),s=!1}finally{if(s)try{t.closeSync(a)}catch(t){}else t.closeSync(a)}return o}):t.futimes&&(t.lutimes=function(t,e,i,n){n&&r.nextTick(n)},t.lutimesSync=function(){})}(t);t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=e(t.chmod),t.fchmod=e(t.fchmod),t.lchmod=e(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(t,e,i){i&&r.nextTick(i)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(t,e,i,n){n&&r.nextTick(n)},t.lchownSync=function(){});"win32"===s&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function i(i,r,n){var o=Date.now(),a=0;e(i,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?e(i,r,s):n(c)}))}),a),void(a<100&&(a+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(i,e),i}(t.rename));function e(e){return e?function(i,r,n){return e.call(t,i,r,(function(t){l(t)&&(t=null),n&&n.apply(this,arguments)}))}:e}function i(e){return e?function(i,r){try{return e.call(t,i,r)}catch(t){if(!l(t))throw t}}:e}function o(e){return e?function(i,r,n,o){return e.call(t,i,r,n,(function(t){l(t)&&(t=null),o&&o.apply(this,arguments)}))}:e}function a(e){return e?function(i,r,n){try{return e.call(t,i,r,n)}catch(t){if(!l(t))throw t}}:e}function c(e){return e?function(i,r,n){function o(t,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(t,i,r,o):e.call(t,i,o)}:e}function u(e){return e?function(i,r){var n=r?e.call(t,i,r):e.call(t,i);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function l(t){return!t||("ENOSYS"===t.code||!(r.getuid&&0===r.getuid()||"EINVAL"!==t.code&&"EPERM"!==t.code))}t.read="function"!=typeof t.read?t.read:function(e){function i(i,r,n,o,a,s){var c;if(s&&"function"==typeof s){var u=0;c=function(l,h,f){if(l&&"EAGAIN"===l.code&&u<10)return u++,e.call(t,i,r,n,o,a,c);s.apply(this,arguments)}}return e.call(t,i,r,n,o,a,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(i,e),i}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(h=t.readSync,function(e,i,r,n,o){for(var a=0;;)try{return h.call(t,e,i,r,n,o)}catch(t){if("EAGAIN"===t.code&&a<10){a++;continue}throw t}});var h}},31044:(t,e,i)=>{"use strict";var r=i(40210)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(t){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},28185:t=>{"use strict";var e={foo:{}},i=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof i)}},41405:(t,e,i)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=i(55419);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},55419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},96410:(t,e,i)=>{"use strict";var r=i(55419);t.exports=function(){return r()&&!!Symbol.toStringTag}},3349:(t,e,i)=>{"use strict";var r=i(89509).Buffer,n=i(88473).Transform;function o(t){n.call(this),this._block=r.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}i(35717)(o,n),o.prototype._transform=function(t,e,i){var r=null;try{this.update(t,e)}catch(t){r=t}i(r)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!r.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(t)||(t=r.from(t,e));for(var i=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},33715:(t,e,i)=>{var r=e;r.utils=i(26436),r.common=i(95772),r.sha=i(89041),r.ripemd=i(12949),r.hmac=i(52344),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},95772:(t,e,i)=>{"use strict";var r=i(26436),n=i(79746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-i,this.endian);for(var n=0;n>>24&255,r[n++]=t>>>16&255,r[n++]=t>>>8&255,r[n++]=255&t}else for(r[n++]=255&t,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o{"use strict";var r=i(26436),n=i(79746);function o(t,e,i){if(!(this instanceof o))return new o(t,e,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,i))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var r=i(26436),n=i(95772),o=r.rotl32,a=r.sum32,s=r.sum32_3,c=r.sum32_4,u=n.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,i,r){return t<=15?e^i^r:t<=31?e&i|~e&r:t<=47?(e|~i)^r:t<=63?e&r|i&~r:e^(i|~r)}function f(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}r.inherits(l,u),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var i=this.h[0],r=this.h[1],n=this.h[2],u=this.h[3],l=this.h[4],g=i,b=r,w=n,_=u,S=l,x=0;x<80;x++){var M=a(o(c(i,h(x,r,n,u),t[d[x]+e],f(x)),y[x]),l);i=l,l=u,u=o(n,10),n=r,r=M,M=a(o(c(g,h(79-x,b,w,_),t[m[x]+e],p(x)),v[x]),S),g=S,S=_,_=o(w,10),w=b,b=M}M=s(this.h[1],n,_),this.h[1]=s(this.h[2],u,S),this.h[2]=s(this.h[3],l,g),this.h[3]=s(this.h[4],i,b),this.h[4]=s(this.h[0],r,w),this.h[0]=M},l.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},89041:(t,e,i)=>{"use strict";e.sha1=i(84761),e.sha224=i(10799),e.sha256=i(89344),e.sha384=i(80772),e.sha512=i(45900)},84761:(t,e,i)=>{"use strict";var r=i(26436),n=i(95772),o=i(37038),a=r.rotl32,s=r.sum32,c=r.sum32_5,u=o.ft_1,l=n.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(f,l),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r{"use strict";var r=i(26436),n=i(89344);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(o,n),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},89344:(t,e,i)=>{"use strict";var r=i(26436),n=i(95772),o=i(37038),a=i(79746),s=r.sum32,c=r.sum32_4,u=r.sum32_5,l=o.ch32,h=o.maj32,f=o.s0_256,p=o.s1_256,d=o.g0_256,m=o.g1_256,y=n.BlockHash,v=[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];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(g,y),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r{"use strict";var r=i(26436),n=i(45900);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(o,n),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},45900:(t,e,i)=>{"use strict";var r=i(26436),n=i(95772),o=i(79746),a=r.rotr64_hi,s=r.rotr64_lo,c=r.shr64_hi,u=r.shr64_lo,l=r.sum64,h=r.sum64_hi,f=r.sum64_lo,p=r.sum64_4_hi,d=r.sum64_4_lo,m=r.sum64_5_hi,y=r.sum64_5_lo,v=n.BlockHash,g=[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];function b(){if(!(this instanceof b))return new b;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(t,e,i,r,n){var o=t&i^~t&n;return o<0&&(o+=4294967296),o}function _(t,e,i,r,n,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function S(t,e,i,r,n){var o=t&i^t&n^i&n;return o<0&&(o+=4294967296),o}function x(t,e,i,r,n,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function M(t,e){var i=a(t,e,28)^a(e,t,2)^a(e,t,7);return i<0&&(i+=4294967296),i}function E(t,e){var i=s(t,e,28)^s(e,t,2)^s(e,t,7);return i<0&&(i+=4294967296),i}function k(t,e){var i=a(t,e,14)^a(t,e,18)^a(e,t,9);return i<0&&(i+=4294967296),i}function O(t,e){var i=s(t,e,14)^s(t,e,18)^s(e,t,9);return i<0&&(i+=4294967296),i}function C(t,e){var i=a(t,e,1)^a(t,e,8)^c(t,e,7);return i<0&&(i+=4294967296),i}function A(t,e){var i=s(t,e,1)^s(t,e,8)^u(t,e,7);return i<0&&(i+=4294967296),i}function P(t,e){var i=a(t,e,19)^a(e,t,29)^c(t,e,6);return i<0&&(i+=4294967296),i}function j(t,e){var i=s(t,e,19)^s(e,t,29)^u(t,e,6);return i<0&&(i+=4294967296),i}r.inherits(b,v),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var i=this.W,r=0;r<32;r++)i[r]=t[e+r];for(;r{"use strict";var r=i(26436).rotr32;function n(t,e,i){return t&e^~t&i}function o(t,e,i){return t&e^t&i^e&i}function a(t,e,i){return t^e^i}e.ft_1=function(t,e,i,r){return 0===t?n(e,i,r):1===t||3===t?a(e,i,r):2===t?o(e,i,r):void 0},e.ch32=n,e.maj32=o,e.p32=a,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},26436:(t,e,i)=>{"use strict";var r=i(79746),n=i(35717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,i[r++]=63&a|128):o(t,n)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),i[r++]=a>>18|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128,i[r++]=63&a|128):(i[r++]=a>>12|224,i[r++]=a>>6&63|128,i[r++]=63&a|128)}else for(n=0;n>>0}return a},e.split32=function(t,e){for(var i=new Array(4*t.length),r=0,n=0;r>>24,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=255&o):(i[n+3]=o>>>24,i[n+2]=o>>>16&255,i[n+1]=o>>>8&255,i[n]=255&o)}return i},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,i){return t+e+i>>>0},e.sum32_4=function(t,e,i,r){return t+e+i+r>>>0},e.sum32_5=function(t,e,i,r,n){return t+e+i+r+n>>>0},e.sum64=function(t,e,i,r){var n=t[e],o=r+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,i,r){return(e+r>>>0>>0},e.sum64_lo=function(t,e,i,r){return e+r>>>0},e.sum64_4_hi=function(t,e,i,r,n,o,a,s){var c=0,u=e;return c+=(u=u+r>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,i,r,n,o,a,s){return e+r+o+s>>>0},e.sum64_5_hi=function(t,e,i,r,n,o,a,s,c,u){var l=0,h=e;return l+=(h=h+r>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,i,r,n,o,a,s,c,u){return e+r+o+s+u>>>0},e.rotr64_hi=function(t,e,i){return(e<<32-i|t>>>i)>>>0},e.rotr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},e.shr64_hi=function(t,e,i){return t>>>i},e.shr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0}},48824:(t,e,i)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=i(58612);t.exports=o.call(r,n)},2156:(t,e,i)=>{"use strict";var r=i(33715),n=i(34504),o=i(79746);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),i=n.toArray(t.nonce,t.nonceEnc||"hex"),r=n.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,r)}t.exports=a,a.prototype._init=function(t,e,i){var r=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1},a.prototype.generate=function(t,e,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=i,i=e,e=null),i&&(i=n.toArray(i,r||"hex"),this._update(i));for(var o=[];o.length{var r=i(8501),n=i(8575),o=t.exports;for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);function s(t){if("string"==typeof t&&(t=n.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}o.request=function(t,e){return t=s(t),r.request.call(this,t,e)},o.get=function(t,e){return t=s(t),r.get.call(this,t,e)}},35717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}}},82584:(t,e,i)=>{"use strict";var r=i(96410)(),n=i(21924)("Object.prototype.toString"),o=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},48738:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},95320:t=>{"use strict";var e,i,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw i}}),i={},n((function(){throw 42}),null,e)}catch(t){t!==i&&(n=null)}else n=null;var o=/^\s*class\b/,a=function(t){try{var e=r.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(r.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=n?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{n(t,null,e)}catch(t){if(t!==i)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},48662:(t,e,i)=>{"use strict";var r,n=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=i(96410)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===n.call(t);if(!c)return!1;if(void 0===r){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&c(e)}return c(t)===r}},98611:t=>{"use strict";t.exports=function(t){return t!=t}},20360:(t,e,i)=>{"use strict";var r=i(55559),n=i(4289),o=i(98611),a=i(29415),s=i(23194),c=r(a(),Number);n(c,{getPolyfill:a,implementation:o,shim:s}),t.exports=c},29415:(t,e,i)=>{"use strict";var r=i(98611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},23194:(t,e,i)=>{"use strict";var r=i(4289),n=i(29415);t.exports=function(){var t=n();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},85692:(t,e,i)=>{"use strict";var r=i(86430);t.exports=function(t){return!!r(t)}},5826:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},71031:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]16)throw new Error("InvalidIVLength");if(f.default.ciphers[e].staticIvLength&&f.default.ciphers[e].ivLength!==i.byteLength)throw new Error("InvalidIVLength")}if(f.default.ciphers[e].tagLength&&r){if(!Number.isInteger(r))throw new Error("InvalidArguments");if(r<4||r>16)throw new Error("InvalidTagLength")}};e.encrypt=function(t,e,i){var r=i.name,n=void 0===r?"AES-GCM":r,o=i.iv,c=i.additionalData,d=void 0===c?new Uint8Array([]):c,m=i.tagLength;return a(void 0,void 0,void 0,(function(){var i;return s(this,(function(r){if(p({name:n,iv:o,tagLength:m}),f.default.ciphers[n].tagLength&&!m&&(m=f.default.ciphers[n].tagLength),"webCrypto"===(i=u.getCrypto()).name){if("function"!=typeof i.crypto.importKey||"function"!=typeof i.crypto.encrypt)throw new Error("UnsupportedWebCrypto");return[2,h.encrypt(t,e,{name:n,iv:o,additionalData:d,tagLength:m},i.crypto)]}if("nodeCrypto"===i.name)return[2,l.encrypt(t,e,{name:n,iv:o,additionalData:d,tagLength:m},i.crypto)];throw new Error("UnsupportedEnvironment")}))}))};e.decrypt=function(t,e,i){var r=i.name,n=void 0===r?"AES-GCM":r,o=i.iv,c=i.additionalData,d=void 0===c?new Uint8Array([]):c,m=i.tagLength;return a(void 0,void 0,void 0,(function(){var i;return s(this,(function(r){if(p({name:n,iv:o,tagLength:m}),f.default.ciphers[n].tagLength&&!m&&(m=f.default.ciphers[n].tagLength),"webCrypto"===(i=u.getCrypto()).name){if("function"!=typeof i.crypto.importKey||"function"!=typeof i.crypto.decrypt)throw new Error("UnsupportedWebCrypto");return[2,h.decrypt(t,e,{name:n,iv:o,additionalData:d,tagLength:m},i.crypto)]}if("nodeCrypto"===i.name)return[2,l.decrypt(t,e,{name:n,iv:o,additionalData:d,tagLength:m},i.crypto)];throw new Error("UnsupportedEnvironment")}))}))};e.wrapKey=function(t,e,i){var r=i.name;return a(void 0,void 0,void 0,(function(){var i,n;return s(this,(function(o){if(t.length%8>0)throw new Error("WrappedKeyMustBeMultipleOf8");if(i=u.getCrypto(),n=f.default.wrapKeys["AES-KW"].defaultIv,"webCrypto"===i.name){if("function"!=typeof i.crypto.importKey||"function"!=typeof i.crypto.wrapKey)throw new Error("UnsupportedWebCrypto");return[2,h.wrapKey(t,e,{name:r,iv:n},i.crypto)]}if("nodeCrypto"===i.name)return[2,l.wrapKey(t,e,{name:r,iv:n},i.crypto)];throw new Error("UnsupportedEnvironment")}))}))};e.unwrapKey=function(t,e,i){var r=i.name;return a(void 0,void 0,void 0,(function(){var i,n;return s(this,(function(o){if(i=u.getCrypto(),n=f.default.wrapKeys["AES-KW"].defaultIv,"webCrypto"===i.name){if("function"!=typeof i.crypto.importKey||"function"!=typeof i.crypto.unwrapKey)throw new Error("UnsupportedWebCrypto");return[2,h.unwrapKey(t,e,{name:r,iv:n},i.crypto)]}if("nodeCrypto"===i.name)return[2,l.unwrapKey(t,e,{name:r,iv:n},i.crypto)];throw new Error("UnsupportedEnvironment")}))}))}},22608:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.unwrapKey=e.wrapKey=e.decrypt=e.encrypt=void 0;var a=o(i(71031));e.encrypt=a.encrypt,e.decrypt=a.decrypt,e.wrapKey=a.wrapKey,e.unwrapKey=a.unwrapKey,e.default={encrypt:e.encrypt,decrypt:e.decrypt,wrapKey:e.wrapKey,unwrapKey:e.unwrapKey}},70260:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.unwrapKey=e.wrapKey=void 0;var n=r(i(77960));e.wrapKey=function(t,i,r,n){var o=r.name,a=r.iv;return(0,e.encrypt)(t,i,{name:o,iv:a},n,!0)};e.unwrapKey=function(t,i,r,n){var o=r.name,a=r.iv;return(0,e.decrypt)(t,i,{name:o,iv:a},n,!0)};e.encrypt=function(t,e,i,r,a){var s=i.name,c=i.iv,u=i.additionalData,l=i.tagLength;void 0===a&&(a=!1);var h,f,p,d,m=o(s,e.byteLength,a?n.default.wrapKeys:n.default.ciphers);switch(s){case"AES-GCM":(h=r.createCipheriv(m,e,c,{authTagLength:l})).setAAD(u);break;case"AES-CTR":if(0===c.length||c.length>16)throw new Error("InvalidIVLength");var y=new Uint8Array(16);y.set(c),y[15]+=1,h=r.createCipheriv(m,e,y);break;default:h=r.createCipheriv(m,e,c)}try{f=new Uint8Array(h.update(t)),p=new Uint8Array(h.final()),d=new Uint8Array([]),"AES-GCM"===s&&(d=new Uint8Array(h.getAuthTag()))}catch(t){throw new Error("NodeCrypto_EncryptionFailure")}var v=new Uint8Array(f.length+p.length+d.length);return v.set(f),v.set(p,f.length),v.set(d,f.length+p.length),v};e.decrypt=function(t,e,i,r,a){var s=i.name,c=i.iv,u=i.additionalData,l=i.tagLength;void 0===a&&(a=!1);var h,f,p,d,m=o(s,e.byteLength,a?n.default.wrapKeys:n.default.ciphers);switch(s){case"AES-GCM":(h=r.createDecipheriv(m,e,c,{authTagLength:l})).setAAD(u),f=t.slice(0,t.length-l);var y=t.slice(t.length-l);h.setAuthTag(y);break;case"AES-CTR":if(0===c.length||c.length>16)throw new Error("InvalidIVLength");var v=new Uint8Array(16);v.set(c),v[15]+=1,h=r.createDecipheriv(m,e,v),f=t;break;default:h=r.createDecipheriv(m,e,c),f=t}try{p=h.update(f),d=h.final()}catch(t){throw new Error("NodeCrypto_DecryptionFailure")}var g=new Uint8Array(d.length+p.length);return g.set(p),g.set(d,p.length),g};var o=function(t,e,i){var r=i[t].nodePrefix;return(r="".concat(r).concat((8*e).toString()))+i[t].nodeSuffix}},77960:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={"AES-KW":{nodePrefix:"id-aes",nodeSuffix:"-wrap",ivLength:8,staticIvLength:!0,defaultIv:new Uint8Array([166,166,166,166,166,166,166,166])}};e.default={ciphers:{"AES-GCM":{nodePrefix:"aes-",nodeSuffix:"-gcm",ivLength:12,tagLength:16,staticIvLength:!0},"AES-CBC":{nodePrefix:"aes-",nodeSuffix:"-cbc",ivLength:16,staticIvLength:!0},"AES-CTR":{nodePrefix:"aes-",nodeSuffix:"-ctr",ivLength:12,staticIvLength:!1}},wrapKeys:i}},11683:function(t,e){"use strict";var i=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]16)throw new Error("InvalidIVLength");o.counter=new Uint8Array(16),o.counter.set(i),o.counter[15]+=1,o.length=128}return o}},58760:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCrypto=e.getRootWebCrypto=e.getWebCrypto=e.getNodeCrypto=void 0;var r=function(){return"undefined"!=typeof window&&window.crypto||"undefined"==typeof window&&"undefined"!=typeof crypto?void 0:i(55835)};e.getNodeCrypto=r;var n=function(){return"undefined"!=typeof window&&window.crypto?window.crypto.subtle:"undefined"==typeof window&&"undefined"!=typeof crypto?crypto.subtle:void 0};e.getWebCrypto=n;var o=function(){return"undefined"!=typeof window&&window.crypto?window.crypto:"undefined"==typeof window&&"undefined"!=typeof crypto?crypto:void 0};e.getRootWebCrypto=o;var a=function(){var t=n(),e=r();return void 0!==e?{name:"nodeCrypto",crypto:e}:void 0!==t?{name:"webCrypto",crypto:t}:{name:void 0}};e.getCrypto=a,e.default={getNodeCrypto:r,getWebCrypto:n,getRootWebCrypto:o,getCrypto:a}},34657:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1] ").concat(c.message),new Error("UnsupportedEnvironment: ".concat(n))):new Error("UnsupportedEnvironment");case 10:return[2,new Uint8Array(r)]}}))}))};var d=function(t,e,i){var r=l.default.hashes[t].nodeName,n=i.createHash(r);return n.update(e),n.digest()},m=function(t,e){return a(void 0,void 0,void 0,(function(){var r,n,a,c;return s(this,(function(s){switch(s.label){case 0:return"MD5"!==t?[3,1]:(r=(0,h.default)(Array.from(e),{asBytes:!0}),[3,4]);case 1:return["SHA3-512","SHA3-384","SHA3-256","SHA3-224"].indexOf(t)>=0?(n=8*l.default.hashes[t].hashSize,a=new f.SHA3(n),[4,Promise.resolve().then((function(){return o(i(58609))}))]):[3,3];case 2:return c=s.sent().Buffer,a.update(c.from(e)),r=a.digest("binary"),[3,4];case 3:r=p[l.default.hashes[t].nodeName]().update(e).digest(),s.label=4;case 4:return[2,new Uint8Array(r)]}}))}))}},81985:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.compute=void 0;var a=o(i(34657));e.compute=a.compute,e.default={compute:e.compute}},77290:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={hashes:{"SHA3-512":{nodeName:"sha3-512",hashSize:64},"SHA3-384":{nodeName:"sha3-384",hashSize:48},"SHA3-256":{nodeName:"sha3-256",hashSize:32},"SHA3-224":{nodeName:"sha3-224",hashSize:28},"SHA-256":{nodeName:"sha256",hashSize:32},"SHA-384":{nodeName:"sha384",hashSize:48},"SHA-512":{nodeName:"sha512",hashSize:64},"SHA-1":{nodeName:"sha1",hashSize:20},MD5:{nodeName:"md5",hashSize:16}}}},44704:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1] ").concat(d.message),new Error("UnsupportedEnvironments: ".concat(o))):new Error("UnsupportedEnvironments");case 11:return[2,new Uint8Array(n)]}}))}))};var f=function(t,e,i){return a(void 0,void 0,void 0,(function(){var r,n,o,a,c,l,f,p;return s(this,(function(s){switch(s.label){case 0:return r=u.default.hashes[i].blockSize,n=u.default.hashes[i].hashSize,t.length>r?[4,h.default.compute(t,i)]:[3,2];case 1:t=s.sent(),s.label=2;case 2:return(o=new Uint8Array(r)).set(t),a=o.map((function(t){return 255&(54^t)})),c=o.map((function(t){return 255&(92^t)})),(l=new Uint8Array(r+e.length)).set(a),l.set(e,r),[4,h.default.compute(l,i)];case 3:return f=s.sent(),(p=new Uint8Array(r+n)).set(c),p.set(f,r),[2,h.default.compute(p,i)]}}))}))};e.verify=function(t,i,r,n){return void 0===n&&(n="SHA-256"),a(void 0,void 0,void 0,(function(){var o;return s(this,(function(a){switch(a.label){case 0:return[4,(0,e.compute)(t,i,n)];case 1:return o=a.sent(),[2,r.toString()===o.toString()]}}))}))}},10312:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.verify=e.compute=void 0;var a=o(i(44704));e.compute=a.compute,e.verify=a.verify,e.default={compute:e.compute,verify:e.verify}},81677:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={hashes:{"SHA3-512":{nodeName:"sha3-512",hashSize:64,blockSize:72},"SHA3-384":{nodeName:"sha3-384",hashSize:48,blockSize:104},"SHA3-256":{nodeName:"sha3-256",hashSize:32,blockSize:136},"SHA3-224":{nodeName:"sha3-224",hashSize:28,blockSize:144},"SHA-256":{nodeName:"sha256",hashSize:32,blockSize:64},"SHA-384":{nodeName:"sha384",hashSize:48,blockSize:128},"SHA-512":{nodeName:"sha512",hashSize:64,blockSize:128},"SHA-1":{nodeName:"sha1",hashSize:20,blockSize:64},MD5:{nodeName:"md5",hashSize:16,blockSize:64}}}},27130:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PBES2ESParams=e.PBKDF2Params=e.PBES2Params=e.PBEParameter=e.EncryptedPrivateKeyInfo=e.OneAsymmetricKey=e.SubjectPublicKeyInfo=e.KeyStructure=void 0;var o=n(i(39809));e.KeyStructure=o.default.define("KeyStructure",(function(){this.choice({subjectPublicKeyInfo:this.use(e.SubjectPublicKeyInfo),oneAsymmetricKey:this.use(e.OneAsymmetricKey),encryptedPrivateKeyInfo:this.use(e.EncryptedPrivateKeyInfo)})})),e.SubjectPublicKeyInfo=o.default.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),e.OneAsymmetricKey=o.default.define("OneAsymmetricKey",(function(){this.seq().obj(this.key("version").use(s),this.key("privateKeyAlgorithm").use(a),this.key("privateKey").octstr(),this.key("attributes").implicit(0).optional().any(),this.key("publicKey").implicit(1).optional().bitstr())})),e.EncryptedPrivateKeyInfo=o.default.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("encryptionAlgorithm").use(a),this.key("encryptedData").octstr())})),e.PBEParameter=o.default.define("PBEParameter",(function(){this.seq().obj(this.key("salt").octstr(8),this.key("iterationCount").int())})),e.PBES2Params=o.default.define("PBES2Params",(function(){this.seq().obj(this.key("keyDerivationFunc").use(a),this.key("encryptionScheme").use(a))})),e.PBKDF2Params=o.default.define("PBKDF2Params",(function(){this.seq().obj(this.key("salt").choice({specified:this.octstr(),otherSource:this.use(a)}),this.key("iterationCount").int(),this.key("keyLength").int().optional(),this.key("prf").use(a).def({algorithm:[1,2,840,113549,2,7],parameters:r.from([5,0])}))})),e.PBES2ESParams={"des-ede3-cbc":o.default.define("DesEde3CbcParams",(function(){this.octstr()})),"aes128-cbc":o.default.define("Aes128CbcParams",(function(){this.octstr()})),"aes192-cbc":o.default.define("Aes192CbcParams",(function(){this.octstr()})),"aes256-cbc":o.default.define("Aes256CbcParams",(function(){this.octstr()}))};var a=o.default.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})),s=o.default.define("Version",(function(){this.int()}))},41288:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toJWK=e.fromJWK=void 0;var s=a(i(39809)),c=o(i(32398)),u=i(53336);e.fromJWK=function(t,e,i){void 0===i&&(i=!1);var r=(0,u.fromJwk)(t,{outputFormat:"binary",outputPublic:!0,compact:i}),n=c.publicKeyAlgorithms.EC.oid,o={unused:0,data:Array.from(r)},a=l.encode({type:"namedCurve",value:c.namedCurves[t.crv].oid},"der"),s={algorithm:n,parameters:a},f={};if("public"===e)f.subjectPublicKey=o,f.algorithm=s;else if("private"===e){var p=(0,u.fromJwk)(t,{outputFormat:"binary",outputPublic:!1,compact:i});f.version=0,f.privateKeyAlgorithm=s,f.privateKey=h.encode({version:1,privateKey:Array.from(p),parameters:a,publicKey:o},"der")}return f};e.toJWK=function(t,e){if("public"===e){t.algorithm.parameters=l.decode(t.algorithm.parameters,"der");var i=new Uint8Array(t.subjectPublicKey.data),r=c.getAlgorithmFromOid(t.algorithm.parameters.value,c.namedCurves);return(0,u.toJwk)(i,r[0],{outputPublic:!0})}t.privateKeyAlgorithm.parameters=l.decode(t.privateKeyAlgorithm.parameters,"der");try{t.privateKey=h.decode(t.privateKey,"der")}catch(e){t.privateKey=f.decode(t.privateKey,"der")}var n=new Uint8Array(t.privateKey.privateKey);if((r=c.getAlgorithmFromOid(t.privateKeyAlgorithm.parameters.value,c.namedCurves)).length<1)throw new Error("UnsupportedCurve");return(0,u.toJwk)(n,r[0],{outputPublic:!1})};var l=s.default.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),h=s.default.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})),f=s.default.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("publicKey").explicit(1).optional().bitstr())}))},86400:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]0?[4,(0,m.encryptEncryptedPrivateKeyInfo)(h,c)]:[3,3];case 2:h=s.sent(),n="encryptedPrivate",s.label=3;case 3:return h=new Uint8Array(h),[2,"pem"===e?f.default.formatter.binToPem(h,n):h]}}))}))};e.toJwk=function(t,e,i){var r=i.outputPublic,n=i.passphrase;return a(void 0,void 0,void 0,(function(){var i,o,a,c;return s(this,(function(s){switch(s.label){case 0:i="pem"===e?f.default.formatter.pemToBin(t):t;try{o=d.KeyStructure.decode(v.from(i),"der")}catch(t){throw new Error("FailedToDecodeKey")}return"subjectPublicKeyInfo"!==o.type?[3,1]:(a="public",o=o.value,[3,4]);case 1:return a="boolean"==typeof r&&r?"public":"private","encryptedPrivateKeyInfo"!==o.type?[3,3]:[4,(0,m.decryptEncryptedPrivateKeyInfo)(o.value,n)];case 2:return o=s.sent(),[3,4];case 3:if("oneAsymmetricKey"!==o.type)throw new Error("UnsupportedKeyStructure");o=o.value,s.label=4;case 4:if((c=(0,h.getAlgorithmFromOid)("public"===a?o.algorithm.algorithm:o.privateKeyAlgorithm.algorithm,h.publicKeyAlgorithms)).length<1)throw new Error("UnsupportedKey");if("EC"===c[0])return[2,u.toJWK(o,a)];if("RSA"===c[0])return[2,l.toJwk(o,a)];throw new Error("InvalidKeyType")}}))}))}},11570:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toJwk=e.fromJwk=void 0;var s=a(i(39809)),c=a(i(10212)),u=o(i(58609)).Buffer,l=o(i(32398)),h=i(45330);e.fromJwk=function(t,e){var i={algorithm:l.publicKeyAlgorithms.RSA.oid,parameters:u.from([5,0])},r=c.default.encoder.decodeBase64Url(t.n),n=r.length,o=n%128==0?n:n+(128-n%128),a=new s.default.bignum((0,h.appendLeadingZeros)(r,o)),d=new s.default.bignum(c.default.encoder.decodeBase64Url(t.e)),m={};return"public"===e?(m.subjectPublicKey={unused:0,data:f.encode({modulus:a,publicExponent:d},"der")},m.algorithm=i):"private"===e&&(m.version=0,m.privateKeyAlgorithm=i,m.privateKey=p.encode({version:0,modulus:a,publicExponent:d,privateExponent:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.d),o)),prime1:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.p),o)),prime2:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.q),o)),exponent1:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.dp),o)),exponent2:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.dq),o)),coefficient:new s.default.bignum((0,h.appendLeadingZeros)(c.default.encoder.decodeBase64Url(t.qi),o))},"der")),m};e.toJwk=function(t,e){if("public"===e){t.subjectPublicKey.data=f.decode(t.subjectPublicKey.data,"der");var i=t.subjectPublicKey.data.modulus,r=t.subjectPublicKey.data.publicExponent,n=(a=i.byteLength())%128==0?a:a+(128-a%128);return i=new Uint8Array(i.toArray("be",n)),r=new Uint8Array(r.toArray("be",r.byteLength())),{kty:"RSA",n:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(i)),e:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(r))}}t.privateKey=p.decode(t.privateKey,"der");var o={};o.modulus=t.privateKey.modulus;var a,s=(a=o.modulus.byteLength())%128==0?a:a+(128-a%128);o.modulus=new Uint8Array(o.modulus.toArray("be",s)),o.publicExponent=new Uint8Array(t.privateKey.publicExponent.toArray("be",t.privateKey.publicExponent.byteLength())),o.privateExponent=new Uint8Array(t.privateKey.privateExponent.toArray("be",s));return["prime1","prime2","exponent1","exponent2","coefficient"].forEach((function(e){o[e]=new Uint8Array(t.privateKey[e].toArray("be",s>>1))})),{kty:"RSA",n:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.modulus)),e:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.publicExponent)),d:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.privateExponent)),p:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.prime1)),q:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.prime2)),dp:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.exponent1)),dq:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.exponent2)),qi:c.default.encoder.encodeBase64Url((0,h.pruneLeadingZeros)(o.coefficient))}};var f=s.default.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())})),p=s.default.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int(),this.key("otherPrimeInfos").optional().use(d))})),d=s.default.define("OtherPrimeInfos",(function(){this.seqof(m)})),m=s.default.define("OtherPrimeInfo",(function(){this.seq().obj(this.key("prime").int(),this.key("exponent").int(),this.key("coefficient").int())}))},55312:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]0,this._current.oct=void 0!==this._oct.key&&void 0!==this._oct.namedCurve&&this._oct.key.length>0},t.prototype.export=function(t,e){return void 0===t&&(t="jwk"),void 0===e&&(e={}),r(this,void 0,void 0,(function(){var i;return n(this,(function(r){switch(r.label){case 0:if(this._isEncrypted&&"private"===this._type){if("der"!==t&&"pem"!==t||0!==Object.keys(e).length||!this._current.der)throw new Error("DecryptionRequired");return[2,"pem"===t?c.default.formatter.binToPem(this._der,"encryptedPrivate"):this._der]}return this._current.jwk?(i=this._jwk,[3,6]):[3,1];case 1:return this._current.oct?[4,(0,a.toJwkFrom)("oct",this._oct.key,{namedCurve:this._oct.namedCurve})]:[3,3];case 2:case 4:return i=r.sent(),[3,6];case 3:return this._current.der?[4,(0,a.toJwkFrom)("der",this._der)]:[3,5];case 5:throw new Error("InvalidStatus");case 6:return this._setJwk(i),"der"!==t&&"pem"!==t?[3,8]:[4,(0,a.fromJwkTo)(t,i,{outputPublic:e.outputPublic,compact:e.compact,encryptParams:e.encryptParams})];case 7:case 9:return[2,r.sent()];case 8:return"oct"!==t?[3,10]:[4,(0,a.fromJwkTo)(t,i,{outputPublic:e.outputPublic,output:e.output,compact:e.compact})];case 10:return[2,i]}}))}))},t.prototype.encrypt=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:if(this._isEncrypted)throw new Error("AlreadyEncrypted");return e={encryptParams:{passphrase:t}},i=this._setAsn1,[4,this.export("der",e)];case 1:return i.apply(this,[r.sent(),"der"]),[2,!0]}}))}))},t.prototype.decrypt=function(t){return r(this,void 0,void 0,(function(){var e;return n(this,(function(i){switch(i.label){case 0:if(!this._isEncrypted)throw new Error("NotEncrypted");return this._current.der?[4,(0,a.toJwkFrom)("der",this._der,{passphrase:t})]:[3,2];case 1:return e=i.sent(),[3,3];case 2:throw new Error("FailedToDecrypt");case 3:return this._setJwk(e),[2,!0]}}))}))},t.prototype.getJwkThumbprint=function(t,e){return void 0===t&&(t="SHA-256"),void 0===e&&(e="binary"),r(this,void 0,void 0,(function(){var i;return n(this,(function(r){switch(r.label){case 0:if(this._isEncrypted)throw new Error("DecryptionRequired");return i=s.getJwkThumbprint,[4,this.export("jwk")];case 1:return[4,i.apply(void 0,[r.sent(),t,e])];case 2:return[2,r.sent()]}}))}))},Object.defineProperty(t.prototype,"keyType",{get:function(){var t=this;if(this._isEncrypted)throw new Error("DecryptionRequired");return new Promise((function(e,i){t.export("jwk").then((function(t){e(t.kty)})).catch((function(t){i(t)}))}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwkThumbprint",{get:function(){return this.getJwkThumbprint()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEncrypted",{get:function(){return this._isEncrypted},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrivate",{get:function(){return"private"===this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"der",{get:function(){return this.export("der")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pem",{get:function(){return this.export("pem")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwk",{get:function(){return this.export("jwk")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oct",{get:function(){return this.export("oct",{output:"string"})},enumerable:!1,configurable:!0}),t}();e.Key=h},53336:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toJwk=e.fromJwk=void 0;var s=o(i(32398)),c=a(i(10212)),u=o(i(86266)),l=i(45330),h=u.ec;e.fromJwk=function(t,e){var i=e.outputPublic,r=e.outputFormat,n=void 0===r?"binary":r,o=e.compact,a=void 0!==o&&o,s=(0,l.getJwkType)(t);if("public"===("boolean"==typeof i&&i?"public":s)){var u=c.default.encoder.decodeBase64Url(t.x),h=c.default.encoder.decodeBase64Url(t.y),f=void 0;return a?((f=new Uint8Array(u.length+1))[0]=255&2+(1&h.slice(-1)[0]),f.set(u,1)):((f=new Uint8Array(u.length+h.length+1))[0]=4,f.set(u,1),f.set(h,u.length+1)),"string"===n?c.default.encoder.arrayBufferToHexString(f):f}if(!t.d)throw new Error("InvalidKey");var p=c.default.encoder.decodeBase64Url(t.d);return"string"===n?c.default.encoder.arrayBufferToHexString(p):p};e.toJwk=function(t,e,i){var r=i.outputPublic;if(Object.keys(s.namedCurves).indexOf(e)<0)throw new Error("UnsupportedCurve");var n=(0,l.getSec1KeyType)(t,e),o="boolean"==typeof r&&r?"public":n,a="string"==typeof t?c.default.encoder.hexStringToArrayBuffer(t):t,u=s.namedCurves[e].indutnyName,f=new h(u),p="public"===n?f.keyFromPublic(a):f.keyFromPrivate(a),d=new Uint8Array(p.getPublic("array")),m=s.namedCurves[e].payloadSize,y=d.slice(1,m+1),v=d.slice(m+1,2*m+1),g={kty:"EC",crv:e,x:c.default.encoder.encodeBase64Url(y),y:c.default.encoder.encodeBase64Url(v)};return"private"===o&&(g.d=c.default.encoder.encodeBase64Url(a)),g}},32398:(t,e)=>{"use strict";function i(t,e){return Object.keys(e).filter((function(i){return e[i].oid.toString()===t.toString()}))}Object.defineProperty(e,"__esModule",{value:!0}),e.getAlgorithmFromOidStrict=e.getAlgorithmFromOid=e.hashes=e.encryptionSchemes=e.pbkdf2Prfs=e.keyDerivationFunctions=e.passwordBasedEncryptionSchemes=e.publicKeyAlgorithms=e.namedCurves=void 0,e.namedCurves={"P-256":{indutnyName:"p256",payloadSize:32,oid:[1,2,840,10045,3,1,7]},"P-384":{indutnyName:"p384",payloadSize:48,oid:[1,3,132,0,34]},"P-521":{indutnyName:"p521",payloadSize:66,oid:[1,3,132,0,35]},"P-256K":{indutnyName:"secp256k1",payloadSize:32,oid:[1,3,132,0,10]}},e.publicKeyAlgorithms={EC:{oid:[1,2,840,10045,2,1]},RSA:{oid:[1,2,840,113549,1,1,1]}},e.passwordBasedEncryptionSchemes={"pbeWithMD5AndDES-CBC":{oid:[1,2,840,113549,1,5,3],hash:"MD5",encrypt:"DES-CBC"},"pbeWithSHA1AndDES-CBC":{oid:[1,2,840,113549,1,5,10],hash:"SHA-1",encrypt:"DES-CBC"},pbes2:{oid:[1,2,840,113549,1,5,13]}},e.keyDerivationFunctions={pbkdf2:{oid:[1,2,840,113549,1,5,12],defaultSaltLen:8}},e.pbkdf2Prfs={hmacWithSHA1:{oid:[1,2,840,113549,2,7],hash:"SHA-1"},hmacWithSHA256:{oid:[1,2,840,113549,2,9],hash:"SHA-256"},hmacWithSHA384:{oid:[1,2,840,113549,2,10],hash:"SHA-384"},hmacWithSHA512:{oid:[1,2,840,113549,2,11],hash:"SHA-512"}},e.encryptionSchemes={"des-ede3-cbc":{oid:[1,2,840,113549,3,7],keyLength:24,ivLength:8},"aes128-cbc":{oid:[2,16,840,1,101,3,4,1,2],keyLength:16,ivLength:16},"aes192-cbc":{oid:[2,16,840,1,101,3,4,1,22],keyLength:24,ivLength:16},"aes256-cbc":{oid:[2,16,840,1,101,3,4,1,42],keyLength:32,ivLength:16}},e.hashes={"SHA-256":{hashSize:32},"SHA-384":{hashSize:48},"SHA-512":{hashSize:64},"SHA-1":{hashSize:20},MD5:{hashSize:16}},e.getAlgorithmFromOid=i;e.getAlgorithmFromOidStrict=function(t,e){var r=i(t,e);if(0===r.length)throw new Error("UnsupportedAlgorithm");return r[0]}},7597:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=0))throw new Error("UnsupportedCipher");return r.parameters=l.PBES2ESParams[r.algorithm].encode(r.parameters,"der"),r.algorithm=u.encryptionSchemes[r.algorithm].oid,e.encryptionAlgorithm.parameters=l.PBES2Params.encode({keyDerivationFunc:i,encryptionScheme:r},"der"),e.encryptedData=t.encryptedData,l.EncryptedPrivateKeyInfo.encode(e,"der")},_=function(t){var e,i,r,n=l.PBES2Params.decode(t,"der"),o=u.getAlgorithmFromOidStrict(n.keyDerivationFunc.algorithm,u.keyDerivationFunctions);if("pbkdf2"!==o)throw new Error("UnsupportedKDF");var a=l.PBKDF2Params.decode(n.keyDerivationFunc.parameters,"der");r={algorithm:u.getAlgorithmFromOidStrict(a.prf.algorithm,u.pbkdf2Prfs),parameters:a.prf.parameters},e=a.iterationCount,i={type:a.salt.type,value:a.salt.value};var s=u.getAlgorithmFromOidStrict(n.encryptionScheme.algorithm,u.encryptionSchemes);if(!(Object.keys(l.PBES2ESParams).indexOf(s)>=0))throw new Error("UnsupportedCipher");return{keyDerivationFunc:{algorithm:o,parameters:{salt:i,iterationCount:e,prf:r}},encryptionScheme:{algorithm:s,parameters:l.PBES2ESParams[s].decode(n.encryptionScheme.parameters,"der")}}},S=function(t,e,i,r,n,o){return a(void 0,void 0,void 0,(function(){var a,c,l,f,p,w,_,S,x,M,E,k;return s(this,(function(s){switch(s.label){case 0:return a=d.default.encoder.stringToArrayBuffer(e),[4,v.default.getRandomBytes(u.keyDerivationFunctions[i].defaultSaltLen)];case 1:return c=s.sent(),l=u.encryptionSchemes[o].keyLength,"pbkdf2"!==i?[3,3]:[4,m.default.pbkdf2(a,c,n,l,u.pbkdf2Prfs[r].hash)];case 2:return f=s.sent(),[3,4];case 3:throw new Error("UnsupportedKDF");case 4:return"des-ede3-cbc"!==o?[3,6]:(S=(_=g).from,[4,v.default.getRandomBytes(u.encryptionSchemes[o].ivLength)]);case 5:return p=S.apply(_,[s.sent()]),x=h.default.CBC.instantiate(h.default.EDE),M=x.create({type:"encrypt",key:g.from(f),iv:p}),w=g.from(M.update(t).concat(M.final())),[3,10];case 6:return"aes128-cbc"!==o&&"aes192-cbc"!==o&&"aes256-cbc"!==o?[3,9]:[4,v.default.getRandomBytes(u.encryptionSchemes[o].ivLength)];case 7:return p=s.sent(),k=(E=g).from,[4,y.default.encrypt(new Uint8Array(t),f,{name:"AES-CBC",iv:p})];case 8:return w=k.apply(E,[s.sent()]),p=g.from(p),[3,10];case 9:throw new Error("UnsupportedCipher");case 10:return[2,{encryptedData:w,encryptionAlgorithm:{algorithm:"pbes2",parameters:{keyDerivationFunc:{algorithm:i,parameters:{salt:{type:"specified",value:g.from(c)},iterationCount:new b(n),prf:{algorithm:r,parameters:g.from([5,0])}}},encryptionScheme:{algorithm:o,parameters:p}}}}]}}))}))},x=function(t,e){return a(void 0,void 0,void 0,(function(){var i,r,n,o,a,c,f,p,v,b,w,_,S,x;return s(this,(function(s){switch(s.label){case 0:if(i=t.encryptionAlgorithm.parameters.keyDerivationFunc,r=t.encryptionAlgorithm.parameters.encryptionScheme,n=u.encryptionSchemes[r.algorithm].keyLength,"pbkdf2"!==i.algorithm)return[3,2];if(a=d.default.encoder.stringToArrayBuffer(e),"specified"!==i.parameters.salt.type)throw new Error("UnsupportedSaltSource");return c=new Uint8Array(i.parameters.salt.value),f=i.parameters.iterationCount.toNumber(),p=i.parameters.prf.algorithm,[4,m.default.pbkdf2(a,c,f,n,u.pbkdf2Prfs[p].hash)];case 1:return o=s.sent(),[3,3];case 2:throw new Error("UnsupportedKDF");case 3:return"des-ede3-cbc"!==r.algorithm?[3,4]:(_=r.parameters,b=h.default.CBC.instantiate(h.default.EDE),w=b.create({type:"decrypt",key:o,iv:_}),v=g.from(w.update(t.encryptedData).concat(w.final())),[3,7]);case 4:return"aes128-cbc"!==r.algorithm&&"aes192-cbc"!==r.algorithm&&"aes256-cbc"!==r.algorithm?[3,6]:(_=new Uint8Array(r.parameters),x=(S=g).from,[4,y.default.decrypt(new Uint8Array(t.encryptedData),o,{name:"AES-CBC",iv:_})]);case 5:return v=x.apply(S,[s.sent()]),[3,7];case 6:throw new Error("UnsupportedEncryptionAlgorithm");case 7:return[2,l.OneAsymmetricKey.decode(v,"der")]}}))}))},M=function(t,e,i,r){return a(void 0,void 0,void 0,(function(){var n,o,a,c,l,f,p,y,w;return s(this,(function(s){switch(s.label){case 0:return n=d.default.encoder.stringToArrayBuffer(e),[4,v.default.getRandomBytes(8)];case 1:return o=s.sent(),a=u.passwordBasedEncryptionSchemes[i].hash,[4,m.default.pbkdf1(n,o,r,16,a)];case 2:if(c=s.sent(),l=c.slice(0,8),f=c.slice(8,16),"DES-CBC"!==u.passwordBasedEncryptionSchemes[i].encrypt)throw new Error("UnsupportedEncryptionAlgorithm");return y=h.default.CBC.instantiate(h.default.DES),w=y.create({type:"encrypt",key:l,iv:f}),p=g.from(w.update(t).concat(w.final())),[2,{encryptionAlgorithm:{algorithm:i,parameters:{salt:g.from(o),iterationCount:new b(r)}},encryptedData:p}]}}))}))},E=function(t,e){return a(void 0,void 0,void 0,(function(){var i,r,n,o,a,c,f,p,y,v;return s(this,(function(s){switch(s.label){case 0:return i=d.default.encoder.stringToArrayBuffer(e),r=new Uint8Array(t.encryptionAlgorithm.parameters.salt),n=u.passwordBasedEncryptionSchemes[t.encryptionAlgorithm.algorithm].hash,o=t.encryptionAlgorithm.parameters.iterationCount.toNumber(),[4,m.default.pbkdf1(i,r,o,16,n)];case 1:if(a=s.sent(),c=a.slice(0,8),f=a.slice(8,16),"DES-CBC"!==u.passwordBasedEncryptionSchemes[t.encryptionAlgorithm.algorithm].encrypt)throw new Error("UnsupportedEncryptionAlgorithm");return y=h.default.CBC.instantiate(h.default.DES),v=y.create({type:"decrypt",key:c,iv:f}),p=g.from(v.update(t.encryptedData).concat(v.final())),[2,l.OneAsymmetricKey.decode(p,"der")]}}))}))}},12357:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},a=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]e)throw new Error("InvalidLength");var i=new Uint8Array(e);return i.set(t,e-t.length),i}},97833:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.pbkdf1=e.pbkdf2=void 0;var a=o(i(34122));e.pbkdf2=a.pbkdf2,e.pbkdf1=a.pbkdf1,e.default={pbkdf2:e.pbkdf2,pbkdf1:e.pbkdf1}},52483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={hashes:{"SHA3-512":{hashSize:64},"SHA3-384":{hashSize:48},"SHA3-256":{hashSize:32},"SHA3-224":{hashSize:28},"SHA-256":{hashSize:32},"SHA-384":{hashSize:48},"SHA-512":{hashSize:64},"SHA-1":{hashSize:20},MD5:{hashSize:16}}}},34122:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1](Math.pow(2,32)-1)*f)throw new Error("DerivedKeyTooLong");for(p=Math.ceil(o/f),d=o-(p-1)*f,m=function(t){return r(void 0,void 0,void 0,(function(){var r,o,a,u;return n(this,(function(n){switch(n.label){case 0:return(r=new Uint8Array(e.length+4)).set(e),r.set(l(t+1,4),e.length),[4,c.default.compute(h,r,s)];case 1:o=n.sent(),a=new Uint8Array(o),u=1,n.label=2;case 2:return u>8*(e-r-1);return i};e.pbkdf1=function(t,e,i,o,c){return r(void 0,void 0,void 0,(function(){var r,l;return n(this,(function(n){switch(n.label){case 0:if(i<=0)throw new Error("InvalidIterationCount");if(o<=0)throw new Error("InvalidDerivedKeyLength");if("string"==typeof t&&(t=a.default.encoder.stringToArrayBuffer(t)),o>u.default.hashes[c].hashSize)throw new Error("DerivedKeyTooLong");(r=new Uint8Array(t.length+e.length)).set(t),r.set(e,t.length),l=0,n.label=1;case 1:return l{let i="";i="string"==typeof t?t:(0,e.arrayBufferToString)(t);return a.getEnvBtoa()(i)};e.decodeBase64=t=>{const i=a.getEnvAtob()(t),r=(0,e.stringToArrayBuffer)(i);return c(r)};const s=t=>t instanceof Uint8Array?t:ArrayBuffer.isView(t)&&void 0!==t.buffer?new Uint8Array(t.buffer):new Uint8Array(t),c=t=>{let e=!0;for(let i=0;i126||t[i]<32&&13!==t[i]&&10!==t[i]){e=!1;break}let i=null;if(e){i="";for(let e=0;e(0,e.encodeBase64)(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");e.decodeBase64Url=t=>(t=t.replace(/-/g,"+").replace(/_/g,"/"),(0,e.decodeBase64)(t));e.arrayBufferToHexString=t=>{const e=s(t);let i="";for(let t=0;t{const e=[],i=t.length;for(let r=0;r{const e=s(t),i=new Array(e.length);return e.forEach(((t,e)=>{i[e]=t})),String.fromCharCode.apply(null,i)};e.stringToArrayBuffer=t=>new Uint8Array(t.length).map(((e,i)=>t.charCodeAt(i)))},19943:(t,e,i)=>{"use strict";var r=i(99649);Object.defineProperty(e,"__esModule",{value:!0}),e.getEnvAtob=e.getEnvBtoa=void 0;e.getEnvBtoa=()=>"undefined"!=typeof window?window.btoa:n;e.getEnvAtob=()=>"undefined"!=typeof window?window.atob:o;const n=t=>{if(void 0===r)throw new Error("UnsupportedEnvironment");return r.from(t.toString(),"binary").toString("base64")},o=t=>{if(void 0===r)throw new Error("UnsupportedEnvironment");return r.from(t,"base64").toString("binary")}},22269:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.binToPem=e.pemToBin=void 0;const a=o(i(21036)),s={public:"PUBLIC KEY",private:"PRIVATE KEY",encryptedPrivate:"ENCRYPTED PRIVATE KEY",certificate:"CERTIFICATE",certRequest:"CERTIFICATE REQUEST"};e.pemToBin=t=>{const e=u(t);return a.decodeBase64(e)};e.binToPem=(t,e)=>{const i=a.encodeBase64(t);return c(i,e)};const c=(t,e)=>{const i=s[e];let r=`-----BEGIN ${i}-----\n`;for(;t.length>0;)r+=`${t.substring(0,64)}\n`,t=t.substring(64);return r=`${r}-----END ${i}-----`,r},u=t=>{const e=RegExp("^-----[s]*BEGIN[^-]*-----$","gm"),i=RegExp("^-----[s]*END[^-]*-----$","gm");try{let r=t.split(e)[1].split(i)[0];return r=r.replace(/\r?\n/g,""),r}catch(t){throw new Error("Invalid format as PEM")}}},10212:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.formatter=e.encoder=void 0;const a=o(i(21036)),s=o(i(22269));var c,u;!function(t){t.encodeBase64=a.encodeBase64,t.decodeBase64=a.decodeBase64,t.encodeBase64Url=a.encodeBase64Url,t.decodeBase64Url=a.decodeBase64Url,t.arrayBufferToHexString=a.arrayBufferToHexString,t.hexStringToArrayBuffer=a.hexStringToArrayBuffer,t.stringToArrayBuffer=a.stringToArrayBuffer,t.arrayBufferToString=a.arrayBufferToString}(c||(e.encoder=c={})),function(t){t.binToPem=s.binToPem,t.pemToBin=s.pemToBin}(u||(e.formatter=u={})),e.default={encoder:c,formatter:u}},96813:(t,e,i)=>{let r;try{r=i(20077)}catch(t){r=i(10978)}const n=i(38981),{stringify:o,stripBom:a}=i(96780);const s={readFile:n.fromPromise((async function(t,e={}){"string"==typeof e&&(e={encoding:e});const i=e.fs||r,o=!("throws"in e)||e.throws;let s,c=await n.fromCallback(i.readFile)(t,e);c=a(c);try{s=JSON.parse(c,e?e.reviver:null)}catch(e){if(o)throw e.message=`${t}: ${e.message}`,e;return null}return s})),readFileSync:function(t,e={}){"string"==typeof e&&(e={encoding:e});const i=e.fs||r,n=!("throws"in e)||e.throws;try{let r=i.readFileSync(t,e);return r=a(r),JSON.parse(r,e.reviver)}catch(e){if(n)throw e.message=`${t}: ${e.message}`,e;return null}},writeFile:n.fromPromise((async function(t,e,i={}){const a=i.fs||r,s=o(e,i);await n.fromCallback(a.writeFile)(t,s,i)})),writeFileSync:function(t,e,i={}){const n=i.fs||r,a=o(e,i);return n.writeFileSync(t,a,i)}};t.exports=s},96780:(t,e,i)=>{var r=i(99649);t.exports={stringify:function(t,{EOL:e="\n",finalEOL:i=!0,replacer:r=null,spaces:n}={}){const o=i?e:"";return JSON.stringify(t,r,n).replace(/\n/g,e)+o},stripBom:function(t){return r.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}}},83465:(t,e,i)=>{t=i.nmd(t);var r="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",a="[object Boolean]",s="[object Date]",c="[object Function]",u="[object GeneratorFunction]",l="[object Map]",h="[object Number]",f="[object Object]",p="[object Promise]",d="[object RegExp]",m="[object Set]",y="[object String]",v="[object Symbol]",g="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",x="[object Int8Array]",M="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",O="[object Uint8ClampedArray]",C="[object Uint16Array]",A="[object Uint32Array]",P=/\w*$/,j=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,R={};R[o]=R["[object Array]"]=R[b]=R[w]=R[a]=R[s]=R[_]=R[S]=R[x]=R[M]=R[E]=R[l]=R[h]=R[f]=R[d]=R[m]=R[y]=R[v]=R[k]=R[O]=R[C]=R[A]=!0,R["[object Error]"]=R[c]=R[g]=!1;var I="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,N="object"==typeof self&&self&&self.Object===Object&&self,D=I||N||Function("return this")(),L=e&&!e.nodeType&&e,B=L&&t&&!t.nodeType&&t,F=B&&B.exports===L;function U(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function q(t,e,i,r){var n=-1,o=t?t.length:0;for(r&&o&&(i=t[++n]);++n-1},Ot.prototype.set=function(t,e){var i=this.__data__,r=Tt(i,t);return r<0?i.push([t,e]):i[r][1]=e,this},Ct.prototype.clear=function(){this.__data__={hash:new kt,map:new(dt||Ot),string:new kt}},Ct.prototype.delete=function(t){return Lt(this,t).delete(t)},Ct.prototype.get=function(t){return Lt(this,t).get(t)},Ct.prototype.has=function(t){return Lt(this,t).has(t)},Ct.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},At.prototype.clear=function(){this.__data__=new Ot},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Ot){var r=i.__data__;if(!dt||r.length<199)return r.push([t,e]),this;i=this.__data__=new Ct(r)}return i.set(t,e),this};var Ft=lt?W(lt,Object):function(){return[]},Ut=function(t){return et.call(t)};function zt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||T.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=n}(t.length)&&!Zt(t)}var Vt=ht||function(){return!1};function Zt(t){var e=$t(t)?et.call(t):"";return e==c||e==u}function $t(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Gt(t)?Pt(t):function(t){if(!qt(t))return ft(t);var e=[];for(var i in Object(t))tt.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}t.exports=function(t){return Rt(t,!0,!0)}},62318:(t,e,i)=>{"use strict";var r=i(35717),n=i(3349),o=i(89509).Buffer,a=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<>>32-e}function u(t,e,i,r,n,o,a){return c(t+(e&i|~e&r)+n+o|0,a)+e|0}function l(t,e,i,r,n,o,a){return c(t+(e&r|i&~r)+n+o|0,a)+e|0}function h(t,e,i,r,n,o,a){return c(t+(e^i^r)+n+o|0,a)+e|0}function f(t,e,i,r,n,o,a){return c(t+(i^(e|~r))+n+o|0,a)+e|0}r(s,n),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var i=this._a,r=this._b,n=this._c,o=this._d;i=u(i,r,n,o,t[0],3614090360,7),o=u(o,i,r,n,t[1],3905402710,12),n=u(n,o,i,r,t[2],606105819,17),r=u(r,n,o,i,t[3],3250441966,22),i=u(i,r,n,o,t[4],4118548399,7),o=u(o,i,r,n,t[5],1200080426,12),n=u(n,o,i,r,t[6],2821735955,17),r=u(r,n,o,i,t[7],4249261313,22),i=u(i,r,n,o,t[8],1770035416,7),o=u(o,i,r,n,t[9],2336552879,12),n=u(n,o,i,r,t[10],4294925233,17),r=u(r,n,o,i,t[11],2304563134,22),i=u(i,r,n,o,t[12],1804603682,7),o=u(o,i,r,n,t[13],4254626195,12),n=u(n,o,i,r,t[14],2792965006,17),i=l(i,r=u(r,n,o,i,t[15],1236535329,22),n,o,t[1],4129170786,5),o=l(o,i,r,n,t[6],3225465664,9),n=l(n,o,i,r,t[11],643717713,14),r=l(r,n,o,i,t[0],3921069994,20),i=l(i,r,n,o,t[5],3593408605,5),o=l(o,i,r,n,t[10],38016083,9),n=l(n,o,i,r,t[15],3634488961,14),r=l(r,n,o,i,t[4],3889429448,20),i=l(i,r,n,o,t[9],568446438,5),o=l(o,i,r,n,t[14],3275163606,9),n=l(n,o,i,r,t[3],4107603335,14),r=l(r,n,o,i,t[8],1163531501,20),i=l(i,r,n,o,t[13],2850285829,5),o=l(o,i,r,n,t[2],4243563512,9),n=l(n,o,i,r,t[7],1735328473,14),i=h(i,r=l(r,n,o,i,t[12],2368359562,20),n,o,t[5],4294588738,4),o=h(o,i,r,n,t[8],2272392833,11),n=h(n,o,i,r,t[11],1839030562,16),r=h(r,n,o,i,t[14],4259657740,23),i=h(i,r,n,o,t[1],2763975236,4),o=h(o,i,r,n,t[4],1272893353,11),n=h(n,o,i,r,t[7],4139469664,16),r=h(r,n,o,i,t[10],3200236656,23),i=h(i,r,n,o,t[13],681279174,4),o=h(o,i,r,n,t[0],3936430074,11),n=h(n,o,i,r,t[3],3572445317,16),r=h(r,n,o,i,t[6],76029189,23),i=h(i,r,n,o,t[9],3654602809,4),o=h(o,i,r,n,t[12],3873151461,11),n=h(n,o,i,r,t[15],530742520,16),i=f(i,r=h(r,n,o,i,t[2],3299628645,23),n,o,t[0],4096336452,6),o=f(o,i,r,n,t[7],1126891415,10),n=f(n,o,i,r,t[14],2878612391,15),r=f(r,n,o,i,t[5],4237533241,21),i=f(i,r,n,o,t[12],1700485571,6),o=f(o,i,r,n,t[3],2399980690,10),n=f(n,o,i,r,t[10],4293915773,15),r=f(r,n,o,i,t[1],2240044497,21),i=f(i,r,n,o,t[8],1873313359,6),o=f(o,i,r,n,t[15],4264355552,10),n=f(n,o,i,r,t[6],2734768916,15),r=f(r,n,o,i,t[13],1309151649,21),i=f(i,r,n,o,t[4],4149444226,6),o=f(o,i,r,n,t[11],3174756917,10),n=f(n,o,i,r,t[2],718787259,15),r=f(r,n,o,i,t[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},2568:(t,e,i)=>{var r,n,o,a,s;r=i(71012),n=i(40487).utf8,o=i(48738),a=i(40487).bin,(s=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):n.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var i=r.bytesToWords(t),c=8*t.length,u=1732584193,l=-271733879,h=-1732584194,f=271733878,p=0;p>>24)|4278255360&(i[p]<<24|i[p]>>>8);i[c>>>5]|=128<>>9<<4)]=c;var d=s._ff,m=s._gg,y=s._hh,v=s._ii;for(p=0;p>>0,l=l+b>>>0,h=h+w>>>0,f=f+_>>>0}return r.endian([u,l,h,f])})._ff=function(t,e,i,r,n,o,a){var s=t+(e&i|~e&r)+(n>>>0)+a;return(s<>>32-o)+e},s._gg=function(t,e,i,r,n,o,a){var s=t+(e&r|i&~r)+(n>>>0)+a;return(s<>>32-o)+e},s._hh=function(t,e,i,r,n,o,a){var s=t+(e^i^r)+(n>>>0)+a;return(s<>>32-o)+e},s._ii=function(t,e,i,r,n,o,a){var s=t+(i^(e|~r))+(n>>>0)+a;return(s<>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var i=r.wordsToBytes(s(t,e));return e&&e.asBytes?i:e&&e.asString?a.bytesToString(i):r.bytesToHex(i)}},63047:(t,e,i)=>{var r=i(96240),n=i(29931);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),i=Math.ceil(e/8);do{var n=new r(this.rand.generate(i))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var i=e.sub(t);return t.add(this._randbelow(i))},o.prototype.test=function(t,e,i){var n=t.bitLength(),o=r.mont(t),a=new r(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var s=t.subn(1),c=0;!s.testn(c);c++);for(var u=t.shrn(c),l=s.toRed(o);e>0;e--){var h=this._randrange(new r(2),s);i&&i(h);var f=h.toRed(o).redPow(u);if(0!==f.cmp(a)&&0!==f.cmp(l)){for(var p=1;p0;e--){var l=this._randrange(new r(2),a),h=t.gcd(l);if(0!==h.cmpn(1))return h;var f=l.toRed(n).redPow(c);if(0!==f.cmp(o)&&0!==f.cmp(u)){for(var p=1;p=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},55234:(t,e,i)=>{t.exports=i(53765)},80983:(t,e,i)=>{"use strict";var r,n,o,a=i(55234),s=i(1679).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(t){if(!t||"string"!=typeof t)return!1;var e=c.exec(t),i=e&&a[e[1].toLowerCase()];return i&&i.charset?i.charset:!(!e||!u.test(e[1]))&&"UTF-8"}e.charset=l,e.charsets={lookup:l},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var i=-1===t.indexOf("/")?e.lookup(t):t;if(!i)return!1;if(-1===i.indexOf("charset")){var r=e.charset(i);r&&(i+="; charset="+r.toLowerCase())}return i},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var i=c.exec(t),r=i&&e.extensions[i[1].toLowerCase()];if(!r||!r.length)return!1;return r[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=s("x."+t).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),r=e.extensions,n=e.types,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(t){var e=a[t],i=e.extensions;if(i&&i.length){r[t]=i;for(var s=0;sl||u===l&&"application/"===n[c].substr(0,12)))continue}n[c]=t}}}))},79746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,i){if(t!=e)throw new Error(i||"Assertion failed: "+t+" != "+e)}},34504:(t,e)=>{"use strict";var i=e;function r(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",i=0;i>8,a=255&n;o?i.push(o,a):i.push(a)}return i},i.zero2=r,i.toHex=n,i.encode=function(t,e){return"hex"===e?n(t):t}},70631:(t,e,i)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&c&&"function"==typeof c.get?c.get:null,l=s&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,m=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,g=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,_=String.prototype.toLowerCase,S=RegExp.prototype.test,x=Array.prototype.concat,M=Array.prototype.join,E=Array.prototype.slice,k=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||"symbol")?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function I(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-k(-t):k(t);if(r!==t){var n=String(r),o=g.call(e,n.length+1);return b.call(n,i,"$&_")+"."+b.call(b.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(e,i,"$&_")}var N=i(24654),D=N.custom,L=q(D)?D:null;function B(t,e,i){var r="double"===(i.quoteStyle||e)?'"':"'";return r+t+r}function F(t){return b.call(String(t),/"/g,""")}function U(t){return!("[object Array]"!==W(t)||j&&"object"==typeof t&&j in t)}function z(t){return!("[object RegExp]"!==W(t)||j&&"object"==typeof t&&j in t)}function q(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!A)return!1;try{return A.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,s){var c=r||{};if(H(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return V(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?I(e,S):S}if("bigint"==typeof e){var k=String(e)+"n";return w?I(e,k):k}var C=void 0===c.depth?5:c.depth;if(void 0===n&&(n=0),n>=C&&C>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var D=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=M.call(Array(t.indent+1)," ")}return{base:i,prev:M.call(Array(e+1),i)}}(c,n);if(void 0===s)s=[];else if(G(s,e)>=0)return"[Circular]";function K(e,i,r){if(i&&(s=E.call(s)).push(i),r){var o={depth:c.depth};return H(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,n+1,s)}return t(e,c,n+1,s)}if("function"==typeof e&&!z(e)){var Z=function(t){if(t.name)return t.name;var e=v.call(y.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),tt=Q(e,K);return"[Function"+(Z?": "+Z:" (anonymous)")+"]"+(tt.length>0?" { "+M.call(tt,", ")+" }":"")}if(q(e)){var et=P?b.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(e);return"object"!=typeof e||P?et:$(et)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var it="<"+_.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt"}if(U(e)){if(0===e.length)return"[]";var ot=Q(e,K);return D&&!function(t){for(var e=0;e=0)return!1;return!0}(ot)?"["+Y(ot,D)+"]":"[ "+M.call(ot,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||j&&"object"==typeof t&&j in t)}(e)){var at=Q(e,K);return"cause"in Error.prototype||!("cause"in e)||T.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+M.call(at,", ")+" }":"{ ["+String(e)+"] "+M.call(x.call("[cause]: "+K(e.cause),at),", ")+" }"}if("object"==typeof e&&m){if(L&&"function"==typeof e[L]&&N)return N(e,{depth:C-n});if("symbol"!==m&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,i){st.push(K(i,e,!0)+" => "+K(t,e))})),X("Map",o.call(e),st,D)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return l&&l.call(e,(function(t){ct.push(K(t,e))})),X("Set",u.call(e),ct,D)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return J("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return J("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return J("WeakRef");if(function(t){return!("[object Number]"!==W(t)||j&&"object"==typeof t&&j in t)}(e))return $(K(Number(e)));if(function(t){if(!t||"object"!=typeof t||!O)return!1;try{return O.call(t),!0}catch(t){}return!1}(e))return $(K(O.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||j&&"object"==typeof t&&j in t)}(e))return $(d.call(e));if(function(t){return!("[object String]"!==W(t)||j&&"object"==typeof t&&j in t)}(e))return $(K(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===i.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||j&&"object"==typeof t&&j in t)}(e)&&!z(e)){var ut=Q(e,K),lt=R?R(e)===Object.prototype:e instanceof Object||e.constructor===Object,ht=e instanceof Object?"":"null prototype",ft=!lt&&j&&Object(e)===e&&j in e?g.call(W(e),8,-1):ht?"Object":"",pt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ft||ht?"["+M.call(x.call([],ft||[],ht||[]),": ")+"] ":"");return 0===ut.length?pt+"{}":D?pt+"{"+Y(ut,D)+"}":pt+"{ "+M.call(ut,", ")+" }"}return String(e)};var K=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return K.call(t,e)}function W(t){return m.call(t)}function G(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,r=t.length;ie.maxStringLength){var i=t.length-e.maxStringLength,r="... "+i+" more character"+(i>1?"s":"");return V(g.call(t,0,e.maxStringLength),e)+r}return B(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Z),"single",e)}function Z(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function $(t){return"Object("+t+")"}function J(t){return t+" { ? }"}function X(t,e,i,r){return t+" ("+e+") {"+(r?Y(i,r):M.call(i,", "))+"}"}function Y(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+M.call(t,","+i)+"\n"+e.prev}function Q(t,e){var i=U(t),r=[];if(i){r.length=t.length;for(var n=0;n{"use strict";var e=function(t){return t!=t};t.exports=function(t,i){return 0===t&&0===i?1/t==1/i:t===i||!(!e(t)||!e(i))}},20609:(t,e,i)=>{"use strict";var r=i(4289),n=i(55559),o=i(24244),a=i(75624),s=i(52281),c=n(a(),Object);r(c,{getPolyfill:a,implementation:o,shim:s}),t.exports=c},75624:(t,e,i)=>{"use strict";var r=i(24244);t.exports=function(){return"function"==typeof Object.is?Object.is:r}},52281:(t,e,i)=>{"use strict";var r=i(75624),n=i(4289);t.exports=function(){var t=r();return n(Object,{is:t},{is:function(){return Object.is!==t}}),t}},18987:(t,e,i)=>{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=i(21414),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===o.call(t),r=a(t),s=e&&"[object String]"===o.call(t),f=[];if(!e&&!i&&!r)throw new TypeError("Object.keys called on a non-object");var d=u&&i;if(s&&t.length>0&&!n.call(t,0))for(var m=0;m0)for(var y=0;y{"use strict";var r=Array.prototype.slice,n=i(21414),o=Object.keys,a=o?function(t){return o(t)}:i(18987),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return n(t)?s(r.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},21414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var i=e.call(t),r="[object Arguments]"===i;return r||(r="[object Array]"!==i&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),r}},92837:(t,e,i)=>{"use strict";var r=i(82215),n=i(55419)(),o=i(21924),a=Object,s=o("Array.prototype.push"),c=o("Object.prototype.propertyIsEnumerable"),u=n?Object.getOwnPropertySymbols:null;t.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var i=a(t);if(1===arguments.length)return i;for(var o=1;o{"use strict";var r=i(92837);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),i={},r=0;r{e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},52818:(t,e,i)=>{"use strict";var r=i(39809);e.certificate=i(41934);var n=r.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=n;var o=r.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=r.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=c;var u=r.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=u;var l=r.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=l,e.DSAparam=r.define("DSAparam",(function(){this.int()}));var h=r.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=h;var f=r.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=r.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},41934:(t,e,i)=>{"use strict";var r=i(39809),n=r.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=r.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=r.define("RelativeDistinguishedName",(function(){this.setof(o)})),u=r.define("RDNSequence",(function(){this.seqof(c)})),l=r.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),h=r.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),f=r.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),p=r.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(h),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),d=r.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(p),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=d},77631:(t,e,i)=>{var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=i(13048),s=i(44696),c=i(89509).Buffer;t.exports=function(t,e){var i,u=t.toString(),l=u.match(r);if(l){var h="aes"+l[1],f=c.from(l[2],"hex"),p=c.from(l[3].replace(/[\r\n]/g,""),"base64"),d=a(e,f.slice(0,8),parseInt(l[1],10)).key,m=[],y=s.createDecipheriv(h,d,f);m.push(y.update(p)),m.push(y.final()),i=c.concat(m)}else{var v=u.match(o);i=c.from(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(n)[1],data:i}}},70980:(t,e,i)=>{var r=i(52818),n=i(22562),o=i(77631),a=i(44696),s=i(25632),c=i(89509).Buffer;function u(t){var e;"object"!=typeof t||c.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=c.from(t));var i,u,l=o(t,e),h=l.tag,f=l.data;switch(h){case"CERTIFICATE":u=r.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=r.PublicKey.decode(f,"der")),i=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=r.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":f=function(t,e){var i=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=n[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,l=t.subjectPrivateKey,h=parseInt(o.split("-")[1],10)/8,f=s.pbkdf2Sync(e,i,r,h,"sha1"),p=a.createDecipheriv(o,f,u),d=[];return d.push(p.update(l)),d.push(p.final()),c.concat(d)}(f=r.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(i=(u=r.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:r.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=r.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=r.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+h)}}t.exports=u,u.signature=r.signature},25632:(t,e,i)=>{e.pbkdf2=i(88638),e.pbkdf2Sync=i(91257)},88638:(t,e,i)=>{var r,n,o=i(89509).Buffer,a=i(77357),s=i(12368),c=i(91257),u=i(57777),l=i.g.crypto&&i.g.crypto.subtle,h={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function p(){return n||(n=i.g.process&&i.g.process.nextTick?i.g.process.nextTick:i.g.queueMicrotask?i.g.queueMicrotask:i.g.setImmediate?i.g.setImmediate:i.g.setTimeout)}function d(t,e,i,r,n){return l.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return l.deriveBits({name:"PBKDF2",salt:e,iterations:i,hash:{name:n}},t,r<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,n,m,y,v){"function"==typeof y&&(v=y,y=void 0);var g=h[(y=y||"sha1").toLowerCase()];if(g&&"function"==typeof i.g.Promise){if(a(n,m),t=u(t,s,"Password"),e=u(e,s,"Salt"),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){p()((function(){e(null,t)}))}),(function(t){p()((function(){e(t)}))}))}(function(t){if(i.g.process&&!i.g.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==f[t])return f[t];var e=d(r=r||o.alloc(8),r,10,128,t).then((function(){return!0})).catch((function(){return!1}));return f[t]=e,e}(g).then((function(i){return i?d(t,e,n,m,g):c(t,e,n,m,y)})),v)}else p()((function(){var i;try{i=c(t,e,n,m,y)}catch(t){return v(t)}v(null,i)}))}},12368:(t,e,i)=>{var r,n=i(34155);if(i.g.process&&i.g.process.browser)r="utf-8";else if(i.g.process&&i.g.process.version){r=parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r},77357:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,i){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof i)throw new TypeError("Key length not a number");if(i<0||i>e||i!=i)throw new TypeError("Bad key length")}},91257:(t,e,i)=>{var r=i(78028),n=i(79785),o=i(89072),a=i(89509).Buffer,s=i(77357),c=i(12368),u=i(57777),l=a.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(t,e,i){var s=function(t){function e(e){return o(t).update(e).digest()}function i(t){return(new n).update(t).digest()}return"rmd160"===t||"ripemd160"===t?i:"md5"===t?r:e}(t),c="sha512"===t||"sha384"===t?128:64;e.length>c?e=s(e):e.length{var r=i(89509).Buffer;t.exports=function(t,e,i){if(r.isBuffer(t))return t;if("string"==typeof t)return r.from(t,e);if(ArrayBuffer.isView(t))return r.from(t.buffer);throw new TypeError(i+" must be a string, a Buffer, a typed array or a DataView")}},88212:(t,e,i)=>{"use strict";var r=i(34155);void 0===r||!r.version||0===r.version.indexOf("v0.")||0===r.version.indexOf("v1.")&&0!==r.version.indexOf("v1.8.")?t.exports={nextTick:function(t,e,i,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return r.nextTick(t);case 2:return r.nextTick((function(){t.call(null,e)}));case 3:return r.nextTick((function(){t.call(null,e,i)}));case 4:return r.nextTick((function(){t.call(null,e,i,n)}));default:for(o=new Array(s-1),a=0;a{var e,i,r=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var s,c=[],u=!1,l=-1;function h(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=a(h);u=!0;for(var e=c.length;e;){for(s=c,c=[];++l1)for(var i=1;i{var r=i(14650),n=i(29529);t.exports=function(e,i){if("function"==typeof e)return t.exports(null,e);var o=(e=e||{}).length||0,a=e.time||0,s=e.drain||!1,c=e.transferred||0,u=Date.now()+a,l=0,h=n(e.speed||5e3),f=Date.now(),p={percentage:0,transferred:c,length:o,remaining:o,eta:0,runtime:0},d=function(t){p.delta=l,p.percentage=t?100:o?c/o*100:0,p.speed=h(l),p.eta=Math.round(p.remaining/p.speed),p.runtime=parseInt((Date.now()-f)/1e3),u=Date.now()+a,l=0,m.emit("progress",p)},m=r(e.objectMode?{objectMode:!0,highWaterMark:16}:{},(function(t,i,r){var n=e.objectMode?1:t.length;c+=n,l+=n,p.transferred=c,p.remaining=o>=c?o-c:0,Date.now()>=u&&d(!1),r(null,t)}),(function(t){d(!0),t()})),y=function(t){o=t,p.length=o,p.remaining=o-p.transferred,m.emit("length",o)};return m.setLength=y,m.on("pipe",(function(t){if("number"!=typeof o)return t.readable&&!t.writable&&t.headers?y(parseInt(t.headers["content-length"]||0)):"number"==typeof t.length?y(t.length):void t.on("response",(function(t){if(t&&t.headers&&"gzip"!==t.headers["content-encoding"])return t.headers["content-length"]?y(parseInt(t.headers["content-length"])):void 0}))})),s&&m.resume(),i&&m.on("progress",i),m.progress=function(){return p.speed=h(0),p.eta=Math.round(p.remaining/p.speed),p},m}},7900:(t,e,i)=>{e.publicEncrypt=i(16559),e.privateDecrypt=i(26138),e.privateEncrypt=function(t,i){return e.publicEncrypt(t,i,!0)},e.publicDecrypt=function(t,i){return e.privateDecrypt(t,i,!0)}},99199:(t,e,i)=>{var r=i(23482),n=i(89509).Buffer;function o(t){var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var i,a=n.alloc(0),s=0;a.length=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=c(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,s=Math.min(o,o-a)+i,c=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,c=a/67108864|0;i.words[0]=s;for(var u=1;u>>26,h=67108863&c,f=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=f;p++){var d=u-p|0;l+=(a=(n=0|t.words[d])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[u]=0|h,c=0|l}return 0!==c?i.words[u]=0|c:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?l[6-c.length]+c+i:c+i,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],p=f[t];i="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);i=(d=d.idivn(p)).isZero()?m+i:l[u-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===e,u=new t(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,m=p>>>13,y=0|a[2],v=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],x=8191&S,M=S>>>13,E=0|a[5],k=8191&E,O=E>>>13,C=0|a[6],A=8191&C,P=C>>>13,j=0|a[7],T=8191&j,R=j>>>13,I=0|a[8],N=8191&I,D=I>>>13,L=0|a[9],B=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,G=0|s[2],V=8191&G,Z=G>>>13,$=0|s[3],J=8191&$,X=$>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,ft=lt>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(u+(r=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,q))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(d,z),n=(n=Math.imul(d,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var vt=(u+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,z),n=(n=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),r=r+Math.imul(d,H)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var gt=(u+(r=r+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(w,z),n=(n=Math.imul(w,q))+Math.imul(_,z)|0,o=Math.imul(_,q),r=r+Math.imul(v,H)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,r=r+Math.imul(d,V)|0,n=(n=n+Math.imul(d,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(n=(n=n+Math.imul(h,X)|0)+Math.imul(f,J)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(x,z),n=(n=Math.imul(x,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,H)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,r=r+Math.imul(d,J)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var wt=(u+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(k,z),n=(n=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(x,H)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,r=r+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(f,it)|0))<<13)|0;u=((o=o+Math.imul(f,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,z),n=(n=Math.imul(A,q))+Math.imul(P,z)|0,o=Math.imul(P,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(x,V)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,J)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,r=r+Math.imul(d,it)|0,n=(n=n+Math.imul(d,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(f,ot)|0))<<13)|0;u=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,z),n=(n=Math.imul(T,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,rt)|0,r=r+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var xt=(u+(r=r+Math.imul(h,ct)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(f,ct)|0))<<13)|0;u=((o=o+Math.imul(f,ut)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(N,z),n=(n=Math.imul(N,q))+Math.imul(D,z)|0,o=Math.imul(D,q),r=r+Math.imul(T,H)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,r=r+Math.imul(d,ct)|0,n=(n=n+Math.imul(d,ut)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ut)|0;var Mt=(u+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;u=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,z),n=(n=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),r=r+Math.imul(N,H)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,r=r+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(x,it)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0,r=r+Math.imul(d,ht)|0,n=(n=n+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var Et=(u+(r=r+Math.imul(h,dt)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;u=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,H),n=(n=Math.imul(B,W))+Math.imul(F,H)|0,o=Math.imul(F,W),r=r+Math.imul(N,V)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,Z)|0,r=r+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ft)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,ft)|0;var kt=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,V),n=(n=Math.imul(B,Z))+Math.imul(F,V)|0,o=Math.imul(F,Z),r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Ot=(u+(r=r+Math.imul(v,dt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(g,dt)|0))<<13)|0;u=((o=o+Math.imul(g,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(B,J),n=(n=Math.imul(B,X))+Math.imul(F,J)|0,o=Math.imul(F,X),r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(T,it)|0,n=(n=n+Math.imul(T,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Ct=(u+(r=r+Math.imul(w,dt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),r=r+Math.imul(N,it)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,r=r+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,r=r+Math.imul(k,ht)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var At=(u+(r=r+Math.imul(x,dt)|0)|0)+((8191&(n=(n=n+Math.imul(x,mt)|0)+Math.imul(M,dt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,it),n=(n=Math.imul(B,rt))+Math.imul(F,it)|0,o=Math.imul(F,rt),r=r+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ft)|0;var Pt=(u+(r=r+Math.imul(k,dt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(O,dt)|0))<<13)|0;u=((o=o+Math.imul(O,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(B,ot),n=(n=Math.imul(B,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,r=r+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var jt=(u+(r=r+Math.imul(A,dt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(P,dt)|0))<<13)|0;u=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ct),n=(n=Math.imul(B,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),r=r+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Tt=(u+(r=r+Math.imul(T,dt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(R,dt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),n=(n=Math.imul(B,ft))+Math.imul(F,ht)|0,o=Math.imul(F,ft);var Rt=(u+(r=r+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul(D,dt)|0))<<13)|0;u=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(r=Math.imul(B,dt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(F,dt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,c[0]=yt,c[1]=vt,c[2]=gt,c[3]=bt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=Mt,c[9]=Et,c[10]=kt,c[11]=Ot,c[12]=Ct,c[13]=At,c[14]=Pt,c[15]=jt,c[16]=Tt,c[17]=Rt,c[18]=It,0!==u&&(c[19]=u,i.length++),i};function m(t,e,i){return(new y).mulp(t,e,i)}function y(t,e){this.x=t,this.y=e}Math.imul||(d=p),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):m(this,t,e),i},y.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},y.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,i[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(e=0;e>>26-i}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=n);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,a=0|n.words[n.length-1];0!==(i=26-this._countBits(a))&&(n=n.ushln(i),r.iushln(i),a=0|n.words[n.length-1]);var s,c=r.length-n.length;if("mod"!==e){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var f=67108864*(0|r.words[n.length+h])+(0|r.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(n,f,h);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(n,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),i&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,m=1;0==(i.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(h)),s.iushrn(1),c.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),a.isub(c)):(i.isub(e),s.isub(n),c.isub(a))}return{a:s,b:c,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),c=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,f=1;0==(i.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(s)):(i.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(b,g),b.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=a}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=a;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var h=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[a]),s=0,a=0)):s=0}c=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},26138:(t,e,i)=>{var r=i(70980),n=i(99199),o=i(57859),a=i(92144),s=i(23663),c=i(23482),u=i(84818),l=i(89509).Buffer;t.exports=function(t,e,i){var h;h=t.padding?t.padding:i?1:4;var f,p=r(t),d=p.modulus.byteLength();if(e.length>d||new a(e).cmp(p.modulus)>=0)throw new Error("decryption error");f=i?u(new a(e),p):s(e,p);var m=l.alloc(d-f.length);if(f=l.concat([m,f],d),4===h)return function(t,e){var i=t.modulus.byteLength(),r=c("sha1").update(l.alloc(0)).digest(),a=r.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),u=e.slice(a+1),h=o(s,n(u,a)),f=o(u,n(h,i-a-1));if(function(t,e){t=l.from(t),e=l.from(e);var i=0,r=t.length;t.length!==e.length&&(i++,r=Math.min(t.length,e.length));var n=-1;for(;++n=e.length){o++;break}var a=e.slice(2,n-1);("0002"!==r.toString("hex")&&!i||"0001"!==r.toString("hex")&&i)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(n)}(0,f,i);if(3===h)return f;throw new Error("unknown padding")}},16559:(t,e,i)=>{var r=i(70980),n=i(61798),o=i(23482),a=i(99199),s=i(57859),c=i(92144),u=i(84818),l=i(23663),h=i(89509).Buffer;t.exports=function(t,e,i){var f;f=t.padding?t.padding:i?1:4;var p,d=r(t);if(4===f)p=function(t,e){var i=t.modulus.byteLength(),r=e.length,u=o("sha1").update(h.alloc(0)).digest(),l=u.length,f=2*l;if(r>i-f-2)throw new Error("message too long");var p=h.alloc(i-r-f-2),d=i-l-1,m=n(l),y=s(h.concat([u,p,h.alloc(1,1),e],d),a(m,d)),v=s(m,a(y,l));return new c(h.concat([h.alloc(1),v,y],i))}(d,e);else if(1===f)p=function(t,e,i){var r,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");r=i?h.alloc(a-o-3,255):function(t){var e,i=h.allocUnsafe(t),r=0,o=n(2*t),a=0;for(;r=0)throw new Error("data too long for modulus")}return i?l(p,d):u(p,d)}},84818:(t,e,i)=>{var r=i(92144),n=i(89509).Buffer;t.exports=function(t,e){return n.from(t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed().toArray())}},57859:t=>{t.exports=function(t,e){for(var i=t.length,r=-1;++r{"use strict";var e=String.prototype.replace,i=/%20/g,r="RFC1738",n="RFC3986";t.exports={default:n,formatters:{RFC1738:function(t){return e.call(t,i,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:n}},80129:(t,e,i)=>{"use strict";var r=i(58261),n=i(55235),o=i(55798);t.exports={formats:o,parse:n,stringify:r}},55235:(t,e,i)=>{"use strict";var r=i(12769),n=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},c=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},u=function(t,e,i,r){if(t){var o=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,s=i.depth>0&&/(\[[^[\]]*])/.exec(o),u=s?o.slice(0,s.index):o,l=[];if(u){if(!i.plainObjects&&n.call(Object.prototype,u)&&!i.allowPrototypes)return;l.push(u)}for(var h=0;i.depth>0&&null!==(s=a.exec(o))&&h=0;--o){var a,s=t[o];if("[]"===s&&i.parseArrays)a=[].concat(n);else{a=i.plainObjects?Object.create(null):{};var u="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(u,10);i.parseArrays||""!==u?!isNaN(l)&&s!==u&&String(l)===u&&l>=0&&i.parseArrays&&l<=i.arrayLimit?(a=[])[l]=n:"__proto__"!==u&&(a[u]=n):a={0:n}}n=a}return n}(l,e,i,r)}};t.exports=function(t,e){var i=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null==t)return i.plainObjects?Object.create(null):{};for(var l="string"==typeof t?function(t,e){var i,u={__proto__:null},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,h=e.parameterLimit===1/0?void 0:e.parameterLimit,f=l.split(e.delimiter,h),p=-1,d=e.charset;if(e.charsetSentinel)for(i=0;i-1&&(y=o(y)?[y]:y),n.call(u,m)?u[m]=r.combine(u[m],y):u[m]=y}return u}(t,i):t,h=i.plainObjects?Object.create(null):{},f=Object.keys(l),p=0;p{"use strict";var r=i(37478),n=i(12769),o=i(55798),a=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},c=Array.isArray,u=Array.prototype.push,l=function(t,e){u.apply(t,c(e)?e:[e])},h=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(t){return h.call(t)},skipNulls:!1,strictNullHandling:!1},d={},m=function t(e,i,o,a,s,u,h,f,m,y,v,g,b,w,_,S){for(var x,M=e,E=S,k=0,O=!1;void 0!==(E=E.get(d))&&!O;){var C=E.get(e);if(k+=1,void 0!==C){if(C===k)throw new RangeError("Cyclic object value");O=!0}void 0===E.get(d)&&(k=0)}if("function"==typeof f?M=f(i,M):M instanceof Date?M=v(M):"comma"===o&&c(M)&&(M=n.maybeMap(M,(function(t){return t instanceof Date?v(t):t}))),null===M){if(s)return h&&!w?h(i,p.encoder,_,"key",g):i;M=""}if("string"==typeof(x=M)||"number"==typeof x||"boolean"==typeof x||"symbol"==typeof x||"bigint"==typeof x||n.isBuffer(M))return h?[b(w?i:h(i,p.encoder,_,"key",g))+"="+b(h(M,p.encoder,_,"value",g))]:[b(i)+"="+b(String(M))];var A,P=[];if(void 0===M)return P;if("comma"===o&&c(M))w&&h&&(M=n.maybeMap(M,h)),A=[{value:M.length>0?M.join(",")||null:void 0}];else if(c(f))A=f;else{var j=Object.keys(M);A=m?j.sort(m):j}for(var T=a&&c(M)&&1===M.length?i+"[]":i,R=0;R0?_+w:""}},12769:(t,e,i)=>{"use strict";var r=i(55798),n=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),s=function(t,e){for(var i=e&&e.plainObjects?Object.create(null):{},r=0;r1;){var e=t.pop(),i=e.obj[e.prop];if(o(i)){for(var r=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===r.RFC1738&&(40===l||41===l)?c+=s.charAt(u):l<128?c+=a[l]:l<2048?c+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?c+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(u)),c+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return c},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var i=[],r=0;r{"use strict";var r=i(34155),n=65536,o=4294967295;var a=i(89509).Buffer,s=i.g.crypto||i.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var i=a.allocUnsafe(t);if(t>0)if(t>n)for(var c=0;c{"use strict";var r=i(34155);function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=i(89509),a=i(61798),s=o.Buffer,c=o.kMaxLength,u=i.g.crypto||i.g.msCrypto,l=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>l||t<0)throw new TypeError("offset must be a uint32");if(t>c||t>e)throw new RangeError("offset out of range")}function f(t,e,i){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>l||t<0)throw new TypeError("size must be a uint32");if(t+e>i||t>c)throw new RangeError("buffer too small")}function p(t,e,i,n){if(r.browser){var o=t.buffer,s=new Uint8Array(o,e,i);return u.getRandomValues(s),n?void r.nextTick((function(){n(null,t)})):t}if(!n)return a(i).copy(t,e),t;a(i,(function(i,r){if(i)return n(i);r.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!r.browser?(e.randomFill=function(t,e,r,n){if(!(s.isBuffer(t)||t instanceof i.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)n=e,e=0,r=t.length;else if("function"==typeof r)n=r,r=t.length-e;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return h(e,t.length),f(r,e,t.length),p(t,e,r,n)},e.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof i.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===r&&(r=t.length-e);return f(r,e,t.length),p(t,e,r)}):(e.randomFill=n,e.randomFillSync=n)},94281:t=>{"use strict";var e={};function i(t,i,r){r||(r=Error);var n=function(t){var e,r;function n(e,r,n){return t.call(this,function(t,e,r){return"string"==typeof i?i:i(t,e,r)}(e,r,n))||this}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n}(r);n.prototype.name=r.name,n.prototype.code=t,e[t]=n}function r(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,i){var n,o,a,s;if("string"==typeof e&&(o="not ",e.substr(!a||a<0?0:+a,o.length)===o)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(r(e,"type"));else{var c=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+e.length>t.length)&&-1!==t.indexOf(e,i)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(c," ").concat(n," ").concat(r(e,"type"))}return s+=". Received type ".concat(typeof i)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},56753:(t,e,i)=>{"use strict";var r=i(34155),n=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=l;var o=i(79481),a=i(64229);i(35717)(l,o);for(var s=n(a.prototype),c=0;c{"use strict";t.exports=n;var r=i(74605);function n(t){if(!(this instanceof n))return new n(t);r.call(this,t)}i(35717)(n,r),n.prototype._transform=function(t,e,i){i(null,t)}},79481:(t,e,i)=>{"use strict";var r,n=i(34155);t.exports=E,E.ReadableState=M;i(17187).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=i(22503),s=i(58609).Buffer,c=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=i(94616);u=l&&l.debuglog?l.debuglog("stream"):function(){};var h,f,p,d=i(57327),m=i(61195),y=i(82457).getHighWaterMark,v=i(94281).q,g=v.ERR_INVALID_ARG_TYPE,b=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(35717)(E,a);var S=m.errorOrDestroy,x=["error","close","destroy","pause","resume"];function M(t,e,n){r=r||i(56753),t=t||{},"boolean"!=typeof n&&(n=e instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=i(32553).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function E(t){if(r=r||i(56753),!(this instanceof E))return new E(t);var e=this instanceof r;this._readableState=new M(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function k(t,e,i,r,n){u("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?P(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,a);else if(n||(o=function(t,e){var i;r=e,s.isBuffer(r)||r instanceof c||"string"==typeof e||void 0===e||t.objectMode||(i=new g("chunk",["string","Buffer","Uint8Array"],e));var r;return i}(a,e)),o)S(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)a.endEmitted?S(t,new _):O(t,a,e,!0);else if(a.ended)S(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?O(t,a,e,!1):T(t,a)):O(t,a,e,!1)}else r||(a.reading=!1,T(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=C?t=C:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(j,t))}function j(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L(t)}function T(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){u("readable nexttick read 0"),t.read(0)}function D(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function F(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(U,e,t))}function U(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function z(t,e){for(var i=0,r=t.length;i=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):P(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&F(this),null;var r,n=e.needReadable;return u("need readable",n),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&F(this)),null!==r&&this.emit("data",r),r},E.prototype._read=function(t){S(this,new w("_read()"))},E.prototype.pipe=function(t,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,u("pipe count=%d opts=%j",r.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?c:y;function s(e,n){u("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",s),i.removeListener("end",c),i.removeListener("end",y),i.removeListener("data",f),h=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function c(){u("onend"),t.end()}r.endEmitted?n.nextTick(a):i.once("end",a),t.on("unpipe",s);var l=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,L(t))}}(i);t.on("drain",l);var h=!1;function f(e){u("ondata");var n=t.write(e);u("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==z(r.pipes,t))&&!h&&(u("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(e){u("onerror",e),y(),t.removeListener("error",p),0===o(t,"error")&&S(t,e)}function d(){t.removeListener("finish",m),y()}function m(){u("onfinish"),t.removeListener("close",d),y()}function y(){u("unpipe"),i.unpipe(t)}return i.on("data",f),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",p),t.once("close",d),t.once("finish",m),t.emit("pipe",i),r.flowing||(u("pipe resume"),i.resume()),t},E.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u("on readable",r.length,r.reading),r.length?P(this):r.reading||n.nextTick(N,this))),i},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,e){var i=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(I,this),i},E.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(I,this),e},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(D,t,e))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",(function(){if(u("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(u("wrapped data"),i.decoder&&(n=i.decoder.write(n)),i.objectMode&&null==n)||(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o{"use strict";t.exports=l;var r=i(94281).q,n=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=i(56753);function u(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";var r,n=i(34155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;t.entry=null;for(;r;){var n=r.callback;e.pendingcb--,n(i),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=E,E.WritableState=M;var a={deprecate:i(94927)},s=i(22503),c=i(58609).Buffer,u=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,h=i(61195),f=i(82457).getHighWaterMark,p=i(94281).q,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,v=p.ERR_STREAM_CANNOT_PIPE,g=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;function x(){}function M(t,e,a){r=r||i(56753),t=t||{},"boolean"!=typeof a&&(a=e instanceof r),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,o=i.writecb;if("function"!=typeof o)throw new y;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,o){--e.pendingcb,i?(n.nextTick(o,r),n.nextTick(j,t,e),t._writableState.errorEmitted=!0,S(t,r)):(o(r),t._writableState.errorEmitted=!0,S(t,r),j(t,e))}(t,i,r,e,o);else{var a=A(i)||t.destroyed;a||i.corked||i.bufferProcessing||!i.bufferedRequest||C(t,i),r?n.nextTick(O,t,i,a,o):O(t,i,a,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function E(t){var e=this instanceof(r=r||i(56753));if(!e&&!l.call(E,this))return new E(t);this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function k(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function O(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),j(t,e)}function C(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),a=e.corkedRequestsFree;a.entry=i;for(var s=0,c=!0;i;)n[s]=i,i.isBuf||(c=!1),i=i.next,s+=1;n.allBuffers=c,k(t,e,!0,e.length,n,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;i;){var u=i.chunk,l=i.encoding,h=i.callback;if(k(t,e,!1,e.objectMode?1:u.length,u,l,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(i){e.pendingcb--,i&&S(t,i),e.prefinished=!0,t.emit("prefinish"),j(t,e)}))}function j(t,e){var i=A(e);if(i&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,n.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return i}i(35717)(E,s),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===E&&(t&&t._writableState instanceof M)}})):l=function(t){return t instanceof this},E.prototype.pipe=function(){S(this,new v)},E.prototype.write=function(t,e,i){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=t,c.isBuffer(r)||r instanceof u);return s&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(i=e,e=null),s?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof i&&(i=x),o.ending?function(t,e){var i=new w;S(t,i),n.nextTick(e,i)}(this,i):(s||function(t,e,i,r){var o;return null===i?o=new b:"string"==typeof i||e.objectMode||(o=new d("chunk",["string","Buffer"],i)),!o||(S(t,o),n.nextTick(r,o),!1)}(this,o,t,i))&&(o.pendingcb++,a=function(t,e,i,r,n,o){if(!i){var a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,i));return e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var s=e.objectMode?1:r.length;e.length+=s;var u=e.length-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(t,e,i){i(new m("_write()"))},E.prototype._writev=null,E.prototype.end=function(t,e,i){var r=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,j(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i));e.ended=!0,t.writable=!1}(this,r,i),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.prototype._destroy=function(t,e){e(t)}},45850:(t,e,i)=>{"use strict";var r,n=i(34155);function o(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var a=i(8610),s=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function m(t){var e=t[s];if(null!==e){var i=t[p].read();null!==i&&(t[h]=null,t[s]=null,t[c]=null,e(d(i,!1)))}}function y(t){n.nextTick(m,t)}var v=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((o(r={get stream(){return this[p]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,i){n.nextTick((function(){t[u]?i(t[u]):e(d(void 0,!0))}))}));var i,r=this[h];if(r)i=new Promise(function(t,e){return function(i,r){t.then((function(){e[l]?i(d(void 0,!0)):e[f](i,r)}),r)}}(r,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));i=new Promise(this[f])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),o(r,"return",(function(){var t=this;return new Promise((function(e,i){t[p].destroy(null,(function(t){t?i(t):e(d(void 0,!0))}))}))})),r),v);t.exports=function(t){var e,i=Object.create(g,(o(e={},p,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,l,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var r=i[p].read();r?(i[h]=null,i[s]=null,i[c]=null,t(d(r,!1))):(i[s]=t,i[c]=e)},writable:!0}),e));return i[h]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=i[c];return null!==e&&(i[h]=null,i[s]=null,i[c]=null,e(t)),void(i[u]=t)}var r=i[s];null!==r&&(i[h]=null,i[s]=null,i[c]=null,r(d(void 0,!0))),i[l]=!0})),t.on("readable",y.bind(null,i)),i}},57327:(t,e,i)=>{"use strict";function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function n(t){for(var e=1;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return c.alloc(0);for(var e,i,r,n=c.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,i=n,r=a,c.prototype.copy.call(e,i,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var i;return tn.length?n.length:t;if(o===n.length?r+=n:r+=n.slice(0,t),0==(t-=o)){o===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=c.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,e}},{key:l,value:function(t,e){return u(this,n(n({},e),{},{depth:0,customInspect:!1}))}}])&&a(e.prototype,i),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},61195:(t,e,i)=>{"use strict";var r=i(34155);function n(t,e){a(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var i=this,s=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return s||c?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(a,this,t)):r.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?i._writableState?i._writableState.errorEmitted?r.nextTick(o,i):(i._writableState.errorEmitted=!0,r.nextTick(n,i,t)):r.nextTick(n,i,t):e?(r.nextTick(o,i),e(t)):r.nextTick(o,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,i)=>{"use strict";var r=i(94281).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,i,o){if("function"==typeof i)return t(e,null,i);i||(i={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},59946:(t,e,i)=>{"use strict";var r;var n=i(94281).q,o=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function c(t){t()}function u(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n0,(function(t){l||(l=t),t&&f.forEach(c),o||(f.forEach(c),h(l))}))}));return e.reduce(u)}},82457:(t,e,i)=>{"use strict";var r=i(94281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,i,n){var o=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,n,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(n?i:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},22503:(t,e,i)=>{t.exports=i(17187).EventEmitter},88473:(t,e,i)=>{(e=t.exports=i(79481)).Stream=e,e.Readable=e,e.Writable=i(64229),e.Duplex=i(56753),e.Transform=i(74605),e.PassThrough=i(82725),e.finished=i(8610),e.pipeline=i(59946)},79785:(t,e,i)=>{"use strict";var r=i(58609).Buffer,n=i(35717),o=i(3349),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function p(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(t,e){return t<>>32-e}function m(t,e,i,r,n,o,a,s){return d(t+(e^i^r)+o+a|0,s)+n|0}function y(t,e,i,r,n,o,a,s){return d(t+(e&i|~e&r)+o+a|0,s)+n|0}function v(t,e,i,r,n,o,a,s){return d(t+((e|~i)^r)+o+a|0,s)+n|0}function g(t,e,i,r,n,o,a,s){return d(t+(e&r|i&~r)+o+a|0,s)+n|0}function b(t,e,i,r,n,o,a,s){return d(t+(e^(i|~r))+o+a|0,s)+n|0}n(p,o),p.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var i=0|this._a,r=0|this._b,n=0|this._c,o=0|this._d,p=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,x=0|this._d,M=0|this._e,E=0;E<80;E+=1){var k,O;E<16?(k=m(i,r,n,o,p,t[s[E]],h[0],u[E]),O=b(w,_,S,x,M,t[c[E]],f[0],l[E])):E<32?(k=y(i,r,n,o,p,t[s[E]],h[1],u[E]),O=g(w,_,S,x,M,t[c[E]],f[1],l[E])):E<48?(k=v(i,r,n,o,p,t[s[E]],h[2],u[E]),O=v(w,_,S,x,M,t[c[E]],f[2],l[E])):E<64?(k=g(i,r,n,o,p,t[s[E]],h[3],u[E]),O=y(w,_,S,x,M,t[c[E]],f[3],l[E])):(k=b(i,r,n,o,p,t[s[E]],h[4],u[E]),O=m(w,_,S,x,M,t[c[E]],f[4],l[E])),i=p,p=o,o=d(n,10),n=r,r=k,w=M,M=x,x=d(S,10),S=_,_=O}var C=this._b+n+x|0;this._b=this._c+o+M|0,this._c=this._d+p+w|0,this._d=this._e+i+_|0,this._e=this._a+r+S|0,this._a=C},p.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=r.alloc?r.alloc(20):new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=p},89509:(t,e,i)=>{var r=i(58609),n=r.Buffer;function o(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return n(t,e,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),a.prototype=Object.create(n.prototype),o(n,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=n(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},2399:(t,e,i)=>{"use strict";var r,n=i(34155),o=i(58609),a=o.Buffer,s={};for(r in o)o.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(s[r]=o[r]);var c=s.Buffer={};for(r in a)a.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(c[r]=a[r]);if(s.Buffer.prototype=a.prototype,c.from&&c.from!==Uint8Array.from||(c.from=function(t,e,i){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return a(t,e,i)}),c.alloc||(c.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=a(t);return e&&0!==e.length?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r}),!s.kStringMaxLength)try{s.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s},67771:(t,e,i)=>{"use strict";var r=i(40210),n=i(12296),o=i(31044)(),a=i(27296),s=r("%TypeError%"),c=r("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new s("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],r=!0,u=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(r=!1),l&&!l.writable&&(u=!1)}return(r||u||!i)&&(o?n(t,"length",e,!0,!0):n(t,"length",e)),t}},24189:(t,e,i)=>{var r=i(89509).Buffer;function n(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var i=this._block,n=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,n=(i-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},89072:(t,e,i)=>{var r=t.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=i(74448),r.sha1=i(18336),r.sha224=i(48432),r.sha256=i(67499),r.sha384=i(51686),r.sha512=i(87816)},74448:(t,e,i)=>{var r=i(35717),n=i(24189),o=i(89509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function l(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}r(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)i[h]=t.readInt32BE(4*h);for(;h<80;++h)i[h]=i[h-3]^i[h-8]^i[h-14]^i[h-16];for(var f=0;f<80;++f){var p=~~(f/20),d=0|((e=r)<<5|e>>>27)+l(p,n,o,s)+c+i[f]+a[p];c=s,s=o,o=u(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},18336:(t,e,i)=>{var r=i(35717),n=i(24189),o=i(89509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function h(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}r(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)i[f]=t.readInt32BE(4*f);for(;f<80;++f)i[f]=(e=i[f-3]^i[f-8]^i[f-14]^i[f-16])<<1|e>>>31;for(var p=0;p<80;++p){var d=~~(p/20),m=u(r)+h(d,n,o,s)+c+i[p]+a[d]|0;c=s,s=o,o=l(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},48432:(t,e,i)=>{var r=i(35717),n=i(67499),o=i(24189),a=i(89509).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}r(c,n),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},67499:(t,e,i)=>{var r=i(35717),n=i(24189),o=i(89509).Buffer,a=[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],s=new Array(64);function c(){this.init(),this._w=s,n.call(this,64,56)}function u(t,e,i){return i^t&(e^i)}function l(t,e,i){return t&e|i&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function f(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function p(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(c,n),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,d=0|this._f,m=0|this._g,y=0|this._h,v=0;v<16;++v)i[v]=t.readInt32BE(4*v);for(;v<64;++v)i[v]=0|(((e=i[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+i[v-7]+p(i[v-15])+i[v-16];for(var g=0;g<64;++g){var b=y+f(c)+u(c,d,m)+a[g]+i[g]|0,w=h(r)+l(r,n,o)|0;y=m,m=d,d=c,c=s+b|0,s=o,o=n,n=r,r=b+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},c.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},51686:(t,e,i)=>{var r=i(35717),n=i(87816),o=i(24189),a=i(89509).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}r(c,n),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},87816:(t,e,i)=>{var r=i(35717),n=i(24189),o=i(89509).Buffer,a=[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],s=new Array(160);function c(){this.init(),this._w=s,n.call(this,128,112)}function u(t,e,i){return i^t&(e^i)}function l(t,e,i){return t&e|i&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function f(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0>>0?1:0}r(c,n),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,i=0|this._ah,r=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,g=0|this._gh,b=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,x=0|this._dl,M=0|this._el,E=0|this._fl,k=0|this._gl,O=0|this._hl,C=0;C<32;C+=2)e[C]=t.readInt32BE(4*C),e[C+1]=t.readInt32BE(4*C+4);for(;C<160;C+=2){var A=e[C-30],P=e[C-30+1],j=p(A,P),T=d(P,A),R=m(A=e[C-4],P=e[C-4+1]),I=y(P,A),N=e[C-14],D=e[C-14+1],L=e[C-32],B=e[C-32+1],F=T+D|0,U=j+N+v(F,T)|0;U=(U=U+R+v(F=F+I|0,I)|0)+L+v(F=F+B|0,B)|0,e[C]=U,e[C+1]=F}for(var z=0;z<160;z+=2){U=e[z],F=e[z+1];var q=l(i,r,n),K=l(w,_,S),H=h(i,w),W=h(w,i),G=f(s,M),V=f(M,s),Z=a[z],$=a[z+1],J=u(s,c,g),X=u(M,E,k),Y=O+V|0,Q=b+G+v(Y,O)|0;Q=(Q=(Q=Q+J+v(Y=Y+X|0,X)|0)+Z+v(Y=Y+$|0,$)|0)+U+v(Y=Y+F|0,F)|0;var tt=W+K|0,et=H+q+v(tt,W)|0;b=g,O=k,g=c,k=E,c=s,E=M,s=o+Q+v(M=x+Y|0,x)|0,o=n,x=S,n=r,S=_,r=i,_=w,i=Q+et+v(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+x|0,this._el=this._el+M|0,this._fl=this._fl+E|0,this._gl=this._gl+k|0,this._hl=this._hl+O|0,this._ah=this._ah+i+v(this._al,w)|0,this._bh=this._bh+r+v(this._bl,_)|0,this._ch=this._ch+n+v(this._cl,S)|0,this._dh=this._dh+o+v(this._dl,x)|0,this._eh=this._eh+s+v(this._el,M)|0,this._fh=this._fh+c+v(this._fl,E)|0,this._gh=this._gh+g+v(this._gl,k)|0,this._hh=this._hh+b+v(this._hl,O)|0},c.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},35682:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SHAKE=e.SHA3Hash=e.SHA3=e.Keccak=void 0;var r,n=i(58609),o=(r=i(29274))&&r.__esModule?r:{default:r};var a=function(t){var e=t.allowedSizes,i=t.defaultSize,r=t.padding;return function t(){var a=this,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;if(!this||this.constructor!==t)return new t(s);if(e&&!e.includes(s))throw new Error("Unsupported hash length");var c=new o.default({capacity:s});return this.update=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(n.Buffer.isBuffer(t))return c.absorb(t),a;if("string"==typeof t)return a.update(n.Buffer.from(t,e));throw new TypeError("Not a string or buffer")},this.digest=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",e="string"==typeof t?{format:t}:t,i=c.squeeze({buffer:e.buffer,padding:e.padding||r});return e.format&&"binary"!==e.format?i.toString(e.format):i},this.reset=function(){return c.reset(),a},this}},s=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});e.Keccak=s;var c=a({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});e.SHA3=c;var u=a({allowedSizes:[128,256],defaultSize:256,padding:31});e.SHAKE=u;var l=s;e.SHA3Hash=l,c.SHA3Hash=l;var h=c;e.default=h},29274:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=i(58609),o=(r=i(99618))&&r.__esModule?r:{default:r};var a=function(t,e){for(var i=0;i>>8,e[i+2]=t[r+1]>>>16,e[i+3]=t[r+1]>>>24,e[i+4]=t[r],e[i+5]=t[r]>>>8,e[i+6]=t[r]>>>16,e[i+7]=t[r]>>>24}return e},c=function(t){var e=this,i=t.capacity,r=t.padding,c=(0,o.default)(),u=i/8,l=200-i/4,h=0,f=new Uint32Array(50),p=n.Buffer.allocUnsafe(l);return this.absorb=function(t){for(var i=0;i=l&&(a(p,f),c(f),h=0);return e},this.squeeze=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={buffer:t.buffer||n.Buffer.allocUnsafe(u),padding:t.padding||r,queue:n.Buffer.allocUnsafe(p.length),state:new Uint32Array(f.length)};p.copy(e.queue);for(var i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=i(76605))&&r.__esModule?r:{default:r};var o=function(t){for(var e=t.A,i=t.C,r=0;r<25;r+=5){for(var o=0;o<5;o++)(0,n.default)(e,r+o)(i,o);for(var a=0;a<5;a++){var s=2*(r+a),c=(a+1)%5*2,u=(a+2)%5*2;e[s]^=~i[c]&i[u],e[s+1]^=~i[c+1]&i[u+1]}}};e.default=o},76605:t=>{"use strict";t.exports=function(t,e){return function(i,r){var n=2*r,o=2*e;i[n]=t[o],i[n+1]=t[o+1]}}},99618:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(i(61298)),n=s(i(96533)),o=s(i(59420)),a=s(i(57959));function s(t){return t&&t.__esModule?t:{default:t}}var c=function(){var t=new Uint32Array(10),e=new Uint32Array(10),i=new Uint32Array(2);return function(s){for(var c=0;c<24;c++)(0,a.default)({A:s,C:t,D:e,W:i}),(0,o.default)({A:s,C:t,W:i}),(0,r.default)({A:s,C:t}),(0,n.default)({A:s,roundIndex:c});t.fill(0),e.fill(0),i.fill(0)}};e.default=c},96533:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=i(11306))&&r.__esModule?r:{default:r};var o=function(t){var e=t.A,i=2*t.roundIndex;e[0]^=n.default[i],e[1]^=n.default[i+1]};e.default=o},11306:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);e.default=i},59420:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(i(76325)),n=a(i(23010)),o=a(i(76605));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){var e=t.A,i=t.C,a=t.W;(0,o.default)(e,1)(a,0);for(var s=0,c=0,u=0,l=32,h=0;h<24;h++){var f=r.default[h],p=n.default[h];(0,o.default)(e,f)(i,0),s=a[0],c=a[1],l=32-p,a[u=p<32?0:1]=s<>>l,a[(u+1)%2]=c<>>l,(0,o.default)(a,0)(e,f),(0,o.default)(i,0)(a,0)}};e.default=s},76325:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1];e.default=i},23010:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44];e.default=i},57959:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=i(76605))&&r.__esModule?r:{default:r};var o=function(t){for(var e=t.A,i=t.C,r=t.D,o=t.W,a=0,s=0,c=0;c<5;c++){var u=2*c,l=2*(c+5),h=2*(c+10),f=2*(c+15),p=2*(c+20);i[u]=e[u]^e[l]^e[h]^e[f]^e[p],i[u+1]=e[u+1]^e[l+1]^e[h+1]^e[f+1]^e[p+1]}for(var d=0;d<5;d++){(0,n.default)(i,(d+1)%5)(o,0),a=o[0],s=o[1],o[0]=a<<1|s>>>31,o[1]=s<<1|a>>>31,r[2*d]=i[(d+4)%5*2]^o[0],r[2*d+1]=i[(d+4)%5*2+1]^o[1];for(var m=0;m<25;m+=5)e[2*(m+d)]^=r[2*d],e[2*(m+d)+1]^=r[2*d+1]}};e.default=o},37478:(t,e,i)=>{"use strict";var r=i(40210),n=i(21924),o=i(70631),a=i(14453),s=r("%WeakMap%",!0),c=r("%Map%",!0),u=n("WeakMap.prototype.get",!0),l=n("WeakMap.prototype.set",!0),h=n("WeakMap.prototype.has",!0),f=n("Map.prototype.get",!0),p=n("Map.prototype.set",!0),d=n("Map.prototype.has",!0),m=function(t,e){for(var i,r=t;null!==(i=r.next);r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i};t.exports=function(){var t,e,i,r={assert:function(t){if(!r.has(t))throw new a("Side channel does not contain "+o(t))},get:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(t)return u(t,r)}else if(c){if(e)return f(e,r)}else if(i)return function(t,e){var i=m(t,e);return i&&i.value}(i,r)},has:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(t)return h(t,r)}else if(c){if(e)return d(e,r)}else if(i)return function(t,e){return!!m(t,e)}(i,r);return!1},set:function(r,n){s&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new s),l(t,r,n)):c?(e||(e=new c),p(e,r,n)):(i||(i={key:{},next:null}),function(t,e,i){var r=m(t,e);r?r.value=i:t.next={key:e,next:t.next,value:i}}(i,r,n))}};return r}},29529:t=>{var e=1,i=65535,r=setInterval((function(){e=e+1&i}),250);r.unref&&r.unref(),t.exports=function(t){var r=4*(t||5),n=[0],o=1,a=e-1&i;return function(t){var s=e-a&i;for(s>r&&(s=r),a=e;s--;)o===r&&(o=0),n[o]=n[0===o?r-1:o-1],o++;t&&(n[o-1]+=t);var c=n[o-1],u=n.length{t.exports=n;var r=i(17187).EventEmitter;function n(){r.call(this)}i(35717)(n,r),n.Readable=i(79481),n.Writable=i(64229),n.Duplex=i(56753),n.Transform=i(74605),n.PassThrough=i(82725),n.finished=i(8610),n.pipeline=i(59946),n.Stream=n,n.prototype.pipe=function(t,e){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||e&&!1===e.end||(i.on("end",s),i.on("close",c));var a=!1;function s(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",s),i.removeListener("close",c),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",l),i.removeListener("close",l),t.removeListener("close",l)}return i.on("error",u),t.on("error",u),i.on("end",l),i.on("close",l),t.on("close",l),t.emit("pipe",i),t}},8501:(t,e,i)=>{var r=i(11989),n=i(55676),o=i(47529),a=i(50584),s=i(8575),c=e;c.request=function(t,e){t="string"==typeof t?s.parse(t):o(t);var n=-1===i.g.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||n,c=t.hostname||t.host,u=t.port,l=t.path||"/";c&&-1!==c.indexOf(":")&&(c="["+c+"]"),t.url=(c?a+"//"+c:"")+(u?":"+u:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var h=new r(t);return e&&h.on("response",e),h},c.get=function(t,e){var i=c.request(t,e);return i.end(),i},c.ClientRequest=r,c.IncomingMessage=n.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=a,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(t,e,i)=>{var r;function n(){if(void 0!==r)return r;if(i.g.XMLHttpRequest){r=new i.g.XMLHttpRequest;try{r.open("GET",i.g.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function o(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function a(t){return"function"==typeof t}e.fetch=a(i.g.fetch)&&a(i.g.ReadableStream),e.writableStream=a(i.g.WritableStream),e.abortController=a(i.g.AbortController),e.arraybuffer=e.fetch||o("arraybuffer"),e.msstream=!e.fetch&&o("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!n()&&a(n().overrideMimeType),r=null},11989:(t,e,i)=>{var r=i(99649),n=i(34155),o=i(8725),a=i(35717),s=i(55676),c=i(88473),u=s.IncomingMessage,l=s.readyStates;var h=t.exports=function(t){var e,i=this;c.Writable.call(i),i._opts=t,i._body=[],i._headers={},t.auth&&i.setHeader("Authorization","Basic "+r.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){i.setHeader(e,t.headers[e])}));var n=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)n=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}i._mode=function(t,e){return o.fetch&&e?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&t?"arraybuffer":"text"}(e,n),i._fetchTimer=null,i._socketTimeout=null,i._socketTimer=null,i.on("finish",(function(){i._onFinish()}))};a(h,c.Writable),h.prototype.setHeader=function(t,e){var i=t.toLowerCase();-1===f.indexOf(i)&&(this._headers[i]={name:t,value:e})},h.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},h.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},h.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var r=t._headers,a=null;"GET"!==e.method&&"HEAD"!==e.method&&(a=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var s=[];if(Object.keys(r).forEach((function(t){var e=r[t].name,i=r[t].value;Array.isArray(i)?i.forEach((function(t){s.push([e,t])})):s.push([e,i])})),"fetch"===t._mode){var c=null;if(o.abortController){var u=new AbortController;c=u.signal,t._fetchAbortController=u,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=i.g.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}i.g.fetch(t._opts.url,{method:t._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:c}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var h=t._xhr=new i.g.XMLHttpRequest;try{h.open(t._opts.method,t._opts.url,!0)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}"responseType"in h&&(h.responseType=t._mode),"withCredentials"in h&&(h.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in h&&h.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(h.timeout=e.requestTimeout,h.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){h.setRequestHeader(t[0],t[1])})),t._response=null,h.onreadystatechange=function(){switch(h.readyState){case l.LOADING:case l.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(h.onprogress=function(){t._onXHRProgress()}),h.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{h.send(a)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}}}},h.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},h.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},h.prototype._write=function(t,e,i){this._body.push(t),i()},h.prototype._resetTimers=function(t){var e=this;i.g.clearTimeout(e._socketTimer),e._socketTimer=null,t?(i.g.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=i.g.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},h.prototype.abort=h.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},h.prototype.end=function(t,e,i){"function"==typeof t&&(i=t,t=void 0),c.Writable.prototype.end.call(this,t,e,i)},h.prototype.setTimeout=function(t,e){var i=this;e&&i.once("timeout",e),i._socketTimeout=t,i._resetTimers(!1)},h.prototype.flushHeaders=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},55676:(t,e,i)=>{var r=i(34155),n=i(99649),o=i(8725),a=i(35717),s=i(88473),c=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(t,e,i,a){var c=this;if(s.Readable.call(c),c._mode=i,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){r.nextTick((function(){c.emit("close")}))})),"fetch"===i){if(c._fetchResponse=e,c.url=e.url,c.statusCode=e.status,c.statusMessage=e.statusText,e.headers.forEach((function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)})),o.writableStream){var u=new WritableStream({write:function(t){return a(!1),new Promise((function(e,i){c._destroyed?i():c.push(n.from(t))?e():c._resumeFetch=e}))},close:function(){a(!0),c._destroyed||c.push(null)},abort:function(t){a(!0),c._destroyed||c.emit("error",t)}});try{return void e.body.pipeTo(u).catch((function(t){a(!0),c._destroyed||c.emit("error",t)}))}catch(t){}}var l=e.body.getReader();!function t(){l.read().then((function(e){c._destroyed||(a(e.done),e.done?c.push(null):(c.push(n.from(e.value)),t()))})).catch((function(t){a(!0),c._destroyed||c.emit("error",t)}))}()}else{if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var i=e[1].toLowerCase();"set-cookie"===i?(void 0===c.headers[i]&&(c.headers[i]=[]),c.headers[i].push(e[2])):void 0!==c.headers[i]?c.headers[i]+=", "+e[2]:c.headers[i]=e[2],c.rawHeaders.push(e[1],e[2])}})),c._charset="x-user-defined",!o.overrideMimeType){var h=c.rawHeaders["mime-type"];if(h){var f=h.match(/;\s*charset=([^;])(;|$)/);f&&(c._charset=f[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};a(u,s.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,o=null;switch(e._mode){case"text":if((o=r.responseText).length>e._pos){var a=o.substr(e._pos);if("x-user-defined"===e._charset){for(var s=n.alloc(a.length),u=0;ue._pos&&(e.push(n.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(o)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},32553:(t,e,i)=>{"use strict";var r=i(89509).Buffer,n=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=h,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function l(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return n>0&&(t.lastNeed=n-1),n;if(--r=0)return n>0&&(t.lastNeed=n-2),n;if(--r=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},45867:(t,e,i)=>{"use strict";var r=i(88212),n=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=h;var o=Object.create(i(16497));o.inherits=i(35717);var a=i(44278),s=i(10759);o.inherits(h,a);for(var c=n(s.prototype),u=0;u{"use strict";t.exports=o;var r=i(60062),n=Object.create(i(16497));function o(t){if(!(this instanceof o))return new o(t);r.call(this,t)}n.inherits=i(35717),n.inherits(o,r),o.prototype._transform=function(t,e,i){i(null,t)}},44278:(t,e,i)=>{"use strict";var r=i(34155),n=i(88212);t.exports=b;var o,a=i(5826);b.ReadableState=g;i(17187).EventEmitter;var s=function(t,e){return t.listeners(e).length},c=i(84104),u=i(64591).Buffer,l=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h=Object.create(i(16497));h.inherits=i(35717);var f=i(66882),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var d,m=i(93912),y=i(55513);h.inherits(b,c);var v=["error","close","destroy","pause","resume"];function g(t,e){t=t||{};var r=e instanceof(o=o||i(45867));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=i(47989).s),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function b(t){if(o=o||i(45867),!(this instanceof b))return new b(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function w(t,e,i,r,n){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,M(t)}(t,a)):(n||(o=function(t,e){var i;r=e,u.isBuffer(r)||r instanceof l||"string"==typeof e||void 0===e||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk"));var r;return i}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),r?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?_(t,a,e,!1):k(t,a)):_(t,a,e,!1))):r||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(E,t):E(t))}function E(t){p("emit readable"),t.emit("readable"),P(t)}function k(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(O,t,e))}function O(t,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function(t,e,i){var r;to.length?o.length:t;if(a===o.length?n+=o:n+=o.slice(0,t),0===(t-=a)){a===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(a));break}++r}return e.length-=r,n}(t,e):function(t,e){var i=u.allocUnsafe(t),r=e.head,n=1;r.data.copy(i),t-=r.data.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e);return r}(t,e.buffer,e.decoder),i);var i}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var i=0,r=t.length;i=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):M(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&T(this),null;var r,n=e.needReadable;return p("need readable",n),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&T(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(t,e){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var c=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:b;function u(e,r){p("onunpipe"),e===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",h),t.removeListener("error",y),t.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",b),i.removeListener("data",m),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){p("onend"),t.end()}o.endEmitted?n.nextTick(c):i.once("end",c),t.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,P(t))}}(i);t.on("drain",h);var f=!1;var d=!1;function m(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==I(o.pipes,t))&&!f&&(p("false write response, pause",o.awaitDrain),o.awaitDrain++,d=!0),i.pause())}function y(e){p("onerror",e),b(),t.removeListener("error",y),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),b()}function g(){p("onfinish"),t.removeListener("close",v),b()}function b(){p("unpipe"),i.unpipe(t)}return i.on("data",m),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",y),t.once("close",v),t.once("finish",g),t.emit("pipe",i),o.flowing||(p("pipe resume"),i.resume()),t},b.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o{"use strict";t.exports=a;var r=i(45867),n=Object.create(i(16497));function o(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";var r=i(34155),n=i(88212);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;t.entry=null;for(;r;){var n=r.callback;e.pendingcb--,n(i),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=v;var a,s=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:n.nextTick;v.WritableState=y;var c=Object.create(i(16497));c.inherits=i(35717);var u={deprecate:i(94927)},l=i(84104),h=i(64591).Buffer,f=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,d=i(55513);function m(){}function y(t,e){a=a||i(45867),t=t||{};var r=e instanceof a;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var c=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:r&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,o=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,o){--e.pendingcb,i?(n.nextTick(o,r),n.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(o(r),t._writableState.errorEmitted=!0,t.emit("error",r),x(t,e))}(t,i,r,e,o);else{var a=_(i);a||i.corked||i.bufferProcessing||!i.bufferedRequest||w(t,i),r?s(b,t,i,a,o):b(t,i,a,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function v(t){if(a=a||i(45867),!(p.call(v,this)||this instanceof a))return new v(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function g(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function b(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),a=e.corkedRequestsFree;a.entry=i;for(var s=0,c=!0;i;)n[s]=i,i.isBuf||(c=!1),i=i.next,s+=1;n.allBuffers=c,g(t,e,!0,e.length,n,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;i;){var u=i.chunk,l=i.encoding,h=i.callback;if(g(t,e,!1,e.objectMode?1:u.length,u,l,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(i){e.pendingcb--,i&&t.emit("error",i),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var i=_(e);return i&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,n.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}c.inherits(v,l),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,i){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=t,h.isBuffer(r)||r instanceof f);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(i=e,e=null),s?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof i&&(i=m),o.ended?function(t,e){var i=new Error("write after end");t.emit("error",i),n.nextTick(e,i)}(this,i):(s||function(t,e,i,r){var o=!0,a=!1;return null===i?a=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),n.nextTick(r,a),o=!1),o}(this,o,t,i))&&(o.pendingcb++,a=function(t,e,i,r,n,o){if(!i){var a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,i));return e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var s=e.objectMode?1:r.length;e.length+=s;var c=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,i){i(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,i){var r=this._writableState;"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,i){e.ending=!0,x(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i));e.ended=!0,t.writable=!1}(this,r,i)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=d.destroy,v.prototype._undestroy=d.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}},93912:(t,e,i)=>{"use strict";var r=i(64591).Buffer,n=i(50522);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);for(var e,i,n,o=r.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,i=o,n=s,e.copy(i,n),s+=a.data.length,a=a.next;return o},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},55513:(t,e,i)=>{"use strict";var r=i(88212);function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var i=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(n,this,t)):r.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,r.nextTick(n,i,t)):r.nextTick(n,i,t):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},84104:(t,e,i)=>{t.exports=i(17187).EventEmitter},96801:(t,e,i)=>{(e=t.exports=i(44278)).Stream=e,e.Readable=e,e.Writable=i(10759),e.Duplex=i(45867),e.Transform=i(60062),e.PassThrough=i(3431)},64591:(t,e,i)=>{var r=i(58609),n=r.Buffer;function o(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return n(t,e,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),o(n,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=n(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},47989:(t,e,i)=>{"use strict";var r=i(64591).Buffer,n=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=h,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function l(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return n>0&&(t.lastNeed=n-1),n;if(--r=0)return n>0&&(t.lastNeed=n-2),n;if(--r=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},14650:(t,e,i)=>{var r=i(34155),n=i(96801).Transform,o=i(89539).inherits,a=i(47529);function s(t){n.call(this,t),this._destroyed=!1}function c(t,e,i){i(null,t)}function u(t){return function(e,i,r){return"function"==typeof e&&(r=i,i=e,e={}),"function"!=typeof i&&(i=c),"function"!=typeof r&&(r=null),t(e,i,r)}}o(s,n),s.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var e=this;r.nextTick((function(){t&&e.emit("error",t),e.emit("close")}))}},t.exports=u((function(t,e,i){var r=new s(t);return r._transform=e,i&&(r._flush=i),r})),t.exports.ctor=u((function(t,e,i){function r(e){if(!(this instanceof r))return new r(e);this.options=a(t,e),s.call(this,this.options)}return o(r,s),r.prototype._transform=e,i&&(r.prototype._flush=i),r})),t.exports.obj=u((function(t,e,i){var r=new s(a({objectMode:!0,highWaterMark:16},t));return r._transform=e,i&&(r._flush=i),r}))},31293:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.APIClient=e.APIClientDefaults=void 0;const o=n(i(97218)),a=i(78593),s=i(95601),c=i(89539),u=i(42830),l=n(i(55674)),h=i(24240),f=i(85612),p=i(63643),d=n(i(79267)),m=n(i(8575)),y=n(i(65472)),v=n(i(4147)),g=(0,c.promisify)(u.pipeline);e.APIClientDefaults={gatewayURLs:["https://gateway.filen.io","https://gateway.filen.net","https://gateway.filen-1.net","https://gateway.filen-2.net","https://gateway.filen-3.net","https://gateway.filen-4.net","https://gateway.filen-5.net","https://gateway.filen-6.net"],egestURLs:["https://egest.filen.io","https://egest.filen.net","https://egest.filen-1.net","https://egest.filen-2.net","https://egest.filen-3.net","https://egest.filen-4.net","https://egest.filen-5.net","https://egest.filen-6.net"],ingestURLs:["https://ingest.filen.io","https://ingest.filen.net","https://ingest.filen-1.net","https://ingest.filen-2.net","https://ingest.filen-3.net","https://ingest.filen-4.net","https://ingest.filen-5.net","https://ingest.filen-6.net"],gatewayTimeout:3e5,egestTimeout:18e5,ingestTimeout:36e5,maxRetries:32,retryTimeout:1e3};class b{constructor(t){this.config={apiKey:""},this._semaphores={request:new p.Semaphore(512)},this.config=t}buildHeaders(t){return Object.assign({Authorization:"Bearer "+(t&&t.apiKey?t.apiKey:this.config.apiKey),Accept:"application/json, text/plain, */*"},"node"===s.environment?{"User-Agent":`filen-sdk/${v.default.version}`}:{})}async post(t){let i=t.headers?t.headers:this.buildHeaders({apiKey:t.apiKey});t.apiKey&&!i.Authorization&&(i.Authorization=`Bearer ${t.apiKey}`);const n=t.url?t.url:e.APIClientDefaults.gatewayURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.gatewayURLs.length-1)],c=t.data instanceof r||t.data instanceof Uint8Array||t.data instanceof ArrayBuffer;t.headers||c||(i=Object.assign(Object.assign({},i),{Checksum:await(0,f.bufferToHash)({buffer:r.from(JSON.stringify(t.data),"utf-8"),algorithm:"sha512"})}));let l=0;return"node"===s.environment?new Promise(((o,a)=>{const s=m.default.parse(n,!0),h=t.timeout?t.timeout:e.APIClientDefaults.gatewayTimeout,f=d.default.request({method:"POST",hostname:s.hostname,path:t.endpoint,port:443,timeout:h,headers:Object.assign(Object.assign({},i),c?{}:{"Content-Type":"application/json"})},(e=>{var n;if(200===e.statusCode){if("stream"===t.responseType)o({status:200,statusText:"",data:e,headers:i,config:null});else{const n=[];e.on("data",(t=>{e&&t instanceof r&&n.push(t)})),e.on("end",(()=>{try{o({status:200,statusText:"",data:t.responseType?"json"===t.responseType?JSON.parse(r.concat(n).toString("utf-8")):r.concat(n):JSON.parse(r.concat(n).toString("utf-8")),headers:i,config:null})}catch(t){a(t)}}))}e.on("error",a)}else o({status:null!==(n=e.statusCode)&&void 0!==n?n:500,statusText:"",data:null,headers:i,config:null})}));if(f.on("error",a),f.on("timeout",(()=>a(new Error(`Request timed out after ${h}ms`)))),c){const e=t.data,i=(0,y.default)({length:e.byteLength,time:100});i.on("progress",(e=>{if(!t.onUploadProgress||!e||"number"!=typeof e.transferred)return;let i=e.transferred;0===l||(i=Math.floor(e.transferred-l)),l=e.transferred,t.onUploadProgress(i)})),u.Readable.from([e]).pipe(i).pipe(f)}else f.write(JSON.stringify(t.data)),f.end()})):await o.default.post(n+t.endpoint,t.data,{headers:i,signal:t.abortSignal,timeout:t.timeout?t.timeout:e.APIClientDefaults.gatewayTimeout,responseType:t.responseType?t.responseType:"json",maxRedirects:0,onUploadProgress:e=>{if(!t.onUploadProgress||!e||"number"!=typeof e.loaded)return;let i=e.loaded;0===l||(i=Math.floor(e.loaded-l)),l=e.loaded,t.onUploadProgress(i)}})}async get(t){const i=t.headers?t.headers:this.buildHeaders({apiKey:t.apiKey});t.apiKey&&!i.Authorization&&(i.Authorization=`Bearer ${t.apiKey}`);const n=t.url?t.url:e.APIClientDefaults.gatewayURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.gatewayURLs.length-1)];(n.includes("egest.")||n.includes("down."))&&delete i.Authorization;let c=0;return"node"===s.environment?new Promise(((o,a)=>{const s=m.default.parse(n,!0),l=t.timeout?t.timeout:e.APIClientDefaults.gatewayTimeout,h=new u.Transform({transform(e,i,n){t.onDownloadProgress&&e instanceof r&&t.onDownloadProgress(e.byteLength),this.push(e),n()}}),f=d.default.request({method:"GET",hostname:s.hostname,path:t.endpoint,port:443,timeout:l,headers:i},(e=>{var n;if(200===e.statusCode){if("stream"===t.responseType)o({status:200,statusText:"",data:e.pipe(h),headers:i,config:null});else{const n=[];e.on("data",(i=>{e&&i instanceof r&&(n.push(i),(e=>{if(!t.onDownloadProgress)return;let i=e;0===c||(i=Math.floor(e-c)),c=e,t.onDownloadProgress(i)})(i.byteLength))})),e.on("end",(()=>{try{o({status:200,statusText:"",data:t.responseType?"json"===t.responseType?JSON.parse(r.concat(n).toString("utf-8")):r.concat(n):JSON.parse(r.concat(n).toString("utf-8")),headers:i,config:null})}catch(t){a(t)}}))}e.on("error",a)}else o({status:null!==(n=e.statusCode)&&void 0!==n?n:500,statusText:"",data:null,headers:i,config:null})}));f.on("error",a),f.on("timeout",(()=>a(new Error(`Request timed out after ${l}ms`)))),f.end()})):await o.default.get(n+t.endpoint,{headers:i,signal:t.abortSignal,timeout:t.timeout?t.timeout:e.APIClientDefaults.gatewayTimeout,responseType:t.responseType?t.responseType:"json",maxRedirects:0,onDownloadProgress:e=>{if(!t.onDownloadProgress||!e||"number"!=typeof e.loaded)return;let i=e.loaded;0===c||(i=Math.floor(e.loaded-c)),c=e.loaded,t.onDownloadProgress(i)}})}async request(t){const i=t.maxRetries?t.maxRetries:e.APIClientDefaults.maxRetries,r=t.retryTimeout?t.retryTimeout:e.APIClientDefaults.retryTimeout;let n,o=0,s=!1;const c=async()=>{if(o>=i){if(n)throw n;throw new h.APIError({code:"request_failed_after_max_tries",message:`Request failed after ${i} tries`})}o+=1;try{const e="GET"===t.method?await this.get(t):await this.post(t);if(!e||200!==e.status)throw new h.APIError({code:"invalid_http_status_code",message:`Invalid HTTP status code: ${e.status}`});if("object"==typeof e.data&&"boolean"==typeof e.data.status&&!e.data.status)throw s=!0,new h.APIError({code:e.data.code,message:e.data.message});return e.data.data?e.data.data:e.data}catch(t){if(s)throw t;return n=t,await(0,a.sleep)(r),await c()}};await this._semaphores.request.acquire();try{return await c()}finally{this._semaphores.request.release()}}async downloadChunkToLocal({uuid:t,bucket:i,region:r,chunk:n,to:o,timeout:c,abortSignal:u,maxRetries:h,retryTimeout:f,onProgress:p}){if("node"!==s.environment)throw new Error("cloud.downloadChunkToLocal is only available in a Node.JS environment");o=(0,a.normalizePath)(o);const d=await this.request({method:"GET",url:`${e.APIClientDefaults.egestURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.egestURLs.length-1)]}`,endpoint:`/${r}/${i}/${t}/${n}`,abortSignal:u,timeout:c||e.APIClientDefaults.egestTimeout,responseType:"stream",maxRetries:h,retryTimeout:f,onDownloadProgress:p});await g(d,l.default.createWriteStream(o))}async downloadChunkToStream({uuid:t,bucket:i,region:r,chunk:n,timeout:o,abortSignal:s,maxRetries:c,retryTimeout:u,onProgress:l}){return await this.request({method:"GET",url:`${e.APIClientDefaults.egestURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.egestURLs.length-1)]}`,endpoint:`/${r}/${i}/${t}/${n}`,abortSignal:s,timeout:o||e.APIClientDefaults.egestTimeout,responseType:"stream",maxRetries:c,retryTimeout:u,onDownloadProgress:l})}async downloadChunkToBuffer({uuid:t,bucket:i,region:n,chunk:o,timeout:s,abortSignal:c,maxRetries:u,retryTimeout:l,onProgress:h}){const f=await this.request({method:"GET",url:`${e.APIClientDefaults.egestURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.egestURLs.length-1)]}`,endpoint:`/${n}/${i}/${t}/${o}`,abortSignal:c,timeout:s||e.APIClientDefaults.egestTimeout,responseType:"arraybuffer",maxRetries:u,retryTimeout:l,onDownloadProgress:h});return r.from(f)}async uploadChunkBuffer({uuid:t,index:i,parent:n,uploadKey:o,buffer:s,abortSignal:c,maxRetries:u,timeout:l,retryTimeout:h,onProgress:p}){const d=new URLSearchParams({uuid:t,index:i,parent:n,uploadKey:o}).toString(),m=await(0,f.bufferToHash)({buffer:s,algorithm:"sha512"}),y=`${e.APIClientDefaults.ingestURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.ingestURLs.length-1)]}/v3/upload?${d}&hash=${m}`,v=(0,a.parseURLParams)({url:y}),g=await(0,f.bufferToHash)({buffer:r.from(JSON.stringify(v),"utf-8"),algorithm:"sha512"}),b=this.buildHeaders({apiKey:void 0});return await this.request({method:"POST",url:`${e.APIClientDefaults.ingestURLs[(0,a.getRandomArbitrary)(0,e.APIClientDefaults.ingestURLs.length-1)]}`,endpoint:`/v3/upload?${d}&hash=${m}`,data:s,abortSignal:c,maxRetries:u,timeout:l||e.APIClientDefaults.ingestTimeout,retryTimeout:h,headers:Object.assign(Object.assign({},b),{Checksum:g}),onUploadProgress:p})}}e.APIClient=b,e.default=b},24240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.APIError=void 0;class i extends Error{constructor({code:t,message:e}){super(e),this.name="APIError",this.code=t,this.message=e,Error.captureStackTrace&&Error.captureStackTrace(this,i)}}e.APIError=i},70395:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0;const n=r(i(31293)),o=r(i(80639)),a=r(i(78057)),s=r(i(24599)),c=r(i(8720)),u=r(i(27357)),l=r(i(43211)),h=r(i(10721)),f=r(i(61402)),p=r(i(78234)),d=r(i(88854)),m=r(i(60659)),y=r(i(81566)),v=r(i(26666)),g=r(i(92926)),b=r(i(33594)),w=r(i(81190)),_=r(i(96323)),S=r(i(3213)),x=r(i(25768)),M=r(i(63564)),E=r(i(89057)),k=r(i(28191)),O=r(i(57743)),C=r(i(58398)),A=r(i(59649)),P=r(i(9223)),j=r(i(69337)),T=r(i(13061)),R=r(i(40440)),I=r(i(75642)),N=r(i(17644)),D=r(i(42195)),L=r(i(15467)),B=r(i(4665)),F=r(i(52042)),U=r(i(59587)),z=r(i(15618)),q=r(i(61840)),K=r(i(69140)),H=r(i(70519)),W=r(i(88411)),G=r(i(71995)),V=r(i(9218)),Z=r(i(40288)),$=r(i(54842)),J=r(i(46115)),X=r(i(58460)),Y=r(i(97620)),Q=r(i(71523)),tt=r(i(17370)),et=r(i(79627)),it=r(i(54442)),rt=r(i(6926)),nt=r(i(13937)),ot=r(i(44245)),at=r(i(97977)),st=r(i(73079)),ct=r(i(68940)),ut=r(i(50884)),lt=r(i(55708)),ht=r(i(43543)),ft=r(i(52144)),pt=r(i(936)),dt=r(i(57779)),mt=r(i(96471)),yt=r(i(67444)),vt=r(i(43329)),gt=r(i(49135)),bt=r(i(57328)),wt=r(i(13739)),_t=r(i(641)),St=r(i(78072)),xt=r(i(95865)),Mt=r(i(79618)),Et=r(i(26409)),kt=r(i(32796)),Ot=r(i(83462)),Ct=r(i(72181)),At=r(i(44520)),Pt=r(i(27991)),jt=r(i(99664)),Tt=r(i(31498)),Rt=r(i(16037)),It=r(i(15425)),Nt=r(i(31805)),Dt=r(i(28066)),Lt=r(i(95820)),Bt=r(i(48618)),Ft=r(i(79341)),Ut=r(i(93860)),zt=r(i(12675)),qt=r(i(60121)),Kt=r(i(88820)),Ht=r(i(5264)),Wt=r(i(35265)),Gt=r(i(29247)),Vt=r(i(72495)),Zt=r(i(4205)),$t=r(i(19729)),Jt=r(i(64497)),Xt=r(i(69368)),Yt=r(i(33181)),Qt=r(i(76298)),te=r(i(98933)),ee=r(i(12659)),ie=r(i(9592)),re=r(i(93226)),ne=r(i(78017)),oe=r(i(21587)),ae=r(i(38805)),se=r(i(16818)),ce=r(i(38266)),ue=r(i(88675)),le=r(i(57887)),he=r(i(12674)),fe=r(i(43390)),pe=r(i(49616)),de=r(i(61605)),me=r(i(30323)),ye=r(i(97636)),ve=r(i(67569)),ge=r(i(72859)),be=r(i(92589)),we=r(i(4119)),_e=r(i(2e4)),Se=r(i(82046)),xe=r(i(47899)),Me=r(i(13292)),Ee=r(i(24527)),ke=r(i(1850)),Oe=r(i(10024)),Ce=r(i(25818)),Ae=r(i(46017)),Pe=r(i(79464)),je=r(i(40943)),Te=r(i(6037)),Re=r(i(66714)),Ie=r(i(40838));class Ne{constructor(t){if(this.config=t,0===this.config.apiKey.length)throw new Error("Invalid apiKey");this.apiClient=new n.default({apiKey:this.config.apiKey}),this.crypto=t.crypto,this._v3={health:new o.default({apiClient:this.apiClient}),dir:{content:new a.default({apiClient:this.apiClient}),download:new d.default({apiClient:this.apiClient}),shared:new m.default({apiClient:this.apiClient}),linked:new y.default({apiClient:this.apiClient}),link:{add:new v.default({apiClient:this.apiClient}),status:new W.default({apiClient:this.apiClient}),remove:new Z.default({apiClient:this.apiClient}),edit:new $.default({apiClient:this.apiClient}),info:new dt.default({apiClient:this.apiClient}),content:new mt.default({apiClient:this.apiClient})},exists:new x.default({apiClient:this.apiClient}),create:new E.default({apiClient:this.apiClient}),present:new k.default({apiClient:this.apiClient}),trash:new O.default({apiClient:this.apiClient}),move:new P.default({apiClient:this.apiClient}),rename:new T.default({apiClient:this.apiClient}),size:new R.default({apiClient:this.apiClient}),sizeLink:new I.default({apiClient:this.apiClient}),delete:{permanent:new B.default({apiClient:this.apiClient})},restore:new U.default({apiClient:this.apiClient}),color:new X.default({apiClient:this.apiClient})},auth:{info:new s.default({apiClient:this.apiClient})},login:new c.default({apiClient:this.apiClient}),user:{info:new u.default({apiClient:this.apiClient}),baseFolder:new l.default({apiClient:this.apiClient}),publicKey:new q.default({apiClient:this.apiClient}),settings:new Y.default({apiClient:this.apiClient}),account:new Q.default({apiClient:this.apiClient}),gdpr:new tt.default({apiClient:this.apiClient}),avatar:new et.default({apiClient:this.apiClient}),settingsEmail:{change:new it.default({apiClient:this.apiClient})},personal:{update:new rt.default({apiClient:this.apiClient})},delete:new nt.default({apiClient:this.apiClient}),deleteVersions:new ot.default({apiClient:this.apiClient}),deleteAll:new at.default({apiClient:this.apiClient}),settingsPassword:{change:new st.default({apiClient:this.apiClient})},twoFactorAuthentication:{enable:new ct.default({apiClient:this.apiClient}),disable:new ut.default({apiClient:this.apiClient})},events:new lt.default({apiClient:this.apiClient}),event:new ht.default({apiClient:this.apiClient}),sub:{cancel:new yt.default({apiClient:this.apiClient}),create:new gt.default({apiClient:this.apiClient})},invoice:new vt.default({apiClient:this.apiClient}),affiliate:{payout:new bt.default({apiClient:this.apiClient})},versioning:new wt.default({apiClient:this.apiClient}),loginAlerts:new _t.default({apiClient:this.apiClient}),nickname:new ae.default({apiClient:this.apiClient}),appearOffline:new se.default({apiClient:this.apiClient}),profile:new Me.default({apiClient:this.apiClient}),lastActive:{desktop:new Ee.default({apiClient:this.apiClient})},keyPair:{update:new je.default({apiClient:this.apiClient}),set:new Te.default({apiClient:this.apiClient}),info:new Re.default({apiClient:this.apiClient})},masterKeys:new Ie.default({apiClient:this.apiClient})},shared:{in:new h.default({apiClient:this.apiClient}),out:new f.default({apiClient:this.apiClient})},upload:{done:new p.default({apiClient:this.apiClient})},item:{share:new g.default({apiClient:this.apiClient}),shared:new b.default({apiClient:this.apiClient}),linked:new w.default({apiClient:this.apiClient}),linkedRename:new _.default({apiClient:this.apiClient}),sharedRename:new S.default({apiClient:this.apiClient}),favorite:new N.default({apiClient:this.apiClient}),sharedOut:{remove:new K.default({apiClient:this.apiClient})},sharedIn:{remove:new H.default({apiClient:this.apiClient})}},file:{exists:new M.default({apiClient:this.apiClient}),trash:new C.default({apiClient:this.apiClient}),move:new A.default({apiClient:this.apiClient}),rename:new j.default({apiClient:this.apiClient}),delete:{permanent:new L.default({apiClient:this.apiClient})},restore:new F.default({apiClient:this.apiClient}),version:{restore:new z.default({apiClient:this.apiClient})},link:{status:new G.default({apiClient:this.apiClient}),edit:new V.default({apiClient:this.apiClient}),info:new ft.default({apiClient:this.apiClient}),password:new pt.default({apiClient:this.apiClient})},versions:new J.default({apiClient:this.apiClient}),download:{chunk:{buffer:new ke.default({apiClient:this.apiClient}),stream:new Oe.default({apiClient:this.apiClient}),local:new Ce.default({apiClient:this.apiClient})}},upload:{chunk:{buffer:new Ae.default({apiClient:this.apiClient})}}},trash:{empty:new D.default({apiClient:this.apiClient})},chat:{conversations:new St.default({apiClient:this.apiClient}),messages:new xt.default({apiClient:this.apiClient}),conversationsName:{edit:new Mt.default({apiClient:this.apiClient})},send:new Et.default({apiClient:this.apiClient}),edit:new kt.default({apiClient:this.apiClient}),conversationsCreate:new Ot.default({apiClient:this.apiClient}),conversationsParticipants:{add:new Ct.default({apiClient:this.apiClient}),remove:new be.default({apiClient:this.apiClient})},typing:new At.default({apiClient:this.apiClient}),conversationsRead:new Pt.default({apiClient:this.apiClient}),conversationsUnread:new jt.default({apiClient:this.apiClient}),unread:new Tt.default({apiClient:this.apiClient}),conversationsOnline:new Rt.default({apiClient:this.apiClient}),delete:new It.default({apiClient:this.apiClient}),message:{embed:{disable:new ge.default({apiClient:this.apiClient})}},conversationsLeave:new we.default({apiClient:this.apiClient}),conversationsDelete:new _e.default({apiClient:this.apiClient}),lastFocusUpdate:new Se.default({apiClient:this.apiClient}),lastFocus:new xe.default({apiClient:this.apiClient})},notes:{all:new Nt.default({apiClient:this.apiClient}),content:new Dt.default({apiClient:this.apiClient}),create:new Lt.default({apiClient:this.apiClient}),contentEdit:new Bt.default({apiClient:this.apiClient}),titleEdit:new Ft.default({apiClient:this.apiClient}),delete:new Ut.default({apiClient:this.apiClient}),trash:new zt.default({apiClient:this.apiClient}),archive:new qt.default({apiClient:this.apiClient}),restore:new Kt.default({apiClient:this.apiClient}),typeChange:new Ht.default({apiClient:this.apiClient}),pinned:new Wt.default({apiClient:this.apiClient}),favorite:new Gt.default({apiClient:this.apiClient}),history:new Vt.default({apiClient:this.apiClient}),historyRestore:new Zt.default({apiClient:this.apiClient}),participantsRemove:new $t.default({apiClient:this.apiClient}),participantsPermissions:new Jt.default({apiClient:this.apiClient}),participantsAdd:new Pe.default({apiClient:this.apiClient}),tags:new he.default({apiClient:this.apiClient}),tagsCreate:new fe.default({apiClient:this.apiClient}),tagsRename:new pe.default({apiClient:this.apiClient}),tagsDelete:new de.default({apiClient:this.apiClient}),tagsFavorite:new me.default({apiClient:this.apiClient}),tag:new ye.default({apiClient:this.apiClient}),untag:new ve.default({apiClient:this.apiClient})},contacts:{all:new Xt.default({apiClient:this.apiClient}),requestsIn:new Yt.default({apiClient:this.apiClient}),requestsInCount:new Qt.default({apiClient:this.apiClient}),requestsOut:new te.default({apiClient:this.apiClient}),requestsOutDelete:new ee.default({apiClient:this.apiClient}),requestsSend:new ie.default({apiClient:this.apiClient}),requestsAccept:new re.default({apiClient:this.apiClient}),requestsDeny:new ne.default({apiClient:this.apiClient}),delete:new oe.default({apiClient:this.apiClient}),blocked:new ce.default({apiClient:this.apiClient}),blockedAdd:new ue.default({apiClient:this.apiClient}),blockedDelete:new le.default({apiClient:this.apiClient})}}}v3(){return{health:()=>this._v3.health.fetch(),dir:()=>({content:(...t)=>this._v3.dir.content.fetch(...t),download:(...t)=>this._v3.dir.download.fetch(...t),shared:(...t)=>this._v3.dir.shared.fetch(...t),linked:(...t)=>this._v3.dir.linked.fetch(...t),link:()=>({add:(...t)=>this._v3.dir.link.add.fetch(...t),status:(...t)=>this._v3.dir.link.status.fetch(...t),remove:(...t)=>this._v3.dir.link.remove.fetch(...t),edit:(...t)=>this._v3.dir.link.edit.fetch(...t),info:(...t)=>this._v3.dir.link.info.fetch(...t),content:(...t)=>this._v3.dir.link.content.fetch(...t)}),exists:(...t)=>this._v3.dir.exists.fetch(...t),create:(...t)=>this._v3.dir.create.fetch(...t),present:(...t)=>this._v3.dir.present.fetch(...t),trash:(...t)=>this._v3.dir.trash.fetch(...t),move:(...t)=>this._v3.dir.move.fetch(...t),rename:(...t)=>this._v3.dir.rename.fetch(...t),size:(...t)=>this._v3.dir.size.fetch(...t),sizeLink:(...t)=>this._v3.dir.sizeLink.fetch(...t),delete:()=>({permanent:(...t)=>this._v3.dir.delete.permanent.fetch(...t)}),restore:(...t)=>this._v3.dir.restore.fetch(...t),color:(...t)=>this._v3.dir.color.fetch(...t)}),auth:()=>({info:(...t)=>this._v3.auth.info.fetch(...t)}),login:(...t)=>this._v3.login.fetch(...t),user:()=>({info:(...t)=>this._v3.user.info.fetch(...t),baseFolder:(...t)=>this._v3.user.baseFolder.fetch(...t),publicKey:(...t)=>this._v3.user.publicKey.fetch(...t),settings:(...t)=>this._v3.user.settings.fetch(...t),account:(...t)=>this._v3.user.account.fetch(...t),gdpr:(...t)=>this._v3.user.gdpr.fetch(...t),avatar:(...t)=>this._v3.user.avatar.fetch(...t),settingsEmail:()=>({change:(...t)=>this._v3.user.settingsEmail.change.fetch(...t)}),personal:()=>({change:(...t)=>this._v3.user.personal.update.fetch(...t)}),delete:(...t)=>this._v3.user.delete.fetch(...t),deleteVersions:(...t)=>this._v3.user.deleteVersions.fetch(...t),deleteAll:(...t)=>this._v3.user.deleteAll.fetch(...t),settingsPassword:()=>({change:(...t)=>this._v3.user.settingsPassword.change.fetch(...t)}),twoFactorAuthentication:()=>({enable:(...t)=>this._v3.user.twoFactorAuthentication.enable.fetch(...t),disable:(...t)=>this._v3.user.twoFactorAuthentication.disable.fetch(...t)}),events:(...t)=>this._v3.user.events.fetch(...t),event:(...t)=>this._v3.user.event.fetch(...t),sub:()=>({cancel:(...t)=>this._v3.user.sub.cancel.fetch(...t),create:(...t)=>this._v3.user.sub.create.fetch(...t)}),invoice:(...t)=>this._v3.user.invoice.fetch(...t),affiliate:()=>({payout:(...t)=>this._v3.user.affiliate.payout.fetch(...t)}),versioning:(...t)=>this._v3.user.versioning.fetch(...t),loginAlerts:(...t)=>this._v3.user.loginAlerts.fetch(...t),nickname:(...t)=>this._v3.user.nickname.fetch(...t),appearOffline:(...t)=>this._v3.user.appearOffline.fetch(...t),profile:(...t)=>this._v3.user.profile.fetch(...t),lastActive:()=>({desktop:(...t)=>this._v3.user.lastActive.desktop.fetch(...t)}),keyPair:()=>({update:(...t)=>this._v3.user.keyPair.update.fetch(...t),set:(...t)=>this._v3.user.keyPair.set.fetch(...t),info:(...t)=>this._v3.user.keyPair.info.fetch(...t)}),masterKeys:(...t)=>this._v3.user.masterKeys.fetch(...t)}),shared:()=>({in:(...t)=>this._v3.shared.in.fetch(...t),out:(...t)=>this._v3.shared.out.fetch(...t)}),upload:()=>({done:(...t)=>this._v3.upload.done.fetch(...t)}),item:()=>({share:(...t)=>this._v3.item.share.fetch(...t),shared:(...t)=>this._v3.item.shared.fetch(...t),linked:(...t)=>this._v3.item.linked.fetch(...t),linkedRename:(...t)=>this._v3.item.linkedRename.fetch(...t),sharedRename:(...t)=>this._v3.item.sharedRename.fetch(...t),favorite:(...t)=>this._v3.item.favorite.fetch(...t),sharedOut:()=>({remove:(...t)=>this._v3.item.sharedOut.remove.fetch(...t)}),sharedIn:()=>({remove:(...t)=>this._v3.item.sharedIn.remove.fetch(...t)})}),file:()=>({exists:(...t)=>this._v3.file.exists.fetch(...t),trash:(...t)=>this._v3.file.trash.fetch(...t),move:(...t)=>this._v3.file.move.fetch(...t),rename:(...t)=>this._v3.file.rename.fetch(...t),delete:()=>({permanent:(...t)=>this._v3.file.delete.permanent.fetch(...t)}),restore:(...t)=>this._v3.file.restore.fetch(...t),version:()=>({restore:(...t)=>this._v3.file.version.restore.fetch(...t)}),link:()=>({status:(...t)=>this._v3.file.link.status.fetch(...t),edit:(...t)=>this._v3.file.link.edit.fetch(...t),info:(...t)=>this._v3.file.link.info.fetch(...t),password:(...t)=>this._v3.file.link.password.fetch(...t)}),versions:(...t)=>this._v3.file.versions.fetch(...t),download:()=>({chunk:()=>({buffer:(...t)=>this._v3.file.download.chunk.buffer.fetch(...t),stream:(...t)=>this._v3.file.download.chunk.stream.fetch(...t),local:(...t)=>this._v3.file.download.chunk.local.fetch(...t)})}),upload:()=>({chunk:()=>({buffer:(...t)=>this._v3.file.upload.chunk.buffer.fetch(...t)})})}),trash:()=>({empty:(...t)=>this._v3.trash.empty.fetch(...t)}),chat:()=>({conversations:(...t)=>this._v3.chat.conversations.fetch(...t),messages:(...t)=>this._v3.chat.messages.fetch(...t),conversationsName:()=>({edit:(...t)=>this._v3.chat.conversationsName.edit.fetch(...t)}),send:(...t)=>this._v3.chat.send.fetch(...t),edit:(...t)=>this._v3.chat.edit.fetch(...t),conversationsCreate:(...t)=>this._v3.chat.conversationsCreate.fetch(...t),conversationsParticipants:()=>({add:(...t)=>this._v3.chat.conversationsParticipants.add.fetch(...t),remove:(...t)=>this._v3.chat.conversationsParticipants.remove.fetch(...t)}),typing:(...t)=>this._v3.chat.typing.fetch(...t),conversationsRead:(...t)=>this._v3.chat.conversationsRead.fetch(...t),conversationsUnread:(...t)=>this._v3.chat.conversationsUnread.fetch(...t),unread:(...t)=>this._v3.chat.unread.fetch(...t),conversationsOnline:(...t)=>this._v3.chat.conversationsOnline.fetch(...t),delete:(...t)=>this._v3.chat.delete.fetch(...t),message:()=>({embed:()=>({disable:(...t)=>this._v3.chat.message.embed.disable.fetch(...t)})}),conversationsLeave:(...t)=>this._v3.chat.conversationsLeave.fetch(...t),conversationsDelete:(...t)=>this._v3.chat.conversationsDelete.fetch(...t),lastFocusUpdate:(...t)=>this._v3.chat.lastFocusUpdate.fetch(...t),lastFocus:(...t)=>this._v3.chat.lastFocus.fetch(...t)}),notes:()=>({all:(...t)=>this._v3.notes.all.fetch(...t),content:(...t)=>this._v3.notes.content.fetch(...t),create:(...t)=>this._v3.notes.create.fetch(...t),contentEdit:(...t)=>this._v3.notes.contentEdit.fetch(...t),titleEdit:(...t)=>this._v3.notes.titleEdit.fetch(...t),delete:(...t)=>this._v3.notes.delete.fetch(...t),trash:(...t)=>this._v3.notes.trash.fetch(...t),archive:(...t)=>this._v3.notes.archive.fetch(...t),restore:(...t)=>this._v3.notes.restore.fetch(...t),typeChange:(...t)=>this._v3.notes.typeChange.fetch(...t),pinned:(...t)=>this._v3.notes.pinned.fetch(...t),favorite:(...t)=>this._v3.notes.favorite.fetch(...t),history:(...t)=>this._v3.notes.history.fetch(...t),historyRestore:(...t)=>this._v3.notes.historyRestore.fetch(...t),participantsRemove:(...t)=>this._v3.notes.participantsRemove.fetch(...t),participantsAdd:(...t)=>this._v3.notes.participantsAdd.fetch(...t),participantsPermissions:(...t)=>this._v3.notes.participantsPermissions.fetch(...t),tags:(...t)=>this._v3.notes.tags.fetch(...t),tagsCreate:(...t)=>this._v3.notes.tagsCreate.fetch(...t),tagsRename:(...t)=>this._v3.notes.tagsRename.fetch(...t),tagsDelete:(...t)=>this._v3.notes.tagsDelete.fetch(...t),tagsFavorite:(...t)=>this._v3.notes.tagsFavorite.fetch(...t),tag:(...t)=>this._v3.notes.tag.fetch(...t),untag:(...t)=>this._v3.notes.untag.fetch(...t)}),contacts:()=>({all:(...t)=>this._v3.contacts.all.fetch(...t),requestsIn:(...t)=>this._v3.contacts.requestsIn.fetch(...t),requestsInCount:(...t)=>this._v3.contacts.requestsInCount.fetch(...t),requestsOut:(...t)=>this._v3.contacts.requestsOut.fetch(...t),requestsOutDelete:(...t)=>this._v3.contacts.requestsOutDelete.fetch(...t),requestsSend:(...t)=>this._v3.contacts.requestsSend.fetch(...t),requestsAccept:(...t)=>this._v3.contacts.requestsAccept.fetch(...t),requestsDeny:(...t)=>this._v3.contacts.requestsDeny.fetch(...t),delete:(...t)=>this._v3.contacts.delete.fetch(...t),blocked:(...t)=>this._v3.contacts.blocked.fetch(...t),blockedAdd:(...t)=>this._v3.contacts.blockedAdd.fetch(...t),blockedDelete:(...t)=>this._v3.contacts.blockedDelete.fetch(...t)})}}}e.API=Ne,e.default=Ne},24599:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AuthInfo=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/auth/info",data:{email:t}})}}e.AuthInfo=i,e.default=i},78072:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversations=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/chat/conversations"})}}e.ChatConversations=i,e.default=i},83462:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsCreate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,metadata:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/create",data:{uuid:t,metadata:e}})}}e.ChatConversationsCreate=i,e.default=i},2e4:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/delete",data:{uuid:t}})}}e.ChatConversationsDelete=i,e.default=i},4119:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsLeave=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/leave",data:{uuid:t}})}}e.ChatConversationsLeave=i,e.default=i},79618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsNameEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,name:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/name/edit",data:{uuid:t,name:e}})}}e.ChatConversationsNameEdit=i,e.default=i},16037:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsOnline=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversation:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/online",data:{conversation:t}})}}e.ChatConversationsOnline=i,e.default=i},72181:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsParticipantsAdd=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,contactUUID:e,metadata:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/participants/add",data:{uuid:t,contactUUID:e,metadata:i}})}}e.ChatConversationsParticipantsAdd=i,e.default=i},92589:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsParticipantsRemove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,userId:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/participants/remove",data:{uuid:t,userId:e}})}}e.ChatConversationsParticipantsRemove=i,e.default=i},27991:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsRead=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/read",data:{uuid:t}})}}e.ChatConversationsRead=i,e.default=i},99664:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatConversationsUnread=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/chat/conversations/unread",data:{uuid:t}})}}e.ChatConversationsUnread=i,e.default=i},15425:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/delete",data:{uuid:t}})}}e.ChatDelete=i,e.default=i},32796:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversation:t,uuid:e,message:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/edit",data:{conversation:t,uuid:e,message:i}})}}e.ChatEdit=i,e.default=i},47899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatLastFocus=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/chat/lastFocus"})}}e.ChatLastFocus=i,e.default=i},82046:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatLastFocusUpdate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversations:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/lastFocus",data:{conversations:t}})}}e.ChatLastFocusUpdate=i,e.default=i},72859:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatMessageEmbedDisable=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/message/embed/disable",data:{uuid:t}})}}e.ChatMessageEmbedDisable=i,e.default=i},95865:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatMessages=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversation:t,timestamp:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/chat/messages",data:{conversation:t,timestamp:e}})}}e.ChatMessages=i,e.default=i},26409:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatSend=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversation:t,uuid:e,message:i,replyTo:r}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/send",data:{conversation:t,uuid:e,message:i,replyTo:r}})}}e.ChatSend=i,e.default=i},44520:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatTyping=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({conversation:t,type:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/chat/typing",data:{conversation:t,type:e}})}}e.ChatTyping=i,e.default=i},31498:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChatUnread=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/chat/unread"})}}e.ChatUnread=i,e.default=i},69368:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Contacts=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/contacts"})}}e.Contacts=i,e.default=i},38266:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsBlocked=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/contacts/blocked"})}}e.ContactsBlocked=i,e.default=i},88675:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsBlockedAdd=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/blocked/add",data:{email:t}})}}e.ContactsBlockedAdd=i,e.default=i},57887:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsBlockedDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/blocked/delete",data:{uuid:t}})}}e.ContactsBlockedDelete=i,e.default=i},21587:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/delete",data:{uuid:t}})}}e.ContactsDelete=i,e.default=i},93226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsAccept=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/requests/accept",data:{uuid:t}})}}e.ContactsRequestsAccept=i,e.default=i},78017:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsDeny=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/requests/deny",data:{uuid:t}})}}e.ContactsRequestsDeny=i,e.default=i},33181:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsIn=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/contacts/requests/in"})}}e.ContactsRequestsIn=i,e.default=i},76298:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsInCount=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/contacts/requests/in/count"})}}e.ContactsRequestsInCount=i,e.default=i},98933:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsOut=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/contacts/requests/in"})}}e.ContactsRequestsOut=i,e.default=i},12659:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsOutDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/requests/out/delete",data:{uuid:t}})}}e.ContactsRequestsOutDelete=i,e.default=i},9592:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContactsRequestsSend=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/contacts/requests/send",data:{email:t}})}}e.ContactsRequestsSend=i,e.default=i},58460:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirColor=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,color:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/color",data:{uuid:t,color:e}})}}e.DirColor=i,e.default=i},78057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirContent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,dirsOnly:e=!1}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/content",data:Object.assign({uuid:t},e?{foldersOnly:!0}:{})})}}e.DirContent=i,e.default=i},89057:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirCreate=void 0;const r=i(78593);class n{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,metadataEncrypted:e,parent:i,nameHashed:n}){const o=t||await(0,r.uuidv4)();return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/create",data:{uuid:o,name:e,nameHashed:n,parent:i}})}}e.DirCreate=n,e.default=n},4665:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirDeletePermanent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/delete/permanent",data:{uuid:t}})}}e.DirDeletePermanent=i,e.default=i},88854:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirDownload=void 0;const r=i(85612);class n{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,type:e="normal",linkUUID:i,linkHasPassword:n,linkPassword:o,linkSalt:a,skipCache:s}){const c="shared"===e?"/v3/dir/download/shared":"linked"===e?"/v3/dir/download/link":"/v3/dir/download",u="shared"===e||"normal"===e?Object.assign({uuid:t},s?{skipCache:s}:{}):Object.assign({uuid:i,parent:t,password:n&&a&&o?32===a.length?await(0,r.deriveKeyFromPassword)({password:o,salt:a,iterations:2e5,hash:"sha512",bitLength:512,returnHex:!0}):await(0,r.hashFn)({input:0===o.length?"empty":o}):await(0,r.hashFn)({input:"empty"})},s?{skipCache:s}:{});return await this.apiClient.request({method:"POST",endpoint:c,data:u})}}e.DirDownload=n,e.default=n},25768:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirExists=void 0;const r=i(85612);class n{constructor({apiClient:t}){this.apiClient=t}async fetch({name:t,parent:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/exists",data:{parent:e,nameHashed:await(0,r.hashFn)({input:t.toLowerCase()})}})}}e.DirExists=n,e.default=n},26666:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkAdd=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,parent:e,linkUUID:i,type:r,metadata:n,key:o,expiration:a}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/add",data:{uuid:t,parent:e,linkUUID:i,type:r,metadata:n,key:o,expiration:a}})}}e.DirLinkAdd=i,e.default=i},96471:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkContent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,password:e,parent:i}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/content",data:{uuid:t,password:e,parent:i}})}}e.DirLinkContent=i,e.default=i},54842:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,expiration:e="never",password:i,downloadBtn:r=!0,passwordHashed:n,salt:o}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/edit",data:{uuid:t,expiration:e,password:i,passwordHashed:n,salt:o,downloadBtn:r}})}}e.DirLinkEdit=i,e.default=i},57779:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkInfo=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/info",data:{uuid:t}})}}e.DirLinkInfo=i,e.default=i},40288:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkRemove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/remove",data:{uuid:t}})}}e.DirLinkRemove=i,e.default=i},88411:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinkStatus=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/link/status",data:{uuid:t}})}}e.DirLinkStatus=i,e.default=i},81566:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirLinked=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/linked",data:{uuid:t}})}}e.DirLinked=i,e.default=i},9223:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirMove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,to:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/move",data:{uuid:t,to:e}})}}e.DirMove=i,e.default=i},28191:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirPresent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/present",data:{uuid:t}})}}e.DirPresent=i,e.default=i},13061:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirRename=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,metadataEncrypted:e,nameHashed:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/rename",data:{uuid:t,name:e,nameHashed:i}})}}e.DirRename=i,e.default=i},59587:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirRestore=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/restore",data:{uuid:t}})}}e.DirRestore=i,e.default=i},60659:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirShared=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/shared",data:{uuid:t}})}}e.DirShared=i,e.default=i},40440:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirSize=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,sharerId:e=0,receiverId:i=0,trash:r=!1}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/size",data:{uuid:t,sharerId:e,receiverId:i,trash:r?1:0}})}}e.DirSize=i,e.default=i},75642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirSizeLink=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,linkUUID:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/dir/size/link",data:{uuid:t,linkUUID:e}})}}e.DirSizeLink=i,e.default=i},57743:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirTrash=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/dir/trash",data:{uuid:t}})}}e.DirTrash=i,e.default=i},15467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDeletePermanent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/delete/permanent",data:{uuid:t}})}}e.FileDeletePermanent=i,e.default=i},1850:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDownloadChunkBuffer=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,onProgress:a}){return await this.apiClient.downloadChunkToBuffer({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,onProgress:a})}}e.FileDownloadChunkBuffer=i,e.default=i},25818:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDownloadChunkLocal=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,to:a,onProgress:s}){await this.apiClient.downloadChunkToLocal({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,to:a,onProgress:s})}}e.FileDownloadChunkLocal=i,e.default=i},10024:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDownloadChunkStream=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,onProgress:a}){return await this.apiClient.downloadChunkToStream({uuid:t,bucket:e,region:i,chunk:r,timeout:n,abortSignal:o,onProgress:a})}}e.FileDownloadChunkStream=i,e.default=i},63564:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileExists=void 0;const r=i(85612);class n{constructor({apiClient:t}){this.apiClient=t}async fetch({name:t,parent:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/file/exists",data:{parent:e,nameHashed:await(0,r.hashFn)({input:t.toLowerCase()})}})}}e.FileExists=n,e.default=n},9218:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileLinkEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,fileUUID:e,expiration:i="never",password:r,downloadBtn:n=!0,type:o,passwordHashed:a,salt:s}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/link/edit",data:{uuid:t,fileUUID:e,expiration:i,password:r,passwordHashed:a,salt:s,downloadBtn:n,type:o}})}}e.FileLinkEdit=i,e.default=i},52144:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileLinkInfo=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,password:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/file/link/info",data:{uuid:t,password:e}})}}e.FileLinkInfo=i,e.default=i},936:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileLinkPassword=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/file/link/password",data:{uuid:t}})}}e.FileLinkPassword=i,e.default=i},71995:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileLinkStatus=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/file/link/status",data:{uuid:t}})}}e.FileLinkStatus=i,e.default=i},59649:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileMove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,to:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/move",data:{uuid:t,to:e}})}}e.FileMove=i,e.default=i},69337:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileRename=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,metadataEncrypted:e,nameEncrypted:i,nameHashed:r}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/rename",data:{uuid:t,name:i,nameHashed:r,metadata:e}})}}e.FileRename=i,e.default=i},52042:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileRestore=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/restore",data:{uuid:t}})}}e.FileRestore=i,e.default=i},58398:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTrash=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/trash",data:{uuid:t}})}}e.FileTrash=i,e.default=i},46017:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileUploadChunkBuffer=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,index:e,parent:i,uploadKey:r,abortSignal:n,maxRetries:o,retryTimeout:a,timeout:s,buffer:c,onProgress:u}){return await this.apiClient.uploadChunkBuffer({uuid:t,index:e,parent:i,uploadKey:r,abortSignal:n,maxRetries:o,retryTimeout:a,timeout:s,buffer:c,onProgress:u})}}e.FileUploadChunkBuffer=i,e.default=i},15618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileVersionRestore=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,currentUUID:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/file/version/restore",data:{uuid:t,current:e}})}}e.FileVersionRestore=i,e.default=i},46115:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileVersions=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/file/versions",data:{uuid:t}})}}e.FileVersions=i,e.default=i},80639:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Health=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/health"})}}e.Health=i,e.default=i},17644:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemFavorite=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,type:e,favorite:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/favorite",data:{uuid:t,type:e,value:i?1:0}})}}e.ItemFavorite=i,e.default=i},81190:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemLinked=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/item/linked",data:{uuid:t}})}}e.ItemLinked=i,e.default=i},96323:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemLinkedRename=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,linkUUID:e,metadata:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/linked/rename",data:{uuid:t,linkUUID:e,metadata:i}})}}e.ItemLinkedRename=i,e.default=i},92926:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemShare=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,parent:e,email:i,type:r,metadata:n}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/share",data:{uuid:t,parent:e,email:i,type:r,metadata:n}})}}e.ItemShare=i,e.default=i},33594:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemShared=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/item/shared",data:{uuid:t}})}}e.ItemShared=i,e.default=i},70519:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemSharedInRemove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/shared/in/remove",data:{uuid:t}})}}e.ItemSharedInRemove=i,e.default=i},69140:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemSharedOutRemove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,receiverId:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/shared/out/remove",data:{uuid:t,receiverId:e}})}}e.ItemSharedOutRemove=i,e.default=i},3213:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ItemSharedRename=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,receiverId:e,metadata:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/item/shared/rename",data:{uuid:t,receiverId:e,metadata:i}})}}e.ItemSharedRename=i,e.default=i},8720:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Login=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t,password:e,twoFactorCode:i="XXXXXX",authVersion:r}){return await this.apiClient.request({method:"POST",endpoint:"/v3/login",data:{email:t,password:e,twoFactorCode:i,authVersion:r}})}}e.Login=i,e.default=i},31805:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Notes=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/notes"})}}e.Notes=i,e.default=i},60121:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesArchive=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/archive",data:{uuid:t}})}}e.NotesArchive=i,e.default=i},28066:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesContent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/notes/content",data:{uuid:t}})}}e.NotesContent=i,e.default=i},48618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesContentEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,preview:e,content:i,type:r}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/content/edit",data:{uuid:t,preview:e,content:i,type:r}})}}e.NotesContentEdit=i,e.default=i},95820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesCreate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,title:e,metadata:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/create",data:{uuid:t,title:e,metadata:i}})}}e.NotesCreate=i,e.default=i},93860:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/delete",data:{uuid:t}})}}e.NotesDelete=i,e.default=i},29247:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesFavorite=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,favorite:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/favorite",data:{uuid:t,favorite:e}})}}e.NotesFavorite=i,e.default=i},72495:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesHistory=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/notes/history",data:{uuid:t}})}}e.NotesHistory=i,e.default=i},4205:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesHistoryRestore=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,id:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/history/restore",data:{uuid:t,id:e}})}}e.NotesHistoryRestore=i,e.default=i},79464:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesParticipantsAdd=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,contactUUID:e,metadata:i,permissionsWrite:r}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/participants/add",data:{uuid:t,contactUUID:e,metadata:i,permissionsWrite:r}})}}e.NotesParticipantsAdd=i,e.default=i},64497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesParticipantsPermissions=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,userId:e,permissionsWrite:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/participants/permissions",data:{uuid:t,userId:e,permissionsWrite:i}})}}e.NotesParticipantsPermissions=i,e.default=i},19729:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesParticipantsRemove=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,userId:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/participants/remove",data:{uuid:t,userId:e}})}}e.NotesParticipantsRemove=i,e.default=i},35265:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesPinned=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,pinned:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/pinned",data:{uuid:t,pinned:e}})}}e.NotesPinned=i,e.default=i},88820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesRestore=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/restore",data:{uuid:t}})}}e.NotesRestore=i,e.default=i},97636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTag=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,tag:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/tag",data:{uuid:t,tag:e}})}}e.NotesTag=i,e.default=i},12674:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTags=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/notes/tags"})}}e.NotesTags=i,e.default=i},43390:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTagsCreate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({name:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/notes/tags/create",data:{name:t}})}}e.NotesTagsCreate=i,e.default=i},61605:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTagsDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/tags/delete",data:{uuid:t}})}}e.NotesTagsDelete=i,e.default=i},30323:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTagsFavorite=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,favorite:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/tags/favorite",data:{uuid:t,favorite:e}})}}e.NotesTagsFavorite=i,e.default=i},49616:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTagsRename=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,name:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/tags/rename",data:{uuid:t,name:e}})}}e.NotesTagsRename=i,e.default=i},79341:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NoteTitleEdit=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,title:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/title/edit",data:{uuid:t,title:e}})}}e.NoteTitleEdit=i,e.default=i},12675:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTrash=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/trash",data:{uuid:t}})}}e.NotesTrash=i,e.default=i},5264:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesTypeChange=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,type:e,preview:i,content:r}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/type/change",data:{uuid:t,type:e,preview:i,content:r}})}}e.NotesTypeChange=i,e.default=i},67569:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotesUntag=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,tag:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/notes/untag",data:{uuid:t,tag:e}})}}e.NotesUntag=i,e.default=i},10721:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedIn=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(t){return await this.apiClient.request({method:"POST",endpoint:"/v3/shared/in",data:{uuid:t?t.uuid:"shared-in"}})}}e.SharedIn=i,e.default=i},61402:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedOut=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(t){return await this.apiClient.request({method:"POST",endpoint:"/v3/shared/out",data:{uuid:t?t.uuid:"shared-out",receiverId:t?t.receiverId:0}})}}e.SharedOut=i,e.default=i},42195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TrashEmpty=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){await this.apiClient.request({method:"POST",endpoint:"/v3/trash/empty",data:{}})}}e.TrashEmpty=i,e.default=i},78234:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UploadDone=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t,name:e,nameHashed:i,size:r,chunks:n,mime:o,rm:a,metadata:s,version:c,uploadKey:u}){return await this.apiClient.request({method:"POST",endpoint:"/v3/upload/done",data:{uuid:t,name:e,nameHashed:i,size:r,chunks:n,mime:o,rm:a,metadata:s,version:c,uploadKey:u}})}}e.UploadDone=i,e.default=i},50884:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.User2FADisable=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({code:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/2fa/disable",data:{code:t}})}}e.User2FADisable=i,e.default=i},68940:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.User2FAEnable=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({code:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/2fa/enable",data:{code:t}})}}e.User2FAEnable=i,e.default=i},71523:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserAccount=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/account"})}}e.UserAccount=i,e.default=i},57328:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserAffiliatePayout=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({address:t,method:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/affiliate/payout",data:{method:e,address:t}})}}e.UserAffiliatePayout=i,e.default=i},16818:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserAppearOffline=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({appearOffline:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/appearOffline",data:{appearOffline:t}})}}e.UserAppearOffline=i,e.default=i},79627:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserAvatar=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({base64:t,hash:e}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/avatar",data:{avatar:t,hash:e}})}}e.UserAvatar=i,e.default=i},43211:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserBaseFolder=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({apiKey:t}){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/baseFolder",apiKey:t})}}e.UserBaseFolder=i,e.default=i},13937:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDelete=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({twoFactorCode:t="XXXXXX"}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/delete",data:{twoFactorKey:t}})}}e.UserDelete=i,e.default=i},97977:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDeleteAll=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){await this.apiClient.request({method:"POST",endpoint:"/v3/user/delete/all",data:{}})}}e.UserDeleteAll=i,e.default=i},44245:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDeleteVersions=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){await this.apiClient.request({method:"POST",endpoint:"/v3/user/delete/versions",data:{}})}}e.UserDeleteVersions=i,e.default=i},43543:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserEvent=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/event",data:{uuid:t}})}}e.UserEvent=i,e.default=i},55708:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserEvents=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({lastTimestamp:t,filter:e}){return(await this.apiClient.request({method:"POST",endpoint:"/v3/user/events",data:{filter:e,timestamp:t}})).events}}e.UserEvents=i,e.default=i},17370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserGDPR=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/gdpr"})}}e.UserGDPR=i,e.default=i},27357:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfo=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({apiKey:t}){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/info",apiKey:t})}}e.UserInfo=i,e.default=i},43329:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserInvoice=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/invoice",data:{uuid:t}})}}e.UserInvoice=i,e.default=i},66714:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserKeyPairInfo=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({apiKey:t}){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/keyPair/info",apiKey:t})}}e.UserKeyPairInfo=i,e.default=i},6037:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserKeyPairSet=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({publicKey:t,encryptedPrivateKey:e,apiKey:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/keyPair/set",data:{publicKey:t,privateKey:e},apiKey:i})}}e.UserKeyPairSet=i,e.default=i},40943:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserKeyPairUpdate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({publicKey:t,encryptedPrivateKey:e,apiKey:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/keyPair/update",data:{publicKey:t,privateKey:e},apiKey:i})}}e.UserKeyPairUpdate=i,e.default=i},24527:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserLastActiveDesktop=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({timestamp:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/lastActive/desktop",data:{timestamp:t}})}}e.UserLastActiveDesktop=i,e.default=i},641:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserLoginAlerts=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({enable:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/loginAlerts",data:{enabled:t?1:0}})}}e.UserLoginAlerts=i,e.default=i},40838:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserMasterKeys=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({encryptedMasterKeys:t,apiKey:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/masterKeys",data:{masterKeys:t},apiKey:e})}}e.UserMasterKeys=i,e.default=i},38805:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserNickname=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({nickname:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/nickname",data:{nickname:t}})}}e.UserNickname=i,e.default=i},6926:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserPersonalUpdate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({city:t,companyName:e,country:i,firstName:r,lastName:n,postalCode:o,street:a,streetNumber:s,vatId:c}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/personal/update",data:{city:t,companyName:e,country:i,firstName:r,lastName:n,postalCode:o,street:a,streetNumber:s,vatId:c}})}}e.UserPersonalUpdate=i,e.default=i},13292:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserProfile=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({id:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/profile",data:{id:t}})}}e.UserProfile=i,e.default=i},61840:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserPublicKey=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/publicKey",data:{email:t}})}}e.UserPublicKey=i,e.default=i},97620:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserSettings=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch(){return await this.apiClient.request({method:"GET",endpoint:"/v3/user/settings"})}}e.UserSettings=i,e.default=i},54442:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserSettingsEmailChange=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({email:t,password:e,authVersion:i}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/settings/email/change",data:{email:t,password:e,authVersion:i}})}}e.UserSettingsEmailChange=i,e.default=i},73079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserSettingsPasswordChange=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({password:t,currentPassword:e,authVersion:i,salt:r,masterKeys:n}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/settings/password/change",data:{password:t,currentPassword:e,authVersion:i,salt:r,masterKeys:n}})}}e.UserSettingsPasswordChange=i,e.default=i},67444:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserSubCancel=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({uuid:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/sub/cancel",data:{uuid:t}})}}e.UserSubCancel=i,e.default=i},49135:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserSubCreate=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({planId:t,method:e}){return await this.apiClient.request({method:"POST",endpoint:"/v3/user/sub/create",data:{planId:t,method:e}})}}e.UserSubCreate=i,e.default=i},13739:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserVersioning=void 0;class i{constructor({apiClient:t}){this.apiClient=t}async fetch({enable:t}){await this.apiClient.request({method:"POST",endpoint:"/v3/user/versioning",data:{enabled:t?1:0}})}}e.UserVersioning=i,e.default=i},30078:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i={fileMetadata:new Map,folderMetadata:new Map,importPublicKey:new Map,importPrivateKey:new Map,chatKey:new Map,noteKeyOwner:new Map,noteKeyParticipant:new Map,noteTitle:new Map,notePreview:new Map,noteTagName:new Map,chatConversationName:new Map,folderLinkKey:new Map,importRawKey:new Map,importPBKDF2Key:new Map};e.default=i},35252:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Chats=void 0;const r=i(78593),n=i(63643);class o{constructor(t){this._chatKeyCache=new Map,this._semaphores={list:new n.Semaphore(128)},this.api=t.api,this.crypto=t.crypto,this.sdkConfig=t.sdkConfig}async _chatKey({conversation:t}){if(this._chatKeyCache.has(t))return this._chatKeyCache.get(t);const e=(await this.conversations()).filter((e=>e.uuid===t));if(0===e.length)throw new Error(`Could not find chat ${t}.`);const i=e[0].participants.filter((t=>t.userId===this.sdkConfig.userId));if(0===i.length)throw new Error(`Could not find participant metadata for chat ${t}.`);const r=await this.crypto.decrypt().chatKey({metadata:i[0].metadata,privateKey:this.sdkConfig.privateKey});return this._chatKeyCache.set(t,r),r}async conversations(){const t=await this.api.v3().chat().conversations(),e=[],i=[];for(const r of t)i.push(new Promise(((t,i)=>{this._semaphores.list.acquire().then((()=>{const n=r.participants.filter((t=>t.userId===this.sdkConfig.userId));if(0===n.length)return void i(new Error("Conversation metadata not found."));(this._chatKeyCache.has(r.uuid)?Promise.resolve(this._chatKeyCache.get(r.uuid)):this.crypto.decrypt().chatKey({metadata:n[0].metadata,privateKey:this.sdkConfig.privateKey})).then((n=>{this._chatKeyCache.set(r.uuid,n);const o="string"==typeof r.name&&r.name.length>0?this.crypto.decrypt().chatConversationName({name:r.name,key:n}):Promise.resolve(""),a="string"==typeof r.lastMessage&&r.lastMessage.length>0?this.crypto.decrypt().chatMessage({message:r.lastMessage,key:n}):Promise.resolve("");Promise.all([o,a]).then((([i,n])=>{e.push(Object.assign(Object.assign({},r),{lastMessage:n,name:i})),t()})).catch(i)})).catch(i)})).catch(i)})).finally((()=>{this._semaphores.list.release()})));return await(0,r.promiseAllChunked)(i),e}async conversationsRecents(){return(await this.conversations()).sort(((t,e)=>e.lastMessageTimestamp-t.lastMessageTimestamp))}async get({conversation:t}){const e=(await this.conversations()).filter((e=>e.uuid===t));if(0===e.length)throw new Error(`Chat conversation ${t} not found.`);return e[0]}async create({uuid:t,contacts:e}){const[i,n]=await Promise.all([t?Promise.resolve(t):await(0,r.uuidv4)(),this.crypto.utils.generateRandomString({length:32})]),o=await this.crypto.encrypt().metadataPublic({metadata:JSON.stringify({key:n}),publicKey:this.sdkConfig.publicKey});if(await this.api.v3().chat().conversationsCreate({uuid:i,metadata:o}),this._chatKeyCache.set(i,n),e){const t=[];for(const r of e)t.push(this.addParticipant({conversation:i,contact:r}));await(0,r.promiseAllChunked)(t)}return i}async deleteMessage({uuid:t}){await this.api.v3().chat().delete({uuid:t})}async delete({conversation:t}){await this.api.v3().chat().conversationsDelete({uuid:t})}async editConversationName({conversation:t,name:e}){const i=await this._chatKey({conversation:t}),r=await this.crypto.encrypt().chatConversationName({name:e,key:i});await this.api.v3().chat().conversationsName().edit({uuid:t,name:r})}async editMessage({uuid:t,conversation:e,message:i}){const r=await this._chatKey({conversation:e}),n=await this.crypto.encrypt().chatMessage({message:i,key:r});await this.api.v3().chat().edit({uuid:t,conversation:e,message:n})}async sendMessage({uuid:t,conversation:e,message:i,replyTo:n}){const[o,a]=await Promise.all([this._chatKey({conversation:e}),t?Promise.resolve(t):(0,r.uuidv4)()]),s=await this.crypto.encrypt().chatMessage({message:i,key:o});return await this.api.v3().chat().send({uuid:a,conversation:e,message:s,replyTo:n}),a}async sendTyping({conversation:t,type:e}){await this.api.v3().chat().typing({conversation:t,type:e})}async messages({conversation:t,timestamp:e}){const[i,n]=await Promise.all([this._chatKey({conversation:t}),this.api.v3().chat().messages({conversation:t,timestamp:e||Date.now()+36e5})]),o=[],a=[];for(const t of n)a.push(new Promise(((e,r)=>{this._semaphores.list.acquire().then((()=>{const n=t.replyTo.uuid.length>0&&t.replyTo.message.length>0?this.crypto.decrypt().chatMessage({message:t.replyTo.message,key:i}):Promise.resolve("");Promise.all([this.crypto.decrypt().chatMessage({message:t.message,key:i}),n]).then((([i,r])=>{o.push(Object.assign(Object.assign({},t),{message:i,replyTo:Object.assign(Object.assign({},t.replyTo),{message:r})})),e()})).catch(r)})).catch(r)})).finally((()=>{this._semaphores.list.release()})));return await(0,r.promiseAllChunked)(a),o}async addParticipant({conversation:t,contact:e}){const i=await this._chatKey({conversation:t}),r=(await this.api.v3().user().publicKey({email:e.email})).publicKey,n=await this.crypto.encrypt().metadataPublic({metadata:JSON.stringify({key:i}),publicKey:r});await this.api.v3().chat().conversationsParticipants().add({uuid:t,contactUUID:e.uuid,metadata:n})}async removeParticipant({conversation:t,userId:e}){await this.api.v3().chat().conversationsParticipants().remove({uuid:t,userId:e})}async markConversationAsRead({conversation:t}){await this.api.v3().chat().conversationsRead({uuid:t})}async conversationUnreadCount({conversation:t}){return(await this.api.v3().chat().conversationsUnread({uuid:t})).unread}async unread(){return(await this.api.v3().chat().unread()).unread}async conversationOnline({conversation:t}){return await this.api.v3().chat().conversationsOnline({conversation:t})}async disableMessageEmbed({uuid:t}){await this.api.v3().chat().message().embed().disable({uuid:t})}async leave({conversation:t}){await this.api.v3().chat().conversationsLeave({uuid:t})}async lastFocus(){return await this.api.v3().chat().lastFocus()}async updateLastFocus({values:t}){await this.api.v3().chat().lastFocusUpdate({conversations:t})}}e.Chats=o,e.default=o},64181:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Cloud=void 0;const n=i(78593),o=i(95601),a=i(13365),s=r(i(1679)),c=r(i(67435)),u=r(i(55674)),l=i(63643),h=r(i(88177)),f=r(i(80983)),p=r(i(73247));class d{constructor(t){this._semaphores={downloadThreads:new l.Semaphore(o.MAX_DOWNLOAD_THREADS),downloadWriters:new l.Semaphore(o.MAX_DOWNLOAD_WRITERS),uploadThreads:new l.Semaphore(o.MAX_UPLOAD_THREADS),listSemaphore:new l.Semaphore(o.MAX_CONCURRENT_LISTING_OPS),downloads:new l.Semaphore(o.MAX_CONCURRENT_DOWNLOADS),uploads:new l.Semaphore(o.MAX_CONCURRENT_UPLOADS),directoryDownloads:new l.Semaphore(o.MAX_CONCURRENT_DIRECTORY_DOWNLOADS),directoryUploads:new l.Semaphore(o.MAX_CONCURRENT_DIRECTORY_UPLOADS)},this.utils={signals:{PauseSignal:a.PauseSignal},utils:p.default},this.api=t.api,this.crypto=t.crypto,this.sdkConfig=t.sdkConfig}async listDirectory({uuid:t}){const e=await this.api.v3().dir().content({uuid:t}),i=[],r=[];for(const t of e.folders)r.push(new Promise(((e,r)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadata({metadata:t.name}).then((r=>{if(0===r.name.length)return void e();const o=(0,n.convertTimestampToMs)(t.timestamp);i.push({type:"directory",uuid:t.uuid,name:r.name,lastModified:o,timestamp:o,color:t.color,parent:t.parent,favorited:1===t.favorited,size:0}),e()})).catch(r)})).catch(r))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const t of e.uploads)r.push(new Promise(((e,r)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:t.metadata}).then((r=>{0!==r.name.length?(i.push({type:"file",uuid:t.uuid,name:r.name,size:r.size,mime:r.mime,lastModified:(0,n.convertTimestampToMs)(r.lastModified),timestamp:(0,n.convertTimestampToMs)(t.timestamp),parent:t.parent,rm:t.rm,version:t.version,chunks:t.chunks,favorited:1===t.favorited,key:r.key,bucket:t.bucket,region:t.region,creation:r.creation,hash:r.hash}),e()):e()})).catch(r)})).catch(r))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(r),i}async listDirectorySharedIn({uuid:t}){const e=await this.api.v3().shared().in({uuid:t}),i=[],r=[];for(const t of e.folders)r.push(new Promise(((e,r)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadataPrivate({metadata:t.metadata}).then((r=>{var o,a,s;if(0===r.name.length)return void e();const c=(0,n.convertTimestampToMs)(t.timestamp);i.push({type:"directory",uuid:t.uuid,name:r.name,lastModified:c,timestamp:c,color:t.color,parent:null!==(o=t.parent)&&void 0!==o?o:"shared-in",sharerEmail:t.sharerEmail,sharerId:t.sharerId,receiverEmail:null!==(a=t.receiverEmail)&&void 0!==a?a:"",receiverId:null!==(s=t.receiverId)&&void 0!==s?s:0,receivers:[],size:0}),e()})).catch(r)})).catch(r))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const t of e.uploads)r.push(new Promise(((e,r)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadataPrivate({metadata:t.metadata}).then((r=>{var o,a;0!==r.name.length?(i.push({type:"file",uuid:t.uuid,name:r.name,size:r.size,mime:r.mime,lastModified:(0,n.convertTimestampToMs)(r.lastModified),timestamp:(0,n.convertTimestampToMs)(t.timestamp),parent:t.parent,version:t.version,chunks:t.chunks,key:r.key,bucket:t.bucket,region:t.region,creation:r.creation,hash:r.hash,sharerEmail:t.sharerEmail,sharerId:t.sharerId,receiverEmail:null!==(o=t.receiverEmail)&&void 0!==o?o:"",receiverId:null!==(a=t.receiverId)&&void 0!==a?a:0,receivers:[]}),e()):e()})).catch(r)})).catch(r))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(r),i}async listDirectorySharedOut({uuid:t,receiverId:e}){const i=await this.api.v3().shared().out({uuid:t,receiverId:e}),r=[],o=[];for(const t of i.folders)o.push(new Promise(((e,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadata({metadata:t.metadata}).then((i=>{var o,a,s;if(0===i.name.length)return void e();const c=(0,n.convertTimestampToMs)(t.timestamp);r.push({type:"directory",uuid:t.uuid,name:i.name,lastModified:c,timestamp:c,color:t.color,parent:null!==(o=t.parent)&&void 0!==o?o:"shared-in",sharerEmail:t.sharerEmail,sharerId:t.sharerId,receiverEmail:null!==(a=t.receiverEmail)&&void 0!==a?a:"",receiverId:null!==(s=t.receiverId)&&void 0!==s?s:0,receivers:[],size:0}),e()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const t of i.uploads)o.push(new Promise(((e,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:t.metadata}).then((i=>{var o,a;0!==i.name.length?(r.push({type:"file",uuid:t.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),timestamp:(0,n.convertTimestampToMs)(t.timestamp),parent:t.parent,version:t.version,chunks:t.chunks,key:i.key,bucket:t.bucket,region:t.region,creation:i.creation,hash:i.hash,sharerEmail:t.sharerEmail,sharerId:t.sharerId,receiverEmail:null!==(o=t.receiverEmail)&&void 0!==o?o:"",receiverId:null!==(a=t.receiverId)&&void 0!==a?a:0,receivers:[]}),e()):e()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));await(0,n.promiseAllChunked)(o);const a=[],s={},c={};for(const t of r)Array.isArray(s[t.uuid])?s[t.uuid].push({id:t.receiverId,email:t.receiverEmail}):s[t.uuid]=[{id:t.receiverId,email:t.receiverEmail}];for(let t=0;tthis._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:r.metadata}).then((i=>{0!==i.name.length?(e.push({type:"file",uuid:r.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),timestamp:(0,n.convertTimestampToMs)(r.timestamp),parent:r.parent,rm:r.rm,version:r.version,chunks:r.chunks,favorited:1===r.favorited,key:i.key,bucket:r.bucket,region:r.region,creation:i.creation,hash:i.hash}),t()):t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(i),e}async listTrash(){const t=await this.api.v3().dir().content({uuid:"trash"}),e=[],i=[];for(const r of t.folders)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadata({metadata:r.name}).then((i=>{if(0===i.name.length)return void t();const o=(0,n.convertTimestampToMs)(r.timestamp);e.push({type:"directory",uuid:r.uuid,name:i.name,lastModified:o,timestamp:o,color:r.color,parent:r.parent,favorited:1===r.favorited,size:0}),t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const r of t.uploads)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:r.metadata}).then((i=>{0!==i.name.length?(e.push({type:"file",uuid:r.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),timestamp:(0,n.convertTimestampToMs)(r.timestamp),parent:r.parent,rm:r.rm,version:r.version,chunks:r.chunks,favorited:1===r.favorited,key:i.key,bucket:r.bucket,region:r.region,creation:i.creation,hash:i.hash}),t()):t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(i),e}async listFavorites(){const t=await this.api.v3().dir().content({uuid:"favorites"}),e=[],i=[];for(const r of t.folders)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadata({metadata:r.name}).then((i=>{if(0===i.name.length)return void t();const o=(0,n.convertTimestampToMs)(r.timestamp);e.push({type:"directory",uuid:r.uuid,name:i.name,lastModified:o,timestamp:o,color:r.color,parent:r.parent,favorited:1===r.favorited,size:0}),t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const r of t.uploads)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:r.metadata}).then((i=>{0!==i.name.length?(e.push({type:"file",uuid:r.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),timestamp:(0,n.convertTimestampToMs)(r.timestamp),parent:r.parent,rm:r.rm,version:r.version,chunks:r.chunks,favorited:1===r.favorited,key:i.key,bucket:r.bucket,region:r.region,creation:i.creation,hash:i.hash}),t()):t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(i),e}async listPublicLinks(){const t=await this.api.v3().dir().content({uuid:"links"}),e=[],i=[];for(const r of t.folders)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().folderMetadata({metadata:r.name}).then((i=>{if(0===i.name.length)return void t();const o=(0,n.convertTimestampToMs)(r.timestamp);e.push({type:"directory",uuid:r.uuid,name:i.name,lastModified:o,timestamp:o,color:r.color,parent:r.parent,favorited:1===r.favorited,size:0}),t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));for(const r of t.uploads)i.push(new Promise(((t,i)=>this._semaphores.listSemaphore.acquire().then((()=>{this.crypto.decrypt().fileMetadata({metadata:r.metadata}).then((i=>{0!==i.name.length?(e.push({type:"file",uuid:r.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),timestamp:(0,n.convertTimestampToMs)(r.timestamp),parent:r.parent,rm:r.rm,version:r.version,chunks:r.chunks,favorited:1===r.favorited,key:i.key,bucket:r.bucket,region:r.region,creation:i.creation,hash:i.hash}),t()):t()})).catch(i)})).catch(i))).finally((()=>{this._semaphores.listSemaphore.release()})));return await(0,n.promiseAllChunked)(i),e}async renameFile({uuid:t,metadata:e,name:i}){const[r,n,o]=await Promise.all([this.crypto.utils.hashFn({input:i.toLowerCase()}),this.crypto.encrypt().metadata({metadata:JSON.stringify(Object.assign(Object.assign({},e),{name:i}))}),this.crypto.encrypt().metadata({metadata:i,key:e.key})]);await this.api.v3().file().rename({uuid:t,metadataEncrypted:n,nameEncrypted:o,nameHashed:r}),await this.checkIfItemIsSharedForRename({uuid:t,itemMetadata:e})}async renameDirectory({uuid:t,name:e}){const[i,r]=await Promise.all([this.crypto.utils.hashFn({input:e.toLowerCase()}),this.crypto.encrypt().metadata({metadata:JSON.stringify({name:e})})]);await this.api.v3().dir().rename({uuid:t,metadataEncrypted:r,nameHashed:i}),await this.checkIfItemIsSharedForRename({uuid:t,itemMetadata:{name:e}})}async moveFile({uuid:t,to:e,metadata:i}){await this.api.v3().file().move({uuid:t,to:e}),await this.checkIfItemParentIsShared({type:"file",parent:e,uuid:t,itemMetadata:i})}async moveDirectory({uuid:t,to:e,metadata:i}){await this.api.v3().dir().move({uuid:t,to:e}),await this.checkIfItemParentIsShared({type:"directory",parent:e,uuid:t,itemMetadata:i})}async trashFile({uuid:t}){await this.api.v3().file().trash({uuid:t})}async trashDirectory({uuid:t}){await this.api.v3().dir().trash({uuid:t})}async createDirectory({uuid:t,name:e,parent:i}){let r=t||await(0,n.uuidv4)();const o=await this.api.v3().dir().exists({name:e,parent:i});if(o.exists)r=o.existsUUID;else{const[t,n]=await Promise.all([this.crypto.encrypt().metadata({metadata:JSON.stringify({name:e})}),this.crypto.utils.hashFn({input:e.toLowerCase()})]);await this.api.v3().dir().create({uuid:r,metadataEncrypted:t,nameHashed:n,parent:i}),await this.checkIfItemParentIsShared({type:"directory",parent:i,uuid:r,itemMetadata:{name:e}})}return r}async changeDirectoryColor({uuid:t,color:e}){await this.api.v3().dir().color({uuid:t,color:e})}async favoriteDirectory({uuid:t,favorite:e}){await this.api.v3().item().favorite({uuid:t,type:"folder",favorite:e})}async favoriteFile({uuid:t,favorite:e}){await this.api.v3().item().favorite({uuid:t,type:"file",favorite:e})}async deleteFile({uuid:t}){await this.api.v3().file().delete().permanent({uuid:t})}async deleteDirectory({uuid:t}){await this.api.v3().dir().delete().permanent({uuid:t})}async restoreFile({uuid:t}){await this.api.v3().file().restore({uuid:t})}async restoreDirectory({uuid:t}){await this.api.v3().dir().restore({uuid:t})}async restoreFileVersion({uuid:t,currentUUID:e}){await this.api.v3().file().version().restore({uuid:t,currentUUID:e})}async fileVersions({uuid:t}){return await this.api.v3().file().versions({uuid:t})}async shareItem({uuid:t,parent:e,email:i,type:r,publicKey:n,metadata:o}){const a=await this.crypto.encrypt().metadataPublic({metadata:JSON.stringify(o),publicKey:n});await this.api.v3().item().share({uuid:t,parent:e,email:i,type:r,metadata:a})}async addItemToDirectoryPublicLink({uuid:t,parent:e,linkUUID:i,type:r,metadata:n,linkKeyEncrypted:o,expiration:a}){const s=await this.crypto.decrypt().folderLinkKey({metadata:o}),c=await this.crypto.encrypt().metadata({metadata:JSON.stringify(n),key:s});await this.api.v3().dir().link().add({uuid:t,parent:e,linkUUID:i,type:r,metadata:c,key:o,expiration:a})}async enablePublicLink({type:t,uuid:e,onProgress:i}){const r=await(0,n.uuidv4)();if("directory"===t){const[t,o]=await Promise.all([this.getDirectoryTree({uuid:e}),this.crypto.utils.generateRandomString({length:32})]),a=await this.crypto.encrypt().metadata({metadata:o});let s=0;const c=[];for(const e in t){const n=t[e];c.push(new Promise(((t,e)=>{this.addItemToDirectoryPublicLink({uuid:n.uuid,parent:n.parent,linkUUID:r,type:"directory"===n.type?"folder":"file",expiration:"never",linkKeyEncrypted:a,metadata:"directory"===n.type?{name:n.name}:{name:n.name,size:n.size,mime:n.mime,lastModified:n.lastModified,key:n.key,creation:n.creation,hash:n.hash}}).then((()=>{s+=1,i&&i(s),t()})).catch(e)})))}return await(0,n.promiseAllChunked)(c),r}return await this.api.v3().file().link().edit({uuid:r,fileUUID:e,expiration:"never",password:"empty",passwordHashed:await this.crypto.utils.hashFn({input:"empty"}),downloadBtn:!0,type:"enable",salt:await this.crypto.utils.generateRandomString({length:32})}),r}async editPublicLink({type:t,itemUUID:e,linkUUID:i,password:r,enableDownload:n=!0,expiration:o="never"}){const a=await this.crypto.utils.generateRandomString({length:32}),s=r&&r.length>0?"notempty":"empty",c=r&&r.length>0?await this.crypto.utils.deriveKeyFromPassword({password:r,salt:a,iterations:2e5,hash:"sha512",bitLength:512,returnHex:!0}):"empty";if("directory"!==t){if(!i)throw new Error("[cloud.disablePublicLink] linkUUID undefined, expected: UUIDv4 string");await this.api.v3().file().link().edit({uuid:i,fileUUID:e,expiration:o,password:s,passwordHashed:c,salt:a,downloadBtn:n,type:"enable"})}else await this.api.v3().dir().link().edit({uuid:e,expiration:o,password:s,passwordHashed:c,salt:a,downloadBtn:n})}async disablePublicLink({type:t,linkUUID:e,itemUUID:i}){if("directory"!==t){if(!e)throw new Error("[cloud.disablePublicLink] linkUUID undefined, expected: UUIDv4 string");await this.api.v3().file().link().edit({uuid:e,fileUUID:i,expiration:"never",password:"empty",passwordHashed:await this.crypto.utils.hashPassword({password:"empty"}),salt:await this.crypto.utils.generateRandomString({length:32}),downloadBtn:!0,type:"disable"})}else await this.api.v3().dir().link().remove({uuid:i})}async stopSharingItem({uuid:t,receiverId:e}){await this.api.v3().item().sharedOut().remove({uuid:t,receiverId:e})}async removeSharedItem({uuid:t}){await this.api.v3().item().sharedIn().remove({uuid:t})}async shareItemsToUser({files:t,directories:e,email:i,onProgress:r}){const o=(await this.api.v3().user().publicKey({email:i})).publicKey,a=[];for(const e of t)a.push(Object.assign(Object.assign({},e),{metadata:e.metadata,parent:"none",type:"file"}));const s=[];for(const t of e)a.push(Object.assign(Object.assign({},t),{metadata:t.metadata,parent:"none",type:"folder"})),s.push(new Promise(((e,i)=>{this.getDirectoryTree({uuid:t.uuid}).then((i=>{for(const e in i){const r=i[e];"base"!==r.parent&&r.uuid!==t.uuid&&("directory"===r.type?a.push({uuid:r.uuid,metadata:{name:r.name},parent:r.parent,type:"folder"}):a.push({uuid:r.uuid,metadata:{name:r.name,size:r.size,mime:r.mime,lastModified:r.lastModified,key:r.key,creation:r.creation,hash:r.hash},parent:r.parent,type:"file"}))}e()})).catch(i)})));await(0,n.promiseAllChunked)(s);const c=[];let u=0;for(const t of a)c.push(new Promise(((e,n)=>{this.shareItem({uuid:t.uuid,parent:t.parent,email:i,type:t.type,publicKey:o,metadata:t.metadata}).then((()=>{u+=1,r&&r(u),e()})).catch(n)})));await(0,n.promiseAllChunked)(c)}async checkIfItemParentIsShared({type:t,parent:e,uuid:i,itemMetadata:r}){const[o,a]=await Promise.all([this.api.v3().dir().shared({uuid:e}),this.api.v3().dir().linked({uuid:e})]);if(!o.sharing&&!a.link)return;const s=[];let c=null;if(o.sharing){const n=[],a=[];if("file"===t)n.push({uuid:i,parent:e,metadata:r});else{a.push({uuid:i,parent:e,metadata:r}),c||(c=await this.getDirectoryTree({uuid:i}));for(const t in c){const e=c[t];e.uuid!==i&&"base"!==e.parent&&("file"===e.type?n.push({uuid:e.uuid,parent:e.parent,metadata:{name:e.name,size:e.size,mime:e.mime,key:e.key,lastModified:e.lastModified,creation:e.creation,hash:e.hash}}):a.push({uuid:e.uuid,parent:e.parent,metadata:{name:e.name}}))}}for(const t of n)for(const e of o.users)s.push(this.shareItem({uuid:t.uuid,parent:t.parent,email:e.email,publicKey:e.publicKey,metadata:t.metadata,type:"file"}));for(const t of a)for(const e of o.users)s.push(this.shareItem({uuid:t.uuid,parent:t.parent,email:e.email,publicKey:e.publicKey,metadata:t.metadata,type:"folder"}))}if(a.link){const n=[],o=[];if("file"===t)n.push({uuid:i,parent:e,metadata:r});else{o.push({uuid:i,parent:e,metadata:r}),c||(c=await this.getDirectoryTree({uuid:i}));for(const t in c){const e=c[t];e.uuid!==i&&"base"!==e.parent&&("file"===e.type?n.push({uuid:e.uuid,parent:e.parent,metadata:{name:e.name,size:e.size,mime:e.mime,key:e.key,lastModified:e.lastModified,creation:e.creation,hash:e.hash}}):o.push({uuid:e.uuid,parent:e.parent,metadata:{name:e.name}}))}}for(const t of n)for(const e of a.links)s.push(this.addItemToDirectoryPublicLink({uuid:t.uuid,parent:t.parent,metadata:t.metadata,type:"file",linkUUID:e.linkUUID,linkKeyEncrypted:e.linkKey,expiration:"never"}));for(const t of o)for(const e of a.links)s.push(this.addItemToDirectoryPublicLink({uuid:t.uuid,parent:t.parent,metadata:t.metadata,type:"folder",linkUUID:e.linkUUID,linkKeyEncrypted:e.linkKey,expiration:"never"}))}s.length>0&&await(0,n.promiseAllChunked)(s)}async renameSharedItem({uuid:t,receiverId:e,metadata:i,publicKey:r}){const n=await this.crypto.encrypt().metadataPublic({metadata:JSON.stringify(i),publicKey:r});await this.api.v3().item().sharedRename({uuid:t,receiverId:e,metadata:n})}async renamePubliclyLinkedItem({uuid:t,linkUUID:e,metadata:i,linkKeyEncrypted:r}){const n=await this.crypto.decrypt().folderLinkKey({metadata:r}),o=await this.crypto.encrypt().metadata({metadata:JSON.stringify(i),key:n});await this.api.v3().item().linkedRename({uuid:t,linkUUID:e,metadata:o})}async checkIfItemIsSharedForRename({uuid:t,itemMetadata:e}){const[i,r]=await Promise.all([this.api.v3().item().shared({uuid:t}),this.api.v3().item().linked({uuid:t})]);if(!i.sharing&&!r.link)return;const o=[];if(i.sharing)for(const r of i.users)o.push(this.renameSharedItem({uuid:t,receiverId:r.id,metadata:e,publicKey:r.publicKey}));if(r.link)for(const i of r.links)o.push(this.renamePubliclyLinkedItem({uuid:t,linkUUID:i.linkUUID,metadata:e,linkKeyEncrypted:i.linkKey}));o.length>0&&await(0,n.promiseAllChunked)(o)}async directorySize({uuid:t,sharerId:e,receiverId:i,trash:r}){return(await this.api.v3().dir().size({uuid:t,sharerId:e,receiverId:i,trash:r})).size}async directorySizePublicLink({uuid:t,linkUUID:e}){return(await this.api.v3().dir().sizeLink({uuid:t,linkUUID:e})).size}async downloadFileToLocal({uuid:t,bucket:e,region:i,chunks:r,version:a,key:l,abortSignal:f,pauseSignal:p,chunksStart:d,chunksEnd:m,to:y,onProgress:v,onQueued:g,onStarted:b,onError:w,onFinished:_}){if("node"!==o.environment)throw new Error(`cloud.downloadFileToLocal is not implemented for ${o.environment}`);g&&g(),await this._semaphores.downloads.acquire();try{b&&b();const o=m?m===1/0?r:m:r,g=d||0,S=this.sdkConfig.tmpPath?this.sdkConfig.tmpPath:c.default.tmpdir(),x=(0,n.normalizePath)(y||s.default.join(S,"filen-sdk",await(0,n.uuidv4)())),M=(0,n.normalizePath)(s.default.join(S,"filen-sdk",await(0,n.uuidv4)()));let E=g,k=!1;await Promise.all([u.default.rm(x,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),u.default.rm(M,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})]),await Promise.all([u.default.mkdir(s.default.dirname(x),{recursive:!0}),u.default.mkdir(M,{recursive:!0})]);const O=async()=>await new Promise((t=>{if(!p||!p.isPaused()||k||(null==f?void 0:f.aborted))return void t();const e=setInterval((()=>{(!p.isPaused()||k||(null==f?void 0:f.aborted))&&(clearInterval(e),t())}),10)})),C=async({index:t,file:e})=>{try{if(p&&p.isPaused()&&await O(),f&&f.aborted)throw new Error("Aborted");if(k)return;if(t!==E)return void setTimeout((()=>{C({index:t,file:e})}),10);t===g?await u.default.move(e,x,{overwrite:!0}):(await(0,h.default)({inputFile:e,baseFile:x}),await u.default.rm(e,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})),E+=1}finally{this._semaphores.downloadWriters.release()}};try{await new Promise(((r,n)=>{let c=0;for(let h=g;h{try{if(await Promise.all([this._semaphores.downloadThreads.acquire(),this._semaphores.downloadWriters.acquire()]),p&&p.isPaused()&&await O(),f&&f.aborted)throw new Error("Aborted");const m=s.default.join(M,`${h}.encrypted`);if(await this.api.v3().file().download().chunk().local({uuid:t,bucket:e,region:i,chunk:h,to:m,abortSignal:f,onProgress:v}),p&&p.isPaused()&&await O(),f&&f.aborted)throw new Error("Aborted");const y=s.default.join(M,`${h}.decrypted`);await this.crypto.decrypt().dataStream({inputFile:m,key:l,version:a,outputFile:y}),await u.default.rm(m,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),C({index:d,file:y}).catch((t=>{this._semaphores.downloadThreads.release(),this._semaphores.downloadWriters.release(),k=!0,n(t)})),c+=1,this._semaphores.downloadThreads.release(),c>=o&&r()}catch(t){throw this._semaphores.downloadThreads.release(),this._semaphores.downloadWriters.release(),k=!0,t}})().catch(n)}})),await new Promise((t=>{if(E>=o)return void t();const e=setInterval((()=>{E>=o&&(clearInterval(e),t())}),10)}))}catch(t){throw await u.default.rm(x,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),w&&w(t),t}finally{await u.default.rm(M,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})}return _&&_(),x}finally{this._semaphores.downloads.release()}}async downloadFileToReadableStream({uuid:t,bucket:e,region:i,chunks:r,version:n,key:o,abortSignal:a,pauseSignal:s,chunksStart:c,chunksEnd:u,onProgress:l,onQueued:h,onStarted:f,onError:p,onFinished:d}){h&&h(),await this._semaphores.downloads.acquire(),f&&f();const m=this._semaphores.downloadThreads,y=this._semaphores.downloadWriters,v=this._semaphores.downloads,g=this.api,b=this.crypto,w=u?u===1/0?r:u:r,_=c||0;let S=_,x=!1;const M=async()=>await new Promise((t=>{if(!s||!s.isPaused()||x||(null==a?void 0:a.aborted))return void t();const e=setInterval((()=>{(!s.isPaused()||x||(null==a?void 0:a.aborted))&&(clearInterval(e),t())}),10)}));return new ReadableStream({async start(r){const c=async({index:t,buffer:e})=>{try{if(s&&s.isPaused()&&await M(),a&&a.aborted)throw new Error("Aborted");if(x)return;if(t!==S)return void setTimeout((()=>{c({index:t,buffer:e})}),10);e.byteLength>0&&r.enqueue(e),S+=1}finally{y.release()}};try{await new Promise(((u,h)=>{let f=0;for(let p=_;p{try{if(await Promise.all([m.acquire(),y.acquire()]),s&&s.isPaused()&&await M(),a&&a.aborted)return r.close(),void h(new Error("Aborted"));const v=await g.v3().file().download().chunk().buffer({uuid:t,bucket:e,region:i,chunk:p,abortSignal:a,onProgress:l});if(s&&s.isPaused()&&await M(),a&&a.aborted)return r.close(),void h(new Error("Aborted"));s&&s.isPaused()&&await M();const _=await b.decrypt().data({data:v,key:o,version:n});c({index:d,buffer:_}).catch((t=>{m.release(),y.release(),r.close(),x=!0,h(t)})),f+=1,m.release(),f>=w&&u()}catch(t){throw m.release(),y.release(),r.close(),x=!0,t}})().catch(h)}})),await new Promise((t=>{if(S>=w)return void t();const e=setInterval((()=>{S>=w&&(clearInterval(e),t())}),10)}))}catch(t){throw p&&p(t),t}finally{r.close(),v.release()}d&&d()}},{highWaterMark:1048576})}async getDirectoryTree({uuid:t,type:e="normal",linkUUID:i,linkHasPassword:r,linkPassword:o,linkSalt:a,skipCache:s}){const c=await this.api.v3().dir().download({uuid:t,type:e,linkUUID:i,linkHasPassword:r,linkPassword:o,linkSalt:a,skipCache:s}),u={},l={base:"/"};for(const t of c.folders){const e="base"!==t.parent?await this.crypto.decrypt().folderMetadata({metadata:t.name}):{name:""},i=`${"base"===t.parent?"":`${l[t.parent]}/`}${e.name}`;l[t.uuid]=i,u[i]={type:"directory",uuid:t.uuid,name:e.name,parent:t.parent,size:0}}const h=[];for(const t of c.files)h.push(new Promise(((e,i)=>{this.crypto.decrypt().fileMetadata({metadata:t.metadata}).then((i=>{if(0===i.name.length)return void e();const r=l[t.parent];u[`${r}/${i.name}`]={type:"file",uuid:t.uuid,name:i.name,size:i.size,mime:i.mime,lastModified:(0,n.convertTimestampToMs)(i.lastModified),parent:t.parent,version:t.version,chunks:t.chunks,key:i.key,bucket:t.bucket,region:t.region,creation:i.creation,hash:i.hash},e()})).catch(i)})));return await(0,n.promiseAllChunked)(h),u}async downloadDirectoryToLocal({uuid:t,type:e="normal",linkUUID:i,linkHasPassword:r,linkPassword:a,linkSalt:l,to:h,abortSignal:f,pauseSignal:p,onQueued:d,onStarted:m,onError:y,onFinished:v,onProgress:g}){if("node"!==o.environment)throw new Error(`cloud.downloadDirectoryToLocal is not implemented for ${o.environment}`);d&&d(),await this._semaphores.directoryDownloads.acquire();let b=null;try{m&&m();const o=this.sdkConfig.tmpPath?this.sdkConfig.tmpPath:c.default.tmpdir();b=(0,n.normalizePath)(h||s.default.join(o,"filen-sdk",await(0,n.uuidv4)())),await u.default.rm(b,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),await u.default.mkdir(b,{recursive:!0});const d=await this.getDirectoryTree({uuid:t,type:e,linkUUID:i,linkHasPassword:r,linkPassword:a,linkSalt:l}),y=[];for(const t in d){const e=d[t];if("file"!==e.type)continue;const i=s.default.join(b,t);y.push(new Promise(((t,r)=>{this.downloadFileToLocal({uuid:e.uuid,bucket:e.bucket,region:e.region,chunks:e.chunks,version:e.version,key:e.key,abortSignal:f,pauseSignal:p,to:i,onProgress:g}).then((()=>t())).catch(r)})))}return await(0,n.promiseAllChunked)(y),v&&v(),b}catch(t){throw b&&await u.default.rm(b,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),y&&y(t),t}finally{this._semaphores.directoryDownloads.release()}}async uploadLocalFile({source:t,parent:e,pauseSignal:i,abortSignal:r,onProgress:a,onQueued:c,onStarted:l,onError:h,onFinished:d,onUploaded:m}){if("node"!==o.environment)throw new Error(`cloud.uploadFileFromLocal is not implemented for ${o.environment}`);c&&c(),await this._semaphores.uploads.acquire();try{if(l&&l(),t=(0,n.normalizePath)(t),!await u.default.exists(t))throw new Error(`Could not find source file at path ${t}.`);const c=await this.api.v3().dir().present({uuid:e});if(!c.present||c.trash)throw new Error(`Can not upload file to parent directory ${e}. Parent is either not present or in the trash.`);const h=s.default.basename(t);if("."===h||"/"===h||h.length<=0)throw new Error(`Invalid source file at path ${t}. Could not parse file name.`);const y=f.default.lookup(h)||"application/octet-stream",v=await u.default.stat(t);if(!v.isFile()||v.isDirectory()||v.isSymbolicLink()||v.isSocket()||v.isBlockDevice()||v.isCharacterDevice())throw new Error(`Invalid source file at path ${t}. Not a file.`);if(v.size<=0)throw new Error(`Invalid source file at path ${t}. 0 bytes.`);const g=v.size;let b=0,w=0;const _=parseInt(v.mtimeMs.toString()),S=parseInt(v.birthtimeMs.toString());let x=o.DEFAULT_UPLOAD_BUCKET,M=o.DEFAULT_UPLOAD_REGION;for(;bawait new Promise((t=>{if(!i||!i.isPaused()||(null==r?void 0:r.aborted))return void t();const e=setInterval((()=>{i.isPaused()&&!(null==r?void 0:r.aborted)||(clearInterval(e),t())}),10)}));await new Promise(((n,s)=>{let c=0;for(let u=0;u{try{if(await this._semaphores.uploadThreads.acquire(),i&&i.isPaused()&&await I(),r&&r.aborted)return void s(new Error("Aborted"));const u=await p.default.readLocalFileChunk({path:t,offset:l*o.UPLOAD_CHUNK_SIZE,length:o.UPLOAD_CHUNK_SIZE});if(i&&i.isPaused()&&await I(),r&&r.aborted)return void s(new Error("Aborted"));const h=await this.crypto.encrypt().data({data:u,key:k});if(i&&i.isPaused()&&await I(),r&&r.aborted)return void s(new Error("Aborted"));const f=await this.api.v3().file().upload().chunk().buffer({uuid:E,index:l,parent:e,uploadKey:C,abortSignal:r,buffer:h,onProgress:a});x=f.bucket,M=f.region,c+=1,this._semaphores.uploadThreads.release(),c>=w&&n()}catch(t){throw this._semaphores.uploadThreads.release(),t}})().catch(s)}}));const N=await this.api.v3().upload().done({uuid:E,name:A,nameHashed:R,size:j,chunks:w,mime:P,rm:O,metadata:T,version:o.CURRENT_FILE_ENCRYPTION_VERSION,uploadKey:C});w=N.chunks;const D={type:"file",uuid:E,name:h,size:g,mime:y,lastModified:_,timestamp:Date.now(),parent:e,rm:O,version:o.CURRENT_FILE_ENCRYPTION_VERSION,chunks:w,favorited:!1,key:k,bucket:x,region:M,creation:S};return await this.checkIfItemParentIsShared({type:"file",parent:e,uuid:E,itemMetadata:{name:h,size:g,mime:y,lastModified:_,creation:S,key:k}}),m&&await m.call(void 0,D),d&&d(),D}catch(t){throw h&&h(t),t}finally{this._semaphores.uploads.release()}}async uploadWebFile({file:t,parent:e,pauseSignal:i,abortSignal:r,onProgress:a,onQueued:s,onStarted:c,onError:u,onFinished:l,onUploaded:h}){if("browser"!==o.environment)throw new Error(`cloud.uploadWebFile is not implemented for ${o.environment}`);s&&s(),await this._semaphores.uploads.acquire();try{c&&c();const s=await this.api.v3().dir().present({uuid:e});if(!s.present||s.trash)throw new Error(`Can not upload file to parent directory ${e}. Parent is either not present or in the trash.`);const u=t.name,d=f.default.lookup(u)||"application/octet-stream",m=t.size;let y=0,v=0;const g=t.lastModified;let b=o.DEFAULT_UPLOAD_BUCKET,w=o.DEFAULT_UPLOAD_REGION;for(;yawait new Promise((t=>{if(!i||!i.isPaused()||(null==r?void 0:r.aborted))return void t();const e=setInterval((()=>{i.isPaused()&&!(null==r?void 0:r.aborted)||(clearInterval(e),t())}),10)}));await new Promise(((n,s)=>{let c=0;for(let u=0;u{try{if(await this._semaphores.uploadThreads.acquire(),i&&i.isPaused()&&await P(),r&&r.aborted)return void s(new Error("Aborted"));const u=await p.default.readWebFileChunk({file:t,index:l,length:o.UPLOAD_CHUNK_SIZE});if(i&&i.isPaused()&&await P(),r&&r.aborted)return void s(new Error("Aborted"));const h=await this.crypto.encrypt().data({data:u,key:S});if(i&&i.isPaused()&&await P(),r&&r.aborted)return void s(new Error("Aborted"));const f=await this.api.v3().file().upload().chunk().buffer({uuid:_,index:l,parent:e,uploadKey:M,abortSignal:r,buffer:h,onProgress:a});b=f.bucket,w=f.region,c+=1,this._semaphores.uploadThreads.release(),c>=v&&n()}catch(t){throw this._semaphores.uploadThreads.release(),t}})().catch(s)}}));const j=await this.api.v3().upload().done({uuid:_,name:E,nameHashed:A,size:O,chunks:v,mime:k,rm:x,metadata:C,version:o.CURRENT_FILE_ENCRYPTION_VERSION,uploadKey:M});v=j.chunks;const T={type:"file",uuid:_,name:u,size:m,mime:d,lastModified:g,timestamp:Date.now(),parent:e,rm:x,version:o.CURRENT_FILE_ENCRYPTION_VERSION,chunks:v,favorited:!1,key:S,bucket:b,region:w};return await this.checkIfItemParentIsShared({type:"file",parent:e,uuid:_,itemMetadata:{name:u,size:m,mime:d,lastModified:g,key:S}}),h&&await h.call(void 0,T),l&&l(),T}catch(t){throw u&&u(t),t}finally{this._semaphores.uploads.release()}}async uploadLocalDirectory({source:t,parent:e,pauseSignal:i,abortSignal:r,onProgress:a,onQueued:c,onStarted:l,onError:h,onFinished:f,onUploaded:p}){var d,m;if("node"!==o.environment)throw new Error(`cloud.uploadDirectoryFromLocal is not implemented for ${o.environment}`);c&&c(),await this._semaphores.directoryUploads.acquire();try{if(l&&l(),t=(0,n.normalizePath)(t),!await u.default.exists(t))throw new Error(`Could not find source directory at path ${t}.`);const o=await this.api.v3().dir().present({uuid:e});if(!o.present||o.trash)throw new Error(`Can not upload directory to parent directory ${e}. Parent is either not present or in the trash.`);const c=s.default.basename(t);if("."===c||"/"===c||c.length<=0)throw new Error(`Invalid source directory at path ${t}. Could not parse directory name.`);e=await this.createDirectory({name:c,parent:e});const h="\\"===s.default.sep?(await u.default.readdir(t,{recursive:!0})).map((t=>t.split("\\").join("/"))):await u.default.readdir(t,{recursive:!0}),y=h.sort(((t,e)=>t.split("/").length-e.split("/").length)),v=[],g={},b={};for(const e of h)v.push(new Promise(((i,r)=>{u.default.stat(s.default.join(t,e)).then((t=>{g[e]=t,i()})).catch(r)})));await(0,n.promiseAllChunked)(v);for(const t of y){const i=g[t];if(!i||!i.isDirectory()||i.isSymbolicLink()||i.isBlockDevice()||i.isCharacterDevice()||i.isSocket())continue;const r=s.default.posix.dirname(t),n="."===r||r.length<=0?e:null!==(d=b[r])&&void 0!==d?d:"";if(n.length<=16)continue;const o=s.default.posix.basename(t);if(o.length<=0)continue;const a=await this.createDirectory({name:o,parent:n});b[t]=a}const w=[];for(const n of y){const o=g[n];if(!o||!o.isFile()||o.size<=0||o.isSymbolicLink()||o.isBlockDevice()||o.isCharacterDevice()||o.isSocket())continue;const c=s.default.posix.dirname(n),u="."===c||c.length<=0?e:null!==(m=b[c])&&void 0!==m?m:"";u.length<=16||w.push(this.uploadLocalFile({source:s.default.join(t,n),parent:u,abortSignal:r,pauseSignal:i,onProgress:a,onUploaded:p}))}await(0,n.promiseAllChunked)(w),f&&f()}catch(t){throw h&&h(t),t}finally{this._semaphores.directoryUploads.release()}}async uploadDirectoryFromWeb({files:t,parent:e,pauseSignal:i,abortSignal:r,onProgress:a,onQueued:c,onStarted:u,onError:l,onFinished:h,onUploaded:f}){var p,d;if("browser"!==o.environment)throw new Error(`cloud.uploadDirectoryFromWeb is not implemented for ${o.environment}`);c&&c(),await this._semaphores.directoryUploads.acquire();try{u&&u();const o=[];let c=null;const l={};for(let e=0;e0&&(c=r[0].trim())}if(!c)throw new Error(`Can not upload directory to parent directory ${e}. Could not parse base directory name.`);const m=await this.api.v3().dir().present({uuid:e});if(!m.present||m.trash)throw new Error(`Can not upload directory to parent directory ${e}. Parent is either not present or in the trash.`);e=await this.createDirectory({name:c,parent:e}),l[c]=e;const y=o.map((t=>s.default.posix.dirname(t.path)));for(const t of y){const e=(0,n.getEveryPossibleDirectoryPath)(t);for(const t of e)y.includes(t)||y.push(t)}for(const t of y){const i=s.default.posix.dirname(t),r="."===i||i.length<=0?e:null!==(p=l[i])&&void 0!==p?p:"";if(r.length<=16)continue;const n=s.default.posix.basename(t);if(n.length<=0)continue;const o=await this.createDirectory({name:n,parent:r});l[t]=o}const v=[];for(const t of o){const n=s.default.posix.dirname(t.path),o="."===n||n.length<=0?e:null!==(d=l[n])&&void 0!==d?d:"";o.length<=16||v.push(this.uploadWebFile({file:t.file,parent:o,abortSignal:r,pauseSignal:i,onProgress:a,onUploaded:f}))}await(0,n.promiseAllChunked)(v),h&&h()}catch(t){throw l&&l(t),t}finally{this._semaphores.directoryUploads.release()}}}e.Cloud=d,e.default=d},13365:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PauseSignal=void 0;e.PauseSignal=class{constructor(){this.paused=!1,this.listeners=[]}pause(){this.paused=!0,this.listeners.forEach((t=>t()))}resume(){this.paused=!1}onPaused(t){this.listeners.push(t)}isPaused(){return this.paused}}},73247:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.readWebFileChunk=e.readLocalFileChunk=void 0;const o=i(78593),a=n(i(55674));function s({path:t,offset:e,length:i}){return new Promise(((n,s)=>{t=(0,o.normalizePath)(t),a.default.open(t,"r",((t,o)=>{if(t)return void s(t);const c=r.alloc(i);a.default.read(o,c,0,i,e,((t,e)=>{if(t)a.default.close(o,(e=>{s(t?e:t)}));else{let t;t=e{e?s(e):n(t)}))}}))}))}))}function c({file:t,index:e,length:i}){return new Promise(((n,o)=>{const a=new FileReader;a.onloadend=()=>{"string"!=typeof a.result&&null!==a.result?n(r.from(a.result)):n(r.from([]))},a.onerror=o;const s=i*e;a.readAsArrayBuffer(t.slice(s,s+i))}))}e.readLocalFileChunk=s,e.readWebFileChunk=c,e.utils={readLocalFileChunk:s,readWebFileChunk:c},e.default=e.utils},95601:(t,e,i)=>{"use strict";var r=i(34155);Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_CONCURRENT_DIRECTORY_DOWNLOADS=e.MAX_CONCURRENT_DIRECTORY_UPLOADS=e.MAX_CONCURRENT_UPLOADS=e.MAX_CONCURRENT_LISTING_OPS=e.MAX_NOTE_SIZE=e.UPLOAD_CHUNK_SIZE=e.DEFAULT_UPLOAD_BUCKET=e.DEFAULT_UPLOAD_REGION=e.CURRENT_FILE_ENCRYPTION_VERSION=e.MAX_UPLOAD_THREADS=e.MAX_DOWNLOAD_WRITERS=e.MAX_DOWNLOAD_THREADS=e.MAX_CONCURRENT_DOWNLOADS=e.BASE64_BUFFER_SIZE=e.BUFFER_SIZE=e.environment=void 0;const n="undefined"!=typeof window&&void 0!==window.document,o=void 0!==r&&null!==r.versions&&null!==r.versions.node,a=void 0!==i.g.nodeThread&&null!==i.g.nodeThread;e.environment=!n||o||a?!o||n||a?"reactNative":"node":"browser",e.BUFFER_SIZE=4096,e.BASE64_BUFFER_SIZE=3072,e.MAX_CONCURRENT_DOWNLOADS=32,e.MAX_DOWNLOAD_THREADS=128,e.MAX_DOWNLOAD_WRITERS=256,e.MAX_UPLOAD_THREADS=16,e.CURRENT_FILE_ENCRYPTION_VERSION=2,e.DEFAULT_UPLOAD_REGION="de-1",e.DEFAULT_UPLOAD_BUCKET="filen-1",e.UPLOAD_CHUNK_SIZE=1048576,e.MAX_NOTE_SIZE=1048575,e.MAX_CONCURRENT_LISTING_OPS=64,e.MAX_CONCURRENT_UPLOADS=8,e.MAX_CONCURRENT_DIRECTORY_UPLOADS=4,e.MAX_CONCURRENT_DIRECTORY_DOWNLOADS=8},59160:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Contacts=void 0;class i{constructor(t){this.api=t.api,this.sdkConfig=t.sdkConfig}async all(){return await this.api.v3().contacts().all()}async incomingRequests(){return await this.api.v3().contacts().requestsIn()}async incomingRequestsCount(){return await this.api.v3().contacts().requestsInCount()}async outgoingRequests(){return await this.api.v3().contacts().requestsOut()}async deleteOutgoingRequest({uuid:t}){await this.api.v3().contacts().requestsOutDelete({uuid:t})}async sendRequest({email:t}){await this.api.v3().contacts().requestsSend({email:t})}async acceptRequest({uuid:t}){await this.api.v3().contacts().requestsAccept({uuid:t})}async denyRequest({uuid:t}){await this.api.v3().contacts().requestsDeny({uuid:t})}async remove({uuid:t}){await this.api.v3().contacts().delete({uuid:t})}async blocked(){return await this.api.v3().contacts().blocked()}async block({email:t}){await this.api.v3().contacts().blockedAdd({email:t})}async unblock({uuid:t}){await this.api.v3().contacts().blockedDelete({uuid:t})}}e.Contacts=i,e.default=i},10547:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Decrypt=void 0;const o=i(95601),a=i(85612),s=n(i(55835)),c=i(78593),u=n(i(30078)),l=n(i(1679)),h=n(i(55674)),f=i(37717),p=i(42830),d=i(89539),m=n(i(81354)),y=i(63643),v=(0,d.promisify)(p.pipeline);class g{constructor(t){this.textDecoder=new TextDecoder,this._semaphores={metadata:new y.Semaphore(512),data:new y.Semaphore(256)},this.config=t}async metadata({metadata:t,key:e}){await this._semaphores.metadata.acquire();try{if("reactNative"===o.environment)return await globalThis.nodeThread.decryptMetadata({data:t,key:e});if("U2FsdGVk"===t.slice(0,8))return m.default.AES.decrypt(t,e).toString(m.default.enc.Utf8);{const n=t.slice(0,3);if("002"===n){const n=await(0,a.deriveKeyFromPassword)({password:e,salt:e,iterations:1,hash:"sha512",bitLength:256,returnHex:!1}),c=r.from(t.slice(3,15),"utf-8"),u=r.from(t.slice(15),"base64");if("node"===o.environment){const t=u.subarray(-16),e=u.subarray(0,u.byteLength-16),i=s.default.createDecipheriv("aes-256-gcm",n,c);return i.setAuthTag(t),r.concat([i.update(e),i.final()]).toString("utf-8")}if("browser"===o.environment){const t=await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:c},await(0,a.importRawKey)({key:e,algorithm:"AES-GCM",mode:["decrypt"]}),u);return r.from(t).toString("utf-8")}if("reactNative"===o.environment)return await i.g.nodeThread.decryptMetadata({data:t,key:e});throw new Error(`crypto.decrypt.metadata is not implemented for ${o.environment} environment`)}throw new Error(`[crypto.decrypt.metadata] Invalid metadata version ${n}`)}}finally{this._semaphores.metadata.release()}}async metadataPrivate({metadata:t,privateKey:e}){await this._semaphores.metadata.acquire();try{if("node"===o.environment){const i=await(0,a.derKeyToPem)({key:e});return s.default.privateDecrypt({key:i,padding:s.default.constants.RSA_PKCS1_OAEP_PADDING,oaepHash:"sha512"},r.from(t,"base64")).toString("utf-8")}if("browser"===o.environment){const i=await(0,a.importPrivateKey)({privateKey:e,mode:["decrypt"]}),n=await globalThis.crypto.subtle.decrypt({name:"RSA-OAEP"},i,r.from(t,"base64"));return this.textDecoder.decode(n)}if("reactNative"===o.environment)return await i.g.nodeThread.decryptMetadataPrivateKey({data:t,privateKey:e});throw new Error(`crypto.encrypt.metadataPrivate not implemented for ${o.environment} environment`)}finally{this._semaphores.metadata.release()}}async fileMetadata({metadata:t,key:e}){var i,r;const n=t;if(this.config.metadataCache&&u.default.fileMetadata.has(n))return u.default.fileMetadata.get(n);let o={name:"",size:0,mime:"application/octet-stream",key:"",lastModified:Date.now(),creation:void 0,hash:void 0};const a=e?[e]:this.config.masterKeys;for(const e of a)try{const a=JSON.parse(await this.metadata({metadata:t,key:e}));if(a&&"string"==typeof a.name&&a.name.length>0){o={size:parseInt(null!==(i=a.size)&&void 0!==i?i:0),lastModified:(0,c.convertTimestampToMs)(parseInt(null!==(r=a.lastModified)&&void 0!==r?r:Date.now())),creation:"number"==typeof a.creation?(0,c.convertTimestampToMs)(parseInt(a.creation)):void 0,name:a.name,key:a.key,mime:a.mime,hash:a.hash},this.config.metadataCache&&u.default.fileMetadata.set(n,o);break}}catch(t){continue}return o}async folderMetadata({metadata:t,key:e}){if("default"===t)return{name:"Default"};const i=t;if(this.config.metadataCache&&u.default.folderMetadata.has(i))return u.default.folderMetadata.get(i);let r={name:""};const n=e?[e]:this.config.masterKeys;for(const e of n)try{const n=JSON.parse(await this.metadata({metadata:t,key:e}));if(n&&"string"==typeof n.name&&n.name.length>0){r={name:n.name},this.config.metadataCache&&u.default.folderMetadata.set(i,r);break}}catch(t){continue}return r}async fileMetadataPrivate({metadata:t,key:e}){var i,r;const n=t;if(this.config.metadataCache&&u.default.fileMetadata.has(n))return u.default.fileMetadata.get(n);let o={name:"",size:0,mime:"application/octet-stream",key:"",lastModified:Date.now(),creation:void 0,hash:void 0};const a=e||this.config.privateKey,s=JSON.parse(await this.metadataPrivate({metadata:t,privateKey:a}));return s&&"string"==typeof s.name&&s.name.length>0&&(o={size:parseInt(null!==(i=s.size)&&void 0!==i?i:0),lastModified:(0,c.convertTimestampToMs)(parseInt(null!==(r=s.lastModified)&&void 0!==r?r:Date.now())),creation:"number"==typeof s.creation?(0,c.convertTimestampToMs)(parseInt(s.creation)):void 0,name:s.name,key:s.key,mime:s.mime,hash:s.hash},this.config.metadataCache&&u.default.fileMetadata.set(n,o)),o}async folderMetadataPrivate({metadata:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.folderMetadata.has(i))return u.default.folderMetadata.get(i);let r={name:""};const n=e||this.config.privateKey,o=JSON.parse(await this.metadataPrivate({metadata:t,privateKey:n}));return o&&"string"==typeof o.name&&o.name.length>0&&(r={name:o.name},this.config.metadataCache&&u.default.folderMetadata.set(i,r)),r}async fileMetadataLink({metadata:t,linkKey:e}){var i,r;const n=t;if(this.config.metadataCache&&u.default.fileMetadata.has(n))return u.default.fileMetadata.get(n);let o={name:"",size:0,mime:"application/octet-stream",key:"",lastModified:Date.now(),creation:void 0,hash:void 0};const a=JSON.parse(await this.metadata({metadata:t,key:e}));return a&&"string"==typeof a.name&&a.name.length>0&&(o={size:parseInt(null!==(i=a.size)&&void 0!==i?i:0),lastModified:(0,c.convertTimestampToMs)(parseInt(null!==(r=a.lastModified)&&void 0!==r?r:Date.now())),creation:"number"==typeof a.creation?(0,c.convertTimestampToMs)(parseInt(a.creation)):void 0,name:a.name,key:a.key,mime:a.mime,hash:a.hash},this.config.metadataCache&&u.default.fileMetadata.set(n,o)),o}async folderMetadataLink({metadata:t,linkKey:e}){const i=t;if(this.config.metadataCache&&u.default.folderMetadata.has(i))return u.default.folderMetadata.get(i);let r={name:""};const n=JSON.parse(await this.metadata({metadata:t,key:e}));if(n&&"string"==typeof n.name&&n.name.length>0&&(r={name:n.name},this.config.metadataCache&&u.default.folderMetadata.set(i,r)),0===r.name.length)throw new Error("Could not decrypt folder metadata (link) using given key.");return r}async folderLinkKey({metadata:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.folderLinkKey.has(i))return u.default.folderLinkKey.get(i);const r=e?[e]:this.config.masterKeys;for(const e of r)try{const r=JSON.parse(await this.metadata({metadata:t,key:e}));if("string"==typeof r&&r.length>0)return this.config.metadataCache&&u.default.folderLinkKey.set(i,r),r}catch(t){continue}throw new Error("Could not decrypt folder link key using given keys.")}async chatKey({metadata:t,privateKey:e}){const i=t;if(this.config.metadataCache&&u.default.chatKey.has(i))return u.default.chatKey.get(i);const r=await this.metadataPrivate({metadata:t,privateKey:e}),n=JSON.parse(r);if("string"!=typeof n.key)throw new Error("Could not decrypt chat key, malformed decrypted metadata");return this.config.metadataCache&&u.default.chatKey.set(i,n.key),n.key}async chatMessage({message:t,key:e}){const i=await this.metadata({metadata:t,key:e}),r=JSON.parse(i);if("string"!=typeof r.message)throw new Error("Could not decrypt chat message, malformed decrypted metadata");return r.message}async noteKeyOwner({metadata:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.noteKeyOwner.has(i))return u.default.noteKeyOwner.get(i);const r=e?[e]:this.config.masterKeys;for(const e of r)try{const r=JSON.parse(await this.metadata({metadata:t,key:e}));if(r&&"string"==typeof r.key&&r.key.length>0)return this.config.metadataCache&&u.default.noteKeyOwner.set(i,r.key),r.key}catch(t){continue}throw new Error("Could not decrypt note key (owner) using given metadata and keys")}async noteKeyParticipant({metadata:t,privateKey:e}){const i=t;if(this.config.metadataCache&&u.default.noteKeyParticipant.has(i))return u.default.noteKeyParticipant.get(i);const r=await this.metadataPrivate({metadata:t,privateKey:e}),n=JSON.parse(r);if("string"!=typeof n.key)throw new Error("Could not decrypt note key of participant, malformed decrypted metadata");return this.config.metadataCache&&u.default.noteKeyParticipant.set(i,n.key),n.key}async noteContent({content:t,key:e}){const i=await this.metadata({metadata:t,key:e}),r=JSON.parse(i);if("string"!=typeof r.content)throw new Error("Could not decrypt note content, malformed decrypted metadata");return r.content}async noteTitle({title:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.noteTitle.has(i))return u.default.noteTitle.get(i);const r=await this.metadata({metadata:t,key:e}),n=JSON.parse(r);if("string"!=typeof n.title)throw new Error("Could not decrypt note title, malformed decrypted metadata");return this.config.metadataCache&&u.default.noteTitle.set(i,n.title),n.title}async notePreview({preview:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.notePreview.has(i))return u.default.notePreview.get(i);const r=await this.metadata({metadata:t,key:e}),n=JSON.parse(r);if("string"!=typeof n.preview)throw new Error("Could not decrypt note preview, malformed decrypted metadata");return this.config.metadataCache&&u.default.notePreview.set(i,n.preview),n.preview}async noteTagName({name:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.noteTagName.has(i))return u.default.noteTagName.get(i);const r=e?[e]:this.config.masterKeys;for(const e of r)try{const r=JSON.parse(await this.metadata({metadata:t,key:e}));if(r&&"string"==typeof r.name&&r.name.length>0)return this.config.metadataCache&&u.default.noteTagName.set(i,r.name),r.name}catch(t){continue}throw new Error("Could not decrypt note tag name using given metadata and keys")}async chatConversationName({name:t,key:e}){const i=t;if(this.config.metadataCache&&u.default.chatConversationName.has(i))return u.default.chatConversationName.get(i);const r=await this.metadata({metadata:t,key:e}),n=JSON.parse(r);if("string"!=typeof n.name)throw new Error("Could not decrypt chat conversation name, malformed decrypted metadata");return this.config.metadataCache&&u.default.chatConversationName.set(i,n.name),n.name}async data({data:t,key:e,version:n}){await this._semaphores.data.acquire();try{if("node"===o.environment){if(1===n){const i=r.from(t.subarray(0,16)),n=i.toString("ascii"),o=i.toString("base64"),c=i.toString("utf-8");let u=!0,l=!0;if((n.startsWith("Salted_")||o.startsWith("Salted_")||c.startsWith("Salted_"))&&(u=!1),(n.startsWith("Salted_")||o.startsWith("Salted_")||c.startsWith("U2FsdGVk")||n.startsWith("U2FsdGVk")||c.startsWith("Salted_")||o.startsWith("U2FsdGVk"))&&(l=!1),u&&!l&&(t=r.from(this.textDecoder.decode(t),"base64")),l){const i=r.from(e,"utf-8"),n=i.subarray(0,16),o=s.default.createDecipheriv("aes-256-cbc",i,n);return r.concat([o.update(t),o.final()])}{const i=r.from(t.subarray(8,16)),{key:n,iv:o}=(0,a.EVP_BytesToKey)({password:r.from(e,"utf-8"),salt:i,keyBits:256,ivLength:16}),c=s.default.createDecipheriv("aes-256-cbc",n,o),u=t.subarray(16);return r.concat([c.update(u),c.final()])}}if(2===n){const i=t.subarray(0,12),n=t.subarray(12),o=n.subarray(-16),a=n.subarray(0,n.byteLength-16),c=s.default.createDecipheriv("aes-256-gcm",r.from(e,"utf-8"),i);return c.setAuthTag(o),r.concat([c.update(a),c.final()])}}else if("browser"===o.environment){if(1===n){const i=r.from(t.subarray(0,16)),n=i.toString("ascii"),o=i.toString("base64"),s=i.toString("utf-8");let c=!0,u=!0;if((n.startsWith("Salted_")||o.startsWith("Salted_")||s.startsWith("Salted_"))&&(c=!1),(n.startsWith("Salted_")||o.startsWith("Salted_")||s.startsWith("U2FsdGVk")||n.startsWith("U2FsdGVk")||s.startsWith("Salted_")||o.startsWith("U2FsdGVk"))&&(u=!1),c&&!u&&(t=r.from(this.textDecoder.decode(t),"base64")),u){const i=r.from(e,"utf-8").subarray(0,16),n=await globalThis.crypto.subtle.decrypt({name:"AES-CBC",iv:i},await(0,a.importRawKey)({key:e,algorithm:"AES-CBC",mode:["decrypt"]}),t);return r.from(n)}{const i=r.from(t.subarray(8,16)),{key:n,iv:o}=(0,a.EVP_BytesToKey)({password:r.from(e,"utf-8"),salt:i,keyBits:256,ivLength:16}),s=await globalThis.crypto.subtle.decrypt({name:"AES-CBC",iv:o},await(0,a.importRawKey)({key:n.toString("utf-8"),algorithm:"AES-GCM",mode:["decrypt"]}),t.subarray(16));return r.from(s)}}if(2===n){const i=t.subarray(0,12),n=t.subarray(12),o=await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:i},await(0,a.importRawKey)({key:e,algorithm:"AES-GCM",mode:["decrypt"]}),n);return r.from(o)}}else if("reactNative"===o.environment)return r.from(await i.g.nodeThread.decryptData({base64:r.from(t).toString("base64"),key:e,version:n}));throw new Error(`crypto.decrypt.data not implemented for ${o.environment} environment`)}finally{this._semaphores.data.release()}}async dataStream({inputFile:t,key:e,version:i,outputFile:n}){await this._semaphores.data.acquire();try{if("node"!==o.environment)throw new Error(`crypto.decrypt.dataStream not implemented for ${o.environment} environment`);let u=(0,c.normalizePath)(t);const p=(0,c.normalizePath)(n||l.default.join(this.config.tmpPath,await(0,c.uuidv4)()));if(!await h.default.exists(u))throw new Error("Input file does not exist.");await h.default.rm(p,{force:!0,maxRetries:600,recursive:!0,retryDelay:100});const d=await h.default.stat(u);if(d.size<(1===i?17:13))throw new Error(`Input file size too small: ${d.size}.`);let m,y=await h.default.open(u,h.default.constants.R_OK),g=0,b=0,w=0;try{if(1===i){const t=r.alloc(16);if(await h.default.read(y,t,0,16,0),0===t.byteLength)throw new Error("Could not read input file.");const i=t.toString("ascii"),n=t.toString("base64"),o=t.toString("utf-8");let d=!0,v=!0;if((i.startsWith("Salted_")||n.startsWith("Salted_")||o.startsWith("Salted_"))&&(d=!1),(i.startsWith("Salted_")||n.startsWith("Salted_")||o.startsWith("U2FsdGVk")||i.startsWith("U2FsdGVk")||o.startsWith("Salted_")||n.startsWith("U2FsdGVk"))&&(v=!1),d&&!v){const t=l.default.join(l.default.dirname(p),await(0,c.uuidv4)());await h.default.rm(t,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),await h.default.close(y);const e=`${u}`;u=await(0,f.streamDecodeBase64)({inputFile:u,outputFile:t}),y=await h.default.open(u,h.default.constants.R_OK),await h.default.rm(e,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})}if(v){const t=r.from(e,"utf-8"),i=t.subarray(0,16);m=s.default.createDecipheriv("aes-256-cbc",t,i),g=0,b=0}else{const t=r.alloc(8);await h.default.read(y,t,0,8,8);const{key:i,iv:n}=(0,a.EVP_BytesToKey)({password:r.from(e,"utf-8"),salt:t,keyBits:256,ivLength:16});m=s.default.createDecipheriv("aes-256-cbc",i,n),g=16,b=0}}else{if(2!==i)throw new Error(`Invalid FileEncryptionVersion: ${i}`);{const t=r.from(e,"utf-8"),i=r.alloc(12),n=r.alloc(16),o=await h.default.stat(u);if(await Promise.all([h.default.read(y,i,0,12,0),h.default.read(y,n,0,16,o.size-16)]),0===i.byteLength||0===n.byteLength)throw new Error("Could not read input file.");m=s.default.createDecipheriv("aes-256-gcm",t,i).setAuthTag(n),g=12,b=16,w=o.size}}}finally{await h.default.close(y)}const _=h.default.createReadStream((0,c.normalizePath)(u),{highWaterMark:o.BUFFER_SIZE,end:w>0&&b>0?w-b-1:1/0,start:g}),S=h.default.createWriteStream((0,c.normalizePath)(p));return await v(_,m,S),p}finally{this._semaphores.data.release()}}}e.Decrypt=g,e.default=g},36947:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Encrypt=void 0;const o=i(95601),a=n(i(55835)),s=i(85612),c=i(78593),u=n(i(1679)),l=n(i(55674)),h=i(42830),f=i(89539),p=i(63643),d=(0,f.promisify)(h.pipeline);class m{constructor(t){this.textEncoder=new TextEncoder,this._semaphores={metadata:new p.Semaphore(512),data:new p.Semaphore(256)},this.config=t}async metadata({metadata:t,key:e,derive:n=!0}){await this._semaphores.metadata.acquire();try{const c=e||this.config.masterKeys[this.config.masterKeys.length-1];if("reactNative"===o.environment)return await i.g.nodeThread.encryptMetadata({data:t,key:c});const u=await(0,s.generateRandomString)({length:12}),l=this.textEncoder.encode(u);if("node"===o.environment){const e=n?await(0,s.deriveKeyFromPassword)({password:c,salt:c,iterations:1,hash:"sha512",bitLength:256,returnHex:!1}):this.textEncoder.encode(c),i=this.textEncoder.encode(t),o=a.default.createCipheriv("aes-256-gcm",e,l),h=r.concat([o.update(i),o.final()]),f=o.getAuthTag();return`002${u}${r.concat([h,f]).toString("base64")}`}if("browser"===o.environment){const e=n?await(0,s.deriveKeyFromPassword)({password:c,salt:c,iterations:1,hash:"sha512",bitLength:256,returnHex:!0}):c,i=this.textEncoder.encode(t),o=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:l},await(0,s.importRawKey)({key:e,algorithm:"AES-GCM",mode:["encrypt"],keyCache:!1}),i);return`002${u}${r.from(o).toString("base64")}`}if("reactNative"===o.environment)return await i.g.nodeThread.encryptMetadata({data:t,key:c});throw new Error(`crypto.encrypt.metadata not implemented for ${o.environment} environment`)}finally{this._semaphores.metadata.release()}}async metadataPublic({metadata:t,publicKey:e}){await this._semaphores.metadata.acquire();try{if("node"===o.environment){const i=await(0,s.derKeyToPem)({key:e}),n=a.default.publicEncrypt({key:i,padding:a.default.constants.RSA_PKCS1_OAEP_PADDING,oaepHash:"sha512"},this.textEncoder.encode(t));return r.from(n).toString("base64")}if("browser"===o.environment){const i=await(0,s.importPublicKey)({publicKey:e,mode:["encrypt"]}),n=await globalThis.crypto.subtle.encrypt({name:"RSA-OAEP"},i,this.textEncoder.encode(t));return r.from(n).toString("base64")}if("reactNative"===o.environment)return await i.g.nodeThread.encryptMetadataPublicKey({data:t,publicKey:e});throw new Error(`crypto.encrypt.metadataPublic not implemented for ${o.environment} environment`)}finally{this._semaphores.metadata.release()}}async chatMessage({message:t,key:e}){return await this.metadata({metadata:JSON.stringify({message:t}),key:e})}async noteContent({content:t,key:e}){return await this.metadata({metadata:JSON.stringify({content:t}),key:e})}async noteTitle({title:t,key:e}){return await this.metadata({metadata:JSON.stringify({title:t}),key:e})}async notePreview({preview:t,key:e}){return await this.metadata({metadata:JSON.stringify({preview:t}),key:e})}async noteTagName({name:t,key:e}){const i=e||this.config.masterKeys[this.config.masterKeys.length-1];return await this.metadata({metadata:JSON.stringify({name:t}),key:i})}async chatConversationName({name:t,key:e}){return await this.metadata({metadata:JSON.stringify({name:t}),key:e})}async data({data:t,key:e}){await this._semaphores.data.acquire();try{const n=await(0,s.generateRandomString)({length:12});if("node"===o.environment){const i=r.from(n,"utf-8"),o=a.default.createCipheriv("aes-256-gcm",r.from(e,"utf-8"),i),s=r.concat([o.update(t),o.final()]),c=o.getAuthTag(),u=r.concat([s,c]);return r.concat([i,u])}if("browser"===o.environment){const i=await globalThis.crypto.subtle.encrypt({name:"AES-GCM",iv:this.textEncoder.encode(n)},await(0,s.importRawKey)({key:e,algorithm:"AES-GCM",mode:["encrypt"],keyCache:!1}),t);return r.concat([this.textEncoder.encode(n),new Uint8Array(i)])}if("reactNative"===o.environment)return r.from(await i.g.nodeThread.encryptData({base64:r.from(t).toString("base64"),key:e}));throw new Error(`crypto.decrypt.data not implemented for ${o.environment} environment`)}finally{this._semaphores.data.release()}}async dataStream({inputFile:t,key:e,outputFile:i}){await this._semaphores.data.acquire();try{if("node"!==o.environment)throw new Error(`crypto.encrypt.dataStream not implemented for ${o.environment} environment`);const n=(0,c.normalizePath)(t),h=(0,c.normalizePath)(i||u.default.join(this.config.tmpPath,await(0,c.uuidv4)()));if(!await l.default.exists(n))throw new Error("Input file does not exist.");await l.default.rm(h,{force:!0,maxRetries:600,recursive:!0,retryDelay:100});const f=await(0,s.generateRandomString)({length:12}),p=r.from(f,"utf-8"),m=a.default.createCipheriv("aes-256-gcm",r.from(e,"utf-8"),p),y=l.default.createReadStream((0,c.normalizePath)(n),{highWaterMark:o.BUFFER_SIZE}),v=l.default.createWriteStream((0,c.normalizePath)(h));await new Promise(((t,e)=>{v.write(p,(i=>{i?e(i):t()}))})),await d(y,m,v);const g=m.getAuthTag();return await l.default.appendFile(h,g),h}finally{this._semaphores.data.release()}}}e.Encrypt=m,e.default=m},27633:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Crypto=void 0;const n=r(i(36947)),o=r(i(10547)),a=r(i(85612));class s{constructor(t){this.utils=a.default,this.config=t,this._encrypt=new n.default(this.config),this._decrypt=new o.default(this.config)}encrypt(){return this._encrypt}decrypt(){return this._decrypt}}e.Crypto=s,e.default=s},85612:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.EVP_BytesToKey=e.generateKeyPair=e.bufferToHash=e.importPBKDF2Key=e.importRawKey=e.importPrivateKey=e.importPublicKey=e.derKeyToPem=e.generatePasswordAndMasterKeyBasedOnAuthVersion=e.hashPassword=e.normalizeHash=e.hashFn=e.deriveKeyFromPassword=e.generateRandomString=void 0;const o=i(95601),a=n(i(55835)),s=n(i(58292)),c=n(i(37035)),u=n(i(30078)),l=new TextEncoder;async function h({length:t}){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";if("node"===o.environment){const i=a.default.randomBytes(t),r=new Array(t);let n=0;for(let o=0;ot%62)).map((t=>e[t])).join("")}if("reactNative"===o.environment)return await i.g.nodeThread.generateRandomString({charLength:t});throw new Error(`crypto.utils.generateRandomString not implemented for ${o.environment} environment`)}async function f({password:t,salt:e,iterations:n,hash:s,bitLength:c,returnHex:u}){if("node"===o.environment)return await new Promise(((i,o)=>{a.default.pbkdf2(t,e,n,c/8,s,((t,e)=>{t?o(t):i(u?r.from(e).toString("hex"):e)}))}));if("browser"===o.environment){const i=await globalThis.crypto.subtle.deriveBits({name:"PBKDF2",salt:l.encode(e),iterations:n,hash:{name:"sha512"===s?"SHA-512":s}},await w({key:t,mode:["deriveBits"]}),c);return u?r.from(i).toString("hex"):r.from(i)}if("reactNative"===o.environment)return await i.g.nodeThread.deriveKeyFromPassword({password:t,salt:e,iterations:n,hash:s,bitLength:c,returnHex:u});throw new Error(`crypto.utils.deriveKeyFromPassword not implemented for ${o.environment} environment`)}async function p({input:t}){if("node"===o.environment)return a.default.createHash("sha1").update(a.default.createHash("sha512").update(l.encode(t)).digest("hex")).digest("hex");if("browser"===o.environment)return r.from(await globalThis.crypto.subtle.digest("SHA-1",await globalThis.crypto.subtle.digest("SHA-512",l.encode(t)))).toString("hex");if("reactNative"===o.environment)return await i.g.nodeThread.hashFn({string:t});throw new Error(`crypto.utils.hashFn not implemented for ${o.environment} environment`)}async function d({password:t}){if("node"===o.environment){const e=l.encode(t);return a.default.createHash("sha512").update(a.default.createHash("sha384").update(a.default.createHash("sha256").update(e).digest("hex")).digest("hex")).digest("hex")+a.default.createHash("sha512").update(a.default.createHash("md5").update(a.default.createHash("md4").update(e).digest("hex")).digest("hex")).digest("hex")}if("browser"===o.environment)return s.default.hash("sha512",s.default.hash("sha384",s.default.hash("sha256",s.default.hash("sha1",t))))+s.default.hash("sha512",s.default.hash("md5",s.default.hash("md4",s.default.hash("md2",t))));if("reactNative"===o.environment)return await i.g.nodeThread.hashPassword({password:t});throw new Error(`crypto.utils.hashPassword not implemented for ${o.environment} environment`)}async function m({rawPassword:t,authVersion:e,salt:i}){if(1===e){const e=await d({password:t});return{derivedMasterKeys:await p({input:t}),derivedPassword:e}}if(2===e){const e=await f({password:t,salt:i,iterations:2e5,hash:"sha512",bitLength:512,returnHex:!0});let n=e.substring(e.length/2,e.length);const c=e.substring(0,e.length/2);if("node"===o.environment)n=a.default.createHash("sha512").update(l.encode(n)).digest("hex");else if("browser"===o.environment)n=r.from(await globalThis.crypto.subtle.digest("SHA-512",l.encode(n))).toString("hex");else{if("reactNative"!==o.environment)throw new Error(`crypto.utils.generatePasswordAndMasterKeysBasedOnAuthVersion not implemented for ${o.environment} environment`);n=s.default.hash("sha512",n)}return{derivedMasterKeys:c,derivedPassword:n}}throw new Error(`Invalid authVersion: ${e}`)}async function y({key:t}){const e=new c.default.Key("der",r.from(t,"base64"));return(await e.export("pem")).toString()}async function v({publicKey:t,mode:e=["encrypt"],keyCache:i=!0}){if("browser"!==o.environment)throw new Error(`crypto.utils.importPublicKey not implemented for ${o.environment} environment`);const n=`${t}:${e.join(":")}`;if(u.default.importPublicKey.has(n))return u.default.importPublicKey.get(n);const a=await globalThis.crypto.subtle.importKey("spki",r.from(t,"base64"),{name:"RSA-OAEP",hash:"SHA-512"},!0,e);return i&&u.default.importPublicKey.set(n,a),a}async function g({privateKey:t,mode:e=["encrypt"],keyCache:i=!0}){if("browser"!==o.environment)throw new Error(`crypto.utils.importPrivateKey not implemented for ${o.environment} environment`);const n=`${t}:${e.join(":")}`;if(u.default.importPrivateKey.has(n))return u.default.importPrivateKey.get(n);const a=await globalThis.crypto.subtle.importKey("pkcs8",r.from(t,"base64"),{name:"RSA-OAEP",hash:"SHA-512"},!0,e);return i&&u.default.importPrivateKey.set(n,a),a}async function b({key:t,algorithm:e,mode:i=["encrypt"],keyCache:r=!0}){if("browser"!==o.environment)throw new Error(`crypto.utils.importRawKey not implemented for ${o.environment} environment`);const n=`${t}:${e}:${i.join(":")}`;if(u.default.importRawKey.has(n))return u.default.importRawKey.get(n);const a=await globalThis.crypto.subtle.importKey("raw",l.encode(t),e,!1,i);return r&&u.default.importRawKey.set(n,a),a}async function w({key:t,mode:e=["encrypt"],keyCache:i=!0}){if("browser"!==o.environment)throw new Error(`crypto.utils.importPBKDF2Key not implemented for ${o.environment} environment`);const r=`${t}:${e.join(":")}`;if(u.default.importPBKDF2Key.has(r))return u.default.importPBKDF2Key.get(r);const n=await globalThis.crypto.subtle.importKey("raw",l.encode(t),{name:"PBKDF2"},!1,e);return i&&u.default.importPBKDF2Key.set(r,n),n}async function _({buffer:t,algorithm:e}){if("node"===o.environment)return a.default.createHash(e).update(t).digest("hex");if("browser"===o.environment){const i="sha512"===e?"SHA-512":"sha256"===e?"SHA-256":"MD-5",n=await globalThis.crypto.subtle.digest(i,t);return r.from(n).toString("hex")}throw new Error(`crypto.utils.bufferToHash not implemented for ${o.environment} environment`)}async function S(){if("node"===o.environment)return await new Promise(((t,e)=>{a.default.generateKeyPair("rsa",{modulusLength:4096,publicKeyEncoding:{type:"spki",format:"der"},privateKeyEncoding:{type:"pkcs8",format:"der"},publicExponent:65537},((i,r,n)=>{i?e(i):t({publicKey:r.toString("base64"),privateKey:n.toString("base64")})}))}));if("browser"===o.environment){const t=await globalThis.crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-512"},!0,["encrypt","decrypt"]),e=await globalThis.crypto.subtle.exportKey("spki",t.publicKey),i=await globalThis.crypto.subtle.exportKey("pkcs8",t.privateKey);return{publicKey:r.from(e).toString("base64"),privateKey:r.from(i).toString("base64")}}if("reactNative"===o.environment)return await i.g.nodeThread.generateKeypair();throw new Error(`crypto.utils.generateKeyPair not implemented for ${o.environment} environment`)}e.generateRandomString=h,e.deriveKeyFromPassword=f,e.hashFn=p,e.normalizeHash=function({hash:t}){const e=t.toLowerCase();return"sha-512"===e?"sha512":"sha-256"===e?"sha256":"sha-384"===e?"sha384":"sha-1"===e?"sha1":"md-2"===e?"md2":"md-4"===e?"md4":"md-5"===e?"md5":t},e.hashPassword=d,e.generatePasswordAndMasterKeyBasedOnAuthVersion=m,e.derKeyToPem=y,e.importPublicKey=v,e.importPrivateKey=g,e.importRawKey=b,e.importPBKDF2Key=w,e.bufferToHash=_,e.generateKeyPair=S,e.EVP_BytesToKey=function({password:t,salt:e,keyBits:i,ivLength:n}){let o=i/8;const s=r.alloc(o),c=r.alloc(n||0);let u=r.alloc(0);for(;o>0||n>0;){const i=a.default.createHash("md5");i.update(u),i.update(t),e&&i.update(e),u=i.digest();let r=0;if(o>0){const t=s.length-o;r=Math.min(o,u.length),u.copy(s,t,0,r),o-=r}if(r0){const t=c.length-n,e=Math.min(n,u.length-r);u.copy(c,t,r,r+e),n-=e}}return u.fill(0),{key:s,iv:c}},e.utils={generateRandomString:h,deriveKeyFromPassword:f,hashFn:p,generatePasswordAndMasterKeyBasedOnAuthVersion:m,hashPassword:d,derKeyToPem:y,importPublicKey:v,importPrivateKey:g,bufferToHash:_,generateKeyPair:S,importRawKey:b,importPBKDF2Key:w},e.default=e.utils},25357:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ENOENT=void 0;class i extends Error{constructor({path:t}){super(`ENOENT: no such file or directory, open '${t}'`),this.name="FileNotFoundError",this.code="ENOENT",this.errno=-2,this.syscall="open",this.path=t,Error.captureStackTrace&&Error.captureStackTrace(this,i)}}e.ENOENT=i},80939:function(t,e,i){"use strict";var r=i(99649),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FS=void 0;const o=n(i(1679)),a=i(25357),s=i(95601),c=n(i(55674)),u=i(78593),l=n(i(67435)),h=i(63643);class f{constructor(t){this._pathToItemUUIDMutex=new h.Semaphore(1),this._readdirMutex=new h.Semaphore(1),this.api=t.api,this.crypto=t.crypto,this.sdkConfig=t.sdkConfig,this.cloud=t.cloud,this._items={"/":{uuid:this.sdkConfig.baseFolderUUID,type:"directory",metadata:{name:"Cloud Drive"}}}}normalizePath({path:t}){return(t=o.default.posix.normalize(t.trim())).endsWith("/")&&(t=t.substring(0,t.length-1)),t.startsWith("/")||(t="/"+t),t}async pathToItemUUID({path:t,type:e}){const i=e?"directory"===e?["directory"]:["file"]:["directory","file"];if("/"===(t=this.normalizePath({path:t})))return this.sdkConfig.baseFolderUUID;if(this._items[t])return this._items[t].uuid;await this._pathToItemUUIDMutex.acquire();try{const e=t.split("/");let r="/";for(const n of e){if(e.length<=0)continue;r=o.default.posix.join(r,n);const a=o.default.posix.dirname(r);if(!this._items[a])return null;const s=await this.cloud.listDirectory({uuid:this._items[a].uuid});let c="",u=null;for(const e of s){const i=o.default.posix.join(a,e.name);i===t&&(c=e.uuid,u=e.type),"directory"===e.type?this._items[i]={uuid:e.uuid,type:"directory",metadata:{name:e.name}}:this._items[i]={uuid:e.uuid,type:"file",metadata:{name:e.name,size:e.size,mime:e.mime,key:e.key,lastModified:e.lastModified,chunks:e.chunks,region:e.region,bucket:e.bucket,version:e.version}}}if(u&&c.length>0&&i.includes(u))return c}return this._items[t]&&i.includes(this._items[t].type)?this._items[t].uuid:null}finally{this._pathToItemUUIDMutex.release()}}async readdir({path:t,recursive:e=!1}){await this._readdirMutex.acquire();try{t=this.normalizePath({path:t});const i=await this.pathToItemUUID({path:t});if(!i)throw new a.ENOENT({path:t});const r=[];if(e){const e=await this.cloud.getDirectoryTree({uuid:i});for(const i in e){const n=e[i],a=i.startsWith("/")?i.substring(1):i;if("base"===n.parent)continue;const s=o.default.posix.join(t,a);r.push(a),"directory"===n.type?this._items[s]={uuid:n.uuid,type:"directory",metadata:{name:n.name}}:this._items[s]={uuid:n.uuid,type:"file",metadata:{name:n.name,size:n.size,mime:n.mime,key:n.key,lastModified:n.lastModified,chunks:n.chunks,region:n.region,bucket:n.bucket,version:n.version}}}return r}const n=await this.cloud.listDirectory({uuid:i});for(const e of n){const i=o.default.posix.join(t,e.name);r.push(e.name),"directory"===e.type?this._items[i]={uuid:e.uuid,type:"directory",metadata:{name:e.name}}:this._items[i]={uuid:e.uuid,type:"file",metadata:{name:e.name,size:e.size,mime:e.mime,key:e.key,lastModified:e.lastModified,chunks:e.chunks,region:e.region,bucket:e.bucket,version:e.version}}}return r}finally{this._readdirMutex.release()}}async ls(...t){return await this.readdir(...t)}async stat({path:t}){var e;t=this.normalizePath({path:t});const i=await this.pathToItemUUID({path:t});if(!i)throw new a.ENOENT({path:t});const r=this._items[t];if(!r)throw new a.ENOENT({path:t});return"file"===r.type?Object.assign(Object.assign({},r.metadata),{uuid:i,size:r.metadata.size,mtimeMs:r.metadata.lastModified,birthtimeMs:null!==(e=r.metadata.creation)&&void 0!==e?e:0,type:"file",isDirectory:()=>!1,isFile:()=>!0,isSymbolicLink:()=>!1}):Object.assign(Object.assign({},r.metadata),{uuid:i,size:0,mtimeMs:0,birthtimeMs:0,type:"directory",isDirectory:()=>!0,isFile:()=>!1,isSymbolicLink:()=>!1})}async lstat(...t){return await this.stat(...t)}async mkdir({path:t}){if("/"===(t=this.normalizePath({path:t})))return;if(await this.pathToItemUUID({path:t}))return;const e=o.default.posix.dirname(t),i=o.default.posix.basename(t);if("/"===e||"."===e||""===e){const e=await this.cloud.createDirectory({name:i,parent:this.sdkConfig.baseFolderUUID});return void(this._items[t]={uuid:e,type:"directory",metadata:{name:i}})}const r=t.split("/");let n="/";for(const t of r)if(!(r.length<=0||(n=o.default.posix.join(n,t),this._items[n]))){const t=o.default.posix.basename(n),e=o.default.posix.dirname(n),i=this._items[e];if(!i)continue;const r="/"===e||"."===e||""===e?this.sdkConfig.baseFolderUUID:i.uuid,a=await this.cloud.createDirectory({name:t,parent:r});this._items[n]={uuid:a,type:"directory",metadata:{name:t}}}if(!this._items[t])throw new a.ENOENT({path:t})}async rename({from:t,to:e}){if(t=this.normalizePath({path:t}),e=this.normalizePath({path:e}),"/"===t||t===e)return;const i=await this.pathToItemUUID({path:t}),r=this._items[t];if(!i||!r)throw new a.ENOENT({path:t});const n=o.default.posix.dirname(t),s=o.default.posix.dirname(e),c=o.default.posix.basename(e),u=o.default.posix.basename(t);if(s===n){if("/"===e||c.length<=0)return;"directory"===r.type?await this.cloud.renameDirectory({uuid:i,name:c}):await this.cloud.renameFile({uuid:i,metadata:Object.assign(Object.assign({},r.metadata),{name:c}),name:c}),this._items[e]=this._items[t],delete this._items[t]}else{if(u!==c&&("directory"===r.type?await this.cloud.renameDirectory({uuid:i,name:c}):await this.cloud.renameFile({uuid:i,metadata:Object.assign(Object.assign({},r.metadata),{name:c}),name:c})),"/"===s||"."===s||""===s)"directory"===r.type?await this.cloud.moveDirectory({uuid:i,to:this.sdkConfig.baseFolderUUID,metadata:r.metadata}):await this.cloud.moveFile({uuid:i,to:this.sdkConfig.baseFolderUUID,metadata:r.metadata});else{await this.mkdir({path:s});const t=this._items[s];if(!t)throw new a.ENOENT({path:s});"directory"===r.type?await this.cloud.moveDirectory({uuid:i,to:t.uuid,metadata:r.metadata}):await this.cloud.moveFile({uuid:i,to:t.uuid,metadata:r.metadata})}for(const i in this._items)i.startsWith(t)&&(this._items[i.split(t).join(e)]=this._items[i],delete this._items[i])}}async statfs(){const t=await this.api.v3().user().account();return{type:-1,bsize:s.BUFFER_SIZE,blocks:1/0,bfree:1/0,bavail:1/0,files:-1,used:t.storage,max:t.maxStorage,ffree:1/0}}async _unlink({path:t,type:e}){t=this.normalizePath({path:t});const i=await this.pathToItemUUID({path:t});if(!i||!this._items[t])throw new a.ENOENT({path:t});if(!(e?"directory"===e?["directory"]:["file"]:["directory","file"]).includes(this._items[t].type))throw new a.ENOENT({path:t});"directory"===this._items[t].type?await this.cloud.trashDirectory({uuid:i}):await this.cloud.trashFile({uuid:i}),delete this._items[t]}async unlink({path:t}){return await this._unlink({path:t})}async rm({path:t}){return await this._unlink({path:t})}async rmdir(...t){return await this._unlink({path:t[0].path,type:"directory"})}async read({path:t,offset:e,length:i,position:n,abortSignal:o,pauseSignal:c,onProgress:u}){t=this.normalizePath({path:t});const l=await this.pathToItemUUID({path:t}),h=this._items[t];if(!l||!h||"directory"===h.type)throw new a.ENOENT({path:t});const f=Math.floor(n/s.UPLOAD_CHUNK_SIZE),p=Math.ceil((n+i)/s.UPLOAD_CHUNK_SIZE)-1;if(f<=0||f>h.metadata.chunks||p<=0||p>h.metadata.chunks)throw new Error("Invalid position or length.");const d=await this.cloud.downloadFileToReadableStream({uuid:l,bucket:h.metadata.bucket,region:h.metadata.region,chunks:h.metadata.chunks,version:h.metadata.version,key:h.metadata.key,abortSignal:o,pauseSignal:c,onProgress:u,chunksStart:f,chunksEnd:p});let m=r.from([]);const y=d.getReader();let v=!1,g=0;for(;!v;){const{done:t,value:e}=await y.read();if(t){v=!0;break}if(e instanceof Uint8Array&&e.byteLength>0){const t=g-n,o=Math.max(0,n-g),a=Math.min(o+i,e.byteLength);if(to){const t=e.subarray(o,a);m=r.concat([m,t]),i-=t.byteLength}g+=e.byteLength}}return m.subarray(e,e+Math.min(m.length,i))}async write(...t){return await this.writeFile(...t)}async readFile({path:t,abortSignal:e,pauseSignal:i,onProgress:n}){t=this.normalizePath({path:t});const o=await this.pathToItemUUID({path:t}),s=this._items[t];if(!o||!s||"directory"===s.type)throw new a.ENOENT({path:t});const c=await this.cloud.downloadFileToReadableStream({uuid:o,bucket:s.metadata.bucket,region:s.metadata.region,chunks:s.metadata.chunks,version:s.metadata.version,key:s.metadata.key,abortSignal:e,pauseSignal:i,onProgress:n});let u=r.from([]);const l=c.getReader();let h=!1;for(;!h;){const{done:t,value:e}=await l.read();if(t){h=!0;break}e instanceof Uint8Array&&e.byteLength>0&&(u=r.concat([u,e]))}return u}async writeFile({path:t,content:e,abortSignal:i,pauseSignal:r,onProgress:n}){if("node"!==s.environment)throw new Error(`fs.writeFile is not implemented for a ${s.environment} environment`);t=this.normalizePath({path:t});const a=o.default.posix.dirname(t);let h="";if("/"===a||"."===a||""===a)h=this.sdkConfig.baseFolderUUID;else{await this.mkdir({path:a});const e=await this.pathToItemUUID({path:a,type:"directory"}),i=this._items[a];if(!e||!i)throw new Error(`Could not find parent for path ${t}`);h=i.uuid}const f=this.sdkConfig.tmpPath?this.sdkConfig.tmpPath:l.default.tmpdir(),p=o.default.join(f,"filen-sdk",await(0,u.uuidv4)());await c.default.rm(p,{force:!0,maxRetries:600,recursive:!0,retryDelay:100}),await c.default.writeFile(p,e);try{await this.cloud.uploadLocalFile({source:p,parent:h,abortSignal:i,pauseSignal:r,onProgress:n})}finally{await c.default.rm(p,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})}}async download({path:t,destination:e,abortSignal:i,pauseSignal:r,onProgress:n}){if("node"!==s.environment)throw new Error(`fs.download is not implemented for a ${s.environment} environment`);t=this.normalizePath({path:t}),e=(0,u.normalizePath)(e);const o=await this.pathToItemUUID({path:t}),c=this._items[t];if(!o||!c)throw new a.ENOENT({path:t});"directory"!==c.type?await this.cloud.downloadFileToLocal({uuid:o,bucket:c.metadata.bucket,region:c.metadata.region,chunks:c.metadata.chunks,version:c.metadata.version,key:c.metadata.key,to:e,abortSignal:i,pauseSignal:r,onProgress:n}):await this.cloud.downloadDirectoryToLocal({uuid:o,to:e,abortSignal:i,pauseSignal:r,onProgress:n})}async upload({path:t,source:e,abortSignal:i,pauseSignal:r,onProgress:n}){if("node"!==s.environment)throw new Error(`fs.upload is not implemented for a ${s.environment} environment`);t=this.normalizePath({path:t}),e=(0,u.normalizePath)(e);const a=o.default.posix.dirname(t);let c="";if("/"===a||"."===a||""===a)c=this.sdkConfig.baseFolderUUID;else{await this.mkdir({path:a});const e=await this.pathToItemUUID({path:a,type:"directory"}),i=this._items[a];if(!e||!i)throw new Error(`Could not find parent for path ${t}`);c=i.uuid}await this.cloud.uploadLocalFile({source:e,parent:c,abortSignal:i,pauseSignal:r,onProgress:n})}async cp({from:t,to:e,abortSignal:i,pauseSignal:r,onProgress:n}){if("node"!==s.environment)throw new Error(`fs.cp is not implemented for a ${s.environment} environment`);if(t=this.normalizePath({path:t}),e=this.normalizePath({path:e}),"/"===t||t===e)return;const h=await this.pathToItemUUID({path:t}),f=this._items[t];if(!h||!f)throw new a.ENOENT({path:t});const p=o.default.posix.dirname(e);let d="";if("/"===p||"."===p||""===p)d=this.sdkConfig.baseFolderUUID;else{await this.mkdir({path:p});const t=await this.pathToItemUUID({path:p,type:"directory"}),i=this._items[p];if(!t||!i)throw new Error(`Could not find parent for path ${e}`);d=i.uuid}if("directory"===f.type){const e=this.sdkConfig.tmpPath?this.sdkConfig.tmpPath:l.default.tmpdir(),a=o.default.posix.basename(t),s=(0,u.normalizePath)(o.default.join(e,"filen-sdk",await(0,u.uuidv4)(),a));await this.cloud.downloadDirectoryToLocal({uuid:h,to:s});try{await this.cloud.uploadLocalDirectory({source:s,parent:d,abortSignal:i,pauseSignal:r,onProgress:n})}finally{await c.default.rm(o.default.join(s,".."),{force:!0,maxRetries:600,recursive:!0,retryDelay:100})}}else{const t=await this.cloud.downloadFileToLocal({uuid:h,bucket:f.metadata.bucket,region:f.metadata.region,chunks:f.metadata.chunks,version:f.metadata.version,key:f.metadata.key,abortSignal:i,pauseSignal:r,onProgress:n});try{await this.cloud.uploadLocalFile({source:t,parent:d,abortSignal:i,pauseSignal:r,onProgress:n})}finally{await c.default.rm(t,{force:!0,maxRetries:600,recursive:!0,retryDelay:100})}}}async copy(...t){return await this.cp(...t)}}e.FS=f,e.default=f},63607:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FilenSDK=void 0,i(92645);const n=r(i(70395)),o=r(i(27633)),a=r(i(78593)),s=i(95601),c=r(i(67435)),u=r(i(80939)),l=r(i(88177)),h=i(37717),f=r(i(85612)),p=r(i(64181)),d=r(i(1679)),m=r(i(35252)),y=r(i(60060)),v=r(i(59160)),g=r(i(55052));class b{constructor(t){this.utils=Object.assign(Object.assign({},a.default),{crypto:f.default,streams:{append:l.default,decodeBase64:h.streamDecodeBase64,encodeBase64:h.streamEncodeBase64}}),t||(t={}),this.config=t,this._crypto=t.masterKeys&&t.publicKey&&t.privateKey?new o.default({masterKeys:t.masterKeys,publicKey:t.publicKey,privateKey:t.privateKey,metadataCache:!!t.metadataCache&&t.metadataCache,tmpPath:"browser"===s.environment?"/dev/null":t.tmpPath?a.default.normalizePath(t.tmpPath):a.default.normalizePath(c.default.tmpdir())}):new o.default({masterKeys:[],publicKey:"",privateKey:"",metadataCache:!!t.metadataCache&&t.metadataCache,tmpPath:"browser"===s.environment?"/dev/null":t.tmpPath?a.default.normalizePath(t.tmpPath):a.default.normalizePath(c.default.tmpdir())}),this._api=t.apiKey?new n.default({apiKey:t.apiKey,crypto:this._crypto}):new n.default({apiKey:"anonymous",crypto:this._crypto}),this._cloud=new p.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._fs=new u.default({sdkConfig:t,api:this._api,crypto:this._crypto,cloud:this._cloud}),this._notes=new y.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._chats=new m.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._contacts=new v.default({sdkConfig:t,api:this._api}),this._user=new g.default({sdkConfig:t,api:this._api,crypto:this._crypto})}init(t){this.config=t,this._crypto=t.masterKeys&&t.publicKey&&t.privateKey?new o.default({masterKeys:t.masterKeys,publicKey:t.publicKey,privateKey:t.privateKey,metadataCache:!!t.metadataCache&&t.metadataCache,tmpPath:"browser"===s.environment?"/dev/null":t.tmpPath?a.default.normalizePath(t.tmpPath):a.default.normalizePath(c.default.tmpdir())}):new o.default({masterKeys:[],publicKey:"",privateKey:"",metadataCache:!!t.metadataCache&&t.metadataCache,tmpPath:"browser"===s.environment?"/dev/null":t.tmpPath?a.default.normalizePath(t.tmpPath):a.default.normalizePath(c.default.tmpdir())}),this._api=t.apiKey?new n.default({apiKey:t.apiKey,crypto:this._crypto}):new n.default({apiKey:"anonymous",crypto:this._crypto}),this._cloud=new p.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._fs=new u.default({sdkConfig:t,api:this._api,crypto:this._crypto,cloud:this._cloud}),this._notes=new y.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._chats=new m.default({sdkConfig:t,api:this._api,crypto:this._crypto}),this._contacts=new v.default({sdkConfig:t,api:this._api}),this._user=new g.default({sdkConfig:t,api:this._api,crypto:this._crypto})}isLoggedIn(){return void 0!==this.config.apiKey&&void 0!==this.config.masterKeys&&void 0!==this.config.publicKey&&void 0!==this.config.privateKey&&void 0!==this.config.baseFolderUUID&&void 0!==this.config.authVersion&&void 0!==this.config.userId&&this.config.apiKey.length>0&&this.config.masterKeys.length>0&&this.config.publicKey.length>0&&this.config.privateKey.length>0&&this.config.baseFolderUUID.length>0&&this.config.userId>0&&[1,2].includes(this.config.authVersion)}async _updateKeyPair({apiKey:t,publicKey:e,privateKey:i,masterKeys:r}){const n=await this._crypto.encrypt().metadata({metadata:i,key:r[r.length-1]});await this._api.v3().user().keyPair().update({publicKey:e,encryptedPrivateKey:n,apiKey:t})}async _setKeyPair({apiKey:t,publicKey:e,privateKey:i,masterKeys:r}){const n=await this._crypto.encrypt().metadata({metadata:i,key:r[r.length-1]});await this._api.v3().user().keyPair().set({publicKey:e,encryptedPrivateKey:n,apiKey:t})}async __updateKeyPair({apiKey:t,masterKeys:e}){const i=await this._api.v3().user().keyPair().info({apiKey:t});if("string"==typeof i.publicKey&&"string"==typeof i.privateKey&&i.publicKey.length>0&&i.privateKey.length>16){let r=null;for(const t of e)try{const e=await this._crypto.decrypt().metadata({metadata:i.privateKey,key:t});"string"==typeof e&&e.length>16&&(r=e)}catch(t){continue}if(!r)throw new Error("Could not decrypt private key.");return await this._updateKeyPair({apiKey:t,publicKey:i.publicKey,privateKey:r,masterKeys:e}),{publicKey:i.publicKey,privateKey:r}}const r=await this._crypto.utils.generateKeyPair();return await this._setKeyPair({apiKey:t,publicKey:r.publicKey,privateKey:r.privateKey,masterKeys:e}),{publicKey:r.publicKey,privateKey:r.privateKey}}async _updateKeys({apiKey:t,masterKeys:e}){const i=await this._crypto.encrypt().metadata({metadata:e.join("|"),key:e[e.length-1]}),r=await this._api.v3().user().masterKeys({encryptedMasterKeys:i,apiKey:t});let n=[...e];for(const t of e)try{const i=await this._crypto.decrypt().metadata({metadata:r.keys,key:t});"string"==typeof i&&i.length>16&&i.includes("|")&&(n=[...e,...i.split("|")])}catch(t){continue}if(0===n.length)throw new Error("Could not decrypt master keys.");const{publicKey:o,privateKey:a}=await this.__updateKeyPair({apiKey:t,masterKeys:n});return{masterKeys:n,publicKey:o,privateKey:a}}async login({email:t,password:e,twoFactorCode:i}){const r=t||(this.config.email?this.config.email:""),n=e||(this.config.password?this.config.password:""),o=i||(this.config.twoFactorCode?this.config.twoFactorCode:"XXXXXX");let a=this.config.authVersion?this.config.authVersion:null;if(0===r.length||0===n.length||0===o.length)throw new Error("Empty email, password or twoFactorCode");const s=await this._api.v3().auth().info({email:r});a||(a=s.authVersion);const c=await this._crypto.utils.generatePasswordAndMasterKeyBasedOnAuthVersion({rawPassword:n,authVersion:s.authVersion,salt:s.salt}),u=await this._api.v3().login({email:r,password:c.derivedPassword,authVersion:a}),[l,h]=await Promise.all([this._api.v3().user().info({apiKey:u.apiKey}),this._api.v3().user().baseFolder({apiKey:u.apiKey})]),f=await this._updateKeys({apiKey:u.apiKey,masterKeys:[c.derivedMasterKeys]});this.init(Object.assign(Object.assign({},this.config),{email:r,password:n,twoFactorCode:o,masterKeys:f.masterKeys,apiKey:u.apiKey,publicKey:f.publicKey,privateKey:f.privateKey,authVersion:a,baseFolderUUID:h.uuid,userId:l.id}))}logout(){this.init(Object.assign(Object.assign({},this.config),{email:void 0,password:void 0,twoFactorCode:void 0,masterKeys:void 0,apiKey:void 0,publicKey:void 0,privateKey:void 0,authVersion:void 0,baseFolderUUID:void 0,userId:void 0}))}api(t){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");if(3===t)return this._api.v3();throw new Error(`API version ${t} does not exist`)}crypto(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._crypto}fs(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._fs}cloud(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._cloud}notes(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._notes}chats(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._chats}contacts(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._contacts}user(){if(!this.isLoggedIn())throw new Error("Not authenticated, please call login() first");return this._user}async clearTemporaryDirectory(){if("node"!==s.environment)return;const t=a.default.normalizePath(d.default.join(this.config.tmpPath?this.config.tmpPath:c.default.tmpdir(),"filen-sdk"));await a.default.clearTempDirectory({tmpDir:t})}}e.FilenSDK=b,e.default=b,t.exports=b,e.default=b},60060:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Notes=void 0;const r=i(78593),n=i(62174),o=i(95601),a=i(63643);class s{constructor(t){this._noteKeyCache=new Map,this._semaphores={list:new a.Semaphore(128)},this.api=t.api,this.crypto=t.crypto,this.sdkConfig=t.sdkConfig}async _allTags({tags:t}){const e=[],i=[];for(const r of t)i.push(new Promise(((t,i)=>{this.crypto.decrypt().noteTagName({name:r.name}).then((i=>{e.push(Object.assign(Object.assign({},r),{name:i})),t()})).catch(i)})));return await(0,r.promiseAllChunked)(i),e}async all(){const t=await this.api.v3().notes().all(),e=[];for(const i of t)e.push(new Promise(((e,r)=>{this._semaphores.list.acquire().then((()=>{const n=i.participants.filter((t=>t.userId===this.sdkConfig.userId));if(0===n.length)return void r(new Error("Could not find user as a participant."));(this._noteKeyCache.has(i.uuid)?Promise.resolve(this._noteKeyCache.get(i.uuid)):this.crypto.decrypt().noteKeyParticipant({metadata:n[0].metadata,privateKey:this.sdkConfig.privateKey})).then((n=>{this._noteKeyCache.set(i.uuid,n),this.crypto.decrypt().noteTitle({title:i.title,key:n}).then((o=>{Promise.all([0===i.preview.length?Promise.resolve(o):this.crypto.decrypt().notePreview({preview:i.preview,key:n}),this._allTags({tags:i.tags})]).then((([r,n])=>{t.push(Object.assign(Object.assign({},i),{title:o,preview:r,tags:n})),e()})).catch(r)})).catch(r)})).catch(r)})).catch(r)})).finally((()=>{this._semaphores.list.release()})));return await(0,r.promiseAllChunked)(e),[]}async get({uuid:t}){const e=(await this.all()).filter((e=>e.uuid===t));if(0===e.length)throw new Error(`Note ${t} not found.`);return e[0]}async archived(){return(await this.all()).filter((t=>t.archive))}async trashed(){return(await this.all()).filter((t=>t.trash))}async favorited(){return(await this.all()).filter((t=>t.favorite))}async pinned(){return(await this.all()).filter((t=>t.pinned))}async recents(){return(await this.all()).sort(((t,e)=>e.editedTimestamp-t.editedTimestamp))}async _noteKey({uuid:t}){if(this._noteKeyCache.has(t))return this._noteKeyCache.get(t);const e=(await this.all()).filter((e=>e.uuid===t));if(0===e.length)throw new Error(`Could not find note ${t}.`);const i=e[0].participants.filter((t=>t.userId===this.sdkConfig.userId));if(0===i.length)throw new Error(`Could not find participant metadata for note ${t}.`);const r=await this.crypto.decrypt().noteKeyParticipant({metadata:i[0].metadata,privateKey:this.sdkConfig.privateKey});return this._noteKeyCache.set(t,r),r}async addParticipant({uuid:t,contactUUID:e,permissionsWrite:i,publicKey:r}){const n=await this._noteKey({uuid:t}),o=await this.crypto.encrypt().metadataPublic({metadata:JSON.stringify({key:n}),publicKey:r});await this.api.v3().notes().participantsAdd({uuid:t,metadata:o,contactUUID:e,permissionsWrite:i})}async removeParticipant({uuid:t,userId:e}){await this.api.v3().notes().participantsRemove({uuid:t,userId:e})}async participantPermissions({uuid:t,permissionsWrite:e,userId:i}){await this.api.v3().notes().participantsPermissions({uuid:t,userId:i,permissionsWrite:e})}async create({uuid:t,title:e}){const i=t||await(0,r.uuidv4)(),n=e||(0,r.simpleDate)(Date.now()),o=await this.crypto.utils.generateRandomString({length:32}),[a,s]=await Promise.all([this.crypto.encrypt().metadata({metadata:JSON.stringify({key:o})}),this.crypto.encrypt().noteTitle({title:n,key:o})]);return await this.api.v3().notes().create({uuid:i,title:s,metadata:a}),this._noteKeyCache.set(i,o),await this.addParticipant({uuid:i,contactUUID:"owner",permissionsWrite:!0,publicKey:this.sdkConfig.publicKey}),i}async content({uuid:t}){const e=await this.api.v3().notes().content({uuid:t});let i="";if(0===e.content.length)return i="checklist"===e.type?'


':"",{content:i,type:e.type,editedTimestamp:e.editedTimestamp,editorId:e.editorId,preview:""};const r=await this._noteKey({uuid:t}),n=0===e.preview.length?Promise.resolve(""):this.crypto.decrypt().notePreview({preview:e.preview,key:r}),[o,a]=await Promise.all([this.crypto.decrypt().noteContent({content:e.content,key:r}),n]);return i="checklist"!==e.type||""!==o&&-1!==o.indexOf("