@johnhenry/mallory-cli 0.0.0-stage → 0.1.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 +60 -2
- package/bin/mallory.mjs +51 -0
- package/package.json +51 -4
- package/src/a2a/client.js +511 -0
- package/src/a2a/demo-agent.js +396 -0
- package/src/a2a/hub.js +578 -0
- package/src/a2a/settings.js +88 -0
- package/src/a2a/task.js +358 -0
- package/src/acp/client.js +573 -0
- package/src/acp/demo-agent.js +332 -0
- package/src/acp/hub.js +632 -0
- package/src/acp/settings.js +78 -0
- package/src/actions/map.js +524 -0
- package/src/agent/cloud.js +77 -0
- package/src/agent/compact.js +84 -0
- package/src/agent/constants.js +39 -0
- package/src/agent/diff.js +101 -0
- package/src/agent/fork.js +159 -0
- package/src/agent/grounding.js +73 -0
- package/src/agent/guards.js +129 -0
- package/src/agent/local-transport.js +152 -0
- package/src/agent/loop.js +479 -0
- package/src/agent/park-store.js +77 -0
- package/src/agent/park.js +76 -0
- package/src/agent/ports.js +28 -0
- package/src/agent/providers.js +591 -0
- package/src/agent/restart.js +51 -0
- package/src/agent/router.js +380 -0
- package/src/agent/run.js +861 -0
- package/src/agent/tools.js +247 -0
- package/src/agent-library/engine.js +43 -0
- package/src/ai/bridge.js +155 -0
- package/src/ai/policy.js +131 -0
- package/src/aimatey/vendor.js +18 -0
- package/src/audio/container-duration.js +35 -0
- package/src/audio/instruments.js +776 -0
- package/src/audio/lanes.js +230 -0
- package/src/audio/patch.js +1410 -0
- package/src/audio/plan.js +276 -0
- package/src/audio/rack.js +1006 -0
- package/src/audio/sample-trim.js +293 -0
- package/src/audio/soundfont.js +243 -0
- package/src/audio/take-store.js +87 -0
- package/src/audio/takes.js +129 -0
- package/src/audio/wav.js +170 -0
- package/src/audio/zzfx.js +333 -0
- package/src/autonomy/bundle.js +207 -0
- package/src/autonomy/confine.js +61 -0
- package/src/autonomy/enforce.js +155 -0
- package/src/autonomy/file-kv.js +88 -0
- package/src/autonomy/ledger.js +203 -0
- package/src/autonomy/pins.js +50 -0
- package/src/autonomy/psl/index.js +32 -0
- package/src/autonomy/psl/suffixes.json +1 -0
- package/src/autonomy/record.js +28 -0
- package/src/autonomy/routines.js +107 -0
- package/src/autonomy/server.js +175 -0
- package/src/autonomy/signer-node.js +167 -0
- package/src/autonomy/store.js +43 -0
- package/src/autonomy/unattended.js +13 -0
- package/src/bytes/bytes.js +378 -0
- package/src/calc/syntax.js +125 -0
- package/src/calc/tex.js +28 -0
- package/src/calendar/vendor.js +2 -0
- package/src/clipboard.js +130 -0
- package/src/clsh/clsh.js +3417 -0
- package/src/codec/capnp.js +1804 -0
- package/src/codec/core.js +2043 -0
- package/src/codec/vendor/avro.js +136 -0
- package/src/codec/vendor/cbor.js +25 -0
- package/src/codec/vendor/flatbuffers.js +206 -0
- package/src/codec/vendor/msgpack.js +9 -0
- package/src/codec/vendor/protobuf.js +53 -0
- package/src/delegation/caps.js +60 -0
- package/src/delegation/config.js +32 -0
- package/src/device/model.js +246 -0
- package/src/device/recording.js +198 -0
- package/src/device/stream-model.js +151 -0
- package/src/documents/documents.js +1224 -0
- package/src/effects/catalog.js +63 -0
- package/src/effects/extras.js +133 -0
- package/src/effects/parse.js +339 -0
- package/src/embed/protocol.js +131 -0
- package/src/env/env.js +159 -0
- package/src/exact/vendor.js +45 -0
- package/src/example-meta.js +164 -0
- package/src/examples.js +94 -0
- package/src/export/canvas-image.js +217 -0
- package/src/export/expr-latex-lazy.js +8 -0
- package/src/export/formats.js +322 -0
- package/src/export/latex.js +183 -0
- package/src/export/pane.js +184 -0
- package/src/export/value.js +452 -0
- package/src/export/zip.js +214 -0
- package/src/ext/access.js +58 -0
- package/src/ext/btasks.js +225 -0
- package/src/ext/client.js +209 -0
- package/src/ext/tools.js +69 -0
- package/src/ext/view.js +105 -0
- package/src/ext/webmcp-tabs.js +299 -0
- package/src/files/archive.js +232 -0
- package/src/files/files.js +317 -0
- package/src/formats/json.js +24 -0
- package/src/formats/jupyter.js +188 -0
- package/src/formats/markdown.js +254 -0
- package/src/formats/n8n.js +276 -0
- package/src/formats/node-red.js +363 -0
- package/src/formats/registry.js +177 -0
- package/src/formats/rivet.js +259 -0
- package/src/formats/shared.js +98 -0
- package/src/formats/structure.js +182 -0
- package/src/formats/yaml.js +127 -0
- package/src/frame/frame.js +962 -0
- package/src/frame/vendor.js +1484 -0
- package/src/gate/audit.js +116 -0
- package/src/gate/gate.js +365 -0
- package/src/gate/policy.js +295 -0
- package/src/gate/scripted.js +110 -0
- package/src/gate/seams.js +32 -0
- package/src/gate/store.js +66 -0
- package/src/geometry/model.js +533 -0
- package/src/grant-key.js +149 -0
- package/src/graph/model.js +381 -0
- package/src/headless/a2a-push.js +123 -0
- package/src/headless/channels/config.js +142 -0
- package/src/headless/channels/connectors.js +283 -0
- package/src/headless/channels/index.js +257 -0
- package/src/headless/channels/mail.js +197 -0
- package/src/headless/channels/mailnet.js +223 -0
- package/src/headless/channels/platforms.js +194 -0
- package/src/headless/channels/replay.js +49 -0
- package/src/headless/cli.js +1397 -0
- package/src/headless/companion-client.js +182 -0
- package/src/headless/cost-cli.js +177 -0
- package/src/headless/deprecations-cli.js +102 -0
- package/src/headless/examples.js +48 -0
- package/src/headless/ffmpeg-exec.js +217 -0
- package/src/headless/gateways/config.js +213 -0
- package/src/headless/gateways/homeassistant.js +159 -0
- package/src/headless/gateways/index.js +121 -0
- package/src/headless/gateways/matter.js +150 -0
- package/src/headless/gateways/mqtt-client.js +177 -0
- package/src/headless/gateways/mqtt.js +70 -0
- package/src/headless/gateways/netway.js +226 -0
- package/src/headless/gateways/serverpod-worker.mjs +16 -0
- package/src/headless/gateways/serverpod.js +71 -0
- package/src/headless/gateways/util.js +27 -0
- package/src/headless/grant-cli.js +208 -0
- package/src/headless/guard.js +125 -0
- package/src/headless/guards.js +124 -0
- package/src/headless/machine-cli.js +853 -0
- package/src/headless/mcp-endpoint.js +287 -0
- package/src/headless/mcp-roots.js +38 -0
- package/src/headless/model-endpoint.js +88 -0
- package/src/headless/net.js +151 -0
- package/src/headless/node.js +263 -0
- package/src/headless/npm-tarball.js +29 -0
- package/src/headless/operator-page.js +112 -0
- package/src/headless/operator.js +242 -0
- package/src/headless/people.js +34 -0
- package/src/headless/pkg-cli.js +1103 -0
- package/src/headless/pkg-serve.js +138 -0
- package/src/headless/process-worker.js +88 -0
- package/src/headless/runner-remote.js +477 -0
- package/src/headless/sandbox-child.mjs +21 -0
- package/src/headless/scheduled.js +557 -0
- package/src/headless/serve-stream.js +97 -0
- package/src/headless/serve.js +2238 -0
- package/src/headless/short-links.js +158 -0
- package/src/headless/static-dirs.js +207 -0
- package/src/headless/trust-file.js +51 -0
- package/src/headless/watch.js +291 -0
- package/src/headless/ws-connect.js +65 -0
- package/src/headless/ws-connections.js +44 -0
- package/src/headless/ws-echo.js +150 -0
- package/src/headless/ws-proxy.js +354 -0
- package/src/headless/ws-ticket.js +48 -0
- package/src/hooks/config.js +50 -0
- package/src/hooks/engine.js +189 -0
- package/src/input/log.js +613 -0
- package/src/input/player.js +217 -0
- package/src/input/replay.js +209 -0
- package/src/jth/vendor.js +28 -0
- package/src/ledger/tx.js +94 -0
- package/src/machine/apply.js +193 -0
- package/src/machine/diff.js +168 -0
- package/src/machine/drive.js +296 -0
- package/src/machine/engine.js +478 -0
- package/src/machine/files-tool.js +76 -0
- package/src/machine/lint.js +139 -0
- package/src/machine/llmtm-trace.js +117 -0
- package/src/machine/llmtm.js +475 -0
- package/src/machine/otel.js +80 -0
- package/src/machine/pane-provider.js +51 -0
- package/src/machine/propose.js +159 -0
- package/src/machine/random.js +52 -0
- package/src/machine/risk.js +107 -0
- package/src/machine/session.js +1017 -0
- package/src/machine/shell-tool.js +45 -0
- package/src/machine/tape.js +349 -0
- package/src/machine/templates.js +104 -0
- package/src/machine/trace.js +664 -0
- package/src/machine/view.js +73 -0
- package/src/machine/vm-tool.js +47 -0
- package/src/machine/watchdog.js +46 -0
- package/src/mcp/app-args.js +51 -0
- package/src/mcp/app-run.js +56 -0
- package/src/mcp/apps.js +468 -0
- package/src/mcp/cache.js +232 -0
- package/src/mcp/client.js +507 -0
- package/src/mcp/demo-app.js +183 -0
- package/src/mcp/demo-server.js +602 -0
- package/src/mcp/elicitation.js +116 -0
- package/src/mcp/hub.js +1326 -0
- package/src/mcp/roots.js +139 -0
- package/src/mcp/sampling.js +105 -0
- package/src/mcp/settings.js +125 -0
- package/src/mcp/tape.js +292 -0
- package/src/mcp/uri-template.js +156 -0
- package/src/mcp/wsh-client.js +164 -0
- package/src/media/animated-codec.js +7 -0
- package/src/media/animated.js +623 -0
- package/src/media/compare-agent.js +70 -0
- package/src/media/compare-job.js +63 -0
- package/src/media/compare-page.js +296 -0
- package/src/media/compare-worker.js +14 -0
- package/src/media/compare.js +600 -0
- package/src/media/contract.js +62 -0
- package/src/media/decode-frame.js +57 -0
- package/src/media/decode-pool.js +188 -0
- package/src/media/ffmpeg-edit.js +344 -0
- package/src/media/ffmpeg-wasm-client.js +121 -0
- package/src/media/ffmpeg-wasm-session.js +79 -0
- package/src/media/ffmpeg-wasm.js +139 -0
- package/src/media/ffmpeg-worker.js +23 -0
- package/src/media/ffmpeg.js +903 -0
- package/src/media/helpers.js +419 -0
- package/src/media/keep.js +108 -0
- package/src/media/metadata-worker.js +16 -0
- package/src/media/metadata.js +2518 -0
- package/src/media/mime.js +102 -0
- package/src/media/page-decode.js +74 -0
- package/src/media/persist.js +114 -0
- package/src/media/png.js +226 -0
- package/src/media/sample-input.js +67 -0
- package/src/media/store.js +86 -0
- package/src/media/wav.js +109 -0
- package/src/midi/mappings.js +250 -0
- package/src/midi/message.js +125 -0
- package/src/model/action-hub.js +143 -0
- package/src/model/adapters.js +284 -0
- package/src/model/agent-runs.js +12 -0
- package/src/model/arrange.js +308 -0
- package/src/model/automation-clock.js +494 -0
- package/src/model/automation.js +653 -0
- package/src/model/batches.js +78 -0
- package/src/model/binary-view.js +195 -0
- package/src/model/breakpoints.js +392 -0
- package/src/model/calc-settings.js +65 -0
- package/src/model/calendar.js +254 -0
- package/src/model/canvas-id.js +5 -0
- package/src/model/canvas.js +5048 -0
- package/src/model/channel-names.js +29 -0
- package/src/model/channels.js +692 -0
- package/src/model/chart-clock.js +631 -0
- package/src/model/chart-code.js +69 -0
- package/src/model/codecs.js +60 -0
- package/src/model/companion-access.js +271 -0
- package/src/model/companion-pane.js +50 -0
- package/src/model/composite.js +324 -0
- package/src/model/context.js +380 -0
- package/src/model/controls.js +231 -0
- package/src/model/converter-presets.js +368 -0
- package/src/model/cost.js +580 -0
- package/src/model/curve-transform.js +122 -0
- package/src/model/cycles.js +176 -0
- package/src/model/debug-log.js +168 -0
- package/src/model/decision-clock.js +100 -0
- package/src/model/decisions.js +265 -0
- package/src/model/desk.js +87 -0
- package/src/model/device-hub.js +400 -0
- package/src/model/diff.js +445 -0
- package/src/model/emit-events.js +179 -0
- package/src/model/errors.js +238 -0
- package/src/model/event-presets.js +297 -0
- package/src/model/events.js +1303 -0
- package/src/model/explicit-setters.js +139 -0
- package/src/model/field-mapping.js +623 -0
- package/src/model/files-pane.js +263 -0
- package/src/model/flow-idle.js +89 -0
- package/src/model/foreach.js +549 -0
- package/src/model/frame-loop.js +71 -0
- package/src/model/frame-pressure.js +180 -0
- package/src/model/function-scaffold.js +1000 -0
- package/src/model/geometry-settings.js +54 -0
- package/src/model/goals.js +176 -0
- package/src/model/graph-settings.js +76 -0
- package/src/model/grid-widget.js +175 -0
- package/src/model/groups.js +332 -0
- package/src/model/hash.js +21 -0
- package/src/model/history.js +259 -0
- package/src/model/http-copy.js +88 -0
- package/src/model/http-send-companion.js +110 -0
- package/src/model/http-send.js +163 -0
- package/src/model/http-tap.js +521 -0
- package/src/model/http-tools.js +1138 -0
- package/src/model/import-lock.js +78 -0
- package/src/model/imports.js +258 -0
- package/src/model/infer-outputs.js +822 -0
- package/src/model/ink-connect.js +150 -0
- package/src/model/ink-diff.js +75 -0
- package/src/model/ink-gone.js +71 -0
- package/src/model/ink-route.js +120 -0
- package/src/model/ink-svg.js +206 -0
- package/src/model/ink.js +739 -0
- package/src/model/input-log-hub.js +456 -0
- package/src/model/input-split.js +69 -0
- package/src/model/json-schema-host.js +9 -0
- package/src/model/json-schema.js +368 -0
- package/src/model/jth.js +78 -0
- package/src/model/latex-expr.js +528 -0
- package/src/model/layout-history.js +120 -0
- package/src/model/lazy-map.js +88 -0
- package/src/model/ledger-pane.js +101 -0
- package/src/model/legacy-viaframe.js +90 -0
- package/src/model/lessons.js +448 -0
- package/src/model/links.js +981 -0
- package/src/model/live.js +411 -0
- package/src/model/math-widget.js +53 -0
- package/src/model/memory-settings.js +33 -0
- package/src/model/midi-controls.js +350 -0
- package/src/model/nl-time.js +408 -0
- package/src/model/notebook.js +137 -0
- package/src/model/pane-view-store.js +15 -0
- package/src/model/partial.js +115 -0
- package/src/model/pause-clock.js +53 -0
- package/src/model/peer-pane.js +32 -0
- package/src/model/persist-state.js +290 -0
- package/src/model/person-only.js +122 -0
- package/src/model/pin.js +209 -0
- package/src/model/plot-3d.js +213 -0
- package/src/model/plot-series.js +157 -0
- package/src/model/plot-settings.js +531 -0
- package/src/model/ports.js +312 -0
- package/src/model/presentation.js +222 -0
- package/src/model/preset-apply.js +316 -0
- package/src/model/preset-banks.js +335 -0
- package/src/model/preset-morph.js +263 -0
- package/src/model/preset-ops.js +205 -0
- package/src/model/preset-player.js +283 -0
- package/src/model/preset-states.js +172 -0
- package/src/model/profile-settings.js +109 -0
- package/src/model/promote.js +103 -0
- package/src/model/protected.js +10 -0
- package/src/model/proxy-log.js +230 -0
- package/src/model/proxy.js +367 -0
- package/src/model/quantity-widget.js +61 -0
- package/src/model/queue-book.js +359 -0
- package/src/model/quick-add.js +224 -0
- package/src/model/rate-limit.js +313 -0
- package/src/model/rate.js +95 -0
- package/src/model/recovery.js +216 -0
- package/src/model/rename-follow.js +113 -0
- package/src/model/repeater.js +1126 -0
- package/src/model/retention.js +664 -0
- package/src/model/route-edit.js +132 -0
- package/src/model/router.js +155 -0
- package/src/model/runaway.js +232 -0
- package/src/model/runlog.js +1033 -0
- package/src/model/runners/a2a.js +2 -0
- package/src/model/runners/acp.js +2 -0
- package/src/model/runners/actions.js +4 -0
- package/src/model/runners/agent.js +4 -0
- package/src/model/runners/audio.js +21 -0
- package/src/model/runners/automation.js +2 -0
- package/src/model/runners/calc.js +23 -0
- package/src/model/runners/catch.js +10 -0
- package/src/model/runners/codec.js +24 -0
- package/src/model/runners/companion-run.js +2 -0
- package/src/model/runners/device.js +7 -0
- package/src/model/runners/dom.js +13 -0
- package/src/model/runners/effects.js +2 -0
- package/src/model/runners/embed.js +11 -0
- package/src/model/runners/eval.js +2 -0
- package/src/model/runners/files.js +19 -0
- package/src/model/runners/geometry.js +23 -0
- package/src/model/runners/goals.js +18 -0
- package/src/model/runners/graph.js +23 -0
- package/src/model/runners/html.js +2 -0
- package/src/model/runners/http-proxy.js +185 -0
- package/src/model/runners/http-send.js +61 -0
- package/src/model/runners/http-static.js +83 -0
- package/src/model/runners/http-tap.js +26 -0
- package/src/model/runners/http.js +40 -0
- package/src/model/runners/import.js +2 -0
- package/src/model/runners/index.js +74 -0
- package/src/model/runners/input.js +14 -0
- package/src/model/runners/inputlog.js +7 -0
- package/src/model/runners/ledger.js +15 -0
- package/src/model/runners/machine.js +4 -0
- package/src/model/runners/mcp.js +2 -0
- package/src/model/runners/mcpapp.js +2 -0
- package/src/model/runners/media.js +18 -0
- package/src/model/runners/memory.js +28 -0
- package/src/model/runners/mesh-inspect.js +13 -0
- package/src/model/runners/peer.js +14 -0
- package/src/model/runners/plot.js +22 -0
- package/src/model/runners/render.js +14 -0
- package/src/model/runners/respond.js +2 -0
- package/src/model/runners/sample-soundfont.js +85 -0
- package/src/model/runners/sample.js +159 -0
- package/src/model/runners/scene.js +8 -0
- package/src/model/runners/score.js +24 -0
- package/src/model/runners/secret.js +10 -0
- package/src/model/runners/select.js +2 -0
- package/src/model/runners/shared.js +4 -0
- package/src/model/runners/shares.js +15 -0
- package/src/model/runners/shell.js +7 -0
- package/src/model/runners/skill.js +26 -0
- package/src/model/runners/state.js +2 -0
- package/src/model/runners/statechart.js +4 -0
- package/src/model/runners/subgraph.js +9 -0
- package/src/model/runners/tabs.js +25 -0
- package/src/model/runners/terminal.js +5 -0
- package/src/model/runners/text.js +4 -0
- package/src/model/runners/timer.js +7 -0
- package/src/model/runners/traffic.js +65 -0
- package/src/model/runners/trigger.js +2 -0
- package/src/model/runners/verdict.js +29 -0
- package/src/model/runners/vm.js +7 -0
- package/src/model/runners/wait.js +4 -0
- package/src/model/runners/ws-client.js +57 -0
- package/src/model/safe-regex.js +719 -0
- package/src/model/sample-settings.js +43 -0
- package/src/model/sample-source.js +47 -0
- package/src/model/saved-mapping.js +153 -0
- package/src/model/score-controllers.js +87 -0
- package/src/model/score-edit.js +399 -0
- package/src/model/score-instruments.js +300 -0
- package/src/model/score-library.js +407 -0
- package/src/model/score-markup.js +235 -0
- package/src/model/score-mix.js +248 -0
- package/src/model/score-patterns.js +276 -0
- package/src/model/score-selection.js +34 -0
- package/src/model/score-time.js +139 -0
- package/src/model/score-transforms.js +336 -0
- package/src/model/score-transport.js +192 -0
- package/src/model/selection.js +351 -0
- package/src/model/serial-controls.js +328 -0
- package/src/model/shares-pane.js +17 -0
- package/src/model/shell-pane.js +106 -0
- package/src/model/signature.js +1122 -0
- package/src/model/size-hints.js +106 -0
- package/src/model/size-ratio.js +12 -0
- package/src/model/skill-settings.js +23 -0
- package/src/model/snapping.js +466 -0
- package/src/model/split.js +375 -0
- package/src/model/spring-player.js +222 -0
- package/src/model/statecharts.js +1369 -0
- package/src/model/states-preset.js +208 -0
- package/src/model/static-route.js +100 -0
- package/src/model/step-words.js +45 -0
- package/src/model/subgraph.js +1042 -0
- package/src/model/switch.js +98 -0
- package/src/model/tabs-store.js +10 -0
- package/src/model/tensor-view.js +146 -0
- package/src/model/timer-clock.js +361 -0
- package/src/model/timers.js +422 -0
- package/src/model/timing.js +212 -0
- package/src/model/traffic-agent.js +111 -0
- package/src/model/traffic-store.js +20 -0
- package/src/model/traffic.js +665 -0
- package/src/model/transport.js +364 -0
- package/src/model/turns.js +86 -0
- package/src/model/types.js +425 -0
- package/src/model/value-path.js +138 -0
- package/src/model/versions.js +535 -0
- package/src/model/view-outputs.js +144 -0
- package/src/model/viewport-bookmarks.js +194 -0
- package/src/model/virtual-clock.js +85 -0
- package/src/model/vm-pane.js +258 -0
- package/src/model/wait-clock.js +715 -0
- package/src/model/wait-persist.js +248 -0
- package/src/model/waits.js +431 -0
- package/src/model/watch.js +80 -0
- package/src/model/webhook.js +496 -0
- package/src/model/when.js +48 -0
- package/src/model/widget-values.js +392 -0
- package/src/model/window-commands.js +278 -0
- package/src/model/windows.js +348 -0
- package/src/model/wire-inspect.js +343 -0
- package/src/model/wire-ops.js +324 -0
- package/src/model/wire-pipeline.js +378 -0
- package/src/model/wire-route.js +637 -0
- package/src/model/workspaces.js +122 -0
- package/src/model/ws-client.js +155 -0
- package/src/model/ws-demo.js +31 -0
- package/src/model/ws-frames.js +141 -0
- package/src/model/ws-hub.js +219 -0
- package/src/model/ws-served.js +13 -0
- package/src/model/xstate.js +374 -0
- package/src/narrative/narrative.js +1557 -0
- package/src/network/auth.js +224 -0
- package/src/network/csp-frame.js +197 -0
- package/src/network/declarative-shadow.js +27 -0
- package/src/network/frame-net-shim.js +962 -0
- package/src/network/hosts.js +157 -0
- package/src/network/policy.js +520 -0
- package/src/network/rtc-shim.js +418 -0
- package/src/network/secret-gate.js +78 -0
- package/src/network/secrets.js +261 -0
- package/src/network/sockets.js +287 -0
- package/src/network/store.js +186 -0
- package/src/network/streams.js +99 -0
- package/src/packages/asset-values.js +50 -0
- package/src/packages/assets.js +99 -0
- package/src/packages/deprecation.js +203 -0
- package/src/packages/fetch.js +152 -0
- package/src/packages/function-canvas.js +73 -0
- package/src/packages/module.js +120 -0
- package/src/packages/package.js +474 -0
- package/src/packages/published.js +27 -0
- package/src/packages/requires.js +83 -0
- package/src/packages/signing.js +145 -0
- package/src/packages/trust.js +107 -0
- package/src/panes/a2a.js +51 -0
- package/src/panes/acp.js +60 -0
- package/src/panes/actions.js +54 -0
- package/src/panes/agent.js +83 -0
- package/src/panes/audio.js +103 -0
- package/src/panes/automation.js +112 -0
- package/src/panes/calc.js +67 -0
- package/src/panes/catch.js +52 -0
- package/src/panes/codec.js +59 -0
- package/src/panes/colors.js +12 -0
- package/src/panes/companion.js +54 -0
- package/src/panes/decision.js +65 -0
- package/src/panes/device.js +56 -0
- package/src/panes/dom.js +37 -0
- package/src/panes/effects.js +118 -0
- package/src/panes/embed.js +30 -0
- package/src/panes/eval.js +186 -0
- package/src/panes/fields.js +299 -0
- package/src/panes/files.js +45 -0
- package/src/panes/gate.js +70 -0
- package/src/panes/geometry.js +64 -0
- package/src/panes/goals.js +75 -0
- package/src/panes/graph.js +66 -0
- package/src/panes/html.js +54 -0
- package/src/panes/http.js +82 -0
- package/src/panes/import.js +38 -0
- package/src/panes/input.js +124 -0
- package/src/panes/inputlog.js +66 -0
- package/src/panes/ledger.js +56 -0
- package/src/panes/machine.js +138 -0
- package/src/panes/mcp.js +85 -0
- package/src/panes/mcpapp.js +64 -0
- package/src/panes/media.js +38 -0
- package/src/panes/memory.js +46 -0
- package/src/panes/mesh-inspect.js +49 -0
- package/src/panes/note.js +38 -0
- package/src/panes/peer.js +44 -0
- package/src/panes/plot.js +196 -0
- package/src/panes/registry.js +475 -0
- package/src/panes/render.js +87 -0
- package/src/panes/respond.js +44 -0
- package/src/panes/router.js +84 -0
- package/src/panes/sample.js +75 -0
- package/src/panes/scene.js +55 -0
- package/src/panes/score.js +87 -0
- package/src/panes/secret.js +38 -0
- package/src/panes/select.js +67 -0
- package/src/panes/shader.js +166 -0
- package/src/panes/shared.js +33 -0
- package/src/panes/shares.js +43 -0
- package/src/panes/shell.js +47 -0
- package/src/panes/skill.js +44 -0
- package/src/panes/state.js +91 -0
- package/src/panes/statechart.js +63 -0
- package/src/panes/story.js +33 -0
- package/src/panes/subgraph.js +94 -0
- package/src/panes/tabs.js +52 -0
- package/src/panes/terminal.js +57 -0
- package/src/panes/text.js +36 -0
- package/src/panes/timer.js +55 -0
- package/src/panes/traffic.js +59 -0
- package/src/panes/verdict.js +62 -0
- package/src/panes/vm.js +46 -0
- package/src/panes/wait.js +61 -0
- package/src/panes/watch.js +57 -0
- package/src/panes/webhook.js +67 -0
- package/src/panes/ws-client.js +67 -0
- package/src/persist.js +281 -0
- package/src/plot/tex.js +19 -0
- package/src/plot/vendor.js +59 -0
- package/src/plot/view-vendor.js +5 -0
- package/src/privacy/levels.js +108 -0
- package/src/protocol/devtools.js +116 -0
- package/src/protocol/inspector.js +368 -0
- package/src/render/time.js +381 -0
- package/src/rooms/mesh-metrics.js +162 -0
- package/src/run/companion.js +355 -0
- package/src/run/describe.js +114 -0
- package/src/run/local-model.js +150 -0
- package/src/run/monitor.js +208 -0
- package/src/run/publish.js +360 -0
- package/src/run/respond-outcome.js +12 -0
- package/src/run/run.js +820 -0
- package/src/run/runner-pairing.js +243 -0
- package/src/run/values.js +122 -0
- package/src/runtime/compile.js +122 -0
- package/src/runtime/console-tag.js +64 -0
- package/src/runtime/frame-signals.js +126 -0
- package/src/runtime/iteration-push.js +19 -0
- package/src/runtime/keys.js +474 -0
- package/src/runtime/midi-input.js +170 -0
- package/src/runtime/person-waits.js +140 -0
- package/src/runtime/resource-timing.js +56 -0
- package/src/runtime/runtime.js +2150 -0
- package/src/runtime/sandbox-modules.js +163 -0
- package/src/runtime/spring.js +246 -0
- package/src/runtime/strict.js +215 -0
- package/src/runtime/transfer.js +75 -0
- package/src/runtime/tween.js +158 -0
- package/src/runtime/wasm-fuel.js +596 -0
- package/src/runtime/worker/00-prelude.js +88 -0
- package/src/runtime/worker/10-helpers.js +295 -0
- package/src/runtime/worker/20-io.js +645 -0
- package/src/runtime/worker/30-previews.js +210 -0
- package/src/runtime/worker/40-profile-lineage.js +278 -0
- package/src/runtime/worker/50-own-worker.js +233 -0
- package/src/runtime/worker/60-timers.js +172 -0
- package/src/runtime/worker/70-state-keyed.js +193 -0
- package/src/runtime/worker/80-each-compile-generators.js +619 -0
- package/src/runtime/worker/90-events-operators.js +655 -0
- package/src/runtime/worker/95-agents-batches.js +1820 -0
- package/src/runtime/worker/96-plot.js +47 -0
- package/src/runtime/worker/97-calc.js +28 -0
- package/src/runtime/worker/98-geometry.js +24 -0
- package/src/runtime/worker/99-graph.js +30 -0
- package/src/runtime/worker/99-shell.js +30 -0
- package/src/safety/config.js +57 -0
- package/src/safety/engine.js +324 -0
- package/src/scene/pixi-scene.js +806 -0
- package/src/scene/scene-assets.js +241 -0
- package/src/scene/scene-edit.js +319 -0
- package/src/secret/settings.js +41 -0
- package/src/security/multipart.js +257 -0
- package/src/security/redact.js +261 -0
- package/src/serial/broker.js +473 -0
- package/src/serial/config.js +185 -0
- package/src/serial/framers.js +389 -0
- package/src/serial/packets.js +64 -0
- package/src/shader/audio-texture.js +87 -0
- package/src/shader/channels.js +496 -0
- package/src/shader/common.js +90 -0
- package/src/shader/model.js +867 -0
- package/src/shader/passes.js +150 -0
- package/src/shader/shadertoy.js +198 -0
- package/src/shell/hub.js +287 -0
- package/src/sim/checkpoints.js +850 -0
- package/src/sim/compile.js +37 -0
- package/src/sim/fixed.js +377 -0
- package/src/sim/headless.js +205 -0
- package/src/sim/physics.js +399 -0
- package/src/smf-helper/vendor.js +2 -0
- package/src/sources/config.js +435 -0
- package/src/storage.js +153 -0
- package/src/table/table-geo.js +2344 -0
- package/src/table/table-lineage.js +808 -0
- package/src/table/table-quality.js +355 -0
- package/src/table/table-schema.js +392 -0
- package/src/table/table-sql.js +1650 -0
- package/src/table/table-stats.js +480 -0
- package/src/table/table.js +2102 -0
- package/src/tensor/tensor.js +1153 -0
- package/src/terminal/hub.js +715 -0
- package/src/terminal/screen.js +516 -0
- package/src/tests/capture.js +88 -0
- package/src/tests/compare.js +480 -0
- package/src/tests/dataset.js +170 -0
- package/src/tests/evaluate.js +286 -0
- package/src/tests/from-runs.js +99 -0
- package/src/tests/judge.js +134 -0
- package/src/tests/matchers.js +263 -0
- package/src/tests/matrix-spec.js +87 -0
- package/src/tests/matrix.js +397 -0
- package/src/tests/metrics.js +369 -0
- package/src/tests/no-value.js +42 -0
- package/src/tests/pane-check.js +45 -0
- package/src/tests/report.js +124 -0
- package/src/tests/reporters.js +140 -0
- package/src/tests/run.js +155 -0
- package/src/tilemap/tilemap.js +1122 -0
- package/src/units/units.js +3 -0
- package/src/util/bytes-text.js +21 -0
- package/src/util/num.js +10 -0
- package/src/util/regexp.js +2 -0
- package/src/util/text.js +38 -0
- package/src/verdict/engine.js +154 -0
- package/src/vm/guest-wsh.js +108 -0
- package/src/vm/hub.js +457 -0
- package/src/vm/image-files.js +4 -0
- package/src/vm/image.js +33 -0
- package/src/vm/image.lock.json +13 -0
- package/src/vm/link.js +266 -0
- package/src/vm/mount.js +212 -0
- package/src/vm/net.js +85 -0
- package/src/vm/pipe-ws.js +187 -0
- package/src/vm/v86-loader.js +11 -0
- package/src/webmcp/args.js +212 -0
- package/src/webmcp/hidden.js +218 -0
- package/src/webmcp/text.js +250 -0
- package/src/webmcp/tools/bookmark-tools.js +106 -0
- package/src/webmcp/tools/breakpoint-tools.js +48 -0
- package/src/webmcp/tools/canvases.js +208 -0
- package/src/webmcp/tools/context-tools.js +84 -0
- package/src/webmcp/tools/core.js +170 -0
- package/src/webmcp/tools/devices.js +41 -0
- package/src/webmcp/tools/edit.js +357 -0
- package/src/webmcp/tools/event-tools.js +145 -0
- package/src/webmcp/tools/image-tools.js +173 -0
- package/src/webmcp/tools/ink-tools.js +247 -0
- package/src/webmcp/tools/input-log-tools.js +163 -0
- package/src/webmcp/tools/live.js +166 -0
- package/src/webmcp/tools/machine-tools.js +74 -0
- package/src/webmcp/tools/media.js +161 -0
- package/src/webmcp/tools/midi-tools.js +32 -0
- package/src/webmcp/tools/preset-tools.js +184 -0
- package/src/webmcp/tools/quick-add-tools.js +95 -0
- package/src/webmcp/tools/reshape.js +152 -0
- package/src/webmcp/tools/run-tools.js +309 -0
- package/src/webmcp/tools/runs.js +101 -0
- package/src/webmcp/tools/scaffold-tools.js +161 -0
- package/src/webmcp/tools/serial-tools.js +36 -0
- package/src/webmcp/tools/shared.js +338 -0
- package/src/webmcp/tools/subgraphs.js +360 -0
- package/src/webmcp/tools/tests.js +170 -0
- package/src/webmcp/tools/traffic-tools.js +70 -0
- package/src/webmcp/tools/transport-tools.js +65 -0
- package/src/webmcp/tools/version-tools.js +126 -0
- package/src/webmcp/tools/versions.js +11 -0
- package/src/webmcp/tools/wire-tools.js +90 -0
- package/src/webmcp/tools/workspace-tools.js +93 -0
- package/src/webmcp/tools.js +1323 -0
- package/src/wsh/connect.js +347 -0
- package/src/wsh/demo-host.js +361 -0
- package/src/wsh/e2e.js +27 -0
- package/src/wsh/keys.js +154 -0
- package/src/wsh/known-hosts.js +39 -0
- package/src/wsh/private-key.js +95 -0
- package/src/wsh/reverse.js +34 -0
- package/src/wsh/settings.js +118 -0
- package/src/wsh/transfer.js +62 -0
- package/src/wsh/vendor.js +5 -0
- package/src/x402/challenge.js +171 -0
- package/src/x402/demo-server.js +127 -0
- package/src/x402/pay.js +125 -0
- package/src/x402/retry.js +95 -0
- package/src/x402/store.js +76 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*! avsc@5.7.9 (MIT), bundled into one ES module by scripts/build-codec-vendor.mjs. Do not edit.
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2017, Matthieu Monsch.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Also bundled: buffer@6.0.3 (MIT)
|
|
24
|
+
|
|
25
|
+
The MIT License (MIT)
|
|
26
|
+
|
|
27
|
+
Copyright (c) Feross Aboukhadijeh, and other contributors.
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
30
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
31
|
+
in the Software without restriction, including without limitation the rights
|
|
32
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
33
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
34
|
+
furnished to do so, subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be included in
|
|
37
|
+
all copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
42
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
43
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
44
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
45
|
+
THE SOFTWARE.
|
|
46
|
+
|
|
47
|
+
Also bundled: base64-js@1.5.1 (MIT)
|
|
48
|
+
|
|
49
|
+
The MIT License (MIT)
|
|
50
|
+
|
|
51
|
+
Copyright (c) 2014 Jameson Little
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
54
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
55
|
+
in the Software without restriction, including without limitation the rights
|
|
56
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
57
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
58
|
+
furnished to do so, subject to the following conditions:
|
|
59
|
+
|
|
60
|
+
The above copyright notice and this permission notice shall be included in
|
|
61
|
+
all copies or substantial portions of the Software.
|
|
62
|
+
|
|
63
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
64
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
65
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
66
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
67
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
68
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
69
|
+
THE SOFTWARE.
|
|
70
|
+
|
|
71
|
+
Also bundled: ieee754@1.2.1 (BSD-3-Clause)
|
|
72
|
+
|
|
73
|
+
Copyright 2008 Fair Oaks Labs, Inc.
|
|
74
|
+
|
|
75
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
76
|
+
|
|
77
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
78
|
+
|
|
79
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
80
|
+
|
|
81
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
82
|
+
|
|
83
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
84
|
+
*/
|
|
85
|
+
var Kt=Object.create;var Ae=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty;var ir=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var pe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},or=(t,e)=>{for(var r in e)Ae(t,r,{get:e[r],enumerable:!0})},ut=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tr(e))!nr.call(t,i)&&i!==r&&Ae(t,i,{get:()=>e[i],enumerable:!(n=er(e,i))||n.enumerable});return t};var ft=(t,e,r)=>(r=t!=null?Kt(rr(t)):{},ut(e||!t||!t.__esModule?Ae(r,"default",{value:t,enumerable:!0}):r,t)),st=t=>ut(Ae({},"__esModule",{value:!0}),t);var pt=pe(Se=>{"use strict";Se.byteLength=fr;Se.toByteArray=ar;Se.fromByteArray=hr;var Y=[],q=[],ur=typeof Uint8Array<"u"?Uint8Array:Array,Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(he=0,at=Ce.length;he<at;++he)Y[he]=Ce[he],q[Ce.charCodeAt(he)]=he;var he,at;q[45]=62;q[95]=63;function ct(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function fr(t){var e=ct(t),r=e[0],n=e[1];return(r+n)*3/4-n}function sr(t,e,r){return(e+r)*3/4-r}function ar(t){var e,r=ct(t),n=r[0],i=r[1],o=new ur(sr(t,n,i)),u=0,f=i>0?n-4:n,a;for(a=0;a<f;a+=4)e=q[t.charCodeAt(a)]<<18|q[t.charCodeAt(a+1)]<<12|q[t.charCodeAt(a+2)]<<6|q[t.charCodeAt(a+3)],o[u++]=e>>16&255,o[u++]=e>>8&255,o[u++]=e&255;return i===2&&(e=q[t.charCodeAt(a)]<<2|q[t.charCodeAt(a+1)]>>4,o[u++]=e&255),i===1&&(e=q[t.charCodeAt(a)]<<10|q[t.charCodeAt(a+1)]<<4|q[t.charCodeAt(a+2)]>>2,o[u++]=e>>8&255,o[u++]=e&255),o}function cr(t){return Y[t>>18&63]+Y[t>>12&63]+Y[t>>6&63]+Y[t&63]}function pr(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(cr(n));return i.join("")}function hr(t){for(var e,r=t.length,n=r%3,i=[],o=16383,u=0,f=r-n;u<f;u+=o)i.push(pr(t,u,u+o>f?f:u+o));return n===1?(e=t[r-1],i.push(Y[e>>2]+Y[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Y[e>>10]+Y[e>>4&63]+Y[e<<2&63]+"=")),i.join("")}});var ht=pe(je=>{je.read=function(t,e,r,n,i){var o,u,f=i*8-n-1,a=(1<<f)-1,p=a>>1,l=-7,h=r?i-1:0,w=r?-1:1,_=t[e+h];for(h+=w,o=_&(1<<-l)-1,_>>=-l,l+=f;l>0;o=o*256+t[e+h],h+=w,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=n;l>0;u=u*256+t[e+h],h+=w,l-=8);if(o===0)o=1-p;else{if(o===a)return u?NaN:(_?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-p}return(_?-1:1)*u*Math.pow(2,o-n)};je.write=function(t,e,r,n,i,o){var u,f,a,p=o*8-i-1,l=(1<<p)-1,h=l>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:o-1,g=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+h>=1?e+=w/a:e+=w*Math.pow(2,1-h),e*a>=2&&(u++,a/=2),u+h>=l?(f=0,u=l):u+h>=1?(f=(e*a-1)*Math.pow(2,i),u=u+h):(f=e*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[r+_]=f&255,_+=g,f/=256,i-=8);for(u=u<<i|f,p+=i;p>0;t[r+_]=u&255,_+=g,u/=256,p-=8);t[r+_-g]|=v*128}});var Ee=pe(xe=>{"use strict";var Re=pt(),we=ht(),lt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;xe.Buffer=s;xe.SlowBuffer=wr;xe.INSPECT_MAX_BYTES=50;var Ne=2147483647;xe.kMaxLength=Ne;s.TYPED_ARRAY_SUPPORT=lr();!s.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 lr(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function ee(t){if(t>Ne)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Pe(t)}return gt(t,e,r)}s.poolSize=8192;function gt(t,e,r){if(typeof t=="string")return dr(t,e);if(ArrayBuffer.isView(t))return mr(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return De(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,e,r);let i=gr(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,e,r){return gt(t,e,r)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function wt(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function yr(t,e,r){return wt(t),t<=0?ee(t):e!==void 0?typeof r=="string"?ee(t).fill(e,r):ee(t).fill(e):ee(t)}s.alloc=function(t,e,r){return yr(t,e,r)};function Pe(t){return wt(t),ee(t<0?0:ze(t)|0)}s.allocUnsafe=function(t){return Pe(t)};s.allocUnsafeSlow=function(t){return Pe(t)};function dr(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=_t(t,e)|0,n=ee(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Ve(t){let e=t.length<0?0:ze(t.length)|0,r=ee(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function mr(t){if(X(t,Uint8Array)){let e=new Uint8Array(t);return De(e.buffer,e.byteOffset,e.byteLength)}return Ve(t)}function De(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function gr(t){if(s.isBuffer(t)){let e=ze(t.length)|0,r=ee(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||qe(t.length)?ee(0):Ve(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ve(t.data)}function ze(t){if(t>=Ne)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ne.toString(16)+" bytes");return t|0}function wr(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype};s.compare=function(e,r){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),X(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(e)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,u=Math.min(n,i);o<u;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};s.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}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=s.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let u=e[n];if(X(u,Uint8Array))o+u.length>i.length?(s.isBuffer(u)||(u=s.from(u)),u.copy(i,o)):Uint8Array.prototype.set.call(i,u,o);else if(s.isBuffer(u))u.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return i};function _t(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Me(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return At(t).length;default:if(i)return n?-1:Me(t).length;e=(""+e).toLowerCase(),i=!0}}s.byteLength=_t;function _r(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Sr(this,e,r);case"utf8":case"utf-8":return bt(this,e,r);case"ascii":return Ir(this,e,r);case"latin1":case"binary":return Ar(this,e,r);case"base64":return Fr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function le(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)le(this,r,r+1);return this};s.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)le(this,r,r+3),le(this,r+1,r+2);return this};s.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)le(this,r,r+7),le(this,r+1,r+6),le(this,r+2,r+5),le(this,r+3,r+4);return this};s.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?bt(this,0,e):_r.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.inspect=function(){let e="",r=xe.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};lt&&(s.prototype[lt]=s.prototype.inspect);s.prototype.compare=function(e,r,n,i,o){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let u=o-i,f=n-r,a=Math.min(u,f),p=this.slice(i,o),l=e.slice(r,n);for(let h=0;h<a;++h)if(p[h]!==l[h]){u=p[h],f=l[h];break}return u<f?-1:f<u?1:0};function xt(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,qe(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),s.isBuffer(e))return e.length===0?-1:yt(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):yt(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function yt(t,e,r,n,i){let o=1,u=t.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,u/=2,f/=2,r/=2}function a(l,h){return o===1?l[h]:l.readUInt16BE(h*o)}let p;if(i){let l=-1;for(p=r;p<u;p++)if(a(t,p)===a(e,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===f)return l*o}else l!==-1&&(p-=p-l),l=-1}else for(r+f>u&&(r=u-f),p=r;p>=0;p--){let l=!0;for(let h=0;h<f;h++)if(a(t,p+h)!==a(e,h)){l=!1;break}if(l)return p}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return xt(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return xt(this,e,r,n,!1)};function xr(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let u;for(u=0;u<n;++u){let f=parseInt(e.substr(u*2,2),16);if(qe(f))return u;t[r+u]=f}return u}function br(t,e,r,n){return ke(Me(e,t.length-r),t,r,n)}function vr(t,e,r,n){return ke(Or(e),t,r,n)}function Br(t,e,r,n){return ke(At(e),t,r,n)}function Er(t,e,r,n){return ke(Cr(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let u=!1;for(;;)switch(i){case"hex":return xr(this,e,r,n);case"utf8":case"utf-8":return br(this,e,r,n);case"ascii":case"latin1":case"binary":return vr(this,e,r,n);case"base64":return Br(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Er(this,e,r,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fr(t,e,r){return e===0&&r===t.length?Re.fromByteArray(t):Re.fromByteArray(t.slice(e,r))}function bt(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],u=null,f=o>239?4:o>223?3:o>191?2:1;if(i+f<=r){let a,p,l,h;switch(f){case 1:o<128&&(u=o);break;case 2:a=t[i+1],(a&192)===128&&(h=(o&31)<<6|a&63,h>127&&(u=h));break;case 3:a=t[i+1],p=t[i+2],(a&192)===128&&(p&192)===128&&(h=(o&15)<<12|(a&63)<<6|p&63,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:a=t[i+1],p=t[i+2],l=t[i+3],(a&192)===128&&(p&192)===128&&(l&192)===128&&(h=(o&15)<<18|(a&63)<<12|(p&63)<<6|l&63,h>65535&&h<1114112&&(u=h))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=f}return Tr(n)}var dt=4096;function Tr(t){let e=t.length;if(e<=dt)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=dt));return r}function Ir(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Ar(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Sr(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=jr[t[o]];return i}function Nr(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,s.prototype),i};function F(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=this[e],o=1,u=0;for(;++u<r&&(o*=256);)i+=this[e+u]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(e,r){return e=e>>>0,r||F(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||F(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||F(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readBigUInt64LE=oe(function(e){e=e>>>0,_e(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Be(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});s.prototype.readBigUInt64BE=oe(function(e){e=e>>>0,_e(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Be(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});s.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=this[e],o=1,u=0;for(;++u<r&&(o*=256);)i+=this[e+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};s.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=r,o=1,u=this[e+--i];for(;i>0&&(o*=256);)u+=this[e+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*r)),u};s.prototype.readInt8=function(e,r){return e=e>>>0,r||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){e=e>>>0,r||F(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){e=e>>>0,r||F(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readBigInt64LE=oe(function(e){e=e>>>0,_e(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Be(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});s.prototype.readBigInt64BE=oe(function(e){e=e>>>0,_e(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Be(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});s.prototype.readFloatLE=function(e,r){return e=e>>>0,r||F(e,4,this.length),we.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return e=e>>>0,r||F(e,4,this.length),we.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||F(e,8,this.length),we.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||F(e,8,this.length),we.read(this,e,!1,52,8)};function C(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let f=Math.pow(2,8*n)-1;C(this,e,r,n,f,0)}let o=1,u=0;for(this[r]=e&255;++u<n&&(o*=256);)this[r+u]=e/o&255;return r+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let f=Math.pow(2,8*n)-1;C(this,e,r,n,f,0)}let o=n-1,u=1;for(this[r+o]=e&255;--o>=0&&(u*=256);)this[r+o]=e/u&255;return r+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,1,255,0),this[r]=e&255,r+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function vt(t,e,r,n,i){It(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=u,u=u>>8,t[r++]=u,u=u>>8,t[r++]=u,u=u>>8,t[r++]=u,r}function Bt(t,e,r,n,i){It(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=u,u=u>>8,t[r+2]=u,u=u>>8,t[r+1]=u,u=u>>8,t[r]=u,r+8}s.prototype.writeBigUInt64LE=oe(function(e,r=0){return vt(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeBigUInt64BE=oe(function(e,r=0){return Bt(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let a=Math.pow(2,8*n-1);C(this,e,r,n,a-1,-a)}let o=0,u=1,f=0;for(this[r]=e&255;++o<n&&(u*=256);)e<0&&f===0&&this[r+o-1]!==0&&(f=1),this[r+o]=(e/u>>0)-f&255;return r+n};s.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let a=Math.pow(2,8*n-1);C(this,e,r,n,a-1,-a)}let o=n-1,u=1,f=0;for(this[r+o]=e&255;--o>=0&&(u*=256);)e<0&&f===0&&this[r+o+1]!==0&&(f=1),this[r+o]=(e/u>>0)-f&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||C(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};s.prototype.writeBigInt64LE=oe(function(e,r=0){return vt(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});s.prototype.writeBigInt64BE=oe(function(e,r=0){return Bt(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Et(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ft(t,e,r,n,i){return e=+e,r=r>>>0,i||Et(t,e,r,4,34028234663852886e22,-34028234663852886e22),we.write(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return Ft(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return Ft(this,e,r,!1,n)};function Tt(t,e,r,n,i){return e=+e,r=r>>>0,i||Et(t,e,r,8,17976931348623157e292,-17976931348623157e292),we.write(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return Tt(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return Tt(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,i){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};s.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let u=e.charCodeAt(0);(i==="utf8"&&u<128||i==="latin1")&&(e=u)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let u=s.isBuffer(e)?e:s.from(e,i),f=u.length;if(f===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=u[o%f]}return this};var ge={};function $e(t,e,r){ge[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}$e("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);$e("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);$e("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=mt(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=mt(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function mt(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function kr(t,e,r){_e(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Be(e,t.length-(r+1))}function It(t,e,r,n,i,o){if(t>r||t<e){let u=typeof e=="bigint"?"n":"",f;throw o>3?e===0||e===BigInt(0)?f=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:f=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:f=`>= ${e}${u} and <= ${r}${u}`,new ge.ERR_OUT_OF_RANGE("value",f,t)}kr(n,i,o)}function _e(t,e){if(typeof t!="number")throw new ge.ERR_INVALID_ARG_TYPE(e,"number",t)}function Be(t,e,r){throw Math.floor(t)!==t?(_e(t,r),new ge.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new ge.ERR_BUFFER_OUT_OF_BOUNDS:new ge.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Ur=/[^+/0-9A-Za-z-_]/g;function Lr(t){if(t=t.split("=")[0],t=t.trim().replace(Ur,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Me(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Or(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Cr(t,e){let r,n,i,o=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function At(t){return Re.toByteArray(Lr(t))}function ke(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function qe(t){return t!==t}var jr=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e})();function oe(t){return typeof BigInt>"u"?Rr:t}function Rr(){throw new Error("BigInt not supported")}});var Nt=pe((En,St)=>{"use strict";var Vr=Ee(),Je=Vr.Buffer;function Dr(t){if(t!=="md5")throw new Error("only md5 is supported in the browser");return new We}function We(){this.data=void 0}We.prototype.end=function(t){this.data=t};We.prototype.read=function(){return zr(this.data)};function He(t,e){var r=t[0],n=t[1],i=t[2],o=t[3];r=A(r,n,i,o,e[0],7,-680876936),o=A(o,r,n,i,e[1],12,-389564586),i=A(i,o,r,n,e[2],17,606105819),n=A(n,i,o,r,e[3],22,-1044525330),r=A(r,n,i,o,e[4],7,-176418897),o=A(o,r,n,i,e[5],12,1200080426),i=A(i,o,r,n,e[6],17,-1473231341),n=A(n,i,o,r,e[7],22,-45705983),r=A(r,n,i,o,e[8],7,1770035416),o=A(o,r,n,i,e[9],12,-1958414417),i=A(i,o,r,n,e[10],17,-42063),n=A(n,i,o,r,e[11],22,-1990404162),r=A(r,n,i,o,e[12],7,1804603682),o=A(o,r,n,i,e[13],12,-40341101),i=A(i,o,r,n,e[14],17,-1502002290),n=A(n,i,o,r,e[15],22,1236535329),r=S(r,n,i,o,e[1],5,-165796510),o=S(o,r,n,i,e[6],9,-1069501632),i=S(i,o,r,n,e[11],14,643717713),n=S(n,i,o,r,e[0],20,-373897302),r=S(r,n,i,o,e[5],5,-701558691),o=S(o,r,n,i,e[10],9,38016083),i=S(i,o,r,n,e[15],14,-660478335),n=S(n,i,o,r,e[4],20,-405537848),r=S(r,n,i,o,e[9],5,568446438),o=S(o,r,n,i,e[14],9,-1019803690),i=S(i,o,r,n,e[3],14,-187363961),n=S(n,i,o,r,e[8],20,1163531501),r=S(r,n,i,o,e[13],5,-1444681467),o=S(o,r,n,i,e[2],9,-51403784),i=S(i,o,r,n,e[7],14,1735328473),n=S(n,i,o,r,e[12],20,-1926607734),r=N(r,n,i,o,e[5],4,-378558),o=N(o,r,n,i,e[8],11,-2022574463),i=N(i,o,r,n,e[11],16,1839030562),n=N(n,i,o,r,e[14],23,-35309556),r=N(r,n,i,o,e[1],4,-1530992060),o=N(o,r,n,i,e[4],11,1272893353),i=N(i,o,r,n,e[7],16,-155497632),n=N(n,i,o,r,e[10],23,-1094730640),r=N(r,n,i,o,e[13],4,681279174),o=N(o,r,n,i,e[0],11,-358537222),i=N(i,o,r,n,e[3],16,-722521979),n=N(n,i,o,r,e[6],23,76029189),r=N(r,n,i,o,e[9],4,-640364487),o=N(o,r,n,i,e[12],11,-421815835),i=N(i,o,r,n,e[15],16,530742520),n=N(n,i,o,r,e[2],23,-995338651),r=k(r,n,i,o,e[0],6,-198630844),o=k(o,r,n,i,e[7],10,1126891415),i=k(i,o,r,n,e[14],15,-1416354905),n=k(n,i,o,r,e[5],21,-57434055),r=k(r,n,i,o,e[12],6,1700485571),o=k(o,r,n,i,e[3],10,-1894986606),i=k(i,o,r,n,e[10],15,-1051523),n=k(n,i,o,r,e[1],21,-2054922799),r=k(r,n,i,o,e[8],6,1873313359),o=k(o,r,n,i,e[15],10,-30611744),i=k(i,o,r,n,e[6],15,-1560198380),n=k(n,i,o,r,e[13],21,1309151649),r=k(r,n,i,o,e[4],6,-145523070),o=k(o,r,n,i,e[11],10,-1120210379),i=k(i,o,r,n,e[2],15,718787259),n=k(n,i,o,r,e[9],21,-343485551),t[0]=ue(r,t[0]),t[1]=ue(n,t[1]),t[2]=ue(i,t[2]),t[3]=ue(o,t[3])}function Ue(t,e,r,n,i,o){return e=ue(ue(e,t),ue(n,o)),ue(e<<i|e>>>32-i,r)}function A(t,e,r,n,i,o,u){return Ue(e&r|~e&n,t,e,i,o,u)}function S(t,e,r,n,i,o,u){return Ue(e&n|r&~n,t,e,i,o,u)}function N(t,e,r,n,i,o,u){return Ue(e^r^n,t,e,i,o,u)}function k(t,e,r,n,i,o,u){return Ue(r^(e|~n),t,e,i,o,u)}function Mr(t){var e=t.length,r=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=t.length;n+=64)He(r,Pr(t.substring(n-64,n)));t=t.substring(n-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<t.length;n++)i[n>>2]|=t.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(He(r,i),n=0;n<16;n++)i[n]=0;return i[14]=e*8,He(r,i),r}function Pr(t){var e=[],r;for(r=0;r<64;r+=4)e[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return e}function zr(t){var e=Mr(t),r=Je.alloc?Je.alloc(16):new Je(16),n;for(n=0;n<4;n++)r.writeIntLE(e[n],n*4,4);return r}function ue(t,e){return t+e&4294967295}St.exports={createHash:Dr}});var Ge={};or(Ge,{debuglog:()=>Ot,default:()=>$r,deprecate:()=>Lt,format:()=>Ut,inherits:()=>kt});function kt(t,e){t.super_=e,Object.setPrototypeOf(t.prototype,e.prototype)}function Ut(t,...e){if(typeof t!="string")return[t,...e].map(String).join(" ");let r=0;return[t.replace(/%[sdj%]/g,i=>i==="%%"?"%":r>=e.length?i:i==="%s"?String(e[r++]):i==="%d"?String(Number(e[r++])):JSON.stringify(e[r++])),...e.slice(r).map(String)].join(" ")}function Lt(t){return t}function Ot(){return()=>{}}var $r,Ye=ir(()=>{$r={inherits:kt,format:Ut,deprecate:Lt,debuglog:Ot}});var Pt=pe((Fn,Mt)=>{"use strict";var Ct=Ee(),qr=Nt(),jt=(Ye(),st(Ge)),P=Ct.Buffer,Jr=new Qe(4096),Hr=/^[A-Za-z_][A-Za-z0-9_]*$/,Wr=jt.format;function Fe(t){return typeof P.alloc=="function"?P.alloc(t):new P(t)}function Gr(t){return typeof P.allocUnsafeSlow=="function"?P.allocUnsafeSlow(t):new Ct.SlowBuffer(t)}function Rt(t,e){return typeof P.from=="function"?P.from(t,e):new P(t,e)}function Vt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Yr(t,e){return t===e?0:t<e?-1:1}function Xr(t,e,r){var n=t[e];return n===void 0?r:n}function Qr(t,e){e=e||"md5";var r=qr.createHash(e);return r.end(t),r.read()}function Zr(t,e){var r=-1,n,i;if(!t)return-1;for(n=0,i=t.length;n<i;n++)if(t[n]===e){if(r>=0)return-2;r=n}return r}function Kr(t,e){var r={},n,i;for(n=0;n<t.length;n++)i=t[n],r[e(i)]=i;return r}function en(t){return Object.keys(t).map(function(e){return t[e]})}function tn(t,e){var r=Object.create(null),n,i,o;for(n=0,i=t.length;n<i;n++){if(o=t[n],e&&(o=e(o)),r[o])return!0;r[o]=!0}return!1}function rn(t,e,r){var n=Object.getOwnPropertyNames(t),i,o,u;for(i=0,o=n.length;i<o;i++)if(u=n[i],!e.hasOwnProperty(u)||r){var f=Object.getOwnPropertyDescriptor(t,u);Object.defineProperty(e,u,f)}return e}function Dt(t){return Hr.test(t)}function nn(t,e){return~t.indexOf(".")?t=t.replace(/^\./,""):e&&(t=e+"."+t),t.split(".").forEach(function(r){if(!Dt(r))throw new Error(Wr("invalid name: %j",t))}),t}function on(t){var e=t.split(".");return e[e.length-1]}function un(t){var e=/^(.*)\.[^.]+$/.exec(t);return e?e[1]:void 0}function fn(t,e){e=e|0;var r=t.charAt(e++);if(/[\d-]/.test(r)){for(;/[eE\d.+-]/.test(t.charAt(e));)e++;return e}else{if(/true|null/.test(t.slice(e-1,e+3)))return e+3;if(/false/.test(t.slice(e-1,e+4)))return e+4}var n=0,i=!1;do switch(r){case"{":case"[":i||n++;break;case"}":case"]":if(!i&&!--n)return e;break;case'"':if(i=!i,!n&&!i)return e;break;case"\\":e++}while(r=t.charAt(e++));return-1}function sn(){throw new Error("abstract")}function an(t,e){var r=t.prototype,n,i,o,u;for(n=0,i=e.length;n<i;n++)o=e[n],u="get"+Vt(o),r[u]=jt.deprecate(f(o),"use `."+o+"` instead of `."+u+"()`");function f(a){return function(){var p=this[a];return typeof p=="function"?p.apply(this,arguments):p}}}function Qe(t){this._len=t|0,this._pos=0,this._slab=Fe(this._len)}Qe.prototype.alloc=function(t){if(t<0)throw new Error("negative length");var e=this._len;return t>e?Fe(t):(this._pos+t>e&&(this._slab=Fe(e),this._pos=0),this._slab.slice(this._pos,this._pos+=t))};function ye(t){var e=1103515245,r=12345,n=Math.pow(2,31),i=Math.floor(t||Math.random()*(n-1));this._max=n,this._nextInt=function(){return i=(e*i+r)%n}}ye.prototype.nextBoolean=function(){return!!(this._nextInt()%2)};ye.prototype.nextInt=function(t,e){return e===void 0&&(e=t,t=0),e=e===void 0?this._max:e,t+Math.floor(this.nextFloat()*(e-t))};ye.prototype.nextFloat=function(t,e){return e===void 0&&(e=t,t=0),e=e===void 0?1:e,t+(e-t)*this._nextInt()/this._max};ye.prototype.nextString=function(t,e){t|=0,e=e||"aA";var r="";e.indexOf("a")>-1&&(r+="abcdefghijklmnopqrstuvwxyz"),e.indexOf("A")>-1&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.indexOf("#")>-1&&(r+="0123456789"),e.indexOf("!")>-1&&(r+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var n=[],i=0;i<t;i++)n.push(this.choice(r));return n.join("")};ye.prototype.nextBuffer=function(t){var e=[],r;for(r=0;r<t;r++)e.push(this.nextInt(256));return Rt(e)};ye.prototype.choice=function(t){var e=t.length;if(!e)throw new Error("choosing from empty array");return t[this.nextInt(e)]};function Ze(){this._index=0,this._items=[]}Ze.prototype.push=function(t){var e=this._items,r=e.length|0,n;for(e.push(t);r>0&&e[r].index<e[n=r-1>>1].index;)t=e[r],e[r]=e[n],e[n]=t,r=n};Ze.prototype.pop=function(){var t=this._items,e=t.length-1|0,r=t[0];if(!r||r.index>this._index)return null;if(this._index++,!e)return t.pop(),r;t[0]=t.pop();for(var n=e>>1,i=0,o,u,f,a,p,l,h;i<n&&(a=t[i],o=(i<<1)+1,u=i+1<<1,l=t[o],h=t[u],!h||l.index<=h.index?(p=l,f=o):(p=h,f=u),!(p.index>=a.index));)t[f]=a,t[i]=p,i=f;return r};function d(t,e){if(this.buf=t,this.pos=e|0,this.pos<0)throw new Error("negative offset")}d.prototype.isValid=function(){return this.pos<=this.buf.length};d.prototype._invalidate=function(){this.pos=this.buf.length+1};d.prototype.readBoolean=function(){return!!this.buf[this.pos++]};d.prototype.skipBoolean=function(){this.pos++};d.prototype.writeBoolean=function(t){this.buf[this.pos++]=!!t};d.prototype.readInt=d.prototype.readLong=function(){var t=0,e=0,r=this.buf,n,i,o,u;do n=r[this.pos++],i=n&128,t|=(n&127)<<e,e+=7;while(i&&e<28);if(i){o=t,u=268435456;do n=r[this.pos++],o+=(n&127)*u,u*=128;while(n&128);return(o%2?-(o+1):o)/2}return t>>1^-(t&1)};d.prototype.skipInt=d.prototype.skipLong=function(){for(var t=this.buf;t[this.pos++]&128;);};d.prototype.writeInt=d.prototype.writeLong=function(t){var e=this.buf,r,n;if(t>=-1073741824&&t<1073741824){n=t>=0?t<<1:~t<<1|1;do e[this.pos]=n&127,n>>=7;while(n&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++};d.prototype.readFloat=function(){var t=this.buf,e=this.pos;return this.pos+=4,this.pos>t.length?0:this.buf.readFloatLE(e)};d.prototype.skipFloat=function(){this.pos+=4};d.prototype.writeFloat=function(t){var e=this.buf,r=this.pos;if(this.pos+=4,!(this.pos>e.length))return this.buf.writeFloatLE(t,r)};d.prototype.readDouble=function(){var t=this.buf,e=this.pos;return this.pos+=8,this.pos>t.length?0:this.buf.readDoubleLE(e)};d.prototype.skipDouble=function(){this.pos+=8};d.prototype.writeDouble=function(t){var e=this.buf,r=this.pos;if(this.pos+=8,!(this.pos>e.length))return this.buf.writeDoubleLE(t,r)};d.prototype.readFixed=function(t){var e=this.pos;if(this.pos+=t,!(this.pos>this.buf.length)){var r=Jr.alloc(t);return this.buf.copy(r,0,e,e+t),r}};d.prototype.skipFixed=function(t){this.pos+=t};d.prototype.writeFixed=function(t,e){e=e||t.length;var r=this.pos;this.pos+=e,!(this.pos>this.buf.length)&&t.copy(this.buf,r,0,e)};d.prototype.readBytes=function(){var t=this.readLong();if(t<0){this._invalidate();return}return this.readFixed(t)};d.prototype.skipBytes=function(){var t=this.readLong();if(t<0){this._invalidate();return}this.pos+=t};d.prototype.writeBytes=function(t){var e=t.length;this.writeLong(e),this.writeFixed(t,e)};typeof P.prototype.utf8Slice=="function"?d.prototype.readString=function(){var t=this.readLong();if(t<0)return this._invalidate(),"";var e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.utf8Slice(e,e+t)}:d.prototype.readString=function(){var t=this.readLong();if(t<0)return this._invalidate(),"";var e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()};d.prototype.skipString=function(){var t=this.readLong();if(t<0){this._invalidate();return}this.pos+=t};d.prototype.writeString=function(t){var e=P.byteLength(t),r=this.buf;this.writeLong(e);var n=this.pos;if(this.pos+=e,!(this.pos>r.length))if(e>64&&typeof P.prototype.utf8Write=="function")r.utf8Write(t,n,e);else{var i,o,u,f;for(i=0,o=e;i<o;i++)u=t.charCodeAt(i),u<128?r[n++]=u:u<2048?(r[n++]=u>>6|192,r[n++]=u&63|128):(u&64512)===55296&&((f=t.charCodeAt(i+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),i++,r[n++]=u>>18|240,r[n++]=u>>12&63|128,r[n++]=u>>6&63|128,r[n++]=u&63|128):(r[n++]=u>>12|224,r[n++]=u>>6&63|128,r[n++]=u&63|128)}};typeof P.prototype.latin1Write=="function"?d.prototype.writeBinary=function(t,e){var r=this.pos;this.pos+=e,!(this.pos>this.buf.length)&&this.buf.latin1Write(t,r,e)}:typeof P.prototype.binaryWrite=="function"?d.prototype.writeBinary=function(t,e){var r=this.pos;this.pos+=e,!(this.pos>this.buf.length)&&this.buf.binaryWrite(t,r,e)}:d.prototype.writeBinary=function(t,e){var r=this.pos;this.pos+=e,!(this.pos>this.buf.length)&&this.buf.write(t,r,e,"binary")};d.prototype.matchBoolean=function(t){return this.buf[this.pos++]-t.buf[t.pos++]};d.prototype.matchInt=d.prototype.matchLong=function(t){var e=this.readLong(),r=t.readLong();return e===r?0:e<r?-1:1};d.prototype.matchFloat=function(t){var e=this.readFloat(),r=t.readFloat();return e===r?0:e<r?-1:1};d.prototype.matchDouble=function(t){var e=this.readDouble(),r=t.readDouble();return e===r?0:e<r?-1:1};d.prototype.matchFixed=function(t,e){return this.readFixed(e).compare(t.readFixed(e))};d.prototype.matchBytes=d.prototype.matchString=function(t){var e=this.readLong(),r=this.pos;this.pos+=e;var n=t.readLong(),i=t.pos;t.pos+=n;var o=this.buf.slice(r,this.pos),u=t.buf.slice(i,t.pos);return o.compare(u)};d.prototype.unpackLongBytes=function(){var t=Fe(8),e=0,r=0,n=6,i=this.buf,o,u;for(o=i[this.pos++],u=o&1,t.fill(0),e|=(o&127)>>1;o&128;)o=i[this.pos++],e|=(o&127)<<n,n+=7,n>=8&&(n-=8,t[r++]=e,e>>=8);return t[r]=e,u&&Xe(t,8),t};d.prototype.packLongBytes=function(t){var e=(t[7]&128)>>7,r=this.buf,n=1,i=0,o=3,u;e?(Xe(t,8),u=1):u=0;for(var f=[t.readUIntLE(0,3),t.readUIntLE(3,3),t.readUIntLE(6,2)];o&&!f[--o];);for(;i<o;)for(u|=f[i++]<<n,n+=24;n>7;)r[this.pos++]=u&127|128,u>>=7,n-=7;u|=f[o]<<n;do r[this.pos]=u&127,u>>=7;while(u&&(r[this.pos++]|=128));this.pos++,e&&Xe(t,8)};function Xe(t,e){for(;e--;)t[e]=~t[e]}Mt.exports={abstractFunction:sn,addDeprecatedGetters:an,bufferFrom:Rt,capitalize:Vt,copyOwnProperties:rn,getHash:Qr,compare:Yr,getOption:Xr,impliedNamespace:un,isValidName:Dt,jsonEnd:fn,newBuffer:Fe,newSlowBuffer:Gr,objectValues:en,qualify:nn,toMap:Kr,singleIndexOf:Zr,hasDuplicates:tn,unqualify:on,BufferPool:Qe,Lcg:ye,OrderedQueue:Ze,Tap:d}});var Gt=pe((Tn,Wt)=>{"use strict";var y=Pt(),cn=Ee(),E=(Ye(),st(Ge)),fe=cn.Buffer,me=y.Tap,Ke=E.debuglog("avsc:types"),m=E.format,Le={array:D,boolean:re,bytes:$,double:Z,enum:R,error:B,fixed:V,float:Q,int:ne,long:z,map:L,null:J,record:B,string:G},I=new y.Lcg,de=new me(y.newSlowBuffer(1024)),W=null,be=[];function c(t,e){var r;if(W?(r=W,be.push([W,this]),W=null):r=this,this._hash=new pn,this.name=void 0,this.aliases=void 0,this.doc=t&&t.doc?""+t.doc:void 0,t){var n=t.name,i=t.namespace===void 0?e&&e.namespace:t.namespace;if(n!==void 0){if(n=tt(n,i),ve(n))throw new Error(m("cannot rename primitive type: %j",n));var o=e&&e.registry;if(o){if(o[n]!==void 0)throw new Error(m("duplicate type name: %s",n));o[n]=r}}else if(e&&e.noAnonymousTypes)throw new Error(m("missing name property in schema: %j",t));this.name=n,this.aliases=t.aliases?t.aliases.map(function(u){return tt(u,i)}):[]}}c.forSchema=function(t,e){e=e||{},e.registry=e.registry||{};var r=(function(p){switch(p===!0?p="always":p===!1?p="never":p===void 0?p="auto":typeof p=="string"&&(p=p.toLowerCase()),p){case"always":return H;case"never":return j;case"auto":return;default:throw new Error(m("invalid wrap unions option: %j",p))}})(e.wrapUnions);if(t===null)throw new Error('invalid type: null (did you mean "null"?)');if(c.isType(t))return t;var n;if(e.typeHook&&(n=e.typeHook(t,e))){if(!c.isType(n))throw new Error(m("invalid typehook return value: %j",n));return n}if(typeof t=="string"){if(t=tt(t,e.namespace),n=e.registry[t],n)return n;if(ve(t))return e.registry[t]=c.forSchema({type:t},e);throw new Error(m("undefined type name: %s",t))}if(t.logicalType&&e.logicalTypes&&!W){var i=e.logicalTypes[t.logicalType];if(i){var o=e.namespace,u={};Object.keys(e.registry).forEach(function(p){u[p]=e.registry[p]});try{return Ke("instantiating logical type for %s",t.logicalType),new i(t,e)}catch(p){if(Ke("failed to instantiate logical type for %s",t.logicalType),e.assertLogicalTypes)throw p;W=null,e.namespace=o,e.registry=u}}}if(Array.isArray(t)){var f=W;W=null;var a=t.map(function(p){return c.forSchema(p,e)});r||(r=hn(a)?H:j),W=f,n=new r(a,e)}else n=(function(p){var l=Le[p];if(l===void 0)throw new Error(m("unknown type: %j",p));return new l(t,e)})(t.type);return n};c.forValue=function(t,e){if(e=e||{},e.emptyArrayType=e.emptyArrayType||c.forSchema({type:"array",items:"null"}),e.valueHook){var r=e.valueHook(t,e);if(r!==void 0){if(!c.isType(r))throw new Error(m("invalid value hook return value: %j",r));return r}}switch(typeof t){case"string":return c.forSchema("string",e);case"boolean":return c.forSchema("boolean",e);case"number":return(t|0)===t?c.forSchema("int",e):Math.abs(t)<9007199254740991?c.forSchema("float",e):c.forSchema("double",e);case"object":if(t===null)return c.forSchema("null",e);if(Array.isArray(t))return t.length?c.forSchema({type:"array",items:c.forTypes(t.map(function(i){return c.forValue(i,e)}),e)},e):e.emptyArrayType;if(fe.isBuffer(t))return c.forSchema("bytes",e);var n=Object.keys(t);return n.some(function(i){return!y.isValidName(i)})?c.forSchema({type:"map",values:c.forTypes(n.map(function(i){return c.forValue(t[i],e)}),e)},e):c.forSchema({type:"record",fields:n.map(function(i){return{name:i,type:c.forValue(t[i],e)}})},e);default:throw new Error(m("cannot infer type from: %j",t))}};c.forTypes=function(t,e){if(!t.length)throw new Error("no types to combine");if(t.length===1)return t[0];e=e||{};var r=[],n=0,i=!0;if(t.forEach(function(h){switch(h.typeName){case"union:unwrapped":i=!1,r=r.concat(h.types);break;case"union:wrapped":n++,r=r.concat(h.types);break;case"null":r.push(h);break;default:i=!1,r.push(h)}}),n){if(!i)throw new Error("cannot combine wrapped union");var o={};r.forEach(function(h){var w=h.branchName,_=o[w];if(!_)o[w]=h;else if(!h.equals(_))throw new Error("inconsistent branch type")});var u=e.wrapUnions,f;e.wrapUnions=!0;try{f=c.forSchema(Object.keys(o).map(function(h){return o[h]}),e)}catch(h){throw e.wrapUnions=u,h}return e.wrapUnions=u,f}var a={};r.forEach(function(h){var w=Oe(h),_=a[w];_||(a[w]=_=[]),_.push(h)});var p=Object.keys(a),l=p.map(function(h){var w=a[h];if(w.length===1)return w[0];switch(h){case"null":case"boolean":return w[0];case"number":return ln(w);case"string":return yn(w,e);case"buffer":return dn(w,e);case"array":return w=w.filter(function(_){return _!==e.emptyArrayType}),w.length?c.forSchema({type:"array",items:c.forTypes(w.map(function(_){return _.itemsType}),e)},e):e.emptyArrayType;default:return mn(w,e)}});return l.length===1?l[0]:c.forSchema(l,e)};c.isType=function(){var t=arguments.length;if(!t)return!1;var e=arguments[0];if(!e||typeof e._update!="function"||typeof e.fingerprint!="function")return!1;if(t===1)return!0;var r=e.typeName,n;for(n=1;n<t;n++)if(r.indexOf(arguments[n])===0)return!0;return!1};c.__reset=function(t){Ke("resetting type buffer to %d",t),de.buf=y.newSlowBuffer(t)};Object.defineProperty(c.prototype,"branchName",{enumerable:!0,get:function(){var t=c.isType(this,"logical")?this.underlyingType:this;return t.name?t.name:c.isType(t,"abstract")?t._concreteTypeName:c.isType(t,"union")?void 0:t.typeName}});c.prototype.clone=function(t,e){return e?(e={coerce:!!e.coerceBuffers|0,fieldHook:e.fieldHook,qualifyNames:!!e.qualifyNames,skip:!!e.skipMissingFields,wrap:!!e.wrapUnions|0},this._copy(t,e)):this.fromBuffer(this.toBuffer(t))};c.prototype.compare=y.abstractFunction;c.prototype.compareBuffers=function(t,e){return this._match(new me(t),new me(e))};c.prototype.createResolver=function(t,e){if(!c.isType(t))throw new Error(m("not a type: %j",t));if(!c.isType(this,"union","logical")&&c.isType(t,"logical"))return this.createResolver(t.underlyingType,e);e=e||{},e.registry=e.registry||{};var r,n;if(c.isType(this,"record","error")&&c.isType(t,"record","error")&&(n=this.name+":"+t.name,r=e.registry[n],r))return r;if(r=new rt(this),n&&(e.registry[n]=r),c.isType(t,"union")){var i=t.types.map(function(o){return this.createResolver(o,e)},this);r._read=function(o){var u=o.readLong(),f=i[u];if(f===void 0)throw new Error(m("invalid union index: %s",u));return i[u]._read(o)}}else this._update(r,t,e);if(!r._read)throw new Error(m("cannot read %s as %s",t,this));return Object.freeze(r)};c.prototype.decode=function(t,e,r){var n=new me(t,e),i=zt(this,n,r);return n.isValid()?{value:i,offset:n.pos}:{value:void 0,offset:-1}};c.prototype.encode=function(t,e,r){var n=new me(e,r);return this._write(n,t),n.isValid()?n.pos:e.length-n.pos};c.prototype.equals=function(t,e){var r=c.isType(t)&&this.fingerprint().equals(t.fingerprint());return!r||!(e&&e.strict)?r:JSON.stringify(this.schema({exportAttrs:!0}))===JSON.stringify(t.schema({exportAttrs:!0}))};c.prototype.fingerprint=function(t){if(t)return y.getHash(JSON.stringify(this.schema()),t);if(!this._hash.str){var e=JSON.stringify(this.schema());this._hash.str=y.getHash(e).toString("binary")}return y.bufferFrom(this._hash.str,"binary")};c.prototype.fromBuffer=function(t,e,r){var n=new me(t),i=zt(this,n,e,r);if(!n.isValid())throw new Error("truncated buffer");if(!r&&n.pos<t.length)throw new Error("trailing data");return i};c.prototype.fromString=function(t){return this._copy(JSON.parse(t),{coerce:2})};c.prototype.inspect=function(){var t=this.typeName,e=qt(t);if(ve(t))return m("<%s>",e);var r=this.schema({exportAttrs:!0,noDeref:!0});return typeof r=="object"&&!c.isType(this,"logical")&&(r.type=void 0),m("<%s %j>",e,r)};c.prototype.isValid=function(t,e){var r=(e&&e.noUndeclaredFields)|0,n=e&&e.errorHook,i,o;return n&&(o=[],i=function(u,f){n.call(this,o.slice(),u,f,t)}),this._check(t,r,i,o)};c.prototype.random=y.abstractFunction;c.prototype.schema=function(t){return this._attrs({exportAttrs:!!(t&&t.exportAttrs),noDeref:!!(t&&t.noDeref)})};c.prototype.toBuffer=function(t){de.pos=0,this._write(de,t);var e=y.newBuffer(de.pos);return de.isValid()?de.buf.copy(e,0,0,de.pos):this._write(new me(e),t),e};c.prototype.toJSON=function(){return this.schema({exportAttrs:!0})};c.prototype.toString=function(t){return JSON.stringify(t===void 0?this.schema({noDeref:!0}):this._copy(t,{coerce:3}))};c.prototype.wrap=function(t){var e=this._branchConstructor;return e===null?null:new e(t)};c.prototype._attrs=function(t){t.derefed=t.derefed||{};var e=this.name;if(e!==void 0){if(t.noDeref||t.derefed[e])return e;t.derefed[e]=!0}var r={};this.name!==void 0&&(r.name=e),r.type=this.typeName;var n=this._deref(r,t);return n!==void 0&&(r=n),t.exportAttrs&&(this.aliases&&this.aliases.length&&(r.aliases=this.aliases),this.doc!==void 0&&(r.doc=this.doc)),r};c.prototype._createBranchConstructor=function(){var t=this.branchName;if(t==="null")return null;var e=~t.indexOf(".")?"this['"+t+"']":"this."+t,r="return function Branch$(val) { "+e+" = val; };",n=new Function(r)();return n.type=this,n.prototype.unwrap=new Function("return "+e+";"),n.prototype.unwrapped=n.prototype.unwrap,n};c.prototype._peek=function(t){var e=t.pos,r=this._read(t);return t.pos=e,r};c.prototype._check=y.abstractFunction;c.prototype._copy=y.abstractFunction;c.prototype._deref=y.abstractFunction;c.prototype._match=y.abstractFunction;c.prototype._read=y.abstractFunction;c.prototype._skip=y.abstractFunction;c.prototype._update=y.abstractFunction;c.prototype._write=y.abstractFunction;c.prototype.getAliases=function(){return this.aliases};c.prototype.getFingerprint=c.prototype.fingerprint;c.prototype.getName=function(t){return this.name||!t?this.name:this.branchName};c.prototype.getSchema=c.prototype.schema;c.prototype.getTypeName=function(){return this.typeName};function b(t){c.call(this),this._branchConstructor=this._createBranchConstructor(),t||Object.freeze(this)}E.inherits(b,c);b.prototype._update=function(t,e){e.typeName===this.typeName&&(t._read=this._read)};b.prototype._copy=function(t){return this._check(t,void 0,x),t};b.prototype._deref=function(){return this.typeName};b.prototype.compare=y.compare;function J(){b.call(this)}E.inherits(J,b);J.prototype._check=function(t,e,r){var n=t===null;return!n&&r&&r(t,this),n};J.prototype._read=function(){return null};J.prototype._skip=function(){};J.prototype._write=function(t,e){e!==null&&x(e,this)};J.prototype._match=function(){return 0};J.prototype.compare=J.prototype._match;J.prototype.typeName="null";J.prototype.random=J.prototype._read;function re(){b.call(this)}E.inherits(re,b);re.prototype._check=function(t,e,r){var n=typeof t=="boolean";return!n&&r&&r(t,this),n};re.prototype._read=function(t){return t.readBoolean()};re.prototype._skip=function(t){t.skipBoolean()};re.prototype._write=function(t,e){typeof e!="boolean"&&x(e,this),t.writeBoolean(e)};re.prototype._match=function(t,e){return t.matchBoolean(e)};re.prototype.typeName="boolean";re.prototype.random=function(){return I.nextBoolean()};function ne(){b.call(this)}E.inherits(ne,b);ne.prototype._check=function(t,e,r){var n=t===(t|0);return!n&&r&&r(t,this),n};ne.prototype._read=function(t){return t.readInt()};ne.prototype._skip=function(t){t.skipInt()};ne.prototype._write=function(t,e){e!==(e|0)&&x(e,this),t.writeInt(e)};ne.prototype._match=function(t,e){return t.matchInt(e)};ne.prototype.typeName="int";ne.prototype.random=function(){return I.nextInt(1e3)|0};function z(){b.call(this)}E.inherits(z,b);z.prototype._check=function(t,e,r){var n=typeof t=="number"&&t%1===0&&it(t);return!n&&r&&r(t,this),n};z.prototype._read=function(t){var e=t.readLong();if(!it(e))throw new Error("potential precision loss");return e};z.prototype._skip=function(t){t.skipLong()};z.prototype._write=function(t,e){(typeof e!="number"||e%1||!it(e))&&x(e,this),t.writeLong(e)};z.prototype._match=function(t,e){return t.matchLong(e)};z.prototype._update=function(t,e){switch(e.typeName){case"int":t._read=e._read;break;case"abstract:long":case"long":t._read=this._read}};z.prototype.typeName="long";z.prototype.random=function(){return I.nextInt()};z.__with=function(t,e){t=t||{};var r={toBuffer:"_toBuffer",fromBuffer:"_fromBuffer",fromJSON:"_fromJSON",toJSON:"_toJSON",isValid:"_isValid",compare:"compare"},n=new U(e);return Object.keys(r).forEach(function(i){if(t[i]===void 0)throw new Error(m("missing method implementation: %s",i));n[r[i]]=t[i]}),Object.freeze(n)};function Q(){b.call(this)}E.inherits(Q,b);Q.prototype._check=function(t,e,r){var n=typeof t=="number";return!n&&r&&r(t,this),n};Q.prototype._read=function(t){return t.readFloat()};Q.prototype._skip=function(t){t.skipFloat()};Q.prototype._write=function(t,e){typeof e!="number"&&x(e,this),t.writeFloat(e)};Q.prototype._match=function(t,e){return t.matchFloat(e)};Q.prototype._update=function(t,e){switch(e.typeName){case"float":case"int":t._read=e._read;break;case"abstract:long":case"long":t._read=function(r){return r.readLong()}}};Q.prototype.typeName="float";Q.prototype.random=function(){return I.nextFloat(1e3)};function Z(){b.call(this)}E.inherits(Z,b);Z.prototype._check=function(t,e,r){var n=typeof t=="number";return!n&&r&&r(t,this),n};Z.prototype._read=function(t){return t.readDouble()};Z.prototype._skip=function(t){t.skipDouble()};Z.prototype._write=function(t,e){typeof e!="number"&&x(e,this),t.writeDouble(e)};Z.prototype._match=function(t,e){return t.matchDouble(e)};Z.prototype._update=function(t,e){switch(e.typeName){case"double":case"float":case"int":t._read=e._read;break;case"abstract:long":case"long":t._read=function(r){return r.readLong()}}};Z.prototype.typeName="double";Z.prototype.random=function(){return I.nextFloat()};function G(){b.call(this)}E.inherits(G,b);G.prototype._check=function(t,e,r){var n=typeof t=="string";return!n&&r&&r(t,this),n};G.prototype._read=function(t){return t.readString()};G.prototype._skip=function(t){t.skipString()};G.prototype._write=function(t,e){typeof e!="string"&&x(e,this),t.writeString(e)};G.prototype._match=function(t,e){return t.matchString(e)};G.prototype._update=function(t,e){switch(e.typeName){case"bytes":case"string":t._read=this._read}};G.prototype.typeName="string";G.prototype.random=function(){return I.nextString(I.nextInt(32))};function $(){b.call(this)}E.inherits($,b);$.prototype._check=function(t,e,r){var n=fe.isBuffer(t);return!n&&r&&r(t,this),n};$.prototype._read=function(t){return t.readBytes()};$.prototype._skip=function(t){t.skipBytes()};$.prototype._write=function(t,e){fe.isBuffer(e)||x(e,this),t.writeBytes(e)};$.prototype._match=function(t,e){return t.matchBytes(e)};$.prototype._update=G.prototype._update;$.prototype._copy=function(t,e){var r;switch((e&&e.coerce)|0){case 3:return this._check(t,void 0,x),t.toString("binary");case 2:if(typeof t!="string")throw new Error(m("cannot coerce to buffer: %j",t));return r=y.bufferFrom(t,"binary"),this._check(r,void 0,x),r;case 1:if(!Jt(t))throw new Error(m("cannot coerce to buffer: %j",t));return r=y.bufferFrom(t.data),this._check(r,void 0,x),r;default:return this._check(t,void 0,x),y.bufferFrom(t)}};$.prototype.compare=fe.compare;$.prototype.typeName="bytes";$.prototype.random=function(){return I.nextBuffer(I.nextInt(32))};function K(t,e){if(c.call(this),!Array.isArray(t))throw new Error(m("non-array union schema: %j",t));if(!t.length)throw new Error("empty union");this.types=Object.freeze(t.map(function(r){return c.forSchema(r,e)})),this._branchIndices={},this.types.forEach(function(r,n){if(c.isType(r,"union"))throw new Error("unions cannot be directly nested");var i=r.branchName;if(this._branchIndices[i]!==void 0)throw new Error(m("duplicate union branch name: %j",i));this._branchIndices[i]=n},this)}E.inherits(K,c);K.prototype._branchConstructor=function(){throw new Error("unions cannot be directly wrapped")};K.prototype._skip=function(t){this.types[t.readLong()]._skip(t)};K.prototype._match=function(t,e){var r=t.readLong(),n=e.readLong();return r===n?this.types[r]._match(t,e):r<n?-1:1};K.prototype._deref=function(t,e){return this.types.map(function(r){return r._attrs(e)})};K.prototype.getTypes=function(){return this.types};function j(t,e){K.call(this,t,e),this._dynamicBranches=null,this._bucketIndices={},this.types.forEach(function(r,n){if(c.isType(r,"abstract","logical"))this._dynamicBranches||(this._dynamicBranches=[]),this._dynamicBranches.push({index:n,type:r});else{var i=Oe(r);if(this._bucketIndices[i]!==void 0)throw new Error(m("ambiguous unwrapped union: %j",this));this._bucketIndices[i]=n}},this),Object.freeze(this)}E.inherits(j,K);j.prototype._getIndex=function(t){var e=this._bucketIndices[Ht(t)];return this._dynamicBranches&&(e=this._getBranchIndex(t,e)),e};j.prototype._getBranchIndex=function(t,e){var r=this._dynamicBranches,n,i,o;for(n=0,i=r.length;n<i;n++)if(o=r[n],o.type._check(t))if(e===void 0)e=o.index;else throw new Error("ambiguous conversion");return e};j.prototype._check=function(t,e,r,n){var i=this._getIndex(t),o=i!==void 0;return o?this.types[i]._check(t,e,r,n):(r&&r(t,this),o)};j.prototype._read=function(t){var e=t.readLong(),r=this.types[e];if(r)return r._read(t);throw new Error(m("invalid union index: %s",e))};j.prototype._write=function(t,e){var r=this._getIndex(e);r===void 0&&x(e,this),t.writeLong(r),e!==null&&this.types[r]._write(t,e)};j.prototype._update=function(t,e,r){var n,i,o;for(n=0,i=this.types.length;n<i;n++){try{o=this.types[n].createResolver(e,r)}catch{continue}t._read=function(u){return o._read(u)};return}};j.prototype._copy=function(t,e){var r=e&&e.coerce|0,n=e&&e.wrap|0,i;if(n===2)i=0;else{switch(r){case 1:Jt(t)&&this._bucketIndices.buffer!==void 0?i=this._bucketIndices.buffer:i=this._getIndex(t);break;case 2:if(t===null)i=this._bucketIndices.null;else if(typeof t=="object"){var o=Object.keys(t);o.length===1&&(i=this._branchIndices[o[0]],t=t[o[0]])}break;default:i=this._getIndex(t)}i===void 0&&x(t,this)}var u=this.types[i];if(t===null||n===3)return u._copy(t,e);if(r===3){var f={};return f[u.branchName]=u._copy(t,e),f}else return u._copy(t,e)};j.prototype.compare=function(t,e){var r=this._getIndex(t),n=this._getIndex(e);if(r===void 0)x(t,this);else if(n===void 0)x(e,this);else return r===n?this.types[r].compare(t,e):y.compare(r,n)};j.prototype.typeName="union:unwrapped";j.prototype.random=function(){var t=I.nextInt(this.types.length);return this.types[t].random()};function H(t,e){K.call(this,t,e),Object.freeze(this)}E.inherits(H,K);H.prototype._check=function(t,e,r,n){var i=!1;if(t===null)i=this._branchIndices.null!==void 0;else if(typeof t=="object"){var o=Object.keys(t);if(o.length===1){var u=o[0],f=this._branchIndices[u];if(f!==void 0)return r?(n.push(u),i=this.types[f]._check(t[u],e,r,n),n.pop(),i):this.types[f]._check(t[u],e)}}return!i&&r&&r(t,this),i};H.prototype._read=function(t){var e=this.types[t.readLong()];if(!e)throw new Error(m("invalid union index"));var r=e._branchConstructor;return r===null?null:new r(e._read(t))};H.prototype._write=function(t,e){var r,n,i;e===null?(r=this._branchIndices.null,r===void 0&&x(e,this),t.writeLong(r)):(n=Object.keys(e),n.length===1&&(i=n[0],r=this._branchIndices[i]),r===void 0&&x(e,this),t.writeLong(r),this.types[r]._write(t,e[i]))};H.prototype._update=function(t,e,r){var n,i,o,u;for(n=0,i=this.types.length;n<i;n++){try{o=this.types[n].createResolver(e,r)}catch{continue}u=this.types[n]._branchConstructor,u?t._read=function(f){return new u(o._read(f))}:t._read=function(){return null};return}};H.prototype._copy=function(t,e){var r=e&&e.wrap|0;if(r===2){var n=this.types[0];return t===null&&n.typeName==="null"?null:new n._branchConstructor(n._copy(t,e))}if(t===null&&this._branchIndices.null!==void 0)return null;var i,o,u;if(typeof t=="object"){var f=Object.keys(t);if(f.length===1){var a=f[0];if(i=this._branchIndices[a],i===void 0&&e.qualifyNames){var p,l;for(p=0,o=this.types.length;p<o;p++)if(l=this.types[p],l.name&&a===y.unqualify(l.name)){i=p;break}}i!==void 0&&(u=this.types[i]._copy(t[a],e))}}if(r===1&&u===void 0)for(i=0,o=this.types.length;i<o&&u===void 0;)try{u=this.types[i]._copy(t,e)}catch{i++}if(u!==void 0)return r===3?u:new this.types[i]._branchConstructor(u);x(t,this)};H.prototype.compare=function(t,e){var r=t===null?"null":Object.keys(t)[0],n=e===null?"null":Object.keys(e)[0],i=this._branchIndices[r];return r===n?r==="null"?0:this.types[i].compare(t[r],e[r]):y.compare(i,this._branchIndices[n])};H.prototype.typeName="union:wrapped";H.prototype.random=function(){var t=I.nextInt(this.types.length),e=this.types[t],r=e._branchConstructor;return r?new r(e.random()):null};function R(t,e){if(c.call(this,t,e),!Array.isArray(t.symbols)||!t.symbols.length)throw new Error(m("invalid enum symbols: %j",t.symbols));if(this.symbols=Object.freeze(t.symbols.slice()),this._indices={},this.symbols.forEach(function(r,n){if(!y.isValidName(r))throw new Error(m("invalid %s symbol: %j",this,r));if(this._indices[r]!==void 0)throw new Error(m("duplicate %s symbol: %j",this,r));this._indices[r]=n},this),this.default=t.default,this.default!==void 0&&this._indices[this.default]===void 0)throw new Error(m("invalid %s default: %j",this,this.default));this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}E.inherits(R,c);R.prototype._check=function(t,e,r){var n=this._indices[t]!==void 0;return!n&&r&&r(t,this),n};R.prototype._read=function(t){var e=t.readLong(),r=this.symbols[e];if(r===void 0)throw new Error(m("invalid %s enum index: %s",this.name,e));return r};R.prototype._skip=function(t){t.skipLong()};R.prototype._write=function(t,e){var r=this._indices[e];r===void 0&&x(e,this),t.writeLong(r)};R.prototype._match=function(t,e){return t.matchLong(e)};R.prototype.compare=function(t,e){return y.compare(this._indices[t],this._indices[e])};R.prototype._update=function(t,e,r){var n=this.symbols;e.typeName==="enum"&&nt(this,e,!r.ignoreNamespaces)&&(e.symbols.every(function(i){return~n.indexOf(i)})||this.default!==void 0)&&(t.symbols=e.symbols.map(function(i){return this._indices[i]===void 0?this.default:i},this),t._read=e._read)};R.prototype._copy=function(t){return this._check(t,void 0,x),t};R.prototype._deref=function(t){t.symbols=this.symbols};R.prototype.getSymbols=function(){return this.symbols};R.prototype.typeName="enum";R.prototype.random=function(){return I.choice(this.symbols)};function V(t,e){if(c.call(this,t,e),t.size!==(t.size|0)||t.size<0)throw new Error(m("invalid %s size",this.branchName));this.size=t.size|0,this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}E.inherits(V,c);V.prototype._check=function(t,e,r){var n=fe.isBuffer(t)&&t.length===this.size;return!n&&r&&r(t,this),n};V.prototype._read=function(t){return t.readFixed(this.size)};V.prototype._skip=function(t){t.skipFixed(this.size)};V.prototype._write=function(t,e){(!fe.isBuffer(e)||e.length!==this.size)&&x(e,this),t.writeFixed(e,this.size)};V.prototype._match=function(t,e){return t.matchFixed(e,this.size)};V.prototype.compare=fe.compare;V.prototype._update=function(t,e,r){e.typeName==="fixed"&&this.size===e.size&&nt(this,e,!r.ignoreNamespaces)&&(t.size=this.size,t._read=this._read)};V.prototype._copy=$.prototype._copy;V.prototype._deref=function(t){t.size=this.size};V.prototype.getSize=function(){return this.size};V.prototype.typeName="fixed";V.prototype.random=function(){return I.nextBuffer(this.size)};function L(t,e){if(c.call(this),!t.values)throw new Error(m("missing map values: %j",t));this.valuesType=c.forSchema(t.values,e),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}E.inherits(L,c);L.prototype._check=function(t,e,r,n){if(!t||typeof t!="object"||Array.isArray(t))return r&&r(t,this),!1;var i=Object.keys(t),o=!0,u,f,a,p;if(r){for(a=n.length,n.push(""),u=0,f=i.length;u<f;u++)p=n[a]=i[u],this.valuesType._check(t[p],e,r,n)||(o=!1);n.pop()}else for(u=0,f=i.length;u<f;u++)if(!this.valuesType._check(t[i[u]],e))return!1;return o};L.prototype._read=function(t){for(var e=this.valuesType,r={},n;n=et(t);)for(;n--;){var i=t.readString();r[i]=e._read(t)}return r};L.prototype._skip=function(t){for(var e=this.valuesType,r,n;n=t.readLong();)if(n<0)r=t.readLong(),t.pos+=r;else for(;n--;)t.skipString(),e._skip(t)};L.prototype._write=function(t,e){(!e||typeof e!="object"||Array.isArray(e))&&x(e,this);var r=this.valuesType,n=Object.keys(e),i=n.length,o,u;if(i)for(t.writeLong(i),o=0;o<i;o++)u=n[o],t.writeString(u),r._write(t,e[u]);t.writeLong(0)};L.prototype._match=function(){throw new Error("maps cannot be compared")};L.prototype._update=function(t,e,r){e.typeName==="map"&&(t.valuesType=this.valuesType.createResolver(e.valuesType,r),t._read=this._read)};L.prototype._copy=function(t,e){if(t&&typeof t=="object"&&!Array.isArray(t)){var r=this.valuesType,n=Object.keys(t),i,o,u,f={};for(i=0,o=n.length;i<o;i++)u=n[i],f[u]=r._copy(t[u],e);return f}x(t,this)};L.prototype.compare=L.prototype._match;L.prototype.typeName="map";L.prototype.getValuesType=function(){return this.valuesType};L.prototype.random=function(){var t={},e,r;for(e=0,r=I.nextInt(10);e<r;e++)t[I.nextString(I.nextInt(20))]=this.valuesType.random();return t};L.prototype._deref=function(t,e){t.values=this.valuesType._attrs(e)};function D(t,e){if(c.call(this),!t.items)throw new Error(m("missing array items: %j",t));this.itemsType=c.forSchema(t.items,e),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}E.inherits(D,c);D.prototype._check=function(t,e,r,n){if(!Array.isArray(t))return r&&r(t,this),!1;var i=this.itemsType,o=!0,u,f,a;if(r){for(a=n.length,n.push(""),u=0,f=t.length;u<f;u++)n[a]=""+u,i._check(t[u],e,r,n)||(o=!1);n.pop()}else for(u=0,f=t.length;u<f;u++)if(!i._check(t[u],e))return!1;return o};D.prototype._read=function(t){for(var e=this.itemsType,r=0,n,i;i=t.readLong();)for(i<0&&(i=-i,t.skipLong()),n=n||new Array(i);i--;)n[r++]=e._read(t);return n||[]};D.prototype._skip=function(t){for(var e=this.itemsType,r,n;n=t.readLong();)if(n<0)r=t.readLong(),t.pos+=r;else for(;n--;)e._skip(t)};D.prototype._write=function(t,e){Array.isArray(e)||x(e,this);var r=this.itemsType,n=e.length,i;if(n)for(t.writeLong(n),i=0;i<n;i++)r._write(t,e[i]);t.writeLong(0)};D.prototype._match=function(t,e){for(var r=t.readLong(),n=e.readLong(),i;r&&n;){if(i=this.itemsType._match(t,e),i)return i;--r||(r=et(t)),--n||(n=et(e))}return y.compare(r,n)};D.prototype._update=function(t,e,r){e.typeName==="array"&&(t.itemsType=this.itemsType.createResolver(e.itemsType,r),t._read=this._read)};D.prototype._copy=function(t,e){Array.isArray(t)||x(t,this);var r=new Array(t.length),n,i;for(n=0,i=t.length;n<i;n++)r[n]=this.itemsType._copy(t[n],e);return r};D.prototype._deref=function(t,e){t.items=this.itemsType._attrs(e)};D.prototype.compare=function(t,e){var r=t.length,n=e.length,i,o,u;for(i=0,o=Math.min(r,n);i<o;i++)if(u=this.itemsType.compare(t[i],e[i]))return u;return y.compare(r,n)};D.prototype.getItemsType=function(){return this.itemsType};D.prototype.typeName="array";D.prototype.random=function(){var t=[],e,r;for(e=0,r=I.nextInt(10);e<r;e++)t.push(this.itemsType.random());return t};function B(t,e){e=e||{};var r=e.namespace;if(t.namespace!==void 0)e.namespace=t.namespace;else if(t.name){var n=y.impliedNamespace(t.name);n!==void 0&&(e.namespace=n)}if(c.call(this,t,e),!Array.isArray(t.fields))throw new Error(m("non-array record fields: %j",t.fields));if(y.hasDuplicates(t.fields,function(i){return i.name}))throw new Error(m("duplicate field name: %j",t.fields));this._fieldsByName={},this.fields=Object.freeze(t.fields.map(function(i){var o=new te(i,e);return this._fieldsByName[o.name]=o,o},this)),this._branchConstructor=this._createBranchConstructor(),this._isError=t.type==="error",this.recordConstructor=this._createConstructor(e.errorStackTraces,e.omitRecordMethods),this._read=this._createReader(),this._skip=this._createSkipper(),this._write=this._createWriter(),this._check=this._createChecker(),e.namespace=r,Object.freeze(this)}E.inherits(B,c);B.prototype._getConstructorName=function(){return this.name?y.capitalize(y.unqualify(this.name)):this._isError?"Error$":"Record$"};B.prototype._createConstructor=function(t,e){var r=[],n=[],i=[],o="",u,f,a,p,l,h,w;for(u=0,f=this.fields.length;u<f;u++)a=this.fields[u],l=a.defaultValue,h=l()!==void 0,p=a.name,t&&this._isError&&p==="stack"&&c.isType(a.type,"string")&&!h&&(w=a),n.push("v"+u),o+=" ",h?(o+="if (v"+u+" === undefined) { ",o+="this."+p+" = d"+i.length+"(); ",o+="} else { this."+p+" = v"+u+`; }
|
|
86
|
+
`,r.push("d"+i.length),i.push(l)):o+="this."+p+" = v"+u+`;
|
|
87
|
+
`;w&&(o+=" if (this.stack === undefined) { ",typeof Error.captureStackTrace=="function"?o+="Error.captureStackTrace(this, this.constructor);":o+="this.stack = Error().stack;",o+=` }
|
|
88
|
+
`);var _="return function "+this._getConstructorName()+"(";_+=n.join()+`) {
|
|
89
|
+
`+o+"};";var g=new Function(r.join(),_).apply(void 0,i);if(e)return g;var v=this;return g.getType=function(){return v},g.type=v,this._isError&&(E.inherits(g,Error),g.prototype.name=this._getConstructorName()),g.prototype.clone=function(M){return v.clone(this,M)},g.prototype.compare=function(M){return v.compare(this,M)},g.prototype.isValid=function(M){return v.isValid(this,M)},g.prototype.toBuffer=function(){return v.toBuffer(this)},g.prototype.toString=function(){return v.toString(this)},g.prototype.wrap=function(){return v.wrap(this)},g.prototype.wrapped=g.prototype.wrap,g};B.prototype._createChecker=function(){var t=[],e=[],r=this._getConstructorName(),n="return function check"+r+`(v, f, h, p) {
|
|
90
|
+
`;if(n+=` if (
|
|
91
|
+
`,n+=` v === null ||
|
|
92
|
+
`,n+=` typeof v != 'object' ||
|
|
93
|
+
`,n+=` (f && !this._checkFields(v))
|
|
94
|
+
`,n+=` ) {
|
|
95
|
+
`,n+=` if (h) { h(v, this); }
|
|
96
|
+
`,n+=` return false;
|
|
97
|
+
`,n+=` }
|
|
98
|
+
`,!this.fields.length)n+=` return true;
|
|
99
|
+
`;else{for(i=0,o=this.fields.length;i<o;i++)u=this.fields[i],t.push("t"+i),e.push(u.type),u.defaultValue()!==void 0&&(n+=" var v"+i+" = v."+u.name+`;
|
|
100
|
+
`);n+=` if (h) {
|
|
101
|
+
`,n+=` var b = 1;
|
|
102
|
+
`,n+=` var j = p.length;
|
|
103
|
+
`,n+=` p.push('');
|
|
104
|
+
`;var i,o,u;for(i=0,o=this.fields.length;i<o;i++)u=this.fields[i],n+=" p[j] = '"+u.name+`';
|
|
105
|
+
`,n+=" b &= ",u.defaultValue()===void 0?n+="t"+i+"._check(v."+u.name+`, f, h, p);
|
|
106
|
+
`:(n+="v"+i+" === undefined || ",n+="t"+i+"._check(v"+i+`, f, h, p);
|
|
107
|
+
`);n+=` p.pop();
|
|
108
|
+
`,n+=` return !!b;
|
|
109
|
+
`,n+=` } else {
|
|
110
|
+
return (
|
|
111
|
+
`,n+=this.fields.map(function(f,a){return f.defaultValue()===void 0?"t"+a+"._check(v."+f.name+", f)":"(v"+a+" === undefined || t"+a+"._check(v"+a+", f))"}).join(` &&
|
|
112
|
+
`),n+=`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
`}return n+="};",new Function(t.join(),n).apply(void 0,e)};B.prototype._createReader=function(){var t=[],e=[this.recordConstructor],r,n;for(r=0,n=this.fields.length;r<n;r++)t.push("t"+r),e.push(this.fields[r].type);var i=this._getConstructorName(),o="return function read"+i+`(t) {
|
|
116
|
+
`;return o+=" return new "+i+`(
|
|
117
|
+
`,o+=t.map(function(u){return u+"._read(t)"}).join(`,
|
|
118
|
+
`),o+=`
|
|
119
|
+
);
|
|
120
|
+
};`,t.unshift(i),new Function(t.join(),o).apply(void 0,e)};B.prototype._createSkipper=function(){var t=[],e="return function skip"+this._getConstructorName()+`(t) {
|
|
121
|
+
`,r=[],n,i;for(n=0,i=this.fields.length;n<i;n++)t.push("t"+n),r.push(this.fields[n].type),e+=" t"+n+`._skip(t);
|
|
122
|
+
`;return e+="}",new Function(t.join(),e).apply(void 0,r)};B.prototype._createWriter=function(){var t=[],e=this._getConstructorName(),r="return function write"+e+`(t, v) {
|
|
123
|
+
`,n=[],i,o,u,f;for(i=0,o=this.fields.length;i<o;i++)u=this.fields[i],t.push("t"+i),n.push(u.type),r+=" ",u.defaultValue()===void 0?r+="t"+i+"._write(t, v."+u.name+`);
|
|
124
|
+
`:(f=u.type.toBuffer(u.defaultValue()).toString("binary"),t.push("d"+i),n.push(f),r+="var v"+i+" = v."+u.name+`;
|
|
125
|
+
`,r+="if (v"+i+` === undefined) {
|
|
126
|
+
`,r+=" t.writeBinary(d"+i+", "+f.length+`);
|
|
127
|
+
`,r+=` } else {
|
|
128
|
+
t`+i+"._write(t, v"+i+`);
|
|
129
|
+
}
|
|
130
|
+
`);return r+="}",new Function(t.join(),r).apply(void 0,n)};B.prototype._update=function(t,e,r){if(!nt(this,e,!r.ignoreNamespaces))throw new Error(m("no alias found for %s",e.name));var n=this.fields,i=e.fields,o=y.toMap(i,function(Ie){return Ie.name}),u=[],f={},a,p,l,h,w,_,g;for(a=0;a<n.length;a++){for(l=n[a],w=$t(l),_=[],p=0;p<w.length;p++)h=w[p],o[h]&&_.push(h);if(_.length>1)throw new Error(m("ambiguous aliasing for %s.%s (%s)",e.name,l.name,_));if(_.length)h=_[0],g={resolver:l.type.createResolver(o[h].type,r),name:"_"+l.name},f[h]?f[h].push(g):f[h]=[g],u.push(g.name);else{if(l.defaultValue()===void 0)throw new Error(m("no matching field for default-less %s.%s",e.name,l.name));u.push("undefined")}}var v=-1;for(a=i.length;a&&f[i[--a].name]===void 0;)v=a;var M=this._getConstructorName(),se=[M],ie=[this.recordConstructor],O=" return function read"+M+`(t, b) {
|
|
131
|
+
`;for(a=0;a<i.length;a++)if(a===v&&(O+=` if (!b) {
|
|
132
|
+
`),l=e.fields[a],h=l.name,f[h]===void 0)O+=~v&&a>=v?" ":" ",se.push("r"+a),ie.push(l.type),O+="r"+a+`._skip(t);
|
|
133
|
+
`;else for(p=f[h].length;p--;)O+=~v&&a>=v?" ":" ",se.push("r"+a+"f"+p),g=f[h][p],ie.push(g.resolver),O+="var "+g.name+" = ",O+="r"+a+"f"+p+"._"+(p?"peek":"read")+`(t);
|
|
134
|
+
`;~v&&(O+=` }
|
|
135
|
+
`),O+=" return new "+M+"("+u.join()+`);
|
|
136
|
+
};`,t._read=new Function(se.join(),O).apply(void 0,ie)};B.prototype._match=function(t,e){var r=this.fields,n,i,o,u,f;for(n=0,i=r.length;n<i;n++)if(o=r[n],u=o._order,f=o.type,u){if(u*=f._match(t,e),u)return u}else f._skip(t),f._skip(e);return 0};B.prototype._checkFields=function(t){var e=Object.keys(t),r,n;for(r=0,n=e.length;r<n;r++)if(!this._fieldsByName[e[r]])return!1;return!0};B.prototype._copy=function(t,e){var r=e&&e.fieldHook,n=[void 0],i,o,u,f;for(i=0,o=this.fields.length;i<o;i++)u=this.fields[i],f=t[u.name],f===void 0&&u.hasOwnProperty("defaultValue")&&(f=u.defaultValue()),(e&&!e.skip||f!==void 0)&&(f=u.type._copy(f,e)),r&&(f=r(u,f,this)),n.push(f);var a=this.recordConstructor;return new(a.bind.apply(a,n))};B.prototype._deref=function(t,e){t.fields=this.fields.map(function(r){var n=r.type,i={name:r.name,type:n._attrs(e)};if(e.exportAttrs){var o=r.defaultValue();o!==void 0&&(i.default=n._copy(o,{coerce:3,wrap:3}));var u=r.order;u!=="ascending"&&(i.order=u);var f=r.aliases;f.length&&(i.aliases=f);var a=r.doc;a!==void 0&&(i.doc=a)}return i})};B.prototype.compare=function(t,e){var r=this.fields,n,i,o,u,f,a;for(n=0,i=r.length;n<i;n++)if(o=r[n],u=o.name,f=o._order,a=o.type,f&&(f*=a.compare(t[u],e[u]),f))return f;return 0};B.prototype.random=function(){var t=this.fields.map(function(r){return r.type.random()});t.unshift(void 0);var e=this.recordConstructor;return new(e.bind.apply(e,t))};B.prototype.field=function(t){return this._fieldsByName[t]};B.prototype.getField=B.prototype.field;B.prototype.getFields=function(){return this.fields};B.prototype.getRecordConstructor=function(){return this.recordConstructor};Object.defineProperty(B.prototype,"typeName",{enumerable:!0,get:function(){return this._isError?"error":"record"}});function T(t,e){this._logicalTypeName=t.logicalType,c.call(this),W=this;try{this._underlyingType=c.forSchema(t,e)}finally{W=null;var r=be.length;r&&be[r-1][0]===this&&be.pop()}c.isType(this.underlyingType,"union")?this._branchConstructor=this.underlyingType._branchConstructor:this._branchConstructor=this.underlyingType._createBranchConstructor()}E.inherits(T,c);Object.defineProperty(T.prototype,"typeName",{enumerable:!0,get:function(){return"logical:"+this._logicalTypeName}});Object.defineProperty(T.prototype,"underlyingType",{enumerable:!0,get:function(){if(this._underlyingType)return this._underlyingType;var t,e,r;for(t=0,e=be.length;t<e;t++)if(r=be[t],r[0]===this)return r[1]}});T.prototype.getUnderlyingType=function(){return this.underlyingType};T.prototype._read=function(t){return this._fromValue(this.underlyingType._read(t))};T.prototype._write=function(t,e){this.underlyingType._write(t,this._toValue(e))};T.prototype._check=function(t,e,r,n){try{var i=this._toValue(t)}catch{}return i===void 0?(r&&r(t,this),!1):this.underlyingType._check(i,e,r,n)};T.prototype._copy=function(t,e){var r=this.underlyingType;switch(e&&e.coerce){case 3:return r._copy(this._toValue(t),e);case 2:return this._fromValue(r._copy(t,e));default:return this._fromValue(r._copy(this._toValue(t),e))}};T.prototype._update=function(t,e,r){var n=this._resolve(e,r);n&&(t._read=function(i){return n(e._read(i))})};T.prototype.compare=function(t,e){var r=this._toValue(t),n=this._toValue(e);return this.underlyingType.compare(r,n)};T.prototype.random=function(){return this._fromValue(this.underlyingType.random())};T.prototype._deref=function(t,e){var r=this.underlyingType,n=r.name!==void 0&&e.derefed[r.name];return t=r._attrs(e),!n&&e.exportAttrs&&(typeof t=="string"&&(t={type:t}),t.logicalType=this._logicalTypeName,this._export(t)),t};T.prototype._skip=function(t){this.underlyingType._skip(t)};T.prototype._export=function(){};T.prototype._fromValue=y.abstractFunction;T.prototype._toValue=y.abstractFunction;T.prototype._resolve=y.abstractFunction;function U(t){this._concreteTypeName="long",b.call(this,!0),this._noUnpack=!!t}E.inherits(U,z);U.prototype.typeName="abstract:long";U.prototype._check=function(t,e,r){var n=this._isValid(t);return!n&&r&&r(t,this),n};U.prototype._read=function(t){var e,r;if(this._noUnpack?(r=t.pos,t.skipLong(),e=t.buf.slice(r,t.pos)):e=t.unpackLongBytes(t),t.isValid())return this._fromBuffer(e)};U.prototype._write=function(t,e){this._isValid(e)||x(e,this);var r=this._toBuffer(e);this._noUnpack?t.writeFixed(r):t.packLongBytes(r)};U.prototype._copy=function(t,e){switch(e&&e.coerce){case 3:return this._toJSON(t);case 2:return this._fromJSON(t);default:return this._fromJSON(this._toJSON(t))}};U.prototype._deref=function(){return"long"};U.prototype._update=function(t,e){var r=this;switch(e.typeName){case"int":t._read=function(n){return r._fromJSON(e._read(n))};break;case"abstract:long":case"long":t._read=function(n){return r._read(n)}}};U.prototype.random=function(){return this._fromJSON(z.prototype.random())};U.prototype._fromBuffer=y.abstractFunction;U.prototype._toBuffer=y.abstractFunction;U.prototype._fromJSON=y.abstractFunction;U.prototype._toJSON=y.abstractFunction;U.prototype._isValid=y.abstractFunction;U.prototype.compare=y.abstractFunction;function te(t,e){var r=t.name;if(typeof r!="string"||!y.isValidName(r))throw new Error(m("invalid field name: %s",r));this.name=r,this.type=c.forSchema(t.type,e),this.aliases=t.aliases||[],this.doc=t.doc!==void 0?""+t.doc:void 0,this._order=(function(f){switch(f){case"ascending":return 1;case"descending":return-1;case"ignore":return 0;default:throw new Error(m("invalid order: %j",f))}})(t.order===void 0?"ascending":t.order);var n=t.default;if(n!==void 0){var i=this.type,o;try{o=i._copy(n,{coerce:2,wrap:2})}catch(f){var u=m("incompatible field default %j (%s)",n,f.message);throw c.isType(i,"union")&&(u+=m(", union defaults must match the first branch's type (%j)",i.types[0])),new Error(u)}ve(i.typeName)&&i.typeName!=="bytes"?this.defaultValue=function(){return o}:this.defaultValue=function(){return i._copy(o)}}Object.freeze(this)}te.prototype.defaultValue=function(){};Object.defineProperty(te.prototype,"order",{enumerable:!0,get:function(){return["descending","ignore","ascending"][this._order+1]}});te.prototype.getAliases=function(){return this.aliases};te.prototype.getDefault=te.prototype.defaultValue;te.prototype.getName=function(){return this.name};te.prototype.getOrder=function(){return this.order};te.prototype.getType=function(){return this.type};function rt(t){this._readerType=t,this._read=null,this.itemsType=null,this.size=0,this.symbols=null,this.valuesType=null}rt.prototype._peek=c.prototype._peek;rt.prototype.inspect=function(){return"<Resolver>"};function pn(){this.str=void 0}function zt(t,e,r,n){if(r){if(r._readerType!==t)throw new Error("invalid resolver");return r._read(e,n)}else return t._read(e)}function $t(t){var e={};t.name&&(e[t.name]=!0);var r=t.aliases,n,i;for(n=0,i=r.length;n<i;n++)e[r[n]]=!0;return Object.keys(e)}function nt(t,e,r){if(!e.name)return!0;var n=r?e.name:y.unqualify(e.name),i=$t(t),o,u,f;for(o=0,u=i.length;o<u;o++)if(f=i[o],r||(f=y.unqualify(f)),f===n)return!0;return!1}function ve(t){var e=Le[t];return e&&e.prototype instanceof b}function qt(t){if(t==="error")t="record";else{var e=/^([^:]+):(.*)$/.exec(t);e&&(e[1]==="union"?t=e[2]+"Union":t=e[1])}return y.capitalize(t)+"Type"}function et(t){var e=t.readLong();return e<0&&(e=-e,t.skipLong()),e}function it(t){return t>=-9007199254740990&&t<=9007199254740990}function Jt(t){return t&&t.type==="Buffer"&&Array.isArray(t.data)}function x(t,e){throw new Error(m("invalid %j: %j",e.schema(),t))}function tt(t,e){var r=y.unqualify(t);return ve(r)?r:y.qualify(t,e)}function Oe(t){var e=t.typeName;switch(e){case"double":case"float":case"int":case"long":return"number";case"bytes":case"fixed":return"buffer";case"enum":return"string";case"map":case"error":case"record":return"object";default:return e}}function Ht(t){if(t===null)return"null";var e=typeof t;if(e==="object"){if(Array.isArray(t))return"array";if(fe.isBuffer(t))return"buffer"}return e}function hn(t){var e={},r,n,i,o;for(r=0,n=t.length;r<n;r++)if(o=t[r],!c.isType(o,"logical")){if(i=Oe(o),e[i])return!0;e[i]=!0}return!1}function ln(t){var e=["int","long","float","double"],r=-1,n=null,i,o,u,f;for(i=0,o=t.length;i<o;i++)u=t[i],f=e.indexOf(u.typeName),f>r&&(r=f,n=u);return n}function yn(t,e){var r={},n,i,o,u;for(n=0,i=t.length;n<i;n++){if(o=t[n],o.typeName==="string")return o;u=o.symbols;var f,a;for(f=0,a=u.length;f<a;f++)r[u[f]]=!0}return c.forSchema({type:"enum",symbols:Object.keys(r)},e)}function dn(t,e){var r=-1,n,i,o;for(n=0,i=t.length;n<i;n++){if(o=t[n],o.typeName==="bytes")return o;r===-1?r=o.size:o.size!==r&&(r=-2)}return r<0?c.forSchema("bytes",e):t[0]}function mn(t,e){var r=[],n={},i={},o=!0,u,f,a,p;for(u=0,f=t.length;u<f;u++)if(a=t[u],a.typeName==="map")o=!1,r.push(a.valuesType);else{p=a.fields;var l,h,w,_,g,v;for(l=0,h=p.length;l<h;l++)w=p[l],g=w.name,v=w.type,r.push(v),o&&(n[g]||(n[g]=[]),n[g].push(v),_=w.defaultValue(),_!==void 0&&(i[g]=_))}if(o){var M=Object.keys(n);for(u=0,f=M.length;u<f;u++)g=M[u],n[g].length<t.length&&i[g]===void 0&&(e&&e.strictDefaults?o=!1:(n[g].unshift(c.forSchema("null",e)),i[g]=null))}var se;return o?se={type:"record",fields:M.map(function(ie){var O=c.forTypes(n[ie],e),Ie=i[ie];if(Ie!==void 0&&~O.typeName.indexOf("union")){var ae=O.types.slice(),ce,ot;for(ce=0,ot=ae.length;ce<ot&&!ae[ce].isValid(Ie);ce++);if(ce>0){var Zt=ae[0];ae[0]=ae[ce],ae[ce]=Zt,O=c.forSchema(ae,e)}}return{name:ie,type:O,default:i[ie]}})}:se={type:"map",values:c.forTypes(r,e)},c.forSchema(se,e)}Wt.exports={Type:c,getTypeBucket:Oe,getValueBucket:Ht,isPrimitive:ve,builtins:(function(){var t={LogicalType:T,UnwrappedUnionType:j,WrappedUnionType:H},e=Object.keys(Le),r,n,i;for(r=0,n=e.length;r<n;r++)i=e[r],t[qt(i)]=Le[i];return t})()}});var Xt=pe((In,Yt)=>{"use strict";var Te=Gt();function gn(t,e){var r;if(typeof t=="string")try{r=JSON.parse(t)}catch{r=t}else r=t;return Te.Type.forSchema(r,e)}Yt.exports={Type:Te.Type,parse:gn,types:Te.builtins,combine:Te.Type.forTypes,infer:Te.Type.forValue}});var Qt=ft(Xt()),wn=ft(Ee()),An=Qt.default;var export_Buf=wn.Buffer;export{export_Buf as Buf,An as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*! cbor-x@1.6.6 (MIT), bundled into one ES module by scripts/build-codec-vendor.mjs. Do not edit.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2020 Kris Zyp
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
var Be;try{Be=new TextDecoder}catch{}var h,L,o=0;var rt=[],wt=105,gt=57342,bt=57343,Xe=57337;var Qe=6,ie={},ae=11281e4,Z=1681e4;var Re=rt,Fe=0,A={},_,we,ge=0,ue=0,F,K,B=[],De=[],C,V,ce,ve={useRecords:!1,mapsAsObjects:!0},de=!1,nt=2;try{new Function("")}catch{nt=1/0}var X=class e{constructor(t){if(t&&((t.keyMap||t._keyMap)&&!t.useRecords&&(t.useRecords=!1,t.mapsAsObjects=!0),t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.getStructures&&(t.getShared=t.getStructures),t.getShared&&!t.structures&&((t.structures=[]).uninitialized=!0),t.keyMap)){this.mapKey=new Map;for(let[f,n]of Object.entries(t.keyMap))this.mapKey.set(n,f)}Object.assign(this,t)}decodeKey(t){return this.keyMap&&this.mapKey.get(t)||t}encodeKey(t){return this.keyMap&&this.keyMap.hasOwnProperty(t)?this.keyMap[t]:t}encodeKeys(t){if(!this._keyMap)return t;let f=new Map;for(let[n,l]of Object.entries(t))f.set(this._keyMap.hasOwnProperty(n)?this._keyMap[n]:n,l);return f}decodeKeys(t){if(!this._keyMap||t.constructor.name!="Map")return t;if(!this._mapKey){this._mapKey=new Map;for(let[n,l]of Object.entries(this._keyMap))this._mapKey.set(l,n)}let f={};return t.forEach((n,l)=>f[z(this._mapKey.has(l)?this._mapKey.get(l):l)]=n),f}mapDecode(t,f){let n=this.decode(t);return this._keyMap&&n.constructor.name==="Array"?n.map(l=>this.decodeKeys(l)):n}decode(t,f){if(h)return lt(()=>(be(),this?this.decode(t,f):e.prototype.decode.call(ve,t,f)));L=f>-1?f:t.length,o=0,Fe=0,ue=0,we=null,Re=rt,F=null,h=t;try{V=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(n){throw h=null,t instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof e){if(A=this,C=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return _=this.structures,ye();(!_||_.length>0)&&(_=[])}else A=ve,(!_||_.length>0)&&(_=[]),C=null;return ye()}decodeMultiple(t,f){let n,l=0;try{let a=t.length;de=!0;let u=this?this.decode(t,a):Le.decode(t,a);if(f){if(f(u)===!1)return;for(;o<a;)if(l=o,f(ye())===!1)return}else{for(n=[u];o<a;)l=o,n.push(ye());return n}}catch(a){throw a.lastPosition=l,a.values=n,a}finally{de=!1,be()}}};function ye(){try{let e=E();if(F){if(o>=F.postBundlePosition){let t=new Error("Unexpected bundle position");throw t.incomplete=!0,t}o=F.postBundlePosition,F=null}if(o==L)_=null,h=null,K&&(K=null);else if(o>L){let t=new Error("Unexpected end of CBOR data");throw t.incomplete=!0,t}else if(!de)throw new Error("Data read, but end of buffer not reached");return e}catch(e){throw be(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer"))&&(e.incomplete=!0),e}}function te(){let e=new Error("Unexpected end of CBOR data");return e.incomplete=!0,e}function E(){if(!(o<L))throw te();let e=h[o++],t=e>>5;if(e=e&31,e>23)switch(e){case 24:if(o>=L)throw te();e=h[o++];break;case 25:if(t==7)return Et();e=V.getUint16(o),o+=2;break;case 26:if(t==7){let f=V.getFloat32(o);if(A.useFloat32>2){let n=me[(h[o]&127)<<1|h[o+1]>>7];return o+=4,(n*f+(f>0?.5:-.5)>>0)/n}return o+=4,f}if(e=V.getUint32(o),o+=4,t===1)return-1-e;break;case 27:if(t==7){let f=V.getFloat64(o);return o+=8,f}if(t>1){if(V.getUint32(o)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");e=V.getUint32(o+4)}else A.int64AsNumber?(e=V.getUint32(o)*4294967296,e+=V.getUint32(o+4)):e=V.getBigUint64(o);o+=8;break;case 31:switch(t){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4:let f=[],n,l=0;for(;(n=E())!=ie;){if(l>=ae)throw new Error(`Array length exceeds ${ae}`);f[l++]=n}return t==4?f:t==3?f.join(""):Buffer.concat(f);case 5:let a;if(A.mapsAsObjects){let u={},g=0;if(A.keyMap)for(;(a=E())!=ie;){if(g++>=Z)throw new Error(`Property count exceeds ${Z}`);u[z(A.decodeKey(a))]=E()}else for(;(a=E())!=ie;){if(g++>=Z)throw new Error(`Property count exceeds ${Z}`);u[z(a)]=E()}return u}else{ce&&(A.mapsAsObjects=!0,ce=!1);let u=new Map;if(A.keyMap){let g=0;for(;(a=E())!=ie;){if(g++>=Z)throw new Error(`Map size exceeds ${Z}`);u.set(A.decodeKey(a),E())}}else{let g=0;for(;(a=E())!=ie;){if(g++>=Z)throw new Error(`Map size exceeds ${Z}`);u.set(a,E())}}return u}case 7:return ie;default:throw new Error("Invalid major type for indefinite length "+t)}default:throw new Error("Unknown token "+e)}switch(t){case 0:return e;case 1:return~e;case 2:return At(e);case 3:if(ue>=o)return we.slice(o-ge,(o+=e)-ge);if(ue==0&&L<140&&e<32){let l=e<16?it(e):St(e);if(l!=null)return l}return mt(e);case 4:if(e>=ae)throw new Error(`Array length exceeds ${ae}`);if(e>L-o)throw te();let f=new Array(e);for(let l=0;l<e;l++)f[l]=E();return f;case 5:if(e>=Z)throw new Error(`Map size exceeds ${ae}`);if(e>(L-o)/2)throw te();if(A.mapsAsObjects){let l={};if(A.keyMap)for(let a=0;a<e;a++)l[z(A.decodeKey(E()))]=E();else for(let a=0;a<e;a++)l[z(E())]=E();return l}else{ce&&(A.mapsAsObjects=!0,ce=!1);let l=new Map;if(A.keyMap)for(let a=0;a<e;a++)l.set(A.decodeKey(E()),E());else for(let a=0;a<e;a++)l.set(E(),E());return l}case 6:if(e>=Xe){let l=_[e&8191];if(l)return l.read||(l.read=Pe(l)),l.read();if(e<65536){if(e==bt){let a=fe(),u=E(),g=E();Ve(u,g);let U={};if(A.keyMap)for(let p=2;p<a;p++){let R=A.decodeKey(g[p-2]);U[z(R)]=E()}else for(let p=2;p<a;p++){let R=g[p-2];U[z(R)]=E()}return U}else if(e==gt){let a=fe(),u=E();for(let g=2;g<a;g++)Ve(u++,E());return E()}else if(e==Xe)return _t();if(A.getShared&&(Ce(),l=_[e&8191],l))return l.read||(l.read=Pe(l)),l.read()}}let n=B[e];if(n)return n.handlesRead?n(E):n(E());{let l=E();for(let a=0;a<De.length;a++){let u=De[a](e,l);if(u!==void 0)return u}return new W(l,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let l=(C||ee())[e];if(l!==void 0)return l;throw new Error("Unknown token "+e)}default:throw isNaN(e)?te():new Error("Unknown CBOR token "+e)}}var et=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Pe(e){if(!e)throw new Error("Structure is required in record definition");function t(){let f=h[o++];if(f=f&31,f>23)switch(f){case 24:f=h[o++];break;case 25:f=V.getUint16(o),o+=2;break;case 26:f=V.getUint32(o),o+=4;break;default:throw new Error("Expected array header, but got "+h[o-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===f)return n(E);n=n.next}if(this.slowReads++>=nt){let a=this.length==f?this:this.slice(0,f);return n=A.keyMap?new Function("r","return {"+a.map(u=>A.decodeKey(u)).map(u=>et.test(u)?z(u)+":r()":"["+JSON.stringify(u)+"]:r()").join(",")+"}"):new Function("r","return {"+a.map(u=>et.test(u)?z(u)+":r()":"["+JSON.stringify(u)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=f,this.compiledReader=n,n(E)}let l={};if(A.keyMap)for(let a=0;a<f;a++)l[z(A.decodeKey(this[a]))]=E();else for(let a=0;a<f;a++)l[z(this[a])]=E();return l}return e.slowReads=0,t}function z(e){if(typeof e=="string")return e==="__proto__"?"__proto_":e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";throw new Error("Invalid property name type "+typeof e)}var mt=Te;function Te(e){let t;if(e<16&&(t=it(e)))return t;if(e>64&&Be)return Be.decode(h.subarray(o,o+=e));let f=o+e,n=[];for(t="";o<f;){let l=h[o++];if((l&128)===0)n.push(l);else if((l&224)===192)if(l<194||o>=f||(h[o]&192)!==128)n.push(65533);else{let a=h[o++]&63;n.push((l&31)<<6|a)}else if((l&240)===224){let a=o<f?h[o]:0;if(o>=f||(a&192)!==128||l===224&&a<160||l===237&&a>=160)n.push(65533);else if(o++,o>=f||(h[o]&192)!==128)n.push(65533);else{let u=h[o++]&63;n.push((l&31)<<12|(a&63)<<6|u)}}else if((l&248)===240){let a=o<f?h[o]:0;if(l>244||o>=f||(a&192)!==128||l===240&&a<144||l===244&&a>=144)n.push(65533);else if(o++,o>=f||(h[o]&192)!==128)n.push(65533);else{let u=h[o++]&63;if(o>=f||(h[o]&192)!==128)n.push(65533);else{let g=h[o++]&63,U=(l&7)<<18|(a&63)<<12|u<<6|g;U-=65536,n.push(U>>>10&1023|55296),n.push(56320|U&1023)}}}else n.push(65533);n.length>=4096&&(t+=P.apply(String,n),n.length=0)}return n.length>0&&(t+=P.apply(String,n)),t}var P=String.fromCharCode;function St(e){let t=o,f=new Array(e);for(let n=0;n<e;n++){let l=h[o++];if((l&128)>0){o=t;return}f[n]=l}return P.apply(String,f)}function it(e){if(e<4)if(e<2){if(e===0)return"";{let t=h[o++];if((t&128)>1){o-=1;return}return P(t)}}else{let t=h[o++],f=h[o++];if((t&128)>0||(f&128)>0){o-=2;return}if(e<3)return P(t,f);let n=h[o++];if((n&128)>0){o-=3;return}return P(t,f,n)}else{let t=h[o++],f=h[o++],n=h[o++],l=h[o++];if((t&128)>0||(f&128)>0||(n&128)>0||(l&128)>0){o-=4;return}if(e<6){if(e===4)return P(t,f,n,l);{let a=h[o++];if((a&128)>0){o-=5;return}return P(t,f,n,l,a)}}else if(e<8){let a=h[o++],u=h[o++];if((a&128)>0||(u&128)>0){o-=6;return}if(e<7)return P(t,f,n,l,a,u);let g=h[o++];if((g&128)>0){o-=7;return}return P(t,f,n,l,a,u,g)}else{let a=h[o++],u=h[o++],g=h[o++],U=h[o++];if((a&128)>0||(u&128)>0||(g&128)>0||(U&128)>0){o-=8;return}if(e<10){if(e===8)return P(t,f,n,l,a,u,g,U);{let p=h[o++];if((p&128)>0){o-=9;return}return P(t,f,n,l,a,u,g,U,p)}}else if(e<12){let p=h[o++],R=h[o++];if((p&128)>0||(R&128)>0){o-=10;return}if(e<11)return P(t,f,n,l,a,u,g,U,p,R);let k=h[o++];if((k&128)>0){o-=11;return}return P(t,f,n,l,a,u,g,U,p,R,k)}else{let p=h[o++],R=h[o++],k=h[o++],j=h[o++];if((p&128)>0||(R&128)>0||(k&128)>0||(j&128)>0){o-=12;return}if(e<14){if(e===12)return P(t,f,n,l,a,u,g,U,p,R,k,j);{let T=h[o++];if((T&128)>0){o-=13;return}return P(t,f,n,l,a,u,g,U,p,R,k,j,T)}}else{let T=h[o++],J=h[o++];if((T&128)>0||(J&128)>0){o-=14;return}if(e<15)return P(t,f,n,l,a,u,g,U,p,R,k,j,T,J);let q=h[o++];if((q&128)>0){o-=15;return}return P(t,f,n,l,a,u,g,U,p,R,k,j,T,J,q)}}}}}function At(e){return A.copyBuffers?Uint8Array.prototype.slice.call(h,o,o+=e):h.subarray(o,o+=e)}var st=new Float32Array(1),pe=new Uint8Array(st.buffer,0,4);function Et(){let e=h[o++],t=h[o++],f=(e&127)>>2;if(f===31)return t||e&3?NaN:e&128?-1/0:1/0;if(f===0){let n=((e&3)<<8|t)/16777216;return e&128?-n:n}return pe[3]=e&128|(f>>1)+56,pe[2]=(e&7)<<5|t>>3,pe[1]=t<<5,pe[0]=0,st[0]}var Wt=new Array(4096);var W=class{constructor(t,f){this.value=t,this.tag=f}};B[0]=e=>new Date(e);B[1]=e=>new Date(Math.round(e*1e3));B[2]=e=>{let t=BigInt(0);for(let f=0,n=e.byteLength;f<n;f++)t=BigInt(e[f])+(t<<BigInt(8));return t};B[3]=e=>BigInt(-1)-B[2](e);B[4]=e=>+(e[1]+"e"+e[0]);B[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));var Ve=(e,t)=>{e=e-57344;let f=_[e];f&&f.isShared&&((_.restoreStructures||(_.restoreStructures=[]))[e]=f),_[e]=t,t.read=Pe(t)};B[wt]=e=>{let t=e.length,f=e[1];Ve(e[0],f);let n={};for(let l=2;l<t;l++){let a=f[l-2];n[z(a)]=e[l]}return n};B[14]=e=>F?F[0].slice(F.position0,F.position0+=e):new W(e,14);B[15]=e=>F?F[1].slice(F.position1,F.position1+=e):new W(e,15);var Ot={Error,RegExp};B[27]=e=>(Ot[e[0]]||Error)(e[1],e[2]);var ft=e=>{if(h[o++]!=132){let f=new Error("Packed values structure must be followed by a 4 element array");throw h.length<o&&(f.incomplete=!0),f}let t=e();if(!t||!t.length){let f=new Error("Packed values structure must be followed by a 4 element array");throw f.incomplete=!0,f}return C=C?t.concat(C.slice(t.length)):t,C.prefixes=e(),C.suffixes=e(),e()};ft.handlesRead=!0;B[51]=ft;B[Qe]=e=>{if(!C)if(A.getShared)Ce();else return new W(e,Qe);if(typeof e=="number")return C[16+(e>=0?2*e:-2*e-1)];let t=new Error("No support for non-integer packed references yet");throw e===void 0&&(t.incomplete=!0),t};B[28]=e=>{K||(K=new Map,K.id=0);let t=K.id++,f=o,n=h[o],l;n>>5==4?l=[]:l={};let a={target:l};K.set(t,a);let u=e();return a.used?(Object.getPrototypeOf(l)!==Object.getPrototypeOf(u)&&(o=f,l=u,K.set(t,{target:l}),u=e()),Object.assign(l,u)):(a.target=u,u)};B[28].handlesRead=!0;B[29]=e=>{let t=K.get(e);return t.used=!0,t.target};B[258]=e=>new Set(e);(B[259]=e=>(A.mapsAsObjects&&(A.mapsAsObjects=!1,ce=!0),e())).handlesRead=!0;function se(e,t){return typeof e=="string"?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function ee(){if(!C)if(A.getShared)Ce();else throw new Error("No packed values available");return C}var It=1399353956;De.push((e,t)=>{if(e>=225&&e<=255)return se(ee().prefixes[e-224],t);if(e>=28704&&e<=32767)return se(ee().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return se(ee().prefixes[e-1879048192],t);if(e>=216&&e<=223)return se(t,ee().suffixes[e-216]);if(e>=27647&&e<=28671)return se(t,ee().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return se(t,ee().suffixes[e-1811939328]);if(e==It)return{packedValues:C,structures:_.slice(0),version:t};if(e==55799)return t});var kt=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,tt=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Mt=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<tt.length;e++)Ut(tt[e],Mt[e]);function Ut(e,t){let f="get"+e.name.slice(0,-5),n;typeof e=="function"?n=e.BYTES_PER_ELEMENT:e=null;for(let l=0;l<2;l++){if(!l&&n==1)continue;let a=n==2?1:n==4?2:n==8?3:0;B[l?t:t-4]=n==1||l==kt?u=>{if(!e)throw new Error("Could not find typed array for code "+t);return!A.copyBuffers&&(n===1||n===2&&!(u.byteOffset&1)||n===4&&!(u.byteOffset&3)||n===8&&!(u.byteOffset&7))?new e(u.buffer,u.byteOffset,u.byteLength>>a):new e(Uint8Array.prototype.slice.call(u,0).buffer)}:u=>{if(!e)throw new Error("Could not find typed array for code "+t);let g=new DataView(u.buffer,u.byteOffset,u.byteLength),U=u.length>>a,p=new e(U),R=g[f];for(let k=0;k<U;k++)p[k]=R.call(g,k<<a,l);return p}}}function _t(){let e=fe(),t=o+E();for(let n=2;n<e;n++){let l=fe();o+=l}let f=o;return o=t,F=[Te(fe()),Te(fe())],F.position0=0,F.position1=0,F.postBundlePosition=o,o=f,E()}function fe(){if(!(o<L))throw te();let e=h[o++]&31;if(e>23)switch(e){case 24:if(o>=L)throw te();e=h[o++];break;case 25:e=V.getUint16(o),o+=2;break;case 26:e=V.getUint32(o),o+=4;break}return e}function Ce(){if(A.getShared){let e=lt(()=>(h=null,A.getShared()))||{},t=e.structures||[];A.sharedVersion=e.version,C=A.sharedValues=e.packedValues,_===!0?A.structures=_=t:_.splice.apply(_,[0,t.length].concat(t))}}function lt(e){let t=L,f=o,n=Fe,l=ge,a=ue,u=we,g=Re,U=K,p=F,R=new Uint8Array(h.slice(0,L)),k=_,j=A,T=de,J=e();return L=t,o=f,Fe=n,ge=l,ue=a,we=u,Re=g,K=U,F=p,h=R,de=T,_=k,A=j,V=new DataView(h.buffer,h.byteOffset,h.byteLength),J}function be(){h=null,K=null,_=null}function ot(e){B[e.tag]=e.decode}var me=new Array(147);for(let e=0;e<256;e++)me[e]=+("1e"+Math.floor(45.15-e*.30103));var Le=new X({useRecords:!1}),at=Le.decode,Bt=Le.decodeMultiple,Se={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};var Ae;try{Ae=new TextEncoder}catch{}var Oe,$e,ke=typeof globalThis=="object"&&globalThis.Buffer,xe=typeof ke<"u",Ne=xe?ke.allocUnsafeSlow:Uint8Array,ct=xe?ke:Uint8Array,ut=256,dt=xe?4294967296:2144337920;var je,s,M,r=0,Q,D=null,Rt=61440,Ft=/[\u0080-\uFFFF]/,N=Symbol("record-id"),le=class extends X{constructor(t){super(t),this.offset=0;let f,n,l,a,u,g;t=t||{};let U=ct.prototype.utf8Write?function(i,y){return s.utf8Write(i,y,s.byteLength-y)}:Ae&&Ae.encodeInto?function(i,y){return Ae.encodeInto(i,s.subarray(y)).written}:!1,p=this,R=t.structures||t.saveStructures,k=t.maxSharedStructures;if(k==null&&(k=R?128:0),k>8190)throw new Error("Maximum maxSharedStructure is 8190");let j=t.sequential;j&&(k=0),this.structures||(this.structures=[]),this.saveStructures&&(this.saveShared=this.saveStructures);let T,J,q=t.sharedValues,$;if(q){$=Object.create(null);for(let i=0,y=q.length;i<y;i++)$[q[i]]=i}let G=[],Me=0,he=0;this.mapEncode=function(i,y){return this._keyMap&&!this._mapped&&i.constructor.name==="Array"&&(i=i.map(c=>this.encodeKeys(c))),this.encode(i,y)},this.encode=function(i,y){if(s||(s=new Ne(8192),M=new DataView(s.buffer,0,8192),r=0),Q=s.length-10,Q-r<2048?(s=new Ne(s.length),M=new DataView(s.buffer,0,s.length),Q=s.length-10,r=0):y===Je&&(r=r+7&2147483640),n=r,p.useSelfDescribedHeader&&(M.setUint32(r,3654940416),r+=3),g=p.structuredClone?new Map:null,p.bundleStrings&&typeof i!="string"?(D=[],D.size=1/0):D=null,l=p.structures,l){if(l.uninitialized){let x=p.getShared()||{};p.structures=l=x.structures||[],p.sharedVersion=x.version;let d=p.sharedValues=x.packedValues;if(d){$={};for(let w=0,b=d.length;w<b;w++)$[d[w]]=w}}let c=l.length;if(c>k&&!j&&(c=k),!l.transitions){l.transitions=Object.create(null);for(let x=0;x<c;x++){let d=l[x];if(!d)continue;let w,b=l.transitions;for(let m=0,S=d.length;m<S;m++){b[N]===void 0&&(b[N]=x);let O=d[m];w=b[O],w||(w=b[O]=Object.create(null)),b=w}b[N]=x|1048576}}j||(l.nextId=c)}if(a&&(a=!1),u=l||[],J=$,t.pack){let c=new Map;if(c.values=[],c.encoder=p,c.maxValues=t.maxPrivatePackedValues||($?16:1/0),c.objectMap=$||!1,c.samplingPackedValues=T,Ee(i,c),c.values.length>0){s[r++]=216,s[r++]=51,H(4);let x=c.values;I(x),H(0),H(0),J=Object.create($||null);for(let d=0,w=x.length;d<w;d++)J[x[d]]=d}}je=y&ze;try{if(je)return;if(I(i),D&&ht(n,I),p.offset=r,g&&g.idsToInsert){r+=g.idsToInsert.length*2,r>Q&&re(r),p.offset=r;let c=Tt(s.subarray(n,r),g.idsToInsert);return g=null,c}return y&Je?(s.start=n,s.end=r,s):s.subarray(n,r)}finally{if(l){if(he<10&&he++,l.length>k&&(l.length=k),Me>1e4)l.transitions=null,he=0,Me=0,G.length>0&&(G=[]);else if(G.length>0&&!j){for(let c=0,x=G.length;c<x;c++)G[c][N]=void 0;G=[]}}if(a&&p.saveShared){p.structures.length>k&&(p.structures=p.structures.slice(0,k));let c=s.subarray(n,r);return p.updateSharedData()===!1?p.encode(i):c}y&zt&&(r=n)}},this.findCommonStringsToPack=()=>(T=new Map,$||($=Object.create(null)),i=>{let y=i&&i.threshold||4,c=this.pack?i.maxPrivatePackedValues||16:0;q||(q=this.sharedValues=[]);for(let[x,d]of T)d.count>y&&($[x]=c++,q.push(x),a=!0);for(;this.saveShared&&this.updateSharedData()===!1;);T=null});let I=i=>{r>Q&&(s=re(r));var y=typeof i,c;if(y==="string"){if(J){let b=J[i];if(b>=0){b<16?s[r++]=b+224:(s[r++]=198,b&1?I(15-b>>1):I(b-16>>1));return}else if(T&&!t.pack){let m=T.get(i);m?m.count++:T.set(i,{count:1})}}let x=i.length;if(D&&x>=4&&x<1024){if((D.size+=x)>Rt){let m,S=(D[0]?D[0].length*3+D[1].length:0)+10;r+S>Q&&(s=re(r+S)),s[r++]=217,s[r++]=223,s[r++]=249,s[r++]=D.position?132:130,s[r++]=26,m=r-n,r+=4,D.position&&ht(n,I),D=["",""],D.size=0,D.position=m}let b=Ft.test(i);D[b?0:1]+=i,s[r++]=b?206:207,I(x);return}let d;x<32?d=1:x<256?d=2:x<65536?d=3:d=5;let w=x*3;if(r+w>Q&&(s=re(r+w)),x<64||!U){let b,m,S,O=r+d;for(b=0;b<x;b++)m=i.charCodeAt(b),m<128?s[O++]=m:m<2048?(s[O++]=m>>6|192,s[O++]=m&63|128):(m&64512)===55296&&((S=i.charCodeAt(b+1))&64512)===56320?(m=65536+((m&1023)<<10)+(S&1023),b++,s[O++]=m>>18|240,s[O++]=m>>12&63|128,s[O++]=m>>6&63|128,s[O++]=m&63|128):(s[O++]=m>>12|224,s[O++]=m>>6&63|128,s[O++]=m&63|128);c=O-r-d}else c=U(i,r+d,w);c<24?s[r++]=96|c:c<256?(d<2&&s.copyWithin(r+2,r+1,r+1+c),s[r++]=120,s[r++]=c):c<65536?(d<3&&s.copyWithin(r+3,r+2,r+2+c),s[r++]=121,s[r++]=c>>8,s[r++]=c&255):(d<5&&s.copyWithin(r+5,r+3,r+3+c),s[r++]=122,M.setUint32(r,c),r+=4),r+=c}else if(y==="number")if(!this.alwaysUseFloat&&i>>>0===i)i<24?s[r++]=i:i<256?(s[r++]=24,s[r++]=i):i<65536?(s[r++]=25,s[r++]=i>>8,s[r++]=i&255):(s[r++]=26,M.setUint32(r,i),r+=4);else if(!this.alwaysUseFloat&&i>>0===i)i>=-24?s[r++]=31-i:i>=-256?(s[r++]=56,s[r++]=~i):i>=-65536?(s[r++]=57,M.setUint16(r,~i),r+=2):(s[r++]=58,M.setUint32(r,~i),r+=4);else if(!this.alwaysUseFloat&&i<0&&i>=-4294967296&&Math.floor(i)===i)s[r++]=58,M.setUint32(r,-1-i),r+=4;else{let x;if((x=this.useFloat32)>0&&i<4294967296&&i>=-2147483648){s[r++]=250,M.setFloat32(r,i);let d;if(x<4||(d=i*me[(s[r]&127)<<1|s[r+1]>>7])>>0===d){r+=4;return}else r--}s[r++]=251,M.setFloat64(r,i),r+=8}else if(y==="object")if(!i)s[r++]=246;else{if(g){let d=g.get(i);if(d){if(s[r++]=216,s[r++]=29,s[r++]=25,!d.references){let w=g.idsToInsert||(g.idsToInsert=[]);d.references=[],w.push(d)}d.references.push(r-n),r+=2;return}else g.set(i,{offset:r-n})}let x=i.constructor;if(x===Object)this.skipFunction===!0&&(i=Object.fromEntries([...Object.keys(i).filter(d=>typeof i[d]!="function").map(d=>[d,i[d]])])),Ue(i);else if(x===Array){c=i.length,c<24?s[r++]=128|c:H(c);for(let d=0;d<c;d++)I(i[d])}else if(x===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(s[r++]=217,s[r++]=1,s[r++]=3),c=i.size,c<24?s[r++]=160|c:c<256?(s[r++]=184,s[r++]=c):c<65536?(s[r++]=185,s[r++]=c>>8,s[r++]=c&255):(s[r++]=186,M.setUint32(r,c),r+=4),p.keyMap)for(let[d,w]of i)I(p.encodeKey(d)),I(w);else for(let[d,w]of i)I(d),I(w);else{for(let d=0,w=Oe.length;d<w;d++){let b=$e[d];if(i instanceof b){let m=Oe[d],S=m.tag;S==null&&(S=m.getTag&&m.getTag.call(this,i)),S<24?s[r++]=192|S:S<256?(s[r++]=216,s[r++]=S):S<65536?(s[r++]=217,s[r++]=S>>8,s[r++]=S&255):S>-1&&(s[r++]=218,M.setUint32(r,S),r+=4),m.encode.call(this,i,I,re);return}}if(i[Symbol.iterator]){if(je){let d=new Error("Iterable should be serialized as iterator");throw d.iteratorNotHandled=!0,d}s[r++]=159;for(let d of i)I(d);s[r++]=255;return}if(i[Symbol.asyncIterator]||Ke(i)){let d=new Error("Iterable/blob should be serialized as iterator");throw d.iteratorNotHandled=!0,d}if(this.useToJSON&&i.toJSON){let d=i.toJSON();if(d!==i)return I(d)}Ue(i)}}else if(y==="boolean")s[r++]=i?245:244;else if(y==="bigint"){if(i<BigInt(1)<<BigInt(64)&&i>=0)s[r++]=27,M.setBigUint64(r,i);else if(i>-(BigInt(1)<<BigInt(64))&&i<0)s[r++]=59,M.setBigUint64(r,-i-BigInt(1));else if(this.largeBigIntToFloat)s[r++]=251,M.setFloat64(r,Number(i));else{i>=BigInt(0)?s[r++]=194:(s[r++]=195,i=BigInt(-1)-i);let x=[];for(;i;)x.push(Number(i&BigInt(255))),i>>=BigInt(8);We(new Uint8Array(x.reverse()),re);return}r+=8}else if(y==="undefined")s[r++]=247;else throw new Error("Unknown type: "+y)},Ue=this.useRecords===!1?this.variableMapSize?i=>{let y=Object.keys(i),c=Object.values(i),x=y.length;x<24?s[r++]=160|x:x<256?(s[r++]=184,s[r++]=x):x<65536?(s[r++]=185,s[r++]=x>>8,s[r++]=x&255):(s[r++]=186,M.setUint32(r,x),r+=4);let d;if(p.keyMap)for(let w=0;w<x;w++)I(p.encodeKey(y[w])),I(c[w]);else for(let w=0;w<x;w++)I(y[w]),I(c[w])}:i=>{s[r++]=185;let y=r-n;r+=2;let c=0;if(p.keyMap)for(let x in i)(typeof i.hasOwnProperty!="function"||i.hasOwnProperty(x))&&(I(p.encodeKey(x)),I(i[x]),c++);else for(let x in i)(typeof i.hasOwnProperty!="function"||i.hasOwnProperty(x))&&(I(x),I(i[x]),c++);s[y+++n]=c>>8,s[y+n]=c&255}:(i,y)=>{let c,x=u.transitions||(u.transitions=Object.create(null)),d=0,w=0,b,m;if(this.keyMap){m=Object.keys(i).map(O=>this.encodeKey(O)),w=m.length;for(let O=0;O<w;O++){let Ze=m[O];c=x[Ze],c||(c=x[Ze]=Object.create(null),d++),x=c}}else for(let O in i)(typeof i.hasOwnProperty!="function"||i.hasOwnProperty(O))&&(c=x[O],c||(x[N]&1048576&&(b=x[N]&65535),c=x[O]=Object.create(null),d++),x=c,w++);let S=x[N];if(S!==void 0)S&=65535,s[r++]=217,s[r++]=S>>8|224,s[r++]=S&255;else if(m||(m=x.__keys__||(x.__keys__=Object.keys(i))),b===void 0?(S=u.nextId++,S||(S=0,u.nextId=1),S>=ut&&(u.nextId=(S=k)+1)):S=b,u[S]=m,S<k){s[r++]=217,s[r++]=S>>8|224,s[r++]=S&255,x=u.transitions;for(let O=0;O<w;O++)(x[N]===void 0||x[N]&1048576)&&(x[N]=S),x=x[m[O]];x[N]=S|1048576,a=!0}else{if(x[N]=S,M.setUint32(r,3655335680),r+=3,d&&(Me+=he*d),G.length>=ut-k&&(G.shift()[N]=void 0),G.push(x),H(w+2),I(57344+S),I(m),y)return;for(let O in i)(typeof i.hasOwnProperty!="function"||i.hasOwnProperty(O))&&I(i[O]);return}if(w<24?s[r++]=128|w:H(w),!y)for(let O in i)(typeof i.hasOwnProperty!="function"||i.hasOwnProperty(O))&&I(i[O])},re=i=>{let y;if(i>16777216){if(i-n>dt)throw new Error("Encoded buffer would be larger than maximum buffer size");y=Math.min(dt,Math.round(Math.max((i-n)*(i>67108864?1.25:2),4194304)/4096)*4096)}else y=(Math.max(i-n<<2,s.length-1)>>12)+1<<12;let c=new Ne(y);return M=new DataView(c.buffer,0,y),s.copy?s.copy(c,0,n,i):c.set(s.slice(n,i)),r-=n,n=0,Q=c.length-10,s=c},v=100,He=1e3;this.encodeAsIterable=function(i,y){return qe(i,y,ne)},this.encodeAsAsyncIterable=function(i,y){return qe(i,y,Ge)};function*ne(i,y,c){let x=i.constructor;if(x===Object){let d=p.useRecords!==!1;d?Ue(i,!0):xt(Object.keys(i).length,160);for(let w in i){let b=i[w];d||I(w),b&&typeof b=="object"?y[w]?yield*ne(b,y[w]):yield*_e(b,y,w):I(b)}}else if(x===Array){let d=i.length;H(d);for(let w=0;w<d;w++){let b=i[w];b&&(typeof b=="object"||r-n>v)?y.element?yield*ne(b,y.element):yield*_e(b,y,"element"):I(b)}}else if(i[Symbol.iterator]&&!i.buffer){s[r++]=159;for(let d of i)d&&(typeof d=="object"||r-n>v)?y.element?yield*ne(d,y.element):yield*_e(d,y,"element"):I(d);s[r++]=255}else Ke(i)?(xt(i.size,64),yield s.subarray(n,r),yield i,oe()):i[Symbol.asyncIterator]?(s[r++]=159,yield s.subarray(n,r),yield i,oe(),s[r++]=255):I(i);c&&r>n?yield s.subarray(n,r):r-n>v&&(yield s.subarray(n,r),oe())}function*_e(i,y,c){let x=r-n;try{I(i),r-n>v&&(yield s.subarray(n,r),oe())}catch(d){if(d.iteratorNotHandled)y[c]={},r=n+x,yield*ne.call(this,i,y[c]);else throw d}}function oe(){v=He,p.encode(null,ze)}function qe(i,y,c){return y&&y.chunkThreshold?v=He=y.chunkThreshold:v=100,i&&typeof i=="object"?(p.encode(null,ze),c(i,p.iterateProperties||(p.iterateProperties={}),!0)):[p.encode(i)]}async function*Ge(i,y){for(let c of ne(i,y,!0)){let x=c.constructor;if(x===ct||x===Uint8Array)yield c;else if(Ke(c)){let d=c.stream().getReader(),w;for(;!(w=await d.read()).done;)yield w.value}else if(c[Symbol.asyncIterator])for await(let d of c)oe(),d?yield*Ge(d,y.async||(y.async={})):yield p.encode(d);else yield c}}}useBuffer(t){s=t,M=new DataView(s.buffer,s.byteOffset,s.byteLength),r=0}clearSharedData(){this.structures&&(this.structures=[]),this.sharedValues&&(this.sharedValues=void 0)}updateSharedData(){let t=this.sharedVersion||0;this.sharedVersion=t+1;let f=this.structures.slice(0),n=new Ie(f,this.sharedValues,this.sharedVersion),l=this.saveShared(n,a=>(a&&a.version||0)==t);return l===!1?(n=this.getShared()||{},this.structures=n.structures||[],this.sharedValues=n.packedValues,this.sharedVersion=n.version,this.structures.nextId=this.structures.length):f.forEach((a,u)=>this.structures[u]=a),l}};function xt(e,t){e<24?s[r++]=t|e:e<256?(s[r++]=t|24,s[r++]=e):e<65536?(s[r++]=t|25,s[r++]=e>>8,s[r++]=e&255):(s[r++]=t|26,M.setUint32(r,e),r+=4)}var Ie=class{constructor(t,f,n){this.structures=t,this.packedValues=f,this.version=n}};function H(e){e<24?s[r++]=128|e:e<256?(s[r++]=152,s[r++]=e):e<65536?(s[r++]=153,s[r++]=e>>8,s[r++]=e&255):(s[r++]=154,M.setUint32(r,e),r+=4)}var Dt=typeof Blob>"u"?function(){}:Blob;function Ke(e){if(e instanceof Dt)return!0;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Ee(e,t){switch(typeof e){case"string":if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let n=t.get(e);if(n)++n.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let l=t.samplingPackedValues.get(e);l?l.count++:t.samplingPackedValues.set(e,{count:1})}}break;case"object":if(e)if(e instanceof Array)for(let n=0,l=e.length;n<l;n++)Ee(e[n],t);else{let n=!t.encoder.useRecords;for(var f in e)e.hasOwnProperty(f)&&(n&&Ee(f,t),Ee(e[f],t))}break;case"function":console.log(e)}}var Pt=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;$e=[Date,Set,Error,RegExp,W,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?function(){}:BigInt64Array,Float32Array,Float64Array,Ie];Oe=[{tag:1,encode(e,t){let f=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&f>=0&&f<4294967296?(s[r++]=26,M.setUint32(r,f),r+=4):(s[r++]=251,M.setFloat64(r,f),r+=8)}},{tag:258,encode(e,t){let f=Array.from(e);t(f)}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t(["RegExp",e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,f){We(e,f)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||xe&&this.tagUint8Array!==!1))return 64},encode(e,t,f){We(e,f)}},Y(68,1),Y(69,2),Y(70,4),Y(71,8),Y(72,1),Y(77,2),Y(78,4),Y(79,8),Y(85,4),Y(86,8),{encode(e,t){let f=e.packedValues||[],n=e.structures||[];if(f.values.length>0){s[r++]=216,s[r++]=51,H(4);let l=f.values;t(l),H(0),H(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let a=0,u=l.length;a<u;a++)packedObjectMap[l[a]]=a}if(n){M.setUint32(r,3655335424),r+=3;let l=n.slice(0);l.unshift(57344),l.push(new W(e.version,1399353956)),t(l)}else t(new W(e.version,1399353956))}}];function Y(e,t){return!Pt&&t>1&&(e-=4),{tag:e,encode:function(n,l){let a=n.byteLength,u=n.byteOffset||0,g=n.buffer||n;l(xe?ke.from(g,u,a):new Uint8Array(g,u,a))}}}function We(e,t){let f=e.byteLength;f<24?s[r++]=64+f:f<256?(s[r++]=88,s[r++]=f):f<65536?(s[r++]=89,s[r++]=f>>8,s[r++]=f&255):(s[r++]=90,M.setUint32(r,f),r+=4),r+f>=s.length&&t(r+f),s.set(e.buffer?e:new Uint8Array(e),r),r+=f}function Tt(e,t){let f,n=t.length*2,l=e.length-n;t.sort((a,u)=>a.offset>u.offset?1:-1);for(let a=0;a<t.length;a++){let u=t[a];u.id=a;for(let g of u.references)e[g++]=a>>8,e[g]=a&255}for(;f=t.pop();){let a=f.offset;e.copyWithin(a+n,a,l),n-=2;let u=a+n;e[u++]=216,e[u++]=28,l=a}return e}function ht(e,t){M.setUint32(D.position+e,r-D.position-e+1);let f=D;D=null,t(f[0]),t(f[1])}function yt(e){if(e.Class){if(!e.encode)throw new Error("Extension has no encode function");$e.unshift(e.Class),Oe.unshift(e)}ot(e)}var Ye=new le({useRecords:!1}),pt=Ye.encode,Vt=Ye.encodeAsIterable,Ct=Ye.encodeAsAsyncIterable,{NEVER:Lt,ALWAYS:Nt,DECIMAL_ROUND:jt,DECIMAL_FIT:Kt}=Se,Je=512,zt=1024,ze=2048;export{X as Decoder,le as Encoder,W as Tag,yt as addExtension,at as decode,pt as encode};
|