@mudlet/mudlet-web 0.4.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-lib/analytics.d.ts +27 -0
- package/dist-lib/assets/fonts/Vera.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
- package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
- package/dist-lib/backupImport-wt8r7JXI.js +233 -0
- package/dist-lib/branding.d.ts +111 -13
- package/dist-lib/db/sqliteClient.d.ts +195 -7
- package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
- package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
- package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
- package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
- package/dist-lib/import/applyMudletProfile.d.ts +35 -9
- package/dist-lib/import/backupImport.d.ts +118 -0
- package/dist-lib/import/collectProfileExport.d.ts +33 -2
- package/dist-lib/import/defaultPackages.d.ts +57 -14
- package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
- package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
- package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
- package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
- package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
- package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
- package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
- package/dist-lib/import/mudletControlChars.d.ts +14 -0
- package/dist-lib/import/mudletHost.d.ts +73 -10
- package/dist-lib/import/mudletLink.d.ts +53 -2
- package/dist-lib/import/mudletProfileExport.d.ts +38 -5
- package/dist-lib/import/mudletProfileImport.d.ts +110 -12
- package/dist-lib/import/mudletVariables.d.ts +4 -3
- package/dist-lib/import/mudletWriteback.d.ts +15 -1
- package/dist-lib/import/mudletXmlImport.d.ts +46 -0
- package/dist-lib/import/packageFonts.d.ts +33 -0
- package/dist-lib/import/packageInstaller.d.ts +111 -7
- package/dist-lib/import/qtProfileData.d.ts +10 -0
- package/dist-lib/import/remotePackageInstall.d.ts +23 -7
- package/dist-lib/import/zipEntries.d.ts +45 -0
- package/dist-lib/index.d.ts +7 -3
- package/dist-lib/index.js +50660 -29735
- package/dist-lib/logging/SessionLogger.d.ts +75 -15
- package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
- package/dist-lib/map/MapStore.d.ts +432 -59
- package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
- package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
- package/dist-lib/map/areaGraph.d.ts +120 -0
- package/dist-lib/map/environmentKit.d.ts +36 -0
- package/dist-lib/map/labelPixmap.d.ts +90 -0
- package/dist-lib/map/mapImageExport.d.ts +36 -2
- package/dist-lib/map/mapStyle.d.ts +11 -0
- package/dist-lib/map/mapVersion.d.ts +66 -0
- package/dist-lib/map/pathfinding.d.ts +2 -2
- package/dist-lib/mud/CharLoginController.d.ts +230 -0
- package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
- package/dist-lib/mud/MudSession.d.ts +279 -22
- package/dist-lib/mud/PatternEngine.d.ts +153 -14
- package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
- package/dist-lib/mud/autoLogin.d.ts +59 -0
- package/dist-lib/mud/commandSplit.d.ts +9 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
- package/dist-lib/mud/connection/MudClient.d.ts +291 -53
- package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
- package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
- package/dist-lib/mud/events.d.ts +102 -23
- package/dist-lib/mud/games/bundledGames.d.ts +12 -7
- package/dist-lib/mud/games/gameLinks.d.ts +40 -0
- package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
- package/dist-lib/mud/games/icons/3Scapes.png +0 -0
- package/dist-lib/mud/games/icons/achaea.png +0 -0
- package/dist-lib/mud/games/icons/aetolia.png +0 -0
- package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
- package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
- package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
- package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
- package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
- package/dist-lib/mud/games/icons/blackmud.png +0 -0
- package/dist-lib/mud/games/icons/carrionfields.png +0 -0
- package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
- package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
- package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
- package/dist-lib/mud/games/icons/imperian.png +0 -0
- package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
- package/dist-lib/mud/games/icons/lusternia.png +0 -0
- package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
- package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
- package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
- package/dist-lib/mud/games/icons/starmourn.png +0 -0
- package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
- package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
- package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
- package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
- package/dist-lib/mud/protocol/atcp.d.ts +19 -0
- package/dist-lib/mud/protocol/byteString.d.ts +24 -0
- package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
- package/dist-lib/mud/protocol/charset.d.ts +111 -46
- package/dist-lib/mud/protocol/codePages.d.ts +10 -0
- package/dist-lib/mud/protocol/constants.d.ts +17 -10
- package/dist-lib/mud/protocol/echo.d.ts +23 -27
- package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
- package/dist-lib/mud/protocol/index.d.ts +3 -2
- package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
- package/dist-lib/mud/protocol/mccp.d.ts +83 -1
- package/dist-lib/mud/protocol/mnes.d.ts +41 -58
- package/dist-lib/mud/protocol/msdp.d.ts +11 -4
- package/dist-lib/mud/protocol/msp.d.ts +3 -2
- package/dist-lib/mud/protocol/mssp.d.ts +9 -4
- package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
- package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
- package/dist-lib/mud/protocol/mxp.d.ts +193 -14
- package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
- package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
- package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
- package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
- package/dist-lib/mud/text/Console.d.ts +255 -49
- package/dist-lib/mud/text/FormatState.d.ts +137 -14
- package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
- package/dist-lib/mud/text/colorParsers.d.ts +14 -2
- package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
- package/dist-lib/mud/text/colors.d.ts +17 -10
- package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
- package/dist-lib/mud/text/lineBreak.d.ts +5 -0
- package/dist-lib/mud/text/serverWrap.d.ts +2 -2
- package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
- package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
- package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
- package/dist-lib/mud/text/wcwidth.d.ts +27 -22
- package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
- package/dist-lib/mud/timers/workerClock.d.ts +67 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
- package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
- package/dist-lib/oauth-callback.html +94 -0
- package/dist-lib/pcre2Wasm.d.ts +54 -0
- package/dist-lib/pcre2Wasm.js +241 -0
- package/dist-lib/scripting/EngineHost.d.ts +54 -21
- package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
- package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
- package/dist-lib/scripting/ScriptingAPI.d.ts +1039 -213
- package/dist-lib/scripting/ScriptingEngine.d.ts +753 -103
- package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
- package/dist-lib/scripting/http/HttpService.d.ts +9 -1
- package/dist-lib/scripting/http/userUrl.d.ts +41 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
- package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
- package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
- package/dist-lib/scripting/lua/rex.d.ts +4 -2
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
- package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
- package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
- package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
- package/dist-lib/scripting/lua/yajl.d.ts +43 -5
- package/dist-lib/scripting/profilesPresence.d.ts +20 -2
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
- package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
- package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
- package/dist-lib/storage/appStore.d.ts +24 -9
- package/dist-lib/storage/hooks.d.ts +5 -1
- package/dist-lib/storage/index.d.ts +2 -2
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/persistentStorage.d.ts +3 -1
- package/dist-lib/storage/profileStorage.d.ts +15 -0
- package/dist-lib/storage/profileVfsData.d.ts +3 -3
- package/dist-lib/storage/schema.d.ts +521 -44
- package/dist-lib/storage/storageMigration.d.ts +82 -0
- package/dist-lib/storage-g5V1b-c1.js +2039 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/ui/AboutModal.d.ts +1 -1
- package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
- package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
- package/dist-lib/ui/CharLoginModal.d.ts +24 -15
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
- package/dist-lib/ui/CommandBar.d.ts +8 -8
- package/dist-lib/ui/ConnectionFormModal.d.ts +25 -1
- package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
- package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
- package/dist-lib/ui/HelpModal.d.ts +5 -1
- package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
- package/dist-lib/ui/NotepadModal.d.ts +22 -0
- package/dist-lib/ui/ResizableModal.d.ts +16 -1
- package/dist-lib/ui/SettingsModal.d.ts +10 -1
- package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
- package/dist-lib/ui/Toolbar.d.ts +22 -1
- package/dist-lib/ui/VaultManageButton.d.ts +20 -0
- package/dist-lib/ui/VaultModal.d.ts +5 -0
- package/dist-lib/ui/VaultUnlockPrompt.d.ts +15 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
- package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
- package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
- package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
- package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
- package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
- package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
- package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
- package/dist-lib/ui/codemirror/options.d.ts +33 -0
- package/dist-lib/ui/codemirror/theme.d.ts +29 -5
- package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
- package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
- package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
- package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
- package/dist-lib/ui/commands/keySequence.d.ts +57 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
- package/dist-lib/ui/components/FontPicker.d.ts +5 -1
- package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
- package/dist-lib/ui/helpTopics.d.ts +15 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
- package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
- package/dist-lib/ui/labels/labelModel.d.ts +64 -0
- package/dist-lib/ui/labels/qColor.d.ts +13 -0
- package/dist-lib/ui/labels/qtCss.d.ts +12 -4
- package/dist-lib/ui/landmarks.d.ts +9 -0
- package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
- package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
- package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
- package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
- package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
- package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
- package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
- package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
- package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
- package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
- package/dist-lib/ui/menu/appMenus.d.ts +65 -0
- package/dist-lib/ui/menu/menuModel.d.ts +88 -0
- package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
- package/dist-lib/ui/notepad.d.ts +76 -0
- package/dist-lib/ui/openSignInPage.d.ts +14 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
- package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
- package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
- package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
- package/dist-lib/ui/output/caretMode.d.ts +3 -2
- package/dist-lib/ui/output/clearSplit.d.ts +11 -0
- package/dist-lib/ui/output/outputCopy.d.ts +41 -2
- package/dist-lib/ui/output/outputRows.d.ts +43 -0
- package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
- package/dist-lib/ui/output/wordSelection.d.ts +33 -0
- package/dist-lib/ui/search/matcher.d.ts +14 -4
- package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
- package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
- package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
- package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
- package/dist-lib/ui/tabCompletion.d.ts +53 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
- package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
- package/dist-lib/ui/useVaultSaver.d.ts +26 -0
- package/dist-lib/ui/video/VideoManager.d.ts +7 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
- package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
- package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
- package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
- package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
- package/dist-lib/utils/appShellCache.d.ts +25 -0
- package/dist-lib/utils/fontFamilyName.d.ts +13 -0
- package/dist-lib/utils/fontLoader.d.ts +31 -0
- package/dist-lib/utils/formatBytes.d.ts +4 -0
- package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
- package/dist-lib/utils/profileLock.d.ts +1 -1
- package/dist-lib/utils/storedCredentials.d.ts +31 -0
- package/dist-lib/utils/systemTheme.d.ts +24 -0
- package/dist-lib/utils/timeZone.d.ts +10 -0
- package/dist-lib/vault/CredentialVault.d.ts +197 -0
- package/dist-lib/vault/deviceUnlock.d.ts +47 -0
- package/dist-lib/vault/passkeyPrf.d.ts +56 -0
- package/dist-lib/vault/useVault.d.ts +8 -0
- package/dist-lib/vault/vaultAccess.d.ts +80 -0
- package/dist-lib/vault/vaultCrypto.d.ts +56 -0
- package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
- package/dist-lib/vault/vaultRecord.d.ts +92 -0
- package/dist-lib/vfs-sw.js +220 -11
- package/dist-lib/vite.d.ts +1 -1
- package/dist-lib/vite.js +66 -43
- package/package.json +22 -14
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
- package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
- package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
- package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
- package/dist-lib/ui/bufferWords.d.ts +0 -38
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n={},r={};r.byteLength=d,r.toByteArray=p,r.fromByteArray=ee;for(var i=[],a=[],o=typeof Uint8Array<`u`?Uint8Array:Array,s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,c=0,l=s.length;c<l;++c)i[c]=s[c],a[s.charCodeAt(c)]=c;a[45]=62,a[95]=63;function u(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function d(e){var t=u(e),n=t[0],r=t[1];return(n+r)*3/4-r}function f(e,t,n){return(t+n)*3/4-n}function p(e){var t,n=u(e),r=n[0],i=n[1],s=new o(f(e,r,i)),c=0,l=i>0?r-4:r,d;for(d=0;d<l;d+=4)t=a[e.charCodeAt(d)]<<18|a[e.charCodeAt(d+1)]<<12|a[e.charCodeAt(d+2)]<<6|a[e.charCodeAt(d+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=a[e.charCodeAt(d)]<<2|a[e.charCodeAt(d+1)]>>4,s[c++]=t&255),i===1&&(t=a[e.charCodeAt(d)]<<10|a[e.charCodeAt(d+1)]<<4|a[e.charCodeAt(d+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function m(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[e&63]}function h(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(m(r));return i.join(``)}function ee(e){for(var t,n=e.length,r=n%3,a=[],o=16383,s=0,c=n-r;s<c;s+=o)a.push(h(e,s,s+o>c?c:s+o));return r===1?(t=e[n-1],a.push(i[t>>2]+i[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],a.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+`=`)),a.join(``)}var te={}
|
|
2
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
-
/*!
|
|
4
|
-
* The buffer module from node.js, for the browser.
|
|
5
|
-
*
|
|
6
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
7
|
-
* @license MIT
|
|
8
|
-
*/
|
|
9
|
-
;te.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},te.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128},(function(e){let t=r,n=te,i=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=d,e.SlowBuffer=ie,e.INSPECT_MAX_BYTES=50;let a=2147483647;e.kMaxLength=a;let{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:c}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{let e=new o(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,o.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(e){if(e>a)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new o(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return h(e)}return f(e,t,n)}d.poolSize=8192;function f(e,t,n){if(typeof e==`string`)return ee(e,t);if(s.isView(e))return _(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(B(e,s)||e&&B(e.buffer,s)||c!==void 0&&(B(e,c)||e&&B(e.buffer,c)))return ne(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return d.from(r,t,n);let i=re(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return d.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}d.from=function(e,t,n){return f(e,t,n)},Object.setPrototypeOf(d.prototype,o.prototype),Object.setPrototypeOf(d,o);function p(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function m(e,t,n){return p(e),e<=0||t===void 0?u(e):typeof n==`string`?u(e).fill(t,n):u(e).fill(t)}d.alloc=function(e,t,n){return m(e,t,n)};function h(e){return p(e),u(e<0?0:v(e)|0)}d.allocUnsafe=function(e){return h(e)},d.allocUnsafeSlow=function(e){return h(e)};function ee(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!d.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=ae(e,t)|0,r=u(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function g(e){let t=e.length<0?0:v(e.length)|0,n=u(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function _(e){if(B(e,o)){let t=new o(e);return ne(t.buffer,t.byteOffset,t.byteLength)}return g(e)}function ne(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new o(e):n===void 0?new o(e,t):new o(e,t,n),Object.setPrototypeOf(r,d.prototype),r}function re(e){if(d.isBuffer(e)){let t=v(e.length)|0,n=u(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||V(e.length)?u(0):g(e);if(e.type===`Buffer`&&Array.isArray(e.data))return g(e.data)}function v(e){if(e>=a)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+a.toString(16)+` bytes`);return e|0}function ie(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==d.prototype},d.compare=function(e,t){if(B(e,o)&&(e=d.from(e,e.offset,e.byteLength)),B(t,o)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},d.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},d.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return d.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=d.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(B(t,o))i+t.length>r.length?(d.isBuffer(t)||(t=d.from(t)),t.copy(r,i)):o.prototype.set.call(r,t,i);else if(d.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function ae(e,t){if(d.isBuffer(e))return e.length;if(s.isView(e)||B(e,s))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return F(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return R(e).length;default:if(i)return r?-1:F(e).length;t=(``+t).toLowerCase(),i=!0}}d.byteLength=ae;function oe(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ge(this,t,n);case`utf8`:case`utf-8`:return fe(this,t,n);case`ascii`:return he(this,t,n);case`latin1`:case`binary`:return C(this,t,n);case`base64`:return de(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return w(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function y(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}d.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)y(this,t,t+1);return this},d.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},d.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},d.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?fe(this,0,e):oe.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(e){if(!d.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:d.compare(this,e)===0},d.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},i&&(d.prototype[i]=d.prototype.inspect),d.prototype.compare=function(e,t,n,r,i){if(B(e,o)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,s=n-t,c=Math.min(a,s),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],s=u[e];break}return a<s?-1:+(s<a)};function b(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,V(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=d.from(t,r)),d.isBuffer(t))return t.length===0?-1:x(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof o.prototype.indexOf==`function`?i?o.prototype.indexOf.call(e,t,n):o.prototype.lastIndexOf.call(e,t,n):x(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function x(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}d.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},d.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)};function se(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(V(r))return o;e[n+o]=r}return o}function S(e,t,n,r){return z(F(t,e.length-n),e,n,r)}function ce(e,t,n,r){return z(I(t),e,n,r)}function le(e,t,n,r){return z(R(t),e,n,r)}function ue(e,t,n,r){return z(L(t,e.length-n),e,n,r)}d.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return se(this,e,t,n);case`utf8`:case`utf-8`:return S(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return ce(this,e,t,n);case`base64`:return le(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ue(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function de(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function fe(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return me(r)}let pe=4096;function me(e){let t=e.length;if(t<=pe)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=pe));return n}function he(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function C(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ge(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Ce[e[r]];return i}function w(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}d.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,d.prototype),r};function T(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}d.prototype.readUintLE=d.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},d.prototype.readUintBE=d.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=H(function(e){e>>>=0,N(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&P(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),d.prototype.readBigUInt64BE=H(function(e){e>>>=0,N(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&P(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),d.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},d.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},d.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},d.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=H(function(e){e>>>=0,N(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&P(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),d.prototype.readBigInt64BE=H(function(e){e>>>=0,N(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&P(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),d.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)};function E(e,t,n,r,i,a){if(!d.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;E(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;E(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,1,255,0),this[t]=e&255,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function D(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function _e(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}d.prototype.writeBigUInt64LE=H(function(e,t=0){return D(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),d.prototype.writeBigUInt64BE=H(function(e,t=0){return _e(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),d.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);E(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},d.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);E(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},d.prototype.writeBigInt64LE=H(function(e,t=0){return D(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),d.prototype.writeBigInt64BE=H(function(e,t=0){return _e(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function O(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function k(e,t,r,i,a){return t=+t,r>>>=0,a||O(e,t,r,4),n.write(e,t,r,i,23,4),r+4}d.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)};function ve(e,t,r,i,a){return t=+t,r>>>=0,a||O(e,t,r,8),n.write(e,t,r,i,52,8),r+8}d.prototype.writeDoubleLE=function(e,t,n){return ve(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return ve(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,r){if(!d.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof o.prototype.copyWithin==`function`?this.copyWithin(t,n,r):o.prototype.set.call(e,this.subarray(n,r),t),i},d.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!d.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=d.isBuffer(e)?e:d.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let A={};function j(e,t,n){A[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}j(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),j(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ye(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ye(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ye(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function be(e,t,n){N(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&P(t,e.length-(n+1))}function M(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new A.ERR_OUT_OF_RANGE(`value`,i,e)}be(r,i,a)}function N(e,t){if(typeof e!=`number`)throw new A.ERR_INVALID_ARG_TYPE(t,`number`,e)}function P(e,t,n){throw Math.floor(e)===e?t<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(N(e,n),new A.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let xe=/[^+/0-9A-Za-z-_]/g;function Se(e){if(e=e.split(`=`)[0],e=e.trim().replace(xe,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function F(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function I(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function L(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function R(e){return t.toByteArray(Se(e))}function z(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function B(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function V(e){return e!==e}let Ce=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function H(e){return typeof BigInt>`u`?we:e}function we(){throw Error(`BigInt not supported`)}})(n),n.Buffer,n.Blob,n.BlobOptions;const g=n.Buffer;n.File,n.FileOptions,n.INSPECT_MAX_BYTES,n.SlowBuffer,n.TranscodeEncoding,n.atob,n.btoa,n.constants,n.isAscii,n.isUtf8,n.kMaxLength,n.kStringMaxLength,n.resolveObjectURL,n.transcode;function _(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function ne(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e))return Uint8Array.from(e);throw TypeError(`Expected Uint8Array, ArrayBuffer, TypedArray, or number[]`)}const re=new TextEncoder,v=new TextDecoder(`utf-8`);function ie(e){return re.encode(e)}function ae(e){return v.decode(e)}function oe(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setUint16(t*2,e.charCodeAt(t),!1);return t}function y(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=0;r+1<e.byteLength;r+=2)n.push(t.getUint16(r,!1));let r=``,i=8192;for(let e=0;e<n.length;e+=i)r+=String.fromCharCode(...n.slice(e,e+i));return r}function b(e){let t=new Uint8Array(1);return new DataView(t.buffer).setInt8(0,e),t}function x(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e&65535,!1),t}function se(e){let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!1),t}function S(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e>>>0,!1),t}function ce(e){let t=new Uint8Array(8);return new DataView(t.buffer).setBigInt64(0,BigInt.asIntN(64,BigInt(e)),!1),t}function le(e){let t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt.asUintN(64,BigInt(e)),!1),t}function ue(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!1),t}var de=t({ReadBuffer:()=>fe}),fe=class{buffer;view;read_offset;constructor(e){this.buffer=ne(e),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.read_offset=0}remaining(){return this.read_offset>=this.buffer.byteLength?null:this.buffer.subarray(this.read_offset)}readInt8(){let e=this.view.getInt8(this.read_offset);return this.read_offset+=1,e}readInt16BE(){let e=this.view.getInt16(this.read_offset,!1);return this.read_offset+=2,e}readUInt16BE(){let e=this.view.getUint16(this.read_offset,!1);return this.read_offset+=2,e}readInt32BE(){let e=this.view.getInt32(this.read_offset,!1);return this.read_offset+=4,e}readUInt32BE(){let e=this.view.getUint32(this.read_offset,!1);return this.read_offset+=4,e}readInt64BE(){let e=this.view.getBigInt64(this.read_offset,!1);return this.read_offset+=8,e}readUInt64BE(){let e=this.view.getBigUint64(this.read_offset,!1);return this.read_offset+=8,e}readDoubleBE(){let e=this.view.getFloat64(this.read_offset,!1);return this.read_offset+=8,e}slice(e){let t=this.buffer.subarray(this.read_offset,this.read_offset+e);return this.read_offset+=e,t}};function pe(e){return(typeof e==`string`?e:ae(e)).replace(`\0`,``)}function me(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate(),i=Math.floor((14-n)/12),a=Math.floor(t+4800-i),o=n+12*i-3;return r+Math.floor((153*o+2)/5)+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)-32045}function he(e){let t=1461,n=4*(e+1401+Math.floor(Math.floor((4*e+274277)/146097)*3/4)+-38)+3,r=5*Math.floor(n%t/4)+2,i=Math.floor(r%153/5)+1,a=(Math.floor(r/153)+2)%12+1,o=Math.floor(n/t)-4716+Math.floor((14-a)/12);return new Date(o,a-1,i)}const C={INVALID:0,BOOL:1,INT:2,UINT:3,INT64:4,UINT64:5,DOUBLE:6,CHAR:7,MAP:8,LIST:9,STRING:10,STRINGLIST:11,BYTEARRAY:12,TIME:15,DATETIME:16,USERTYPE:127,SHORT:133};function ge(e){return e!=null&&typeof e.export==`function`?e.export():e}var w=class{__obj;static qtype;static types=new Map;constructor(e){this.__obj=e}static from(e,t=!1){let n=this;return e instanceof n&&!t||(e=ge(e),e instanceof n)?e:new n(e)}static read(e,t){throw Error(`${this.name}.read() is not implemented`)}};function T(e){return function(t){e!==void 0&&w.types.set(e,t),t.qtype=e}}var E=class extends w{static read(e){}toBuffer(){return new Uint8Array}};T(C.INVALID)(E);var D=class extends w{static read(e){return!!e.readInt8()}toBuffer(){return b(+!!this.__obj)}};T(C.BOOL)(D);var _e=class extends w{static read(e){return e.readInt16BE()}toBuffer(){return x(this.__obj)}};T(C.SHORT)(_e);var O=class extends w{static read(e){return e.readInt32BE()}toBuffer(){return se(this.__obj)}};T(C.INT)(O);var k=class extends w{static read(e){return e.readUInt32BE()}toBuffer(){return S(this.__obj)}};T(C.UINT)(k);var ve=class extends w{static read(e){return e.readInt64BE()}toBuffer(){return ce(this.__obj)}};T(C.INT64)(ve);var A=class extends w{static read(e){return e.readUInt64BE()}toBuffer(){return le(this.__obj)}};T(C.UINT64)(A);var j=class extends w{static read(e){return e.readDoubleBE()}toBuffer(){return ue(this.__obj)}};T(C.DOUBLE)(j);var ye=class extends w{constructor(e){if(super(e),typeof this.__obj!=`string`)throw Error(`${this.__obj} is not a string`);if(this.__obj.length!==1)throw Error(`${this.__obj} length must equal 1`)}static read(e){return y(e.slice(2))}toBuffer(){return oe(this.__obj)}};T(C.CHAR)(ye);var be=class extends k{};T(C.TIME)(be);var M=class extends w{static read(e){let t=k.read(e);return t===0||t===4294967295?null:e.slice(t)}toBuffer(){if(this.__obj===null)return S(4294967295);let e=typeof this.__obj==`string`?ie(this.__obj):ne(this.__obj);return _([S(e.length),e])}};T(C.BYTEARRAY)(M);var N=class extends w{static read(e){let t=k.read(e);return t===0||t===4294967295?``:y(e.slice(t))}toBuffer(){if(this.__obj===null)return S(4294967295);let e=oe(typeof this.__obj==`number`?String(this.__obj):this.__obj);return _([S(e.length),e])}};T(C.STRING)(N);var P=class extends w{static read(e){let t=k.read(e),n=Array(t);for(let r=0;r<t;r++)n[r]=L.read(e);return n}static of(e){let t=typeof e==`string`?I.get(e):e,n=this;return class extends n{static from(e){return Array.isArray(e)&&(e=e.map(e=>ge(t.from(e)))),n.from(e)}}}toBuffer(){let e=[S(this.__obj.length)];for(let t of this.__obj)e.push(L.from(t).toBuffer());return _(e)}};T(C.LIST)(P);var xe=class extends w{static read(e){let t=k.read(e),n=Array(t);for(let r=0;r<t;r++)n[r]=N.read(e);return n}toBuffer(){let e=[S(this.__obj.length)];for(let t of this.__obj)e.push(N.from(t).toBuffer());return _(e)}};T(C.STRINGLIST)(xe);var Se=class extends w{static read(e){let t=k.read(e),n=k.read(e);D.read(e);let r=he(t);return r.setMilliseconds(n),r}toBuffer(){let e=this.__obj,t=(e.getTime()-e.getTimezoneOffset()*6e4)%864e5;return _([S(me(e)),S(t),D.from(e.getTimezoneOffset()===0).toBuffer()])}};T(C.DATETIME)(Se);var F=class extends w{static read(e){let t=k.read(e),n={};for(let r=0;r<t;r++){let t=N.read(e);n[t]=L.read(e)}return n}toBuffer(){let e=[];if(this.__obj instanceof Map){e.push(S(this.__obj.size));for(let[t,n]of this.__obj)e.push(N.from(t).toBuffer()),e.push(L.from(n).toBuffer())}else{let t=this.__obj?Object.keys(this.__obj):[];e.push(S(t.length));for(let n of t)e.push(N.from(n).toBuffer()),e.push(L.from(this.__obj[n]).toBuffer())}return _(e)}};T(C.MAP)(F);var I=class e extends w{name;static usertypes=new Map;constructor(e,t){super(t),this.name=e}static from(t){return t instanceof e?t:new this(t)}static createComplexUserType(t,n){let r=[];for(let t of n){let[n]=Object.keys(t),i={key:n,quserclass:void 0};if(typeof t[n]==`string`?(i.quserclassname=t[n],i.quserclass=e.usertypes.get(t[n])):i.quserclass=w.types.get(t[n]),!i.quserclass)throw Error(`Type ${t[n]} does not exists`);r.push(i)}return class extends e{constructor(e){super(t,e)}static read(e){let t={};for(let n of r)t[n.key]=n.quserclass.read(e,n.quserclassname);return t}toBuffer(e=!1){let t=[this._getNameBuffer(e)];for(let e of r)t.push(e.quserclass.from(this.__obj[e.key]).toBuffer(!0));return _(t)}}}static createUserType(t,n){if(Array.isArray(n))return e.createComplexUserType(t,n);let r=w.types.get(n);return class extends e{constructor(e){super(t,e)}static read(e){return r.read(e)}toBuffer(e=!1){return _([this._getNameBuffer(e),r.from(this.__obj).toBuffer(!0)])}}}static register(t,n){e.usertypes.set(t,e.createUserType(t,n))}static get(t){return e.usertypes.get(t)}static read(t,n){n||=pe(M.read(t)??new Uint8Array);let r=e.usertypes.get(n);if(!r)throw Error(`Unregistered usertype ${n}`);return r.read(t)}_getNameBuffer(e){if(!this.name)throw Error(`Abstract QUserType cannot be converted to a buffer`);return e?new Uint8Array:M.from(this.name).toBuffer()}toBuffer(t=!1){return _([this._getNameBuffer(t),e.usertypes.get(this.name).from(this.__obj).toBuffer(!0)])}};T(C.USERTYPE)(I);var L=class e extends w{static coerceNumbersClass=k;static coerceNumbersTo(t){let n=w.types.get(t);if(n===void 0)throw Error(`undefined type ${t}`);e.coerceNumbersClass=n}static read(e){let t=k.read(e);return D.read(e),w.types.get(t).read(e)}toBuffer(){let t=this.__obj===void 0||this.__obj===null,n=typeof this.__obj,r;if(this.__obj===void 0)r=E;else if(this.__obj instanceof I)r=I;else if(this.__obj instanceof e)throw Error(`Can't nest QVariant`);else r=this.__obj instanceof w?this.__obj.constructor:n===`string`?N:n===`bigint`?ve:n===`number`?e.coerceNumbersClass:n===`boolean`?D:this.__obj instanceof Date?Se:Array.isArray(this.__obj)?P:F;let i=[S(r.qtype),D.from(t).toBuffer()];return t||i.push(r.from(this.__obj).toBuffer()),_(i)}},R=class extends w{static read(e){return e.readInt8()}toBuffer(){return b(this.__obj)}},z=class extends w{static read(e){return e.readUInt16BE()}toBuffer(){return x(this.__obj)}},B=class extends w{static read(e){return{spec:R.read(e),alpha:z.read(e)>>8,r:z.read(e)>>8,g:z.read(e)>>8,b:z.read(e)>>8,pad:z.read(e)>>8}}toBuffer(){let e=this.__obj,t=[];return t.push(R.from(e.spec).toBuffer(!1)),t.push(z.from(e.alpha*257).toBuffer(!1)),t.push(z.from(e.r*257).toBuffer(!1)),t.push(z.from(e.g*257).toBuffer(!1)),t.push(z.from(e.b*257).toBuffer(!1)),t.push(z.from((e.pad??0)*257).toBuffer(!1)),_(t)}},V=class extends N{toBuffer(){return this.__obj===``?k.from(4294967295).toBuffer():super.toBuffer()}},Ce=class extends w{static read(e){let t=V.read(e),n=V.read(e),r=j.read(e),i=O.read(e),a=R.read(e),o=z.read(e);e.readInt8();let s=e.readInt8()>>>0,c=e.readInt8()>>>0,l=e.readUInt16BE(),u=e.readInt8()>>>0;return{family:t,style:n,pointSize:r,pixelSize:i,styleHint:a,styleStrategy:o,weight:s,fontBits:c,stretch:l,extendedFontBits:u,letterSpacing:O.read(e),wordSpacing:O.read(e),hintingPreference:e.readInt8()>>>0,capital:e.readInt8()>>>0,styleSetting:(c&1)!=0,underline:(c&2)!=0,overline:(c&64)!=0,strikeOut:(c&4)!=0,fixedPitch:(c&8)!=0,kerning:(c&16)!=0,styleOblique:(c&128)!=0,ignorePitch:(u&1)!=0,letterSpacingIsAbsolute:(u&2)!=0}}toBuffer(){let e=this.__obj;return _([V.from(e.family).toBuffer(),V.from(e.style).toBuffer(),j.from(e.pointSize).toBuffer(),O.from(e.pixelSize).toBuffer(),R.from(e.styleHint).toBuffer(),z.from(e.styleStrategy).toBuffer(),new Uint8Array(1),b(e.weight),b(e.fontBits),x(e.stretch),b(e.extendedFontBits),O.from(e.letterSpacing).toBuffer(),O.from(e.wordSpacing).toBuffer(),b(e.hintingPreference),b(e.capital)])}},H=class extends w{static read(e){return[j.read(e),j.read(e)]}toBuffer(){let[e,t]=this.__obj;return _([j.from(e).toBuffer(),j.from(t).toBuffer()])}},we=class extends w{static read(e){return[j.read(e),j.read(e),j.read(e)]}toBuffer(){let[e,t,n]=this.__obj;return _([j.from(e).toBuffer(),j.from(t).toBuffer(),j.from(n).toBuffer()])}},Te=class extends w{static read(e){k.read(e);let t=e.read_offset;if(e.readUInt32BE()!==2303741511)return e.read_offset-=4,``;for(;e.readUInt32BE()!==1229278788;)e.read_offset-=3;let n=e.read_offset;e.read_offset=t;let r=n-t;return e.slice(r+4)}toBuffer(){let e=this.__obj;return _([k.from(1).toBuffer(),e===``?new Uint8Array:e])}};const U={...C,POINT:25,FONT:64,PIXMAP:65,COLOR:67,VECTOR:84};let Ee=!1;function De(){Ee||(Ee=!0,T(U.POINT)(H),T(U.FONT)(Ce),T(U.PIXMAP)(Te),T(U.COLOR)(B),T(U.VECTOR)(we))}function Oe(e){return class extends w{static read(t){let n=O.read(t),r={};for(let i=0;i<n;i++){let n=O.read(t),i=O.read(t);r[i]=[];for(let a=0;a<n;a++)r[i].push(I.get(e).read(t))}return r}toBuffer(){let t=this.__obj,n=[];n.push(O.from(Object.keys(t).length).toBuffer());for(let r of Object.keys(t)){let i=parseInt(r);n.push(O.from(t[i].length).toBuffer()),n.push(O.from(i).toBuffer());for(let r of t[i])n.push(I.get(e).from(r).toBuffer(!0))}return _(n)}}}function ke(e){return class extends w{static read(t){let n={},r=O.read(t);for(let i=0;i<r;i++){let r=O.read(t);n[r]=I.get(e).read(t)}return n}toBuffer(){let t=this.__obj,n=[];n.push(O.from(Object.keys(t).length).toBuffer());for(let[r,i]of Object.entries(t).sort((e,t)=>parseInt(e[0])-parseInt(t[0])))n.push(O.from(parseInt(r)).toBuffer()),n.push(I.get(e).from(i).toBuffer(!0));return _(n)}}}function Ae(e){return class extends w{static read(t){let n={};for(;t.buffer.length>t.read_offset;){let r=O.read(t);n[r]=I.get(e).read(t)}return n}toBuffer(){let t=this.__obj,n=[];for(let[r,i]of Object.entries(t).reverse())n.push(O.from(parseInt(r)).toBuffer()),n.push(I.get(e).from(i).toBuffer(!0));return _(n)}}}let W=1e3;const G={},K={},je={},Me={};function q(e){return typeof e==`number`||!e.qtype?w.types.get(e):e}function Ne(e,t){return parseInt(e[0])===-1?-1:parseInt(t[0])===-1?1:parseInt(e[0])-parseInt(t[0])}function Pe(e,t){return class extends w{static read(n){let r={},i=k.read(n);for(let a=0;a<i;a++){let i=e.read(n),a=t.read(n);r[i]===void 0&&(r[i]=[]),r[i].push(a)}return r}toBuffer(){let n=[],r=this.__obj;if(r instanceof Map){n.push(k.from(r.size).toBuffer());for(let[i,a]of r)n.push(e.from(i).toBuffer()),n.push(t.from(a).toBuffer())}else{let i=0;for(let[a,o]of Object.entries(r).reverse())for(let r of o)i++,n.push(e.from(a).toBuffer()),n.push(t.from(r).toBuffer());n.unshift(k.from(i).toBuffer())}return _(n)}}}function Fe(e,t){return class extends w{static read(n){let r={},i=k.read(n);for(let a=0;a<i;a++){let i=e.read(n);r[i]=t.read(n)}return r}toBuffer(){let n=[],r=this.__obj;if(r instanceof Map){n.push(k.from(r.size).toBuffer());for(let[i,a]of r)n.push(e.from(i).toBuffer()),n.push(t.from(a).toBuffer())}else{let i=Object.entries(r);n.push(k.from(i.length).toBuffer());for(let[r,a]of i.sort(Ne))n.push(e.from(r).toBuffer()),n.push(t.from(a).toBuffer())}return _(n)}}}function Ie(e){return class extends w{static read(t){let n=[],r=k.read(t);for(let i=0;i<r;i++)n.push(e.read(t));return n}toBuffer(){let t=[],n=this.__obj;t.push(k.from(n.length).toBuffer());for(let r of n)t.push(e.from(r).toBuffer());return _(t)}}}function Le(e,t){return class extends w{static read(n){return[e.read(n),t.read(n)]}toBuffer(){let n=this.__obj;return _([e.from(n[0]).toBuffer(),t.from(n[1]).toBuffer()])}}}function Re(e,t){let n=q(e),r=q(t),i=String(n),a=String(r);if(K[i]||(K[i]={}),!K[i][a]){let e=Pe(n,r),t=W++;T(t)(e),K[i][a]=t}return K[i][a]}function J(e,t,n){let r=q(e),i=q(t),a=String(r),o=String(i);if(G[a]||(G[a]={}),!G[a][o]){let e=Fe(r,i),t=W++;T(t)(e),G[a][o]=t}return G[a][o]}function Y(e){let t=String(e);if(!je[t]){let n=Ie(e),r=W++;T(r)(n),je[t]=r}return je[t]}function ze(e,t){let n=`${e.name}#${t.name}`;if(!Me[n]){let r=Le(e,t),i=W++;T(i)(r),Me[n]=i}return Me[n]}const Be=new Map;function Ve(e){Be.set(e.version,e)}function He(e){return Be.get(e)}function Ue(){return[...Be.keys()].sort((e,t)=>e-t)}De();const We={"dot line":3,"dash line":2,"dash dot line":4,"dash dot dot line":5},Ge={N:`n`,E:`e`,S:`s`,W:`w`,UP:`up`,DOWN:`down`,NE:`ne`,SE:`se`,SW:`sw`,NW:`nw`,IN:`in`,OUT:`out`},Ke=`system.fallback_symbol`;function qe(e){let t={};for(let n of Object.keys(e))t[Ge[n]??n]=e[n];return t}const Je={family:`Bitstream Vera Sans Mono`,style:``,pointSize:10,pixelSize:-1,styleHint:0,styleStrategy:0,weight:50,fontBits:0,stretch:0,extendedFontBits:0,letterSpacing:0,wordSpacing:0,hintingPreference:0,capital:0,styleSetting:!1,underline:!1,overline:!1,strikeOut:!1,fixedPitch:!0,kerning:!1,styleOblique:!1,ignorePitch:!1,letterSpacingIsAbsolute:!1};var Ye=class extends w{static read(e){let t=e.readInt8();return t>32?String.fromCodePoint(t):``}toBuffer(){throw Error(`writing legacy Mudlet map versions is not supported`)}},Xe=class extends w{static read(e){let t=k.read(e),n=[];for(let r=0;r<t;r++)n.push(O.read(e));return n.length>=3?{spec:1,alpha:255,r:n[0],g:n[1],b:n[2],pad:0}:{spec:1,alpha:255,r:255,g:0,b:0,pad:0}}toBuffer(){throw Error(`writing legacy Mudlet map versions is not supported`)}},Ze=class extends w{static read(e){return We[V.read(e)]??1}toBuffer(){throw Error(`writing legacy Mudlet map versions is not supported`)}},Qe=class extends w{static read(e){return O.read(e),{}}toBuffer(){throw Error(`writing legacy Mudlet map versions is not supported`)}};const X={SYMBOL_BYTE:300,COLOR_INTLIST:301,STYLE_STRING:302,ROOM_ID:303};let $e=!1;function et(){$e||($e=!0,T(X.SYMBOL_BYTE)(Ye),T(X.COLOR_INTLIST)(Xe),T(X.STYLE_STRING)(Ze),T(X.ROOM_ID)(Qe))}const tt={16:{hasMapUserData:!1,hasMapFont:!1,modernRoomIdHash:!1,modernArea:!1,stringSymbol:!1},17:{hasMapUserData:!0,hasMapFont:!1,modernRoomIdHash:!1,modernArea:!0,stringSymbol:!1},18:{hasMapUserData:!0,hasMapFont:!1,modernRoomIdHash:!0,modernArea:!0,stringSymbol:!1},19:{hasMapUserData:!0,hasMapFont:!0,modernRoomIdHash:!0,modernArea:!0,stringSymbol:!0}};function nt(e,t){if(t.hasMapUserData||(e.mUserData={}),t.hasMapFont||(e.mapSymbolFont={...Je},e.mapFontFudgeFactor=1,e.useOnlyMapFont=!1),!t.modernArea)for(let t of Object.values(e.areas)){let e=t;delete e.legacyForZUnused1,delete e.legacyForZUnused2,e.userData={}}}function rt(e,t){if(!t.stringSymbol&&e.userData){let t=e.userData[Ke];typeof t==`string`&&t.length>0&&(e.symbol=t),delete e.userData[Ke]}e.customLines=qe(e.customLines),e.customLinesArrow=qe(e.customLinesArrow),e.customLinesColor=qe(e.customLinesColor),e.customLinesStyle=qe(e.customLinesStyle)}function it(e){let t=tt[e];if(!t)throw Error(`No legacy config for Mudlet map version ${e}`);et();let n={MAP:`MudletMap@${e}`,HEADER:`MudletMapHeader@${e}`,AREA:`MudletArea@${e}`,ROOM:`MudletRoom@${e}`,LABEL:`MudletLabel@${e}`},r={LABELS:e*10,ROOMS:e*10+1,AREAS:e*10+2};T(r.LABELS)(Oe(n.LABEL)),T(r.ROOMS)(Ae(n.ROOM)),T(r.AREAS)(ke(n.AREA));let i=[{rooms:Y(k)},{zLevels:Y(O)},{mAreaExits:Re(O,ze(O,O))},{gridMode:U.BOOL},{max_x:U.INT},{max_y:U.INT},{max_z:U.INT},{min_x:U.INT},{min_y:U.INT},{min_z:U.INT},{span:U.VECTOR}];t.modernArea?i.push({xmaxForZ:J(O,O)},{ymaxForZ:J(O,O)},{xminForZ:J(O,O)},{yminForZ:J(O,O)}):i.push({xmaxForZ:J(O,O)},{ymaxForZ:J(O,O)},{legacyForZUnused1:J(O,O)},{xminForZ:J(O,O)},{yminForZ:J(O,O)},{legacyForZUnused2:J(O,O)}),i.push({pos:U.VECTOR},{isZone:U.BOOL},{zoneAreaRef:U.INT}),t.modernArea&&i.push({userData:J(V,V)}),I.register(n.AREA,i),I.register(n.ROOM,[{area:U.INT},{x:U.INT},{y:U.INT},{z:U.INT},{north:U.INT},{northeast:U.INT},{east:U.INT},{southeast:U.INT},{south:U.INT},{southwest:U.INT},{west:U.INT},{northwest:U.INT},{up:U.INT},{down:U.INT},{in:U.INT},{out:U.INT},{environment:U.INT},{weight:U.INT},{name:U.STRING},{isLocked:U.BOOL},{rawSpecialExits:Re(k,V)},{symbol:t.stringSymbol?U.STRING:X.SYMBOL_BYTE},{userData:J(V,V)},{customLines:J(V,Y(H))},{customLinesArrow:J(V,D)},{customLinesColor:J(V,Xe)},{customLinesStyle:J(V,Ze)},{exitLocks:Y(O)},{stubs:Y(O)},{exitWeights:J(V,O)},{doors:J(V,O)}]),I.register(n.LABEL,[{id:U.INT},{pos:U.VECTOR},{dummy1:U.DOUBLE},{dummy2:U.DOUBLE},{size:ze(j,j)},{text:U.STRING},{fgColor:U.COLOR},{bgColor:U.COLOR},{pixMap:U.PIXMAP},{noScaling:U.BOOL},{showOnTop:U.BOOL}]);let a=[{version:U.INT},{envColors:J(O,O)},{areaNames:J(O,V,!0)},{mCustomEnvColors:J(O,B)},{mpRoomDbHashToRoomId:J(V,k)}];t.hasMapUserData&&a.push({mUserData:J(V,V)}),t.hasMapFont&&a.push({mapSymbolFont:U.FONT},{mapFontFudgeFactor:U.DOUBLE},{useOnlyMapFont:U.BOOL}),a.push({areas:r.AREAS}),a.push(t.modernRoomIdHash?{mRoomIdHash:J(V,O)}:{mRoomIdHash:X.ROOM_ID}),a.push({labels:r.LABELS}),I.register(n.HEADER,a),I.register(n.MAP,[...a,{rooms:r.ROOMS}]),Ve({version:e,read:e=>{let r=I.read(e,n.MAP);nt(r,t);for(let e of Object.values(r.rooms))rt(e,t);return r},write:()=>{throw Error(`Writing Mudlet map version ${e} is not supported (read-only). Mudlet only saves the latest format.`)},readHeader:e=>{let r=I.read(e,n.HEADER);return nt(r,t),r},readRoom:e=>{let r=O.read(e),i=I.get(n.ROOM).read(e);return rt(i,t),{id:r,room:i}}})}it(16),it(17),it(18),it(19),De();const Z={MAP:`MudletMap@20`,HEADER:`MudletMapHeader@20`,AREA:`MudletArea@20`,ROOM:`MudletRoom@20`,LABEL:`MudletLabel@20`},Q={LABELS:200,ROOMS:201,AREAS:202};T(Q.LABELS)(Oe(Z.LABEL)),T(Q.ROOMS)(Ae(Z.ROOM)),T(Q.AREAS)(ke(Z.AREA)),I.register(Z.AREA,[{rooms:Y(k)},{zLevels:Y(O)},{mAreaExits:Re(O,ze(O,O))},{gridMode:U.BOOL},{max_x:U.INT},{max_y:U.INT},{max_z:U.INT},{min_x:U.INT},{min_y:U.INT},{min_z:U.INT},{span:U.VECTOR},{xmaxForZ:J(O,O)},{ymaxForZ:J(O,O)},{xminForZ:J(O,O)},{yminForZ:J(O,O)},{pos:U.VECTOR},{isZone:U.BOOL},{zoneAreaRef:U.INT},{userData:J(V,V)}]),I.register(Z.ROOM,[{area:U.INT},{x:U.INT},{y:U.INT},{z:U.INT},{north:U.INT},{northeast:U.INT},{east:U.INT},{southeast:U.INT},{south:U.INT},{southwest:U.INT},{west:U.INT},{northwest:U.INT},{up:U.INT},{down:U.INT},{in:U.INT},{out:U.INT},{environment:U.INT},{weight:U.INT},{name:U.STRING},{isLocked:U.BOOL},{rawSpecialExits:Re(k,V)},{symbol:U.STRING},{userData:J(V,V)},{customLines:J(V,Y(H))},{customLinesArrow:J(V,D)},{customLinesColor:J(V,B)},{customLinesStyle:J(V,k)},{exitLocks:Y(O)},{stubs:Y(O)},{exitWeights:J(V,O)},{doors:J(V,O)}]),I.register(Z.LABEL,[{id:U.INT},{pos:U.VECTOR},{dummy1:U.DOUBLE},{dummy2:U.DOUBLE},{size:ze(j,j)},{text:U.STRING},{fgColor:U.COLOR},{bgColor:U.COLOR},{pixMap:U.PIXMAP},{noScaling:U.BOOL},{showOnTop:U.BOOL}]);const at=[{version:U.INT},{envColors:J(O,O)},{areaNames:J(O,V,!0)},{mCustomEnvColors:J(O,B)},{mpRoomDbHashToRoomId:J(V,k)},{mUserData:J(V,V)},{mapSymbolFont:U.FONT},{mapFontFudgeFactor:U.DOUBLE},{useOnlyMapFont:U.BOOL},{areas:Q.AREAS},{mRoomIdHash:J(V,O)},{labels:Q.LABELS}];I.register(Z.HEADER,at),I.register(Z.MAP,[...at,{rooms:Q.ROOMS}]),Ve({version:20,read:e=>I.read(e,Z.MAP),write:e=>I.get(Z.MAP).from(e).toBuffer(!0),readHeader:e=>I.read(e,Z.HEADER),readRoom:e=>({id:O.read(e),room:I.get(Z.ROOM).read(e)})});const{ReadBuffer:ot}=de,st=[`north`,`northeast`,`east`,`southeast`,`south`,`southwest`,`west`,`northwest`,`up`,`down`,`in`,`out`],ct={north:1,northeast:2,northwest:3,east:4,west:5,south:6,southeast:7,southwest:8,up:9,down:10,in:11,out:12};function lt(e){for(let t in e.areas)Object.hasOwn(e.areas,t)&&(e.areas[t].mAreaExits={});for(let t in e.rooms){if(!Object.hasOwn(e.rooms,t))continue;let n=Number(t),r=e.rooms[n],i=e.areas[r.area];if(!i)continue;let a=[];for(let t of st){let n=r[t];if(!n||n<1)continue;let i=e.rooms[n];!i||i.area===r.area||a.push([n,ct[t]])}let o=r.mSpecialExits??{},s=Object.keys(o).sort();for(let t of s){let n=o[t];if(!n||n<1)continue;let i=e.rooms[n];!i||i.area===r.area||a.push([n,13])}a.length>0&&(i.mAreaExits[n]=a)}}function ut(e){for(let t in e.areas){if(!Object.hasOwn(e.areas,t))continue;let n=e.areas[t];n.xminForZ={},n.xmaxForZ={},n.yminForZ={},n.ymaxForZ={},n.zLevels=[];let r=!0;for(let t of n.rooms){let i=e.rooms[t];if(!i)continue;let a=i.x,o=-i.y,s=i.z;if(r){n.min_x=a,n.max_x=a,n.min_y=o,n.max_y=o,n.min_z=s,n.max_z=s,n.zLevels.push(s),n.xminForZ[s]=a,n.xmaxForZ[s]=a,n.yminForZ[s]=o,n.ymaxForZ[s]=o,r=!1;continue}n.zLevels.includes(s)||n.zLevels.push(s),(n.xminForZ[s]===void 0||a<n.xminForZ[s])&&(n.xminForZ[s]=a),a<n.min_x&&(n.min_x=a),(n.xmaxForZ[s]===void 0||a>n.xmaxForZ[s])&&(n.xmaxForZ[s]=a),a>n.max_x&&(n.max_x=a),(n.yminForZ[s]===void 0||o<n.yminForZ[s])&&(n.yminForZ[s]=o),o<n.min_y&&(n.min_y=o),o>n.max_y&&(n.max_y=o),(n.ymaxForZ[s]===void 0||o>n.ymaxForZ[s])&&(n.ymaxForZ[s]=o),s<n.min_z&&(n.min_z=s),s>n.max_z&&(n.max_z=s)}n.zLevels.length>1&&n.zLevels.sort((e,t)=>e-t)}}function dt(e){for(let t in e.mpRoomDbHashToRoomId){if(!Object.hasOwn(e.mpRoomDbHashToRoomId,t))continue;let n=e.mpRoomDbHashToRoomId[t],r=e.rooms[n];r&&(r.hash=t)}}function ft(e){e.mpRoomDbHashToRoomId={};for(let t in e.rooms){if(!Object.hasOwn(e.rooms,t))continue;let n=e.rooms[t].hash;if(typeof n!=`string`||n.length===0)continue;let r=Number(t);if(Object.hasOwn(e.mpRoomDbHashToRoomId,n)){let t=e.mpRoomDbHashToRoomId[n];console.warn(`[mudlet-map-binary-reader] duplicate room hash "${n}" on rooms ${t} and ${r}; last wins`)}e.mpRoomDbHashToRoomId[n]=r}}function pt(e){e.mSpecialExits={},e.mSpecialExitLocks=[];for(let t in e.rawSpecialExits)if(Object.hasOwn(e.rawSpecialExits,t))for(let n of e.rawSpecialExits[t])n.startsWith(`0`)?e.mSpecialExits[n.substring(1)]=parseInt(t):n.startsWith(`1`)?(e.mSpecialExits[n.substring(1)]=parseInt(t),e.mSpecialExitLocks.push(parseInt(t))):e.mSpecialExits[n]=parseInt(t)}function mt(e){for(let t in e.rooms)Object.hasOwn(e.rooms,t)&&pt(e.rooms[t])}function ht(e){for(let t in e.rooms){let n=e.rooms[t],r={};for(let e in n.mSpecialExits){if(!Object.hasOwn(n.mSpecialExits,e))continue;let t=n.mSpecialExits[e];r[t]===void 0&&(r[t]=[]);let i=n.mSpecialExitLocks.indexOf(t)>-1;r[t].push((i?`1`:`0`)+e)}n.rawSpecialExits=r}}function gt(e){return O.read(new ot(e))}function _t(e){let t=gt(e),n=He(t);if(!n)throw Error(`Unsupported Mudlet map version ${t}. Supported version(s): ${Ue().join(`, `)}.`);let r=n.read(new ot(e));return mt(r),dt(r),r}function vt(e,t,n){let r=gt(e),i=He(r);if(!i)throw Error(`Unsupported Mudlet map version ${r}. Supported version(s): ${Ue().join(`, `)}.`);let a=new ot(e),o=i.readHeader(a);for(n?.(o);a.read_offset<a.buffer.length;){let{id:e,room:n}=i.readRoom(a);pt(n),t(e,n)}return o}function yt(e){let t=He(e.version);if(!t)throw Error(`Cannot write Mudlet map: unsupported version ${e.version}. Supported version(s): ${Ue().join(`, `)}.`);return ht(e),lt(e),ut(e),ft(e),t.write(e)}const bt=_t,xt=yt,St=vt;function Ct(e){for(let t of Object.values(e??{}))for(let e of t){let t=e.pixMap;if(t&&typeof t!=`string`)try{e.pixMap=g.from(t).toString(`base64`)}catch{e.pixMap=``}}}const $=self;self.addEventListener(`message`,e=>{let t=e.data;try{if(t.kind===`serialize`){for(let e of Object.values(t.map.labels??{}))for(let t of e){let e=t.pixMap;typeof e==`string`&&(t.pixMap=g.from(e,`base64`))}let e=xt(t.map),n=new ArrayBuffer(e.byteLength);new Uint8Array(n).set(e);let r={id:t.id,ok:!0,kind:`serialize`,bytes:n};$.postMessage(r,[n]);return}if(t.kind===`parseStream`){let e=[];St(g.from(t.buf),(n,r)=>{e.push([n,r]),e.length>=2e3&&($.postMessage({id:t.id,ok:!0,kind:`rooms`,rooms:e}),e=[])},e=>{Ct(e.labels);let n=0;for(let t of Object.values(e.areas??{}))n+=t.rooms?.length??0;$.postMessage({id:t.id,ok:!0,kind:`header`,header:e,totalRooms:n})}),e.length>0&&$.postMessage({id:t.id,ok:!0,kind:`rooms`,rooms:e}),$.postMessage({id:t.id,ok:!0,kind:`done`});return}let e=bt(g.from(t.buf));Ct(e.labels);let n={id:t.id,ok:!0,kind:`parse`,map:e};$.postMessage(n)}catch(e){let n={id:t.id,ok:!1,error:e instanceof Error?e.message:String(e)};$.postMessage(n)}});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface PingEventSource {
|
|
2
|
-
on(event: 'gmcp.negotiated', handler: () => void): () => void;
|
|
3
|
-
on(event: 'client.disconnect', handler: () => void): () => void;
|
|
4
|
-
on(event: 'gmcp.core.ping', handler: () => void): () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare class PingTracker {
|
|
7
|
-
private readonly sendPingCommand;
|
|
8
|
-
private readonly onPing;
|
|
9
|
-
private timer;
|
|
10
|
-
private probeTimer;
|
|
11
|
-
private lastSentAt;
|
|
12
|
-
private lastDuration;
|
|
13
|
-
private supported;
|
|
14
|
-
/** The responsiveness beat, live only while a ping is outstanding. */
|
|
15
|
-
private beatTimer;
|
|
16
|
-
private lastBeatAt;
|
|
17
|
-
/** Longest interval the event loop went undelivered during the current
|
|
18
|
-
* wait — see {@link MAX_BEAT_GAP_MS}. */
|
|
19
|
-
private worstBeatGapMs;
|
|
20
|
-
private readonly unsubs;
|
|
21
|
-
constructor(sendPingCommand: (latencyMs: number) => void, onPing: (duration: number | null) => void, source: PingEventSource);
|
|
22
|
-
destroy(): void;
|
|
23
|
-
private probe;
|
|
24
|
-
private start;
|
|
25
|
-
private stop;
|
|
26
|
-
/** Sends the last round-trip we measured, per the GMCP spec's documented
|
|
27
|
-
* `Core.Ping <average latency>` form — 0 on the first probe, when there is
|
|
28
|
-
* nothing measured yet. The latency is informational to the server; what
|
|
29
|
-
* matters here is that the request always carries a body, since a bare
|
|
30
|
-
* `Core.Ping` makes servers that unconditionally JSON-parse the part after
|
|
31
|
-
* the module name choke on an empty string. */
|
|
32
|
-
private sendPing;
|
|
33
|
-
/** Begin witnessing the event loop for the wait that starts now. */
|
|
34
|
-
private startBeat;
|
|
35
|
-
private recordBeatGap;
|
|
36
|
-
/** Stop the beat and answer the worst gap it saw, counting the stretch
|
|
37
|
-
* between the final beat and now — a stall that began after the last beat
|
|
38
|
-
* and ran until the reply is still a stall the reading spans. */
|
|
39
|
-
private stopBeat;
|
|
40
|
-
private handlePingResponse;
|
|
41
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type BundledGame } from '../mud/games/bundledGames';
|
|
2
|
-
import type { MudConnection } from '../storage';
|
|
3
|
-
/** The connection record a game turns into. Mudlet's catalogue is host/port, so
|
|
4
|
-
* these are proxied `mud` profiles — the same thing the Add form builds. */
|
|
5
|
-
export declare function connectionFromGame(game: BundledGame): Omit<MudConnection, 'id'>;
|
|
6
|
-
interface Props {
|
|
7
|
-
/** Profiles that already exist, so a game someone has played is offered by
|
|
8
|
-
* its profile tile above rather than a second time down here. */
|
|
9
|
-
connections: MudConnection[];
|
|
10
|
-
busy: boolean;
|
|
11
|
-
/** Create the profile and start playing. */
|
|
12
|
-
onPlay: (game: BundledGame) => void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The games Mudlet ships with, offered the way Mudlet offers them: a browsable
|
|
16
|
-
* list you can start playing without filling in a form. Picking one is what
|
|
17
|
-
* turns it into a profile — until then nothing is stored, so the list is not a
|
|
18
|
-
* pile of empty profiles a player has to tidy up.
|
|
19
|
-
*/
|
|
20
|
-
export declare function BundledGameGrid({ connections, busy, onPlay }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type MudConnection } from '../storage';
|
|
2
|
-
interface Props {
|
|
3
|
-
connections: MudConnection[];
|
|
4
|
-
connecting: boolean;
|
|
5
|
-
connectingId: string | null;
|
|
6
|
-
editingId: string | null;
|
|
7
|
-
/** Ids already open in another browser tab — one tab per profile, so these
|
|
8
|
-
* can't be opened here until that tab releases them. */
|
|
9
|
-
openIds: Set<string>;
|
|
10
|
-
onConnect: (c: MudConnection) => void;
|
|
11
|
-
onOpen: (c: MudConnection) => void;
|
|
12
|
-
onEdit: (c: MudConnection) => void;
|
|
13
|
-
onDelete: (c: MudConnection) => void;
|
|
14
|
-
onReorder: (orderedIds: string[]) => void;
|
|
15
|
-
onAddClick: () => void;
|
|
16
|
-
}
|
|
17
|
-
/** Draggable, animated grid of profile cards. Reordering lifts the dragged tile
|
|
18
|
-
* into a floating clone, opens a dashed placeholder at the target slot, and
|
|
19
|
-
* slides the remaining tiles into their new positions with a FLIP animation. */
|
|
20
|
-
export declare function ConnectionGrid({ connections, connecting, connectingId, editingId, openIds, onConnect, onOpen, onEdit, onDelete, onReorder, onAddClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { MudSession } from '../mud/MudSession';
|
|
2
|
-
/**
|
|
3
|
-
* Maintains a bounded, recency-ordered set of words seen in session output.
|
|
4
|
-
* Subscribes to the `message` event — the single choke point every output line
|
|
5
|
-
* passes through (the same tap SessionLogger uses) — so it captures MUD text,
|
|
6
|
-
* script echoes, and trigger output alike. One instance per session.
|
|
7
|
-
*/
|
|
8
|
-
export declare class BufferWordIndex {
|
|
9
|
-
private readonly session;
|
|
10
|
-
private readonly words;
|
|
11
|
-
private unsubscribe;
|
|
12
|
-
constructor(session: MudSession);
|
|
13
|
-
start(): void;
|
|
14
|
-
stop(): void;
|
|
15
|
-
private ingest;
|
|
16
|
-
/** Words in recency order, newest first. */
|
|
17
|
-
getWords(): string[];
|
|
18
|
-
}
|
|
19
|
-
export interface ActiveWord {
|
|
20
|
-
/** Everything before the trailing word (unchanged by completion). */
|
|
21
|
-
prefix: string;
|
|
22
|
-
/** The trailing word the user is typing. */
|
|
23
|
-
word: string;
|
|
24
|
-
}
|
|
25
|
-
/** Splits the trailing word being typed from its leading text. Returns null when
|
|
26
|
-
* the command is empty or ends in whitespace/punctuation (nothing to complete). */
|
|
27
|
-
export declare function splitTrailingWord(command: string): ActiveWord | null;
|
|
28
|
-
/** True when the trailing word is an *argument* (something precedes it), not the
|
|
29
|
-
* command name. This is what routes Tab to buffer completion vs. history. */
|
|
30
|
-
export declare function hasPrecedingWord(prefix: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Prefix-matches `word` against several candidate lists, tried in priority order
|
|
33
|
-
* (e.g. suggestions, then history, then buffer words). Case-insensitive,
|
|
34
|
-
* de-duplicated across all lists, excludes the exact word already typed. Matching
|
|
35
|
-
* is **prefix-only** — never subsequence — so a completion always literally starts
|
|
36
|
-
* with what was typed. The returned order is the Tab cycle order.
|
|
37
|
-
*/
|
|
38
|
-
export declare function matchWordCandidates(word: string, lists: string[][], limit?: number): string[];
|