moi-computer 0.13.1-next.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/moi.mjs +10 -6
- package/dist/{chunk-k32585ne.js → chunk-828s864r.js} +61 -61
- package/dist/chunk-9ffaaaw3.css +1 -0
- package/dist/chunk-gh11h6dc.js +2 -0
- package/dist/chunk-hhgsmxsq.js +1 -0
- package/dist/chunk-ht9zmff2.js +5 -0
- package/dist/{chunk-0t8m1ehd.js → chunk-jqa4c92z.js} +2 -2
- package/dist/{chunk-qtkv7hp8.js → chunk-kkhswjz8.js} +2 -2
- package/dist/{chunk-wjbejzek.js → chunk-nqh3kx2x.js} +1 -1
- package/dist/chunk-rb2vsqvb.js +1 -0
- package/dist/{chunk-c8g5x288.js → chunk-t22yw8s6.js} +1 -1
- package/dist/chunk-yv6n9e3z.js +72 -0
- package/dist/dot-2bdkpg3k.png +0 -0
- package/dist/duet-3ab8xyzd.png +0 -0
- package/dist/grok-bot-yv07qj9f.png +0 -0
- package/dist/index.html +1 -1
- package/dist/instinct-ypmq6t0w.png +0 -0
- package/dist/muse-qr7zwsvf.png +0 -0
- package/package.json +39 -40
- package/runtime/applets/chunk-bzxakh65.js +2 -0
- package/runtime/applets/chunk-qhjskz2m.js +2 -0
- package/runtime/applets/collab.js +1 -0
- package/runtime/applets/moi.js +1 -0
- package/runtime/applets/rpc.js +2 -0
- package/runtime/assets/shadcn.css +629 -0
- package/runtime/assets/tw-animate.css +1 -0
- package/runtime/build-worker-entry.js +2 -0
- package/runtime/chunk-00rk365r.js +83 -0
- package/runtime/chunk-4wj1jzhr.js +3 -0
- package/runtime/chunk-5egvk1rz.js +3 -0
- package/runtime/chunk-7c0zbz74.js +3 -0
- package/runtime/chunk-8fvgvm56.js +2 -0
- package/runtime/chunk-c3qyet60.js +128 -0
- package/runtime/chunk-ewc55jga.js +32623 -0
- package/runtime/chunk-gbkjshyt.js +26 -0
- package/runtime/chunk-ggphq7nk.js +66 -0
- package/runtime/chunk-h2bwhk81.js +3 -0
- package/runtime/chunk-hjzfk1cr.js +3 -0
- package/runtime/chunk-j0nd7kw0.js +52 -0
- package/runtime/chunk-jb63ns1z.js +2 -0
- package/runtime/chunk-k049dtaq.js +3 -0
- package/runtime/chunk-kjp60rqs.js +3 -0
- package/runtime/chunk-q06m17nb.js +3 -0
- package/runtime/chunk-r5s8rm8n.js +3 -0
- package/runtime/chunk-sdyqhxe1.js +10 -0
- package/runtime/chunk-w1fx9tsc.js +3 -0
- package/runtime/chunk-w6ksnv8y.js +2 -0
- package/runtime/chunk-wvarpvem.js +78 -0
- package/runtime/chunk-zm7k0v1c.js +3 -0
- package/runtime/chunk-zwvtkb81.js +139 -0
- package/runtime/cli.js +246 -0
- package/runtime/functions-worker.js +2 -0
- package/runtime/gateway-client.js +2 -0
- package/runtime/third-party-notices.txt +6830 -0
- package/runtime/worker.js +2 -0
- package/runtime/xdg-open +1267 -0
- package/bunfig.toml +0 -7
- package/client/AGENTS.md +0 -40
- package/client/api/app-config.ts +0 -58
- package/client/api/http.ts +0 -44
- package/client/api/query-client.ts +0 -5
- package/client/api/query-options.ts +0 -6
- package/client/api/workspace-keys.ts +0 -18
- package/client/app/app-provider.tsx +0 -39
- package/client/app/app-router.tsx +0 -57
- package/client/app/routes/home-route.tsx +0 -27
- package/client/app/routes/onboarding-route.tsx +0 -11
- package/client/app/routes/settings-route.tsx +0 -10
- package/client/app/routes/workspace-registration.tsx +0 -68
- package/client/app/routes/workspace-route.tsx +0 -127
- package/client/app/shell/sidebar-layout.tsx +0 -247
- package/client/assets/claude.svg +0 -3
- package/client/assets/favicon.png +0 -0
- package/client/assets/floppy-disk.webp +0 -0
- package/client/assets/hermes.png +0 -0
- package/client/assets/mcp/.gitkeep +0 -0
- package/client/assets/mcp/airtable.png +0 -0
- package/client/assets/mcp/apollo.png +0 -0
- package/client/assets/mcp/asana.png +0 -0
- package/client/assets/mcp/atlassian.png +0 -0
- package/client/assets/mcp/box.png +0 -0
- package/client/assets/mcp/chrome.svg +0 -33
- package/client/assets/mcp/clickup.png +0 -0
- package/client/assets/mcp/cloudflare.png +0 -0
- package/client/assets/mcp/context7.png +0 -0
- package/client/assets/mcp/datadog.png +0 -0
- package/client/assets/mcp/discord.png +0 -0
- package/client/assets/mcp/dropbox.png +0 -0
- package/client/assets/mcp/elevenlabs.png +0 -0
- package/client/assets/mcp/exa.png +0 -0
- package/client/assets/mcp/figma.png +0 -0
- package/client/assets/mcp/firecrawl.png +0 -0
- package/client/assets/mcp/github.png +0 -0
- package/client/assets/mcp/gitlab.png +0 -0
- package/client/assets/mcp/gmail.png +0 -0
- package/client/assets/mcp/googlecalendar.png +0 -0
- package/client/assets/mcp/googledrive.png +0 -0
- package/client/assets/mcp/grafana.png +0 -0
- package/client/assets/mcp/granola.png +0 -0
- package/client/assets/mcp/hubspot.png +0 -0
- package/client/assets/mcp/huggingface.png +0 -0
- package/client/assets/mcp/intercom.png +0 -0
- package/client/assets/mcp/linear.png +0 -0
- package/client/assets/mcp/monday.png +0 -0
- package/client/assets/mcp/mongodb.png +0 -0
- package/client/assets/mcp/neon.png +0 -0
- package/client/assets/mcp/notion.png +0 -0
- package/client/assets/mcp/paper.png +0 -0
- package/client/assets/mcp/paypal.png +0 -0
- package/client/assets/mcp/perplexity.png +0 -0
- package/client/assets/mcp/postgresql.png +0 -0
- package/client/assets/mcp/posthog.png +0 -0
- package/client/assets/mcp/puppeteer.png +0 -0
- package/client/assets/mcp/railway.png +0 -0
- package/client/assets/mcp/redis.png +0 -0
- package/client/assets/mcp/salesforce.png +0 -0
- package/client/assets/mcp/sentry.png +0 -0
- package/client/assets/mcp/shopify.png +0 -0
- package/client/assets/mcp/slack.png +0 -0
- package/client/assets/mcp/snowflake.png +0 -0
- package/client/assets/mcp/stripe.png +0 -0
- package/client/assets/mcp/supabase.png +0 -0
- package/client/assets/mcp/telegram.png +0 -0
- package/client/assets/mcp/twilio.png +0 -0
- package/client/assets/mcp/vercel.png +0 -0
- package/client/assets/mcp/zapier.png +0 -0
- package/client/assets/moi-logo.svg +0 -11
- package/client/assets/openai.svg +0 -1
- package/client/assets/openclaw.svg +0 -22
- package/client/assets.d.ts +0 -14
- package/client/components/shared/agent-blobatar.tsx +0 -93
- package/client/components/shared/bottom-panel.tsx +0 -65
- package/client/components/shared/composer.tsx +0 -125
- package/client/components/shared/led-logo.tsx +0 -181
- package/client/components/shared/panel-header.tsx +0 -16
- package/client/components/shared/reorderable-list.tsx +0 -204
- package/client/components/shared/screen-shell.tsx +0 -23
- package/client/components/shared/ultrafast-icon.tsx +0 -61
- package/client/components/shared/workspace-icon.tsx +0 -83
- package/client/components/ui/alert-dialog.tsx +0 -1
- package/client/components/ui/button.tsx +0 -1
- package/client/components/ui/checkbox.tsx +0 -1
- package/client/components/ui/collapsible.tsx +0 -1
- package/client/components/ui/dialog.tsx +0 -1
- package/client/components/ui/dropdown-menu.tsx +0 -1
- package/client/components/ui/hover-card.tsx +0 -1
- package/client/components/ui/inline-input.tsx +0 -84
- package/client/components/ui/input.tsx +0 -1
- package/client/components/ui/popover.tsx +0 -1
- package/client/components/ui/resizable.tsx +0 -1
- package/client/components/ui/skeleton.tsx +0 -1
- package/client/components/ui/slider.tsx +0 -1
- package/client/components/ui/spinner.tsx +0 -1
- package/client/components/ui/switch.tsx +0 -1
- package/client/components/ui/tabs.tsx +0 -1
- package/client/components/ui/textarea.tsx +0 -1
- package/client/components/ui/toast.tsx +0 -220
- package/client/components/ui/tooltip.tsx +0 -1
- package/client/dev/index.html +0 -43
- package/client/dev/index.ts +0 -15
- package/client/externalize-react.ts +0 -41
- package/client/features/account/account-menu.tsx +0 -96
- package/client/features/account/account-provider.tsx +0 -93
- package/client/features/account/account-test-utils.tsx +0 -310
- package/client/features/account/api.ts +0 -67
- package/client/features/account/profile-actions.ts +0 -29
- package/client/features/app-settings/api.ts +0 -33
- package/client/features/app-settings/avatar-upload.tsx +0 -62
- package/client/features/app-settings/general-settings.tsx +0 -39
- package/client/features/app-settings/profile-settings.tsx +0 -105
- package/client/features/app-settings/settings-page.tsx +0 -45
- package/client/features/app-settings/settings-section.tsx +0 -26
- package/client/features/applets/api.ts +0 -38
- package/client/features/applets/applet-cache.ts +0 -95
- package/client/features/applets/applet-container.tsx +0 -33
- package/client/features/applets/applet-log.ts +0 -81
- package/client/features/applets/applet-runtime.ts +0 -325
- package/client/features/applets/applet-styles.ts +0 -81
- package/client/features/applets/applet-thumbnail.ts +0 -294
- package/client/features/applets/use-applet.ts +0 -210
- package/client/features/applets/widget-error-boundary.tsx +0 -62
- package/client/features/applets/widget-shell.tsx +0 -56
- package/client/features/chat/applet-chat-intents.ts +0 -173
- package/client/features/chat/chat-panel.tsx +0 -326
- package/client/features/chat/chat-popup.tsx +0 -175
- package/client/features/chat/chat-send.ts +0 -259
- package/client/features/chat/chat-store.ts +0 -328
- package/client/features/chat/composer/attachments/attachment-chip.tsx +0 -99
- package/client/features/chat/composer/attachments/draft-attachments.ts +0 -185
- package/client/features/chat/composer/attachments/drawing-attachment-chip.tsx +0 -37
- package/client/features/chat/composer/attachments/file-attachment-chip.tsx +0 -22
- package/client/features/chat/composer/attachments/text-attachment-chip.tsx +0 -11
- package/client/features/chat/composer/attachments/types.ts +0 -25
- package/client/features/chat/composer/attachments/uploads.ts +0 -26
- package/client/features/chat/composer/banners/composer-banner.tsx +0 -16
- package/client/features/chat/composer/banners/error-banner.tsx +0 -36
- package/client/features/chat/composer/banners/skill-update-banner.tsx +0 -93
- package/client/features/chat/composer/chat-composer.tsx +0 -290
- package/client/features/chat/composer/model-order.ts +0 -110
- package/client/features/chat/composer/model-picker.tsx +0 -408
- package/client/features/chat/composer/use-workspace-composer-state.tsx +0 -69
- package/client/features/chat/composer/use-workspace-skill-updates.ts +0 -160
- package/client/features/chat/connection/chat-connection.ts +0 -64
- package/client/features/chat/connection/chat-frames.ts +0 -153
- package/client/features/chat/messages/chat-empty-state.tsx +0 -294
- package/client/features/chat/messages/chat-prompt-bubbles.tsx +0 -72
- package/client/features/chat/messages/fork-history.ts +0 -14
- package/client/features/chat/messages/group-turns.ts +0 -74
- package/client/features/chat/messages/interleave-notices.ts +0 -80
- package/client/features/chat/messages/markdown-content.tsx +0 -89
- package/client/features/chat/messages/preview-turn.ts +0 -37
- package/client/features/chat/messages/shimmer-text.tsx +0 -20
- package/client/features/chat/messages/tool-group/code-block.tsx +0 -41
- package/client/features/chat/messages/tool-group/collapse.tsx +0 -28
- package/client/features/chat/messages/tool-group/detect.ts +0 -93
- package/client/features/chat/messages/tool-group/fixtures.ts +0 -309
- package/client/features/chat/messages/tool-group/format/claude.ts +0 -49
- package/client/features/chat/messages/tool-group/format/codex.ts +0 -130
- package/client/features/chat/messages/tool-group/format/hermes.ts +0 -69
- package/client/features/chat/messages/tool-group/format/index.ts +0 -34
- package/client/features/chat/messages/tool-group/format/mcp.ts +0 -68
- package/client/features/chat/messages/tool-group/format/openclaw.ts +0 -120
- package/client/features/chat/messages/tool-group/format/shared.ts +0 -49
- package/client/features/chat/messages/tool-group/format/shell.ts +0 -162
- package/client/features/chat/messages/tool-group/index.ts +0 -9
- package/client/features/chat/messages/tool-group/read-image-preview.tsx +0 -46
- package/client/features/chat/messages/tool-group/subagent-card.tsx +0 -138
- package/client/features/chat/messages/tool-group/timeline-row.tsx +0 -159
- package/client/features/chat/messages/tool-group/tool-call-group.tsx +0 -279
- package/client/features/chat/messages/tool-group/tool-output.tsx +0 -125
- package/client/features/chat/messages/turn-view.tsx +0 -270
- package/client/features/chat/messages/use-stick-to-bottom.ts +0 -96
- package/client/features/chat/messages/user-message-bubble.tsx +0 -63
- package/client/features/chat/sessions/api.ts +0 -193
- package/client/features/chat/sessions/chat-selector.tsx +0 -399
- package/client/features/chat/sessions/session-view.ts +0 -53
- package/client/features/chat/sessions/use-selected-session.ts +0 -171
- package/client/features/chat/use-chat.ts +0 -229
- package/client/features/collab/applet-api.ts +0 -35
- package/client/features/collab/components/cursors.tsx +0 -241
- package/client/features/collab/components/presence-avatars.tsx +0 -74
- package/client/features/collab/components/presence-frame.tsx +0 -122
- package/client/features/collab/components/presence-group.tsx +0 -31
- package/client/features/collab/components/presence-helpers.ts +0 -50
- package/client/features/collab/components/user-avatar-group.tsx +0 -35
- package/client/features/collab/components/user-avatar.tsx +0 -65
- package/client/features/collab/components/user.tsx +0 -69
- package/client/features/collab/host-state.ts +0 -160
- package/client/features/collab/index.ts +0 -5
- package/client/features/collab/local-user.ts +0 -46
- package/client/features/collab/members/api.ts +0 -17
- package/client/features/collab/members/hooks.ts +0 -97
- package/client/features/collab/members/store.ts +0 -148
- package/client/features/collab/members/types.ts +0 -55
- package/client/features/collab/presence/client.ts +0 -242
- package/client/features/collab/presence/hooks.tsx +0 -160
- package/client/features/collab/presence/presence-publisher.ts +0 -30
- package/client/features/collab/presence/presence-target.ts +0 -8
- package/client/features/collab/presence/provider.tsx +0 -74
- package/client/features/collab/presence/store.ts +0 -156
- package/client/features/collab/presence/users.ts +0 -87
- package/client/features/collab/proxy-user.ts +0 -28
- package/client/features/collab/sharing/agent-invite.tsx +0 -30
- package/client/features/collab/sharing/workspace-members.tsx +0 -269
- package/client/features/collab/sharing/workspace-sharing-menu.tsx +0 -179
- package/client/features/collab/testing/component-fixtures.tsx +0 -54
- package/client/features/collab/testing/fake-engine.ts +0 -120
- package/client/features/connectors/api.ts +0 -25
- package/client/features/connectors/icon-mcp.tsx +0 -21
- package/client/features/connectors/mcp-icons.ts +0 -183
- package/client/features/connectors/mcp-server-cards.tsx +0 -105
- package/client/features/connectors/read-connectors.ts +0 -35
- package/client/features/demo/demo-dialog.tsx +0 -194
- package/client/features/dev/blobatar-shapes-page.tsx +0 -344
- package/client/features/dev/chat-states-fixtures.ts +0 -755
- package/client/features/dev/chat-states-page.tsx +0 -476
- package/client/features/dev/collab/collab-page.tsx +0 -24
- package/client/features/dev/collab/collab-playground.tsx +0 -614
- package/client/features/dev/collab/local-user-settings.tsx +0 -120
- package/client/features/dev/collab/playground-room.ts +0 -33
- package/client/features/dev/dev-index-page.tsx +0 -83
- package/client/features/dev/dev-routes.tsx +0 -43
- package/client/features/dev/harness-debug-page.tsx +0 -607
- package/client/features/dev/onboarding-preview-page.tsx +0 -76
- package/client/features/dev/texture-lab-page.tsx +0 -149
- package/client/features/dev/tool-calls-page.tsx +0 -79
- package/client/features/dev/ui-components/ui-component-previews.tsx +0 -855
- package/client/features/dev/ui-components/ui-components-page.tsx +0 -60
- package/client/features/dev/workspace-setup-mocks.ts +0 -103
- package/client/features/dev/workspace-setup-page.tsx +0 -11
- package/client/features/dev/workspace-setup-preview.tsx +0 -249
- package/client/features/drawings/capture-element.ts +0 -57
- package/client/features/drawings/drawing-layer.tsx +0 -49
- package/client/features/drawings/drawing-toolbar.tsx +0 -95
- package/client/features/drawings/use-chat-annotation.ts +0 -228
- package/client/features/drawings/use-drawing-layer.ts +0 -756
- package/client/features/drawings/use-view-sketch.ts +0 -154
- package/client/features/harness/api.ts +0 -69
- package/client/features/harness/device-login-steps.tsx +0 -103
- package/client/features/harness/harness-login-panel.tsx +0 -232
- package/client/features/harness/harness-presentation.ts +0 -15
- package/client/features/harness/harness-selector.tsx +0 -119
- package/client/features/harness/use-harness-login.ts +0 -77
- package/client/features/home/api.ts +0 -135
- package/client/features/home/home-logo.tsx +0 -344
- package/client/features/home/home-page.tsx +0 -305
- package/client/features/home/shared-workspaces.tsx +0 -70
- package/client/features/home/workspace-invitations.tsx +0 -101
- package/client/features/home/workspace-preview.tsx +0 -213
- package/client/features/identity/host-api.ts +0 -35
- package/client/features/identity/store.ts +0 -26
- package/client/features/identity/types.ts +0 -41
- package/client/features/identity/use-identity.ts +0 -6
- package/client/features/onboarding/agent-setup-step.tsx +0 -57
- package/client/features/onboarding/api.ts +0 -42
- package/client/features/onboarding/onboarding-idea-disk.tsx +0 -129
- package/client/features/onboarding/onboarding-page.tsx +0 -33
- package/client/features/onboarding/onboarding-screen.tsx +0 -20
- package/client/features/onboarding/onboarding-status.tsx +0 -24
- package/client/features/onboarding/workspace-setup-step.tsx +0 -239
- package/client/features/overview/api.ts +0 -28
- package/client/features/overview/default/registry.tsx +0 -34
- package/client/features/overview/default/views-widget.tsx +0 -246
- package/client/features/overview/grid.ts +0 -77
- package/client/features/overview/hidden-panel.tsx +0 -111
- package/client/features/overview/overview.tsx +0 -299
- package/client/features/overview/use-grid-reconcile.ts +0 -94
- package/client/features/overview/widget-canvas.tsx +0 -166
- package/client/features/overview/widget-frame.tsx +0 -77
- package/client/features/overview/workspace-name.tsx +0 -55
- package/client/features/scratchpad/scratch-session.ts +0 -71
- package/client/features/scratchpad/scratchpad-controls.tsx +0 -516
- package/client/features/scratchpad/scratchpad.tsx +0 -360
- package/client/features/scratchpad/use-scratchpad-snapshot.tsx +0 -133
- package/client/features/update/api.ts +0 -35
- package/client/features/update/update-control.tsx +0 -102
- package/client/features/views/api.ts +0 -188
- package/client/features/views/pending-view-screen.tsx +0 -303
- package/client/features/views/use-view-actions.ts +0 -119
- package/client/features/views/use-view-drafts.ts +0 -88
- package/client/features/views/view-manager.tsx +0 -293
- package/client/features/views/view-presentation.ts +0 -12
- package/client/features/views/view-residency.ts +0 -77
- package/client/features/views/view-submission.ts +0 -56
- package/client/features/workspace/add/api.ts +0 -61
- package/client/features/workspace/add/create-workspace-dialog.tsx +0 -230
- package/client/features/workspace/add/import-workspace-dialog.tsx +0 -81
- package/client/features/workspace/add/use-workspace-import.ts +0 -61
- package/client/features/workspace/add/workspace-agent-options.ts +0 -53
- package/client/features/workspace/add/workspace-agent-selector.tsx +0 -96
- package/client/features/workspace/add/workspace-dialog-content.tsx +0 -22
- package/client/features/workspace/api.ts +0 -180
- package/client/features/workspace/harness-transition.ts +0 -81
- package/client/features/workspace/moi-context.ts +0 -129
- package/client/features/workspace/remote.ts +0 -34
- package/client/features/workspace/settings/api.ts +0 -112
- package/client/features/workspace/settings/connectors-settings.tsx +0 -110
- package/client/features/workspace/settings/environment-settings.tsx +0 -149
- package/client/features/workspace/settings/general-settings.tsx +0 -180
- package/client/features/workspace/settings/icon-picker-options.ts +0 -30
- package/client/features/workspace/settings/settings-layout.tsx +0 -53
- package/client/features/workspace/settings/use-env-vars.ts +0 -20
- package/client/features/workspace/settings/workspace-icon-picker.tsx +0 -318
- package/client/features/workspace/settings/workspace-settings-dialog.tsx +0 -65
- package/client/features/workspace/setup/workspace-login-state.tsx +0 -56
- package/client/features/workspace/setup/workspace-recovery-states.tsx +0 -142
- package/client/features/workspace/setup/workspace-setup.tsx +0 -98
- package/client/features/workspace/setup/workspace-welcome-state.tsx +0 -81
- package/client/features/workspace/tab-resolution.ts +0 -32
- package/client/features/workspace/theme-panel.tsx +0 -191
- package/client/features/workspace/unavailable-page.tsx +0 -21
- package/client/features/workspace/use-fits-split-layout.ts +0 -69
- package/client/features/workspace/use-workspace-navigation.ts +0 -265
- package/client/features/workspace/use-workspace-socket.ts +0 -51
- package/client/features/workspace/workspace-content.tsx +0 -597
- package/client/features/workspace/workspace-context.tsx +0 -21
- package/client/features/workspace/workspace-frame.tsx +0 -64
- package/client/features/workspace/workspace-identity.tsx +0 -40
- package/client/features/workspace/workspace-layout-context.tsx +0 -156
- package/client/features/workspace/workspace-menu.tsx +0 -67
- package/client/features/workspace/workspace-pane.tsx +0 -22
- package/client/features/workspace/workspace-pending-screen.tsx +0 -26
- package/client/features/workspace/workspace-preferences.ts +0 -91
- package/client/features/workspace/workspace-presentation.tsx +0 -35
- package/client/features/workspace/workspace-screen.tsx +0 -28
- package/client/features/workspace/workspace-split-layout.tsx +0 -116
- package/client/features/workspace/workspace-state.ts +0 -206
- package/client/features/workspace/workspace-tabs.tsx +0 -233
- package/client/features/workspace/workspace-test-utils.ts +0 -23
- package/client/global.d.ts +0 -5
- package/client/index.css +0 -247
- package/client/index.html +0 -81
- package/client/index.tsx +0 -45
- package/client/lib/agent-availability.ts +0 -14
- package/client/lib/browser-tab-id.ts +0 -4
- package/client/lib/cn.ts +0 -6
- package/client/lib/flags.ts +0 -11
- package/client/lib/identity-icon-registry.ts +0 -150
- package/client/lib/rate-limit.ts +0 -77
- package/client/lib/use-latest-ref.ts +0 -11
- package/client/lib/user-display-name.ts +0 -6
- package/client/lib/ws-url.ts +0 -10
- package/client/main.tsx +0 -43
- package/client/runtime/app-context.ts +0 -20
- package/client/runtime/app-events.ts +0 -75
- package/client/runtime/hmr-watchdog.ts +0 -39
- package/client/runtime/reconnecting-socket.ts +0 -115
- package/client/runtime/use-client-events.ts +0 -69
- package/client/runtime/workspace-theme.ts +0 -175
- package/client/store/ui.ts +0 -94
- package/client/store/workspace-session.ts +0 -30
- package/client/structured-clone-shim.ts +0 -14
- package/client/tailwind-config.ts +0 -43
- package/dist/chunk-851bx8ss.js +0 -72
- package/dist/chunk-cty37f3v.js +0 -1
- package/dist/chunk-dy6f6h3e.js +0 -5
- package/dist/chunk-j6928pwm.js +0 -1
- package/dist/chunk-kffcah9w.css +0 -1
- package/dist/chunk-rh58dc0y.js +0 -2
- package/lib/applet-selector.ts +0 -24
- package/lib/attachment-note.ts +0 -66
- package/lib/chat-title.ts +0 -11
- package/lib/collab/colors.ts +0 -30
- package/lib/collab/protocol.ts +0 -84
- package/lib/collab/types.ts +0 -52
- package/lib/default-widgets.ts +0 -32
- package/lib/events.ts +0 -61
- package/lib/format.ts +0 -348
- package/lib/harness-instructions.ts +0 -30
- package/lib/harness-types.ts +0 -13
- package/lib/identity-icons.ts +0 -73
- package/lib/ids.ts +0 -33
- package/lib/message-attachments.ts +0 -40
- package/lib/moi-attachments.ts +0 -204
- package/lib/moi-context.ts +0 -305
- package/lib/navigation.ts +0 -65
- package/lib/onboarding.ts +0 -41
- package/lib/scratchpad-skew.ts +0 -64
- package/lib/session-drafts.ts +0 -10
- package/lib/speed-mode.ts +0 -5
- package/lib/system-messages.ts +0 -241
- package/lib/themes.ts +0 -241
- package/lib/types.ts +0 -776
- package/lib/update.ts +0 -2
- package/lib/view-build-directives.ts +0 -11
- package/lib/workspace-config.ts +0 -48
- package/lib/workspace-icon.ts +0 -20
- package/lib/workspace-layout.ts +0 -15
- package/lib/workspace-name.ts +0 -17
- package/lib/workspace-tabs.ts +0 -29
- package/server/AGENTS.md +0 -17
- package/server/README.md +0 -123
- package/server/agent-caller.ts +0 -16
- package/server/agent-launcher.ts +0 -27
- package/server/api/harnesses.ts +0 -79
- package/server/api/index.ts +0 -1351
- package/server/api/onboarding.ts +0 -46
- package/server/app-config.ts +0 -264
- package/server/app-settings.ts +0 -69
- package/server/applets/api-base.ts +0 -4
- package/server/applets/applet-css.ts +0 -55
- package/server/applets/build-applet.ts +0 -475
- package/server/applets/build-worker.ts +0 -179
- package/server/applets/bundle-queue.ts +0 -19
- package/server/applets/config.ts +0 -226
- package/server/applets/declarations.ts +0 -45
- package/server/applets/dependencies.ts +0 -206
- package/server/applets/functions-worker.ts +0 -121
- package/server/applets/functions.ts +0 -392
- package/server/applets/index.ts +0 -504
- package/server/applets/log.ts +0 -149
- package/server/applets/runtime/collab.ts +0 -94
- package/server/applets/runtime/moi.ts +0 -35
- package/server/applets/runtime/rpc.ts +0 -15
- package/server/applets/thumbnails.ts +0 -200
- package/server/applets/typecheck.ts +0 -100
- package/server/applets/ui-components.ts +0 -241
- package/server/applets/view-source.ts +0 -73
- package/server/applets/views.ts +0 -323
- package/server/applets/widgets.ts +0 -181
- package/server/cli/applet-selector.ts +0 -19
- package/server/cli/args.ts +0 -5
- package/server/cli/colors.ts +0 -20
- package/server/cli/commands/bundle.ts +0 -119
- package/server/cli/commands/call-server-fn.ts +0 -42
- package/server/cli/commands/check.ts +0 -53
- package/server/cli/commands/config.ts +0 -120
- package/server/cli/commands/debug.ts +0 -119
- package/server/cli/commands/env.ts +0 -162
- package/server/cli/commands/hermes.ts +0 -149
- package/server/cli/commands/init.ts +0 -323
- package/server/cli/commands/navigate.ts +0 -35
- package/server/cli/commands/openclaw.ts +0 -168
- package/server/cli/commands/refresh.ts +0 -45
- package/server/cli/commands/remote.ts +0 -330
- package/server/cli/commands/scratch.ts +0 -496
- package/server/cli/commands/service.ts +0 -298
- package/server/cli/commands/skill.ts +0 -121
- package/server/cli/commands/start.ts +0 -112
- package/server/cli/commands/status.ts +0 -80
- package/server/cli/commands/tabs.ts +0 -36
- package/server/cli/commands/theme.ts +0 -192
- package/server/cli/commands/ui-components.ts +0 -15
- package/server/cli/commands/update.ts +0 -192
- package/server/cli/commands/version.ts +0 -9
- package/server/cli/commands/views.ts +0 -87
- package/server/cli/control.ts +0 -120
- package/server/cli/env.ts +0 -259
- package/server/cli/index.ts +0 -175
- package/server/cli/pc.ts +0 -20
- package/server/cli/provider.ts +0 -25
- package/server/cli/remote-command.ts +0 -77
- package/server/cli/remote-control.ts +0 -73
- package/server/cli/remote-operations.ts +0 -247
- package/server/cli/server-version.ts +0 -16
- package/server/cli/server.ts +0 -93
- package/server/cli/ui-components.ts +0 -294
- package/server/cli/ui.ts +0 -52
- package/server/cli.ts +0 -3
- package/server/collab/cloudflare-access.ts +0 -78
- package/server/collab/config.ts +0 -13
- package/server/collab/manager.ts +0 -413
- package/server/collab/service.ts +0 -136
- package/server/collab/skill/index.ts +0 -7
- package/server/collab/worker-messages.ts +0 -10
- package/server/collab/worker.ts +0 -52
- package/server/constants.ts +0 -13
- package/server/control-client.ts +0 -124
- package/server/control.ts +0 -572
- package/server/data-dir.ts +0 -22
- package/server/debug.ts +0 -10
- package/server/events.ts +0 -25
- package/server/harness/README.md +0 -381
- package/server/harness/acp/NOTES.md +0 -426
- package/server/harness/acp/adapter.ts +0 -206
- package/server/harness/acp/archived.ts +0 -88
- package/server/harness/acp/client.ts +0 -329
- package/server/harness/acp/discovery.ts +0 -127
- package/server/harness/acp/model-state.ts +0 -57
- package/server/harness/acp/run-durations.ts +0 -68
- package/server/harness/acp/session.ts +0 -786
- package/server/harness/acp/wire.ts +0 -132
- package/server/harness/auth.ts +0 -272
- package/server/harness/claude-code/NOTES.md +0 -651
- package/server/harness/claude-code/adapter.ts +0 -876
- package/server/harness/claude-code/auth.ts +0 -178
- package/server/harness/claude-code/cli.ts +0 -42
- package/server/harness/claude-code/git-worktree.ts +0 -35
- package/server/harness/claude-code/index.ts +0 -171
- package/server/harness/claude-code/mcp.ts +0 -152
- package/server/harness/claude-code/models.ts +0 -102
- package/server/harness/claude-code/permissions.ts +0 -34
- package/server/harness/claude-code/run-action.ts +0 -123
- package/server/harness/claude-code/session-title.ts +0 -104
- package/server/harness/claude-code/session.ts +0 -969
- package/server/harness/claude-code/sessions.ts +0 -153
- package/server/harness/codex/NOTES.md +0 -259
- package/server/harness/codex/adapter.ts +0 -633
- package/server/harness/codex/auth.ts +0 -140
- package/server/harness/codex/client.ts +0 -439
- package/server/harness/codex/connectors.ts +0 -92
- package/server/harness/codex/discovery.ts +0 -106
- package/server/harness/codex/index.ts +0 -107
- package/server/harness/codex/pagination.ts +0 -27
- package/server/harness/codex/permissions.ts +0 -80
- package/server/harness/codex/probe.ts +0 -183
- package/server/harness/codex/run-action.ts +0 -93
- package/server/harness/codex/session-title.ts +0 -147
- package/server/harness/codex/session.ts +0 -1196
- package/server/harness/codex/status.ts +0 -31
- package/server/harness/codex/thread-list.ts +0 -78
- package/server/harness/codex/transport.ts +0 -191
- package/server/harness/command.ts +0 -45
- package/server/harness/debug.ts +0 -57
- package/server/harness/detect.ts +0 -164
- package/server/harness/executable.ts +0 -125
- package/server/harness/fork.ts +0 -14
- package/server/harness/hermes/NOTES.md +0 -833
- package/server/harness/hermes/discovery.ts +0 -175
- package/server/harness/hermes/index.ts +0 -167
- package/server/harness/hermes/models.ts +0 -99
- package/server/harness/install.ts +0 -49
- package/server/harness/openclaw/NOTES.md +0 -749
- package/server/harness/openclaw/adapter.ts +0 -336
- package/server/harness/openclaw/compat.ts +0 -95
- package/server/harness/openclaw/cron-view.ts +0 -78
- package/server/harness/openclaw/discovery.ts +0 -456
- package/server/harness/openclaw/gateway.ts +0 -467
- package/server/harness/openclaw/index.ts +0 -125
- package/server/harness/openclaw/session.ts +0 -1512
- package/server/harness/openclaw/strip.ts +0 -184
- package/server/harness/openclaw/thinking.ts +0 -150
- package/server/harness/registry.ts +0 -39
- package/server/harness/run-action.ts +0 -85
- package/server/harness/session-title.ts +0 -59
- package/server/harness/shell-path.ts +0 -89
- package/server/harness/types.ts +0 -170
- package/server/navigation-relay.ts +0 -110
- package/server/onboarding/brief.ts +0 -29
- package/server/onboarding/ideas.ts +0 -48
- package/server/onboarding/jobs.ts +0 -291
- package/server/open-browser.ts +0 -7
- package/server/operations/commands.ts +0 -46
- package/server/operations/files.ts +0 -148
- package/server/operations/server.ts +0 -206
- package/server/remote/agent.ts +0 -103
- package/server/remote/broker-client.ts +0 -76
- package/server/remote/broker.ts +0 -81
- package/server/remote/client.ts +0 -725
- package/server/remote/errors.ts +0 -2
- package/server/remote/routes.ts +0 -121
- package/server/remote/workspace.ts +0 -34
- package/server/scratchpad/assets.ts +0 -258
- package/server/scratchpad/document.ts +0 -312
- package/server/scratchpad/executor.ts +0 -499
- package/server/scratchpad/relay.ts +0 -44
- package/server/scratchpad/shape-defaults.ts +0 -82
- package/server/server-cwd.ts +0 -23
- package/server/service.ts +0 -800
- package/server/sessions/archive.ts +0 -23
- package/server/sessions/attachment-message.ts +0 -95
- package/server/sessions/config.ts +0 -45
- package/server/sessions/lifecycle.ts +0 -19
- package/server/sessions/pending-views.ts +0 -158
- package/server/sessions/selected.ts +0 -113
- package/server/sessions/send-message.ts +0 -102
- package/server/sessions/store.ts +0 -54
- package/server/sessions/view-sessions.ts +0 -192
- package/server/skills/locations.ts +0 -82
- package/server/skills/lock.ts +0 -29
- package/server/skills/template.ts +0 -94
- package/server/skills/update.ts +0 -94
- package/server/skills/version.ts +0 -129
- package/server/skills/workspace.ts +0 -121
- package/server/state.ts +0 -40
- package/server/static.ts +0 -25
- package/server/status.ts +0 -110
- package/server/tldraw-package.d.ts +0 -4
- package/server/update.ts +0 -429
- package/server/uploads.ts +0 -290
- package/server/vendor.ts +0 -63
- package/server/version.ts +0 -41
- package/server/web.ts +0 -350
- package/server/workspace-state/file.ts +0 -181
- package/server/workspace-state/index.ts +0 -169
- package/server/workspace-state/lock.ts +0 -42
- package/server/workspace-state/types.ts +0 -16
- package/server/workspaces/api.ts +0 -24
- package/server/workspaces/change-harness.ts +0 -77
- package/server/workspaces/config.ts +0 -42
- package/server/workspaces/env-apply.ts +0 -20
- package/server/workspaces/env.ts +0 -424
- package/server/workspaces/harness-transition.ts +0 -29
- package/server/workspaces/icon.ts +0 -13
- package/server/workspaces/import.ts +0 -74
- package/server/workspaces/init.ts +0 -74
- package/server/workspaces/layout.ts +0 -190
- package/server/workspaces/preview.ts +0 -72
- package/server/workspaces/registry.ts +0 -330
- package/server/workspaces/required-env.ts +0 -19
- package/server/workspaces/scaffold.ts +0 -189
- package/server/workspaces/shared.ts +0 -74
- package/server/workspaces/tabs.ts +0 -35
- package/server/workspaces/theme.ts +0 -58
- package/tsconfig.json +0 -20
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{e}from"./chunk-7c0zbz74.js";var Gt=e(function(oi){var Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");oi.encode=function(s){if(0<=s&&s<Wt.length)return Wt[s];throw TypeError("Must be between 0 and 63: "+s)};oi.decode=function(s){var r=65,t=90,i=97,a=122,n=48,o=57,l=43,h=47,c=26,u=52;if(r<=s&&s<=t)return s-r;if(i<=s&&s<=a)return s-i+c;if(n<=s&&s<=o)return s-n+u;if(s==l)return 62;if(s==h)return 63;return-1}});var je=e(function(pi){var Jt=Gt(),Ue=5,Xt=1<<Ue,Yt=Xt-1,Qt=Xt;function ci(s){return s<0?(-s<<1)+1:(s<<1)+0}function ui(s){var r=(s&1)===1,t=s>>1;return r?-t:t}pi.encode=function(r){var t="",i,a=ci(r);do{if(i=a&Yt,a>>>=Ue,a>0)i|=Qt;t+=Jt.encode(i)}while(a>0);return t};pi.decode=function(r,t,i){var a=r.length,n=0,o=0,l,h;do{if(t>=a)throw Error("Expected more digits in base 64 VLQ value.");if(h=Jt.decode(r.charCodeAt(t++)),h===-1)throw Error("Invalid base64 digit: "+r.charAt(t-1));l=!!(h&Qt),h&=Yt,n=n+(h<<o),o+=Ue}while(l);i.value=ui(n),i.rest=t}});var oe=e(function(rs){function mi(s,r,t){if(r in s)return s[r];else if(arguments.length===3)return t;else throw Error('"'+r+'" is a required argument.')}rs.getArg=mi;var Zt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,yi=/^data:.+\,.+$/;function fe(s){var r=s.match(Zt);if(!r)return null;return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}rs.urlParse=fe;function ne(s){var r="";if(s.scheme)r+=s.scheme+":";if(r+="//",s.auth)r+=s.auth+"@";if(s.host)r+=s.host;if(s.port)r+=":"+s.port;if(s.path)r+=s.path;return r}rs.urlGenerate=ne;var xi=32;function gi(s){var r=[];return function(t){for(var i=0;i<r.length;i++)if(r[i].input===t){var a=r[0];return r[0]=r[i],r[i]=a,r[0].result}var n=s(t);if(r.unshift({input:t,result:n}),r.length>xi)r.pop();return n}}var $e=gi(function(r){var t=r,i=fe(r);if(i){if(!i.path)return r;t=i.path}var a=rs.isAbsolute(t),n=[],o=0,l=0;while(!0)if(o=l,l=t.indexOf("/",o),l===-1){n.push(t.slice(o));break}else{n.push(t.slice(o,l));while(l<t.length&&t[l]==="/")l++}for(var h,c=0,l=n.length-1;l>=0;l--)if(h=n[l],h===".")n.splice(l,1);else if(h==="..")c++;else if(c>0)if(h==="")n.splice(l+1,c),c=0;else n.splice(l,2),c--;if(t=n.join("/"),t==="")t=a?"/":".";if(i)return i.path=t,ne(i);return t});rs.normalize=$e;function es(s,r){if(s==="")s=".";if(r==="")r=".";var t=fe(r),i=fe(s);if(i)s=i.path||"/";if(t&&!t.scheme){if(i)t.scheme=i.scheme;return ne(t)}if(t||r.match(yi))return r;if(i&&!i.host&&!i.path)return i.host=r,ne(i);var a=r.charAt(0)==="/"?r:$e(s.replace(/\/+$/,"")+"/"+r);if(i)return i.path=a,ne(i);return a}rs.join=es;rs.isAbsolute=function(s){return s.charAt(0)==="/"||Zt.test(s)};function Pi(s,r){if(s==="")s=".";s=s.replace(/\/$/,"");var t=0;while(r.indexOf(s+"/")!==0){var i=s.lastIndexOf("/");if(i<0)return r;if(s=s.slice(0,i),s.match(/^([^\/]+:\/)?\/*$/))return r;++t}return Array(t+1).join("../")+r.substr(s.length+1)}rs.relative=Pi;var ts=function(){var s=Object.create(null);return!("__proto__"in s)}();function ss(s){return s}function bi(s){if(is(s))return"$"+s;return s}rs.toSetString=ts?ss:bi;function Ti(s){if(is(s))return s.slice(1);return s}rs.fromSetString=ts?ss:Ti;function is(s){if(!s)return!1;var r=s.length;if(r<9)return!1;if(s.charCodeAt(r-1)!==95||s.charCodeAt(r-2)!==95||s.charCodeAt(r-3)!==111||s.charCodeAt(r-4)!==116||s.charCodeAt(r-5)!==111||s.charCodeAt(r-6)!==114||s.charCodeAt(r-7)!==112||s.charCodeAt(r-8)!==95||s.charCodeAt(r-9)!==95)return!1;for(var t=r-10;t>=0;t--)if(s.charCodeAt(t)!==36)return!1;return!0}function Ai(s,r,t){var i=K(s.source,r.source);if(i!==0)return i;if(i=s.originalLine-r.originalLine,i!==0)return i;if(i=s.originalColumn-r.originalColumn,i!==0||t)return i;if(i=s.generatedColumn-r.generatedColumn,i!==0)return i;if(i=s.generatedLine-r.generatedLine,i!==0)return i;return K(s.name,r.name)}rs.compareByOriginalPositions=Ai;function Si(s,r,t){var i=s.originalLine-r.originalLine;if(i!==0)return i;if(i=s.originalColumn-r.originalColumn,i!==0||t)return i;if(i=s.generatedColumn-r.generatedColumn,i!==0)return i;if(i=s.generatedLine-r.generatedLine,i!==0)return i;return K(s.name,r.name)}rs.compareByOriginalPositionsNoSource=Si;function Ci(s,r,t){var i=s.generatedLine-r.generatedLine;if(i!==0)return i;if(i=s.generatedColumn-r.generatedColumn,i!==0||t)return i;if(i=K(s.source,r.source),i!==0)return i;if(i=s.originalLine-r.originalLine,i!==0)return i;if(i=s.originalColumn-r.originalColumn,i!==0)return i;return K(s.name,r.name)}rs.compareByGeneratedPositionsDeflated=Ci;function wi(s,r,t){var i=s.generatedColumn-r.generatedColumn;if(i!==0||t)return i;if(i=K(s.source,r.source),i!==0)return i;if(i=s.originalLine-r.originalLine,i!==0)return i;if(i=s.originalColumn-r.originalColumn,i!==0)return i;return K(s.name,r.name)}rs.compareByGeneratedPositionsDeflatedNoLine=wi;function K(s,r){if(s===r)return 0;if(s===null)return 1;if(r===null)return-1;if(s>r)return 1;return-1}function Ii(s,r){var t=s.generatedLine-r.generatedLine;if(t!==0)return t;if(t=s.generatedColumn-r.generatedColumn,t!==0)return t;if(t=K(s.source,r.source),t!==0)return t;if(t=s.originalLine-r.originalLine,t!==0)return t;if(t=s.originalColumn-r.originalColumn,t!==0)return t;return K(s.name,r.name)}rs.compareByGeneratedPositionsInflated=Ii;function vi(s){return JSON.parse(s.replace(/^\)]}'[^\n]*\n/,""))}rs.parseSourceMapInput=vi;function Ei(s,r,t){if(r=r||"",s){if(s[s.length-1]!=="/"&&r[0]!=="/")s+="/";r=s+r}if(t){var i=fe(t);if(!i)throw Error("sourceMapURL could not be parsed");if(i.path){var a=i.path.lastIndexOf("/");if(a>=0)i.path=i.path.substring(0,a+1)}r=es(ne(i),r)}return $e(r)}rs.computeSourceURL=Ei});var ze=e(function(Hi){var Ve=oe(),qe=Object.prototype.hasOwnProperty,ie=typeof Map<"u";function W(){this._array=[],this._set=ie?new Map:Object.create(null)}W.fromArray=function(r,t){var i=new W;for(var a=0,n=r.length;a<n;a++)i.add(r[a],t);return i};W.prototype.size=function(){return ie?this._set.size:Object.getOwnPropertyNames(this._set).length};W.prototype.add=function(r,t){var i=ie?r:Ve.toSetString(r),a=ie?this.has(r):qe.call(this._set,i),n=this._array.length;if(!a||t)this._array.push(r);if(!a)if(ie)this._set.set(r,n);else this._set[i]=n};W.prototype.has=function(r){if(ie)return this._set.has(r);else{var t=Ve.toSetString(r);return qe.call(this._set,t)}};W.prototype.indexOf=function(r){if(ie){var t=this._set.get(r);if(t>=0)return t}else{var i=Ve.toSetString(r);if(qe.call(this._set,i))return this._set[i]}throw Error('"'+r+'" is not in the set.')};W.prototype.at=function(r){if(r>=0&&r<this._array.length)return this._array[r];throw Error("No element indexed by "+r)};W.prototype.toArray=function(){return this._array.slice()};Hi.ArraySet=W});var ns=e(function(Gi){var as=oe();function Wi(s,r){var t=s.generatedLine,i=r.generatedLine,a=s.generatedColumn,n=r.generatedColumn;return i>t||i==t&&n>=a||as.compareByGeneratedPositionsInflated(s,r)<=0}function ve(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ve.prototype.unsortedForEach=function(r,t){this._array.forEach(r,t)};ve.prototype.add=function(r){if(Wi(this._last,r))this._last=r,this._array.push(r);else this._sorted=!1,this._array.push(r)};ve.prototype.toArray=function(){if(!this._sorted)this._array.sort(as.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};Gi.MappingList=ve});var He=e(function(Yi){var de=je(),M=oe(),Ee=ze().ArraySet,Xi=ns().MappingList;function R(s){if(!s)s={};this._file=M.getArg(s,"file",null),this._sourceRoot=M.getArg(s,"sourceRoot",null),this._skipValidation=M.getArg(s,"skipValidation",!1),this._ignoreInvalidMapping=M.getArg(s,"ignoreInvalidMapping",!1),this._sources=new Ee,this._names=new Ee,this._mappings=new Xi,this._sourcesContents=null}R.prototype._version=3;R.fromSourceMap=function(r,t){var i=r.sourceRoot,a=new R(Object.assign(t||{},{file:r.file,sourceRoot:i}));return r.eachMapping(function(n){var o={generated:{line:n.generatedLine,column:n.generatedColumn}};if(n.source!=null){if(o.source=n.source,i!=null)o.source=M.relative(i,o.source);if(o.original={line:n.originalLine,column:n.originalColumn},n.name!=null)o.name=n.name}a.addMapping(o)}),r.sources.forEach(function(n){var o=n;if(i!==null)o=M.relative(i,n);if(!a._sources.has(o))a._sources.add(o);var l=r.sourceContentFor(n);if(l!=null)a.setSourceContent(n,l)}),a};R.prototype.addMapping=function(r){var t=M.getArg(r,"generated"),i=M.getArg(r,"original",null),a=M.getArg(r,"source",null),n=M.getArg(r,"name",null);if(!this._skipValidation){if(this._validateMapping(t,i,a,n)===!1)return}if(a!=null){if(a=String(a),!this._sources.has(a))this._sources.add(a)}if(n!=null){if(n=String(n),!this._names.has(n))this._names.add(n)}this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:a,name:n})};R.prototype.setSourceContent=function(r,t){var i=r;if(this._sourceRoot!=null)i=M.relative(this._sourceRoot,i);if(t!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[M.toSetString(i)]=t}else if(this._sourcesContents){if(delete this._sourcesContents[M.toSetString(i)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};R.prototype.applySourceMap=function(r,t,i){var a=t;if(t==null){if(r.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);a=r.file}var n=this._sourceRoot;if(n!=null)a=M.relative(n,a);var o=new Ee,l=new Ee;this._mappings.unsortedForEach(function(h){if(h.source===a&&h.originalLine!=null){var c=r.originalPositionFor({line:h.originalLine,column:h.originalColumn});if(c.source!=null){if(h.source=c.source,i!=null)h.source=M.join(i,h.source);if(n!=null)h.source=M.relative(n,h.source);if(h.originalLine=c.line,h.originalColumn=c.column,c.name!=null)h.name=c.name}}var u=h.source;if(u!=null&&!o.has(u))o.add(u);var d=h.name;if(d!=null&&!l.has(d))l.add(d)},this),this._sources=o,this._names=l,r.sources.forEach(function(h){var c=r.sourceContentFor(h);if(c!=null){if(i!=null)h=M.join(i,h);if(n!=null)h=M.relative(n,h);this.setSourceContent(h,c)}},this)};R.prototype._validateMapping=function(r,t,i,a){if(t&&typeof t.line!=="number"&&typeof t.column!=="number"){var n="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(n);return!1}else throw Error(n)}if(r&&"line"in r&&"column"in r&&r.line>0&&r.column>=0&&!t&&!i&&!a)return;else if(r&&"line"in r&&"column"in r&&t&&"line"in t&&"column"in t&&r.line>0&&r.column>=0&&t.line>0&&t.column>=0&&i)return;else{var n="Invalid mapping: "+JSON.stringify({generated:r,source:i,original:t,name:a});if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(n);return!1}else throw Error(n)}};R.prototype._serializeMappings=function(){var r=0,t=1,i=0,a=0,n=0,o=0,l="",h,c,u,d,f=this._mappings.toArray();for(var m=0,x=f.length;m<x;m++){if(c=f[m],h="",c.generatedLine!==t){r=0;while(c.generatedLine!==t)h+=";",t++}else if(m>0){if(!M.compareByGeneratedPositionsInflated(c,f[m-1]))continue;h+=","}if(h+=de.encode(c.generatedColumn-r),r=c.generatedColumn,c.source!=null){if(d=this._sources.indexOf(c.source),h+=de.encode(d-o),o=d,h+=de.encode(c.originalLine-1-a),a=c.originalLine-1,h+=de.encode(c.originalColumn-i),i=c.originalColumn,c.name!=null)u=this._names.indexOf(c.name),h+=de.encode(u-n),n=u}l+=h}return l};R.prototype._generateSourcesContent=function(r,t){return r.map(function(i){if(!this._sourcesContents)return null;if(t!=null)i=M.relative(t,i);var a=M.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,a)?this._sourcesContents[a]:null},this)};R.prototype.toJSON=function(){var r={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)r.file=this._file;if(this._sourceRoot!=null)r.sourceRoot=this._sourceRoot;if(this._sourcesContents)r.sourcesContent=this._generateSourcesContent(r.sources,r.sourceRoot);return r};R.prototype.toString=function(){return JSON.stringify(this.toJSON())};Yi.SourceMapGenerator=R});var ls=e(function(Zi){Zi.GREATEST_LOWER_BOUND=1;Zi.LEAST_UPPER_BOUND=2;function Ke(s,r,t,i,a,n){var o=Math.floor((r-s)/2)+s,l=a(t,i[o],!0);if(l===0)return o;else if(l>0){if(r-o>1)return Ke(o,r,t,i,a,n);if(n==Zi.LEAST_UPPER_BOUND)return r<i.length?r:-1;else return o}else{if(o-s>1)return Ke(s,o,t,i,a,n);if(n==Zi.LEAST_UPPER_BOUND)return o;else return s<0?-1:s}}Zi.search=function(r,t,i,a){if(t.length===0)return-1;var n=Ke(-1,t.length,r,t,i,a||Zi.GREATEST_LOWER_BOUND);if(n<0)return-1;while(n-1>=0){if(i(t[n],t[n-1],!0)!==0)break;--n}return n}});var cs=e(function(ir){function tr(s){function r(a,n,o){var l=a[n];a[n]=a[o],a[o]=l}function t(a,n){return Math.round(a+Math.random()*(n-a))}function i(a,n,o,l){if(o<l){var h=t(o,l),c=o-1;r(a,h,l);var u=a[l];for(var d=o;d<l;d++)if(n(a[d],u,!1)<=0)c+=1,r(a,c,d);r(a,c+1,d);var f=c+1;i(a,n,o,f-1),i(a,n,f+1,l)}}return i}function sr(s){let r=tr.toString();return Function(`return ${r}`)()(s)}var hs=new WeakMap;ir.quickSort=function(s,r,t=0){let i=hs.get(r);if(i===void 0)i=sr(r),hs.set(r,i);i(s,r,t,s.length-1)}});var fs=e(function(nr){var P=oe(),Je=ls(),le=ze().ArraySet,ar=je(),me=cs().quickSort;function L(s,r){var t=s;if(typeof s==="string")t=P.parseSourceMapInput(s);return t.sections!=null?new U(t,r):new O(t,r)}L.fromSourceMap=function(s,r){return O.fromSourceMap(s,r)};L.prototype._version=3;L.prototype.__generatedMappings=null;Object.defineProperty(L.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});L.prototype.__originalMappings=null;Object.defineProperty(L.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});L.prototype._charIsMappingSeparator=function(r,t){var i=r.charAt(t);return i===";"||i===","};L.prototype._parseMappings=function(r,t){throw Error("Subclasses must implement _parseMappings")};L.GENERATED_ORDER=1;L.ORIGINAL_ORDER=2;L.GREATEST_LOWER_BOUND=1;L.LEAST_UPPER_BOUND=2;L.prototype.eachMapping=function(r,t,i){var a=t||null,n=i||L.GENERATED_ORDER,o;switch(n){case L.GENERATED_ORDER:o=this._generatedMappings;break;case L.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var l=this.sourceRoot,h=r.bind(a),c=this._names,u=this._sources,d=this._sourceMapURL;for(var f=0,m=o.length;f<m;f++){var x=o[f],T=x.source===null?null:u.at(x.source);if(T!==null)T=P.computeSourceURL(l,T,d);h({source:T,generatedLine:x.generatedLine,generatedColumn:x.generatedColumn,originalLine:x.originalLine,originalColumn:x.originalColumn,name:x.name===null?null:c.at(x.name)})}};L.prototype.allGeneratedPositionsFor=function(r){var t=P.getArg(r,"line"),i={source:P.getArg(r,"source"),originalLine:t,originalColumn:P.getArg(r,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var a=[],n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",P.compareByOriginalPositions,Je.LEAST_UPPER_BOUND);if(n>=0){var o=this._originalMappings[n];if(r.column===void 0){var l=o.originalLine;while(o&&o.originalLine===l)a.push({line:P.getArg(o,"generatedLine",null),column:P.getArg(o,"generatedColumn",null),lastColumn:P.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++n]}else{var h=o.originalColumn;while(o&&o.originalLine===t&&o.originalColumn==h)a.push({line:P.getArg(o,"generatedLine",null),column:P.getArg(o,"generatedColumn",null),lastColumn:P.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++n]}}return a};nr.SourceMapConsumer=L;function O(s,r){var t=s;if(typeof s==="string")t=P.parseSourceMapInput(s);var i=P.getArg(t,"version"),a=P.getArg(t,"sources"),n=P.getArg(t,"names",[]),o=P.getArg(t,"sourceRoot",null),l=P.getArg(t,"sourcesContent",null),h=P.getArg(t,"mappings"),c=P.getArg(t,"file",null);if(i!=this._version)throw Error("Unsupported version: "+i);if(o)o=P.normalize(o);a=a.map(String).map(P.normalize).map(function(u){return o&&P.isAbsolute(o)&&P.isAbsolute(u)?P.relative(o,u):u}),this._names=le.fromArray(n.map(String),!0),this._sources=le.fromArray(a,!0),this._absoluteSources=this._sources.toArray().map(function(u){return P.computeSourceURL(o,u,r)}),this.sourceRoot=o,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=r,this.file=c}O.prototype=Object.create(L.prototype);O.prototype.consumer=L;O.prototype._findSourceIndex=function(s){var r=s;if(this.sourceRoot!=null)r=P.relative(this.sourceRoot,r);if(this._sources.has(r))return this._sources.indexOf(r);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==s)return t;return-1};O.fromSourceMap=function(r,t){var i=Object.create(O.prototype),a=i._names=le.fromArray(r._names.toArray(),!0),n=i._sources=le.fromArray(r._sources.toArray(),!0);i.sourceRoot=r._sourceRoot,i.sourcesContent=r._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=r._file,i._sourceMapURL=t,i._absoluteSources=i._sources.toArray().map(function(m){return P.computeSourceURL(i.sourceRoot,m,t)});var o=r._mappings.toArray().slice(),l=i.__generatedMappings=[],h=i.__originalMappings=[];for(var c=0,u=o.length;c<u;c++){var d=o[c],f=new ps;if(f.generatedLine=d.generatedLine,f.generatedColumn=d.generatedColumn,d.source){if(f.source=n.indexOf(d.source),f.originalLine=d.originalLine,f.originalColumn=d.originalColumn,d.name)f.name=a.indexOf(d.name);h.push(f)}l.push(f)}return me(i.__originalMappings,P.compareByOriginalPositions),i};O.prototype._version=3;Object.defineProperty(O.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function ps(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Ge=P.compareByGeneratedPositionsDeflatedNoLine;function us(s,r){let t=s.length,i=s.length-r;if(i<=1)return;else if(i==2){let a=s[r],n=s[r+1];if(Ge(a,n)>0)s[r]=n,s[r+1]=a}else if(i<20)for(let a=r;a<t;a++)for(let n=a;n>r;n--){let o=s[n-1],l=s[n];if(Ge(o,l)<=0)break;s[n-1]=l,s[n]=o}else me(s,Ge,r)}O.prototype._parseMappings=function(r,t){var i=1,a=0,n=0,o=0,l=0,h=0,c=r.length,u=0,d={},f={},m=[],x=[],T,S,C,k,z;let B=0;while(u<c)if(r.charAt(u)===";")i++,u++,a=0,us(x,B),B=x.length;else if(r.charAt(u)===",")u++;else{T=new ps,T.generatedLine=i;for(k=u;k<c;k++)if(this._charIsMappingSeparator(r,k))break;S=r.slice(u,k),C=[];while(u<k)ar.decode(r,u,f),z=f.value,u=f.rest,C.push(z);if(C.length===2)throw Error("Found a source, but no line and column");if(C.length===3)throw Error("Found a source and line, but no column");if(T.generatedColumn=a+C[0],a=T.generatedColumn,C.length>1){if(T.source=l+C[1],l+=C[1],T.originalLine=n+C[2],n=T.originalLine,T.originalLine+=1,T.originalColumn=o+C[3],o=T.originalColumn,C.length>4)T.name=h+C[4],h+=C[4]}if(x.push(T),typeof T.originalLine==="number"){let se=T.source;while(m.length<=se)m.push(null);if(m[se]===null)m[se]=[];m[se].push(T)}}us(x,B),this.__generatedMappings=x;for(var te=0;te<m.length;te++)if(m[te]!=null)me(m[te],P.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...m)};O.prototype._findMapping=function(r,t,i,a,n,o){if(r[i]<=0)throw TypeError("Line must be greater than or equal to 1, got "+r[i]);if(r[a]<0)throw TypeError("Column must be greater than or equal to 0, got "+r[a]);return Je.search(r,t,n,o)};O.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var t=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var i=this._generatedMappings[r+1];if(t.generatedLine===i.generatedLine){t.lastGeneratedColumn=i.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};O.prototype.originalPositionFor=function(r){var t={generatedLine:P.getArg(r,"line"),generatedColumn:P.getArg(r,"column")},i=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",P.compareByGeneratedPositionsDeflated,P.getArg(r,"bias",L.GREATEST_LOWER_BOUND));if(i>=0){var a=this._generatedMappings[i];if(a.generatedLine===t.generatedLine){var n=P.getArg(a,"source",null);if(n!==null)n=this._sources.at(n),n=P.computeSourceURL(this.sourceRoot,n,this._sourceMapURL);var o=P.getArg(a,"name",null);if(o!==null)o=this._names.at(o);return{source:n,line:P.getArg(a,"originalLine",null),column:P.getArg(a,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};O.prototype.hasContentsOfAllSources=function(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null})};O.prototype.sourceContentFor=function(r,t){if(!this.sourcesContent)return null;var i=this._findSourceIndex(r);if(i>=0)return this.sourcesContent[i];var a=r;if(this.sourceRoot!=null)a=P.relative(this.sourceRoot,a);var n;if(this.sourceRoot!=null&&(n=P.urlParse(this.sourceRoot))){var o=a.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!n.path||n.path=="/")&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}if(t)return null;else throw Error('"'+a+'" is not in the SourceMap.')};O.prototype.generatedPositionFor=function(r){var t=P.getArg(r,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var i={source:t,originalLine:P.getArg(r,"line"),originalColumn:P.getArg(r,"column")},a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",P.compareByOriginalPositions,P.getArg(r,"bias",L.GREATEST_LOWER_BOUND));if(a>=0){var n=this._originalMappings[a];if(n.source===i.source)return{line:P.getArg(n,"generatedLine",null),column:P.getArg(n,"generatedColumn",null),lastColumn:P.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};nr.BasicSourceMapConsumer=O;function U(s,r){var t=s;if(typeof s==="string")t=P.parseSourceMapInput(s);var i=P.getArg(t,"version"),a=P.getArg(t,"sections");if(i!=this._version)throw Error("Unsupported version: "+i);this._sources=new le,this._names=new le;var n={line:-1,column:0};this._sections=a.map(function(o){if(o.url)throw Error("Support for url field in sections not implemented.");var l=P.getArg(o,"offset"),h=P.getArg(l,"line"),c=P.getArg(l,"column");if(h<n.line||h===n.line&&c<n.column)throw Error("Section offsets must be ordered and non-overlapping.");return n=l,{generatedOffset:{generatedLine:h+1,generatedColumn:c+1},consumer:new L(P.getArg(o,"map"),r)}})}U.prototype=Object.create(L.prototype);U.prototype.constructor=L;U.prototype._version=3;Object.defineProperty(U.prototype,"sources",{get:function(){var s=[];for(var r=0;r<this._sections.length;r++)for(var t=0;t<this._sections[r].consumer.sources.length;t++)s.push(this._sections[r].consumer.sources[t]);return s}});U.prototype.originalPositionFor=function(r){var t={generatedLine:P.getArg(r,"line"),generatedColumn:P.getArg(r,"column")},i=Je.search(t,this._sections,function(n,o){var l=n.generatedLine-o.generatedOffset.generatedLine;if(l)return l;return n.generatedColumn-o.generatedOffset.generatedColumn}),a=this._sections[i];if(!a)return{source:null,line:null,column:null,name:null};return a.consumer.originalPositionFor({line:t.generatedLine-(a.generatedOffset.generatedLine-1),column:t.generatedColumn-(a.generatedOffset.generatedLine===t.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:r.bias})};U.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(r){return r.consumer.hasContentsOfAllSources()})};U.prototype.sourceContentFor=function(r,t){for(var i=0;i<this._sections.length;i++){var a=this._sections[i],n=a.consumer.sourceContentFor(r,!0);if(n||n==="")return n}if(t)return null;else throw Error('"'+r+'" is not in the SourceMap.')};U.prototype.generatedPositionFor=function(r){for(var t=0;t<this._sections.length;t++){var i=this._sections[t];if(i.consumer._findSourceIndex(P.getArg(r,"source"))===-1)continue;var a=i.consumer.generatedPositionFor(r);if(a){var n={line:a.line+(i.generatedOffset.generatedLine-1),column:a.column+(i.generatedOffset.generatedLine===a.line?i.generatedOffset.generatedColumn-1:0)};return n}}return{line:null,column:null}};U.prototype._parseMappings=function(r,t){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++){var a=this._sections[i],n=a.consumer._generatedMappings;for(var o=0;o<n.length;o++){var l=n[o],h=a.consumer._sources.at(l.source);if(h!==null)h=P.computeSourceURL(a.consumer.sourceRoot,h,this._sourceMapURL);this._sources.add(h),h=this._sources.indexOf(h);var c=null;if(l.name)c=a.consumer._names.at(l.name),this._names.add(c),c=this._names.indexOf(c);var u={source:h,generatedLine:l.generatedLine+(a.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(a.generatedOffset.generatedLine===l.generatedLine?a.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:c};if(this.__generatedMappings.push(u),typeof u.originalLine==="number")this.__originalMappings.push(u)}}me(this.__generatedMappings,P.compareByGeneratedPositionsDeflated),me(this.__originalMappings,P.compareByOriginalPositions)};nr.IndexedSourceMapConsumer=U});var ds=e(function(dr){var cr=He().SourceMapGenerator,Ne=oe(),ur=/(\r?\n)/,pr=10,he="$$$isSourceNode$$$";function F(s,r,t,i,a){if(this.children=[],this.sourceContents={},this.line=s==null?null:s,this.column=r==null?null:r,this.source=t==null?null:t,this.name=a==null?null:a,this[he]=!0,i!=null)this.add(i)}F.fromStringWithSourceMap=function(r,t,i){var a=new F,n=r.split(ur),o=0,l=function(){var f=x(),m=x()||"";return f+m;function x(){return o<n.length?n[o++]:void 0}},h=1,c=0,u=null;if(t.eachMapping(function(f){if(u!==null)if(h<f.generatedLine)d(u,l()),h++,c=0;else{var m=n[o]||"",x=m.substr(0,f.generatedColumn-c);n[o]=m.substr(f.generatedColumn-c),c=f.generatedColumn,d(u,x),u=f;return}while(h<f.generatedLine)a.add(l()),h++;if(c<f.generatedColumn){var m=n[o]||"";a.add(m.substr(0,f.generatedColumn)),n[o]=m.substr(f.generatedColumn),c=f.generatedColumn}u=f},this),o<n.length){if(u)d(u,l());a.add(n.splice(o).join(""))}return t.sources.forEach(function(f){var m=t.sourceContentFor(f);if(m!=null){if(i!=null)f=Ne.join(i,f);a.setSourceContent(f,m)}}),a;function d(f,m){if(f===null||f.source===void 0)a.add(m);else{var x=i?Ne.join(i,f.source):f.source;a.add(new F(f.originalLine,f.originalColumn,x,m,f.name))}}};F.prototype.add=function(r){if(Array.isArray(r))r.forEach(function(t){this.add(t)},this);else if(r[he]||typeof r==="string"){if(r)this.children.push(r)}else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};F.prototype.prepend=function(r){if(Array.isArray(r))for(var t=r.length-1;t>=0;t--)this.prepend(r[t]);else if(r[he]||typeof r==="string")this.children.unshift(r);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};F.prototype.walk=function(r){var t;for(var i=0,a=this.children.length;i<a;i++)if(t=this.children[i],t[he])t.walk(r);else if(t!=="")r(t,{source:this.source,line:this.line,column:this.column,name:this.name})};F.prototype.join=function(r){var t,i,a=this.children.length;if(a>0){t=[];for(i=0;i<a-1;i++)t.push(this.children[i]),t.push(r);t.push(this.children[i]),this.children=t}return this};F.prototype.replaceRight=function(r,t){var i=this.children[this.children.length-1];if(i[he])i.replaceRight(r,t);else if(typeof i==="string")this.children[this.children.length-1]=i.replace(r,t);else this.children.push("".replace(r,t));return this};F.prototype.setSourceContent=function(r,t){this.sourceContents[Ne.toSetString(r)]=t};F.prototype.walkSourceContents=function(r){for(var t=0,i=this.children.length;t<i;t++)if(this.children[t][he])this.children[t].walkSourceContents(r);var a=Object.keys(this.sourceContents);for(var t=0,i=a.length;t<i;t++)r(Ne.fromSetString(a[t]),this.sourceContents[a[t]])};F.prototype.toString=function(){var r="";return this.walk(function(t){r+=t}),r};F.prototype.toStringWithSourceMap=function(r){var t={code:"",line:1,column:0},i=new cr(r),a=!1,n=null,o=null,l=null,h=null;return this.walk(function(c,u){if(t.code+=c,u.source!==null&&u.line!==null&&u.column!==null){if(n!==u.source||o!==u.line||l!==u.column||h!==u.name)i.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name});n=u.source,o=u.line,l=u.column,h=u.name,a=!0}else if(a)i.addMapping({generated:{line:t.line,column:t.column}}),n=null,a=!1;for(var d=0,f=c.length;d<f;d++)if(c.charCodeAt(d)===pr){if(t.line++,t.column=0,d+1===f)n=null,a=!1;else if(a)i.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name})}else t.column++}),this.walkSourceContents(function(c,u){i.setSourceContent(c,u)}),{code:t.code,map:i}};dr.SourceNode=F});var Be=e(function(yr){yr.SourceMapGenerator=He().SourceMapGenerator;yr.SourceMapConsumer=fs().SourceMapConsumer;yr.SourceNode=ds().SourceNode});var fr=e(function(ni){Object.defineProperty(ni,"__esModule",{value:!0});function br(s,r){if(s==null)return{};var t={};for(var i in s)if({}.hasOwnProperty.call(s,i)){if(r.indexOf(i)!==-1)continue;t[i]=s[i]}return t}class X{constructor(s,r,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=s,this.column=r,this.index=t}}class Se{constructor(s,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=s,this.end=r}}function _(s,r){let{line:t,column:i,index:a}=s;return new X(t,i+r,a+r)}var ms="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Tr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:ms},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:ms}},ys={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Me=(s)=>s.type==="UpdateExpression"?ys.UpdateExpression[`${s.prefix}`]:ys[s.type],Ar={AccessorIsGenerator:({kind:s})=>`A ${s}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:s})=>`Missing initializer in ${s} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:s})=>`\`${s}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:s,exportName:r})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
3
|
+
- Did you mean \`export { '${s}' as '${r}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:s})=>`'${s==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:s})=>`Unsyntactic ${s==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:s})=>`A string literal cannot be used as an imported binding.
|
|
4
|
+
- Did you mean \`import { "${s}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:s})=>`Expected number in radix ${s}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:s})=>`Escape sequence in keyword ${s}.`,InvalidIdentifier:({identifierName:s})=>`Invalid identifier ${s}.`,InvalidLhs:({ancestor:s})=>`Invalid left-hand side in ${Me(s)}.`,InvalidLhsBinding:({ancestor:s})=>`Binding invalid left-hand side in ${Me(s)}.`,InvalidLhsOptionalChaining:({ancestor:s})=>`Invalid optional chaining in the left-hand side of ${Me(s)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:s})=>`Unexpected character '${s}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:s})=>`Private name #${s} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:s})=>`Label '${s}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:s})=>`This experimental syntax requires enabling the parser plugin: ${s.map((r)=>JSON.stringify(r)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:s})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${s.map((r)=>JSON.stringify(r)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:s})=>`Duplicate key "${s}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:s})=>`An export name cannot include a lone surrogate, found '\\u${s.toString(16)}'.`,ModuleExportUndefined:({localName:s})=>`Export '${s}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:s})=>`Private names are only allowed in property accesses (\`obj.#${s}\`) or in \`in\` expressions (\`#${s} in obj\`).`,PrivateNameRedeclaration:({identifierName:s})=>`Duplicate private name #${s}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:s})=>`Unexpected keyword '${s}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:s})=>`Unexpected reserved word '${s}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:s,unexpected:r})=>`Unexpected token${r?` '${r}'.`:""}${s?`, expected "${s}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:s,onlyValidPropertyName:r})=>`The only valid meta property for ${s} is ${s}.${r}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:s})=>`Identifier '${s}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Sr={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:s})=>`Assigning to '${s}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:s})=>`Binding '${s}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Cr={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:s})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(s)}\`.`},wr=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Ir=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:s})=>`Invalid topic token ${s}. In order to use ${s} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${s}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:s})=>`Hack-style pipe body cannot be an unparenthesized ${Me({type:s})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),vr={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."},Er=["message"];function xs(s,r,t){Object.defineProperty(s,r,{enumerable:!1,configurable:!0,value:t})}function Nr({toMessage:s,code:r,reasonCode:t,syntaxPlugin:i}){let a=t==="MissingPlugin"||t==="MissingOneOfPlugins",n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};if(n[t])t=n[t];return function o(l,h){let c=SyntaxError();if(c.code=r,c.reasonCode=t,c.loc=l,c.pos=l.index,c.syntaxPlugin=i,a)c.missingPlugin=h.missingPlugin;return xs(c,"clone",function(d={}){var f;let{line:m,column:x,index:T}=(f=d.loc)!=null?f:l;return o(new X(m,x,T),Object.assign({},h,d.details))}),xs(c,"details",h),Object.defineProperty(c,"message",{configurable:!0,get(){let u=`${s(h)} (${l.line}:${l.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),c}}function V(s,r){if(Array.isArray(s))return(i)=>V(i,s[0]);let t={};for(let i of Object.keys(s)){let a=s[i],n=typeof a==="string"?{message:()=>a}:typeof a==="function"?{message:a}:a,{message:o}=n,l=br(n,Er),h=typeof o==="string"?()=>o:o;t[i]=Nr(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:h},r?{syntaxPlugin:r}:{},l))}return t}var p=Object.assign({},V(Tr),V(Ar),V(Sr),V(Cr),V`pipelineOperator`(Ir),V`functionBind`(vr));function kr(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Lr(s){let r=kr();if(s==null)return r;if(s.annexB!=null&&s.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let t of Object.keys(r))if(s[t]!=null)r[t]=s[t];if(r.startLine===1){if(s.startIndex==null&&r.startColumn>0)r.startIndex=r.startColumn;else if(s.startColumn==null&&r.startIndex>0)r.startColumn=r.startIndex}else if(s.startColumn==null||s.startIndex==null){if(s.startIndex!=null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.")}if(r.sourceType==="commonjs"){if(s.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(s.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(s.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return r}var{defineProperty:Mr}=Object,gs=(s,r)=>{if(s)Mr(s,r,{enumerable:!1,value:s[r]})};function ye(s){return gs(s.loc.start,"index"),gs(s.loc.end,"index"),s}var Or=(s)=>class extends s{parse(){let t=ye(super.parse());if(this.optionFlags&256)t.tokens=t.tokens.map(ye);return t}parseRegExpLiteral({pattern:t,flags:i}){let a=null;try{a=new RegExp(t,i)}catch(o){}let n=this.estreeParseLiteral(a);return n.regex={pattern:t,flags:i},n}parseBigIntLiteral(t){let i;try{i=BigInt(t)}catch(n){i=null}let a=this.estreeParseLiteral(i);return a.bigint=String(a.value||t),a}parseDecimalLiteral(t){let a=this.estreeParseLiteral(null);return a.decimal=String(a.value||t),a}estreeParseLiteral(t){return this.parseLiteral(t,"Literal")}parseStringLiteral(t){return this.estreeParseLiteral(t)}parseNumericLiteral(t){return this.estreeParseLiteral(t)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(t){return this.estreeParseLiteral(t)}estreeParseChainExpression(t,i){let a=this.startNodeAtNode(t);return a.expression=t,this.finishNodeAt(a,"ChainExpression",i)}directiveToStmt(t){let i=t.value;delete t.value,this.castNodeTo(i,"Literal"),i.raw=i.extra.raw,i.value=i.extra.expressionValue;let a=this.castNodeTo(t,"ExpressionStatement");return a.expression=i,a.directive=i.extra.rawValue,delete i.extra,a}fillOptionalPropertiesForTSESLint(t){}cloneEstreeStringLiteral(t){let{start:i,end:a,loc:n,range:o,raw:l,value:h}=t,c=Object.create(t.constructor.prototype);return c.type="Literal",c.start=i,c.end=a,c.loc=n,c.range=o,c.raw=l,c.value=h,c}initFunction(t,i){super.initFunction(t,i),t.expression=!1}checkDeclaration(t){if(t!=null&&this.isObjectProperty(t))this.checkDeclaration(t.value);else super.checkDeclaration(t)}getObjectOrClassMethodParams(t){return t.value.params}isValidDirective(t){var i;return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value==="string"&&!((i=t.expression.extra)!=null&&i.parenthesized)}parseBlockBody(t,i,a,n,o){super.parseBlockBody(t,i,a,n,o);let l=t.directives.map((h)=>this.directiveToStmt(h));t.body=l.concat(t.body),delete t.directives}parsePrivateName(){let t=super.parsePrivateName();if(!this.getPluginOption("estree","classFeatures"))return t;return this.convertPrivateNameToPrivateIdentifier(t)}convertPrivateNameToPrivateIdentifier(t){let i=super.getPrivateNameSV(t);return delete t.id,t.name=i,this.castNodeTo(t,"PrivateIdentifier")}isPrivateName(t){if(!this.getPluginOption("estree","classFeatures"))return super.isPrivateName(t);return t.type==="PrivateIdentifier"}getPrivateNameSV(t){if(!this.getPluginOption("estree","classFeatures"))return super.getPrivateNameSV(t);return t.name}parseLiteral(t,i){let a=super.parseLiteral(t,i);return a.raw=a.extra.raw,delete a.extra,a}parseFunctionBody(t,i,a=!1){super.parseFunctionBody(t,i,a),t.expression=t.body.type!=="BlockStatement"}parseMethod(t,i,a,n,o,l,h=!1){let c=this.startNode();c.kind=t.kind,c=super.parseMethod(c,i,a,n,o,l,h),delete c.kind;let{typeParameters:u}=t;if(u)delete t.typeParameters,c.typeParameters=u,this.resetStartLocationFromNode(c,u);let d=this.castNodeTo(c,"FunctionExpression");if(t.value=d,l==="ClassPrivateMethod")t.computed=!1;if(l==="ObjectMethod"){if(t.kind==="method")t.kind="init";return t.shorthand=!1,this.finishNode(t,"Property")}else return this.finishNode(t,"MethodDefinition")}nameIsConstructor(t){if(t.type==="Literal")return t.value==="constructor";return super.nameIsConstructor(t)}parseClassProperty(...t){let i=super.parseClassProperty(...t);if(!this.getPluginOption("estree","classFeatures"))return i;return this.castNodeTo(i,"PropertyDefinition"),i}parseClassPrivateProperty(...t){let i=super.parseClassPrivateProperty(...t);if(!this.getPluginOption("estree","classFeatures"))return i;return this.castNodeTo(i,"PropertyDefinition"),i.computed=!1,i}parseClassAccessorProperty(t){let i=super.parseClassAccessorProperty(t);if(!this.getPluginOption("estree","classFeatures"))return i;if(i.abstract&&this.hasPlugin("typescript"))delete i.abstract,this.castNodeTo(i,"TSAbstractAccessorProperty");else this.castNodeTo(i,"AccessorProperty");return i}parseObjectProperty(t,i,a,n){let o=super.parseObjectProperty(t,i,a,n);if(o)o.kind="init",this.castNodeTo(o,"Property");return o}finishObjectProperty(t){return t.kind="init",this.finishNode(t,"Property")}isValidLVal(t,i,a,n){return t==="Property"?"value":super.isValidLVal(t,i,a,n)}isAssignable(t,i){if(t!=null&&this.isObjectProperty(t))return this.isAssignable(t.value,i);return super.isAssignable(t,i)}toAssignable(t,i=!1){if(t!=null&&this.isObjectProperty(t)){let{key:a,value:n}=t;if(this.isPrivateName(a))this.classScope.usePrivateName(this.getPrivateNameSV(a),a.loc.start);this.toAssignable(n,i)}else super.toAssignable(t,i)}toAssignableObjectExpressionProp(t,i,a){if(t.type==="Property"&&(t.kind==="get"||t.kind==="set"))this.raise(p.PatternHasAccessor,t.key);else if(t.type==="Property"&&t.method)this.raise(p.PatternHasMethod,t.key);else super.toAssignableObjectExpressionProp(t,i,a)}finishCallExpression(t,i){let a=super.finishCallExpression(t,i);if(a.callee.type==="Import"){var n,o;this.castNodeTo(a,"ImportExpression"),a.source=a.arguments[0],a.options=(n=a.arguments[1])!=null?n:null,a.attributes=(o=a.arguments[1])!=null?o:null,delete a.arguments,delete a.callee}else if(a.type==="OptionalCallExpression")this.castNodeTo(a,"CallExpression");else a.optional=!1;return a}toReferencedArguments(t){if(t.type==="ImportExpression")return;super.toReferencedArguments(t)}parseExport(t,i){let a=this.state.lastTokStartLoc,n=super.parseExport(t,i);switch(n.type){case"ExportAllDeclaration":n.exported=null;break;case"ExportNamedDeclaration":if(n.specifiers.length===1&&n.specifiers[0].type==="ExportNamespaceSpecifier")this.castNodeTo(n,"ExportAllDeclaration"),n.exported=n.specifiers[0].exported,delete n.specifiers;case"ExportDefaultDeclaration":{var o;let{declaration:l}=n;if((l==null?void 0:l.type)==="ClassDeclaration"&&((o=l.decorators)==null?void 0:o.length)>0&&l.start===n.start)this.resetStartLocation(n,a)}break}return n}stopParseSubscript(t,i){let a=super.stopParseSubscript(t,i);if(i.optionalChainMember)return this.estreeParseChainExpression(a,t.loc.end);return a}parseMember(t,i,a,n,o){let l=super.parseMember(t,i,a,n,o);if(l.type==="OptionalMemberExpression")this.castNodeTo(l,"MemberExpression");else l.optional=!1;return l}isOptionalMemberExpression(t){if(t.type==="ChainExpression")return t.expression.type==="MemberExpression";return super.isOptionalMemberExpression(t)}hasPropertyAsPrivateName(t){if(t.type==="ChainExpression")t=t.expression;return super.hasPropertyAsPrivateName(t)}isObjectProperty(t){return t.type==="Property"&&t.kind==="init"&&!t.method}isObjectMethod(t){return t.type==="Property"&&(t.method||t.kind==="get"||t.kind==="set")}castNodeTo(t,i){let a=super.castNodeTo(t,i);return this.fillOptionalPropertiesForTSESLint(a),a}cloneIdentifier(t){let i=super.cloneIdentifier(t);return this.fillOptionalPropertiesForTSESLint(i),i}cloneStringLiteral(t){if(t.type==="Literal")return this.cloneEstreeStringLiteral(t);return super.cloneStringLiteral(t)}finishNodeAt(t,i,a){return ye(super.finishNodeAt(t,i,a))}finishNode(t,i){let a=super.finishNode(t,i);return this.fillOptionalPropertiesForTSESLint(a),a}resetStartLocation(t,i){super.resetStartLocation(t,i),ye(t)}resetEndLocation(t,i=this.state.lastTokEndLoc){super.resetEndLocation(t,i),ye(t)}};class ce{constructor(s,r){this.token=void 0,this.preserveSpace=void 0,this.token=s,this.preserveSpace=!!r}}var E={brace:new ce("{"),j_oTag:new ce("<tag"),j_cTag:new ce("</tag"),j_expr:new ce("<tag>...</tag>",!0)};E.template=new ce("`",!0);var w=!0,y=!0,Xe=!0,xe=!0,Q=!0,Dr=!0;class nt{constructor(s,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=s,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null}}var ot=new Map;function v(s,r={}){r.keyword=s;let t=b(s,r);return ot.set(s,t),t}function D(s,r){return b(s,{beforeExpr:w,binop:r})}var Te=-1,Y=[],lt=[],ht=[],ct=[],ut=[],pt=[];function b(s,r={}){var t,i,a,n;return++Te,lt.push(s),ht.push((t=r.binop)!=null?t:-1),ct.push((i=r.beforeExpr)!=null?i:!1),ut.push((a=r.startsExpr)!=null?a:!1),pt.push((n=r.prefix)!=null?n:!1),Y.push(new nt(s,r)),Te}function I(s,r={}){var t,i,a,n;return++Te,ot.set(s,Te),lt.push(s),ht.push((t=r.binop)!=null?t:-1),ct.push((i=r.beforeExpr)!=null?i:!1),ut.push((a=r.startsExpr)!=null?a:!1),pt.push((n=r.prefix)!=null?n:!1),Y.push(new nt("name",r)),Te}var _r={bracketL:b("[",{beforeExpr:w,startsExpr:y}),bracketHashL:b("#[",{beforeExpr:w,startsExpr:y}),bracketBarL:b("[|",{beforeExpr:w,startsExpr:y}),bracketR:b("]"),bracketBarR:b("|]"),braceL:b("{",{beforeExpr:w,startsExpr:y}),braceBarL:b("{|",{beforeExpr:w,startsExpr:y}),braceHashL:b("#{",{beforeExpr:w,startsExpr:y}),braceR:b("}"),braceBarR:b("|}"),parenL:b("(",{beforeExpr:w,startsExpr:y}),parenR:b(")"),comma:b(",",{beforeExpr:w}),semi:b(";",{beforeExpr:w}),colon:b(":",{beforeExpr:w}),doubleColon:b("::",{beforeExpr:w}),dot:b("."),question:b("?",{beforeExpr:w}),questionDot:b("?."),arrow:b("=>",{beforeExpr:w}),template:b("template"),ellipsis:b("...",{beforeExpr:w}),backQuote:b("`",{startsExpr:y}),dollarBraceL:b("${",{beforeExpr:w,startsExpr:y}),templateTail:b("...`",{startsExpr:y}),templateNonTail:b("...${",{beforeExpr:w,startsExpr:y}),at:b("@"),hash:b("#",{startsExpr:y}),interpreterDirective:b("#!..."),eq:b("=",{beforeExpr:w,isAssign:xe}),assign:b("_=",{beforeExpr:w,isAssign:xe}),slashAssign:b("_=",{beforeExpr:w,isAssign:xe}),xorAssign:b("_=",{beforeExpr:w,isAssign:xe}),moduloAssign:b("_=",{beforeExpr:w,isAssign:xe}),incDec:b("++/--",{prefix:Q,postfix:Dr,startsExpr:y}),bang:b("!",{beforeExpr:w,prefix:Q,startsExpr:y}),tilde:b("~",{beforeExpr:w,prefix:Q,startsExpr:y}),doubleCaret:b("^^",{startsExpr:y}),doubleAt:b("@@",{startsExpr:y}),pipeline:D("|>",0),nullishCoalescing:D("??",1),logicalOR:D("||",1),logicalAND:D("&&",2),bitwiseOR:D("|",3),bitwiseXOR:D("^",4),bitwiseAND:D("&",5),equality:D("==/!=/===/!==",6),lt:D("</>/<=/>=",7),gt:D("</>/<=/>=",7),relational:D("</>/<=/>=",7),bitShift:D("<</>>/>>>",8),bitShiftL:D("<</>>/>>>",8),bitShiftR:D("<</>>/>>>",8),plusMin:b("+/-",{beforeExpr:w,binop:9,prefix:Q,startsExpr:y}),modulo:b("%",{binop:10,startsExpr:y}),star:b("*",{binop:10}),slash:D("/",10),exponent:b("**",{beforeExpr:w,binop:11,rightAssociative:!0}),_in:v("in",{beforeExpr:w,binop:7}),_instanceof:v("instanceof",{beforeExpr:w,binop:7}),_break:v("break"),_case:v("case",{beforeExpr:w}),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",{beforeExpr:w}),_else:v("else",{beforeExpr:w}),_finally:v("finally"),_function:v("function",{startsExpr:y}),_if:v("if"),_return:v("return",{beforeExpr:w}),_switch:v("switch"),_throw:v("throw",{beforeExpr:w,prefix:Q,startsExpr:y}),_try:v("try"),_var:v("var"),_const:v("const"),_with:v("with"),_new:v("new",{beforeExpr:w,startsExpr:y}),_this:v("this",{startsExpr:y}),_super:v("super",{startsExpr:y}),_class:v("class",{startsExpr:y}),_extends:v("extends",{beforeExpr:w}),_export:v("export"),_import:v("import",{startsExpr:y}),_null:v("null",{startsExpr:y}),_true:v("true",{startsExpr:y}),_false:v("false",{startsExpr:y}),_typeof:v("typeof",{beforeExpr:w,prefix:Q,startsExpr:y}),_void:v("void",{beforeExpr:w,prefix:Q,startsExpr:y}),_delete:v("delete",{beforeExpr:w,prefix:Q,startsExpr:y}),_do:v("do",{isLoop:Xe,beforeExpr:w}),_for:v("for",{isLoop:Xe}),_while:v("while",{isLoop:Xe}),_as:I("as",{startsExpr:y}),_assert:I("assert",{startsExpr:y}),_async:I("async",{startsExpr:y}),_await:I("await",{startsExpr:y}),_defer:I("defer",{startsExpr:y}),_from:I("from",{startsExpr:y}),_get:I("get",{startsExpr:y}),_let:I("let",{startsExpr:y}),_meta:I("meta",{startsExpr:y}),_of:I("of",{startsExpr:y}),_sent:I("sent",{startsExpr:y}),_set:I("set",{startsExpr:y}),_source:I("source",{startsExpr:y}),_static:I("static",{startsExpr:y}),_using:I("using",{startsExpr:y}),_yield:I("yield",{startsExpr:y}),_asserts:I("asserts",{startsExpr:y}),_checks:I("checks",{startsExpr:y}),_exports:I("exports",{startsExpr:y}),_global:I("global",{startsExpr:y}),_implements:I("implements",{startsExpr:y}),_intrinsic:I("intrinsic",{startsExpr:y}),_infer:I("infer",{startsExpr:y}),_is:I("is",{startsExpr:y}),_mixins:I("mixins",{startsExpr:y}),_proto:I("proto",{startsExpr:y}),_require:I("require",{startsExpr:y}),_satisfies:I("satisfies",{startsExpr:y}),_keyof:I("keyof",{startsExpr:y}),_readonly:I("readonly",{startsExpr:y}),_unique:I("unique",{startsExpr:y}),_abstract:I("abstract",{startsExpr:y}),_declare:I("declare",{startsExpr:y}),_enum:I("enum",{startsExpr:y}),_module:I("module",{startsExpr:y}),_namespace:I("namespace",{startsExpr:y}),_interface:I("interface",{startsExpr:y}),_type:I("type",{startsExpr:y}),_opaque:I("opaque",{startsExpr:y}),name:b("name",{startsExpr:y}),placeholder:b("%%",{startsExpr:y}),string:b("string",{startsExpr:y}),num:b("num",{startsExpr:y}),bigint:b("bigint",{startsExpr:y}),decimal:b("decimal",{startsExpr:y}),regexp:b("regexp",{startsExpr:y}),privateName:b("#name",{startsExpr:y}),eof:b("eof"),jsxName:b("jsxName"),jsxText:b("jsxText",{beforeExpr:w}),jsxTagStart:b("jsxTagStart",{startsExpr:y}),jsxTagEnd:b("jsxTagEnd")};function N(s){return s>=93&&s<=133}function Fr(s){return s<=92}function q(s){return s>=58&&s<=133}function ks(s){return s>=58&&s<=137}function Br(s){return ct[s]}function Pe(s){return ut[s]}function Rr(s){return s>=29&&s<=33}function Ps(s){return s>=129&&s<=131}function Ur(s){return s>=90&&s<=92}function ft(s){return s>=58&&s<=92}function jr(s){return s>=39&&s<=59}function $r(s){return s===34}function Vr(s){return pt[s]}function qr(s){return s>=121&&s<=123}function zr(s){return s>=124&&s<=130}function ee(s){return lt[s]}function Oe(s){return ht[s]}function Hr(s){return s===57}function _e(s){return s>=24&&s<=25}function G(s){return Y[s]}Y[8].updateContext=(s)=>{s.pop()};Y[5].updateContext=Y[7].updateContext=Y[23].updateContext=(s)=>{s.push(E.brace)};Y[22].updateContext=(s)=>{if(s[s.length-1]===E.template)s.pop();else s.push(E.template)};Y[143].updateContext=(s)=>{s.push(E.j_expr,E.j_oTag)};var dt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ls="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Kr=new RegExp("["+dt+"]"),Wr=new RegExp("["+dt+Ls+"]");dt=Ls=null;var Ms=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Gr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function st(s,r){let t=65536;for(let i=0,a=r.length;i<a;i+=2){if(t+=r[i],t>s)return!1;if(t+=r[i+1],t>=s)return!0}return!1}function H(s){if(s<65)return s===36;if(s<=90)return!0;if(s<97)return s===95;if(s<=122)return!0;if(s<=65535)return s>=170&&Kr.test(String.fromCharCode(s));return st(s,Ms)}function ae(s){if(s<48)return s===36;if(s<58)return!0;if(s<65)return!1;if(s<=90)return!0;if(s<97)return s===95;if(s<=122)return!0;if(s<=65535)return s>=170&&Wr.test(String.fromCharCode(s));return st(s,Ms)||st(s,Gr)}var mt={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Jr=new Set(mt.keyword),Xr=new Set(mt.strict),Yr=new Set(mt.strictBind);function Os(s,r){return r&&s==="await"||s==="enum"}function Ds(s,r){return Os(s,r)||Xr.has(s)}function _s(s){return Yr.has(s)}function Fs(s,r){return Ds(s,r)||_s(s)}function Qr(s){return Jr.has(s)}function Zr(s,r,t){return s===64&&r===64&&H(t)}var ea=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function ta(s){return ea.has(s)}class Fe{constructor(s){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=s}}class Re{constructor(s,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=s,this.inModule=r}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let s=this.currentThisScopeFlags();return(s&64)>0&&(s&2)===0}get inStaticBlock(){for(let s=this.scopeStack.length-1;;s--){let{flags:r}=this.scopeStack[s];if(r&128)return!0;if(r&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(s){return new Fe(s)}enter(s){this.scopeStack.push(this.createScope(s))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(s){return!!(s.flags&130||!this.parser.inModule&&s.flags&1)}declareName(s,r,t){let i=this.currentScope();if(r&8||r&16){this.checkRedeclarationInScope(i,s,r,t);let a=i.names.get(s)||0;if(r&16)a=a|4;else{if(!i.firstLexicalName)i.firstLexicalName=s;a=a|2}if(i.names.set(s,a),r&8)this.maybeExportDefined(i,s)}else if(r&4){for(let a=this.scopeStack.length-1;a>=0;--a)if(i=this.scopeStack[a],this.checkRedeclarationInScope(i,s,r,t),i.names.set(s,(i.names.get(s)||0)|1),this.maybeExportDefined(i,s),i.flags&1667)break}if(this.parser.inModule&&i.flags&1)this.undefinedExports.delete(s)}maybeExportDefined(s,r){if(this.parser.inModule&&s.flags&1)this.undefinedExports.delete(r)}checkRedeclarationInScope(s,r,t,i){if(this.isRedeclaredInScope(s,r,t))this.parser.raise(p.VarRedeclaration,i,{identifierName:r})}isRedeclaredInScope(s,r,t){if(!(t&1))return!1;if(t&8)return s.names.has(r);let i=s.names.get(r)||0;if(t&16)return(i&2)>0||!this.treatFunctionsAsVarInScope(s)&&(i&1)>0;return(i&2)>0&&!(s.flags&8&&s.firstLexicalName===r)||!this.treatFunctionsAsVarInScope(s)&&(i&4)>0}checkLocalExport(s){let{name:r}=s;if(!this.scopeStack[0].names.has(r))this.undefinedExports.set(r,s.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:r}=this.scopeStack[s];if(r&1667)return r}}currentThisScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:r}=this.scopeStack[s];if(r&1731&&!(r&4))return r}}}class Bs extends Fe{constructor(...s){super(...s);this.declareFunctions=new Set}}class Rs extends Re{createScope(s){return new Bs(s)}declareName(s,r,t){let i=this.currentScope();if(r&2048){this.checkRedeclarationInScope(i,s,r,t),this.maybeExportDefined(i,s),i.declareFunctions.add(s);return}super.declareName(s,r,t)}isRedeclaredInScope(s,r,t){if(super.isRedeclaredInScope(s,r,t))return!0;if(t&2048&&!s.declareFunctions.has(r)){let i=s.names.get(r);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(s){if(!this.scopeStack[0].declareFunctions.has(s.name))super.checkLocalExport(s)}}var sa=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),A=V`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:s})=>`Cannot overwrite reserved type ${s}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:s,enumName:r})=>`Boolean enum members need to be initialized. Use either \`${s} = true,\` or \`${s} = false,\` in enum \`${r}\`.`,EnumDuplicateMemberName:({memberName:s,enumName:r})=>`Enum member names need to be unique, but the name \`${s}\` has already been used before in enum \`${r}\`.`,EnumInconsistentMemberValues:({enumName:s})=>`Enum \`${s}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:s,enumName:r})=>`Enum type \`${s}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:s})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:s,memberName:r,explicitType:t})=>`Enum \`${s}\` has type \`${t}\`, so the initializer of \`${r}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:s,memberName:r})=>`Symbol enum members cannot be initialized. Use \`${r},\` in enum \`${s}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:s,memberName:r})=>`The enum member initializer for \`${r}\` needs to be a literal (either a boolean, number, or string) in enum \`${s}\`.`,EnumInvalidMemberName:({enumName:s,memberName:r,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${r}\`, consider using \`${t}\`, in enum \`${s}\`.`,EnumNumberMemberNotInitialized:({enumName:s,memberName:r})=>`Number enum members need to be initialized, e.g. \`${r} = 1\` in enum \`${s}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:s})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${s}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:s})=>`Unexpected reserved type ${s}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:s,suggestion:r})=>`\`declare export ${s}\` is not supported. Use \`${r}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function ia(s){return s.type==="DeclareExportAllDeclaration"||s.type==="DeclareExportDeclaration"&&(!s.declaration||s.declaration.type!=="TypeAlias"&&s.declaration.type!=="InterfaceDeclaration")}function bs(s){return s.importKind==="type"||s.importKind==="typeof"}var ra={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function aa(s,r){let t=[],i=[];for(let a=0;a<s.length;a++)(r(s[a],a,s)?t:i).push(s[a]);return[t,i]}var na=/\*?\s*@((?:no)?flow)\b/,oa=(s)=>class extends s{constructor(...t){super(...t);this.flowPragma=void 0}getScopeHandler(){return Rs}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(t,i){if(t!==134&&t!==13&&t!==28){if(this.flowPragma===void 0)this.flowPragma=null}super.finishToken(t,i)}addComment(t){if(this.flowPragma===void 0){let i=na.exec(t.value);if(!i);else if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw Error("Unexpected flow pragma")}super.addComment(t)}flowParseTypeInitialiser(t){let i=this.state.inType;this.state.inType=!0,this.expect(t||14);let a=this.flowParseType();return this.state.inType=i,a}flowParsePredicate(){let t=this.startNode(),i=this.state.startLoc;if(this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>i.index+1)this.raise(A.UnexpectedSpaceBetweenModuloChecks,i);if(this.eat(10))return t.value=super.parseExpression(),this.expect(11),this.finishNode(t,"DeclaredPredicate");else return this.finishNode(t,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let t=this.state.inType;this.state.inType=!0,this.expect(14);let i=null,a=null;if(this.match(54))this.state.inType=t,a=this.flowParsePredicate();else if(i=this.flowParseType(),this.state.inType=t,this.match(54))a=this.flowParsePredicate();return[i,a]}flowParseDeclareClass(t){return this.next(),this.flowParseInterfaceish(t,!0),this.finishNode(t,"DeclareClass")}flowParseDeclareFunction(t){this.next();let i=t.id=this.parseIdentifier(),a=this.startNode(),n=this.startNode();if(this.match(47))a.typeParameters=this.flowParseTypeParameterDeclaration();else a.typeParameters=null;this.expect(10);let o=this.flowParseFunctionTypeParams();return a.params=o.params,a.rest=o.rest,a.this=o._this,this.expect(11),[a.returnType,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),n.typeAnnotation=this.finishNode(a,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(t.id.name,2048,t.id.loc.start),this.finishNode(t,"DeclareFunction")}flowParseDeclare(t,i){if(this.match(80))return this.flowParseDeclareClass(t);else if(this.match(68))return this.flowParseDeclareFunction(t);else if(this.match(74))return this.flowParseDeclareVariable(t);else if(this.eatContextual(127))if(this.match(16))return this.flowParseDeclareModuleExports(t);else{if(i)this.raise(A.NestedDeclareModule,this.state.lastTokStartLoc);return this.flowParseDeclareModule(t)}else if(this.isContextual(130))return this.flowParseDeclareTypeAlias(t);else if(this.isContextual(131))return this.flowParseDeclareOpaqueType(t);else if(this.isContextual(129))return this.flowParseDeclareInterface(t);else if(this.match(82))return this.flowParseDeclareExportDeclaration(t,i);throw this.unexpected()}flowParseDeclareVariable(t){return this.next(),t.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(t.id.name,5,t.id.loc.start),this.semicolon(),this.finishNode(t,"DeclareVariable")}flowParseDeclareModule(t){if(this.scope.enter(0),this.match(134))t.id=super.parseExprAtom();else t.id=this.parseIdentifier();let i=t.body=this.startNode(),a=i.body=[];this.expect(5);while(!this.match(8)){let l=this.startNode();if(this.match(83)){if(this.next(),!this.isContextual(130)&&!this.match(87))this.raise(A.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc);a.push(super.parseImport(l))}else this.expectContextual(125,A.UnsupportedStatementInDeclareModule),a.push(this.flowParseDeclare(l,!0))}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let n=null,o=!1;return a.forEach((l)=>{if(ia(l)){if(n==="CommonJS")this.raise(A.AmbiguousDeclareModuleKind,l);n="ES"}else if(l.type==="DeclareModuleExports"){if(o)this.raise(A.DuplicateDeclareModuleExports,l);if(n==="ES")this.raise(A.AmbiguousDeclareModuleKind,l);n="CommonJS",o=!0}}),t.kind=n||"CommonJS",this.finishNode(t,"DeclareModule")}flowParseDeclareExportDeclaration(t,i){if(this.expect(82),this.eat(65)){if(this.match(68)||this.match(80))t.declaration=this.flowParseDeclare(this.startNode());else t.declaration=this.flowParseType(),this.semicolon();return t.default=!0,this.finishNode(t,"DeclareExportDeclaration")}else{if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!i){let a=this.state.value;throw this.raise(A.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:a,suggestion:ra[a]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return t.declaration=this.flowParseDeclare(this.startNode()),t.default=!1,this.finishNode(t,"DeclareExportDeclaration");else if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))if(t=this.parseExport(t,null),t.type==="ExportNamedDeclaration")return t.default=!1,delete t.exportKind,this.castNodeTo(t,"DeclareExportDeclaration");else return this.castNodeTo(t,"DeclareExportAllDeclaration")}throw this.unexpected()}flowParseDeclareModuleExports(t){return this.next(),this.expectContextual(111),t.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(t,"DeclareModuleExports")}flowParseDeclareTypeAlias(t){this.next();let i=this.flowParseTypeAlias(t);return this.castNodeTo(i,"DeclareTypeAlias"),i}flowParseDeclareOpaqueType(t){this.next();let i=this.flowParseOpaqueType(t,!0);return this.castNodeTo(i,"DeclareOpaqueType"),i}flowParseDeclareInterface(t){return this.next(),this.flowParseInterfaceish(t,!1),this.finishNode(t,"DeclareInterface")}flowParseInterfaceish(t,i){if(t.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(t.id.name,i?17:8201,t.id.loc.start),this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration();else t.typeParameters=null;if(t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(!i&&this.eat(12));if(i){if(t.implements=[],t.mixins=[],this.eatContextual(117))do t.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do t.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}t.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,allowInexact:!1})}flowParseInterfaceExtends(){let t=this.startNode();if(t.id=this.flowParseQualifiedTypeIdentifier(),this.match(47))t.typeParameters=this.flowParseTypeParameterInstantiation();else t.typeParameters=null;return this.finishNode(t,"InterfaceExtends")}flowParseInterface(t){return this.flowParseInterfaceish(t,!1),this.finishNode(t,"InterfaceDeclaration")}checkNotUnderscore(t){if(t==="_")this.raise(A.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(t,i,a){if(!sa.has(t))return;this.raise(a?A.AssignReservedType:A.UnexpectedReservedType,i,{reservedType:t})}flowParseRestrictedIdentifierName(t,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifierName(t)}flowParseRestrictedIdentifier(t,i){let a=this.startNode(),n=this.flowParseRestrictedIdentifierName(t,i);return this.createIdentifier(a,n)}flowParseTypeAlias(t){if(t.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration();else t.typeParameters=null;return t.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(t,"TypeAlias")}flowParseOpaqueType(t,i){if(this.expectContextual(130),t.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration();else t.typeParameters=null;if(t.supertype=null,this.match(14))t.supertype=this.flowParseTypeInitialiser(14);if(t.impltype=null,!i)t.impltype=this.flowParseTypeInitialiser(29);return this.semicolon(),this.finishNode(t,"OpaqueType")}flowParseTypeParameterBound(){if(this.match(14)||this.isContextual(81)){let t=this.startNode();return this.next(),t.typeAnnotation=this.flowParseType(),this.finishNode(t,"TypeAnnotation")}}flowParseTypeParameter(t=!1){let i=this.state.startLoc,a=this.startNode(),n=this.flowParseVariance();if(a.name=this.flowParseRestrictedIdentifierName(),a.variance=n,a.bound=this.flowParseTypeParameterBound(),this.match(29))this.eat(29),a.default=this.flowParseType();else if(t)this.raise(A.MissingTypeParamDefault,i);return this.finishNode(a,"TypeParameter")}flowParseTypeParameterDeclaration(){let t=this.state.inType,i=this.startNode();if(i.params=[],this.state.inType=!0,this.match(47)||this.match(143))this.next();else this.unexpected();let a=!1;do{let n=this.flowParseTypeParameter(a);if(i.params.push(n),n.default)a=!0;if(!this.match(48))this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=t,this.finishNode(i,"TypeParameterDeclaration")}flowInTopLevelContext(t){if(this.curContext()!==E.brace){let i=this.state.context;this.state.context=[i[0]];try{return t()}finally{this.state.context=i}}else return t()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()!==47)return;return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let t=this.startNode(),i=this.state.inType;if(this.state.inType=!0,t.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!1;while(!this.match(48))if(t.params.push(this.flowParseType()),!this.match(48))this.expect(12);this.state.noAnonFunctionType=a}),this.state.inType=i,!this.state.inType&&this.curContext()===E.brace)this.reScan_lt_gt();return this.expect(48),this.finishNode(t,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let t=this.startNode(),i=this.state.inType;t.params=[],this.state.inType=!0,this.expect(47);while(!this.match(48))if(t.params.push(this.flowParseTypeOrImplicitInstantiation()),!this.match(48))this.expect(12);return this.expect(48),this.state.inType=i,this.finishNode(t,"TypeParameterInstantiation")}flowParseInterfaceType(){let t=this.startNode();if(this.expectContextual(129),t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return t.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(t,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(t,i,a){if(t.static=i,this.lookahead().type===14)t.id=this.flowParseObjectPropertyKey(),t.key=this.flowParseTypeInitialiser();else t.id=null,t.key=this.flowParseType();return this.expect(3),t.value=this.flowParseTypeInitialiser(),t.variance=a,this.finishNode(t,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(t,i){if(t.static=i,t.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10))t.method=!0,t.optional=!1,t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start));else{if(t.method=!1,this.eat(17))t.optional=!0;t.value=this.flowParseTypeInitialiser()}return this.finishNode(t,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(t){if(t.params=[],t.rest=null,t.typeParameters=null,t.this=null,this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration();if(this.expect(10),this.match(78)){if(t.this=this.flowParseFunctionTypeParam(!0),t.this.name=null,!this.match(11))this.expect(12)}while(!this.match(11)&&!this.match(21))if(t.params.push(this.flowParseFunctionTypeParam(!1)),!this.match(11))this.expect(12);if(this.eat(21))t.rest=this.flowParseFunctionTypeParam(!1);return this.expect(11),t.returnType=this.flowParseTypeInitialiser(),this.finishNode(t,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(t,i){let a=this.startNode();return t.static=i,t.value=this.flowParseObjectTypeMethodish(a),this.finishNode(t,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:t,allowExact:i,allowSpread:a,allowProto:n,allowInexact:o}){let l=this.state.inType;this.state.inType=!0;let h=this.startNode();h.callProperties=[],h.properties=[],h.indexers=[],h.internalSlots=[];let c,u,d=!1;if(i&&this.match(6))this.expect(6),c=9,u=!0;else this.expect(5),c=8,u=!1;h.exact=u;while(!this.match(c)){let m=!1,x=null,T=null,S=this.startNode();if(n&&this.isContextual(118)){let k=this.lookahead();if(k.type!==14&&k.type!==17)this.next(),x=this.state.startLoc,t=!1}if(t&&this.isContextual(106)){let k=this.lookahead();if(k.type!==14&&k.type!==17)this.next(),m=!0}let C=this.flowParseVariance();if(this.eat(0)){if(x!=null)this.unexpected(x);if(this.eat(0)){if(C)this.unexpected(C.loc.start);h.internalSlots.push(this.flowParseObjectTypeInternalSlot(S,m))}else h.indexers.push(this.flowParseObjectTypeIndexer(S,m,C))}else if(this.match(10)||this.match(47)){if(x!=null)this.unexpected(x);if(C)this.unexpected(C.loc.start);h.callProperties.push(this.flowParseObjectTypeCallProperty(S,m))}else{let k="init";if(this.isContextual(99)||this.isContextual(104)){let B=this.lookahead();if(ks(B.type))k=this.state.value,this.next()}let z=this.flowParseObjectTypeProperty(S,m,x,C,k,a,o!=null?o:!u);if(z===null)d=!0,T=this.state.lastTokStartLoc;else h.properties.push(z)}if(this.flowObjectTypeSemicolon(),T&&!this.match(8)&&!this.match(9))this.raise(A.UnexpectedExplicitInexactInObject,T)}if(this.expect(c),a)h.inexact=d;let f=this.finishNode(h,"ObjectTypeAnnotation");return this.state.inType=l,f}flowParseObjectTypeProperty(t,i,a,n,o,l,h){if(this.eat(21)){if(this.match(12)||this.match(13)||this.match(8)||this.match(9)){if(!l)this.raise(A.InexactInsideNonObject,this.state.lastTokStartLoc);else if(!h)this.raise(A.InexactInsideExact,this.state.lastTokStartLoc);if(n)this.raise(A.InexactVariance,n);return null}if(!l)this.raise(A.UnexpectedSpreadType,this.state.lastTokStartLoc);if(a!=null)this.unexpected(a);if(n)this.raise(A.SpreadVariance,n);return t.argument=this.flowParseType(),this.finishNode(t,"ObjectTypeSpreadProperty")}else{t.key=this.flowParseObjectPropertyKey(),t.static=i,t.proto=a!=null,t.kind=o;let c=!1;if(this.match(47)||this.match(10)){if(t.method=!0,a!=null)this.unexpected(a);if(n)this.unexpected(n.loc.start);if(t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start)),o==="get"||o==="set")this.flowCheckGetterSetterParams(t);if(!l&&t.key.name==="constructor"&&t.value.this)this.raise(A.ThisParamBannedInConstructor,t.value.this)}else{if(o!=="init")this.unexpected();if(t.method=!1,this.eat(17))c=!0;t.value=this.flowParseTypeInitialiser(),t.variance=n}return t.optional=c,this.finishNode(t,"ObjectTypeProperty")}}flowCheckGetterSetterParams(t){let i=t.kind==="get"?0:1,a=t.value.params.length+(t.value.rest?1:0);if(t.value.this)this.raise(t.kind==="get"?A.GetterMayNotHaveThisParam:A.SetterMayNotHaveThisParam,t.value.this);if(a!==i)this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t);if(t.kind==="set"&&t.value.rest)this.raise(p.BadSetterRestParameter,t)}flowObjectTypeSemicolon(){if(!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9))this.unexpected()}flowParseQualifiedTypeIdentifier(t,i){t!=null||(t=this.state.startLoc);let a=i||this.flowParseRestrictedIdentifier(!0);while(this.eat(16)){let n=this.startNodeAt(t);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier")}return a}flowParseGenericType(t,i){let a=this.startNodeAt(t);if(a.typeParameters=null,a.id=this.flowParseQualifiedTypeIdentifier(t,i),this.match(47))a.typeParameters=this.flowParseTypeParameterInstantiation();return this.finishNode(a,"GenericTypeAnnotation")}flowParseTypeofType(){let t=this.startNode();return this.expect(87),t.argument=this.flowParsePrimaryType(),this.finishNode(t,"TypeofTypeAnnotation")}flowParseTupleType(){let t=this.startNode();t.types=[],this.expect(0);while(this.state.pos<this.length&&!this.match(3)){if(t.types.push(this.flowParseType()),this.match(3))break;this.expect(12)}return this.expect(3),this.finishNode(t,"TupleTypeAnnotation")}flowParseFunctionTypeParam(t){let i=null,a=!1,n=null,o=this.startNode(),l=this.lookahead(),h=this.state.type===78;if(l.type===14||l.type===17){if(h&&!t)this.raise(A.ThisParamMustBeFirst,o);if(i=this.parseIdentifier(h),this.eat(17)){if(a=!0,h)this.raise(A.ThisParamMayNotBeOptional,o)}n=this.flowParseTypeInitialiser()}else n=this.flowParseType();return o.name=i,o.optional=a,o.typeAnnotation=n,this.finishNode(o,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(t){let i=this.startNodeAt(t.loc.start);return i.name=null,i.optional=!1,i.typeAnnotation=t,this.finishNode(i,"FunctionTypeParam")}flowParseFunctionTypeParams(t=[]){let i=null,a=null;if(this.match(78)){if(a=this.flowParseFunctionTypeParam(!0),a.name=null,!this.match(11))this.expect(12)}while(!this.match(11)&&!this.match(21))if(t.push(this.flowParseFunctionTypeParam(!1)),!this.match(11))this.expect(12);if(this.eat(21))i=this.flowParseFunctionTypeParam(!1);return{params:t,rest:i,_this:a}}flowIdentToTypeAnnotation(t,i,a){switch(a.name){case"any":return this.finishNode(i,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(i,"BooleanTypeAnnotation");case"mixed":return this.finishNode(i,"MixedTypeAnnotation");case"empty":return this.finishNode(i,"EmptyTypeAnnotation");case"number":return this.finishNode(i,"NumberTypeAnnotation");case"string":return this.finishNode(i,"StringTypeAnnotation");case"symbol":return this.finishNode(i,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(a.name),this.flowParseGenericType(t,a)}}flowParsePrimaryType(){let t=this.state.startLoc,i=this.startNode(),a,n,o=!1,l=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=l,n;case 47:{let h=this.startNode();return h.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),a=this.flowParseFunctionTypeParams(),h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),this.finishNode(h,"FunctionTypeAnnotation")}case 10:{let h=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(N(this.state.type)||this.match(78)){let c=this.lookahead().type;o=c!==17&&c!==14}else o=!0;if(o)if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=l,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;else this.eat(12);if(n)a=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]);else a=this.flowParseFunctionTypeParams();return h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),h.typeParameters=null,this.finishNode(h,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return i.value=this.match(85),this.next(),this.finishNode(i,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",i);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",i);throw this.raise(A.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(i,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(i,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(i,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(i,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(ft(this.state.type)){let h=ee(this.state.type);return this.next(),super.createIdentifier(i,h)}else if(N(this.state.type)){if(this.isContextual(129))return this.flowParseInterfaceType();return this.flowIdentToTypeAnnotation(t,i,this.parseIdentifier())}}throw this.unexpected()}flowParsePostfixType(){let t=this.state.startLoc,i=this.flowParsePrimaryType(),a=!1;while((this.match(0)||this.match(18))&&!this.canInsertSemicolon()){let n=this.startNodeAt(t),o=this.eat(18);if(a=a||o,this.expect(0),!o&&this.match(3))n.elementType=i,this.next(),i=this.finishNode(n,"ArrayTypeAnnotation");else if(n.objectType=i,n.indexType=this.flowParseType(),this.expect(3),a)n.optional=o,i=this.finishNode(n,"OptionalIndexedAccessType");else i=this.finishNode(n,"IndexedAccessType")}return i}flowParsePrefixType(){let t=this.startNode();if(this.eat(17))return t.typeAnnotation=this.flowParsePrefixType(),this.finishNode(t,"NullableTypeAnnotation");else return this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let t=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let i=this.startNodeAt(t.loc.start);return i.params=[this.reinterpretTypeAsFunctionTypeParam(t)],i.rest=null,i.this=null,i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation")}return t}flowParseIntersectionType(){let t=this.startNode();this.eat(45);let i=this.flowParseAnonFunctionWithoutParens();t.types=[i];while(this.eat(45))t.types.push(this.flowParseAnonFunctionWithoutParens());return t.types.length===1?i:this.finishNode(t,"IntersectionTypeAnnotation")}flowParseUnionType(){let t=this.startNode();this.eat(43);let i=this.flowParseIntersectionType();t.types=[i];while(this.eat(43))t.types.push(this.flowParseIntersectionType());return t.types.length===1?i:this.finishNode(t,"UnionTypeAnnotation")}flowParseType(){let t=this.state.inType;this.state.inType=!0;let i=this.flowParseUnionType();return this.state.inType=t,i}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let t=this.state.startLoc,i=this.parseIdentifier();return this.flowParseGenericType(t,i)}else return this.flowParseType()}flowParseTypeAnnotation(){let t=this.startNode();return t.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(t,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let t=this.startNode(),i=this.parseIdentifierName();if(this.match(14))t.typeAnnotation=this.flowParseTypeAnnotation();return this.createIdentifier(t,i)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}flowParseVariance(){let t=null;if(this.match(53)){if(t=this.startNode(),this.state.value==="+")t.kind="plus";else t.kind="minus";return this.next(),this.finishNode(t,"Variance")}return t}parseFunctionBody(t,i,a=!1){if(i){this.forwardNoArrowParamsConversionAt(t,()=>super.parseFunctionBody(t,!0,a));return}super.parseFunctionBody(t,!1,a)}parseFunctionBodyAndFinish(t,i,a=!1){if(this.match(14)){let n=this.startNode();[n.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),t.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(t,i,a)}parseStatementLike(t){if(this.state.strict&&this.isContextual(129)){let a=this.lookahead();if(q(a.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.isContextual(126)){let a=this.startNode();return this.next(),this.flowParseEnumDeclaration(a)}let i=super.parseStatementLike(t);if(this.flowPragma===void 0&&!this.isValidDirective(i))this.flowPragma=null;return i}parseExpressionStatement(t,i,a){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||N(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(t)}else if(N(this.state.type)){if(i.name==="interface")return this.flowParseInterface(t);else if(i.name==="type")return this.flowParseTypeAlias(t);else if(i.name==="opaque")return this.flowParseOpaqueType(t,!1)}}return super.parseExpressionStatement(t,i,a)}shouldParseExportDeclaration(){let{type:t}=this.state;if(t===126||Ps(t))return!this.state.containsEsc;return super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:t}=this.state;if(t===126||Ps(t))return this.state.containsEsc;return super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDefaultExpression()}parseConditional(t,i,a){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(a),t}this.expect(17);let n=this.state.clone(),o=this.state.noArrowAt,l=this.startNodeAt(i),{consequent:h,failed:c}=this.tryParseConditionalConsequent(),[u,d]=this.getArrowLikeExpressions(h);if(c||d.length>0){let f=[...o];if(d.length>0){this.state=n,this.state.noArrowAt=f;for(let m=0;m<d.length;m++)f.push(d[m].start);({consequent:h,failed:c}=this.tryParseConditionalConsequent()),[u,d]=this.getArrowLikeExpressions(h)}if(c&&u.length>1)this.raise(A.AmbiguousConditionalArrow,n.startLoc);if(c&&u.length===1)this.state=n,f.push(u[0].start),this.state.noArrowAt=f,{consequent:h,failed:c}=this.tryParseConditionalConsequent()}return this.getArrowLikeExpressions(h,!0),this.state.noArrowAt=o,this.expect(14),l.test=t,l.consequent=h,l.alternate=this.forwardNoArrowParamsConversionAt(l,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(l,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let t=this.parseMaybeAssignAllowIn(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:t,failed:i}}getArrowLikeExpressions(t,i){let a=[t],n=[];while(a.length!==0){let o=a.pop();if(o.type==="ArrowFunctionExpression"&&o.body.type!=="BlockStatement"){if(o.typeParameters||!o.returnType)this.finishArrowValidation(o);else n.push(o);a.push(o.body)}else if(o.type==="ConditionalExpression")a.push(o.consequent),a.push(o.alternate)}if(i)return n.forEach((o)=>this.finishArrowValidation(o)),[n,[]];return aa(n,(o)=>o.params.every((l)=>this.isAssignable(l,!0)))}finishArrowValidation(t){var i;this.toAssignableList(t.params,(i=t.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(t,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(t,i){let a;if(this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start)))this.state.noArrowParamsConversionAt.push(this.state.start),a=i(),this.state.noArrowParamsConversionAt.pop();else a=i();return a}parseParenItem(t,i){let a=super.parseParenItem(t,i);if(this.eat(17))a.optional=!0,this.resetEndLocation(t);if(this.match(14)){let n=this.startNodeAt(i);return n.expression=a,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return a}assertModuleNodeAllowed(t){if(t.type==="ImportDeclaration"&&(t.importKind==="type"||t.importKind==="typeof")||t.type==="ExportNamedDeclaration"&&t.exportKind==="type"||t.type==="ExportAllDeclaration"&&t.exportKind==="type")return;super.assertModuleNodeAllowed(t)}parseExportDeclaration(t){if(this.isContextual(130)){t.exportKind="type";let i=this.startNode();if(this.next(),this.match(5))return t.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(t),null;else return this.flowParseTypeAlias(i)}else if(this.isContextual(131)){t.exportKind="type";let i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(129)){t.exportKind="type";let i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.isContextual(126)){t.exportKind="value";let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(t)}eatExportStar(t){if(super.eatExportStar(t))return!0;if(this.isContextual(130)&&this.lookahead().type===55)return t.exportKind="type",this.next(),this.next(),!0;return!1}maybeParseExportNamespaceSpecifier(t){let{startLoc:i}=this.state,a=super.maybeParseExportNamespaceSpecifier(t);if(a&&t.exportKind==="type")this.unexpected(i);return a}parseClassId(t,i,a){if(super.parseClassId(t,i,a),this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration()}parseClassMember(t,i,a){let{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(t,i))return;i.declare=!0}if(super.parseClassMember(t,i,a),i.declare){if(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition")this.raise(A.DeclareClassElement,n);else if(i.value)this.raise(A.DeclareClassFieldInitializer,i.value)}}isIterator(t){return t==="iterator"||t==="asyncIterator"}readIterator(){let t=super.readWord1(),i="@@"+t;if(!this.isIterator(t)||!this.state.inType)this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:i});this.finishToken(132,i)}getTokenFromCode(t){let i=this.input.charCodeAt(this.state.pos+1);if(t===123&&i===124)this.finishOp(6,2);else if(this.state.inType&&(t===62||t===60))this.finishOp(t===62?48:47,1);else if(this.state.inType&&t===63)if(i===46)this.finishOp(18,2);else this.finishOp(17,1);else if(Zr(t,i,this.input.charCodeAt(this.state.pos+2)))this.state.pos+=2,this.readIterator();else super.getTokenFromCode(t)}isAssignable(t,i){if(t.type==="TypeCastExpression")return this.isAssignable(t.expression,i);else return super.isAssignable(t,i)}toAssignable(t,i=!1){if(!i&&t.type==="AssignmentExpression"&&t.left.type==="TypeCastExpression")t.left=this.typeCastToParameter(t.left);super.toAssignable(t,i)}toAssignableList(t,i,a){for(let n=0;n<t.length;n++){let o=t[n];if((o==null?void 0:o.type)==="TypeCastExpression")t[n]=this.typeCastToParameter(o)}super.toAssignableList(t,i,a)}toReferencedList(t,i){for(let n=0;n<t.length;n++){var a;let o=t[n];if(o&&o.type==="TypeCastExpression"&&!((a=o.extra)!=null&&a.parenthesized)&&(t.length>1||!i))this.raise(A.TypeCastInPattern,o.typeAnnotation)}return t}parseArrayLike(t,i,a){let n=super.parseArrayLike(t,i,a);if(a!=null&&!this.state.maybeInArrowParameters)this.toReferencedList(n.elements);return n}isValidLVal(t,i,a,n){return t==="TypeCastExpression"||super.isValidLVal(t,i,a,n)}parseClassProperty(t){if(this.match(14))t.typeAnnotation=this.flowParseTypeAnnotation();return super.parseClassProperty(t)}parseClassPrivateProperty(t){if(this.match(14))t.typeAnnotation=this.flowParseTypeAnnotation();return super.parseClassPrivateProperty(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(t){return!this.match(14)&&super.isNonstaticConstructor(t)}pushClassMethod(t,i,a,n,o,l){if(i.variance)this.unexpected(i.variance.loc.start);if(delete i.variance,this.match(47))i.typeParameters=this.flowParseTypeParameterDeclaration();if(super.pushClassMethod(t,i,a,n,o,l),i.params&&o){let h=i.params;if(h.length>0&&this.isThisParam(h[0]))this.raise(A.ThisParamBannedInConstructor,i)}else if(i.type==="MethodDefinition"&&o&&i.value.params){let h=i.value.params;if(h.length>0&&this.isThisParam(h[0]))this.raise(A.ThisParamBannedInConstructor,i)}}pushClassPrivateMethod(t,i,a,n){if(i.variance)this.unexpected(i.variance.loc.start);if(delete i.variance,this.match(47))i.typeParameters=this.flowParseTypeParameterDeclaration();super.pushClassPrivateMethod(t,i,a,n)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&(this.match(47)||this.match(51)))t.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression();if(this.isContextual(113)){this.next();let i=t.implements=[];do{let a=this.startNode();if(a.id=this.flowParseRestrictedIdentifier(!0),this.match(47))a.typeParameters=this.flowParseTypeParameterInstantiation();else a.typeParameters=null;i.push(this.finishNode(a,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(t){super.checkGetterSetterParams(t);let i=this.getObjectOrClassMethodParams(t);if(i.length>0){let a=i[0];if(this.isThisParam(a)&&t.kind==="get")this.raise(A.GetterMayNotHaveThisParam,a);else if(this.isThisParam(a))this.raise(A.SetterMayNotHaveThisParam,a)}}parsePropertyNamePrefixOperator(t){t.variance=this.flowParseVariance()}parseObjPropValue(t,i,a,n,o,l,h){if(t.variance)this.unexpected(t.variance.loc.start);delete t.variance;let c;if(this.match(47)&&!l){if(c=this.flowParseTypeParameterDeclaration(),!this.match(10))this.unexpected()}let u=super.parseObjPropValue(t,i,a,n,o,l,h);if(c)(u.value||u).typeParameters=c;return u}parseFunctionParamType(t){if(this.eat(17)){if(t.type!=="Identifier")this.raise(A.PatternIsOptional,t);if(this.isThisParam(t))this.raise(A.ThisParamMayNotBeOptional,t);t.optional=!0}if(this.match(14))t.typeAnnotation=this.flowParseTypeAnnotation();else if(this.isThisParam(t))this.raise(A.ThisParamAnnotationRequired,t);if(this.match(29)&&this.isThisParam(t))this.raise(A.ThisParamNoDefault,t);return this.resetEndLocation(t),t}parseMaybeDefault(t,i){let a=super.parseMaybeDefault(t,i);if(a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start)this.raise(A.TypeBeforeInitializer,a.typeAnnotation);return a}checkImportReflection(t){if(super.checkImportReflection(t),t.module&&t.importKind!=="value")this.raise(A.ImportReflectionHasImportType,t.specifiers[0].loc.start)}parseImportSpecifierLocal(t,i,a){i.local=bs(t)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(i,a))}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){if(!t)return!0;let i=this.lookaheadCharCode();return i===123||i===42}return!t&&this.isContextual(87)}applyImportPhase(t,i,a,n){if(super.applyImportPhase(t,i,a,n),i){if(!a&&this.match(65))return;t.exportKind=a==="type"?a:"value"}else{if(a==="type"&&this.match(55))this.unexpected();t.importKind=a==="type"||a==="typeof"?a:"value"}}parseImportSpecifier(t,i,a,n,o){let l=t.imported,h=null;if(l.type==="Identifier"){if(l.name==="type")h="type";else if(l.name==="typeof")h="typeof"}let c=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let d=this.parseIdentifier(!0);if(h!==null&&!q(this.state.type))t.imported=d,t.importKind=h,t.local=this.cloneIdentifier(d);else t.imported=l,t.importKind=null,t.local=this.parseIdentifier()}else{if(h!==null&&q(this.state.type))t.imported=this.parseIdentifier(!0),t.importKind=h;else{if(i)throw this.raise(p.ImportBindingIsString,t,{importName:l.value});t.imported=l,t.importKind=null}if(this.eatContextual(93))t.local=this.parseIdentifier();else c=!0,t.local=this.cloneIdentifier(t.imported)}let u=bs(t);if(a&&u)this.raise(A.ImportTypeShorthandOnlyInPureImport,t);if(a||u)this.checkReservedType(t.local.name,t.local.loc.start,!0);if(c&&!a&&!u)this.checkReservedWord(t.local.name,t.loc.start,!0,!0);return this.finishImportSpecifier(t,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(t,i){let a=t.kind;if(a!=="get"&&a!=="set"&&this.match(47))t.typeParameters=this.flowParseTypeParameterDeclaration();super.parseFunctionParams(t,i)}parseVarId(t,i){if(super.parseVarId(t,i),this.match(14))t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t.id)}parseAsyncArrowFromCallExpression(t,i){if(this.match(14)){let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=a}return super.parseAsyncArrowFromCallExpression(t,i)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(t,i){var a;let n=null,o;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(n=this.state.clone(),o=this.tryParse(()=>super.parseMaybeAssign(t,i),n),!o.error)return o.node;let{context:c}=this.state,u=c[c.length-1];if(u===E.j_oTag||u===E.j_expr)c.pop()}if((a=o)!=null&&a.error||this.match(47)){var l,h;n=n||this.state.clone();let c,u=this.tryParse((f)=>{var m;c=this.flowParseTypeParameterDeclaration();let x=this.forwardNoArrowParamsConversionAt(c,()=>{let S=super.parseMaybeAssign(t,i);return this.resetStartLocationFromNode(S,c),S});if((m=x.extra)!=null&&m.parenthesized)f();let T=this.maybeUnwrapTypeCastExpression(x);if(T.type!=="ArrowFunctionExpression")f();return T.typeParameters=c,this.resetStartLocationFromNode(T,c),x},n),d=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted){if(u.node.async)this.raise(A.UnexpectedTypeParameterBeforeAsyncArrowFunction,c);return u.node}d=u.node}if((l=o)!=null&&l.node)return this.state=o.failState,o.node;if(d)return this.state=u.failState,d;if((h=o)!=null&&h.thrown)throw o.error;if(u.thrown)throw u.error;throw this.raise(A.UnexpectedTokenAfterTypeParameter,c)}return super.parseMaybeAssign(t,i)}parseArrow(t){if(this.match(14)){let i=this.tryParse(()=>{let a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();if([n.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=a,this.canInsertSemicolon())this.unexpected();if(!this.match(19))this.unexpected();return n});if(i.thrown)return null;if(i.error)this.state=i.failState;t.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null}return super.parseArrow(t)}shouldParseArrow(t){return this.match(14)||super.shouldParseArrow(t)}setArrowFunctionParameters(t,i){if(this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start)))t.params=i;else super.setArrowFunctionParameters(t,i)}checkParams(t,i,a,n=!0){if(a&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start)))return;for(let o=0;o<t.params.length;o++)if(this.isThisParam(t.params[o])&&o>0)this.raise(A.ThisParamMustBeFirst,t.params[o]);super.checkParams(t,i,a,n)}parseParenAndDistinguishExpression(t){return super.parseParenAndDistinguishExpression(t&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(t,i,a){if(t.type==="Identifier"&&t.name==="async"&&this.state.noArrowAt.includes(i.index)){this.next();let n=this.startNodeAt(i);n.callee=t,n.arguments=super.parseCallExpressionArguments(),t=this.finishNode(n,"CallExpression")}else if(t.type==="Identifier"&&t.name==="async"&&this.match(47)){let n=this.state.clone(),o=this.tryParse((h)=>this.parseAsyncArrowWithTypeParameters(i)||h(),n);if(!o.error&&!o.aborted)return o.node;let l=this.tryParse(()=>super.parseSubscripts(t,i,a),n);if(l.node&&!l.error)return l.node;if(o.node)return this.state=o.failState,o.node;if(l.node)return this.state=l.failState,l.node;throw o.error||l.error}return super.parseSubscripts(t,i,a)}parseSubscript(t,i,a,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,a)return n.stop=!0,t;this.next();let o=this.startNodeAt(i);return o.callee=t,o.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),o.arguments=this.parseCallExpressionArguments(),o.optional=!0,this.finishCallExpression(o,!0)}else if(!a&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let o=this.startNodeAt(i);o.callee=t;let l=this.tryParse(()=>{if(o.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),o.arguments=super.parseCallExpressionArguments(),n.optionalChainMember)o.optional=!1;return this.finishCallExpression(o,n.optionalChainMember)});if(l.node){if(l.error)this.state=l.failState;return l.node}}return super.parseSubscript(t,i,a,n)}parseNewCallee(t){super.parseNewCallee(t);let i=null;if(this.shouldParseTypes()&&this.match(47))i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node;t.typeArguments=i}parseAsyncArrowWithTypeParameters(t){let i=this.startNodeAt(t);if(this.parseFunctionParams(i,!1),!this.parseArrow(i))return;return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(t){let i=this.input.charCodeAt(this.state.pos+1);if(t===42&&i===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(t)}readToken_pipe_amp(t){let i=this.input.charCodeAt(this.state.pos+1);if(t===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(t)}parseTopLevel(t,i){let a=super.parseTopLevel(t,i);if(this.state.hasFlowComment)this.raise(A.UnterminatedFlowComment,this.state.curPosition());return a}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(A.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let t=this.skipFlowComment();if(t)this.state.pos+=t,this.state.hasFlowComment=!0;return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:t}=this.state,i=2;while([32,9].includes(this.input.charCodeAt(t+i)))i++;let a=this.input.charCodeAt(i+t),n=this.input.charCodeAt(i+t+1);if(a===58&&n===58)return i+2;if(this.input.slice(i+t,i+t+12)==="flow-include")return i+12;if(a===58&&n!==58)return i;return!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(t,{enumName:i,memberName:a}){this.raise(A.EnumBooleanMemberNotInitialized,t,{memberName:a,enumName:i})}flowEnumErrorInvalidMemberInitializer(t,i){return this.raise(!i.explicitType?A.EnumInvalidMemberInitializerUnknownType:i.explicitType==="symbol"?A.EnumInvalidMemberInitializerSymbolType:A.EnumInvalidMemberInitializerPrimaryType,t,i)}flowEnumErrorNumberMemberNotInitialized(t,i){this.raise(A.EnumNumberMemberNotInitialized,t,i)}flowEnumErrorStringMemberInconsistentlyInitialized(t,i){this.raise(A.EnumStringMemberInconsistentlyInitialized,t,i)}flowEnumMemberInit(){let t=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let a=this.parseNumericLiteral(this.state.value);if(i())return{type:"number",loc:a.loc.start,value:a};return{type:"invalid",loc:t}}case 134:{let a=this.parseStringLiteral(this.state.value);if(i())return{type:"string",loc:a.loc.start,value:a};return{type:"invalid",loc:t}}case 85:case 86:{let a=this.parseBooleanLiteral(this.match(85));if(i())return{type:"boolean",loc:a.loc.start,value:a};return{type:"invalid",loc:t}}default:return{type:"invalid",loc:t}}}flowEnumMemberRaw(){let t=this.state.startLoc,i=this.parseIdentifier(!0),a=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:t};return{id:i,init:a}}flowEnumCheckExplicitTypeMismatch(t,i,a){let{explicitType:n}=i;if(n===null)return;if(n!==a)this.flowEnumErrorInvalidMemberInitializer(t,i)}flowEnumMembers({enumName:t,explicitType:i}){let a=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},o=!1;while(!this.match(8)){if(this.eat(21)){o=!0;break}let l=this.startNode(),{id:h,init:c}=this.flowEnumMemberRaw(),u=h.name;if(u==="")continue;if(/^[a-z]/.test(u))this.raise(A.EnumInvalidMemberName,h,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:t});if(a.has(u))this.raise(A.EnumDuplicateMemberName,h,{memberName:u,enumName:t});a.add(u);let d={enumName:t,explicitType:i,memberName:u};switch(l.id=h,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,d,"boolean"),l.init=c.value,n.booleanMembers.push(this.finishNode(l,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,d,"number"),l.init=c.value,n.numberMembers.push(this.finishNode(l,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,d,"string"),l.init=c.value,n.stringMembers.push(this.finishNode(l,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,d);case"none":switch(i){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,d);break;default:n.defaultedMembers.push(this.finishNode(l,"EnumDefaultedMember"))}}if(!this.match(8))this.expect(12)}return{members:n,hasUnknownMembers:o}}flowEnumStringMembers(t,i,{enumName:a}){if(t.length===0)return i;else if(i.length===0)return t;else if(i.length>t.length){for(let n of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return i}else{for(let n of i)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return t}}flowEnumParseExplicitType({enumName:t}){if(!this.eatContextual(102))return null;if(!N(this.state.type))throw this.raise(A.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:t});let{value:i}=this.state;if(this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol")this.raise(A.EnumInvalidExplicitType,this.state.startLoc,{enumName:t,invalidEnumType:i});return i}flowEnumBody(t,i){let a=i.name,n=i.loc.start,o=this.flowEnumParseExplicitType({enumName:a});this.expect(5);let{members:l,hasUnknownMembers:h}=this.flowEnumMembers({enumName:a,explicitType:o});switch(t.hasUnknownMembers=h,o){case"boolean":return t.explicitType=!0,t.members=l.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody");case"number":return t.explicitType=!0,t.members=l.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody");case"string":return t.explicitType=!0,t.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(t,"EnumStringBody");case"symbol":return t.members=l.defaultedMembers,this.expect(8),this.finishNode(t,"EnumSymbolBody");default:{let c=()=>(t.members=[],this.expect(8),this.finishNode(t,"EnumStringBody"));t.explicitType=!1;let u=l.booleanMembers.length,d=l.numberMembers.length,f=l.stringMembers.length,m=l.defaultedMembers.length;if(!u&&!d&&!f&&!m)return c();else if(!u&&!d)return t.members=this.flowEnumStringMembers(l.stringMembers,l.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(t,"EnumStringBody");else if(!d&&!f&&u>=m){for(let x of l.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(x.loc.start,{enumName:a,memberName:x.id.name});return t.members=l.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody")}else if(!u&&!f&&d>=m){for(let x of l.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(x.loc.start,{enumName:a,memberName:x.id.name});return t.members=l.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody")}else return this.raise(A.EnumInconsistentMemberValues,n,{enumName:a}),c()}}}flowParseEnumDeclaration(t){let i=this.parseIdentifier();return t.id=i,t.body=this.flowEnumBody(this.startNode(),i),this.finishNode(t,"EnumDeclaration")}jsxParseOpeningElementAfterName(t){if(this.shouldParseTypes()){if(this.match(47)||this.match(51))t.typeArguments=this.flowParseTypeParameterInstantiationInExpression()}return super.jsxParseOpeningElementAfterName(t)}isLookaheadToken_lt(){let t=this.nextTokenStart();if(this.input.charCodeAt(t)===60){let i=this.input.charCodeAt(t+1);return i!==60&&i!==61}return!1}reScan_lt_gt(){let{type:t}=this.state;if(t===47)this.state.pos-=1,this.readToken_lt();else if(t===48)this.state.pos-=1,this.readToken_gt()}reScan_lt(){let{type:t}=this.state;if(t===51)return this.state.pos-=2,this.finishOp(47,1),47;return t}maybeUnwrapTypeCastExpression(t){return t.type==="TypeCastExpression"?t.expression:t}},la={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},ha=/\r\n|[\r\n\u2028\u2029]/,ke=new RegExp(ha.source,"g");function pe(s){switch(s){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ts(s,r,t){for(let i=r;i<t;i++)if(pe(s.charCodeAt(i)))return!0;return!1}var Ye=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Qe=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function ca(s){switch(s){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var re=V`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:s})=>`Expected corresponding JSX closing tag for <${s}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:s,HTMLEntity:r})=>`Unexpected token \`${s}\`. Did you mean \`${r}\` or \`{'${s}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function Z(s){return s?s.type==="JSXOpeningFragment"||s.type==="JSXClosingFragment":!1}function ue(s){if(s.type==="JSXIdentifier")return s.name;if(s.type==="JSXNamespacedName")return s.namespace.name+":"+s.name.name;if(s.type==="JSXMemberExpression")return ue(s.object)+"."+ue(s.property);throw Error("Node had unexpected type: "+s.type)}var ua=(s)=>class extends s{jsxReadToken(){let t="",i=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(re.UnterminatedJsxContent,this.state.startLoc);let a=this.input.charCodeAt(this.state.pos);switch(a){case 60:case 123:if(this.state.pos===this.state.start){if(a===60&&this.state.canStartJSXElement)++this.state.pos,this.finishToken(143);else super.getTokenFromCode(a);return}t+=this.input.slice(i,this.state.pos),this.finishToken(142,t);return;case 38:t+=this.input.slice(i,this.state.pos),t+=this.jsxReadEntity(),i=this.state.pos;break;case 62:case 125:default:if(pe(a))t+=this.input.slice(i,this.state.pos),t+=this.jsxReadNewLine(!0),i=this.state.pos;else++this.state.pos}}}jsxReadNewLine(t){let i=this.input.charCodeAt(this.state.pos),a;if(++this.state.pos,i===13&&this.input.charCodeAt(this.state.pos)===10)++this.state.pos,a=t?`
|
|
5
|
+
`:`\r
|
|
6
|
+
`;else a=String.fromCharCode(i);return++this.state.curLine,this.state.lineStart=this.state.pos,a}jsxReadString(t){let i="",a=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);if(n===t)break;if(n===38)i+=this.input.slice(a,this.state.pos),i+=this.jsxReadEntity(),a=this.state.pos;else if(pe(n))i+=this.input.slice(a,this.state.pos),i+=this.jsxReadNewLine(!1),a=this.state.pos;else++this.state.pos}i+=this.input.slice(a,this.state.pos++),this.finishToken(134,i)}jsxReadEntity(){let t=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let i=10;if(this.codePointAtPos(this.state.pos)===120)i=16,++this.state.pos;let a=this.readInt(i,void 0,!1,"bail");if(a!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(a)}else{let i=0,a=!1;while(i++<10&&this.state.pos<this.length&&!(a=this.codePointAtPos(this.state.pos)===59))++this.state.pos;if(a){let n=this.input.slice(t,this.state.pos),o=la[n];if(++this.state.pos,o)return o}}return this.state.pos=t,"&"}jsxReadWord(){let t,i=this.state.pos;do t=this.input.charCodeAt(++this.state.pos);while(ae(t)||t===45);this.finishToken(141,this.input.slice(i,this.state.pos))}jsxParseIdentifier(){let t=this.startNode();if(this.match(141))t.name=this.state.value;else if(ft(this.state.type))t.name=ee(this.state.type);else this.unexpected();return this.next(),this.finishNode(t,"JSXIdentifier")}jsxParseNamespacedName(){let t=this.state.startLoc,i=this.jsxParseIdentifier();if(!this.eat(14))return i;let a=this.startNodeAt(t);return a.namespace=i,a.name=this.jsxParseIdentifier(),this.finishNode(a,"JSXNamespacedName")}jsxParseElementName(){let t=this.state.startLoc,i=this.jsxParseNamespacedName();if(i.type==="JSXNamespacedName")return i;while(this.eat(16)){let a=this.startNodeAt(t);a.object=i,a.property=this.jsxParseIdentifier(),i=this.finishNode(a,"JSXMemberExpression")}return i}jsxParseAttributeValue(){let t;switch(this.state.type){case 5:if(t=this.startNode(),this.setContext(E.brace),this.next(),t=this.jsxParseExpressionContainer(t,E.j_oTag),t.expression.type==="JSXEmptyExpression")this.raise(re.AttributeIsEmpty,t);return t;case 143:case 134:return this.parseExprAtom();default:throw this.raise(re.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let t=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(t){return this.next(),t.expression=this.parseExpression(),this.setContext(E.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadChild")}jsxParseExpressionContainer(t,i){if(this.match(8))t.expression=this.jsxParseEmptyExpression();else{let a=this.parseExpression();t.expression=a}return this.setContext(i),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXExpressionContainer")}jsxParseAttribute(){let t=this.startNode();if(this.match(5))return this.setContext(E.brace),this.next(),this.expect(21),t.argument=this.parseMaybeAssignAllowIn(),this.setContext(E.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(t,"JSXSpreadAttribute");return t.name=this.jsxParseNamespacedName(),t.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(t,"JSXAttribute")}jsxParseOpeningElementAt(t){let i=this.startNodeAt(t);if(this.eat(144))return this.finishNode(i,"JSXOpeningFragment");return i.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(i)}jsxParseOpeningElementAfterName(t){let i=[];while(!this.match(56)&&!this.match(144))i.push(this.jsxParseAttribute());return t.attributes=i,t.selfClosing=this.eat(56),this.expect(144),this.finishNode(t,"JSXOpeningElement")}jsxParseClosingElementAt(t){let i=this.startNodeAt(t);if(this.eat(144))return this.finishNode(i,"JSXClosingFragment");return i.name=this.jsxParseElementName(),this.expect(144),this.finishNode(i,"JSXClosingElement")}jsxParseElementAt(t){let i=this.startNodeAt(t),a=[],n=this.jsxParseOpeningElementAt(t),o=null;if(!n.selfClosing){e:for(;;)switch(this.state.type){case 143:if(t=this.state.startLoc,this.next(),this.eat(56)){o=this.jsxParseClosingElementAt(t);break e}a.push(this.jsxParseElementAt(t));break;case 142:a.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let l=this.startNode();if(this.setContext(E.brace),this.next(),this.match(21))a.push(this.jsxParseSpreadChild(l));else a.push(this.jsxParseExpressionContainer(l,E.j_expr));break}default:this.unexpected()}if(Z(n)&&!Z(o)&&o!==null)this.raise(re.MissingClosingTagFragment,o);else if(!Z(n)&&Z(o))this.raise(re.MissingClosingTagElement,o,{openingTagName:ue(n.name)});else if(!Z(n)&&!Z(o)){if(ue(o.name)!==ue(n.name))this.raise(re.MissingClosingTagElement,o,{openingTagName:ue(n.name)})}}if(Z(n))i.openingFragment=n,i.closingFragment=o;else i.openingElement=n,i.closingElement=o;if(i.children=a,this.match(47))throw this.raise(re.UnwrappedAdjacentJSXElements,this.state.startLoc);return Z(n)?this.finishNode(i,"JSXFragment"):this.finishNode(i,"JSXElement")}jsxParseElement(){let t=this.state.startLoc;return this.next(),this.jsxParseElementAt(t)}setContext(t){let{context:i}=this.state;i[i.length-1]=t}parseExprAtom(t){if(this.match(143))return this.jsxParseElement();else if(this.match(47)&&this.input.charCodeAt(this.state.pos)!==33)return this.replaceToken(143),this.jsxParseElement();else return super.parseExprAtom(t)}skipSpace(){if(!this.curContext().preserveSpace)super.skipSpace()}getTokenFromCode(t){let i=this.curContext();if(i===E.j_expr){this.jsxReadToken();return}if(i===E.j_oTag||i===E.j_cTag){if(H(t)){this.jsxReadWord();return}if(t===62){++this.state.pos,this.finishToken(144);return}if((t===34||t===39)&&i===E.j_oTag){this.jsxReadString(t);return}}if(t===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(t)}updateContext(t){let{context:i,type:a}=this.state;if(a===56&&t===143)i.splice(-2,2,E.j_cTag),this.state.canStartJSXElement=!1;else if(a===143)i.push(E.j_oTag);else if(a===144){let n=i[i.length-1];if(n===E.j_oTag&&t===56||n===E.j_cTag)i.pop(),this.state.canStartJSXElement=i[i.length-1]===E.j_expr;else this.setContext(E.j_expr),this.state.canStartJSXElement=!0}else this.state.canStartJSXElement=Br(a)}};class Us extends Fe{constructor(...s){super(...s);this.tsNames=new Map}}class js extends Re{constructor(...s){super(...s);this.importsStack=[]}createScope(s){return this.importsStack.push(new Set),new Us(s)}enter(s){if(s===1024)this.importsStack.push(new Set);super.enter(s)}exit(){let s=super.exit();if(s===1024)this.importsStack.pop();return s}hasImport(s,r){let t=this.importsStack.length;if(this.importsStack[t-1].has(s))return!0;if(!r&&t>1){for(let i=0;i<t-1;i++)if(this.importsStack[i].has(s))return!0}return!1}declareName(s,r,t){if(r&4096){if(this.hasImport(s,!0))this.parser.raise(p.VarRedeclaration,t,{identifierName:s});this.importsStack[this.importsStack.length-1].add(s);return}let i=this.currentScope(),a=i.tsNames.get(s)||0;if(r&1024){this.maybeExportDefined(i,s),i.tsNames.set(s,a|16);return}if(super.declareName(s,r,t),r&2){if(!(r&1))this.checkRedeclarationInScope(i,s,r,t),this.maybeExportDefined(i,s);a=a|1}if(r&256)a=a|2;if(r&512)a=a|4;if(r&128)a=a|8;if(a)i.tsNames.set(s,a)}isRedeclaredInScope(s,r,t){let i=s.tsNames.get(r);if((i&2)>0){if(t&256){let a=!!(t&512),n=(i&4)>0;return a!==n}return!0}if(t&128&&(i&8)>0)if(s.names.get(r)&2)return!!(t&1);else return!1;if(t&2&&(i&1)>0)return!0;return super.isRedeclaredInScope(s,r,t)}checkLocalExport(s){let{name:r}=s;if(this.hasImport(r))return;let t=this.scopeStack.length;for(let i=t-1;i>=0;i--){let n=this.scopeStack[i].tsNames.get(r);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(s)}}class $s{constructor(){this.stacks=[]}enter(s){this.stacks.push(s)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}}function De(s,r){return(s?2:0)|(r?1:0)}class Vs{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(s){return s+this.startIndex}offsetToSourcePos(s){return s-this.startIndex}hasPlugin(s){if(typeof s==="string")return this.plugins.has(s);else{let[r,t]=s;if(!this.hasPlugin(r))return!1;let i=this.plugins.get(r);for(let a of Object.keys(t))if((i==null?void 0:i[a])!==t[a])return!1;return!0}}getPluginOption(s,r){var t;return(t=this.plugins.get(s))==null?void 0:t[r]}}function qs(s,r){if(s.trailingComments===void 0)s.trailingComments=r;else s.trailingComments.unshift(...r)}function pa(s,r){if(s.leadingComments===void 0)s.leadingComments=r;else s.leadingComments.unshift(...r)}function Ce(s,r){if(s.innerComments===void 0)s.innerComments=r;else s.innerComments.unshift(...r)}function j(s,r,t){let i=null,a=r.length;while(i===null&&a>0)i=r[--a];if(i===null||i.start>t.start)Ce(s,t.comments);else qs(i,t.comments)}class zs extends Vs{addComment(s){if(this.filename)s.loc.filename=this.filename;let{commentsLen:r}=this.state;if(this.comments.length!==r)this.comments.length=r;this.comments.push(s),this.state.commentsLen++}processComment(s){let{commentStack:r}=this.state,t=r.length;if(t===0)return;let i=t-1,a=r[i];if(a.start===s.end)a.leadingNode=s,i--;let{start:n}=s;for(;i>=0;i--){let o=r[i],l=o.end;if(l>n)o.containingNode=s,this.finalizeComment(o),r.splice(i,1);else{if(l===n)o.trailingNode=s;break}}}finalizeComment(s){var r;let{comments:t}=s;if(s.leadingNode!==null||s.trailingNode!==null){if(s.leadingNode!==null)qs(s.leadingNode,t);if(s.trailingNode!==null)pa(s.trailingNode,t)}else{let{containingNode:i,start:a}=s;if(this.input.charCodeAt(this.offsetToSourcePos(a)-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":j(i,i.properties,s);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":j(i,i.arguments,s);break;case"ImportExpression":j(i,[i.source,(r=i.options)!=null?r:null],s);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":j(i,i.params,s);break;case"ArrayExpression":case"ArrayPattern":j(i,i.elements,s);break;case"ExportNamedDeclaration":case"ImportDeclaration":j(i,i.specifiers,s);break;case"TSEnumDeclaration":j(i,i.members,s);break;case"TSEnumBody":j(i,i.members,s);break;case"TSInterfaceBody":j(i,i.body,s);break;default:{if(i.type==="RecordExpression"){j(i,i.properties,s);break}if(i.type==="TupleExpression"){j(i,i.elements,s);break}Ce(i,t)}}else Ce(i,t)}}finalizeRemainingComments(){let{commentStack:s}=this.state;for(let r=s.length-1;r>=0;r--)this.finalizeComment(s[r]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(s){let{commentStack:r}=this.state,{length:t}=r;if(t===0)return;let i=r[t-1];if(i.leadingNode===s)i.leadingNode=null}takeSurroundingComments(s,r,t){let{commentStack:i}=this.state,a=i.length;if(a===0)return;let n=a-1;for(;n>=0;n--){let o=i[n],l=o.end;if(o.start===t)o.leadingNode=s;else if(l===r)o.trailingNode=s;else if(l<r)break}}}class yt{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[E.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(s){if(s)this.flags|=1;else this.flags&=-2}init({strictMode:s,sourceType:r,startIndex:t,startLine:i,startColumn:a}){this.strict=s===!1?!1:s===!0?!0:r==="module",this.startIndex=t,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new X(i,a,t)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(s){if(s)this.flags|=2;else this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(s){if(s)this.flags|=4;else this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(s){if(s)this.flags|=8;else this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(s){if(s)this.flags|=16;else this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(s){if(s)this.flags|=32;else this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(s){if(s)this.flags|=64;else this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(s){if(s)this.flags|=128;else this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(s){if(s)this.flags|=256;else this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(s){if(s)this.flags|=512;else this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(s){if(s)this.flags|=1024;else this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(s){if(s)this.flags|=2048;else this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(s){if(s)this.flags|=4096;else this.flags&=-4097}curPosition(){return new X(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let s=new yt;return s.flags=this.flags,s.startIndex=this.startIndex,s.curLine=this.curLine,s.lineStart=this.lineStart,s.startLoc=this.startLoc,s.endLoc=this.endLoc,s.errors=this.errors.slice(),s.potentialArrowAt=this.potentialArrowAt,s.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),s.topicContext=this.topicContext,s.labels=this.labels.slice(),s.commentsLen=this.commentsLen,s.commentStack=this.commentStack.slice(),s.pos=this.pos,s.type=this.type,s.value=this.value,s.start=this.start,s.end=this.end,s.lastTokEndLoc=this.lastTokEndLoc,s.lastTokStartLoc=this.lastTokStartLoc,s.context=this.context.slice(),s.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,s.strictErrors=this.strictErrors,s.tokensLength=this.tokensLength,s}}var fa=function(r){return r>=48&&r<=57},As={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Le={bin:(s)=>s===48||s===49,oct:(s)=>s>=48&&s<=55,dec:(s)=>s>=48&&s<=57,hex:(s)=>s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102};function Ss(s,r,t,i,a,n){let o=t,l=i,h=a,c="",u=null,d=t,{length:f}=r;for(;;){if(t>=f){n.unterminated(o,l,h),c+=r.slice(d,t);break}let m=r.charCodeAt(t);if(da(s,m,r,t)){c+=r.slice(d,t);break}if(m===92){c+=r.slice(d,t);let x=ma(r,t,i,a,s==="template",n);if(x.ch===null&&!u)u={pos:t,lineStart:i,curLine:a};else c+=x.ch;({pos:t,lineStart:i,curLine:a}=x),d=t}else if(m===8232||m===8233)++t,++a,i=t;else if(m===10||m===13)if(s==="template"){if(c+=r.slice(d,t)+`
|
|
7
|
+
`,++t,m===13&&r.charCodeAt(t)===10)++t;++a,d=i=t}else n.unterminated(o,l,h);else++t}return{pos:t,str:c,firstInvalidLoc:u,lineStart:i,curLine:a,containsInvalid:!!u}}function da(s,r,t,i){if(s==="template")return r===96||r===36&&t.charCodeAt(i+1)===123;return r===(s==="double"?34:39)}function ma(s,r,t,i,a,n){let o=!a;r++;let l=(c)=>({pos:r,ch:c,lineStart:t,curLine:i}),h=s.charCodeAt(r++);switch(h){case 110:return l(`
|
|
8
|
+
`);case 114:return l("\r");case 120:{let c;return{code:c,pos:r}=it(s,r,t,i,2,!1,o,n),l(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:r}=Ks(s,r,t,i,o,n),l(c===null?null:String.fromCodePoint(c))}case 116:return l("\t");case 98:return l("\b");case 118:return l("\v");case 102:return l("\f");case 13:if(s.charCodeAt(r)===10)++r;case 10:t=r,++i;case 8232:case 8233:return l("");case 56:case 57:if(a)return l(null);else n.strictNumericEscape(r-1,t,i);default:if(h>=48&&h<=55){let c=r-1,d=/^[0-7]+/.exec(s.slice(c,r+2))[0],f=parseInt(d,8);if(f>255)d=d.slice(0,-1),f=parseInt(d,8);r+=d.length-1;let m=s.charCodeAt(r);if(d!=="0"||m===56||m===57)if(a)return l(null);else n.strictNumericEscape(c,t,i);return l(String.fromCharCode(f))}return l(String.fromCharCode(h))}}function it(s,r,t,i,a,n,o,l){let h=r,c;if({n:c,pos:r}=Hs(s,r,t,i,16,a,n,!1,l,!o),c===null)if(o)l.invalidEscapeSequence(h,t,i);else r=h-1;return{code:c,pos:r}}function Hs(s,r,t,i,a,n,o,l,h,c){let u=r,d=a===16?As.hex:As.decBinOct,f=a===16?Le.hex:a===10?Le.dec:a===8?Le.oct:Le.bin,m=!1,x=0;for(let T=0,S=n==null?1/0:n;T<S;++T){let C=s.charCodeAt(r),k;if(C===95&&l!=="bail"){let z=s.charCodeAt(r-1),B=s.charCodeAt(r+1);if(!l){if(c)return{n:null,pos:r};h.numericSeparatorInEscapeSequence(r,t,i)}else if(Number.isNaN(B)||!f(B)||d.has(z)||d.has(B)){if(c)return{n:null,pos:r};h.unexpectedNumericSeparator(r,t,i)}++r;continue}if(C>=97)k=C-97+10;else if(C>=65)k=C-65+10;else if(fa(C))k=C-48;else k=1/0;if(k>=a)if(k<=9&&c)return{n:null,pos:r};else if(k<=9&&h.invalidDigit(r,t,i,a))k=0;else if(o)k=0,m=!0;else break;++r,x=x*a+k}if(r===u||n!=null&&r-u!==n||m)return{n:null,pos:r};return{n:x,pos:r}}function Ks(s,r,t,i,a,n){let o=s.charCodeAt(r),l;if(o===123){if(++r,{code:l,pos:r}=it(s,r,t,i,s.indexOf("}",r)-r,!0,a,n),++r,l!==null&&l>1114111)if(a)n.invalidCodePoint(r,t,i);else return{code:null,pos:r}}else({code:l,pos:r}=it(s,r,t,i,4,!1,a,n));return{code:l,pos:r}}function ge(s,r,t){return new X(t,s-r,s)}var ya=new Set([103,109,115,105,121,117,100,118]);class J{constructor(s){let r=s.startIndex||0;this.type=s.type,this.value=s.value,this.start=r+s.start,this.end=r+s.end,this.loc=new Se(s.startLoc,s.endLoc)}}class Ws extends zs{constructor(s,r){super();this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,i,a,n)=>{if(!(this.optionFlags&2048))return!1;return this.raise(p.InvalidDigit,ge(t,i,a),{radix:n}),!0},numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,i,a)=>{this.recordStrictModeErrors(p.StrictNumericEscape,ge(t,i,a))},unterminated:(t,i,a)=>{throw this.raise(p.UnterminatedString,ge(t-1,i,a))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(t,i,a)=>{throw this.raise(p.UnterminatedTemplate,ge(t,i,a))}}),this.state=new yt,this.state.init(s),this.input=r,this.length=r.length,this.comments=[],this.isLookahead=!1}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){if(this.checkKeywordEscapes(),this.optionFlags&256)this.pushToken(new J(this.state));this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(s){if(this.match(s))return this.next(),!0;else return!1}match(s){return this.state.type===s}createLookaheadState(s){return{pos:s.pos,value:null,type:s.type,start:s.start,end:s.end,context:[this.curContext()],inType:s.inType,startLoc:s.startLoc,lastTokEndLoc:s.lastTokEndLoc,curLine:s.curLine,lineStart:s.lineStart,curPosition:s.curPosition}}lookahead(){let s=this.state;this.state=this.createLookaheadState(s),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let r=this.state;return this.state=s,r}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(s){return Ye.lastIndex=s,Ye.test(this.input)?Ye.lastIndex:s}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(s){return this.input.charCodeAt(this.nextTokenStartSince(s))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return Qe.lastIndex=s,Qe.test(this.input)?Qe.lastIndex:s}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(s){let r=this.input.charCodeAt(s);if((r&64512)===55296&&++s<this.input.length){let t=this.input.charCodeAt(s);if((t&64512)===56320)r=65536+((r&1023)<<10)+(t&1023)}return r}setStrict(s){if(this.state.strict=s,s)this.state.strictErrors.forEach(([r,t])=>this.raise(r,t)),this.state.strictErrors.clear()}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,!this.isLookahead)this.state.startLoc=this.state.curPosition();if(this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(s){let r;if(!this.isLookahead)r=this.state.curPosition();let t=this.state.pos,i=this.input.indexOf(s,t+2);if(i===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());this.state.pos=i+s.length,ke.lastIndex=t+2;while(ke.test(this.input)&&ke.lastIndex<=i)++this.state.curLine,this.state.lineStart=ke.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(t+2,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i+s.length),loc:new Se(r,this.state.curPosition())};if(this.optionFlags&256)this.pushToken(a);return a}skipLineComment(s){let r=this.state.pos,t;if(!this.isLookahead)t=this.state.curPosition();let i=this.input.charCodeAt(this.state.pos+=s);if(this.state.pos<this.length)while(!pe(i)&&++this.state.pos<this.length)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,o={type:"CommentLine",value:this.input.slice(r+s,a),start:this.sourceToOffsetPos(r),end:this.sourceToOffsetPos(a),loc:new Se(t,this.state.curPosition())};if(this.optionFlags&256)this.pushToken(o);return o}skipSpace(){let s=this.state.pos,r=this.optionFlags&4096?[]:null;e:while(this.state.pos<this.length){let t=this.input.charCodeAt(this.state.pos);switch(t){case 32:case 160:case 9:++this.state.pos;break;case 13:if(this.input.charCodeAt(this.state.pos+1)===10)++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let i=this.skipBlockComment("*/");if(i!==void 0)this.addComment(i),r==null||r.push(i);break}case 47:{let i=this.skipLineComment(2);if(i!==void 0)this.addComment(i),r==null||r.push(i);break}default:break e}break;default:if(ca(t))++this.state.pos;else if(t===45&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(s===0||this.state.lineStart>s)){let a=this.skipLineComment(3);if(a!==void 0)this.addComment(a),r==null||r.push(a)}else break e}else if(t===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let a=this.skipLineComment(4);if(a!==void 0)this.addComment(a),r==null||r.push(a)}else break e}else break e}}if((r==null?void 0:r.length)>0){let t=this.state.pos,i={start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(t),comments:r,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(s,r){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;if(this.state.type=s,this.state.value=r,!this.isLookahead)this.updateContext(t)}replaceToken(s){this.state.type=s,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let s=this.state.pos+1,r=this.codePointAtPos(s);if(r>=48&&r<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());if(r===123||r===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(r===123?p.RecordExpressionHashIncorrectStartSyntaxType:p.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());if(this.state.pos+=2,r===123)this.finishToken(7);else this.finishToken(1)}else if(H(r))++this.state.pos,this.finishToken(139,this.readWord1(r));else if(r===92)++this.state.pos,this.finishToken(139,this.readWord1());else this.finishOp(27,1)}readToken_dot(){let s=this.input.charCodeAt(this.state.pos+1);if(s>=48&&s<=57){this.readNumber(!0);return}if(s===46&&this.input.charCodeAt(this.state.pos+2)===46)this.state.pos+=3,this.finishToken(21);else++this.state.pos,this.finishToken(16)}readToken_slash(){if(this.input.charCodeAt(this.state.pos+1)===61)this.finishOp(31,2);else this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let s=this.input.charCodeAt(this.state.pos+1);if(s!==33)return!1;let r=this.state.pos;this.state.pos+=1;while(!pe(s)&&++this.state.pos<this.length)s=this.input.charCodeAt(this.state.pos);let t=this.input.slice(r+2,this.state.pos);return this.finishToken(28,t),!0}readToken_mult_modulo(s){let r=s===42?55:54,t=1,i=this.input.charCodeAt(this.state.pos+1);if(s===42&&i===42)t++,i=this.input.charCodeAt(this.state.pos+2),r=57;if(i===61&&!this.state.inType)t++,r=s===37?33:30;this.finishOp(r,t)}readToken_pipe_amp(s){let r=this.input.charCodeAt(this.state.pos+1);if(r===s){if(this.input.charCodeAt(this.state.pos+2)===61)this.finishOp(30,3);else this.finishOp(s===124?41:42,2);return}if(s===124){if(r===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&r===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&r===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(r===61){this.finishOp(30,2);return}this.finishOp(s===124?43:45,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);if(s===61&&!this.state.inType)this.finishOp(32,2);else if(s===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])){if(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94)this.unexpected()}else this.finishOp(44,1)}readToken_atSign(){if(this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}]))this.finishOp(38,2);else this.finishOp(26,1)}readToken_plus_min(s){let r=this.input.charCodeAt(this.state.pos+1);if(r===s){this.finishOp(34,2);return}if(r===61)this.finishOp(30,2);else this.finishOp(53,1)}readToken_lt(){let{pos:s}=this.state,r=this.input.charCodeAt(s+1);if(r===60){if(this.input.charCodeAt(s+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(r===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:s}=this.state,r=this.input.charCodeAt(s+1);if(r===62){let t=this.input.charCodeAt(s+2)===62?3:2;if(this.input.charCodeAt(s+t)===61){this.finishOp(30,t+1);return}this.finishOp(52,t);return}if(r===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(s){let r=this.input.charCodeAt(this.state.pos+1);if(r===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(s===61&&r===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(s===61?29:35,1)}readToken_question(){let s=this.input.charCodeAt(this.state.pos+1),r=this.input.charCodeAt(this.state.pos+2);if(s===63)if(r===61)this.finishOp(30,3);else this.finishOp(40,2);else if(s===46&&!(r>=48&&r<=57))this.state.pos+=2,this.finishToken(18);else++this.state.pos,this.finishToken(17)}getTokenFromCode(s){switch(s){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(p.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:if(this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58)this.finishOp(15,2);else++this.state.pos,this.finishToken(14);return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let r=this.input.charCodeAt(this.state.pos+1);if(r===120||r===88){this.readRadixNumber(16);return}if(r===111||r===79){this.readRadixNumber(8);return}if(r===98||r===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(s);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(s);return;case 124:case 38:this.readToken_pipe_amp(s);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(s);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(s);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(H(s)){this.readWord(s);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(s)})}finishOp(s,r){let t=this.input.slice(this.state.pos,this.state.pos+r);this.state.pos+=r,this.finishToken(s,t)}readRegexp(){let s=this.state.startLoc,r=this.state.start+1,t,i,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(p.UnterminatedRegExp,_(s,1));let h=this.input.charCodeAt(a);if(pe(h))throw this.raise(p.UnterminatedRegExp,_(s,1));if(t)t=!1;else{if(h===91)i=!0;else if(h===93&&i)i=!1;else if(h===47&&!i)break;t=h===92}}let n=this.input.slice(r,a);++a;let o="",l=()=>_(s,a+2-r);while(a<this.length){let h=this.codePointAtPos(a),c=String.fromCharCode(h);if(ya.has(h)){if(h===118){if(o.includes("u"))this.raise(p.IncompatibleRegExpUVFlags,l())}else if(h===117){if(o.includes("v"))this.raise(p.IncompatibleRegExpUVFlags,l())}if(o.includes(c))this.raise(p.DuplicateRegExpFlags,l())}else if(ae(h)||h===92)this.raise(p.MalformedRegExpFlags,l());else break;++a,o+=c}this.state.pos=a,this.finishToken(138,{pattern:n,flags:o})}readInt(s,r,t=!1,i=!0){let{n:a,pos:n}=Hs(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,r,t,i,this.errorHandlers_readInt,!1);return this.state.pos=n,a}readRadixNumber(s){let r=this.state.pos,t=this.state.curPosition(),i=!1;this.state.pos+=2;let a=this.readInt(s);if(a==null)this.raise(p.InvalidDigit,_(t,2),{radix:s});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,i=!0;else if(n===109)throw this.raise(p.InvalidDecimal,t);if(H(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());if(i){let o=this.input.slice(r,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,o);return}this.finishToken(135,a)}readNumber(s){let r=this.state.pos,t=this.state.curPosition(),i=!1,a=!1,n=!1,o=!1;if(!s&&this.readInt(10)===null)this.raise(p.InvalidNumber,this.state.curPosition());let l=this.state.pos-r>=2&&this.input.charCodeAt(r)===48;if(l){let f=this.input.slice(r,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,t),!this.state.strict){let m=f.indexOf("_");if(m>0)this.raise(p.ZeroDigitNumericSeparator,_(t,m))}o=l&&!/[89]/.test(f)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!o)++this.state.pos,this.readInt(10),i=!0,h=this.input.charCodeAt(this.state.pos);if((h===69||h===101)&&!o){if(h=this.input.charCodeAt(++this.state.pos),h===43||h===45)++this.state.pos;if(this.readInt(10)===null)this.raise(p.InvalidOrMissingExponent,t);i=!0,n=!0,h=this.input.charCodeAt(this.state.pos)}if(h===110){if(i||l)this.raise(p.InvalidBigIntLiteral,t);++this.state.pos,a=!0}if(h===109){if(this.expectPlugin("decimal",this.state.curPosition()),n||l)this.raise(p.InvalidDecimal,t);++this.state.pos;var c=!0}if(H(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());let u=this.input.slice(r,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(136,u);return}if(c){this.finishToken(137,u);return}let d=o?parseInt(u,8):parseFloat(u);this.finishToken(135,d)}readCodePoint(s){let{code:r,pos:t}=Ks(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,this.errorHandlers_readCodePoint);return this.state.pos=t,r}readString(s){let{str:r,pos:t,curLine:i,lineStart:a}=Ss(s===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=t+1,this.state.lineStart=a,this.state.curLine=i,this.finishToken(134,r)}readTemplateContinuation(){if(!this.match(8))this.unexpected(null,8);this.state.pos--,this.readTemplateToken()}readTemplateToken(){let s=this.input[this.state.pos],{str:r,firstInvalidLoc:t,pos:i,curLine:a,lineStart:n}=Ss("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);if(this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=a,t)this.state.firstInvalidTemplateEscapePos=new X(t.curLine,t.pos-t.lineStart,this.sourceToOffsetPos(t.pos));if(this.input.codePointAt(i)===96)this.finishToken(24,t?null:s+r+"`");else this.state.pos++,this.finishToken(25,t?null:s+r+"${")}recordStrictModeErrors(s,r){let t=r.index;if(this.state.strict&&!this.state.strictErrors.has(t))this.raise(s,r);else this.state.strictErrors.set(t,[s,r])}readWord1(s){this.state.containsEsc=!1;let r="",t=this.state.pos,i=this.state.pos;if(s!==void 0)this.state.pos+=s<=65535?1:2;while(this.state.pos<this.length){let a=this.codePointAtPos(this.state.pos);if(ae(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,r+=this.input.slice(i,this.state.pos);let n=this.state.curPosition(),o=this.state.pos===t?H:ae;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(p.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);if(l!==null){if(!o(l))this.raise(p.EscapedCharNotAnIdentifier,n);r+=String.fromCodePoint(l)}i=this.state.pos}else break}return r+this.input.slice(i,this.state.pos)}readWord(s){let r=this.readWord1(s),t=ot.get(r);if(t!==void 0)this.finishToken(t,ee(t));else this.finishToken(132,r)}checkKeywordEscapes(){let{type:s}=this.state;if(ft(s)&&this.state.containsEsc)this.raise(p.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:ee(s)})}raise(s,r,t={}){let i=r instanceof X?r:r.loc.start,a=s(i,t);if(!(this.optionFlags&2048))throw a;if(!this.isLookahead)this.state.errors.push(a);return a}raiseOverwrite(s,r,t={}){let i=r instanceof X?r:r.loc.start,a=i.index,n=this.state.errors;for(let o=n.length-1;o>=0;o--){let l=n[o];if(l.loc.index===a)return n[o]=s(i,t);if(l.loc.index<a)break}return this.raise(s,r,t)}updateContext(s){}unexpected(s,r){throw this.raise(p.UnexpectedToken,s!=null?s:this.state.startLoc,{expected:r?ee(r):null})}expectPlugin(s,r){if(this.hasPlugin(s))return!0;throw this.raise(p.MissingPlugin,r!=null?r:this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some((r)=>this.hasPlugin(r)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(r,t,i)=>{this.raise(s,ge(r,t,i))}}}class Gs{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class Js{constructor(s){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=s}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Gs)}exit(){let s=this.stack.pop(),r=this.current();for(let[t,i]of Array.from(s.undefinedPrivateNames))if(r){if(!r.undefinedPrivateNames.has(t))r.undefinedPrivateNames.set(t,i)}else this.parser.raise(p.InvalidPrivateFieldResolution,i,{identifierName:t})}declarePrivateName(s,r,t){let{privateNames:i,loneAccessors:a,undefinedPrivateNames:n}=this.current(),o=i.has(s);if(r&3){let l=o&&a.get(s);if(l){let h=l&4,c=r&4,u=l&3,d=r&3;if(o=u===d||h!==c,!o)a.delete(s)}else if(!o)a.set(s,r)}if(o)this.parser.raise(p.PrivateNameRedeclaration,t,{identifierName:s});i.add(s),n.delete(s)}usePrivateName(s,r){let t;for(t of this.stack)if(t.privateNames.has(s))return;if(t)t.undefinedPrivateNames.set(s,r);else this.parser.raise(p.InvalidPrivateFieldResolution,r,{identifierName:s})}}class Ie{constructor(s=0){this.type=s}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}}class xt extends Ie{constructor(s){super(s);this.declarationErrors=new Map}recordDeclarationError(s,r){let t=r.index;this.declarationErrors.set(t,[s,r])}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}}class Xs{constructor(s){this.parser=void 0,this.stack=[new Ie],this.parser=s}enter(s){this.stack.push(s)}exit(){this.stack.pop()}recordParameterInitializerError(s,r){let t=r.loc.start,{stack:i}=this,a=i.length-1,n=i[a];while(!n.isCertainlyParameterDeclaration()){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(s,t);else return;n=i[--a]}this.parser.raise(s,t)}recordArrowParameterBindingError(s,r){let{stack:t}=this,i=t[t.length-1],a=r.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(s,a);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(s,a);else return}recordAsyncArrowParametersError(s){let{stack:r}=this,t=r.length-1,i=r[t];while(i.canBeArrowParameterDeclaration()){if(i.type===2)i.recordDeclarationError(p.AwaitBindingIdentifier,s);i=r[--t]}}validateAsPattern(){let{stack:s}=this,r=s[s.length-1];if(!r.canBeArrowParameterDeclaration())return;r.iterateErrors(([t,i])=>{this.parser.raise(t,i);let a=s.length-2,n=s[a];while(n.canBeArrowParameterDeclaration())n.clearDeclarationError(i.index),n=s[--a]})}}function xa(){return new Ie(3)}function ga(){return new xt(1)}function Pa(){return new xt(2)}function Ys(){return new Ie}class Qs extends Ws{addExtra(s,r,t,i=!0){if(!s)return;let{extra:a}=s;if(a==null)a={},s.extra=a;if(i)a[r]=t;else Object.defineProperty(a,r,{enumerable:i,value:t})}isContextual(s){return this.state.type===s&&!this.state.containsEsc}isUnparsedContextual(s,r){if(this.input.startsWith(r,s)){let t=this.input.charCodeAt(s+r.length);return!(ae(t)||(t&64512)===55296)}return!1}isLookaheadContextual(s){let r=this.nextTokenStart();return this.isUnparsedContextual(r,s)}eatContextual(s){if(this.isContextual(s))return this.next(),!0;return!1}expectContextual(s,r){if(!this.eatContextual(s)){if(r!=null)throw this.raise(r,this.state.startLoc);this.unexpected(null,s)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ts(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Ts(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(s=!0){if(s?this.isLineTerminator():this.eat(13))return;this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(s,r){if(!this.eat(s))this.unexpected(r,s)}tryParse(s,r=this.state.clone()){let t={node:null};try{let i=s((a=null)=>{throw t.node=a,t});if(this.state.errors.length>r.errors.length){let a=this.state;return this.state=r,this.state.tokensLength=a.tokensLength,{node:i,error:a.errors[r.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let a=this.state;if(this.state=r,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:a};if(i===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:a};throw i}}checkExpressionErrors(s,r){if(!s)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:i,privateKeyLoc:a,optionalParametersLoc:n,voidPatternLoc:o}=s,l=!!t||!!i||!!n||!!a||!!o;if(!r)return l;if(t!=null)this.raise(p.InvalidCoverInitializedName,t);if(i!=null)this.raise(p.DuplicateProto,i);if(a!=null)this.raise(p.UnexpectedPrivateField,a);if(n!=null)this.unexpected(n);if(o!=null)this.raise(p.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return ks(this.state.type)}isPrivateName(s){return s.type==="PrivateName"}getPrivateNameSV(s){return s.id.name}hasPropertyAsPrivateName(s){return(s.type==="MemberExpression"||s.type==="OptionalMemberExpression")&&this.isPrivateName(s.property)}isObjectProperty(s){return s.type==="ObjectProperty"}isObjectMethod(s){return s.type==="ObjectMethod"}initializeScopes(s=this.options.sourceType==="module"){let r=this.state.labels;this.state.labels=[];let t=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=s;let a=this.scope,n=this.getScopeHandler();this.scope=new n(this,s);let o=this.prodParam;this.prodParam=new $s;let l=this.classScope;this.classScope=new Js(this);let h=this.expressionScope;return this.expressionScope=new Xs(this),()=>{this.state.labels=r,this.exportedIdentifiers=t,this.inModule=i,this.scope=a,this.prodParam=o,this.classScope=l,this.expressionScope=h}}enterInitialScopes(){let s=0;if(this.inModule||this.optionFlags&1)s|=2;if(this.optionFlags&32)s|=1;let r=!this.inModule&&this.options.sourceType==="commonjs";if(r||this.optionFlags&2)s|=4;this.prodParam.enter(s);let t=r?514:1;if(this.optionFlags&4)t|=512;this.scope.enter(t)}checkDestructuringPrivate(s){let{privateKeyLoc:r}=s;if(r!==null)this.expectPlugin("destructuringPrivate",r)}}class Ae{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}}class we{constructor(s,r,t){if(this.type="",this.start=r,this.end=0,this.loc=new Se(t),(s==null?void 0:s.optionFlags)&128)this.range=[r,0];if(s!=null&&s.filename)this.loc.filename=s.filename}}var rt=we.prototype;rt.__clone=function(){let s=new we(void 0,this.start,this.loc.start),r=Object.keys(this);for(let t=0,i=r.length;t<i;t++){let a=r[t];if(a!=="leadingComments"&&a!=="trailingComments"&&a!=="innerComments")s[a]=this[a]}return s};class Zs extends Qs{startNode(){let s=this.state.startLoc;return new we(this,s.index,s)}startNodeAt(s){return new we(this,s.index,s)}startNodeAtNode(s){return this.startNodeAt(s.loc.start)}finishNode(s,r){return this.finishNodeAt(s,r,this.state.lastTokEndLoc)}finishNodeAt(s,r,t){if(s.type=r,s.end=t.index,s.loc.end=t,this.optionFlags&128)s.range[1]=t.index;if(this.optionFlags&4096)this.processComment(s);return s}resetStartLocation(s,r){if(s.start=r.index,s.loc.start=r,this.optionFlags&128)s.range[0]=r.index}resetEndLocation(s,r=this.state.lastTokEndLoc){if(s.end=r.index,s.loc.end=r,this.optionFlags&128)s.range[1]=r.index}resetStartLocationFromNode(s,r){this.resetStartLocation(s,r.loc.start)}castNodeTo(s,r){return s.type=r,s}cloneIdentifier(s){let{type:r,start:t,end:i,loc:a,range:n,name:o}=s,l=Object.create(rt);if(l.type=r,l.start=t,l.end=i,l.loc=a,l.range=n,l.name=o,s.extra)l.extra=s.extra;return l}cloneStringLiteral(s){let{type:r,start:t,end:i,loc:a,range:n,extra:o}=s,l=Object.create(rt);return l.type=r,l.start=t,l.end=i,l.loc=a,l.range=n,l.extra=o,l.value=s.value,l}}var at=(s)=>s.type==="ParenthesizedExpression"?at(s.expression):s;class ei extends Zs{toAssignable(s,r=!1){var t,i;let a=void 0;if(s.type==="ParenthesizedExpression"||(t=s.extra)!=null&&t.parenthesized)if(a=at(s),r){if(a.type==="Identifier")this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,s);else if(a.type!=="CallExpression"&&a.type!=="MemberExpression"&&!this.isOptionalMemberExpression(a))this.raise(p.InvalidParenthesizedAssignment,s)}else this.raise(p.InvalidParenthesizedAssignment,s);switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(s,"ObjectPattern");for(let o=0,l=s.properties.length,h=l-1;o<l;o++){var n;let c=s.properties[o],u=o===h;if(this.toAssignableObjectExpressionProp(c,u,r),u&&c.type==="RestElement"&&(n=s.extra)!=null&&n.trailingCommaLoc)this.raise(p.RestTrailingComma,s.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:l}=s;if(this.isPrivateName(o))this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start);this.toAssignable(l,r);break}case"SpreadElement":throw Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(s,"ArrayPattern"),this.toAssignableList(s.elements,(i=s.extra)==null?void 0:i.trailingCommaLoc,r);break;case"AssignmentExpression":if(s.operator!=="=")this.raise(p.MissingEqInAssignment,s.left.loc.end);if(this.castNodeTo(s,"AssignmentPattern"),delete s.operator,s.left.type==="VoidPattern")this.raise(p.VoidPatternInitializer,s.left);this.toAssignable(s.left,r);break;case"ParenthesizedExpression":this.toAssignable(a,r);break}}toAssignableObjectExpressionProp(s,r,t){if(s.type==="ObjectMethod")this.raise(s.kind==="get"||s.kind==="set"?p.PatternHasAccessor:p.PatternHasMethod,s.key);else if(s.type==="SpreadElement"){this.castNodeTo(s,"RestElement");let i=s.argument;if(this.checkToRestConversion(i,!1),this.toAssignable(i,t),!r)this.raise(p.RestTrailingComma,s)}else this.toAssignable(s,t)}toAssignableList(s,r,t){let i=s.length-1;for(let a=0;a<=i;a++){let n=s[a];if(!n)continue;if(this.toAssignableListItem(s,a,t),n.type==="RestElement"){if(a<i)this.raise(p.RestTrailingComma,n);else if(r)this.raise(p.RestTrailingComma,r)}}}toAssignableListItem(s,r,t){let i=s[r];if(i.type==="SpreadElement"){this.castNodeTo(i,"RestElement");let a=i.argument;this.checkToRestConversion(a,!0),this.toAssignable(a,t)}else this.toAssignable(i,t)}isAssignable(s,r){switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let t=s.properties.length-1;return s.properties.every((i,a)=>i.type!=="ObjectMethod"&&(a===t||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(s.value);case"SpreadElement":return this.isAssignable(s.argument);case"ArrayExpression":return s.elements.every((t)=>t===null||this.isAssignable(t));case"AssignmentExpression":return s.operator==="=";case"ParenthesizedExpression":return this.isAssignable(s.expression);case"MemberExpression":case"OptionalMemberExpression":return!r;default:return!1}}toReferencedList(s,r){return s}toReferencedListDeep(s,r){this.toReferencedList(s,r);for(let t of s)if((t==null?void 0:t.type)==="ArrayExpression")this.toReferencedListDeep(t.elements)}parseSpread(s){let r=this.startNode();return this.next(),r.argument=this.parseMaybeAssignAllowIn(s,void 0),this.finishNode(r,"SpreadElement")}parseRestBinding(){let s=this.startNode();this.next();let r=this.parseBindingAtom();if(r.type==="VoidPattern")this.raise(p.UnexpectedVoidPattern,r);return s.argument=r,this.finishNode(s,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let s=this.startNode();return this.next(),s.elements=this.parseBindingList(3,93,1),this.finishNode(s,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(s,r,t){let i=t&1,a=[],n=!0;while(!this.eat(s)){if(n)n=!1;else this.expect(12);if(i&&this.match(12))a.push(null);else if(this.eat(s))break;else if(this.match(21)){let o=this.parseRestBinding();if(this.hasPlugin("flow")||t&2)o=this.parseFunctionParamType(o);if(a.push(o),!this.checkCommaAfterRest(r)){this.expect(s);break}}else{let o=[];if(t&2){if(this.match(26)&&this.hasPlugin("decorators"))this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);while(this.match(26))o.push(this.parseDecorator())}a.push(this.parseBindingElement(t,o))}}return a}parseBindingRestProperty(s){if(this.next(),this.hasPlugin("discardBinding")&&this.match(88))s.argument=this.parseVoidPattern(null),this.raise(p.UnexpectedVoidPattern,s.argument);else s.argument=this.parseIdentifier();return this.checkCommaAfterRest(125),this.finishNode(s,"RestElement")}parseBindingProperty(){let{type:s,startLoc:r}=this.state;if(s===21)return this.parseBindingRestProperty(this.startNode());let t=this.startNode();if(s===139)this.expectPlugin("destructuringPrivate",r),this.classScope.usePrivateName(this.state.value,r),t.key=this.parsePrivateName();else this.parsePropertyName(t);return t.method=!1,this.parseObjPropValue(t,r,!1,!1,!0,!1)}parseBindingElement(s,r){let t=this.parseMaybeDefault();if(this.hasPlugin("flow")||s&2)this.parseFunctionParamType(t);if(r.length)t.decorators=r,this.resetStartLocationFromNode(t,r[0]);return this.parseMaybeDefault(t.loc.start,t)}parseFunctionParamType(s){return s}parseMaybeDefault(s,r){if(s!=null||(s=this.state.startLoc),r=r!=null?r:this.parseBindingAtom(),!this.eat(29))return r;let t=this.startNodeAt(s);if(r.type==="VoidPattern")this.raise(p.VoidPatternInitializer,r);return t.left=r,t.right=this.parseMaybeAssignAllowIn(),this.finishNode(t,"AssignmentPattern")}isValidLVal(s,r,t,i){switch(s){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!r&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(s){return s.type==="OptionalMemberExpression"}checkLVal(s,r,t=64,i=!1,a=!1,n=!1,o=!1){var l;let h=s.type;if(this.isObjectMethod(s))return;let c=this.isOptionalMemberExpression(s);if(c||h==="MemberExpression"){if(c){if(this.expectPlugin("optionalChainingAssign",s.loc.start),r.type!=="AssignmentExpression")this.raise(p.InvalidLhsOptionalChaining,s,{ancestor:r})}if(t!==64)this.raise(p.InvalidPropertyBindingPattern,s);return}if(h==="Identifier"){this.checkIdentifier(s,t,a);let{name:S}=s;if(i)if(i.has(S))this.raise(p.ParamDupe,s);else i.add(S);return}else if(h==="VoidPattern"&&r.type==="CatchClause")this.raise(p.VoidPatternCatchClauseParam,s);let u=at(s);o||(o=u.type==="CallExpression"&&(u.callee.type==="Import"||u.callee.type==="Super"));let d=this.isValidLVal(h,o,!(n||(l=s.extra)!=null&&l.parenthesized)&&r.type==="AssignmentExpression",t);if(d===!0)return;if(d===!1){let S=t===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(S,s,{ancestor:r});return}let f,m;if(typeof d==="string")f=d,m=h==="ParenthesizedExpression";else[f,m]=d;let x=h==="ArrayPattern"||h==="ObjectPattern"?{type:h}:r,T=s[f];if(Array.isArray(T)){for(let S of T)if(S)this.checkLVal(S,x,t,i,a,m,!0)}else if(T)this.checkLVal(T,x,t,i,a,m,o)}checkIdentifier(s,r,t=!1){if(this.state.strict&&(t?Fs(s.name,this.inModule):_s(s.name)))if(r===64)this.raise(p.StrictEvalArguments,s,{referenceName:s.name});else this.raise(p.StrictEvalArgumentsBinding,s,{bindingName:s.name});if(r&8192&&s.name==="let")this.raise(p.LetInLexicalBinding,s);if(!(r&64))this.declareNameFromIdentifier(s,r)}declareNameFromIdentifier(s,r){this.scope.declareName(s.name,r,s.loc.start)}checkToRestConversion(s,r){switch(s.type){case"ParenthesizedExpression":this.checkToRestConversion(s.expression,r);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(r)break;default:this.raise(p.InvalidRestAssignmentPattern,s)}}checkCommaAfterRest(s){if(!this.match(12))return!1;return this.raise(this.lookaheadCharCode()===s?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0}}var Ze=/in(?:stanceof)?|as|satisfies/y;function ba(s){if(s==null)throw Error(`Unexpected ${s} value.`);return s}function Cs(s){if(!s)throw Error("Assert fail")}var g=V`typescript`({AbstractMethodHasImplementation:({methodName:s})=>`Method '${s}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:s})=>`Property '${s}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:s})=>`'declare' is not allowed in ${s}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:s})=>`Accessibility modifier already seen: '${s}'.`,DuplicateModifier:({modifier:s})=>`Duplicate modifier: '${s}'.`,EmptyHeritageClauseType:({token:s})=>`'${s}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:s})=>`'${s[0]}' modifier cannot be used with '${s[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:s})=>`Index signatures cannot have an accessibility modifier ('${s}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:s})=>`'${s}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:(s)=>`'${s}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:s})=>`'${s}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:s})=>`'${s}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:s})=>`'${s}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:(s)=>`'${s}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:s})=>`'${s[0]}' modifier must precede '${s[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:s})=>`Private elements cannot have an accessibility modifier ('${s}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:s})=>`Single type parameter ${s} should have a trailing comma. Example usage: <${s},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:s})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${s}.`,UsingDeclarationInAmbientContext:(s)=>`'${s}' declarations are not allowed in ambient contexts.`});function Ta(s){switch(s){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function ws(s){return s==="private"||s==="public"||s==="protected"}function Aa(s){return s==="in"||s==="out"}var Sa=(s)=>class extends s{constructor(...t){super(...t);this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:g.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter})}getScopeHandler(){return js}tsIsIdentifier(){return N(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){if(this.next(),this.hasPrecedingLineBreak())return!1;return this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){if(this.match(106))return this.next(),this.tsTokenCanFollowModifier();return this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(t,i,a){if(!N(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let n=this.state.value;if(t.includes(n)){if(a&&this.match(106))return;if(i&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}return}tsParseModifiers({allowedModifiers:t,disallowedModifiers:i,stopOnStartOfClassStaticBlock:a,errorTemplate:n=g.InvalidModifierOnTypeMember},o){let l=(c,u,d,f)=>{if(u===d&&o[f])this.raise(g.InvalidModifiersOrder,c,{orderedModifiers:[d,f]})},h=(c,u,d,f)=>{if(o[d]&&u===f||o[f]&&u===d)this.raise(g.IncompatibleModifiers,c,{modifiers:[d,f]})};for(;;){let{startLoc:c}=this.state,u=this.tsParseModifier(t.concat(i!=null?i:[]),a,o.static);if(!u)break;if(ws(u))if(o.accessibility)this.raise(g.DuplicateAccessibilityModifier,c,{modifier:u});else l(c,u,u,"override"),l(c,u,u,"static"),l(c,u,u,"readonly"),o.accessibility=u;else if(Aa(u)){if(o[u])this.raise(g.DuplicateModifier,c,{modifier:u});o[u]=!0,l(c,u,"in","out")}else{if(hasOwnProperty.call(o,u))this.raise(g.DuplicateModifier,c,{modifier:u});else l(c,u,"static","readonly"),l(c,u,"static","override"),l(c,u,"override","readonly"),l(c,u,"abstract","override"),h(c,u,"declare","override"),h(c,u,"static","abstract");o[u]=!0}if(i!=null&&i.includes(u))this.raise(n,c,{modifier:u})}}tsIsListTerminator(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(t,i){let a=[];while(!this.tsIsListTerminator(t))a.push(i());return a}tsParseDelimitedList(t,i,a){return ba(this.tsParseDelimitedListWorker(t,i,!0,a))}tsParseDelimitedListWorker(t,i,a,n){let o=[],l=-1;for(;;){if(this.tsIsListTerminator(t))break;l=-1;let h=i();if(h==null)return;if(o.push(h),this.eat(12)){l=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(t))break;if(a)this.expect(12);return}if(n)n.value=l;return o}tsParseBracketedList(t,i,a,n,o){if(!n)if(a)this.expect(0);else this.expect(47);let l=this.tsParseDelimitedList(t,i,o);if(a)this.expect(3);else this.expect(48);return l}tsParseImportType(){let t=this.startNode();if(this.expect(83),this.expect(10),!this.match(134))this.raise(g.UnsupportedImportTypeArgument,this.state.startLoc),t.argument=super.parseExprAtom();else t.argument=this.parseStringLiteral(this.state.value);if(this.eat(12))t.options=this.tsParseImportTypeOptions();else t.options=null;if(this.expect(11),this.eat(16))t.qualifier=this.tsParseEntityName(3);if(this.match(47))t.typeParameters=this.tsParseTypeArguments();return this.finishNode(t,"TSImportType")}tsParseImportTypeOptions(){let t=this.startNode();this.expect(5);let i=this.startNode();if(this.isContextual(76))i.method=!1,i.key=this.parseIdentifier(!0),i.computed=!1,i.shorthand=!1;else this.unexpected(null,76);return this.expect(14),i.value=this.tsParseImportTypeWithPropertyValue(),t.properties=[this.finishObjectProperty(i)],this.eat(12),this.expect(8),this.finishNode(t,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let t=this.startNode(),i=[];this.expect(5);while(!this.match(8)){let a=this.state.type;if(N(a)||a===134)i.push(super.parsePropertyDefinition(null));else this.unexpected();this.eat(12)}return t.properties=i,this.next(),this.finishNode(t,"ObjectExpression")}tsParseEntityName(t){let i;if(t&1&&this.match(78))if(t&2)i=this.parseIdentifier(!0);else{let a=this.startNode();this.next(),i=this.finishNode(a,"ThisExpression")}else i=this.parseIdentifier(!!(t&1));while(this.eat(16)){let a=this.startNodeAtNode(i);a.left=i,a.right=this.parseIdentifier(!!(t&1)),i=this.finishNode(a,"TSQualifiedName")}return i}tsParseTypeReference(){let t=this.startNode();if(t.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47))t.typeParameters=this.tsParseTypeArguments();return this.finishNode(t,"TSTypeReference")}tsParseThisTypePredicate(t){this.next();let i=this.startNodeAtNode(t);return i.parameterName=t,i.typeAnnotation=this.tsParseTypeAnnotation(!1),i.asserts=!1,this.finishNode(i,"TSTypePredicate")}tsParseThisTypeNode(){let t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")}tsParseTypeQuery(){let t=this.startNode();if(this.expect(87),this.match(83))t.exprName=this.tsParseImportType();else t.exprName=this.tsParseEntityName(3);if(!this.hasPrecedingLineBreak()&&this.match(47))t.typeParameters=this.tsParseTypeArguments();return this.finishNode(t,"TSTypeQuery")}tsParseTypeParameter(t){let i=this.startNode();return t(i),i.name=this.tsParseTypeParameterName(),i.constraint=this.tsEatThenParseType(81),i.default=this.tsEatThenParseType(29),this.finishNode(i,"TSTypeParameter")}tsTryParseTypeParameters(t){if(this.match(47))return this.tsParseTypeParameters(t)}tsParseTypeParameters(t){let i=this.startNode();if(this.match(47)||this.match(143))this.next();else this.unexpected();let a={value:-1};if(i.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,a),i.params.length===0)this.raise(g.EmptyTypeParameters,i);if(a.value!==-1)this.addExtra(i,"trailingComma",a.value);return this.finishNode(i,"TSTypeParameterDeclaration")}tsFillSignature(t,i){let a=t===19,n="parameters",o="typeAnnotation";if(i.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),i.parameters=this.tsParseBindingListForSignature(),a)i.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(t);else if(this.match(t))i.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(t)}tsParseBindingListForSignature(){let t=super.parseBindingList(11,41,2);for(let i of t){let{type:a}=i;if(a==="AssignmentPattern"||a==="TSParameterProperty")this.raise(g.UnsupportedSignatureParameterKind,i,{type:a})}return t}tsParseTypeMemberSemicolon(){if(!this.eat(12)&&!this.isLineTerminator())this.expect(13)}tsParseSignatureMember(t,i){return this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon(),this.finishNode(i,t)}tsIsUnambiguouslyIndexSignature(){if(this.next(),N(this.state.type))return this.next(),this.match(14);return!1}tsTryParseIndexSignature(t){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let i=this.parseIdentifier();i.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(i),this.expect(3),t.parameters=[i];let a=this.tsTryParseTypeAnnotation();if(a)t.typeAnnotation=a;return this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}tsParsePropertyOrMethodSignature(t,i){if(this.eat(17))t.optional=!0;if(this.match(10)||this.match(47)){if(i)this.raise(g.ReadonlyForMethodSignature,t);let a=t;if(a.kind&&this.match(47))this.raise(g.AccessorCannotHaveTypeParameters,this.state.curPosition());this.tsFillSignature(14,a),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(a.kind==="get"){if(a[n].length>0){if(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(a[n][0]))this.raise(g.AccessorCannotDeclareThisParameter,this.state.curPosition())}}else if(a.kind==="set"){if(a[n].length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let l=a[n][0];if(this.isThisParam(l))this.raise(g.AccessorCannotDeclareThisParameter,this.state.curPosition());if(l.type==="Identifier"&&l.optional)this.raise(g.SetAccessorCannotHaveOptionalParameter,this.state.curPosition());if(l.type==="RestElement")this.raise(g.SetAccessorCannotHaveRestParameter,this.state.curPosition())}if(a[o])this.raise(g.SetAccessorCannotHaveReturnType,a[o])}else a.kind="method";return this.finishNode(a,"TSMethodSignature")}else{let a=t;if(i)a.readonly=!0;let n=this.tsTryParseTypeAnnotation();if(n)a.typeAnnotation=n;return this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSPropertySignature")}}tsParseTypeMember(){let t=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(77)){let a=this.startNode();if(this.next(),this.match(10)||this.match(47))return this.tsParseSignatureMember("TSConstructSignatureDeclaration",t);else return t.key=this.createIdentifier(a,"new"),this.tsParsePropertyOrMethodSignature(t,!1)}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},t);let i=this.tsTryParseIndexSignature(t);if(i)return i;if(super.parsePropertyName(t),!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.tsTokenCanFollowModifier()){if(t.kind=t.key.name,super.parsePropertyName(t),!this.match(10)&&!this.match(47))this.unexpected(null,10)}return this.tsParsePropertyOrMethodSignature(t,!!t.readonly)}tsParseTypeLiteral(){let t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),t}tsIsStartOfMappedType(){if(this.next(),this.eat(53))return this.isContextual(122);if(this.isContextual(122))this.next();if(!this.match(0))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(58)}tsParseMappedType(){let t=this.startNode();if(this.expect(5),this.match(53))t.readonly=this.state.value,this.next(),this.expectContextual(122);else if(this.eatContextual(122))t.readonly=!0;this.expect(0);let i=this.startNode();if(i.name=this.tsParseTypeParameterName(),i.constraint=this.tsExpectThenParseType(58),t.typeParameter=this.finishNode(i,"TSTypeParameter"),t.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53))t.optional=this.state.value,this.next(),this.expect(17);else if(this.eat(17))t.optional=!0;return t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(t,"TSMappedType")}tsParseTupleType(){let t=this.startNode();t.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let i=!1;return t.elementTypes.forEach((a)=>{let{type:n}=a;if(i&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&a.optional))this.raise(g.OptionalTypeBeforeRequired,a);i||(i=n==="TSNamedTupleMember"&&a.optional||n==="TSOptionalType")}),this.finishNode(t,"TSTupleType")}tsParseTupleElementType(){let t=this.state.startLoc,i=this.eat(21),{startLoc:a}=this.state,n,o,l,h,u=q(this.state.type)?this.lookaheadCharCode():null;if(u===58)n=!0,l=!1,o=this.parseIdentifier(!0),this.expect(14),h=this.tsParseType();else if(u===63){l=!0;let d=this.state.value,f=this.tsParseNonArrayType();if(this.lookaheadCharCode()===58)n=!0,o=this.createIdentifier(this.startNodeAt(a),d),this.expect(17),this.expect(14),h=this.tsParseType();else n=!1,h=f,this.expect(17)}else h=this.tsParseType(),l=this.eat(17),n=this.eat(14);if(n){let d;if(o){if(d=this.startNodeAt(a),d.optional=l,d.label=o,d.elementType=h,this.eat(17))d.optional=!0,this.raise(g.TupleOptionalAfterType,this.state.lastTokStartLoc)}else d=this.startNodeAt(a),d.optional=l,this.raise(g.InvalidTupleMemberLabel,h),d.label=h,d.elementType=this.tsParseType();h=this.finishNode(d,"TSNamedTupleMember")}else if(l){let d=this.startNodeAt(a);d.typeAnnotation=h,h=this.finishNode(d,"TSOptionalType")}if(i){let d=this.startNodeAt(t);d.typeAnnotation=h,h=this.finishNode(d,"TSRestType")}return h}tsParseParenthesizedType(){let t=this.startNode();return this.expect(10),t.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(t,"TSParenthesizedType")}tsParseFunctionOrConstructorType(t,i){let a=this.startNode();if(t==="TSConstructorType"){if(a.abstract=!!i,i)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,a)),this.finishNode(a,t)}tsParseLiteralTypeNode(){let t=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:t.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(t,"TSLiteralType")}tsParseTemplateLiteralType(){let t=this.startNode();return t.literal=super.parseTemplate(!1),this.finishNode(t,"TSLiteralType")}parseTemplateSubstitution(){if(this.state.inType)return this.tsParseType();return super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let t=this.tsParseThisTypeNode();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(t);else return t}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let t=this.startNode(),i=this.lookahead();if(i.type!==135&&i.type!==136)this.unexpected();return t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:t}=this.state;if(N(t)||t===88||t===84){let i=t===88?"TSVoidKeyword":t===84?"TSNullKeyword":Ta(this.state.value);if(i!==void 0&&this.lookaheadCharCode()!==46){let a=this.startNode();return this.next(),this.finishNode(a,i)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:t}=this.state,i=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(0))if(this.match(3)){let a=this.startNodeAt(t);a.elementType=i,this.expect(3),i=this.finishNode(a,"TSArrayType")}else{let a=this.startNodeAt(t);a.objectType=i,a.indexType=this.tsParseType(),this.expect(3),i=this.finishNode(a,"TSIndexedAccessType")}return i}tsParseTypeOperator(){let t=this.startNode(),i=this.state.value;if(this.next(),t.operator=i,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),i==="readonly")this.tsCheckTypeAnnotationForReadOnly(t);return this.finishNode(t,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(g.UnexpectedReadonly,t)}}tsParseInferType(){let t=this.startNode();this.expectContextual(115);let i=this.startNode();return i.name=this.tsParseTypeParameterName(),i.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),t.typeParameter=this.finishNode(i,"TSTypeParameter"),this.finishNode(t,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let t=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return t}}tsParseTypeOperatorOrHigher(){return qr(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(t,i,a){let n=this.startNode(),o=this.eat(a),l=[];do l.push(i());while(this.eat(a));if(l.length===1&&!o)return l[0];return n.types=l,this.finishNode(n,t)}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){if(this.match(47))return!0;return this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(N(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:t}=this.state,i=t.length;try{return this.parseObjectLike(8,!0),t.length===i}catch(a){return!1}}if(this.match(0)){this.next();let{errors:t}=this.state,i=t.length;try{return super.parseBindingList(3,93,1),t.length===i}catch(a){return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(11)||this.match(21))return!0;if(this.tsSkipParameterStart()){if(this.match(14)||this.match(12)||this.match(17)||this.match(29))return!0;if(this.match(11)){if(this.next(),this.match(19))return!0}}return!1}tsParseTypeOrTypePredicateAnnotation(t){return this.tsInType(()=>{let i=this.startNode();this.expect(t);let a=this.startNode(),n=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(n&&this.match(78)){let h=this.tsParseThisTypeOrThisTypePredicate();if(h.type==="TSThisType")a.parameterName=h,a.asserts=!0,a.typeAnnotation=null,h=this.finishNode(a,"TSTypePredicate");else this.resetStartLocationFromNode(h,a),h.asserts=!0;return i.typeAnnotation=h,this.finishNode(i,"TSTypeAnnotation")}let o=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!o){if(!n)return this.tsParseTypeAnnotation(!1,i);return a.parameterName=this.parseIdentifier(),a.asserts=n,a.typeAnnotation=null,i.typeAnnotation=this.finishNode(a,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")}let l=this.tsParseTypeAnnotation(!1);return a.parameterName=o,a.typeAnnotation=l,a.asserts=n,i.typeAnnotation=this.finishNode(a,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let t=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),t}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let t=this.state.containsEsc;if(this.next(),!N(this.state.type)&&!this.match(78))return!1;if(t)this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"});return!0}tsParseTypeAnnotation(t=!0,i=this.startNode()){return this.tsInType(()=>{if(t)this.expect(14);i.typeAnnotation=this.tsParseType()}),this.finishNode(i,"TSTypeAnnotation")}tsParseType(){Cs(this.state.inType);let t=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return t;let i=this.startNodeAtNode(t);return i.checkType=t,i.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),i.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),i.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(i,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(77))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){if(this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(g.ReservedTypeAssertion,this.state.startLoc);let t=this.startNode();return t.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),t.expression=this.parseMaybeUnary(),this.finishNode(t,"TSTypeAssertion")}tsParseHeritageClause(t){let i=this.state.startLoc,a=this.tsParseDelimitedList("HeritageClauseElement",()=>{let n=this.startNode();if(n.expression=this.tsParseEntityName(3),this.match(47))n.typeParameters=this.tsParseTypeArguments();return this.finishNode(n,"TSExpressionWithTypeArguments")});if(!a.length)this.raise(g.EmptyHeritageClauseType,i,{token:t});return a}tsParseInterfaceDeclaration(t,i={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual(129),i.declare)t.declare=!0;if(N(this.state.type))t.id=this.parseIdentifier(),this.checkIdentifier(t.id,130);else t.id=null,this.raise(g.MissingInterfaceName,this.state.startLoc);if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81))t.extends=this.tsParseHeritageClause("extends");let a=this.startNode();return a.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(a,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(t){return t.id=this.parseIdentifier(),this.checkIdentifier(t.id,2),t.typeAnnotation=this.tsInType(()=>{if(t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")}tsInTopLevelContext(t){if(this.curContext()!==E.brace){let i=this.state.context;this.state.context=[i[0]];try{return t()}finally{this.state.context=i}}else return t()}tsInType(t){let i=this.state.inType;this.state.inType=!0;try{return t()}finally{this.state.inType=i}}tsInDisallowConditionalTypesContext(t){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.state.inDisallowConditionalTypesContext=i}}tsInAllowConditionalTypesContext(t){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.state.inDisallowConditionalTypesContext=i}}tsEatThenParseType(t){if(this.match(t))return this.tsNextThenParseType()}tsExpectThenParseType(t){return this.tsInType(()=>(this.expect(t),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let t=this.startNode();if(t.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29))t.initializer=super.parseMaybeAssignAllowIn();return this.finishNode(t,"TSEnumMember")}tsParseEnumDeclaration(t,i={}){if(i.const)t.const=!0;if(i.declare)t.declare=!0;return this.expectContextual(126),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,t.const?8971:8459),this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumDeclaration")}tsParseEnumBody(){let t=this.startNode();return this.expect(5),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(t,"TSEnumBody")}tsParseModuleBlock(){let t=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(t,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(t,i=!1){if(t.id=this.parseIdentifier(),!i)this.checkIdentifier(t.id,1024);if(this.eat(16)){let a=this.startNode();this.tsParseModuleOrNamespaceDeclaration(a,!0),t.body=a}else this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(t,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(t){if(this.isContextual(112))t.kind="global",t.global=!0,t.id=this.parseIdentifier();else if(this.match(134))t.kind="module",t.id=super.parseStringLiteral(this.state.value);else this.unexpected();if(this.match(5))this.scope.enter(1024),this.prodParam.enter(0),t.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();else this.semicolon();return this.finishNode(t,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(t,i,a){t.isExport=a||!1,t.id=i||this.parseIdentifier(),this.checkIdentifier(t.id,4096),this.expect(29);let n=this.tsParseModuleReference();if(t.importKind==="type"&&n.type!=="TSExternalModuleReference")this.raise(g.ImportAliasHasImportType,n);return t.moduleReference=n,this.semicolon(),this.finishNode(t,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let t=this.startNode();if(this.expectContextual(119),this.expect(10),!this.match(134))this.unexpected();return t.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(t,"TSExternalModuleReference")}tsLookAhead(t){let i=this.state.clone(),a=t();return this.state=i,a}tsTryParseAndCatch(t){let i=this.tryParse((a)=>t()||a());if(i.aborted||!i.node)return;if(i.error)this.state=i.failState;return i.node}tsTryParse(t){let i=this.state.clone(),a=t();if(a!==void 0&&a!==!1)return a;this.state=i}tsTryParseDeclare(t){if(this.isLineTerminator())return;let i=this.state.type;return this.tsInAmbientContext(()=>{switch(i){case 68:return t.declare=!0,super.parseFunctionStatement(t,!1,!1);case 80:return t.declare=!0,this.parseClass(t,!0,!1);case 126:return this.tsParseEnumDeclaration(t,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(t);case 100:if(this.state.containsEsc)return;case 75:case 74:if(!this.match(75)||!this.isLookaheadContextual("enum"))return t.declare=!0,this.parseVarStatement(t,this.state.value,!0);return this.expect(75),this.tsParseEnumDeclaration(t,{const:!0,declare:!0});case 107:if(this.isUsing())return this.raise(g.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.parseVarStatement(t,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(g.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),t.declare=!0,this.next(),this.parseVarStatement(t,"await using",!0);break;case 129:{let a=this.tsParseInterfaceDeclaration(t,{declare:!0});if(a)return a}default:if(N(i))return this.tsParseDeclaration(t,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(t,i,a,n){switch(i){case 124:if(this.tsCheckLineTerminator(a)&&(this.match(80)||N(this.state.type)))return this.tsParseAbstractDeclaration(t,n);break;case 127:if(this.tsCheckLineTerminator(a)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(t);else if(N(this.state.type))return t.kind="module",this.tsParseModuleOrNamespaceDeclaration(t)}break;case 128:if(this.tsCheckLineTerminator(a)&&N(this.state.type))return t.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(t);break;case 130:if(this.tsCheckLineTerminator(a)&&N(this.state.type))return this.tsParseTypeAliasDeclaration(t);break}}tsCheckLineTerminator(t){if(t){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(t){if(!this.match(47))return;let i=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let a=this.tsTryParseAndCatch(()=>{let n=this.startNodeAt(t);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),n});if(this.state.maybeInArrowParameters=i,!a)return;return super.parseArrowExpression(a,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==47)return;return this.tsParseTypeArguments()}tsParseTypeArguments(){let t=this.startNode();if(t.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),t.params.length===0)this.raise(g.EmptyTypeArguments,t);else if(!this.state.inType&&this.curContext()===E.brace)this.reScan_lt_gt();return this.expect(48),this.finishNode(t,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return zr(this.state.type)}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;return super.isExportDefaultSpecifier()}parseBindingElement(t,i){let a=i.length?i[0].loc.start:this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);let{accessibility:o,override:l,readonly:h}=n;if(!(t&4)&&(o||h||l))this.raise(g.UnexpectedParameterModifier,a);let c=this.parseMaybeDefault();if(t&2)this.parseFunctionParamType(c);let u=this.parseMaybeDefault(c.loc.start,c);if(o||h||l){let d=this.startNodeAt(a);if(i.length)d.decorators=i;if(o)d.accessibility=o;if(h)d.readonly=h;if(l)d.override=l;if(u.type!=="Identifier"&&u.type!=="AssignmentPattern")this.raise(g.UnsupportedParameterPropertyKind,d);return d.parameter=u,this.finishNode(d,"TSParameterProperty")}if(i.length)c.decorators=i;return u}isSimpleParameter(t){return t.type==="TSParameterProperty"&&super.isSimpleParameter(t.parameter)||super.isSimpleParameter(t)}tsDisallowOptionalPattern(t){for(let i of t.params)if(i.type!=="Identifier"&&i.optional&&!this.state.isAmbientContext)this.raise(g.PatternIsOptional,i)}setArrowFunctionParameters(t,i,a){super.setArrowFunctionParameters(t,i,a),this.tsDisallowOptionalPattern(t)}parseFunctionBodyAndFinish(t,i,a=!1){if(this.match(14))t.returnType=this.tsParseTypeOrTypePredicateAnnotation(14);let n=i==="FunctionDeclaration"?"TSDeclareFunction":i==="ClassMethod"||i==="ClassPrivateMethod"?"TSDeclareMethod":void 0;if(n&&!this.match(5)&&this.isLineTerminator())return this.finishNode(t,n);if(n==="TSDeclareFunction"&&this.state.isAmbientContext){if(this.raise(g.DeclareFunctionHasImplementation,t),t.declare)return super.parseFunctionBodyAndFinish(t,n,a)}return this.tsDisallowOptionalPattern(t),super.parseFunctionBodyAndFinish(t,i,a)}registerFunctionStatementId(t){if(!t.body&&t.id)this.checkIdentifier(t.id,1024);else super.registerFunctionStatementId(t)}tsCheckForInvalidTypeCasts(t){t.forEach((i)=>{if((i==null?void 0:i.type)==="TSTypeCastExpression")this.raise(g.UnexpectedTypeAnnotation,i.typeAnnotation)})}toReferencedList(t,i){return this.tsCheckForInvalidTypeCasts(t),t}parseArrayLike(t,i,a){let n=super.parseArrayLike(t,i,a);if(n.type==="ArrayExpression")this.tsCheckForInvalidTypeCasts(n.elements);return n}parseSubscript(t,i,a,n){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let l=this.startNodeAt(i);return l.expression=t,this.finishNode(l,"TSNonNullExpression")}let o=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(a)return n.stop=!0,t;n.optionalChainMember=o=!0,this.next()}if(this.match(47)||this.match(51)){let l,h=this.tsTryParseAndCatch(()=>{if(!a&&this.atPossibleAsyncArrow(t)){let f=this.tsTryParseGenericAsyncArrowFunction(i);if(f)return n.stop=!0,f}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(o&&!this.match(10)){l=this.state.curPosition();return}if(_e(this.state.type)){let f=super.parseTaggedTemplateExpression(t,i,n);return f.typeParameters=c,f}if(!a&&this.eat(10)){let f=this.startNodeAt(i);if(f.callee=t,f.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=c,n.optionalChainMember)f.optional=o;return this.finishCallExpression(f,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&u!==93&&u!==120&&Pe(u)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(i);return d.expression=t,d.typeParameters=c,this.finishNode(d,"TSInstantiationExpression")});if(l)this.unexpected(l,10);if(h){if(h.type==="TSInstantiationExpression"){if(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)this.raise(g.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc);if(!this.match(16)&&!this.match(18))h.expression=super.stopParseSubscript(t,n)}return h}}return super.parseSubscript(t,i,a,n)}parseNewCallee(t){var i;super.parseNewCallee(t);let{callee:a}=t;if(a.type==="TSInstantiationExpression"&&!((i=a.extra)!=null&&i.parenthesized))t.typeParameters=a.typeParameters,t.callee=a.expression}parseExprOp(t,i,a){let n;if(Oe(58)>a&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){let o=this.startNodeAt(i);return o.expression=t,o.typeAnnotation=this.tsInType(()=>{if(this.next(),this.match(75)){if(n)this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"});return this.tsParseTypeReference()}return this.tsParseType()}),this.finishNode(o,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(o,i,a)}return super.parseExprOp(t,i,a)}checkReservedWord(t,i,a,n){if(!this.state.isAmbientContext)super.checkReservedWord(t,i,a,n)}checkImportReflection(t){if(super.checkImportReflection(t),t.module&&t.importKind!=="value")this.raise(g.ImportReflectionHasImportType,t.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){let i=this.lookaheadCharCode();return t?i===123||i===42:i!==61}return!t&&this.isContextual(87)}applyImportPhase(t,i,a,n){if(super.applyImportPhase(t,i,a,n),i)t.exportKind=a==="type"?"type":"value";else t.importKind=a==="type"||a==="typeof"?a:"value"}parseImport(t){if(this.match(134))return t.importKind="value",super.parseImport(t);let i;if(N(this.state.type)&&this.lookaheadCharCode()===61)return t.importKind="value",this.tsParseImportEqualsDeclaration(t);else if(this.isContextual(130)){let a=this.parseMaybeImportPhase(t,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(t,a);else i=super.parseImportSpecifiersAndAfter(t,a)}else i=super.parseImport(t);if(i.importKind==="type"&&i.specifiers.length>1&&i.specifiers[0].type==="ImportDefaultSpecifier")this.raise(g.TypeImportCannotSpecifyDefaultAndNamed,i);return i}parseExport(t,i){if(this.match(83)){let a=t;this.next();let n=null;if(this.isContextual(130)&&this.isPotentialImportPhase(!1))n=this.parseMaybeImportPhase(a,!1);else a.importKind="value";return this.tsParseImportEqualsDeclaration(a,n,!0)}else if(this.eat(29)){let a=t;return a.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(a,"TSExportAssignment")}else if(this.eatContextual(93)){let a=t;return this.expectContextual(128),a.id=this.parseIdentifier(),this.semicolon(),this.finishNode(a,"TSNamespaceExportDeclaration")}else return super.parseExport(t,i)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let t=this.startNode();return this.next(),t.abstract=!0,this.parseClass(t,!0,!0)}if(this.match(129)){let t=this.tsParseInterfaceDeclaration(this.startNode());if(t)return t}return super.parseExportDefaultExpression()}parseVarStatement(t,i,a=!1){let{isAmbientContext:n}=this.state,o=super.parseVarStatement(t,i,a||n);if(!n)return o;if(!t.declare&&(i==="using"||i==="await using"))return this.raiseOverwrite(g.UsingDeclarationInAmbientContext,t,i),o;for(let{id:l,init:h}of o.declarations){if(!h)continue;if(i==="var"||i==="let"||!!l.typeAnnotation)this.raise(g.InitializerNotAllowedInAmbientContext,h);else if(!wa(h,this.hasPlugin("estree")))this.raise(g.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,h)}return o}parseStatementContent(t,i){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let a=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(a,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let a=this.state.type,n=this.startNode();this.next();let o=a===125?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,i);if(o){if(a===125)o.declare=!0;return o}else return n.expression=this.createIdentifier(this.startNodeAt(n.loc.start),a===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(n,"ExpressionStatement")}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let n=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(n)}break}case 129:{let a=this.tsParseInterfaceDeclaration(this.startNode());if(a)return a;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let a=this.startNode();return this.next(),this.tsParseDeclaration(a,127,!1,i)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let a=this.startNode();return this.next(),this.tsParseDeclaration(a,128,!1,i)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let a=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(a)}break}}return super.parseStatementContent(t,i)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(t,i){return i.some((a)=>{if(ws(a))return t.accessibility===a;return!!t[a]})}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(t,i,a){let n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:g.InvalidModifierOnTypeParameterPositions},i);let o=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(i,n))this.raise(g.StaticBlockCannotHaveModifier,this.state.curPosition());super.parseClassStaticBlock(t,i)}else this.parseClassMemberWithIsStatic(t,i,a,!!i.static)};if(i.declare)this.tsInAmbientContext(o);else o()}parseClassMemberWithIsStatic(t,i,a,n){let o=this.tsTryParseIndexSignature(i);if(o){if(t.body.push(o),i.abstract)this.raise(g.IndexSignatureHasAbstract,i);if(i.accessibility)this.raise(g.IndexSignatureHasAccessibility,i,{modifier:i.accessibility});if(i.declare)this.raise(g.IndexSignatureHasDeclare,i);if(i.override)this.raise(g.IndexSignatureHasOverride,i);return}if(!this.state.inAbstractClass&&i.abstract)this.raise(g.NonAbstractClassHasAbstractMethod,i);if(i.override){if(!a.hadSuperClass)this.raise(g.OverrideNotInSubClass,i)}super.parseClassMemberWithIsStatic(t,i,a,n)}parsePostMemberNameModifiers(t){if(this.eat(17))t.optional=!0;if(t.readonly&&this.match(10))this.raise(g.ClassMethodHasReadonly,t);if(t.declare&&this.match(10))this.raise(g.ClassMethodHasDeclare,t)}shouldParseExportDeclaration(){if(this.tsIsDeclarationStart())return!0;return super.shouldParseExportDeclaration()}parseConditional(t,i,a){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let n=this.lookaheadCharCode();if(n===44||n===61||n===58||n===41)return this.setOptionalParametersError(a),t}return super.parseConditional(t,i,a)}parseParenItem(t,i){let a=super.parseParenItem(t,i);if(this.eat(17))a.optional=!0,this.resetEndLocation(t);if(this.match(14)){let n=this.startNodeAt(i);return n.expression=t,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,"TSTypeCastExpression")}return t}parseExportDeclaration(t){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(t));let i=this.state.startLoc,a=this.eatContextual(125);if(a&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(g.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let o=N(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(t);if(!o)return null;if(o.type==="TSInterfaceDeclaration"||o.type==="TSTypeAliasDeclaration"||a)t.exportKind="type";if(a&&o.type!=="TSImportEqualsDeclaration")this.resetStartLocation(o,i),o.declare=!0;return o}parseClassId(t,i,a,n){if((!i||a)&&this.isContextual(113))return;super.parseClassId(t,i,a,t.declare?1024:8331);let o=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);if(o)t.typeParameters=o}parseClassPropertyAnnotation(t){if(!t.optional){if(this.eat(35))t.definite=!0;else if(this.eat(17))t.optional=!0}let i=this.tsTryParseTypeAnnotation();if(i)t.typeAnnotation=i}parseClassProperty(t){if(this.parseClassPropertyAnnotation(t),this.state.isAmbientContext&&!(t.readonly&&!t.typeAnnotation)&&this.match(29))this.raise(g.DeclareClassFieldHasInitializer,this.state.startLoc);if(t.abstract&&this.match(29)){let{key:i}=t;this.raise(g.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:i.type==="Identifier"&&!t.computed?i.name:`[${this.input.slice(this.offsetToSourcePos(i.start),this.offsetToSourcePos(i.end))}]`})}return super.parseClassProperty(t)}parseClassPrivateProperty(t){if(t.abstract)this.raise(g.PrivateElementHasAbstract,t);if(t.accessibility)this.raise(g.PrivateElementHasAccessibility,t,{modifier:t.accessibility});return this.parseClassPropertyAnnotation(t),super.parseClassPrivateProperty(t)}parseClassAccessorProperty(t){if(this.parseClassPropertyAnnotation(t),t.optional)this.raise(g.AccessorCannotBeOptional,t);return super.parseClassAccessorProperty(t)}pushClassMethod(t,i,a,n,o,l){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(h&&o)this.raise(g.ConstructorHasTypeParameters,h);let{declare:c=!1,kind:u}=i;if(c&&(u==="get"||u==="set"))this.raise(g.DeclareAccessor,i,{kind:u});if(h)i.typeParameters=h;super.pushClassMethod(t,i,a,n,o,l)}pushClassPrivateMethod(t,i,a,n){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(o)i.typeParameters=o;super.pushClassPrivateMethod(t,i,a,n)}declareClassPrivateMethodInScope(t,i){if(t.type==="TSDeclareMethod")return;if(t.type==="MethodDefinition"&&t.value.body==null)return;super.declareClassPrivateMethodInScope(t,i)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass){if(t.superClass.type==="TSInstantiationExpression"){let i=t.superClass,a=i.expression;this.takeSurroundingComments(a,a.start,a.end);let n=i.typeParameters;this.takeSurroundingComments(n,n.start,n.end),t.superClass=a,t.superTypeParameters=n}else if(this.match(47)||this.match(51))t.superTypeParameters=this.tsParseTypeArgumentsInExpression()}if(this.eatContextual(113))t.implements=this.tsParseHeritageClause("implements")}parseObjPropValue(t,i,a,n,o,l,h){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(c)t.typeParameters=c;return super.parseObjPropValue(t,i,a,n,o,l,h)}parseFunctionParams(t,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(a)t.typeParameters=a;super.parseFunctionParams(t,i)}parseVarId(t,i){if(super.parseVarId(t,i),t.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35))t.definite=!0;let a=this.tsTryParseTypeAnnotation();if(a)t.id.typeAnnotation=a,this.resetEndLocation(t.id)}parseAsyncArrowFromCallExpression(t,i){if(this.match(14))t.returnType=this.tsParseTypeAnnotation();return super.parseAsyncArrowFromCallExpression(t,i)}parseMaybeAssign(t,i){var a,n,o,l,h;let c,u,d;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(c=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(t,i),c),!u.error)return u.node;let{context:x}=this.state,T=x[x.length-1];if(T===E.j_oTag||T===E.j_expr)x.pop()}if(!((a=u)!=null&&a.error)&&!this.match(47))return super.parseMaybeAssign(t,i);if(!c||c===this.state)c=this.state.clone();let f,m=this.tryParse((x)=>{var T,S;f=this.tsParseTypeParameters(this.tsParseConstModifier);let C=super.parseMaybeAssign(t,i);if(C.type!=="ArrowFunctionExpression"||(T=C.extra)!=null&&T.parenthesized)x();if(((S=f)==null?void 0:S.params.length)!==0)this.resetStartLocationFromNode(C,f);return C.typeParameters=f,C},c);if(!m.error&&!m.aborted){if(f)this.reportReservedArrowTypeParam(f);return m.node}if(!u){if(Cs(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(t,i),c),!d.error)return d.node}if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(m.node){if(this.state=m.failState,f)this.reportReservedArrowTypeParam(f);return m.node}if((o=d)!=null&&o.node)return this.state=d.failState,d.node;throw((l=u)==null?void 0:l.error)||m.error||((h=d)==null?void 0:h.error)}reportReservedArrowTypeParam(t){var i;if(t.params.length===1&&!t.params[0].constraint&&!((i=t.extra)!=null&&i.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike"))this.raise(g.ReservedArrowTypeParam,t)}parseMaybeUnary(t,i){if(!this.hasPlugin("jsx")&&this.match(47))return this.tsParseTypeAssertion();return super.parseMaybeUnary(t,i)}parseArrow(t){if(this.match(14)){let i=this.tryParse((a)=>{let n=this.tsParseTypeOrTypePredicateAnnotation(14);if(this.canInsertSemicolon()||!this.match(19))a();return n});if(i.aborted)return;if(!i.thrown){if(i.error)this.state=i.failState;t.returnType=i.node}}return super.parseArrow(t)}parseFunctionParamType(t){if(this.eat(17))t.optional=!0;let i=this.tsTryParseTypeAnnotation();if(i)t.typeAnnotation=i;return this.resetEndLocation(t),t}isAssignable(t,i){switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,i);case"TSParameterProperty":return!0;default:return super.isAssignable(t,i)}}toAssignable(t,i=!1){switch(t.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(t,i);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(i)this.expressionScope.recordArrowParameterBindingError(g.UnexpectedTypeCastInParameter,t);else this.raise(g.UnexpectedTypeCastInParameter,t);this.toAssignable(t.expression,i);break;case"AssignmentExpression":if(!i&&t.left.type==="TSTypeCastExpression")t.left=this.typeCastToParameter(t.left);default:super.toAssignable(t,i)}}toAssignableParenthesizedExpression(t,i){switch(t.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(t.expression,i);break;default:super.toAssignable(t,i)}}checkToRestConversion(t,i){switch(t.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(t.expression,!1);break;default:super.checkToRestConversion(t,i)}}isValidLVal(t,i,a,n){switch(t){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(n!==64||!a)&&["expression",!0];default:return super.isValidLVal(t,i,a,n)}}parseBindingAtom(){if(this.state.type===78)return this.parseIdentifier(!0);return super.parseBindingAtom()}parseMaybeDecoratorArguments(t,i){if(this.match(47)||this.match(51)){let a=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let n=super.parseMaybeDecoratorArguments(t,i);return n.typeParameters=a,n}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(t,i)}checkCommaAfterRest(t){if(this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===t)return this.next(),!1;return super.checkCommaAfterRest(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(t,i){let a=super.parseMaybeDefault(t,i);if(a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start)this.raise(g.TypeAnnotationAfterAssign,a.typeAnnotation);return a}getTokenFromCode(t){if(this.state.inType){if(t===62){this.finishOp(48,1);return}if(t===60){this.finishOp(47,1);return}}super.getTokenFromCode(t)}reScan_lt_gt(){let{type:t}=this.state;if(t===47)this.state.pos-=1,this.readToken_lt();else if(t===48)this.state.pos-=1,this.readToken_gt()}reScan_lt(){let{type:t}=this.state;if(t===51)return this.state.pos-=2,this.finishOp(47,1),47;return t}toAssignableListItem(t,i,a){let n=t[i];if(n.type==="TSTypeCastExpression")t[i]=this.typeCastToParameter(n);super.toAssignableListItem(t,i,a)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}shouldParseArrow(t){if(this.match(14))return t.every((i)=>this.isAssignable(i,!0));return super.shouldParseArrow(t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(t){if(this.match(47)||this.match(51)){let i=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(i)t.typeParameters=i}return super.jsxParseOpeningElementAfterName(t)}getGetterSetterExpectedParamCount(t){let i=super.getGetterSetterExpectedParamCount(t),n=this.getObjectOrClassMethodParams(t)[0];return n&&this.isThisParam(n)?i+1:i}parseCatchClauseParam(){let t=super.parseCatchClauseParam(),i=this.tsTryParseTypeAnnotation();if(i)t.typeAnnotation=i,this.resetEndLocation(t);return t}tsInAmbientContext(t){let{isAmbientContext:i,strict:a}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return t()}finally{this.state.isAmbientContext=i,this.state.strict=a}}parseClass(t,i,a){let n=this.state.inAbstractClass;this.state.inAbstractClass=!!t.abstract;try{return super.parseClass(t,i,a)}finally{this.state.inAbstractClass=n}}tsParseAbstractDeclaration(t,i){if(this.match(80))return t.abstract=!0,this.maybeTakeDecorators(i,this.parseClass(t,!0,!1));else if(this.isContextual(129))if(!this.hasFollowingLineBreak())return t.abstract=!0,this.raise(g.NonClassMethodPropertyHasAbstractModifier,t),this.tsParseInterfaceDeclaration(t);else return null;throw this.unexpected(null,80)}parseMethod(t,i,a,n,o,l,h){let c=super.parseMethod(t,i,a,n,o,l,h);if(c.abstract||c.type==="TSAbstractMethodDefinition"){if((this.hasPlugin("estree")?c.value:c).body){let{key:f}=c;this.raise(g.AbstractMethodHasImplementation,c,{methodName:f.type==="Identifier"&&!c.computed?f.name:`[${this.input.slice(this.offsetToSourcePos(f.start),this.offsetToSourcePos(f.end))}]`})}}return c}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.parse()}getExpression(){if(this.shouldParseAsAmbientContext())this.state.isAmbientContext=!0;return super.getExpression()}parseExportSpecifier(t,i,a,n){if(!i&&n)return this.parseTypeOnlyImportExportSpecifier(t,!1,a),this.finishNode(t,"ExportSpecifier");return t.exportKind="value",super.parseExportSpecifier(t,i,a,n)}parseImportSpecifier(t,i,a,n,o){if(!i&&n)return this.parseTypeOnlyImportExportSpecifier(t,!0,a),this.finishNode(t,"ImportSpecifier");return t.importKind="value",super.parseImportSpecifier(t,i,a,n,a?4098:4096)}parseTypeOnlyImportExportSpecifier(t,i,a){let n=i?"imported":"local",o=i?"local":"exported",l=t[n],h,c=!1,u=!0,d=l.loc.start;if(this.isContextual(93)){let m=this.parseIdentifier();if(this.isContextual(93)){let x=this.parseIdentifier();if(q(this.state.type))c=!0,l=m,h=i?this.parseIdentifier():this.parseModuleExportName(),u=!1;else h=x,u=!1}else if(q(this.state.type))u=!1,h=i?this.parseIdentifier():this.parseModuleExportName();else c=!0,l=m}else if(q(this.state.type))if(c=!0,i){if(l=this.parseIdentifier(!0),!this.isContextual(93))this.checkReservedWord(l.name,l.loc.start,!0,!0)}else l=this.parseModuleExportName();if(c&&a)this.raise(i?g.TypeModifierIsUsedInTypeImports:g.TypeModifierIsUsedInTypeExports,d);t[n]=l,t[o]=h;let f=i?"importKind":"exportKind";if(t[f]=c?"type":"value",u&&this.eatContextual(93))t[o]=i?this.parseIdentifier():this.parseModuleExportName();if(!t[o])t[o]=this.cloneIdentifier(t[n]);if(i)this.checkIdentifier(t[o],c?4098:4096)}fillOptionalPropertiesForTSESLint(t){var i,a,n,o,l,h,c,u,d,f,m,x,T,S,C,k,z,B,te,se,Pt,bt,Tt,At,St,Ct,wt,It,vt,Et,Nt,kt,Lt,Mt,Ot,Dt,_t,Ft,Bt,Rt,Ut,jt,$t,Vt,qt,zt,Ht,Kt;switch(t.type){case"ExpressionStatement":(i=t.directive)!=null||(t.directive=void 0);return;case"RestElement":t.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(a=t.decorators)!=null||(t.decorators=[]),(n=t.optional)!=null||(t.optional=!1),(o=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);return;case"TSParameterProperty":(l=t.accessibility)!=null||(t.accessibility=void 0),(h=t.decorators)!=null||(t.decorators=[]),(c=t.override)!=null||(t.override=!1),(u=t.readonly)!=null||(t.readonly=!1),(d=t.static)!=null||(t.static=!1);return;case"TSEmptyBodyFunctionExpression":t.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(f=t.declare)!=null||(t.declare=!1),(m=t.returnType)!=null||(t.returnType=void 0),(x=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"Property":(T=t.optional)!=null||(t.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(S=t.optional)!=null||(t.optional=!1);case"TSIndexSignature":(C=t.accessibility)!=null||(t.accessibility=void 0),(k=t.readonly)!=null||(t.readonly=!1),(z=t.static)!=null||(t.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(B=t.declare)!=null||(t.declare=!1),(te=t.definite)!=null||(t.definite=!1),(se=t.readonly)!=null||(t.readonly=!1),(Pt=t.typeAnnotation)!=null||(t.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(bt=t.accessibility)!=null||(t.accessibility=void 0),(Tt=t.decorators)!=null||(t.decorators=[]),(At=t.override)!=null||(t.override=!1),(St=t.optional)!=null||(t.optional=!1);return;case"ClassExpression":(Ct=t.id)!=null||(t.id=null);case"ClassDeclaration":(wt=t.abstract)!=null||(t.abstract=!1),(It=t.declare)!=null||(t.declare=!1),(vt=t.decorators)!=null||(t.decorators=[]),(Et=t.implements)!=null||(t.implements=[]),(Nt=t.superTypeArguments)!=null||(t.superTypeArguments=void 0),(kt=t.typeParameters)!=null||(t.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(Lt=t.declare)!=null||(t.declare=!1);return;case"VariableDeclarator":(Mt=t.definite)!=null||(t.definite=!1);return;case"TSEnumDeclaration":(Ot=t.const)!=null||(t.const=!1),(Dt=t.declare)!=null||(t.declare=!1);return;case"TSEnumMember":(_t=t.computed)!=null||(t.computed=!1);return;case"TSImportType":(Ft=t.qualifier)!=null||(t.qualifier=null),(Bt=t.options)!=null||(t.options=null);return;case"TSInterfaceDeclaration":(Rt=t.declare)!=null||(t.declare=!1),(Ut=t.extends)!=null||(t.extends=[]);return;case"TSMappedType":(jt=t.optional)!=null||(t.optional=!1),($t=t.readonly)!=null||(t.readonly=void 0);return;case"TSModuleDeclaration":(Vt=t.declare)!=null||(t.declare=!1),(qt=t.global)!=null||(t.global=t.kind==="global");return;case"TSTypeParameter":(zt=t.const)!=null||(t.const=!1),(Ht=t.in)!=null||(t.in=!1),(Kt=t.out)!=null||(t.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(t,i){if(H(t)){if(Ze.lastIndex=i,Ze.test(this.input)){let a=this.codePointAtPos(Ze.lastIndex);if(!ae(a)&&a!==92)return!1}return!0}else if(t===92)return!0;else return!1}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let t=this.nextTokenInLineStart(),i=this.codePointAtPos(t);return this.chStartsBindingIdentifierAndNotRelationalOperator(i,t)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let t=this.nextTokenInLineStart(),i=this.codePointAtPos(t);return this.chStartsBindingIdentifier(i,t)||i===34||i===39}};function Ca(s){if(s.type!=="MemberExpression")return!1;let{computed:r,property:t}=s;if(r&&t.type!=="StringLiteral"&&(t.type!=="TemplateLiteral"||t.expressions.length>0))return!1;return si(s.object)}function wa(s,r){var t;let{type:i}=s;if((t=s.extra)!=null&&t.parenthesized)return!1;if(r){if(i==="Literal"){let{value:a}=s;if(typeof a==="string"||typeof a==="boolean")return!0}}else if(i==="StringLiteral"||i==="BooleanLiteral")return!0;if(ti(s,r)||Ia(s,r))return!0;if(i==="TemplateLiteral"&&s.expressions.length===0)return!0;if(Ca(s))return!0;return!1}function ti(s,r){if(r)return s.type==="Literal"&&(typeof s.value==="number"||("bigint"in s));return s.type==="NumericLiteral"||s.type==="BigIntLiteral"}function Ia(s,r){if(s.type==="UnaryExpression"){let{operator:t,argument:i}=s;if(t==="-"&&ti(i,r))return!0}return!1}function si(s){if(s.type==="Identifier")return!0;if(s.type!=="MemberExpression"||s.computed)return!1;return si(s.object)}var Is=V`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),va=(s)=>class extends s{parsePlaceholder(t){if(this.match(133)){let i=this.startNode();return this.next(),this.assertNoSpace(),i.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(i,t)}}finishPlaceholder(t,i){let a=t;if(!a.expectedNode||!a.type)a=this.finishNode(a,"Placeholder");return a.expectedNode=i,a}getTokenFromCode(t){if(t===37&&this.input.charCodeAt(this.state.pos+1)===37)this.finishOp(133,2);else super.getTokenFromCode(t)}parseExprAtom(t){return this.parsePlaceholder("Expression")||super.parseExprAtom(t)}parseIdentifier(t){return this.parsePlaceholder("Identifier")||super.parseIdentifier(t)}checkReservedWord(t,i,a,n){if(t!==void 0)super.checkReservedWord(t,i,a,n)}cloneIdentifier(t){let i=super.cloneIdentifier(t);if(i.type==="Placeholder")i.expectedNode=t.expectedNode;return i}cloneStringLiteral(t){if(t.type==="Placeholder")return this.cloneIdentifier(t);return super.cloneStringLiteral(t)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(t,i,a,n){return t==="Placeholder"||super.isValidLVal(t,i,a,n)}toAssignable(t,i){if(t&&t.type==="Placeholder"&&t.expectedNode==="Expression")t.expectedNode="Pattern";else super.toAssignable(t,i)}chStartsBindingIdentifier(t,i){if(super.chStartsBindingIdentifier(t,i))return!0;let a=this.nextTokenStart();if(this.input.charCodeAt(a)===37&&this.input.charCodeAt(a+1)===37)return!0;return!1}verifyBreakContinue(t,i){var a;if(((a=t.label)==null?void 0:a.type)==="Placeholder")return;super.verifyBreakContinue(t,i)}parseExpressionStatement(t,i){var a;if(i.type!=="Placeholder"||(a=i.extra)!=null&&a.parenthesized)return super.parseExpressionStatement(t,i);if(this.match(14)){let o=t;return o.label=this.finishPlaceholder(i,"Identifier"),this.next(),o.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(o,"LabeledStatement")}this.semicolon();let n=t;return n.name=i.name,this.finishPlaceholder(n,"Statement")}parseBlock(t,i,a){return this.parsePlaceholder("BlockStatement")||super.parseBlock(t,i,a)}parseFunctionId(t){return this.parsePlaceholder("Identifier")||super.parseFunctionId(t)}parseClass(t,i,a){let n=i?"ClassDeclaration":"ClassExpression";this.next();let o=this.state.strict,l=this.parsePlaceholder("Identifier");if(l)if(this.match(81)||this.match(133)||this.match(5))t.id=l;else if(a||!i)return t.id=null,t.body=this.finishPlaceholder(l,"ClassBody"),this.finishNode(t,n);else throw this.raise(Is.ClassNameIsRequired,this.state.startLoc);else this.parseClassId(t,i,a);return super.parseClassSuper(t),t.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!t.superClass,o),this.finishNode(t,n)}parseExport(t,i){let a=this.parsePlaceholder("Identifier");if(!a)return super.parseExport(t,i);let n=t;if(!this.isContextual(98)&&!this.match(12))return n.specifiers=[],n.source=null,n.declaration=this.finishPlaceholder(a,"Declaration"),this.finishNode(n,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let o=this.startNode();return o.exported=a,n.specifiers=[this.finishNode(o,"ExportDefaultSpecifier")],super.parseExport(n,i)}isExportDefaultSpecifier(){if(this.match(65)){let t=this.nextTokenStart();if(this.isUnparsedContextual(t,"from")){if(this.input.startsWith(ee(133),this.nextTokenStartSince(t+4)))return!0}}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(t,i){var a;if((a=t.specifiers)!=null&&a.length)return!0;return super.maybeParseExportDefaultSpecifier(t,i)}checkExport(t){let{specifiers:i}=t;if(i!=null&&i.length)t.specifiers=i.filter((a)=>a.exported.type==="Placeholder");super.checkExport(t),t.specifiers=i}parseImport(t){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseImport(t);if(t.specifiers=[],!this.isContextual(98)&&!this.match(12))return t.source=this.finishPlaceholder(i,"StringLiteral"),this.semicolon(),this.finishNode(t,"ImportDeclaration");let a=this.startNodeAtNode(i);if(a.local=i,t.specifiers.push(this.finishNode(a,"ImportDefaultSpecifier")),this.eat(12)){if(!this.maybeParseStarImportSpecifier(t))this.parseNamedImportSpecifiers(t)}return this.expectContextual(98),t.source=this.parseImportSource(),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){if(this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index))this.raise(Is.UnexpectedSpace,this.state.lastTokEndLoc)}},Ea=(s)=>class extends s{parseV8Intrinsic(){if(this.match(54)){let t=this.state.startLoc,i=this.startNode();if(this.next(),N(this.state.type)){let a=this.parseIdentifierName(),n=this.createIdentifier(i,a);if(this.castNodeTo(n,"V8IntrinsicIdentifier"),this.match(10))return n}this.unexpected(t)}}parseExprAtom(t){return this.parseV8Intrinsic()||super.parseExprAtom(t)}},vs=["minimal","fsharp","hack","smart"],Es=["^^","@@","^","%","#"];function Na(s){if(s.has("decorators")){if(s.has("decorators-legacy"))throw Error("Cannot use the decorators and decorators-legacy plugin together");let i=s.get("decorators").decoratorsBeforeExport;if(i!=null&&typeof i!=="boolean")throw Error("'decoratorsBeforeExport' must be a boolean, if specified.");let a=s.get("decorators").allowCallParenthesized;if(a!=null&&typeof a!=="boolean")throw Error("'allowCallParenthesized' must be a boolean.")}if(s.has("flow")&&s.has("typescript"))throw Error("Cannot combine flow and typescript plugins.");if(s.has("placeholders")&&s.has("v8intrinsic"))throw Error("Cannot combine placeholders and v8intrinsic plugins.");if(s.has("pipelineOperator")){var r;let i=s.get("pipelineOperator").proposal;if(!vs.includes(i)){let a=vs.map((n)=>`"${n}"`).join(", ");throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${a}.`)}if(i==="hack"){var t;if(s.has("placeholders"))throw Error("Cannot combine placeholders plugin and Hack-style pipes.");if(s.has("v8intrinsic"))throw Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let a=s.get("pipelineOperator").topicToken;if(!Es.includes(a)){let n=Es.map((o)=>`"${o}"`).join(", ");throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${n}.`)}if(a==="#"&&((t=s.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",s.get("recordAndTuple")])}\`.`)}else if(i==="smart"&&((r=s.get("recordAndTuple"))==null?void 0:r.syntaxType)==="hash")throw Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",s.get("recordAndTuple")])}\`.`)}if(s.has("moduleAttributes")){if(s.has("deprecatedImportAssert")||s.has("importAssertions"))throw Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(s.get("moduleAttributes").version!=="may-2020")throw Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(s.has("importAssertions")){if(s.has("deprecatedImportAssert"))throw Error("Cannot combine importAssertions and deprecatedImportAssert plugins.")}if(s.has("deprecatedImportAssert"));else if(s.has("importAttributes")&&s.get("importAttributes").deprecatedAssertSyntax)s.set("deprecatedImportAssert",{});if(s.has("recordAndTuple")){let i=s.get("recordAndTuple").syntaxType;if(i!=null){let a=["hash","bar"];if(!a.includes(i))throw Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+a.map((n)=>`'${n}'`).join(", "))}}if(s.has("asyncDoExpressions")&&!s.has("doExpressions")){let i=Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw i.missingPlugins="doExpressions",i}if(s.has("optionalChainingAssign")&&s.get("optionalChainingAssign").version!=="2023-07")throw Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(s.has("discardBinding")&&s.get("discardBinding").syntaxType!=="void")throw Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}var ii={estree:Or,jsx:ua,flow:oa,typescript:Sa,v8intrinsic:Ea,placeholders:va},ka=Object.keys(ii);class ri extends ei{checkProto(s,r,t,i){if(s.type==="SpreadElement"||this.isObjectMethod(s)||s.computed||s.shorthand)return t;let a=s.key;if((a.type==="Identifier"?a.name:a.value)==="__proto__"){if(r)return this.raise(p.RecordNoProto,a),!0;if(t)if(i){if(i.doubleProtoLoc===null)i.doubleProtoLoc=a.loc.start}else this.raise(p.DuplicateProto,a);return!0}return t}shouldExitDescending(s,r){return s.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(s.start)===r}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(p.ParseExpressionEmptyInput,this.state.startLoc);let s=this.parseExpression();if(!this.match(140))throw this.raise(p.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});if(this.finalizeRemainingComments(),s.comments=this.comments,s.errors=this.state.errors,this.optionFlags&256)s.tokens=this.tokens;return s}parseExpression(s,r){if(s)return this.disallowInAnd(()=>this.parseExpressionBase(r));return this.allowInAnd(()=>this.parseExpressionBase(r))}parseExpressionBase(s){let r=this.state.startLoc,t=this.parseMaybeAssign(s);if(this.match(12)){let i=this.startNodeAt(r);i.expressions=[t];while(this.eat(12))i.expressions.push(this.parseMaybeAssign(s));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(s,r){return this.disallowInAnd(()=>this.parseMaybeAssign(s,r))}parseMaybeAssignAllowIn(s,r){return this.allowInAnd(()=>this.parseMaybeAssign(s,r))}setOptionalParametersError(s){s.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(s,r){let t=this.state.startLoc,i=this.isContextual(108);if(i){if(this.prodParam.hasYield){this.next();let l=this.parseYield(t);if(r)l=r.call(this,l,t);return l}}let a;if(s)a=!1;else s=new Ae,a=!0;let{type:n}=this.state;if(n===10||N(n))this.state.potentialArrowAt=this.state.start;let o=this.parseMaybeConditional(s);if(r)o=r.call(this,o,t);if(Rr(this.state.type)){let l=this.startNodeAt(t),h=this.state.value;if(l.operator=h,this.match(29)){this.toAssignable(o,!0),l.left=o;let c=t.index;if(s.doubleProtoLoc!=null&&s.doubleProtoLoc.index>=c)s.doubleProtoLoc=null;if(s.shorthandAssignLoc!=null&&s.shorthandAssignLoc.index>=c)s.shorthandAssignLoc=null;if(s.privateKeyLoc!=null&&s.privateKeyLoc.index>=c)this.checkDestructuringPrivate(s),s.privateKeyLoc=null;if(s.voidPatternLoc!=null&&s.voidPatternLoc.index>=c)s.voidPatternLoc=null}else l.left=o;return this.next(),l.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(l,"AssignmentExpression"),void 0,void 0,void 0,void 0,h==="||="||h==="&&="||h==="??="),l}else if(a)this.checkExpressionErrors(s,!0);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Pe(l):Pe(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.YieldNotInGeneratorFunction,t),this.parseYield(t)}return o}parseMaybeConditional(s){let r=this.state.startLoc,t=this.state.potentialArrowAt,i=this.parseExprOps(s);if(this.shouldExitDescending(i,t))return i;return this.parseConditional(i,r,s)}parseConditional(s,r,t){if(this.eat(17)){let i=this.startNodeAt(r);return i.test=s,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return s}parseMaybeUnaryOrPrivate(s){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(s)}parseExprOps(s){let r=this.state.startLoc,t=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(s);if(this.shouldExitDescending(i,t))return i;return this.parseExprOp(i,r,-1)}parseExprOp(s,r,t){if(this.isPrivateName(s)){let a=this.getPrivateNameSV(s);if(t>=Oe(58)||!this.prodParam.hasIn||!this.match(58))this.raise(p.PrivateInExpectedIn,s,{identifierName:a});this.classScope.usePrivateName(a,s.loc.start)}let i=this.state.type;if(jr(i)&&(this.prodParam.hasIn||!this.match(58))){let a=Oe(i);if(a>t){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return s;this.checkPipelineAtInfixOperator(s,r)}let n=this.startNodeAt(r);n.left=s,n.operator=this.state.value;let o=i===41||i===42,l=i===40;if(l)a=Oe(42);if(this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])){if(this.state.type===96&&this.prodParam.hasAwait)throw this.raise(p.UnexpectedAwaitAfterPipelineBody,this.state.startLoc)}n.right=this.parseExprOpRightExpr(i,a);let h=this.finishNode(n,o||l?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(l&&(c===41||c===42)||o&&c===40)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,r,t)}}return s}parseExprOpRightExpr(s,r){let t=this.state.startLoc;switch(s){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(r))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(p.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(s,r),t)});default:return this.parseExprOpBaseRightExpr(s,r)}}parseExprOpBaseRightExpr(s,r){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,Hr(s)?r-1:r)}parseHackPipeBody(){var s;let{startLoc:r}=this.state,t=this.parseMaybeAssign();if(wr.has(t.type)&&!((s=t.extra)!=null&&s.parenthesized))this.raise(p.PipeUnparenthesizedBody,r,{type:t.type});if(!this.topicReferenceWasUsedInCurrentContext())this.raise(p.PipeTopicUnused,r);return t}checkExponentialAfterUnary(s){if(this.match(57))this.raise(p.UnexpectedTokenUnaryExponentiation,s.argument)}parseMaybeUnary(s,r){let t=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(t);if(!r)this.checkExponentialAfterUnary(l);return l}let a=this.match(34),n=this.startNode();if(Vr(this.state.type)){if(n.operator=this.state.value,n.prefix=!0,this.match(72))this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(s,!0),this.state.strict&&l){let h=n.argument;if(h.type==="Identifier")this.raise(p.StrictDelete,n);else if(this.hasPropertyAsPrivateName(h))this.raise(p.DeletePrivateField,n)}if(!a){if(!r)this.checkExponentialAfterUnary(n);return this.finishNode(n,"UnaryExpression")}}let o=this.parseUpdate(n,a,s);if(i){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Pe(l):Pe(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.AwaitNotInAsyncContext,t),this.parseAwait(t)}return o}parseUpdate(s,r,t){if(r){let n=s;return this.checkLVal(n.argument,this.finishNode(n,"UpdateExpression")),s}let i=this.state.startLoc,a=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return a;while($r(this.state.type)&&!this.canInsertSemicolon()){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=a,this.next(),this.checkLVal(a,a=this.finishNode(n,"UpdateExpression"))}return a}parseExprSubscripts(s){let r=this.state.startLoc,t=this.state.potentialArrowAt,i=this.parseExprAtom(s);if(this.shouldExitDescending(i,t))return i;return this.parseSubscripts(i,r)}parseSubscripts(s,r,t){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(s),stop:!1};do s=this.parseSubscript(s,r,t,i),i.maybeAsyncArrow=!1;while(!i.stop);return s}parseSubscript(s,r,t,i){let{type:a}=this.state;if(!t&&a===15)return this.parseBind(s,r,i);else if(_e(a))return this.parseTaggedTemplateExpression(s,r,i);let n=!1;if(a===18){if(t){if(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40)return this.stopParseSubscript(s,i)}i.optionalChainMember=n=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(s,r,i,n);else{let o=this.eat(0);if(o||n||this.eat(16))return this.parseMember(s,r,i,o,n);else return this.stopParseSubscript(s,i)}}stopParseSubscript(s,r){return r.stop=!0,s}parseMember(s,r,t,i,a){let n=this.startNodeAt(r);if(n.object=s,n.computed=i,i)n.property=this.parseExpression(),this.expect(3);else if(this.match(139)){if(s.type==="Super")this.raise(p.SuperPrivateField,r);this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()}else n.property=this.parseIdentifier(!0);if(t.optionalChainMember)return n.optional=a,this.finishNode(n,"OptionalMemberExpression");else return this.finishNode(n,"MemberExpression")}parseBind(s,r,t){let i=this.startNodeAt(r);i.object=s,this.next();let a=this.match(83),n=this.parseNoCallExpr();if(n.type==="Super"||a&&n.type==="ImportExpression"||n.type==="Import")throw this.raise(p.UnsupportedBindRHS,n);return i.callee=n,t.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),r,!1)}parseCoverCallAndAsyncArrowHead(s,r,t,i){let a=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(r);o.callee=s;let{maybeAsyncArrow:l,optionalChainMember:h}=t;if(l)this.expressionScope.enter(Pa()),n=new Ae;if(h)o.optional=i;if(i)o.arguments=this.parseCallExpressionArguments();else o.arguments=this.parseCallExpressionArguments(s.type!=="Super",o,n);let c=this.finishCallExpression(o,h);if(l&&this.shouldParseAsyncArrow()&&!i)t.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(r),c);else{if(l)this.checkExpressionErrors(n,!0),this.expressionScope.exit();this.toReferencedArguments(c)}return this.state.maybeInArrowParameters=a,c}toReferencedArguments(s,r){this.toReferencedListDeep(s.arguments,r)}parseTaggedTemplateExpression(s,r,t){let i=this.startNodeAt(r);if(i.tag=s,i.quasi=this.parseTemplate(!0),t.optionalChainMember)this.raise(p.OptionalChainingNoTemplate,r);return this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(s){return s.type==="Identifier"&&s.name==="async"&&this.state.lastTokEndLoc.index===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&this.offsetToSourcePos(s.start)===this.state.potentialArrowAt}finishCallExpression(s,r){if(s.callee.type==="Import"){if(s.arguments.length===0||s.arguments.length>2)this.raise(p.ImportCallArity,s);else for(let t of s.arguments)if(t.type==="SpreadElement")this.raise(p.ImportCallSpreadArgument,t)}return this.finishNode(s,r?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(s,r,t){let i=[],a=!0,n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;while(!this.eat(11)){if(a)a=!1;else if(this.expect(12),this.match(11)){if(r)this.addTrailingCommaExtraToNode(r);this.next();break}i.push(this.parseExprListItem(11,!1,t,s))}return this.state.inFSharpPipelineDirectBody=n,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(s,r){var t;if(this.resetPreviousNodeTrailingComments(r),this.expect(19),this.parseArrowExpression(s,r.arguments,!0,(t=r.extra)==null?void 0:t.trailingCommaLoc),r.innerComments)Ce(s,r.innerComments);if(r.callee.trailingComments)Ce(s,r.callee.trailingComments);return s}parseNoCallExpr(){let s=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),s,!0)}parseExprAtom(s){let r,t=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:if(r=this.startNode(),this.next(),this.match(16))return this.parseImportMetaPropertyOrPhaseCall(r);if(this.match(10))if(this.optionFlags&512)return this.parseImportCall(r);else return this.finishNode(r,"Import");else return this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(r,"Import");case 78:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}case 0:return this.parseArrayLike(3,!1,s);case 5:return this.parseObjectLike(8,!1,!1,s);case 68:return this.parseFunctionOrFunctionSent();case 26:t=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(t,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{r=this.startNode(),this.next(),r.object=null;let a=r.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(r,"BindExpression");else throw this.raise(p.UnsupportedBind,a)}case 139:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);throw this.unexpected()}case 47:{let a=this.input.codePointAt(this.nextTokenStart());if(H(a)||a===62)throw this.expectOnePlugin(["jsx","flow","typescript"]);throw this.unexpected()}default:if(i===137)return this.parseDecimalLiteral(this.state.value);else if(i===2||i===1)return this.parseArrayLike(this.state.type===2?4:3,!0);else if(i===6||i===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(N(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));else if(N(l))if(a&&this.lookaheadCharCode()===61)return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o));else return o;else if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}if(a&&this.match(19)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1);return o}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(s,r){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=s,this.state.value=r,this.state.pos--,this.state.end--,this.state.endLoc=_(this.state.endLoc,-1),this.parseTopicReference(t);throw this.unexpected()}parseTopicReference(s){let r=this.startNode(),t=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(r,t,s,i)}finishTopicReference(s,r,t,i){if(this.testTopicReferenceConfiguration(t,r,i))if(t==="hack"){if(!this.topicReferenceIsAllowedInCurrentContext())this.raise(p.PipeTopicUnbound,r);return this.registerTopicReference(),this.finishNode(s,"TopicReference")}else{if(!this.topicReferenceIsAllowedInCurrentContext())this.raise(p.PrimaryTopicNotAllowed,r);return this.registerTopicReference(),this.finishNode(s,"PipelinePrimaryTopicReference")}else throw this.raise(p.PipeTopicUnconfiguredToken,r,{token:ee(i)})}testTopicReferenceConfiguration(s,r,t){switch(s){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:ee(t)}]);case"smart":return t===27;default:throw this.raise(p.PipeTopicRequiresHackPipes,r)}}parseAsyncArrowUnaryFunction(s){this.prodParam.enter(De(!0,this.prodParam.hasYield));let r=[this.parseIdentifier()];if(this.prodParam.exit(),this.hasPrecedingLineBreak())this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition());return this.expect(19),this.parseArrowExpression(s,r,!0)}parseDo(s,r){if(this.expectPlugin("doExpressions"),r)this.expectPlugin("asyncDoExpressions");s.async=r,this.next();let t=this.state.labels;if(this.state.labels=[],r)this.prodParam.enter(2),s.body=this.parseBlock(),this.prodParam.exit();else s.body=this.parseBlock();return this.state.labels=t,this.finishNode(s,"DoExpression")}parseSuper(){let s=this.startNode();if(this.next(),this.match(10)&&!this.scope.allowDirectSuper){if(!(this.optionFlags&16))this.raise(p.SuperNotAllowed,s)}else if(!this.scope.allowSuper){if(!(this.optionFlags&16))this.raise(p.UnexpectedSuper,s)}if(!this.match(10)&&!this.match(0)&&!this.match(16))this.raise(p.UnsupportedSuper,s);return this.finishNode(s,"Super")}parsePrivateName(){let s=this.startNode(),r=this.startNodeAt(_(this.state.startLoc,1)),t=this.state.value;return this.next(),s.id=this.createIdentifier(r,t),this.finishNode(s,"PrivateName")}parseFunctionOrFunctionSent(){let s=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let r=this.createIdentifier(this.startNodeAtNode(s),"function");if(this.next(),this.match(103))this.expectPlugin("functionSent");else if(!this.hasPlugin("functionSent"))this.unexpected();return this.parseMetaProperty(s,r,"sent")}return this.parseFunction(s)}parseMetaProperty(s,r,t){s.meta=r;let i=this.state.containsEsc;if(s.property=this.parseIdentifier(!0),s.property.name!==t||i)this.raise(p.UnsupportedMetaProperty,s.property,{target:r.name,onlyValidPropertyName:t});return this.finishNode(s,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(s){if(this.next(),this.isContextual(105)||this.isContextual(97)){let r=this.isContextual(105);return this.expectPlugin(r?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),s.phase=r?"source":"defer",this.parseImportCall(s)}else{let r=this.createIdentifierAt(this.startNodeAtNode(s),"import",this.state.lastTokStartLoc);if(this.isContextual(101)){if(!this.inModule)this.raise(p.ImportMetaOutsideModule,r);this.sawUnambiguousESM=!0}return this.parseMetaProperty(s,r,"meta")}}parseLiteralAtNode(s,r,t){return this.addExtra(t,"rawValue",s),this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.value=s,this.next(),this.finishNode(t,r)}parseLiteral(s,r){let t=this.startNode();return this.parseLiteralAtNode(s,r,t)}parseStringLiteral(s){return this.parseLiteral(s,"StringLiteral")}parseNumericLiteral(s){return this.parseLiteral(s,"NumericLiteral")}parseBigIntLiteral(s){return this.parseLiteral(s,"BigIntLiteral")}parseDecimalLiteral(s){return this.parseLiteral(s,"DecimalLiteral")}parseRegExpLiteral(s){let r=this.startNode();return this.addExtra(r,"raw",this.input.slice(this.offsetToSourcePos(r.start),this.state.end)),r.pattern=s.pattern,r.flags=s.flags,this.next(),this.finishNode(r,"RegExpLiteral")}parseBooleanLiteral(s){let r=this.startNode();return r.value=s,this.next(),this.finishNode(r,"BooleanLiteral")}parseNullLiteral(){let s=this.startNode();return this.next(),this.finishNode(s,"NullLiteral")}parseParenAndDistinguishExpression(s){let r=this.state.startLoc,t;this.next(),this.expressionScope.enter(ga());let i=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],l=new Ae,h=!0,c,u;while(!this.match(11)){if(h)h=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let m=this.state.startLoc;if(c=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),m)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowInOrVoidPattern(11,l,this.parseParenItem))}let d=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=a;let f=this.startNodeAt(r);if(s&&this.shouldParseArrow(o)&&(f=this.parseArrow(f)))return this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f;if(this.expressionScope.exit(),!o.length)this.unexpected(this.state.lastTokStartLoc);if(u)this.unexpected(u);if(c)this.unexpected(c);if(this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1)t=this.startNodeAt(n),t.expressions=o,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,d);else t=o[0];return this.wrapParenthesis(r,t)}wrapParenthesis(s,r){if(!(this.optionFlags&1024))return this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",s.index),this.takeSurroundingComments(r,s.index,this.state.lastTokEndLoc.index),r;let t=this.startNodeAt(s);return t.expression=r,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(s){return!this.canInsertSemicolon()}parseArrow(s){if(this.eat(19))return s}parseParenItem(s,r){return s}parseNewOrNewTarget(){let s=this.startNode();if(this.next(),this.match(16)){let r=this.createIdentifier(this.startNodeAtNode(s),"new");this.next();let t=this.parseMetaProperty(s,r,"target");if(!this.scope.allowNewTarget)this.raise(p.UnexpectedNewTarget,t);return t}return this.parseNew(s)}parseNew(s){if(this.parseNewCallee(s),this.eat(10)){let r=this.parseExprList(11);this.toReferencedList(r),s.arguments=r}else s.arguments=[];return this.finishNode(s,"NewExpression")}parseNewCallee(s){let r=this.match(83),t=this.parseNoCallExpr();if(s.callee=t,r&&t.type==="ImportExpression"||t.type==="Import")this.raise(p.ImportCallNotNewExpression,t);if(t.type==="Super")this.raise(p.SuperCallNotNewExpression,t)}parseTemplateElement(s){let{start:r,startLoc:t,end:i,value:a}=this.state,n=r+1,o=this.startNodeAt(_(t,1));if(a===null){if(!s)this.raise(p.InvalidEscapeSequenceTemplate,_(this.state.firstInvalidTemplateEscapePos,1))}let l=this.match(24),h=l?-1:-2,c=i+h;o.value={raw:this.input.slice(n,c).replace(/\r\n?/g,`
|
|
9
|
+
`),cooked:a===null?null:a.slice(1,h)},o.tail=l,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,_(this.state.lastTokEndLoc,h)),u}parseTemplate(s){let r=this.startNode(),t=this.parseTemplateElement(s),i=[t],a=[];while(!t.tail)a.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(t=this.parseTemplateElement(s));return r.expressions=a,r.quasis=i,this.finishNode(r,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(s,r,t,i){if(t)this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=!1,o=!0,l=this.startNode();l.properties=[],this.next();while(!this.match(s)){if(o)o=!1;else if(this.expect(12),this.match(s)){this.addTrailingCommaExtraToNode(l);break}let c;if(r)c=this.parseBindingProperty();else c=this.parsePropertyDefinition(i),n=this.checkProto(c,t,n,i);if(t&&!this.isObjectProperty(c)&&c.type!=="SpreadElement")this.raise(p.InvalidRecordProperty,c);if(c.shorthand)this.addExtra(c,"shorthand",!0);l.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=a;let h="ObjectExpression";if(r)h="ObjectPattern";else if(t)h="RecordExpression";return this.finishNode(l,h)}addTrailingCommaExtraToNode(s){this.addExtra(s,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(s,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(s){return!s.computed&&s.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(s){let r=[];if(this.match(26)){if(this.hasPlugin("decorators"))this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);while(this.match(26))r.push(this.parseDecorator())}let t=this.startNode(),i=!1,a=!1,n;if(this.match(21)){if(r.length)this.unexpected();return this.parseSpread()}if(r.length)t.decorators=r,r=[];if(t.method=!1,s)n=this.state.startLoc;let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc;if(this.parsePropertyName(t,s),!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let{key:h}=t,c=h.name;if(c==="async"&&!this.hasPrecedingLineBreak())i=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(t);if(c==="get"||c==="set"){if(a=!0,this.resetPreviousNodeTrailingComments(h),t.kind=c,this.match(55))o=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next();this.parsePropertyName(t)}}return this.parseObjPropValue(t,n,o,i,!1,a,s)}getGetterSetterExpectedParamCount(s){return s.kind==="get"?0:1}getObjectOrClassMethodParams(s){return s.params}checkGetterSetterParams(s){var r;let t=this.getGetterSetterExpectedParamCount(s),i=this.getObjectOrClassMethodParams(s);if(i.length!==t)this.raise(s.kind==="get"?p.BadGetterArity:p.BadSetterArity,s);if(s.kind==="set"&&((r=i[i.length-1])==null?void 0:r.type)==="RestElement")this.raise(p.BadSetterRestParameter,s)}parseObjectMethod(s,r,t,i,a){if(a){let n=this.parseMethod(s,r,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(t||r||this.match(10)){if(i)this.unexpected();return s.kind="method",s.method=!0,this.parseMethod(s,r,t,!1,!1,"ObjectMethod")}}parseObjectProperty(s,r,t,i){if(s.shorthand=!1,this.eat(14))return s.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,i),this.finishObjectProperty(s);if(!s.computed&&s.key.type==="Identifier"){if(this.checkReservedWord(s.key.name,s.key.loc.start,!0,!1),t)s.value=this.parseMaybeDefault(r,this.cloneIdentifier(s.key));else if(this.match(29)){let a=this.state.startLoc;if(i!=null){if(i.shorthandAssignLoc===null)i.shorthandAssignLoc=a}else this.raise(p.InvalidCoverInitializedName,a);s.value=this.parseMaybeDefault(r,this.cloneIdentifier(s.key))}else s.value=this.cloneIdentifier(s.key);return s.shorthand=!0,this.finishObjectProperty(s)}}finishObjectProperty(s){return this.finishNode(s,"ObjectProperty")}parseObjPropValue(s,r,t,i,a,n,o){let l=this.parseObjectMethod(s,t,i,a,n)||this.parseObjectProperty(s,r,a,o);if(!l)this.unexpected();return l}parsePropertyName(s,r){if(this.eat(0))s.computed=!0,s.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:i}=this.state,a;if(q(t))a=this.parseIdentifier(!0);else switch(t){case 135:a=this.parseNumericLiteral(i);break;case 134:a=this.parseStringLiteral(i);break;case 136:a=this.parseBigIntLiteral(i);break;case 139:{let n=this.state.startLoc;if(r!=null){if(r.privateKeyLoc===null)r.privateKeyLoc=n}else this.raise(p.UnexpectedPrivateField,n);a=this.parsePrivateName();break}default:if(t===137){a=this.parseDecimalLiteral(i);break}this.unexpected()}if(s.key=a,t!==139)s.computed=!1}}initFunction(s,r){s.id=null,s.generator=!1,s.async=r}parseMethod(s,r,t,i,a,n,o=!1){this.initFunction(s,t),s.generator=r,this.scope.enter(530|(o?576:0)|(a?32:0)),this.prodParam.enter(De(t,s.generator)),this.parseFunctionParams(s,i);let l=this.parseFunctionBodyAndFinish(s,n,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(s,r,t){if(r)this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(s,!r,t,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,r?"TupleExpression":"ArrayExpression")}parseArrowExpression(s,r,t,i){this.scope.enter(518);let a=De(t,!1);if(!this.match(5)&&this.prodParam.hasIn)a|=8;this.prodParam.enter(a),this.initFunction(s,t);let n=this.state.maybeInArrowParameters;if(r)this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(s,r,i);return this.state.maybeInArrowParameters=!1,this.parseFunctionBody(s,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(s,"ArrowFunctionExpression")}setArrowFunctionParameters(s,r,t){this.toAssignableList(r,t,!1),s.params=r}parseFunctionBodyAndFinish(s,r,t=!1){return this.parseFunctionBody(s,!1,t),this.finishNode(s,r)}parseFunctionBody(s,r,t=!1){let i=r&&!this.match(5);if(this.expressionScope.enter(Ys()),i)s.body=this.parseMaybeAssign(),this.checkParams(s,!1,r,!1);else{let a=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),s.body=this.parseBlock(!0,!1,(o)=>{let l=!this.isSimpleParamList(s.params);if(o&&l)this.raise(p.IllegalLanguageModeDirective,(s.kind==="method"||s.kind==="constructor")&&!!s.key?s.key.loc.end:s);let h=!a&&this.state.strict;if(this.checkParams(s,!this.state.strict&&!r&&!t&&!l,r,h),this.state.strict&&s.id)this.checkIdentifier(s.id,65,h)}),this.prodParam.exit(),this.state.labels=n}this.expressionScope.exit()}isSimpleParameter(s){return s.type==="Identifier"}isSimpleParamList(s){for(let r=0,t=s.length;r<t;r++)if(!this.isSimpleParameter(s[r]))return!1;return!0}checkParams(s,r,t,i=!0){let a=!r&&new Set,n={type:"FormalParameters"};for(let o of s.params)this.checkLVal(o,n,5,a,i)}parseExprList(s,r,t,i){let a=[],n=!0;while(!this.eat(s)){if(n)n=!1;else if(this.expect(12),this.match(s)){if(i)this.addTrailingCommaExtraToNode(i);this.next();break}a.push(this.parseExprListItem(s,r,t))}return a}parseExprListItem(s,r,t,i){let a;if(this.match(12)){if(!r)this.raise(p.UnexpectedToken,this.state.curPosition(),{unexpected:","});a=null}else if(this.match(21)){let n=this.state.startLoc;a=this.parseParenItem(this.parseSpread(t),n)}else if(this.match(17)){if(this.expectPlugin("partialApplication"),!i)this.raise(p.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),a=this.finishNode(n,"ArgumentPlaceholder")}else a=this.parseMaybeAssignAllowInOrVoidPattern(s,t,this.parseParenItem);return a}parseIdentifier(s){let r=this.startNode(),t=this.parseIdentifierName(s);return this.createIdentifier(r,t)}createIdentifier(s,r){return s.name=r,s.loc.identifierName=r,this.finishNode(s,"Identifier")}createIdentifierAt(s,r,t){return s.name=r,s.loc.identifierName=r,this.finishNodeAt(s,"Identifier",t)}parseIdentifierName(s){let r,{startLoc:t,type:i}=this.state;if(q(i))r=this.state.value;else this.unexpected();let a=Fr(i);if(s){if(a)this.replaceToken(132)}else this.checkReservedWord(r,t,a,!1);return this.next(),r}checkReservedWord(s,r,t,i){if(s.length>10)return;if(!ta(s))return;if(t&&Qr(s)){this.raise(p.UnexpectedKeyword,r,{keyword:s});return}if((!this.state.strict?Os:i?Fs:Ds)(s,this.inModule)){this.raise(p.UnexpectedReservedWord,r,{reservedWord:s});return}else if(s==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,r);return}}else if(s==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,r);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,r);return}this.expressionScope.recordAsyncArrowParametersError(r)}else if(s==="arguments"){if(this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,r);return}}}recordAwaitIfAllowed(){let s=this.prodParam.hasAwait;if(s&&!this.scope.inFunction)this.state.hasTopLevelAwait=!0;return s}parseAwait(s){let r=this.startNodeAt(s);if(this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,r),this.eat(55))this.raise(p.ObsoleteAwaitStar,r);if(!this.scope.inFunction&&!(this.optionFlags&1))if(this.isAmbiguousPrefixOrIdentifier())this.ambiguousScriptDifferentAst=!0;else this.sawUnambiguousESM=!0;if(!this.state.soloAwait)r.argument=this.parseMaybeUnary(null,!0);return this.finishNode(r,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:s}=this.state;return s===53||s===10||s===0||_e(s)||s===102&&!this.state.containsEsc||s===138||s===56||this.hasPlugin("v8intrinsic")&&s===54}parseYield(s){let r=this.startNodeAt(s);this.expressionScope.recordParameterInitializerError(p.YieldInParameter,r);let t=!1,i=null;if(!this.hasPrecedingLineBreak())switch(t=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!t)break;default:i=this.parseMaybeAssign()}return r.delegate=t,r.argument=i,this.finishNode(r,"YieldExpression")}parseImportCall(s){if(this.next(),s.source=this.parseMaybeAssignAllowIn(),s.options=null,this.eat(12))if(!this.match(11)){if(s.options=this.parseMaybeAssignAllowIn(),this.eat(12)){if(this.addTrailingCommaExtraToNode(s.options),!this.match(11)){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(p.ImportCallArity,s)}}}else this.addTrailingCommaExtraToNode(s.source);return this.expect(11),this.finishNode(s,"ImportExpression")}checkPipelineAtInfixOperator(s,r){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){if(s.type==="SequenceExpression")this.raise(p.PipelineHeadSequenceExpression,r)}}parseSmartPipelineBodyInStyle(s,r){if(this.isSimpleReference(s)){let t=this.startNodeAt(r);return t.callee=s,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(r);return this.checkSmartPipeTopicBodyEarlyErrors(r),t.expression=s,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(s){switch(s.type){case"MemberExpression":return!s.computed&&this.isSimpleReference(s.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(s){if(this.match(19))throw this.raise(p.PipelineBodyNoArrow,this.state.startLoc);if(!this.topicReferenceWasUsedInCurrentContext())this.raise(p.PipelineTopicUnused,s)}withTopicBindingContext(s){let r=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=r}}withSmartMixTopicForbiddingContext(s){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let r=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=r}}else return s()}withSoloAwaitPermittingContext(s){let r=this.state.soloAwait;this.state.soloAwait=!0;try{return s()}finally{this.state.soloAwait=r}}allowInAnd(s){let r=this.prodParam.currentFlags();if(8&~r){this.prodParam.enter(r|8);try{return s()}finally{this.prodParam.exit()}}return s()}disallowInAnd(s){let r=this.prodParam.currentFlags();if(8&r){this.prodParam.enter(r&-9);try{return s()}finally{this.prodParam.exit()}}return s()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(s){let r=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),r,s);return this.state.inFSharpPipelineDirectBody=t,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let s=this.startNode();if(this.next(),!this.match(5))this.unexpected(null,5);let r=this.startNodeAt(this.state.endLoc);this.next();let t=this.initializeScopes(!0);this.enterInitialScopes();try{s.body=this.parseProgram(r,8,"module")}finally{t()}return this.finishNode(s,"ModuleExpression")}parseVoidPattern(s){this.expectPlugin("discardBinding");let r=this.startNode();if(s!=null)s.voidPatternLoc=this.state.startLoc;return this.next(),this.finishNode(r,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(s,r,t){if(r!=null&&this.match(88)){let i=this.lookaheadCharCode();if(i===44||i===(s===3?93:s===8?125:41)||i===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(r))}return this.parseMaybeAssignAllowIn(r,t)}parsePropertyNamePrefixOperator(s){}}var et={kind:1},La={kind:2},Ma=/[\uD800-\uDFFF]/u,tt=/in(?:stanceof)?/y;function Oa(s,r,t){for(let i=0;i<s.length;i++){let a=s[i],{type:n}=a;if(typeof n==="number"){if(n===139){let{loc:o,start:l,value:h,end:c}=a,u=l+1,d=_(o.start,1);s.splice(i,1,new J({type:G(27),value:"#",start:l,end:u,startLoc:o.start,endLoc:d}),new J({type:G(132),value:h,start:u,end:c,startLoc:d,endLoc:o.end})),i++;continue}if(_e(n)){let{loc:o,start:l,value:h,end:c}=a,u=l+1,d=_(o.start,1),f;if(r.charCodeAt(l-t)===96)f=new J({type:G(22),value:"`",start:l,end:u,startLoc:o.start,endLoc:d});else f=new J({type:G(8),value:"}",start:l,end:u,startLoc:o.start,endLoc:d});let m,x,T,S;if(n===24)x=c-1,T=_(o.end,-1),m=h===null?null:h.slice(1,-1),S=new J({type:G(22),value:"`",start:x,end:c,startLoc:T,endLoc:o.end});else x=c-2,T=_(o.end,-2),m=h===null?null:h.slice(1,-2),S=new J({type:G(23),value:"${",start:x,end:c,startLoc:T,endLoc:o.end});s.splice(i,1,f,new J({type:G(20),value:m,start:u,end:x,startLoc:d,endLoc:T}),S),i+=2;continue}a.type=G(n)}}return s}class ai extends ri{parseTopLevel(s,r){if(s.program=this.parseProgram(r,140,this.options.sourceType==="module"?"module":"script"),s.comments=this.comments,this.optionFlags&256)s.tokens=Oa(this.tokens,this.input,this.startIndex);return this.finishNode(s,"File")}parseProgram(s,r,t){if(s.sourceType=t,s.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(s,!0,!0,r),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[a,n]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,n,{localName:a});this.addExtra(s,"topLevelAwait",this.state.hasTopLevelAwait)}let i;if(r===140)i=this.finishNode(s,"Program");else i=this.finishNodeAt(s,"Program",_(this.state.startLoc,-1));return i}stmtToDirective(s){let r=this.castNodeTo(s,"Directive"),t=this.castNodeTo(s.expression,"DirectiveLiteral"),i=t.value,a=this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end)),n=t.value=a.slice(1,-1);return this.addExtra(t,"raw",a),this.addExtra(t,"rawValue",n),this.addExtra(t,"expressionValue",i),r.value=t,delete s.expression,r}parseInterpreterDirective(){if(!this.match(28))return null;let s=this.startNode();return s.value=this.state.value,this.next(),this.finishNode(s,"InterpreterDirective")}isLet(){if(!this.isContextual(100))return!1;return this.hasFollowingBindingAtom()}isUsing(){if(!this.isContextual(107))return!1;return this.nextTokenIsIdentifierOnSameLine()}isForUsing(){if(!this.isContextual(107))return!1;let s=this.nextTokenInLineStart(),r=this.codePointAtPos(s);if(this.isUnparsedContextual(s,"of")){let t=this.lookaheadCharCodeSince(s+2);if(t!==61&&t!==58&&t!==59)return!1}if(this.chStartsBindingIdentifier(r,s)||this.isUnparsedContextual(s,"void"))return!0;return!1}nextTokenIsIdentifierOnSameLine(){let s=this.nextTokenInLineStart(),r=this.codePointAtPos(s);return this.chStartsBindingIdentifier(r,s)}isAwaitUsing(){if(!this.isContextual(96))return!1;let s=this.nextTokenInLineStart();if(this.isUnparsedContextual(s,"using")){s=this.nextTokenInLineStartSince(s+5);let r=this.codePointAtPos(s);if(this.chStartsBindingIdentifier(r,s))return!0}return!1}chStartsBindingIdentifier(s,r){if(H(s)){if(tt.lastIndex=r,tt.test(this.input)){let t=this.codePointAtPos(tt.lastIndex);if(!ae(t)&&t!==92)return!1}return!0}else if(s===92)return!0;else return!1}chStartsBindingPattern(s){return s===91||s===123}hasFollowingBindingAtom(){let s=this.nextTokenStart(),r=this.codePointAtPos(s);return this.chStartsBindingPattern(r)||this.chStartsBindingIdentifier(r,s)}hasInLineFollowingBindingIdentifierOrBrace(){let s=this.nextTokenInLineStart(),r=this.codePointAtPos(s);return r===123||this.chStartsBindingIdentifier(r,s)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(s=!1){let r=0;if(this.options.annexB&&!this.state.strict){if(r|=4,s)r|=8}return this.parseStatementLike(r)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(s){let r=null;if(this.match(26))r=this.parseDecorators(!0);return this.parseStatementContent(s,r)}parseStatementContent(s,r){let t=this.state.type,i=this.startNode(),a=!!(s&2),n=!!(s&4),o=s&1;switch(t){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;if(!n)this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc);return this.parseFunctionStatement(i,!1,!a&&n);case 80:if(!a)this.unexpected();return this.parseClass(this.maybeTakeDecorators(r,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing()){if(!this.allowsUsing())this.raise(p.UnexpectedUsingDeclaration,i);else if(!a)this.raise(p.UnexpectedLexicalDeclaration,i);else if(!this.recordAwaitIfAllowed())this.raise(p.AwaitUsingNotInAsyncContext,i);return this.next(),this.parseVarStatement(i,"await using")}break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;if(!this.allowsUsing())this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc);else if(!a)this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);return this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),u=this.codePointAtPos(c);if(u!==91){if(!a&&this.hasFollowingLineBreak())break;if(!this.chStartsBindingIdentifier(u,c)&&u!==123)break}}case 75:if(!a)this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(i,c)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{if(!(this.optionFlags&8)&&!o)this.raise(p.UnexpectedImportExport,this.state.startLoc);this.next();let c;if(t===83)c=this.parseImport(i);else c=this.parseExport(i,r);return this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction()){if(!a)this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc);return this.next(),this.parseFunctionStatement(i,!0,!a&&n)}}let l=this.state.value,h=this.parseExpression();if(N(t)&&h.type==="Identifier"&&this.eat(14))return this.parseLabeledStatement(i,l,h,s);else return this.parseExpressionStatement(i,h,r)}assertModuleNodeAllowed(s){if(!(this.optionFlags&8)&&!this.inModule)this.raise(p.ImportOutsideModule,s)}decoratorsEnabledBeforeExport(){if(this.hasPlugin("decorators-legacy"))return!0;return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(s,r,t){if(s){var i;if((i=r.decorators)!=null&&i.length){if(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!=="boolean")this.raise(p.DecoratorsBeforeAfterExport,r.decorators[0]);r.decorators.unshift(...s)}else r.decorators=s;if(this.resetStartLocationFromNode(r,s[0]),t)this.resetStartLocationFromNode(t,r)}return r}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(s){let r=[];do r.push(this.parseDecorator());while(this.match(26));if(this.match(82)){if(!s)this.unexpected();if(!this.decoratorsEnabledBeforeExport())this.raise(p.DecoratorExportClass,this.state.startLoc)}else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return r}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let s=this.startNode();if(this.next(),this.hasPlugin("decorators")){let r=this.state.startLoc,t;if(this.match(10)){let i=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(i,t);let a=this.state.startLoc;if(s.expression=this.parseMaybeDecoratorArguments(t,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&s.expression!==t)this.raise(p.DecoratorArgumentsOutsideParentheses,a)}else{t=this.parseIdentifier(!1);while(this.eat(16)){let i=this.startNodeAt(r);if(i.object=t,this.match(139))this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName();else i.property=this.parseIdentifier(!0);i.computed=!1,t=this.finishNode(i,"MemberExpression")}s.expression=this.parseMaybeDecoratorArguments(t,r)}}else s.expression=this.parseExprSubscripts();return this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s,r){if(this.eat(10)){let t=this.startNodeAt(r);return t.callee=s,t.arguments=this.parseCallExpressionArguments(),this.toReferencedList(t.arguments),this.finishNode(t,"CallExpression")}return s}parseBreakContinueStatement(s,r){if(this.next(),this.isLineTerminator())s.label=null;else s.label=this.parseIdentifier(),this.semicolon();return this.verifyBreakContinue(s,r),this.finishNode(s,r?"BreakStatement":"ContinueStatement")}verifyBreakContinue(s,r){let t;for(t=0;t<this.state.labels.length;++t){let i=this.state.labels[t];if(s.label==null||i.name===s.label.name){if(i.kind!=null&&(r||i.kind===1))break;if(s.label&&r)break}}if(t===this.state.labels.length){let i=r?"BreakStatement":"ContinueStatement";this.raise(p.IllegalBreakContinue,s,{type:i})}}parseDebuggerStatement(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let s=this.parseExpression();return this.expect(11),s}parseDoWhileStatement(s){return this.next(),this.state.labels.push(et),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),s.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(s,"DoWhileStatement")}parseForStatement(s){this.next(),this.state.labels.push(et);let r=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed())r=this.state.startLoc,this.next();if(this.scope.enter(0),this.expect(10),this.match(13)){if(r!==null)this.unexpected(r);return this.parseFor(s,null)}let t=this.isContextual(100);{let l=this.isAwaitUsing(),h=l||this.isForUsing(),c=t&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||c){let u=this.startNode(),d;if(l){if(d="await using",!this.recordAwaitIfAllowed())this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc);this.next()}else d=this.state.value;this.next(),this.parseVar(u,!0,d);let f=this.finishNode(u,"VariableDeclaration"),m=this.match(58);if(m&&h)this.raise(p.ForInUsing,f);if((m||this.isContextual(102))&&f.declarations.length===1)return this.parseForIn(s,f,r);if(r!==null)this.unexpected(r);return this.parseFor(s,f)}}let i=this.isContextual(95),a=new Ae,n=this.parseExpression(!0,a),o=this.isContextual(102);if(o){if(t)this.raise(p.ForOfLet,n);if(r===null&&i&&n.type==="Identifier")this.raise(p.ForOfAsync,n)}if(o||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(n,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{type:l}),this.parseForIn(s,n,r)}else this.checkExpressionErrors(a,!0);if(r!==null)this.unexpected(r);return this.parseFor(s,n)}parseFunctionStatement(s,r,t){return this.next(),this.parseFunction(s,1|(t?2:0)|(r?8:0))}parseIfStatement(s){return this.next(),s.test=this.parseHeaderExpression(),s.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),s.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(s,"IfStatement")}parseReturnStatement(s){if(!this.prodParam.hasReturn)this.raise(p.IllegalReturn,this.state.startLoc);if(this.next(),this.isLineTerminator())s.argument=null;else s.argument=this.parseExpression(),this.semicolon();return this.finishNode(s,"ReturnStatement")}parseSwitchStatement(s){this.next(),s.discriminant=this.parseHeaderExpression();let r=s.cases=[];this.expect(5),this.state.labels.push(La),this.scope.enter(256);let t;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);if(t)this.finishNode(t,"SwitchCase");if(r.push(t=this.startNode()),t.consequent=[],this.next(),a)t.test=this.parseExpression();else{if(i)this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc);i=!0,t.test=null}this.expect(14)}else if(t)t.consequent.push(this.parseStatementListItem());else this.unexpected();if(this.scope.exit(),t)this.finishNode(t,"SwitchCase");return this.next(),this.state.labels.pop(),this.finishNode(s,"SwitchStatement")}parseThrowStatement(s){if(this.next(),this.hasPrecedingLineBreak())this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc);return s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")}parseCatchClauseParam(){let s=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&s.type==="Identifier"?8:0),this.checkLVal(s,{type:"CatchClause"},9),s}parseTryStatement(s){if(this.next(),s.block=this.parseBlock(),s.handler=null,this.match(62)){let r=this.startNode();if(this.next(),this.match(10))this.expect(10),r.param=this.parseCatchClauseParam(),this.expect(11);else r.param=null,this.scope.enter(0);r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),s.handler=this.finishNode(r,"CatchClause")}if(s.finalizer=this.eat(67)?this.parseBlock():null,!s.handler&&!s.finalizer)this.raise(p.NoCatchOrFinally,s);return this.finishNode(s,"TryStatement")}parseVarStatement(s,r,t=!1){return this.next(),this.parseVar(s,!1,r,t),this.semicolon(),this.finishNode(s,"VariableDeclaration")}parseWhileStatement(s){return this.next(),s.test=this.parseHeaderExpression(),this.state.labels.push(et),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(s,"WhileStatement")}parseWithStatement(s){if(this.state.strict)this.raise(p.StrictWith,this.state.startLoc);return this.next(),s.object=this.parseHeaderExpression(),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(s,"WithStatement")}parseEmptyStatement(s){return this.next(),this.finishNode(s,"EmptyStatement")}parseLabeledStatement(s,r,t,i){for(let n of this.state.labels)if(n.name===r)this.raise(p.LabelRedeclaration,t,{labelName:r});let a=Ur(this.state.type)?1:this.match(71)?2:null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===s.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=a;else break}return this.state.labels.push({name:r,kind:a,statementStart:this.sourceToOffsetPos(this.state.start)}),s.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),s.label=t,this.finishNode(s,"LabeledStatement")}parseExpressionStatement(s,r,t){return s.expression=r,this.semicolon(),this.finishNode(s,"ExpressionStatement")}parseBlock(s=!1,r=!0,t){let i=this.startNode();if(s)this.state.strictErrors.clear();if(this.expect(5),r)this.scope.enter(0);if(this.parseBlockBody(i,s,!1,8,t),r)this.scope.exit();return this.finishNode(i,"BlockStatement")}isValidDirective(s){return s.type==="ExpressionStatement"&&s.expression.type==="StringLiteral"&&!s.expression.extra.parenthesized}parseBlockBody(s,r,t,i,a){let n=s.body=[],o=s.directives=[];this.parseBlockOrModuleBlockBody(n,r?o:void 0,t,i,a)}parseBlockOrModuleBlockBody(s,r,t,i,a){let n=this.state.strict,o=!1,l=!1;while(!this.match(i)){let h=t?this.parseModuleItem():this.parseStatementListItem();if(r&&!l){if(this.isValidDirective(h)){let c=this.stmtToDirective(h);if(r.push(c),!o&&c.value.value==="use strict")o=!0,this.setStrict(!0);continue}l=!0,this.state.strictErrors.clear()}s.push(h)}if(a==null||a.call(this,o),!n)this.setStrict(!1);this.next()}parseFor(s,r){return s.init=r,this.semicolon(!1),s.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),s.update=this.match(11)?null:this.parseExpression(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,"ForStatement")}parseForIn(s,r,t){let i=this.match(58);if(this.next(),i){if(t!==null)this.unexpected(t)}else s.await=t!==null;if(r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier"))this.raise(p.ForInOfLoopInitializer,r,{type:i?"ForInStatement":"ForOfStatement"});if(r.type==="AssignmentPattern")this.raise(p.InvalidLhs,r,{ancestor:{type:"ForStatement"}});return s.left=r,s.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,i?"ForInStatement":"ForOfStatement")}parseVar(s,r,t,i=!1){let a=s.declarations=[];s.kind=t;for(;;){let n=this.startNode();if(this.parseVarId(n,t),n.init=!this.eat(29)?null:r?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn(),n.init===null&&!i){if(n.id.type!=="Identifier"&&!(r&&(this.match(58)||this.isContextual(102))))this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"});else if((t==="const"||t==="using"||t==="await using")&&!(this.match(58)||this.isContextual(102)))this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:t})}if(a.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return s}parseVarId(s,r){let t=this.parseBindingAtom();if(r==="using"||r==="await using"){if(t.type==="ArrayPattern"||t.type==="ObjectPattern")this.raise(p.UsingDeclarationHasBindingPattern,t.loc.start)}else if(t.type==="VoidPattern")this.raise(p.UnexpectedVoidPattern,t.loc.start);this.checkLVal(t,{type:"VariableDeclarator"},r==="var"?5:8201),s.id=t}parseAsyncFunctionExpression(s){return this.parseFunction(s,8)}parseFunction(s,r=0){let t=r&2,i=!!(r&1),a=i&&!(r&4),n=!!(r&8);if(this.initFunction(s,n),this.match(55)){if(t)this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc);this.next(),s.generator=!0}if(i)s.id=this.parseFunctionId(a);let o=this.state.maybeInArrowParameters;if(this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(De(n,s.generator)),!i)s.id=this.parseFunctionId();if(this.parseFunctionParams(s,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(s,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!t)this.registerFunctionStatementId(s);return this.state.maybeInArrowParameters=o,s}parseFunctionId(s){return s||N(this.state.type)?this.parseIdentifier():null}parseFunctionParams(s,r){this.expect(10),this.expressionScope.enter(xa()),s.params=this.parseBindingList(11,41,2|(r?4:0)),this.expressionScope.exit()}registerFunctionStatementId(s){if(!s.id)return;this.scope.declareName(s.id.name,!this.options.annexB||this.state.strict||s.generator||s.async?this.scope.treatFunctionsAsVar?5:8201:17,s.id.loc.start)}parseClass(s,r,t){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(s,r,t),this.parseClassSuper(s),s.body=this.parseClassBody(!!s.superClass,i),this.finishNode(s,r?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(s){return s.type==="Identifier"&&s.name==="constructor"||s.type==="StringLiteral"&&s.value==="constructor"}isNonstaticConstructor(s){return!s.computed&&!s.static&&this.nameIsConstructor(s.key)}parseClassBody(s,r){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:s},i=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{while(!this.match(8)){if(this.eat(13)){if(i.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();if(i.length)n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[];if(this.parseClassMember(a,n,t),n.kind==="constructor"&&n.decorators&&n.decorators.length>0)this.raise(p.DecoratorConstructor,n)}}),this.state.strict=r,this.next(),i.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(s,r){let t=this.parseIdentifier(!0);if(this.isClassMethod()){let i=r;return i.kind="method",i.computed=!1,i.key=t,i.static=!1,this.pushClassMethod(s,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=r;return i.computed=!1,i.key=t,i.static=!1,s.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(s,r,t){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(s,r))return;if(this.eat(5)){this.parseClassStaticBlock(s,r);return}}this.parseClassMemberWithIsStatic(s,r,t,i)}parseClassMemberWithIsStatic(s,r,t,i){let a=r,n=r,o=r,l=r,h=r,c=a,u=a;if(r.static=i,this.parsePropertyNamePrefixOperator(r),this.eat(55)){c.kind="method";let S=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(c),S){this.pushClassPrivateMethod(s,n,!0,!1);return}if(this.isNonstaticConstructor(a))this.raise(p.ConstructorIsGenerator,a.key);this.pushClassMethod(s,a,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&N(this.state.type),f=this.parseClassElementName(r),m=d?f.name:null,x=this.isPrivateName(f),T=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(c.kind="method",x){this.pushClassPrivateMethod(s,n,!1,!1);return}let S=this.isNonstaticConstructor(a),C=!1;if(S){if(a.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript"))this.raise(p.DuplicateConstructor,f);if(S&&this.hasPlugin("typescript")&&r.override)this.raise(p.OverrideOnConstructor,f);t.hadConstructor=!0,C=t.hadSuperClass}this.pushClassMethod(s,a,!1,!1,S,C)}else if(this.isClassProperty())if(x)this.pushClassPrivateProperty(s,l);else this.pushClassProperty(s,o);else if(m==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let S=this.eat(55);if(u.optional)this.unexpected(T);c.kind="method";let C=this.match(139);if(this.parseClassElementName(c),this.parsePostMemberNameModifiers(u),C)this.pushClassPrivateMethod(s,n,S,!0);else{if(this.isNonstaticConstructor(a))this.raise(p.ConstructorIsAsync,a.key);this.pushClassMethod(s,a,S,!0,!1,!1)}}else if((m==="get"||m==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),c.kind=m;let S=this.match(139);if(this.parseClassElementName(a),S)this.pushClassPrivateMethod(s,n,!1,!1);else{if(this.isNonstaticConstructor(a))this.raise(p.ConstructorIsAccessor,a.key);this.pushClassMethod(s,a,!1,!1,!1,!1)}this.checkGetterSetterParams(a)}else if(m==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(f);let S=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(s,h,S)}else if(this.isLineTerminator())if(x)this.pushClassPrivateProperty(s,l);else this.pushClassProperty(s,o);else this.unexpected()}parseClassElementName(s){let{type:r,value:t}=this.state;if((r===132||r===134)&&s.static&&t==="prototype")this.raise(p.StaticPrototype,this.state.startLoc);if(r===139){if(t==="constructor")this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return s.key=i,i}return this.parsePropertyName(s),s.key}parseClassStaticBlock(s,r){var t;this.scope.enter(720);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let a=r.body=[];if(this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,s.body.push(this.finishNode(r,"StaticBlock")),(t=r.decorators)!=null&&t.length)this.raise(p.DecoratorStaticBlock,r)}pushClassProperty(s,r){if(!r.computed&&this.nameIsConstructor(r.key))this.raise(p.ConstructorClassField,r.key);s.body.push(this.parseClassProperty(r))}pushClassPrivateProperty(s,r){let t=this.parseClassPrivateProperty(r);s.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(s,r,t){if(!t&&!r.computed&&this.nameIsConstructor(r.key))this.raise(p.ConstructorClassField,r.key);let i=this.parseClassAccessorProperty(r);if(s.body.push(i),t)this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(s,r,t,i,a,n){s.body.push(this.parseMethod(r,t,i,a,n,"ClassMethod",!0))}pushClassPrivateMethod(s,r,t,i){let a=this.parseMethod(r,t,i,!1,!1,"ClassPrivateMethod",!0);s.body.push(a);let n=a.kind==="get"?a.static?6:2:a.kind==="set"?a.static?5:1:0;this.declareClassPrivateMethodInScope(a,n)}declareClassPrivateMethodInScope(s,r){this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),r,s.key.loc.start)}parsePostMemberNameModifiers(s){}parseClassPrivateProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassPrivateProperty")}parseClassProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassProperty")}parseClassAccessorProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassAccessorProperty")}parseInitializer(s){this.scope.enter(592),this.expressionScope.enter(Ys()),this.prodParam.enter(0),s.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(s,r,t,i=8331){if(N(this.state.type)){if(s.id=this.parseIdentifier(),r)this.declareNameFromIdentifier(s.id,i)}else if(t||!r)s.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(s){s.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(s,r){let t=this.parseMaybeImportPhase(s,!0),i=this.maybeParseExportDefaultSpecifier(s,t),a=!i||this.eat(12),n=a&&this.eatExportStar(s),o=n&&this.maybeParseExportNamespaceSpecifier(s),l=a&&(!o||this.eat(12)),h=i||n;if(n&&!o){if(i)this.unexpected();if(r)throw this.raise(p.UnsupportedDecoratorExport,s);return this.parseExportFrom(s,!0),this.sawUnambiguousESM=!0,this.finishNode(s,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(s);if(i&&a&&!n&&!c)this.unexpected(null,5);if(o&&l)this.unexpected(null,98);let u;if(h||c){if(u=!1,r)throw this.raise(p.UnsupportedDecoratorExport,s);this.parseExportFrom(s,h)}else u=this.maybeParseExportDeclaration(s);if(h||c||u){var d;let f=s;if(this.checkExport(f,!0,!1,!!f.source),((d=f.declaration)==null?void 0:d.type)==="ClassDeclaration")this.maybeTakeDecorators(r,f.declaration,f);else if(r)throw this.raise(p.UnsupportedDecoratorExport,s);return this.sawUnambiguousESM=!0,this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){let f=s,m=this.parseExportDefaultExpression();if(f.declaration=m,m.type==="ClassDeclaration")this.maybeTakeDecorators(r,m,f);else if(r)throw this.raise(p.UnsupportedDecoratorExport,s);return this.checkExport(f,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(s){return this.eat(55)}maybeParseExportDefaultSpecifier(s,r){if(r||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",r==null?void 0:r.loc.start);let t=r||this.parseIdentifier(!0),i=this.startNodeAtNode(t);return i.exported=t,s.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(s){if(this.isContextual(93)){var r,t;(t=(r=s).specifiers)!=null||(r.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),s.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(s){if(this.match(5)){let r=s;if(!r.specifiers)r.specifiers=[];let t=r.exportKind==="type";if(r.specifiers.push(...this.parseExportSpecifiers(t)),r.source=null,this.hasPlugin("importAssertions"))r.assertions=[];else r.attributes=[];return r.declaration=null,!0}return!1}maybeParseExportDeclaration(s){if(this.shouldParseExportDeclaration()){if(s.specifiers=[],s.source=null,this.hasPlugin("importAssertions"))s.assertions=[];else s.attributes=[];return s.declaration=this.parseExportDeclaration(s),!0}return!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let s=this.nextTokenInLineStart();return this.isUnparsedContextual(s,"function")}parseExportDefaultExpression(){let s=this.startNode();if(this.match(68))return this.next(),this.parseFunction(s,5);else if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(s,13);if(this.match(80))return this.parseClass(s,!0,!0);if(this.match(26)){if(this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise(p.DecoratorBeforeExport,this.state.startLoc);return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0)}if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let r=this.parseMaybeAssignAllowIn();return this.semicolon(),r}parseExportDeclaration(s){if(this.match(80))return this.parseClass(this.startNode(),!0,!1);return this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:s}=this.state;if(N(s)){if(s===95&&!this.state.containsEsc||s===100)return!1;if((s===130||s===129)&&!this.state.containsEsc){let i=this.nextTokenStart(),a=this.input.charCodeAt(i);if(a===123||this.chStartsBindingIdentifier(a,i)&&!this.input.startsWith("from",i))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let r=this.nextTokenStart(),t=this.isUnparsedContextual(r,"from");if(this.input.charCodeAt(r)===44||N(this.state.type)&&t)return!0;if(this.match(65)&&t){let i=this.input.charCodeAt(this.nextTokenStartSince(r+4));return i===34||i===39}return!1}parseExportFrom(s,r){if(this.eatContextual(98))s.source=this.parseImportSource(),this.checkExport(s),this.maybeParseImportAttributes(s),this.checkJSONModuleImport(s);else if(r)this.unexpected();this.semicolon()}shouldParseExportDeclaration(){let{type:s}=this.state;if(s===26){if(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators")){if(this.getPluginOption("decorators","decoratorsBeforeExport")===!0)this.raise(p.DecoratorBeforeExport,this.state.startLoc);return!0}}if(this.isUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0;if(this.isAwaitUsing())return this.raise(p.UsingDeclarationExport,this.state.startLoc),!0;return s===74||s===75||s===68||s===80||this.isLet()||this.isAsyncFunction()}checkExport(s,r,t,i){if(r){var a;if(t){if(this.checkDuplicateExports(s,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=s.declaration;if(o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized))this.raise(p.ExportDefaultFromAsIdentifier,o)}}else if((a=s.specifiers)!=null&&a.length)for(let o of s.specifiers){let{exported:l}=o,h=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,h),!i&&o.local){let{local:c}=o;if(c.type!=="Identifier")this.raise(p.ExportBindingIsString,o,{localName:c.value,exportName:h});else this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c)}}else if(s.declaration){let o=s.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw Error("Assertion failure");this.checkDuplicateExports(s,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(s){if(s.type==="Identifier")this.checkDuplicateExports(s,s.name);else if(s.type==="ObjectPattern")for(let r of s.properties)this.checkDeclaration(r);else if(s.type==="ArrayPattern"){for(let r of s.elements)if(r)this.checkDeclaration(r)}else if(s.type==="ObjectProperty")this.checkDeclaration(s.value);else if(s.type==="RestElement")this.checkDeclaration(s.argument);else if(s.type==="AssignmentPattern")this.checkDeclaration(s.left)}checkDuplicateExports(s,r){if(this.exportedIdentifiers.has(r))if(r==="default")this.raise(p.DuplicateDefaultExport,s);else this.raise(p.DuplicateExport,s,{exportName:r});this.exportedIdentifiers.add(r)}parseExportSpecifiers(s){let r=[],t=!0;this.expect(5);while(!this.eat(8)){if(t)t=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),a=this.match(134),n=this.startNode();n.local=this.parseModuleExportName(),r.push(this.parseExportSpecifier(n,a,s,i))}return r}parseExportSpecifier(s,r,t,i){if(this.eatContextual(93))s.exported=this.parseModuleExportName();else if(r)s.exported=this.cloneStringLiteral(s.local);else if(!s.exported)s.exported=this.cloneIdentifier(s.local);return this.finishNode(s,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let s=this.parseStringLiteral(this.state.value),r=Ma.exec(s.value);if(r)this.raise(p.ModuleExportNameHasLoneSurrogate,s,{surrogateCharCode:r[0].charCodeAt(0)});return s}return this.parseIdentifier(!0)}isJSONModuleImport(s){if(s.assertions!=null)return s.assertions.some(({key:r,value:t})=>t.value==="json"&&(r.type==="Identifier"?r.name==="type":r.value==="type"));return!1}checkImportReflection(s){let{specifiers:r}=s,t=r.length===1?r[0].type:null;if(s.phase==="source"){if(t!=="ImportDefaultSpecifier")this.raise(p.SourcePhaseImportRequiresDefault,r[0].loc.start)}else if(s.phase==="defer"){if(t!=="ImportNamespaceSpecifier")this.raise(p.DeferImportRequiresNamespace,r[0].loc.start)}else if(s.module){var i;if(t!=="ImportDefaultSpecifier")this.raise(p.ImportReflectionNotBinding,r[0].loc.start);if(((i=s.assertions)==null?void 0:i.length)>0)this.raise(p.ImportReflectionHasAssertion,r[0].loc.start)}}checkJSONModuleImport(s){if(this.isJSONModuleImport(s)&&s.type!=="ExportAllDeclaration"){let{specifiers:r}=s;if(r!=null){let t=r.find((i)=>{let a;if(i.type==="ExportSpecifier")a=i.local;else if(i.type==="ImportSpecifier")a=i.imported;if(a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});if(t!==void 0)this.raise(p.ImportJSONBindingNotDefault,t.loc.start)}}}isPotentialImportPhase(s){if(s)return!1;return this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(s,r,t,i){if(r)return;if(t==="module")this.expectPlugin("importReflection",i),s.module=!0;else if(this.hasPlugin("importReflection"))s.module=!1;if(t==="source")this.expectPlugin("sourcePhaseImports",i),s.phase="source";else if(t==="defer")this.expectPlugin("deferredImportEvaluation",i),s.phase="defer";else if(this.hasPlugin("sourcePhaseImports"))s.phase=null}parseMaybeImportPhase(s,r){if(!this.isPotentialImportPhase(r))return this.applyImportPhase(s,r,null),null;let t=this.startNode(),i=this.parseIdentifierName(!0),{type:a}=this.state;if(q(a)?a!==98||this.lookaheadCharCode()===102:a!==12)return this.applyImportPhase(s,r,i,t.loc.start),null;else return this.applyImportPhase(s,r,null),this.createIdentifier(t,i)}isPrecedingIdImportPhase(s){let{type:r}=this.state;return N(r)?r!==98||this.lookaheadCharCode()===102:r!==12}parseImport(s){if(this.match(134))return this.parseImportSourceAndAttributes(s);return this.parseImportSpecifiersAndAfter(s,this.parseMaybeImportPhase(s,!1))}parseImportSpecifiersAndAfter(s,r){s.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(s,r)||this.eat(12),a=i&&this.maybeParseStarImportSpecifier(s);if(i&&!a)this.parseNamedImportSpecifiers(s);return this.expectContextual(98),this.parseImportSourceAndAttributes(s)}parseImportSourceAndAttributes(s){var r;return(r=s.specifiers)!=null||(s.specifiers=[]),s.source=this.parseImportSource(),this.maybeParseImportAttributes(s),this.checkImportReflection(s),this.checkJSONModuleImport(s),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(s,"ImportDeclaration")}parseImportSource(){if(!this.match(134))this.unexpected();return this.parseExprAtom()}parseImportSpecifierLocal(s,r,t){r.local=this.parseIdentifier(),s.specifiers.push(this.finishImportSpecifier(r,t))}finishImportSpecifier(s,r,t=8201){return this.checkLVal(s.local,{type:r},t),this.finishNode(s,r)}parseImportAttributes(){this.expect(5);let s=[],r=new Set;do{if(this.match(8))break;let t=this.startNode(),i=this.state.value;if(r.has(i))this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i});if(r.add(i),this.match(134))t.key=this.parseStringLiteral(i);else t.key=this.parseIdentifier(!0);if(this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),s}parseModuleAttributes(){let s=[],r=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type")this.raise(p.ModuleAttributeDifferentFromType,t.key);if(r.has(t.key.name))this.raise(p.ModuleAttributesWithDuplicateKeys,t.key,{key:t.key.name});if(r.add(t.key.name),this.expect(14),!this.match(134))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return s}maybeParseImportAttributes(s){let r;var t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;if(this.next(),this.hasPlugin("moduleAttributes"))r=this.parseModuleAttributes(),this.addExtra(s,"deprecatedWithLegacySyntax",!0);else r=this.parseImportAttributes();t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak()){if(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions"))this.raise(p.ImportAttributesUseAssert,this.state.startLoc);if(!this.hasPlugin("importAssertions"))this.addExtra(s,"deprecatedAssertSyntax",!0);this.next(),r=this.parseImportAttributes()}else r=[];if(!t&&this.hasPlugin("importAssertions"))s.assertions=r;else s.attributes=r}maybeParseDefaultImportSpecifier(s,r){if(r){let t=this.startNodeAtNode(r);return t.local=r,s.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(q(this.state.type))return this.parseImportSpecifierLocal(s,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(s){if(this.match(55)){let r=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(s,r,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(s){let r=!0;this.expect(5);while(!this.eat(8)){if(r)r=!1;else{if(this.eat(14))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let t=this.startNode(),i=this.match(134),a=this.isContextual(130);t.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(t,i,s.importKind==="type"||s.importKind==="typeof",a,void 0);s.specifiers.push(n)}}parseImportSpecifier(s,r,t,i,a){if(this.eatContextual(93))s.local=this.parseIdentifier();else{let{imported:n}=s;if(r)throw this.raise(p.ImportBindingIsString,s,{importName:n.value});if(this.checkReservedWord(n.name,s.loc.start,!0,!0),!s.local)s.local=this.cloneIdentifier(n)}return this.finishImportSpecifier(s,"ImportSpecifier",a)}isThisParam(s){return s.type==="Identifier"&&s.name==="this"}}class gt extends ai{constructor(s,r,t){let i=Lr(s);super(i,r);this.options=i,this.initializeScopes(),this.plugins=t,this.filename=i.sourceFilename,this.startIndex=i.startIndex;let a=0;if(i.allowAwaitOutsideFunction)a|=1;if(i.allowReturnOutsideFunction)a|=2;if(i.allowImportExportEverywhere)a|=8;if(i.allowSuperOutsideMethod)a|=16;if(i.allowUndeclaredExports)a|=64;if(i.allowNewTargetOutsideFunction)a|=4;if(i.allowYieldOutsideFunction)a|=32;if(i.ranges)a|=128;if(i.tokens)a|=256;if(i.createImportExpressions)a|=512;if(i.createParenthesizedExpressions)a|=1024;if(i.errorRecovery)a|=2048;if(i.attachComment)a|=4096;if(i.annexB)a|=8192;this.optionFlags=a}getScopeHandler(){return Re}parse(){this.enterInitialScopes();let s=this.startNode(),r=this.startNode();this.nextToken(),s.errors=null;let t=this.parseTopLevel(s,r);return t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}}function Da(s,r){var t;if(((t=r)==null?void 0:t.sourceType)==="unambiguous"){r=Object.assign({},r);try{r.sourceType="module";let i=be(r,s),a=i.parse();if(i.sawUnambiguousESM)return a;if(i.ambiguousScriptDifferentAst)try{return r.sourceType="script",be(r,s).parse()}catch(n){}else a.program.sourceType="script";return a}catch(i){try{return r.sourceType="script",be(r,s).parse()}catch(a){}throw i}}else return be(r,s).parse()}function _a(s,r){let t=be(r,s);if(t.options.strictMode)t.state.strict=!0;return t.getExpression()}function Fa(s){let r={};for(let t of Object.keys(s))r[t]=G(s[t]);return r}var Ba=Fa(_r);function be(s,r){let t=gt,i=new Map;if(s!=null&&s.plugins){for(let a of s.plugins){let n,o;if(typeof a==="string")n=a;else[n,o]=a;if(!i.has(n))i.set(n,o||{})}Na(i),t=Ra(i)}return new t(s,r,i)}var Ns=new Map;function Ra(s){let r=[];for(let a of ka)if(s.has(a))r.push(a);let t=r.join("|"),i=Ns.get(t);if(!i){i=gt;for(let a of r)i=ii[a](i);Ns.set(t,i)}return i}ni.parse=Da;ni.parseExpression=_a;ni.tokTypes=Ba});
|
|
10
|
+
export{Be,fr};
|