trybeacon 0.1.32 → 0.1.33
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +14 -14
- package/.next/build-manifest.json +3 -3
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +4 -4
- package/.next/required-server-files.json +4 -4
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +10 -10
- package/.next/server/app/_not-found.segments/_full.segment.rsc +10 -10
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/board-annotations/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-annotations/route.js.nft.json +1 -1
- package/.next/server/app/api/board-annotations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js.nft.json +1 -1
- package/.next/server/app/api/board-layout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bug-flags/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js.nft.json +1 -1
- package/.next/server/app/api/bug-flags/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/position/route.js.nft.json +1 -1
- package/.next/server/app/api/code-graph/position/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js.nft.json +1 -1
- package/.next/server/app/api/code-graph/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js.nft.json +1 -1
- package/.next/server/app/api/context/feature/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/file/route.js.nft.json +1 -1
- package/.next/server/app/api/context/file/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/context/route.js +2 -2
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/context/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/arrange/route.js.nft.json +1 -1
- package/.next/server/app/api/db/arrange/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js.nft.json +1 -1
- package/.next/server/app/api/db/backfill-access/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/position/route.js.nft.json +1 -1
- package/.next/server/app/api/db/position/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js.nft.json +1 -1
- package/.next/server/app/api/db/prune-planned/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js.nft.json +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/db/relations/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/db/tables/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/approve/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/edges/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/edges/route.js.nft.json +1 -1
- package/.next/server/app/api/edges/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/endpoints/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/entities/route.js.nft.json +1 -1
- package/.next/server/app/api/entities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/feedback/route.js +1 -1
- package/.next/server/app/api/feedback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ingest/route.js +2 -2
- package/.next/server/app/api/ingest/route.js.nft.json +1 -1
- package/.next/server/app/api/ingest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/init/route.js +2 -2
- package/.next/server/app/api/init/route.js.nft.json +1 -1
- package/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/describe/route.js +2 -2
- package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
- package/.next/server/app/api/map/describe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/files/route.js.nft.json +1 -1
- package/.next/server/app/api/map/files/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
- package/.next/server/app/api/map/finish/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/route.js.nft.json +1 -1
- package/.next/server/app/api/map/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/start/route.js.nft.json +1 -1
- package/.next/server/app/api/map/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
- package/.next/server/app/api/map/touch-active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/[id]/position/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/positions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/subtasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/open/route.js.nft.json +1 -1
- package/.next/server/app/api/open/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +3 -3
- package/.next/server/app/api/plan/annotations/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/annotations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/approve/route.js +2 -2
- package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/approve/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/history/route.js +1 -1
- package/.next/server/app/api/plan/history/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/markdown/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/presence/route.js +1 -1
- package/.next/server/app/api/plan/presence/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/presence/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/verdict/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/preferences/route.js.nft.json +1 -1
- package/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/reset/route.js.nft.json +1 -1
- package/.next/server/app/api/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/stream/route.js +2 -2
- package/.next/server/app/api/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/activate/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route_client-reference-manifest.js +1 -1
- package/.next/server/app/apple-icon.png/route.js +1 -1
- package/.next/server/app/docs/page.js +2 -2
- package/.next/server/app/docs/page.js.nft.json +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +11 -11
- package/.next/server/app/docs.segments/_full.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +10 -10
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/feedback/page.js +2 -2
- package/.next/server/app/feedback/page.js.nft.json +1 -1
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +11 -11
- package/.next/server/app/feedback.segments/_full.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +10 -10
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page.js.nft.json +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +29 -30
- package/.next/server/app/help.segments/_full.segment.rsc +29 -30
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +10 -10
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +11 -11
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +2 -2
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +14 -14
- package/.next/server/chunks/2877.js +1 -1
- package/.next/server/chunks/2981.js +1 -1
- package/.next/server/chunks/3015.js +1 -0
- package/.next/server/chunks/319.js +3 -3
- package/.next/server/chunks/5258.js +1 -1
- package/.next/server/chunks/7138.js +1 -0
- package/.next/server/chunks/9127.js +1 -1
- package/.next/server/chunks/9313.js +3 -3
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware.js +2 -2
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/8252-326851ad274762f5.js +1 -0
- package/.next/static/chunks/app/_not-found/page-57c7dfeb659fcab6.js +1 -0
- package/.next/static/chunks/app/docs/page-402d7f2c9321710a.js +1 -0
- package/.next/static/chunks/app/feedback/{page-5538af3c0677cc71.js → page-ea7f66503f2a4ca6.js} +1 -1
- package/.next/static/chunks/app/help/page-d720609312abff8b.js +1 -0
- package/.next/static/chunks/app/layout-9b750c41268879f0.js +1 -0
- package/.next/static/chunks/app/map/page-ac03f88297a40d47.js +1 -0
- package/.next/static/chunks/app/{page-92284d5d81118e0d.js → page-cdddef7fb0346b0f.js} +1 -1
- package/.next/static/chunks/app/plan/{page-7be8419fc56d5f1d.js → page-47e880f3e83a2753.js} +1 -1
- package/.next/static/chunks/app/settings/page-4d4879990a4f14fc.js +1 -0
- package/.next/static/chunks/main-app-1a32dc335629e4e4.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-df87398e192c5e45.js +1 -0
- package/.next/static/css/cb2ba3334a6b2336.css +1 -0
- package/.next/trace +38 -38
- package/.next/trace-build +1 -1
- package/.next/types/app/api/board-annotations/[id]/route.ts +1 -1
- package/.next/types/app/api/board-annotations/route.ts +1 -1
- package/.next/types/app/api/board-layout/route.ts +1 -1
- package/.next/types/app/api/bug-flags/[id]/route.ts +1 -1
- package/.next/types/app/api/bug-flags/route.ts +1 -1
- package/.next/types/app/api/code-graph/position/route.ts +1 -1
- package/.next/types/app/api/code-graph/route.ts +1 -1
- package/.next/types/app/api/context/feature/route.ts +1 -1
- package/.next/types/app/api/context/file/route.ts +1 -1
- package/.next/types/app/api/context/route.ts +1 -1
- package/.next/types/app/api/db/arrange/route.ts +1 -1
- package/.next/types/app/api/db/backfill-access/route.ts +1 -1
- package/.next/types/app/api/db/position/route.ts +1 -1
- package/.next/types/app/api/db/prune-planned/route.ts +1 -1
- package/.next/types/app/api/db/reconcile-endpoints/route.ts +1 -1
- package/.next/types/app/api/db/relations/[id]/route.ts +1 -1
- package/.next/types/app/api/db/tables/[id]/route.ts +1 -1
- package/.next/types/app/api/draft/approve/route.ts +1 -1
- package/.next/types/app/api/draft/route.ts +1 -1
- package/.next/types/app/api/draft/status/route.ts +1 -1
- package/.next/types/app/api/edges/[id]/route.ts +1 -1
- package/.next/types/app/api/edges/route.ts +1 -1
- package/.next/types/app/api/endpoints/[id]/route.ts +1 -1
- package/.next/types/app/api/entities/route.ts +1 -1
- package/.next/types/app/api/feedback/[id]/route.ts +1 -1
- package/.next/types/app/api/feedback/[id]/vote/route.ts +1 -1
- package/.next/types/app/api/feedback/route.ts +1 -1
- package/.next/types/app/api/ingest/route.ts +1 -1
- package/.next/types/app/api/init/route.ts +1 -1
- package/.next/types/app/api/map/describe/route.ts +1 -1
- package/.next/types/app/api/map/files/route.ts +1 -1
- package/.next/types/app/api/map/finish/route.ts +1 -1
- package/.next/types/app/api/map/route.ts +1 -1
- package/.next/types/app/api/map/start/route.ts +1 -1
- package/.next/types/app/api/map/touch-active/route.ts +1 -1
- package/.next/types/app/api/nodes/[id]/position/route.ts +1 -1
- package/.next/types/app/api/nodes/[id]/route.ts +1 -1
- package/.next/types/app/api/nodes/positions/route.ts +1 -1
- package/.next/types/app/api/nodes/route.ts +1 -1
- package/.next/types/app/api/nodes/subtasks/route.ts +1 -1
- package/.next/types/app/api/notes/[id]/route.ts +1 -1
- package/.next/types/app/api/notes/route.ts +1 -1
- package/.next/types/app/api/open/route.ts +1 -1
- package/.next/types/app/api/plan/annotations/route.ts +1 -1
- package/.next/types/app/api/plan/approve/route.ts +1 -1
- package/.next/types/app/api/plan/history/route.ts +1 -1
- package/.next/types/app/api/plan/markdown/route.ts +1 -1
- package/.next/types/app/api/plan/presence/route.ts +1 -1
- package/.next/types/app/api/plan/route.ts +1 -1
- package/.next/types/app/api/plan/verdict/route.ts +1 -1
- package/.next/types/app/api/preferences/route.ts +1 -1
- package/.next/types/app/api/reset/route.ts +1 -1
- package/.next/types/app/api/stream/route.ts +1 -1
- package/.next/types/app/api/version/route.ts +1 -1
- package/.next/types/app/api/workspace/activate/route.ts +1 -1
- package/.next/types/app/api/workspace/route.ts +1 -1
- package/.next/types/app/docs/page.ts +1 -1
- package/.next/types/app/feedback/page.ts +1 -1
- package/.next/types/app/help/page.ts +1 -1
- package/.next/types/app/map/page.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/.next/types/app/plan/page.ts +1 -1
- package/.next/types/app/settings/page.ts +1 -1
- package/package.json +1 -1
- package/.next/dev/build-manifest.json +0 -50
- package/.next/dev/fallback-build-manifest.json +0 -37
- package/.next/dev/logs/next-development.log +0 -101
- package/.next/dev/server/chunks/ssr/[externals]__1vp7etu._.js +0 -32
- package/.next/dev/server/chunks/ssr/[externals]__1vp7etu._.js.map +0 -5
- package/.next/dev/server/chunks/ssr/[externals]_next_dist_shared_lib_no-fallback-error_external_0r3u29k.js +0 -8
- package/.next/dev/server/chunks/ssr/[externals]_next_dist_shared_lib_no-fallback-error_external_0r3u29k.js.map +0 -5
- package/.next/dev/server/chunks/ssr/[root-of-the-server]__0y0_snu._.js +0 -285
- package/.next/dev/server/chunks/ssr/[root-of-the-server]__0y0_snu._.js.map +0 -9
- package/.next/dev/server/chunks/ssr/node_modules_02es85m._.js +0 -6621
- package/.next/dev/server/chunks/ssr/node_modules_02es85m._.js.map +0 -76
- package/.next/dev/server/chunks/ssr/node_modules_1_aarlg._.js +0 -4399
- package/.next/dev/server/chunks/ssr/node_modules_1_aarlg._.js.map +0 -35
- package/.next/dev/server/chunks/ssr/node_modules_next_1_o5zxs._.js +0 -55
- package/.next/dev/server/chunks/ssr/node_modules_next_1_o5zxs._.js.map +0 -7
- package/.next/dev/server/middleware-build-manifest.js +0 -50
- package/.next/dev/server/next-font-manifest.js +0 -1
- package/.next/dev/server/next-font-manifest.json +0 -23
- package/.next/dev/server/pages/_app/build-manifest.json +0 -23
- package/.next/dev/server/pages/_app/client-build-manifest.json +0 -5
- package/.next/dev/server/pages/_app/next-font-manifest.json +0 -6
- package/.next/dev/server/pages/_app/pages-manifest.json +0 -3
- package/.next/dev/server/pages/_app/react-loadable-manifest.json +0 -1
- package/.next/dev/server/pages/_app.js +0 -4
- package/.next/dev/server/pages/_app.js.map +0 -5
- package/.next/dev/server/pages/_document/next-font-manifest.json +0 -6
- package/.next/dev/server/pages/_document/pages-manifest.json +0 -3
- package/.next/dev/server/pages/_document/react-loadable-manifest.json +0 -1
- package/.next/dev/server/pages/_document.js +0 -5
- package/.next/dev/server/pages/_document.js.map +0 -5
- package/.next/dev/server/pages/_error/build-manifest.json +0 -22
- package/.next/dev/server/pages/_error/client-build-manifest.json +0 -5
- package/.next/dev/server/pages/_error/next-font-manifest.json +0 -6
- package/.next/dev/server/pages/_error/pages-manifest.json +0 -3
- package/.next/dev/server/pages/_error/react-loadable-manifest.json +0 -1
- package/.next/dev/server/pages/_error.js +0 -8
- package/.next/dev/server/pages/_error.js.map +0 -5
- package/.next/dev/server/pages-manifest.json +0 -5
- package/.next/dev/static/chunks/[next]_entry_page-loader_ts_0z3haqk._.js +0 -23
- package/.next/dev/static/chunks/[next]_entry_page-loader_ts_0z3haqk._.js.map +0 -6
- package/.next/dev/static/chunks/[next]_entry_page-loader_ts_1aoli7m._.js +0 -23
- package/.next/dev/static/chunks/[next]_entry_page-loader_ts_1aoli7m._.js.map +0 -6
- package/.next/dev/static/chunks/[root-of-the-server]__02sxxph._.js +0 -476
- package/.next/dev/static/chunks/[root-of-the-server]__02sxxph._.js.map +0 -6
- package/.next/dev/static/chunks/[root-of-the-server]__0l4r13l._.js +0 -476
- package/.next/dev/static/chunks/[root-of-the-server]__0l4r13l._.js.map +0 -6
- package/.next/dev/static/chunks/node_modules_10e2-xo._.js +0 -1343
- package/.next/dev/static/chunks/node_modules_10e2-xo._.js.map +0 -13
- package/.next/dev/static/chunks/node_modules_next_app_0yrdk3r.js +0 -8
- package/.next/dev/static/chunks/node_modules_next_app_0yrdk3r.js.map +0 -6
- package/.next/dev/static/chunks/node_modules_next_dist_1atto1n._.js +0 -2334
- package/.next/dev/static/chunks/node_modules_next_dist_1atto1n._.js.map +0 -26
- package/.next/dev/static/chunks/node_modules_next_dist_1gdrd03._.js +0 -2165
- package/.next/dev/static/chunks/node_modules_next_dist_1gdrd03._.js.map +0 -25
- package/.next/dev/static/chunks/node_modules_next_dist_client_16lnmlo._.js +0 -4084
- package/.next/dev/static/chunks/node_modules_next_dist_client_16lnmlo._.js.map +0 -49
- package/.next/dev/static/chunks/node_modules_next_dist_compiled_14ibvna._.js +0 -6064
- package/.next/dev/static/chunks/node_modules_next_dist_compiled_14ibvna._.js.map +0 -17
- package/.next/dev/static/chunks/node_modules_next_dist_shared_lib_0pizcwv._.js +0 -7311
- package/.next/dev/static/chunks/node_modules_next_dist_shared_lib_0pizcwv._.js.map +0 -72
- package/.next/dev/static/chunks/node_modules_next_dist_shared_lib_12jmhie._.js +0 -7070
- package/.next/dev/static/chunks/node_modules_next_dist_shared_lib_12jmhie._.js.map +0 -70
- package/.next/dev/static/chunks/node_modules_react-dom_0kla17-._.js +0 -15381
- package/.next/dev/static/chunks/node_modules_react-dom_0kla17-._.js.map +0 -9
- package/.next/dev/static/chunks/pages/_app.js +0 -13
- package/.next/dev/static/chunks/pages/_error.js +0 -12
- package/.next/dev/static/chunks/pages__app_0du2_q-._.js +0 -5
- package/.next/dev/static/chunks/pages__app_1ouknez._.js.map +0 -11
- package/.next/dev/static/chunks/pages__error_0du2_q-._.js +0 -5
- package/.next/dev/static/chunks/pages__error_18oj9bx._.js.map +0 -11
- package/.next/dev/static/chunks/turbopack-pages__app_1ouknez._.js +0 -2236
- package/.next/dev/static/chunks/turbopack-pages__error_18oj9bx._.js +0 -2236
- package/.next/server/chunks/333.js +0 -1
- package/.next/server/chunks/9972.js +0 -1
- package/.next/static/chunks/2420-fa8df70262f420d0.js +0 -1
- package/.next/static/chunks/app/_not-found/page-b2c1eefe2cdbb8c3.js +0 -1
- package/.next/static/chunks/app/docs/page-53e546dabf1b1ad3.js +0 -1
- package/.next/static/chunks/app/help/page-7ece210a72cf4a67.js +0 -1
- package/.next/static/chunks/app/layout-33b2dea4a7ce242e.js +0 -1
- package/.next/static/chunks/app/map/page-02ad8e3650faa96a.js +0 -1
- package/.next/static/chunks/app/settings/page-8a6efc095447310f.js +0 -1
- package/.next/static/chunks/main-app-cb1a040ffaced80b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-c82bd7a72a198de4.js +0 -1
- package/.next/static/css/f57cbca8ad454630.css +0 -1
- /package/.next/static/{fyHHiCSkZnragXxrsGMEr → kJSpkyKRHr2jFBQoOGP8P}/_buildManifest.js +0 -0
- /package/.next/static/{fyHHiCSkZnragXxrsGMEr → kJSpkyKRHr2jFBQoOGP8P}/_ssgManifest.js +0 -0
|
@@ -1,2236 +0,0 @@
|
|
|
1
|
-
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
|
|
2
|
-
typeof document === "object" ? document.currentScript : undefined,
|
|
3
|
-
{"otherChunks":["static/chunks/node_modules_next_dist_compiled_14ibvna._.js","static/chunks/node_modules_next_dist_shared_lib_12jmhie._.js","static/chunks/node_modules_next_dist_client_16lnmlo._.js","static/chunks/node_modules_next_dist_1gdrd03._.js","static/chunks/node_modules_next_app_0yrdk3r.js","static/chunks/[next]_entry_page-loader_ts_0z3haqk._.js","static/chunks/node_modules_react-dom_0kla17-._.js","static/chunks/node_modules_10e2-xo._.js","static/chunks/[root-of-the-server]__0l4r13l._.js"],"runtimeModuleIds":["[project]/node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js [client] (ecmascript)","[project]/node_modules/next/dist/client/next-dev-turbopack.js [client] (ecmascript)","[hmr-entry]/hmr-entry.js { ENTRY => \"[project]/pages/_app\" }"]}
|
|
4
|
-
]);
|
|
5
|
-
(() => {
|
|
6
|
-
if (!Array.isArray(globalThis["TURBOPACK"])) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const CHUNK_BASE_PATH = "/_next/";
|
|
11
|
-
const RELATIVE_ROOT_PATH = "/ROOT";
|
|
12
|
-
const RUNTIME_PUBLIC_PATH = "/_next/";
|
|
13
|
-
const ASSET_SUFFIX = getAssetSuffixFromScriptSrc();
|
|
14
|
-
const WORKER_FORWARDED_GLOBALS = ["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];
|
|
15
|
-
/**
|
|
16
|
-
* This file contains runtime types and functions that are shared between all
|
|
17
|
-
* TurboPack ECMAScript runtimes.
|
|
18
|
-
*
|
|
19
|
-
* It will be prepended to the runtime code of each runtime.
|
|
20
|
-
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" />
|
|
21
|
-
/**
|
|
22
|
-
* Describes why a module was instantiated.
|
|
23
|
-
* Shared between browser and Node.js runtimes.
|
|
24
|
-
*/ var SourceType = /*#__PURE__*/ function(SourceType) {
|
|
25
|
-
/**
|
|
26
|
-
* The module was instantiated because it was included in an evaluated chunk's
|
|
27
|
-
* runtime.
|
|
28
|
-
* SourceData is a ChunkPath.
|
|
29
|
-
*/ SourceType[SourceType["Runtime"] = 0] = "Runtime";
|
|
30
|
-
/**
|
|
31
|
-
* The module was instantiated because a parent module imported it.
|
|
32
|
-
* SourceData is a ModuleId.
|
|
33
|
-
*/ SourceType[SourceType["Parent"] = 1] = "Parent";
|
|
34
|
-
/**
|
|
35
|
-
* The module was instantiated because it was included in a chunk's hot module
|
|
36
|
-
* update.
|
|
37
|
-
* SourceData is an array of ModuleIds or undefined.
|
|
38
|
-
*/ SourceType[SourceType["Update"] = 2] = "Update";
|
|
39
|
-
return SourceType;
|
|
40
|
-
}(SourceType || {});
|
|
41
|
-
/**
|
|
42
|
-
* Flag indicating which module object type to create when a module is merged. Set to `true`
|
|
43
|
-
* by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,
|
|
44
|
-
* nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it
|
|
45
|
-
* uses plain Module objects.
|
|
46
|
-
*/ let createModuleWithDirectionFlag = false;
|
|
47
|
-
const REEXPORTED_OBJECTS = new WeakMap();
|
|
48
|
-
/**
|
|
49
|
-
* Constructs the `__turbopack_context__` object for a module.
|
|
50
|
-
*/ function Context(module, exports) {
|
|
51
|
-
this.m = module;
|
|
52
|
-
// We need to store this here instead of accessing it from the module object to:
|
|
53
|
-
// 1. Make it available to factories directly, since we rewrite `this` to
|
|
54
|
-
// `__turbopack_context__.e` in CJS modules.
|
|
55
|
-
// 2. Support async modules which rewrite `module.exports` to a promise, so we
|
|
56
|
-
// can still access the original exports object from functions like
|
|
57
|
-
// `esmExport`
|
|
58
|
-
// Ideally we could find a new approach for async modules and drop this property altogether.
|
|
59
|
-
this.e = exports;
|
|
60
|
-
}
|
|
61
|
-
const contextPrototype = Context.prototype;
|
|
62
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
63
|
-
const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag;
|
|
64
|
-
function defineProp(obj, name, options) {
|
|
65
|
-
if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options);
|
|
66
|
-
}
|
|
67
|
-
function getOverwrittenModule(moduleCache, id) {
|
|
68
|
-
let module = moduleCache[id];
|
|
69
|
-
if (!module) {
|
|
70
|
-
if (createModuleWithDirectionFlag) {
|
|
71
|
-
// set in development modes for hmr support
|
|
72
|
-
module = createModuleWithDirection(id);
|
|
73
|
-
} else {
|
|
74
|
-
module = createModuleObject(id);
|
|
75
|
-
}
|
|
76
|
-
moduleCache[id] = module;
|
|
77
|
-
}
|
|
78
|
-
return module;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Creates the module object. Only done here to ensure all module objects have the same shape.
|
|
82
|
-
*/ function createModuleObject(id) {
|
|
83
|
-
return {
|
|
84
|
-
exports: {},
|
|
85
|
-
error: undefined,
|
|
86
|
-
id,
|
|
87
|
-
namespaceObject: undefined
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function createModuleWithDirection(id) {
|
|
91
|
-
return {
|
|
92
|
-
exports: {},
|
|
93
|
-
error: undefined,
|
|
94
|
-
id,
|
|
95
|
-
namespaceObject: undefined,
|
|
96
|
-
parents: [],
|
|
97
|
-
children: []
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const BindingTag_Value = 0;
|
|
101
|
-
/**
|
|
102
|
-
* Adds the getters to the exports object.
|
|
103
|
-
*/ function esm(exports, bindings) {
|
|
104
|
-
defineProp(exports, '__esModule', {
|
|
105
|
-
value: true
|
|
106
|
-
});
|
|
107
|
-
if (toStringTag) defineProp(exports, toStringTag, {
|
|
108
|
-
value: 'Module'
|
|
109
|
-
});
|
|
110
|
-
let i = 0;
|
|
111
|
-
while(i < bindings.length){
|
|
112
|
-
const propName = bindings[i++];
|
|
113
|
-
const tagOrFunction = bindings[i++];
|
|
114
|
-
if (typeof tagOrFunction === 'number') {
|
|
115
|
-
if (tagOrFunction === BindingTag_Value) {
|
|
116
|
-
defineProp(exports, propName, {
|
|
117
|
-
value: bindings[i++],
|
|
118
|
-
enumerable: true,
|
|
119
|
-
writable: false
|
|
120
|
-
});
|
|
121
|
-
} else {
|
|
122
|
-
throw new Error(`unexpected tag: ${tagOrFunction}`);
|
|
123
|
-
}
|
|
124
|
-
} else {
|
|
125
|
-
const getterFn = tagOrFunction;
|
|
126
|
-
if (typeof bindings[i] === 'function') {
|
|
127
|
-
const setterFn = bindings[i++];
|
|
128
|
-
defineProp(exports, propName, {
|
|
129
|
-
get: getterFn,
|
|
130
|
-
set: setterFn,
|
|
131
|
-
enumerable: true
|
|
132
|
-
});
|
|
133
|
-
} else {
|
|
134
|
-
defineProp(exports, propName, {
|
|
135
|
-
get: getterFn,
|
|
136
|
-
enumerable: true
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
Object.seal(exports);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Makes the module an ESM with exports
|
|
145
|
-
*/ function esmExport(bindings, id) {
|
|
146
|
-
let module;
|
|
147
|
-
let exports;
|
|
148
|
-
if (id != null) {
|
|
149
|
-
module = getOverwrittenModule(this.c, id);
|
|
150
|
-
exports = module.exports;
|
|
151
|
-
} else {
|
|
152
|
-
module = this.m;
|
|
153
|
-
exports = this.e;
|
|
154
|
-
}
|
|
155
|
-
module.namespaceObject = exports;
|
|
156
|
-
esm(exports, bindings);
|
|
157
|
-
}
|
|
158
|
-
contextPrototype.s = esmExport;
|
|
159
|
-
function ensureDynamicExports(module, exports) {
|
|
160
|
-
let reexportedObjects = REEXPORTED_OBJECTS.get(module);
|
|
161
|
-
if (!reexportedObjects) {
|
|
162
|
-
REEXPORTED_OBJECTS.set(module, reexportedObjects = []);
|
|
163
|
-
module.exports = module.namespaceObject = new Proxy(exports, {
|
|
164
|
-
get (target, prop) {
|
|
165
|
-
if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') {
|
|
166
|
-
return Reflect.get(target, prop);
|
|
167
|
-
}
|
|
168
|
-
for (const obj of reexportedObjects){
|
|
169
|
-
const value = Reflect.get(obj, prop);
|
|
170
|
-
if (value !== undefined) return value;
|
|
171
|
-
}
|
|
172
|
-
return undefined;
|
|
173
|
-
},
|
|
174
|
-
ownKeys (target) {
|
|
175
|
-
const keys = Reflect.ownKeys(target);
|
|
176
|
-
for (const obj of reexportedObjects){
|
|
177
|
-
for (const key of Reflect.ownKeys(obj)){
|
|
178
|
-
if (key !== 'default' && !keys.includes(key)) keys.push(key);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return keys;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
return reexportedObjects;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Dynamically exports properties from an object
|
|
189
|
-
*/ function dynamicExport(object, id) {
|
|
190
|
-
let module;
|
|
191
|
-
let exports;
|
|
192
|
-
if (id != null) {
|
|
193
|
-
module = getOverwrittenModule(this.c, id);
|
|
194
|
-
exports = module.exports;
|
|
195
|
-
} else {
|
|
196
|
-
module = this.m;
|
|
197
|
-
exports = this.e;
|
|
198
|
-
}
|
|
199
|
-
const reexportedObjects = ensureDynamicExports(module, exports);
|
|
200
|
-
if (typeof object === 'object' && object !== null) {
|
|
201
|
-
reexportedObjects.push(object);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
contextPrototype.j = dynamicExport;
|
|
205
|
-
function exportValue(value, id) {
|
|
206
|
-
let module;
|
|
207
|
-
if (id != null) {
|
|
208
|
-
module = getOverwrittenModule(this.c, id);
|
|
209
|
-
} else {
|
|
210
|
-
module = this.m;
|
|
211
|
-
}
|
|
212
|
-
module.exports = value;
|
|
213
|
-
}
|
|
214
|
-
contextPrototype.v = exportValue;
|
|
215
|
-
function exportNamespace(namespace, id) {
|
|
216
|
-
let module;
|
|
217
|
-
if (id != null) {
|
|
218
|
-
module = getOverwrittenModule(this.c, id);
|
|
219
|
-
} else {
|
|
220
|
-
module = this.m;
|
|
221
|
-
}
|
|
222
|
-
module.exports = module.namespaceObject = namespace;
|
|
223
|
-
}
|
|
224
|
-
contextPrototype.n = exportNamespace;
|
|
225
|
-
function createGetter(obj, key) {
|
|
226
|
-
return ()=>obj[key];
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* @returns prototype of the object
|
|
230
|
-
*/ const getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
231
|
-
/** Prototypes that are not expanded for exports */ const LEAF_PROTOTYPES = [
|
|
232
|
-
null,
|
|
233
|
-
getProto({}),
|
|
234
|
-
getProto([]),
|
|
235
|
-
getProto(getProto)
|
|
236
|
-
];
|
|
237
|
-
/**
|
|
238
|
-
* @param raw
|
|
239
|
-
* @param ns
|
|
240
|
-
* @param allowExportDefault
|
|
241
|
-
* * `false`: will have the raw module as default export
|
|
242
|
-
* * `true`: will have the default property as default export
|
|
243
|
-
*/ function interopEsm(raw, ns, allowExportDefault) {
|
|
244
|
-
const bindings = [];
|
|
245
|
-
let defaultLocation = -1;
|
|
246
|
-
for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){
|
|
247
|
-
for (const key of Object.getOwnPropertyNames(current)){
|
|
248
|
-
bindings.push(key, createGetter(raw, key));
|
|
249
|
-
if (defaultLocation === -1 && key === 'default') {
|
|
250
|
-
defaultLocation = bindings.length - 1;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
// this is not really correct
|
|
255
|
-
// we should set the `default` getter if the imported module is a `.cjs file`
|
|
256
|
-
if (!(allowExportDefault && defaultLocation >= 0)) {
|
|
257
|
-
// Replace the binding with one for the namespace itself in order to preserve iteration order.
|
|
258
|
-
if (defaultLocation >= 0) {
|
|
259
|
-
// Replace the getter with the value
|
|
260
|
-
bindings.splice(defaultLocation, 1, BindingTag_Value, raw);
|
|
261
|
-
} else {
|
|
262
|
-
bindings.push('default', BindingTag_Value, raw);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
esm(ns, bindings);
|
|
266
|
-
return ns;
|
|
267
|
-
}
|
|
268
|
-
function createNS(raw) {
|
|
269
|
-
if (typeof raw === 'function') {
|
|
270
|
-
return function(...args) {
|
|
271
|
-
return raw.apply(this, args);
|
|
272
|
-
};
|
|
273
|
-
} else {
|
|
274
|
-
return Object.create(null);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
function esmImport(id) {
|
|
278
|
-
const module = getOrInstantiateModuleFromParent(id, this.m);
|
|
279
|
-
// any ES module has to have `module.namespaceObject` defined.
|
|
280
|
-
if (module.namespaceObject) return module.namespaceObject;
|
|
281
|
-
// only ESM can be an async module, so we don't need to worry about exports being a promise here.
|
|
282
|
-
const raw = module.exports;
|
|
283
|
-
return module.namespaceObject = interopEsm(raw, createNS(raw), raw && raw.__esModule);
|
|
284
|
-
}
|
|
285
|
-
contextPrototype.i = esmImport;
|
|
286
|
-
function asyncLoader(moduleId) {
|
|
287
|
-
const loader = this.r(moduleId);
|
|
288
|
-
return loader(esmImport.bind(this));
|
|
289
|
-
}
|
|
290
|
-
contextPrototype.A = asyncLoader;
|
|
291
|
-
// Add a simple runtime require so that environments without one can still pass
|
|
292
|
-
// `typeof require` CommonJS checks so that exports are correctly registered.
|
|
293
|
-
const runtimeRequire = // @ts-ignore
|
|
294
|
-
typeof require === 'function' ? require : function require1() {
|
|
295
|
-
throw new Error('Unexpected use of runtime require');
|
|
296
|
-
};
|
|
297
|
-
contextPrototype.t = runtimeRequire;
|
|
298
|
-
function commonJsRequire(id) {
|
|
299
|
-
return getOrInstantiateModuleFromParent(id, this.m).exports;
|
|
300
|
-
}
|
|
301
|
-
contextPrototype.r = commonJsRequire;
|
|
302
|
-
/**
|
|
303
|
-
* Remove fragments and query parameters since they are never part of the context map keys
|
|
304
|
-
*
|
|
305
|
-
* This matches how we parse patterns at resolving time. Arguably we should only do this for
|
|
306
|
-
* strings passed to `import` but the resolve does it for `import` and `require` and so we do
|
|
307
|
-
* here as well.
|
|
308
|
-
*/ function parseRequest(request) {
|
|
309
|
-
// Per the URI spec fragments can contain `?` characters, so we should trim it off first
|
|
310
|
-
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
|
|
311
|
-
const hashIndex = request.indexOf('#');
|
|
312
|
-
if (hashIndex !== -1) {
|
|
313
|
-
request = request.substring(0, hashIndex);
|
|
314
|
-
}
|
|
315
|
-
const queryIndex = request.indexOf('?');
|
|
316
|
-
if (queryIndex !== -1) {
|
|
317
|
-
request = request.substring(0, queryIndex);
|
|
318
|
-
}
|
|
319
|
-
return request;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* `require.context` and require/import expression runtime.
|
|
323
|
-
*/ function moduleContext(map) {
|
|
324
|
-
function moduleContext(id) {
|
|
325
|
-
id = parseRequest(id);
|
|
326
|
-
if (hasOwnProperty.call(map, id)) {
|
|
327
|
-
return map[id].module();
|
|
328
|
-
}
|
|
329
|
-
const e = new Error(`Cannot find module '${id}'`);
|
|
330
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
331
|
-
throw e;
|
|
332
|
-
}
|
|
333
|
-
moduleContext.keys = ()=>{
|
|
334
|
-
return Object.keys(map);
|
|
335
|
-
};
|
|
336
|
-
moduleContext.resolve = (id)=>{
|
|
337
|
-
id = parseRequest(id);
|
|
338
|
-
if (hasOwnProperty.call(map, id)) {
|
|
339
|
-
return map[id].id();
|
|
340
|
-
}
|
|
341
|
-
const e = new Error(`Cannot find module '${id}'`);
|
|
342
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
343
|
-
throw e;
|
|
344
|
-
};
|
|
345
|
-
moduleContext.import = async (id)=>{
|
|
346
|
-
return await moduleContext(id);
|
|
347
|
-
};
|
|
348
|
-
return moduleContext;
|
|
349
|
-
}
|
|
350
|
-
contextPrototype.f = moduleContext;
|
|
351
|
-
/**
|
|
352
|
-
* Returns the path of a chunk defined by its data.
|
|
353
|
-
*/ function getChunkPath(chunkData) {
|
|
354
|
-
return typeof chunkData === 'string' ? chunkData : chunkData.path;
|
|
355
|
-
}
|
|
356
|
-
function isPromise(maybePromise) {
|
|
357
|
-
return maybePromise != null && typeof maybePromise === 'object' && 'then' in maybePromise && typeof maybePromise.then === 'function';
|
|
358
|
-
}
|
|
359
|
-
function isAsyncModuleExt(obj) {
|
|
360
|
-
return turbopackQueues in obj;
|
|
361
|
-
}
|
|
362
|
-
function createPromise() {
|
|
363
|
-
let resolve;
|
|
364
|
-
let reject;
|
|
365
|
-
const promise = new Promise((res, rej)=>{
|
|
366
|
-
reject = rej;
|
|
367
|
-
resolve = res;
|
|
368
|
-
});
|
|
369
|
-
return {
|
|
370
|
-
promise,
|
|
371
|
-
resolve: resolve,
|
|
372
|
-
reject: reject
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.
|
|
376
|
-
// The CompressedModuleFactories format is
|
|
377
|
-
// - 1 or more module ids
|
|
378
|
-
// - a module factory function
|
|
379
|
-
// So walking this is a little complex but the flat structure is also fast to
|
|
380
|
-
// traverse, we can use `typeof` operators to distinguish the two cases.
|
|
381
|
-
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
|
|
382
|
-
let i = offset;
|
|
383
|
-
while(i < chunkModules.length){
|
|
384
|
-
let end = i + 1;
|
|
385
|
-
// Find our factory function
|
|
386
|
-
while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){
|
|
387
|
-
end++;
|
|
388
|
-
}
|
|
389
|
-
if (end === chunkModules.length) {
|
|
390
|
-
throw new Error('malformed chunk format, expected a factory function');
|
|
391
|
-
}
|
|
392
|
-
// Install the factory for each module ID that doesn't already have one.
|
|
393
|
-
// When some IDs in this group already have a factory, reuse that existing
|
|
394
|
-
// group factory for the missing IDs to keep all IDs in the group consistent.
|
|
395
|
-
// Otherwise, install the factory from this chunk.
|
|
396
|
-
const moduleFactoryFn = chunkModules[end];
|
|
397
|
-
let existingGroupFactory = undefined;
|
|
398
|
-
for(let j = i; j < end; j++){
|
|
399
|
-
const id = chunkModules[j];
|
|
400
|
-
const existingFactory = moduleFactories.get(id);
|
|
401
|
-
if (existingFactory) {
|
|
402
|
-
existingGroupFactory = existingFactory;
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
const factoryToInstall = existingGroupFactory ?? moduleFactoryFn;
|
|
407
|
-
let didInstallFactory = false;
|
|
408
|
-
for(let j = i; j < end; j++){
|
|
409
|
-
const id = chunkModules[j];
|
|
410
|
-
if (!moduleFactories.has(id)) {
|
|
411
|
-
if (!didInstallFactory) {
|
|
412
|
-
if (factoryToInstall === moduleFactoryFn) {
|
|
413
|
-
applyModuleFactoryName(moduleFactoryFn);
|
|
414
|
-
}
|
|
415
|
-
didInstallFactory = true;
|
|
416
|
-
}
|
|
417
|
-
moduleFactories.set(id, factoryToInstall);
|
|
418
|
-
newModuleId?.(id);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array.
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
// everything below is adapted from webpack
|
|
425
|
-
// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13
|
|
426
|
-
const turbopackQueues = Symbol('turbopack queues');
|
|
427
|
-
const turbopackExports = Symbol('turbopack exports');
|
|
428
|
-
const turbopackError = Symbol('turbopack error');
|
|
429
|
-
function resolveQueue(queue) {
|
|
430
|
-
if (queue && queue.status !== 1) {
|
|
431
|
-
queue.status = 1;
|
|
432
|
-
queue.forEach((fn)=>fn.queueCount--);
|
|
433
|
-
queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn());
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
function wrapDeps(deps) {
|
|
437
|
-
return deps.map((dep)=>{
|
|
438
|
-
if (dep !== null && typeof dep === 'object') {
|
|
439
|
-
if (isAsyncModuleExt(dep)) return dep;
|
|
440
|
-
if (isPromise(dep)) {
|
|
441
|
-
const queue = Object.assign([], {
|
|
442
|
-
status: 0
|
|
443
|
-
});
|
|
444
|
-
const obj = {
|
|
445
|
-
[turbopackExports]: {},
|
|
446
|
-
[turbopackQueues]: (fn)=>fn(queue)
|
|
447
|
-
};
|
|
448
|
-
dep.then((res)=>{
|
|
449
|
-
obj[turbopackExports] = res;
|
|
450
|
-
resolveQueue(queue);
|
|
451
|
-
}, (err)=>{
|
|
452
|
-
obj[turbopackError] = err;
|
|
453
|
-
resolveQueue(queue);
|
|
454
|
-
});
|
|
455
|
-
return obj;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
[turbopackExports]: dep,
|
|
460
|
-
[turbopackQueues]: ()=>{}
|
|
461
|
-
};
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
function asyncModule(body, hasAwait) {
|
|
465
|
-
const module = this.m;
|
|
466
|
-
const queue = hasAwait ? Object.assign([], {
|
|
467
|
-
status: -1
|
|
468
|
-
}) : undefined;
|
|
469
|
-
const depQueues = new Set();
|
|
470
|
-
const { resolve, reject, promise: rawPromise } = createPromise();
|
|
471
|
-
const promise = Object.assign(rawPromise, {
|
|
472
|
-
[turbopackExports]: module.exports,
|
|
473
|
-
[turbopackQueues]: (fn)=>{
|
|
474
|
-
queue && fn(queue);
|
|
475
|
-
depQueues.forEach(fn);
|
|
476
|
-
promise['catch'](()=>{});
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
const attributes = {
|
|
480
|
-
get () {
|
|
481
|
-
return promise;
|
|
482
|
-
},
|
|
483
|
-
set (v) {
|
|
484
|
-
// Calling `esmExport` leads to this.
|
|
485
|
-
if (v !== promise) {
|
|
486
|
-
promise[turbopackExports] = v;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
Object.defineProperty(module, 'exports', attributes);
|
|
491
|
-
Object.defineProperty(module, 'namespaceObject', attributes);
|
|
492
|
-
function handleAsyncDependencies(deps) {
|
|
493
|
-
const currentDeps = wrapDeps(deps);
|
|
494
|
-
const getResult = ()=>currentDeps.map((d)=>{
|
|
495
|
-
if (d[turbopackError]) throw d[turbopackError];
|
|
496
|
-
return d[turbopackExports];
|
|
497
|
-
});
|
|
498
|
-
const { promise, resolve } = createPromise();
|
|
499
|
-
const fn = Object.assign(()=>resolve(getResult), {
|
|
500
|
-
queueCount: 0
|
|
501
|
-
});
|
|
502
|
-
function fnQueue(q) {
|
|
503
|
-
if (q !== queue && !depQueues.has(q)) {
|
|
504
|
-
depQueues.add(q);
|
|
505
|
-
if (q && q.status === 0) {
|
|
506
|
-
fn.queueCount++;
|
|
507
|
-
q.push(fn);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
currentDeps.map((dep)=>dep[turbopackQueues](fnQueue));
|
|
512
|
-
return fn.queueCount ? promise : getResult();
|
|
513
|
-
}
|
|
514
|
-
function asyncResult(err) {
|
|
515
|
-
if (err) {
|
|
516
|
-
reject(promise[turbopackError] = err);
|
|
517
|
-
} else {
|
|
518
|
-
resolve(promise[turbopackExports]);
|
|
519
|
-
}
|
|
520
|
-
resolveQueue(queue);
|
|
521
|
-
}
|
|
522
|
-
body(handleAsyncDependencies, asyncResult);
|
|
523
|
-
if (queue && queue.status === -1) {
|
|
524
|
-
queue.status = 0;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
contextPrototype.a = asyncModule;
|
|
528
|
-
/**
|
|
529
|
-
* A pseudo "fake" URL object to resolve to its relative path.
|
|
530
|
-
*
|
|
531
|
-
* When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this
|
|
532
|
-
* runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid
|
|
533
|
-
* hydration mismatch.
|
|
534
|
-
*
|
|
535
|
-
* This is based on webpack's existing implementation:
|
|
536
|
-
* https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js
|
|
537
|
-
*/ const relativeURL = function relativeURL(inputUrl) {
|
|
538
|
-
const realUrl = new URL(inputUrl, 'x:/');
|
|
539
|
-
const values = {};
|
|
540
|
-
for(const key in realUrl)values[key] = realUrl[key];
|
|
541
|
-
values.href = inputUrl;
|
|
542
|
-
values.pathname = inputUrl.replace(/[?#].*/, '');
|
|
543
|
-
values.origin = values.protocol = '';
|
|
544
|
-
values.toString = values.toJSON = (..._args)=>inputUrl;
|
|
545
|
-
for(const key in values)Object.defineProperty(this, key, {
|
|
546
|
-
enumerable: true,
|
|
547
|
-
configurable: true,
|
|
548
|
-
value: values[key]
|
|
549
|
-
});
|
|
550
|
-
};
|
|
551
|
-
relativeURL.prototype = URL.prototype;
|
|
552
|
-
contextPrototype.U = relativeURL;
|
|
553
|
-
/**
|
|
554
|
-
* Utility function to ensure all variants of an enum are handled.
|
|
555
|
-
*/ function invariant(never, computeMessage) {
|
|
556
|
-
throw new Error(`Invariant: ${computeMessage(never)}`);
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* Constructs an error message for when a module factory is not available.
|
|
560
|
-
*/ function factoryNotAvailableMessage(moduleId, sourceType, sourceData) {
|
|
561
|
-
let instantiationReason;
|
|
562
|
-
switch(sourceType){
|
|
563
|
-
case 0:
|
|
564
|
-
instantiationReason = `as a runtime entry of chunk ${sourceData}`;
|
|
565
|
-
break;
|
|
566
|
-
case 1:
|
|
567
|
-
instantiationReason = `because it was required from module ${sourceData}`;
|
|
568
|
-
break;
|
|
569
|
-
case 2:
|
|
570
|
-
instantiationReason = 'because of an HMR update';
|
|
571
|
-
break;
|
|
572
|
-
default:
|
|
573
|
-
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
|
|
574
|
-
}
|
|
575
|
-
return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* A stub function to make `require` available but non-functional in ESM.
|
|
579
|
-
*/ function requireStub(_moduleId) {
|
|
580
|
-
throw new Error('dynamic usage of require is not supported');
|
|
581
|
-
}
|
|
582
|
-
contextPrototype.z = requireStub;
|
|
583
|
-
// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.
|
|
584
|
-
contextPrototype.g = globalThis;
|
|
585
|
-
function applyModuleFactoryName(factory) {
|
|
586
|
-
// Give the module factory a nice name to improve stack traces.
|
|
587
|
-
Object.defineProperty(factory, 'name', {
|
|
588
|
-
value: 'module evaluation'
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* This file contains runtime types and functions that are shared between all
|
|
593
|
-
* Turbopack *browser* ECMAScript runtimes.
|
|
594
|
-
*
|
|
595
|
-
* It will be appended to the runtime code of each runtime right after the
|
|
596
|
-
* shared runtime utils.
|
|
597
|
-
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
|
|
598
|
-
/// <reference path="../../../shared/runtime/runtime-utils.ts" />
|
|
599
|
-
// Used in WebWorkers to tell the runtime about the chunk suffix
|
|
600
|
-
const browserContextPrototype = Context.prototype;
|
|
601
|
-
const moduleFactories = new Map();
|
|
602
|
-
contextPrototype.M = moduleFactories;
|
|
603
|
-
const availableModules = new Map();
|
|
604
|
-
const availableModuleChunks = new Map();
|
|
605
|
-
function loadChunk(chunkData) {
|
|
606
|
-
return loadChunkInternal(SourceType.Parent, this.m.id, chunkData);
|
|
607
|
-
}
|
|
608
|
-
browserContextPrototype.l = loadChunk;
|
|
609
|
-
function loadInitialChunk(chunkPath, chunkData) {
|
|
610
|
-
return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData);
|
|
611
|
-
}
|
|
612
|
-
async function loadChunkInternal(sourceType, sourceData, chunkData) {
|
|
613
|
-
if (typeof chunkData === 'string') {
|
|
614
|
-
return loadChunkPath(sourceType, sourceData, chunkData);
|
|
615
|
-
}
|
|
616
|
-
const includedList = chunkData.included || [];
|
|
617
|
-
const modulesPromises = includedList.map((included)=>{
|
|
618
|
-
if (moduleFactories.has(included)) return true;
|
|
619
|
-
return availableModules.get(included);
|
|
620
|
-
});
|
|
621
|
-
if (modulesPromises.length > 0 && modulesPromises.every((p)=>p)) {
|
|
622
|
-
// When all included items are already loaded or loading, we can skip loading ourselves
|
|
623
|
-
await Promise.all(modulesPromises);
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
const includedModuleChunksList = chunkData.moduleChunks || [];
|
|
627
|
-
const moduleChunksPromises = includedModuleChunksList.map((included)=>{
|
|
628
|
-
// TODO(alexkirsz) Do we need this check?
|
|
629
|
-
// if (moduleFactories[included]) return true;
|
|
630
|
-
return availableModuleChunks.get(included);
|
|
631
|
-
}).filter((p)=>p);
|
|
632
|
-
let promise;
|
|
633
|
-
if (moduleChunksPromises.length > 0) {
|
|
634
|
-
// Some module chunks are already loaded or loading.
|
|
635
|
-
if (moduleChunksPromises.length === includedModuleChunksList.length) {
|
|
636
|
-
// When all included module chunks are already loaded or loading, we can skip loading ourselves
|
|
637
|
-
await Promise.all(moduleChunksPromises);
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
const moduleChunksToLoad = new Set();
|
|
641
|
-
for (const moduleChunk of includedModuleChunksList){
|
|
642
|
-
if (!availableModuleChunks.has(moduleChunk)) {
|
|
643
|
-
moduleChunksToLoad.add(moduleChunk);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
for (const moduleChunkToLoad of moduleChunksToLoad){
|
|
647
|
-
const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad);
|
|
648
|
-
availableModuleChunks.set(moduleChunkToLoad, promise);
|
|
649
|
-
moduleChunksPromises.push(promise);
|
|
650
|
-
}
|
|
651
|
-
promise = Promise.all(moduleChunksPromises);
|
|
652
|
-
} else {
|
|
653
|
-
promise = loadChunkPath(sourceType, sourceData, chunkData.path);
|
|
654
|
-
// Mark all included module chunks as loading if they are not already loaded or loading.
|
|
655
|
-
for (const includedModuleChunk of includedModuleChunksList){
|
|
656
|
-
if (!availableModuleChunks.has(includedModuleChunk)) {
|
|
657
|
-
availableModuleChunks.set(includedModuleChunk, promise);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
for (const included of includedList){
|
|
662
|
-
if (!availableModules.has(included)) {
|
|
663
|
-
// It might be better to race old and new promises, but it's rare that the new promise will be faster than a request started earlier.
|
|
664
|
-
// In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.
|
|
665
|
-
availableModules.set(included, promise);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
await promise;
|
|
669
|
-
}
|
|
670
|
-
const loadedChunk = Promise.resolve(undefined);
|
|
671
|
-
const instrumentedBackendLoadChunks = new WeakMap();
|
|
672
|
-
// Do not make this async. React relies on referential equality of the returned Promise.
|
|
673
|
-
function loadChunkByUrl(chunkUrl) {
|
|
674
|
-
return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl);
|
|
675
|
-
}
|
|
676
|
-
browserContextPrototype.L = loadChunkByUrl;
|
|
677
|
-
// Do not make this async. React relies on referential equality of the returned Promise.
|
|
678
|
-
function loadChunkByUrlInternal(sourceType, sourceData, chunkUrl) {
|
|
679
|
-
const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl);
|
|
680
|
-
let entry = instrumentedBackendLoadChunks.get(thenable);
|
|
681
|
-
if (entry === undefined) {
|
|
682
|
-
const resolve = instrumentedBackendLoadChunks.set.bind(instrumentedBackendLoadChunks, thenable, loadedChunk);
|
|
683
|
-
entry = thenable.then(resolve).catch((cause)=>{
|
|
684
|
-
let loadReason;
|
|
685
|
-
switch(sourceType){
|
|
686
|
-
case SourceType.Runtime:
|
|
687
|
-
loadReason = `as a runtime dependency of chunk ${sourceData}`;
|
|
688
|
-
break;
|
|
689
|
-
case SourceType.Parent:
|
|
690
|
-
loadReason = `from module ${sourceData}`;
|
|
691
|
-
break;
|
|
692
|
-
case SourceType.Update:
|
|
693
|
-
loadReason = 'from an HMR update';
|
|
694
|
-
break;
|
|
695
|
-
default:
|
|
696
|
-
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
|
|
697
|
-
}
|
|
698
|
-
let error = new Error(`Failed to load chunk ${chunkUrl} ${loadReason}${cause ? `: ${cause}` : ''}`, cause ? {
|
|
699
|
-
cause
|
|
700
|
-
} : undefined);
|
|
701
|
-
error.name = 'ChunkLoadError';
|
|
702
|
-
throw error;
|
|
703
|
-
});
|
|
704
|
-
instrumentedBackendLoadChunks.set(thenable, entry);
|
|
705
|
-
}
|
|
706
|
-
return entry;
|
|
707
|
-
}
|
|
708
|
-
// Do not make this async. React relies on referential equality of the returned Promise.
|
|
709
|
-
function loadChunkPath(sourceType, sourceData, chunkPath) {
|
|
710
|
-
const url = getChunkRelativeUrl(chunkPath);
|
|
711
|
-
return loadChunkByUrlInternal(sourceType, sourceData, url);
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* Returns an absolute url to an asset.
|
|
715
|
-
*/ function resolvePathFromModule(moduleId) {
|
|
716
|
-
const exported = this.r(moduleId);
|
|
717
|
-
return exported?.default ?? exported;
|
|
718
|
-
}
|
|
719
|
-
browserContextPrototype.R = resolvePathFromModule;
|
|
720
|
-
/**
|
|
721
|
-
* no-op for browser
|
|
722
|
-
* @param modulePath
|
|
723
|
-
*/ function resolveAbsolutePath(modulePath) {
|
|
724
|
-
return `/ROOT/${modulePath ?? ''}`;
|
|
725
|
-
}
|
|
726
|
-
browserContextPrototype.P = resolveAbsolutePath;
|
|
727
|
-
/**
|
|
728
|
-
* Exports a URL with the static suffix appended.
|
|
729
|
-
*/ function exportUrl(url, id) {
|
|
730
|
-
exportValue.call(this, `${url}${ASSET_SUFFIX}`, id);
|
|
731
|
-
}
|
|
732
|
-
browserContextPrototype.q = exportUrl;
|
|
733
|
-
/**
|
|
734
|
-
* Creates a worker by instantiating the given WorkerConstructor with the
|
|
735
|
-
* appropriate URL and options.
|
|
736
|
-
*
|
|
737
|
-
* The entrypoint is a pre-compiled worker runtime file. The params configure
|
|
738
|
-
* which module chunks to load and which module to run as the entry point.
|
|
739
|
-
*
|
|
740
|
-
* The params are a JSON array of the following structure:
|
|
741
|
-
* `[TURBOPACK_NEXT_CHUNK_URLS, ASSET_SUFFIX, ...WORKER_FORWARDED_GLOBALS values]`
|
|
742
|
-
*
|
|
743
|
-
* @param WorkerConstructor The Worker or SharedWorker constructor
|
|
744
|
-
* @param entrypoint URL path to the worker entrypoint chunk
|
|
745
|
-
* @param moduleChunks list of module chunk paths to load
|
|
746
|
-
* @param workerOptions options to pass to the Worker constructor (optional)
|
|
747
|
-
*/ function createWorker(WorkerConstructor, entrypoint, moduleChunks, workerOptions) {
|
|
748
|
-
const isSharedWorker = WorkerConstructor.name === 'SharedWorker';
|
|
749
|
-
const chunkUrls = moduleChunks.map((chunk)=>getChunkRelativeUrl(chunk)).reverse();
|
|
750
|
-
const params = [
|
|
751
|
-
chunkUrls,
|
|
752
|
-
ASSET_SUFFIX
|
|
753
|
-
];
|
|
754
|
-
for (const globalName of WORKER_FORWARDED_GLOBALS){
|
|
755
|
-
params.push(globalThis[globalName]);
|
|
756
|
-
}
|
|
757
|
-
const url = new URL(getChunkRelativeUrl(entrypoint), location.origin);
|
|
758
|
-
const paramsJson = JSON.stringify(params);
|
|
759
|
-
if (isSharedWorker) {
|
|
760
|
-
url.searchParams.set('params', paramsJson);
|
|
761
|
-
} else {
|
|
762
|
-
url.hash = '#params=' + encodeURIComponent(paramsJson);
|
|
763
|
-
}
|
|
764
|
-
// Remove type: "module" from options since our worker entrypoint is not a module
|
|
765
|
-
const options = workerOptions ? {
|
|
766
|
-
...workerOptions,
|
|
767
|
-
type: undefined
|
|
768
|
-
} : undefined;
|
|
769
|
-
return new WorkerConstructor(url, options);
|
|
770
|
-
}
|
|
771
|
-
browserContextPrototype.b = createWorker;
|
|
772
|
-
/**
|
|
773
|
-
* Instantiates a runtime module.
|
|
774
|
-
*/ function instantiateRuntimeModule(moduleId, chunkPath) {
|
|
775
|
-
return instantiateModule(moduleId, SourceType.Runtime, chunkPath);
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* Returns the URL relative to the origin where a chunk can be fetched from.
|
|
779
|
-
*/ function getChunkRelativeUrl(chunkPath) {
|
|
780
|
-
return `${CHUNK_BASE_PATH}${chunkPath.split('/').map((p)=>encodeURIComponent(p)).join('/')}${ASSET_SUFFIX}`;
|
|
781
|
-
}
|
|
782
|
-
function getPathFromScript(chunkScript) {
|
|
783
|
-
if (typeof chunkScript === 'string') {
|
|
784
|
-
return chunkScript;
|
|
785
|
-
}
|
|
786
|
-
const chunkUrl = chunkScript.src;
|
|
787
|
-
const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''));
|
|
788
|
-
const path = src.startsWith(CHUNK_BASE_PATH) ? src.slice(CHUNK_BASE_PATH.length) : src;
|
|
789
|
-
return path;
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Return the ChunkUrl from a ChunkScript.
|
|
793
|
-
*/ function getUrlFromScript(chunk) {
|
|
794
|
-
if (typeof chunk === 'string') {
|
|
795
|
-
return getChunkRelativeUrl(chunk);
|
|
796
|
-
} else {
|
|
797
|
-
// This is already exactly what we want
|
|
798
|
-
return chunk.src;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* Determine the chunk to register. Note that this function has side-effects!
|
|
803
|
-
*/ function getChunkFromRegistration(chunk) {
|
|
804
|
-
if (typeof chunk === 'string') {
|
|
805
|
-
return chunk;
|
|
806
|
-
} else if (!chunk) {
|
|
807
|
-
if (typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined') {
|
|
808
|
-
return {
|
|
809
|
-
src: TURBOPACK_NEXT_CHUNK_URLS.pop()
|
|
810
|
-
};
|
|
811
|
-
} else {
|
|
812
|
-
throw new Error('chunk path empty but not in a worker');
|
|
813
|
-
}
|
|
814
|
-
} else {
|
|
815
|
-
return {
|
|
816
|
-
src: chunk.getAttribute('src')
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
|
|
821
|
-
/**
|
|
822
|
-
* Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
|
|
823
|
-
*/ function isJs(chunkUrlOrPath) {
|
|
824
|
-
return regexJsUrl.test(chunkUrlOrPath);
|
|
825
|
-
}
|
|
826
|
-
const regexCssUrl = /\.css(?:\?[^#]*)?(?:#.*)?$/;
|
|
827
|
-
/**
|
|
828
|
-
* Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.
|
|
829
|
-
*/ function isCss(chunkUrl) {
|
|
830
|
-
return regexCssUrl.test(chunkUrl);
|
|
831
|
-
}
|
|
832
|
-
function loadWebAssembly(chunkPath, edgeModule, importsObj) {
|
|
833
|
-
return BACKEND.loadWebAssembly(SourceType.Parent, this.m.id, chunkPath, edgeModule, importsObj);
|
|
834
|
-
}
|
|
835
|
-
contextPrototype.w = loadWebAssembly;
|
|
836
|
-
function loadWebAssemblyModule(chunkPath, edgeModule) {
|
|
837
|
-
return BACKEND.loadWebAssemblyModule(SourceType.Parent, this.m.id, chunkPath, edgeModule);
|
|
838
|
-
}
|
|
839
|
-
contextPrototype.u = loadWebAssemblyModule;
|
|
840
|
-
/// <reference path="./runtime-utils.ts" />
|
|
841
|
-
/// <reference path="./runtime-types.d.ts" />
|
|
842
|
-
/// <reference path="./dev-extensions.ts" />
|
|
843
|
-
/// <reference path="./dev-protocol.d.ts" />
|
|
844
|
-
/**
|
|
845
|
-
* Shared HMR (Hot Module Replacement) implementation.
|
|
846
|
-
*
|
|
847
|
-
* This file contains the complete HMR implementation that's shared between
|
|
848
|
-
* browser and Node.js runtimes. It manages module hot state, dependency
|
|
849
|
-
* tracking, the module.hot API, and the full HMR update flow.
|
|
850
|
-
*/ /**
|
|
851
|
-
* The development module cache shared across the runtime.
|
|
852
|
-
* Browser runtime declares this directly.
|
|
853
|
-
* Node.js runtime assigns globalThis.__turbopack_module_cache__ to this.
|
|
854
|
-
*/ let devModuleCache;
|
|
855
|
-
/**
|
|
856
|
-
* Module IDs that are instantiated as part of the runtime of a chunk.
|
|
857
|
-
*/ let runtimeModules;
|
|
858
|
-
/**
|
|
859
|
-
* Maps module IDs to persisted data between executions of their hot module
|
|
860
|
-
* implementation (`hot.data`).
|
|
861
|
-
*/ const moduleHotData = new Map();
|
|
862
|
-
/**
|
|
863
|
-
* Maps module instances to their hot module state.
|
|
864
|
-
* Uses WeakMap so it works with both HotModule and ModuleWithDirection.
|
|
865
|
-
*/ const moduleHotState = new WeakMap();
|
|
866
|
-
/**
|
|
867
|
-
* Modules that call `module.hot.invalidate()` (while being updated).
|
|
868
|
-
*/ const queuedInvalidatedModules = new Set();
|
|
869
|
-
class UpdateApplyError extends Error {
|
|
870
|
-
name = 'UpdateApplyError';
|
|
871
|
-
dependencyChain;
|
|
872
|
-
constructor(message, dependencyChain){
|
|
873
|
-
super(message);
|
|
874
|
-
this.dependencyChain = dependencyChain;
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Records parent-child relationship when a module imports another.
|
|
879
|
-
* Should be called during module instantiation.
|
|
880
|
-
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
881
|
-
function trackModuleImport(parentModule, childModuleId, childModule) {
|
|
882
|
-
// Record that parent imports child
|
|
883
|
-
if (parentModule.children.indexOf(childModuleId) === -1) {
|
|
884
|
-
parentModule.children.push(childModuleId);
|
|
885
|
-
}
|
|
886
|
-
// Record that child is imported by parent
|
|
887
|
-
if (childModule && childModule.parents.indexOf(parentModule.id) === -1) {
|
|
888
|
-
childModule.parents.push(parentModule.id);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
function formatDependencyChain(dependencyChain) {
|
|
892
|
-
return `Dependency chain: ${dependencyChain.join(' -> ')}`;
|
|
893
|
-
}
|
|
894
|
-
/**
|
|
895
|
-
* Walks the dependency tree to find all modules affected by a change.
|
|
896
|
-
* Returns information about whether the update can be accepted and which
|
|
897
|
-
* modules need to be invalidated.
|
|
898
|
-
*
|
|
899
|
-
* @param moduleId - The module that changed
|
|
900
|
-
* @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept().
|
|
901
|
-
* This is used for server-side HMR where pages auto-accept at the top level.
|
|
902
|
-
*/ function getAffectedModuleEffects(moduleId, autoAcceptRootModules) {
|
|
903
|
-
const outdatedModules = new Set();
|
|
904
|
-
const outdatedDependencies = new Map();
|
|
905
|
-
const queue = [
|
|
906
|
-
{
|
|
907
|
-
moduleId,
|
|
908
|
-
dependencyChain: []
|
|
909
|
-
}
|
|
910
|
-
];
|
|
911
|
-
let nextItem;
|
|
912
|
-
while(nextItem = queue.shift()){
|
|
913
|
-
const { moduleId, dependencyChain } = nextItem;
|
|
914
|
-
if (moduleId != null) {
|
|
915
|
-
if (outdatedModules.has(moduleId)) {
|
|
916
|
-
continue;
|
|
917
|
-
}
|
|
918
|
-
outdatedModules.add(moduleId);
|
|
919
|
-
}
|
|
920
|
-
// We've arrived at the runtime of the chunk, which means that nothing
|
|
921
|
-
// else above can accept this update.
|
|
922
|
-
if (moduleId === undefined) {
|
|
923
|
-
if (autoAcceptRootModules) {
|
|
924
|
-
return {
|
|
925
|
-
type: 'accepted',
|
|
926
|
-
moduleId,
|
|
927
|
-
outdatedModules,
|
|
928
|
-
outdatedDependencies
|
|
929
|
-
};
|
|
930
|
-
}
|
|
931
|
-
return {
|
|
932
|
-
type: 'unaccepted',
|
|
933
|
-
dependencyChain
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
const module = devModuleCache[moduleId];
|
|
937
|
-
const hotState = moduleHotState.get(module);
|
|
938
|
-
if (// The module is not in the cache. Since this is a "modified" update,
|
|
939
|
-
// it means that the module was never instantiated before.
|
|
940
|
-
!module || hotState.selfAccepted && !hotState.selfInvalidated) {
|
|
941
|
-
continue;
|
|
942
|
-
}
|
|
943
|
-
if (hotState.selfDeclined) {
|
|
944
|
-
return {
|
|
945
|
-
type: 'self-declined',
|
|
946
|
-
dependencyChain,
|
|
947
|
-
moduleId
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
if (runtimeModules.has(moduleId)) {
|
|
951
|
-
if (autoAcceptRootModules) {
|
|
952
|
-
continue;
|
|
953
|
-
}
|
|
954
|
-
queue.push({
|
|
955
|
-
moduleId: undefined,
|
|
956
|
-
dependencyChain: [
|
|
957
|
-
...dependencyChain,
|
|
958
|
-
moduleId
|
|
959
|
-
]
|
|
960
|
-
});
|
|
961
|
-
continue;
|
|
962
|
-
}
|
|
963
|
-
for (const parentId of module.parents){
|
|
964
|
-
const parent = devModuleCache[parentId];
|
|
965
|
-
if (!parent) {
|
|
966
|
-
continue;
|
|
967
|
-
}
|
|
968
|
-
const parentHotState = moduleHotState.get(parent);
|
|
969
|
-
// Check if parent declined this dependency
|
|
970
|
-
if (parentHotState?.declinedDependencies[moduleId]) {
|
|
971
|
-
return {
|
|
972
|
-
type: 'declined',
|
|
973
|
-
dependencyChain: [
|
|
974
|
-
...dependencyChain,
|
|
975
|
-
moduleId
|
|
976
|
-
],
|
|
977
|
-
moduleId,
|
|
978
|
-
parentId
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
// Skip if parent is already outdated
|
|
982
|
-
if (outdatedModules.has(parentId)) {
|
|
983
|
-
continue;
|
|
984
|
-
}
|
|
985
|
-
// Check if parent accepts this dependency
|
|
986
|
-
if (parentHotState?.acceptedDependencies[moduleId]) {
|
|
987
|
-
if (!outdatedDependencies.has(parentId)) {
|
|
988
|
-
outdatedDependencies.set(parentId, new Set());
|
|
989
|
-
}
|
|
990
|
-
outdatedDependencies.get(parentId).add(moduleId);
|
|
991
|
-
continue;
|
|
992
|
-
}
|
|
993
|
-
// Neither accepted nor declined — propagate to parent
|
|
994
|
-
queue.push({
|
|
995
|
-
moduleId: parentId,
|
|
996
|
-
dependencyChain: [
|
|
997
|
-
...dependencyChain,
|
|
998
|
-
moduleId
|
|
999
|
-
]
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
|
-
// If no parents and we're at a root module, auto-accept if configured
|
|
1003
|
-
if (module.parents.length === 0 && autoAcceptRootModules) {
|
|
1004
|
-
continue;
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return {
|
|
1008
|
-
type: 'accepted',
|
|
1009
|
-
moduleId,
|
|
1010
|
-
outdatedModules,
|
|
1011
|
-
outdatedDependencies
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
/**
|
|
1015
|
-
* Merges source dependency map into target dependency map.
|
|
1016
|
-
*/ function mergeDependencies(target, source) {
|
|
1017
|
-
for (const [parentId, deps] of source){
|
|
1018
|
-
const existing = target.get(parentId);
|
|
1019
|
-
if (existing) {
|
|
1020
|
-
for (const dep of deps){
|
|
1021
|
-
existing.add(dep);
|
|
1022
|
-
}
|
|
1023
|
-
} else {
|
|
1024
|
-
target.set(parentId, new Set(deps));
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Computes all modules that need to be invalidated based on which modules changed.
|
|
1030
|
-
*
|
|
1031
|
-
* @param invalidated - The modules that have been invalidated
|
|
1032
|
-
* @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()
|
|
1033
|
-
*/ function computedInvalidatedModules(invalidated, autoAcceptRootModules) {
|
|
1034
|
-
const outdatedModules = new Set();
|
|
1035
|
-
const outdatedDependencies = new Map();
|
|
1036
|
-
for (const moduleId of invalidated){
|
|
1037
|
-
const effect = getAffectedModuleEffects(moduleId, autoAcceptRootModules);
|
|
1038
|
-
switch(effect.type){
|
|
1039
|
-
case 'unaccepted':
|
|
1040
|
-
throw new UpdateApplyError(`cannot apply update: unaccepted module. ${formatDependencyChain(effect.dependencyChain)}.`, effect.dependencyChain);
|
|
1041
|
-
case 'self-declined':
|
|
1042
|
-
throw new UpdateApplyError(`cannot apply update: self-declined module. ${formatDependencyChain(effect.dependencyChain)}.`, effect.dependencyChain);
|
|
1043
|
-
case 'declined':
|
|
1044
|
-
throw new UpdateApplyError(`cannot apply update: declined dependency. ${formatDependencyChain(effect.dependencyChain)}. Declined by ${effect.parentId}.`, effect.dependencyChain);
|
|
1045
|
-
case 'accepted':
|
|
1046
|
-
for (const outdatedModuleId of effect.outdatedModules){
|
|
1047
|
-
outdatedModules.add(outdatedModuleId);
|
|
1048
|
-
}
|
|
1049
|
-
mergeDependencies(outdatedDependencies, effect.outdatedDependencies);
|
|
1050
|
-
break;
|
|
1051
|
-
default:
|
|
1052
|
-
invariant(effect, (effect)=>`Unknown effect type: ${effect?.type}`);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
return {
|
|
1056
|
-
outdatedModules,
|
|
1057
|
-
outdatedDependencies
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* Creates the module.hot API object and its internal state.
|
|
1062
|
-
* This provides the HMR API that user code calls (module.hot.accept(), etc.)
|
|
1063
|
-
*/ function createModuleHot(moduleId, hotData) {
|
|
1064
|
-
const hotState = {
|
|
1065
|
-
selfAccepted: false,
|
|
1066
|
-
selfDeclined: false,
|
|
1067
|
-
selfInvalidated: false,
|
|
1068
|
-
disposeHandlers: [],
|
|
1069
|
-
acceptedDependencies: {},
|
|
1070
|
-
acceptedErrorHandlers: {},
|
|
1071
|
-
declinedDependencies: {}
|
|
1072
|
-
};
|
|
1073
|
-
const hot = {
|
|
1074
|
-
// TODO(alexkirsz) This is not defined in the HMR API. It was used to
|
|
1075
|
-
// decide whether to warn whenever an HMR-disposed module required other
|
|
1076
|
-
// modules. We might want to remove it.
|
|
1077
|
-
active: true,
|
|
1078
|
-
data: hotData ?? {},
|
|
1079
|
-
accept: (modules, callback, errorHandler)=>{
|
|
1080
|
-
if (modules === undefined) {
|
|
1081
|
-
hotState.selfAccepted = true;
|
|
1082
|
-
} else if (typeof modules === 'function') {
|
|
1083
|
-
hotState.selfAccepted = modules;
|
|
1084
|
-
} else if (typeof modules === 'object' && modules !== null) {
|
|
1085
|
-
for(let i = 0; i < modules.length; i++){
|
|
1086
|
-
hotState.acceptedDependencies[modules[i]] = callback || function() {};
|
|
1087
|
-
hotState.acceptedErrorHandlers[modules[i]] = errorHandler;
|
|
1088
|
-
}
|
|
1089
|
-
} else {
|
|
1090
|
-
hotState.acceptedDependencies[modules] = callback || function() {};
|
|
1091
|
-
hotState.acceptedErrorHandlers[modules] = errorHandler;
|
|
1092
|
-
}
|
|
1093
|
-
},
|
|
1094
|
-
decline: (dep)=>{
|
|
1095
|
-
if (dep === undefined) {
|
|
1096
|
-
hotState.selfDeclined = true;
|
|
1097
|
-
} else if (typeof dep === 'object' && dep !== null) {
|
|
1098
|
-
for(let i = 0; i < dep.length; i++){
|
|
1099
|
-
hotState.declinedDependencies[dep[i]] = true;
|
|
1100
|
-
}
|
|
1101
|
-
} else {
|
|
1102
|
-
hotState.declinedDependencies[dep] = true;
|
|
1103
|
-
}
|
|
1104
|
-
},
|
|
1105
|
-
dispose: (callback)=>{
|
|
1106
|
-
hotState.disposeHandlers.push(callback);
|
|
1107
|
-
},
|
|
1108
|
-
addDisposeHandler: (callback)=>{
|
|
1109
|
-
hotState.disposeHandlers.push(callback);
|
|
1110
|
-
},
|
|
1111
|
-
removeDisposeHandler: (callback)=>{
|
|
1112
|
-
const idx = hotState.disposeHandlers.indexOf(callback);
|
|
1113
|
-
if (idx >= 0) {
|
|
1114
|
-
hotState.disposeHandlers.splice(idx, 1);
|
|
1115
|
-
}
|
|
1116
|
-
},
|
|
1117
|
-
invalidate: ()=>{
|
|
1118
|
-
hotState.selfInvalidated = true;
|
|
1119
|
-
queuedInvalidatedModules.add(moduleId);
|
|
1120
|
-
},
|
|
1121
|
-
// NOTE(alexkirsz) This is part of the management API, which we don't
|
|
1122
|
-
// implement, but the Next.js React Refresh runtime uses this to decide
|
|
1123
|
-
// whether to schedule an update.
|
|
1124
|
-
status: ()=>'idle',
|
|
1125
|
-
// NOTE(alexkirsz) Since we always return "idle" for now, these are no-ops.
|
|
1126
|
-
addStatusHandler: (_handler)=>{},
|
|
1127
|
-
removeStatusHandler: (_handler)=>{},
|
|
1128
|
-
// NOTE(jridgewell) Check returns the list of updated modules, but we don't
|
|
1129
|
-
// want the webpack code paths to ever update (the turbopack paths handle
|
|
1130
|
-
// this already).
|
|
1131
|
-
check: ()=>Promise.resolve(null)
|
|
1132
|
-
};
|
|
1133
|
-
return {
|
|
1134
|
-
hot,
|
|
1135
|
-
hotState
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Processes queued invalidated modules and adds them to the outdated modules set.
|
|
1140
|
-
* Modules that call module.hot.invalidate() are queued and processed here.
|
|
1141
|
-
*
|
|
1142
|
-
* @param outdatedModules - The current set of outdated modules
|
|
1143
|
-
* @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()
|
|
1144
|
-
*/ function applyInvalidatedModules(outdatedModules, outdatedDependencies, autoAcceptRootModules) {
|
|
1145
|
-
if (queuedInvalidatedModules.size > 0) {
|
|
1146
|
-
const result = computedInvalidatedModules(queuedInvalidatedModules, autoAcceptRootModules);
|
|
1147
|
-
for (const moduleId of result.outdatedModules){
|
|
1148
|
-
outdatedModules.add(moduleId);
|
|
1149
|
-
}
|
|
1150
|
-
mergeDependencies(outdatedDependencies, result.outdatedDependencies);
|
|
1151
|
-
queuedInvalidatedModules.clear();
|
|
1152
|
-
}
|
|
1153
|
-
return {
|
|
1154
|
-
outdatedModules,
|
|
1155
|
-
outdatedDependencies
|
|
1156
|
-
};
|
|
1157
|
-
}
|
|
1158
|
-
/**
|
|
1159
|
-
* Computes which outdated modules have self-accepted and can be hot reloaded.
|
|
1160
|
-
*/ function computeOutdatedSelfAcceptedModules(outdatedModules) {
|
|
1161
|
-
const outdatedSelfAcceptedModules = [];
|
|
1162
|
-
for (const moduleId of outdatedModules){
|
|
1163
|
-
const module = devModuleCache[moduleId];
|
|
1164
|
-
const hotState = moduleHotState.get(module);
|
|
1165
|
-
if (module && hotState?.selfAccepted && !hotState.selfInvalidated) {
|
|
1166
|
-
outdatedSelfAcceptedModules.push({
|
|
1167
|
-
moduleId,
|
|
1168
|
-
errorHandler: hotState.selfAccepted
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
return outdatedSelfAcceptedModules;
|
|
1173
|
-
}
|
|
1174
|
-
/**
|
|
1175
|
-
* Disposes of an instance of a module.
|
|
1176
|
-
* Runs hot.dispose handlers and manages persistent hot data.
|
|
1177
|
-
*
|
|
1178
|
-
* NOTE: mode = "replace" will not remove modules from devModuleCache.
|
|
1179
|
-
* This must be done in a separate step afterwards.
|
|
1180
|
-
*/ function disposeModule(moduleId, mode) {
|
|
1181
|
-
const module = devModuleCache[moduleId];
|
|
1182
|
-
if (!module) {
|
|
1183
|
-
return;
|
|
1184
|
-
}
|
|
1185
|
-
const hotState = moduleHotState.get(module);
|
|
1186
|
-
if (!hotState) {
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
const data = {};
|
|
1190
|
-
// Run the `hot.dispose` handler, if any, passing in the persistent
|
|
1191
|
-
// `hot.data` object.
|
|
1192
|
-
for (const disposeHandler of hotState.disposeHandlers){
|
|
1193
|
-
disposeHandler(data);
|
|
1194
|
-
}
|
|
1195
|
-
// This used to warn in `getOrInstantiateModuleFromParent` when a disposed
|
|
1196
|
-
// module is still importing other modules.
|
|
1197
|
-
if (module.hot) {
|
|
1198
|
-
module.hot.active = false;
|
|
1199
|
-
}
|
|
1200
|
-
moduleHotState.delete(module);
|
|
1201
|
-
// Remove the disposed module from its children's parent list.
|
|
1202
|
-
// It will be added back once the module re-instantiates and imports its
|
|
1203
|
-
// children again.
|
|
1204
|
-
for (const childId of module.children){
|
|
1205
|
-
const child = devModuleCache[childId];
|
|
1206
|
-
if (!child) {
|
|
1207
|
-
continue;
|
|
1208
|
-
}
|
|
1209
|
-
const idx = child.parents.indexOf(module.id);
|
|
1210
|
-
if (idx >= 0) {
|
|
1211
|
-
child.parents.splice(idx, 1);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
switch(mode){
|
|
1215
|
-
case 'clear':
|
|
1216
|
-
delete devModuleCache[module.id];
|
|
1217
|
-
moduleHotData.delete(module.id);
|
|
1218
|
-
break;
|
|
1219
|
-
case 'replace':
|
|
1220
|
-
moduleHotData.set(module.id, data);
|
|
1221
|
-
break;
|
|
1222
|
-
default:
|
|
1223
|
-
invariant(mode, (mode)=>`invalid mode: ${mode}`);
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
/**
|
|
1227
|
-
* Dispose phase: runs dispose handlers and cleans up outdated/disposed modules.
|
|
1228
|
-
* Returns the parent modules of outdated modules for use in the apply phase.
|
|
1229
|
-
*/ function disposePhase(outdatedModules, disposedModules, outdatedDependencies) {
|
|
1230
|
-
for (const moduleId of outdatedModules){
|
|
1231
|
-
disposeModule(moduleId, 'replace');
|
|
1232
|
-
}
|
|
1233
|
-
for (const moduleId of disposedModules){
|
|
1234
|
-
disposeModule(moduleId, 'clear');
|
|
1235
|
-
}
|
|
1236
|
-
// Removing modules from the module cache is a separate step.
|
|
1237
|
-
// We also want to keep track of previous parents of the outdated modules.
|
|
1238
|
-
const outdatedModuleParents = new Map();
|
|
1239
|
-
for (const moduleId of outdatedModules){
|
|
1240
|
-
const oldModule = devModuleCache[moduleId];
|
|
1241
|
-
outdatedModuleParents.set(moduleId, oldModule?.parents);
|
|
1242
|
-
delete devModuleCache[moduleId];
|
|
1243
|
-
}
|
|
1244
|
-
// Remove outdated dependencies from parent module's children list.
|
|
1245
|
-
// When a parent accepts a child's update, the child is re-instantiated
|
|
1246
|
-
// but the parent stays alive. We remove the old child reference so it
|
|
1247
|
-
// gets re-added when the child re-imports.
|
|
1248
|
-
for (const [parentId, deps] of outdatedDependencies){
|
|
1249
|
-
const module = devModuleCache[parentId];
|
|
1250
|
-
if (module) {
|
|
1251
|
-
for (const dep of deps){
|
|
1252
|
-
const idx = module.children.indexOf(dep);
|
|
1253
|
-
if (idx >= 0) {
|
|
1254
|
-
module.children.splice(idx, 1);
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
return {
|
|
1260
|
-
outdatedModuleParents
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */ /**
|
|
1264
|
-
* Shared module instantiation logic.
|
|
1265
|
-
* This handles the full module instantiation flow for both browser and Node.js.
|
|
1266
|
-
* Only React Refresh hooks differ between platforms (passed as callback).
|
|
1267
|
-
*/ function instantiateModuleShared(moduleId, sourceType, sourceData, moduleFactories, devModuleCache, runtimeModules, createModuleObjectFn, createContextFn, runModuleExecutionHooksFn) {
|
|
1268
|
-
// 1. Factory validation (same in both browser and Node.js)
|
|
1269
|
-
const id = moduleId;
|
|
1270
|
-
const moduleFactory = moduleFactories.get(id);
|
|
1271
|
-
if (typeof moduleFactory !== 'function') {
|
|
1272
|
-
throw new Error(factoryNotAvailableMessage(moduleId, sourceType, sourceData) + `\nThis is often caused by a stale browser cache, misconfigured Cache-Control headers, or a service worker serving outdated responses.` + `\nTo fix this, make sure your Cache-Control headers allow revalidation of chunks and review your service worker configuration. ` + `As an immediate workaround, try hard-reloading the page, clearing the browser cache, or unregistering any service workers.`);
|
|
1273
|
-
}
|
|
1274
|
-
// 2. Hot API setup (same in both - works for browser, included for Node.js)
|
|
1275
|
-
const hotData = moduleHotData.get(id);
|
|
1276
|
-
const { hot, hotState } = createModuleHot(id, hotData);
|
|
1277
|
-
// 3. Parent assignment logic (same in both)
|
|
1278
|
-
let parents;
|
|
1279
|
-
switch(sourceType){
|
|
1280
|
-
case SourceType.Runtime:
|
|
1281
|
-
runtimeModules.add(id);
|
|
1282
|
-
parents = [];
|
|
1283
|
-
break;
|
|
1284
|
-
case SourceType.Parent:
|
|
1285
|
-
parents = [
|
|
1286
|
-
sourceData
|
|
1287
|
-
];
|
|
1288
|
-
break;
|
|
1289
|
-
case SourceType.Update:
|
|
1290
|
-
parents = sourceData || [];
|
|
1291
|
-
break;
|
|
1292
|
-
default:
|
|
1293
|
-
throw new Error(`Unknown source type: ${sourceType}`);
|
|
1294
|
-
}
|
|
1295
|
-
// 4. Module creation (platform creates base module object)
|
|
1296
|
-
const module = createModuleObjectFn(id);
|
|
1297
|
-
const exports = module.exports;
|
|
1298
|
-
module.parents = parents;
|
|
1299
|
-
module.children = [];
|
|
1300
|
-
module.hot = hot;
|
|
1301
|
-
devModuleCache[id] = module;
|
|
1302
|
-
moduleHotState.set(module, hotState);
|
|
1303
|
-
// 5. Module execution (React Refresh hooks are platform-specific)
|
|
1304
|
-
try {
|
|
1305
|
-
runModuleExecutionHooksFn(module, (refresh)=>{
|
|
1306
|
-
const context = createContextFn(module, exports, refresh);
|
|
1307
|
-
moduleFactory.call(exports, context, module, exports);
|
|
1308
|
-
});
|
|
1309
|
-
} catch (error) {
|
|
1310
|
-
module.error = error;
|
|
1311
|
-
throw error;
|
|
1312
|
-
}
|
|
1313
|
-
// 6. ESM interop (same in both)
|
|
1314
|
-
if (module.namespaceObject && module.exports !== module.namespaceObject) {
|
|
1315
|
-
// in case of a circular dependency: cjs1 -> esm2 -> cjs1
|
|
1316
|
-
interopEsm(module.exports, module.namespaceObject);
|
|
1317
|
-
}
|
|
1318
|
-
return module;
|
|
1319
|
-
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Analyzes update entries and chunks to determine which modules were added, modified, or deleted.
|
|
1322
|
-
* This is pure logic that doesn't depend on the runtime environment.
|
|
1323
|
-
*/ function computeChangedModules(entries, updates, chunkModulesMap) {
|
|
1324
|
-
const chunksAdded = new Map();
|
|
1325
|
-
const chunksDeleted = new Map();
|
|
1326
|
-
const added = new Map();
|
|
1327
|
-
const modified = new Map();
|
|
1328
|
-
const deleted = new Set();
|
|
1329
|
-
for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates)){
|
|
1330
|
-
switch(mergedChunkUpdate.type){
|
|
1331
|
-
case 'added':
|
|
1332
|
-
{
|
|
1333
|
-
const updateAdded = new Set(mergedChunkUpdate.modules);
|
|
1334
|
-
for (const moduleId of updateAdded){
|
|
1335
|
-
added.set(moduleId, entries[moduleId]);
|
|
1336
|
-
}
|
|
1337
|
-
chunksAdded.set(chunkPath, updateAdded);
|
|
1338
|
-
break;
|
|
1339
|
-
}
|
|
1340
|
-
case 'deleted':
|
|
1341
|
-
{
|
|
1342
|
-
const updateDeleted = chunkModulesMap ? new Set(chunkModulesMap.get(chunkPath)) : new Set();
|
|
1343
|
-
for (const moduleId of updateDeleted){
|
|
1344
|
-
deleted.add(moduleId);
|
|
1345
|
-
}
|
|
1346
|
-
chunksDeleted.set(chunkPath, updateDeleted);
|
|
1347
|
-
break;
|
|
1348
|
-
}
|
|
1349
|
-
case 'partial':
|
|
1350
|
-
{
|
|
1351
|
-
const updateAdded = new Set(mergedChunkUpdate.added);
|
|
1352
|
-
const updateDeleted = new Set(mergedChunkUpdate.deleted);
|
|
1353
|
-
for (const moduleId of updateAdded){
|
|
1354
|
-
added.set(moduleId, entries[moduleId]);
|
|
1355
|
-
}
|
|
1356
|
-
for (const moduleId of updateDeleted){
|
|
1357
|
-
deleted.add(moduleId);
|
|
1358
|
-
}
|
|
1359
|
-
chunksAdded.set(chunkPath, updateAdded);
|
|
1360
|
-
chunksDeleted.set(chunkPath, updateDeleted);
|
|
1361
|
-
break;
|
|
1362
|
-
}
|
|
1363
|
-
default:
|
|
1364
|
-
throw new Error('Unknown merged chunk update type');
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
// If a module was added from one chunk and deleted from another in the same update,
|
|
1368
|
-
// consider it to be modified, as it means the module was moved from one chunk to another
|
|
1369
|
-
// AND has new code in a single update.
|
|
1370
|
-
for (const moduleId of added.keys()){
|
|
1371
|
-
if (deleted.has(moduleId)) {
|
|
1372
|
-
added.delete(moduleId);
|
|
1373
|
-
deleted.delete(moduleId);
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
for (const [moduleId, entry] of Object.entries(entries)){
|
|
1377
|
-
// Modules that haven't been added to any chunk but have new code are considered
|
|
1378
|
-
// to be modified.
|
|
1379
|
-
// This needs to be under the previous loop, as we need it to get rid of modules
|
|
1380
|
-
// that were added and deleted in the same update.
|
|
1381
|
-
if (!added.has(moduleId)) {
|
|
1382
|
-
modified.set(moduleId, entry);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
return {
|
|
1386
|
-
added,
|
|
1387
|
-
deleted,
|
|
1388
|
-
modified,
|
|
1389
|
-
chunksAdded,
|
|
1390
|
-
chunksDeleted
|
|
1391
|
-
};
|
|
1392
|
-
}
|
|
1393
|
-
/**
|
|
1394
|
-
* Compiles new module code and walks the dependency tree to find all outdated modules.
|
|
1395
|
-
* Uses the evalModuleEntry function to compile code (platform-specific).
|
|
1396
|
-
*
|
|
1397
|
-
* @param added - Map of added modules
|
|
1398
|
-
* @param modified - Map of modified modules
|
|
1399
|
-
* @param evalModuleEntry - Function to compile module code
|
|
1400
|
-
* @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()
|
|
1401
|
-
*/ function computeOutdatedModules(added, modified, evalModuleEntry, autoAcceptRootModules) {
|
|
1402
|
-
const newModuleFactories = new Map();
|
|
1403
|
-
// Compile added modules
|
|
1404
|
-
for (const [moduleId, entry] of added){
|
|
1405
|
-
if (entry != null) {
|
|
1406
|
-
newModuleFactories.set(moduleId, evalModuleEntry(entry));
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
// Walk dependency tree to find all modules affected by modifications
|
|
1410
|
-
const { outdatedModules, outdatedDependencies } = computedInvalidatedModules(modified.keys(), autoAcceptRootModules);
|
|
1411
|
-
// Compile modified modules
|
|
1412
|
-
for (const [moduleId, entry] of modified){
|
|
1413
|
-
newModuleFactories.set(moduleId, evalModuleEntry(entry));
|
|
1414
|
-
}
|
|
1415
|
-
return {
|
|
1416
|
-
outdatedModules,
|
|
1417
|
-
outdatedDependencies,
|
|
1418
|
-
newModuleFactories
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
/**
|
|
1422
|
-
* Updates module factories and re-instantiates self-accepted modules.
|
|
1423
|
-
* Uses the instantiateModule function (platform-specific via callback).
|
|
1424
|
-
*/ function applyPhase(outdatedSelfAcceptedModules, newModuleFactories, outdatedModuleParents, outdatedDependencies, moduleFactories, devModuleCache, instantiateModuleFn, applyModuleFactoryNameFn, reportError) {
|
|
1425
|
-
// Update module factories
|
|
1426
|
-
for (const [moduleId, factory] of newModuleFactories.entries()){
|
|
1427
|
-
applyModuleFactoryNameFn(factory);
|
|
1428
|
-
moduleFactories.set(moduleId, factory);
|
|
1429
|
-
}
|
|
1430
|
-
// TODO(alexkirsz) Run new runtime entries here.
|
|
1431
|
-
// Call accept handlers for outdated dependencies.
|
|
1432
|
-
// This runs BEFORE re-instantiating self-accepted modules, matching
|
|
1433
|
-
// webpack's behavior.
|
|
1434
|
-
for (const [parentId, deps] of outdatedDependencies){
|
|
1435
|
-
const module = devModuleCache[parentId];
|
|
1436
|
-
if (!module) continue;
|
|
1437
|
-
const hotState = moduleHotState.get(module);
|
|
1438
|
-
if (!hotState) continue;
|
|
1439
|
-
// Group deps by callback, deduplicating callbacks that handle multiple deps.
|
|
1440
|
-
// Each callback receives only the deps it was registered for.
|
|
1441
|
-
const callbackDeps = new Map();
|
|
1442
|
-
const callbackErrorHandlers = new Map();
|
|
1443
|
-
for (const dep of deps){
|
|
1444
|
-
const acceptCallback = hotState.acceptedDependencies[dep];
|
|
1445
|
-
if (acceptCallback) {
|
|
1446
|
-
let depList = callbackDeps.get(acceptCallback);
|
|
1447
|
-
if (!depList) {
|
|
1448
|
-
depList = [];
|
|
1449
|
-
callbackDeps.set(acceptCallback, depList);
|
|
1450
|
-
callbackErrorHandlers.set(acceptCallback, hotState.acceptedErrorHandlers[dep]);
|
|
1451
|
-
}
|
|
1452
|
-
depList.push(dep);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
for (const [callback, cbDeps] of callbackDeps){
|
|
1456
|
-
try {
|
|
1457
|
-
callback.call(null, cbDeps);
|
|
1458
|
-
} catch (err) {
|
|
1459
|
-
const errorHandler = callbackErrorHandlers.get(callback);
|
|
1460
|
-
if (typeof errorHandler === 'function') {
|
|
1461
|
-
try {
|
|
1462
|
-
errorHandler(err, {
|
|
1463
|
-
moduleId: parentId,
|
|
1464
|
-
dependencyId: cbDeps[0]
|
|
1465
|
-
});
|
|
1466
|
-
} catch (err2) {
|
|
1467
|
-
reportError(err2);
|
|
1468
|
-
reportError(err);
|
|
1469
|
-
}
|
|
1470
|
-
} else {
|
|
1471
|
-
reportError(err);
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
// Re-instantiate all outdated self-accepted modules
|
|
1477
|
-
for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules){
|
|
1478
|
-
try {
|
|
1479
|
-
instantiateModuleFn(moduleId, SourceType.Update, outdatedModuleParents.get(moduleId));
|
|
1480
|
-
} catch (err) {
|
|
1481
|
-
if (typeof errorHandler === 'function') {
|
|
1482
|
-
try {
|
|
1483
|
-
errorHandler(err, {
|
|
1484
|
-
moduleId,
|
|
1485
|
-
module: devModuleCache[moduleId]
|
|
1486
|
-
});
|
|
1487
|
-
} catch (err2) {
|
|
1488
|
-
reportError(err2);
|
|
1489
|
-
reportError(err);
|
|
1490
|
-
}
|
|
1491
|
-
} else {
|
|
1492
|
-
reportError(err);
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
/**
|
|
1498
|
-
* Internal implementation that orchestrates the full HMR update flow:
|
|
1499
|
-
* invalidation, disposal, and application of new modules.
|
|
1500
|
-
*
|
|
1501
|
-
* @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()
|
|
1502
|
-
*/ function applyInternal(outdatedModules, outdatedDependencies, disposedModules, newModuleFactories, moduleFactories, devModuleCache, instantiateModuleFn, applyModuleFactoryNameFn, autoAcceptRootModules) {
|
|
1503
|
-
;
|
|
1504
|
-
({ outdatedModules, outdatedDependencies } = applyInvalidatedModules(outdatedModules, outdatedDependencies, autoAcceptRootModules));
|
|
1505
|
-
// Find self-accepted modules to re-instantiate
|
|
1506
|
-
const outdatedSelfAcceptedModules = computeOutdatedSelfAcceptedModules(outdatedModules);
|
|
1507
|
-
// Run dispose handlers, save hot.data, clear caches
|
|
1508
|
-
const { outdatedModuleParents } = disposePhase(outdatedModules, disposedModules, outdatedDependencies);
|
|
1509
|
-
let error;
|
|
1510
|
-
function reportError(err) {
|
|
1511
|
-
if (!error) error = err; // Keep first error
|
|
1512
|
-
}
|
|
1513
|
-
applyPhase(outdatedSelfAcceptedModules, newModuleFactories, outdatedModuleParents, outdatedDependencies, moduleFactories, devModuleCache, instantiateModuleFn, applyModuleFactoryNameFn, reportError);
|
|
1514
|
-
if (error) {
|
|
1515
|
-
throw error;
|
|
1516
|
-
}
|
|
1517
|
-
// Recursively apply any queued invalidations from new module execution
|
|
1518
|
-
if (queuedInvalidatedModules.size > 0) {
|
|
1519
|
-
applyInternal(new Set(), new Map(), [], new Map(), moduleFactories, devModuleCache, instantiateModuleFn, applyModuleFactoryNameFn, autoAcceptRootModules);
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
/**
|
|
1523
|
-
* Main entry point for applying an ECMAScript merged update.
|
|
1524
|
-
* This is called by both browser and Node.js runtimes with platform-specific callbacks.
|
|
1525
|
-
*
|
|
1526
|
-
* @param options.autoAcceptRootModules - If true, root modules auto-accept updates without explicit
|
|
1527
|
-
* module.hot.accept(). Used for server-side HMR where pages
|
|
1528
|
-
* auto-accept at the top level.
|
|
1529
|
-
*/ function applyEcmascriptMergedUpdateShared(options) {
|
|
1530
|
-
const { added, modified, disposedModules, evalModuleEntry, instantiateModule, applyModuleFactoryName, moduleFactories, devModuleCache, autoAcceptRootModules } = options;
|
|
1531
|
-
const { outdatedModules, outdatedDependencies, newModuleFactories } = computeOutdatedModules(added, modified, evalModuleEntry, autoAcceptRootModules);
|
|
1532
|
-
applyInternal(outdatedModules, outdatedDependencies, disposedModules, newModuleFactories, moduleFactories, devModuleCache, instantiateModule, applyModuleFactoryName, autoAcceptRootModules);
|
|
1533
|
-
}
|
|
1534
|
-
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
|
|
1535
|
-
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
|
|
1536
|
-
const devContextPrototype = Context.prototype;
|
|
1537
|
-
/**
|
|
1538
|
-
* This file contains runtime types and functions that are shared between all
|
|
1539
|
-
* Turbopack *development* ECMAScript runtimes.
|
|
1540
|
-
*
|
|
1541
|
-
* It will be appended to the runtime code of each runtime right after the
|
|
1542
|
-
* shared runtime utils.
|
|
1543
|
-
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ // Assign browser's module cache and runtime modules to shared HMR state
|
|
1544
|
-
devModuleCache = Object.create(null);
|
|
1545
|
-
devContextPrototype.c = devModuleCache;
|
|
1546
|
-
runtimeModules = new Set();
|
|
1547
|
-
// Set flag to indicate we use ModuleWithDirection
|
|
1548
|
-
createModuleWithDirectionFlag = true;
|
|
1549
|
-
/**
|
|
1550
|
-
* Map from module ID to the chunks that contain this module.
|
|
1551
|
-
*
|
|
1552
|
-
* In HMR, we need to keep track of which modules are contained in which so
|
|
1553
|
-
* chunks. This is so we don't eagerly dispose of a module when it is removed
|
|
1554
|
-
* from chunk A, but still exists in chunk B.
|
|
1555
|
-
*/ const moduleChunksMap = new Map();
|
|
1556
|
-
/**
|
|
1557
|
-
* Map from a chunk path to all modules it contains.
|
|
1558
|
-
*/ const chunkModulesMap = new Map();
|
|
1559
|
-
/**
|
|
1560
|
-
* Chunk lists that contain a runtime. When these chunk lists receive an update
|
|
1561
|
-
* that can't be reconciled with the current state of the page, we need to
|
|
1562
|
-
* reload the runtime entirely.
|
|
1563
|
-
*/ const runtimeChunkLists = new Set();
|
|
1564
|
-
/**
|
|
1565
|
-
* Map from a chunk list to the chunk paths it contains.
|
|
1566
|
-
*/ const chunkListChunksMap = new Map();
|
|
1567
|
-
/**
|
|
1568
|
-
* Map from a chunk path to the chunk lists it belongs to.
|
|
1569
|
-
*/ const chunkChunkListsMap = new Map();
|
|
1570
|
-
/**
|
|
1571
|
-
* Gets or instantiates a runtime module.
|
|
1572
|
-
*/ // @ts-ignore
|
|
1573
|
-
function getOrInstantiateRuntimeModule(chunkPath, moduleId) {
|
|
1574
|
-
const module = devModuleCache[moduleId];
|
|
1575
|
-
if (module) {
|
|
1576
|
-
if (module.error) {
|
|
1577
|
-
throw module.error;
|
|
1578
|
-
}
|
|
1579
|
-
return module;
|
|
1580
|
-
}
|
|
1581
|
-
// @ts-ignore
|
|
1582
|
-
return instantiateModule(moduleId, SourceType.Runtime, chunkPath);
|
|
1583
|
-
}
|
|
1584
|
-
/**
|
|
1585
|
-
* Retrieves a module from the cache, or instantiate it if it is not cached.
|
|
1586
|
-
*/ // @ts-ignore Defined in `runtime-utils.ts`
|
|
1587
|
-
const getOrInstantiateModuleFromParent = (id, sourceModule)=>{
|
|
1588
|
-
if (!sourceModule.hot.active) {
|
|
1589
|
-
console.warn(`Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`);
|
|
1590
|
-
}
|
|
1591
|
-
const module = devModuleCache[id];
|
|
1592
|
-
if (sourceModule.children.indexOf(id) === -1) {
|
|
1593
|
-
sourceModule.children.push(id);
|
|
1594
|
-
}
|
|
1595
|
-
if (module) {
|
|
1596
|
-
if (module.error) {
|
|
1597
|
-
throw module.error;
|
|
1598
|
-
}
|
|
1599
|
-
if (module.parents.indexOf(sourceModule.id) === -1) {
|
|
1600
|
-
module.parents.push(sourceModule.id);
|
|
1601
|
-
}
|
|
1602
|
-
return module;
|
|
1603
|
-
}
|
|
1604
|
-
return instantiateModule(id, SourceType.Parent, sourceModule.id);
|
|
1605
|
-
};
|
|
1606
|
-
function DevContext(module, exports, refresh) {
|
|
1607
|
-
Context.call(this, module, exports);
|
|
1608
|
-
this.k = refresh;
|
|
1609
|
-
}
|
|
1610
|
-
DevContext.prototype = Context.prototype;
|
|
1611
|
-
function instantiateModule(moduleId, sourceType, sourceData) {
|
|
1612
|
-
// Browser: creates base HotModule object (hot API added by shared code)
|
|
1613
|
-
const createModuleObjectFn = (id)=>{
|
|
1614
|
-
return createModuleObject(id);
|
|
1615
|
-
};
|
|
1616
|
-
// Browser: creates DevContext with refresh
|
|
1617
|
-
const createContext = (module, exports, refresh)=>{
|
|
1618
|
-
return new DevContext(module, exports, refresh);
|
|
1619
|
-
};
|
|
1620
|
-
// Use shared instantiation logic (includes hot API setup)
|
|
1621
|
-
return instantiateModuleShared(moduleId, sourceType, sourceData, moduleFactories, devModuleCache, runtimeModules, createModuleObjectFn, createContext, runModuleExecutionHooks);
|
|
1622
|
-
}
|
|
1623
|
-
const DUMMY_REFRESH_CONTEXT = {
|
|
1624
|
-
register: (_type, _id)=>{},
|
|
1625
|
-
signature: ()=>(_type)=>{},
|
|
1626
|
-
registerExports: (_module, _helpers)=>{}
|
|
1627
|
-
};
|
|
1628
|
-
/**
|
|
1629
|
-
* NOTE(alexkirsz) Webpack has a "module execution" interception hook that
|
|
1630
|
-
* Next.js' React Refresh runtime hooks into to add module context to the
|
|
1631
|
-
* refresh registry.
|
|
1632
|
-
*/ function runModuleExecutionHooks(module, executeModule) {
|
|
1633
|
-
if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {
|
|
1634
|
-
const cleanupReactRefreshIntercept = globalThis.$RefreshInterceptModuleExecution$(module.id);
|
|
1635
|
-
try {
|
|
1636
|
-
executeModule({
|
|
1637
|
-
register: globalThis.$RefreshReg$,
|
|
1638
|
-
signature: globalThis.$RefreshSig$,
|
|
1639
|
-
registerExports: registerExportsAndSetupBoundaryForReactRefresh
|
|
1640
|
-
});
|
|
1641
|
-
} finally{
|
|
1642
|
-
// Always cleanup the intercept, even if module execution failed.
|
|
1643
|
-
cleanupReactRefreshIntercept();
|
|
1644
|
-
}
|
|
1645
|
-
} else {
|
|
1646
|
-
// If the react refresh hooks are not installed we need to bind dummy functions.
|
|
1647
|
-
// This is expected when running in a Web Worker. It is also common in some of
|
|
1648
|
-
// our test environments.
|
|
1649
|
-
executeModule(DUMMY_REFRESH_CONTEXT);
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts
|
|
1654
|
-
*/ function registerExportsAndSetupBoundaryForReactRefresh(module, helpers) {
|
|
1655
|
-
const currentExports = module.exports;
|
|
1656
|
-
const prevExports = module.hot.data.prevExports ?? null;
|
|
1657
|
-
helpers.registerExportsForReactRefresh(currentExports, module.id);
|
|
1658
|
-
// A module can be accepted automatically based on its exports, e.g. when
|
|
1659
|
-
// it is a Refresh Boundary.
|
|
1660
|
-
if (helpers.isReactRefreshBoundary(currentExports)) {
|
|
1661
|
-
// Save the previous exports on update, so we can compare the boundary
|
|
1662
|
-
// signatures.
|
|
1663
|
-
module.hot.dispose((data)=>{
|
|
1664
|
-
data.prevExports = currentExports;
|
|
1665
|
-
});
|
|
1666
|
-
// Unconditionally accept an update to this module, we'll check if it's
|
|
1667
|
-
// still a Refresh Boundary later.
|
|
1668
|
-
module.hot.accept();
|
|
1669
|
-
// This field is set when the previous version of this module was a
|
|
1670
|
-
// Refresh Boundary, letting us know we need to check for invalidation or
|
|
1671
|
-
// enqueue an update.
|
|
1672
|
-
if (prevExports !== null) {
|
|
1673
|
-
// A boundary can become ineligible if its exports are incompatible
|
|
1674
|
-
// with the previous exports.
|
|
1675
|
-
//
|
|
1676
|
-
// For example, if you add/remove/change exports, we'll want to
|
|
1677
|
-
// re-execute the importing modules, and force those components to
|
|
1678
|
-
// re-render. Similarly, if you convert a class component to a
|
|
1679
|
-
// function, we want to invalidate the boundary.
|
|
1680
|
-
if (helpers.shouldInvalidateReactRefreshBoundary(helpers.getRefreshBoundarySignature(prevExports), helpers.getRefreshBoundarySignature(currentExports))) {
|
|
1681
|
-
module.hot.invalidate();
|
|
1682
|
-
} else {
|
|
1683
|
-
helpers.scheduleUpdate();
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
} else {
|
|
1687
|
-
// Since we just executed the code for the module, it's possible that the
|
|
1688
|
-
// new exports made it ineligible for being a boundary.
|
|
1689
|
-
// We only care about the case when we were _previously_ a boundary,
|
|
1690
|
-
// because we already accepted this update (accidental side effect).
|
|
1691
|
-
const isNoLongerABoundary = prevExports !== null;
|
|
1692
|
-
if (isNoLongerABoundary) {
|
|
1693
|
-
module.hot.invalidate();
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
/**
|
|
1698
|
-
* Adds, deletes, and moves modules between chunks. This must happen before the
|
|
1699
|
-
* dispose phase as it needs to know which modules were removed from all chunks,
|
|
1700
|
-
* which we can only compute *after* taking care of added and moved modules.
|
|
1701
|
-
*/ function updateChunksPhase(chunksAddedModules, chunksDeletedModules) {
|
|
1702
|
-
for (const [chunkPath, addedModuleIds] of chunksAddedModules){
|
|
1703
|
-
for (const moduleId of addedModuleIds){
|
|
1704
|
-
addModuleToChunk(moduleId, chunkPath);
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
const disposedModules = new Set();
|
|
1708
|
-
for (const [chunkPath, addedModuleIds] of chunksDeletedModules){
|
|
1709
|
-
for (const moduleId of addedModuleIds){
|
|
1710
|
-
if (removeModuleFromChunk(moduleId, chunkPath)) {
|
|
1711
|
-
disposedModules.add(moduleId);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
return {
|
|
1716
|
-
disposedModules
|
|
1717
|
-
};
|
|
1718
|
-
}
|
|
1719
|
-
function applyUpdate(update) {
|
|
1720
|
-
switch(update.type){
|
|
1721
|
-
case 'ChunkListUpdate':
|
|
1722
|
-
applyChunkListUpdate(update);
|
|
1723
|
-
break;
|
|
1724
|
-
default:
|
|
1725
|
-
invariant(update, (update)=>`Unknown update type: ${update.type}`);
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
function applyChunkListUpdate(update) {
|
|
1729
|
-
if (update.merged != null) {
|
|
1730
|
-
for (const merged of update.merged){
|
|
1731
|
-
switch(merged.type){
|
|
1732
|
-
case 'EcmascriptMergedUpdate':
|
|
1733
|
-
applyEcmascriptMergedUpdate(merged);
|
|
1734
|
-
break;
|
|
1735
|
-
default:
|
|
1736
|
-
invariant(merged, (merged)=>`Unknown merged type: ${merged.type}`);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
if (update.chunks != null) {
|
|
1741
|
-
for (const [chunkPath, chunkUpdate] of Object.entries(update.chunks)){
|
|
1742
|
-
const chunkUrl = getChunkRelativeUrl(chunkPath);
|
|
1743
|
-
switch(chunkUpdate.type){
|
|
1744
|
-
case 'added':
|
|
1745
|
-
BACKEND.loadChunkCached(SourceType.Update, chunkUrl);
|
|
1746
|
-
break;
|
|
1747
|
-
case 'total':
|
|
1748
|
-
DEV_BACKEND.reloadChunk?.(chunkUrl);
|
|
1749
|
-
break;
|
|
1750
|
-
case 'deleted':
|
|
1751
|
-
DEV_BACKEND.unloadChunk?.(chunkUrl);
|
|
1752
|
-
break;
|
|
1753
|
-
case 'partial':
|
|
1754
|
-
invariant(chunkUpdate.instruction, (instruction)=>`Unknown partial instruction: ${JSON.stringify(instruction)}.`);
|
|
1755
|
-
break;
|
|
1756
|
-
default:
|
|
1757
|
-
invariant(chunkUpdate, (chunkUpdate)=>`Unknown chunk update type: ${chunkUpdate.type}`);
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
function applyEcmascriptMergedUpdate(update) {
|
|
1763
|
-
// Browser-specific chunk management phase
|
|
1764
|
-
const { entries = {}, chunks = {} } = update;
|
|
1765
|
-
const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(entries, chunks, chunkModulesMap);
|
|
1766
|
-
const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted);
|
|
1767
|
-
// Use shared HMR update implementation
|
|
1768
|
-
applyEcmascriptMergedUpdateShared({
|
|
1769
|
-
added,
|
|
1770
|
-
modified,
|
|
1771
|
-
disposedModules,
|
|
1772
|
-
evalModuleEntry: _eval,
|
|
1773
|
-
instantiateModule,
|
|
1774
|
-
applyModuleFactoryName,
|
|
1775
|
-
moduleFactories,
|
|
1776
|
-
devModuleCache,
|
|
1777
|
-
autoAcceptRootModules: false
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
function handleApply(chunkListPath, update) {
|
|
1781
|
-
switch(update.type){
|
|
1782
|
-
case 'partial':
|
|
1783
|
-
{
|
|
1784
|
-
// This indicates that the update is can be applied to the current state of the application.
|
|
1785
|
-
applyUpdate(update.instruction);
|
|
1786
|
-
break;
|
|
1787
|
-
}
|
|
1788
|
-
case 'restart':
|
|
1789
|
-
{
|
|
1790
|
-
// This indicates that there is no way to apply the update to the
|
|
1791
|
-
// current state of the application, and that the application must be
|
|
1792
|
-
// restarted.
|
|
1793
|
-
DEV_BACKEND.restart();
|
|
1794
|
-
break;
|
|
1795
|
-
}
|
|
1796
|
-
case 'notFound':
|
|
1797
|
-
{
|
|
1798
|
-
// This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,
|
|
1799
|
-
// or the page itself was deleted.
|
|
1800
|
-
// If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.
|
|
1801
|
-
// If it is a runtime chunk list, we restart the application.
|
|
1802
|
-
if (runtimeChunkLists.has(chunkListPath)) {
|
|
1803
|
-
DEV_BACKEND.restart();
|
|
1804
|
-
} else {
|
|
1805
|
-
disposeChunkList(chunkListPath);
|
|
1806
|
-
}
|
|
1807
|
-
break;
|
|
1808
|
-
}
|
|
1809
|
-
default:
|
|
1810
|
-
throw new Error(`Unknown update type: ${update.type}`);
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
/**
|
|
1814
|
-
* Removes a module from a chunk.
|
|
1815
|
-
* Returns `true` if there are no remaining chunks including this module.
|
|
1816
|
-
*/ function removeModuleFromChunk(moduleId, chunkPath) {
|
|
1817
|
-
const moduleChunks = moduleChunksMap.get(moduleId);
|
|
1818
|
-
moduleChunks.delete(chunkPath);
|
|
1819
|
-
const chunkModules = chunkModulesMap.get(chunkPath);
|
|
1820
|
-
chunkModules.delete(moduleId);
|
|
1821
|
-
const noRemainingModules = chunkModules.size === 0;
|
|
1822
|
-
if (noRemainingModules) {
|
|
1823
|
-
chunkModulesMap.delete(chunkPath);
|
|
1824
|
-
}
|
|
1825
|
-
const noRemainingChunks = moduleChunks.size === 0;
|
|
1826
|
-
if (noRemainingChunks) {
|
|
1827
|
-
moduleChunksMap.delete(moduleId);
|
|
1828
|
-
}
|
|
1829
|
-
return noRemainingChunks;
|
|
1830
|
-
}
|
|
1831
|
-
/**
|
|
1832
|
-
* Disposes of a chunk list and its corresponding exclusive chunks.
|
|
1833
|
-
*/ function disposeChunkList(chunkListPath) {
|
|
1834
|
-
const chunkPaths = chunkListChunksMap.get(chunkListPath);
|
|
1835
|
-
if (chunkPaths == null) {
|
|
1836
|
-
return false;
|
|
1837
|
-
}
|
|
1838
|
-
chunkListChunksMap.delete(chunkListPath);
|
|
1839
|
-
for (const chunkPath of chunkPaths){
|
|
1840
|
-
const chunkChunkLists = chunkChunkListsMap.get(chunkPath);
|
|
1841
|
-
chunkChunkLists.delete(chunkListPath);
|
|
1842
|
-
if (chunkChunkLists.size === 0) {
|
|
1843
|
-
chunkChunkListsMap.delete(chunkPath);
|
|
1844
|
-
disposeChunk(chunkPath);
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
// We must also dispose of the chunk list's chunk itself to ensure it may
|
|
1848
|
-
// be reloaded properly in the future.
|
|
1849
|
-
const chunkListUrl = getChunkRelativeUrl(chunkListPath);
|
|
1850
|
-
DEV_BACKEND.unloadChunk?.(chunkListUrl);
|
|
1851
|
-
return true;
|
|
1852
|
-
}
|
|
1853
|
-
/**
|
|
1854
|
-
* Disposes of a chunk and its corresponding exclusive modules.
|
|
1855
|
-
*
|
|
1856
|
-
* @returns Whether the chunk was disposed of.
|
|
1857
|
-
*/ function disposeChunk(chunkPath) {
|
|
1858
|
-
const chunkUrl = getChunkRelativeUrl(chunkPath);
|
|
1859
|
-
// This should happen whether the chunk has any modules in it or not.
|
|
1860
|
-
// For instance, CSS chunks have no modules in them, but they still need to be unloaded.
|
|
1861
|
-
DEV_BACKEND.unloadChunk?.(chunkUrl);
|
|
1862
|
-
const chunkModules = chunkModulesMap.get(chunkPath);
|
|
1863
|
-
if (chunkModules == null) {
|
|
1864
|
-
return false;
|
|
1865
|
-
}
|
|
1866
|
-
chunkModules.delete(chunkPath);
|
|
1867
|
-
for (const moduleId of chunkModules){
|
|
1868
|
-
const moduleChunks = moduleChunksMap.get(moduleId);
|
|
1869
|
-
moduleChunks.delete(chunkPath);
|
|
1870
|
-
const noRemainingChunks = moduleChunks.size === 0;
|
|
1871
|
-
if (noRemainingChunks) {
|
|
1872
|
-
moduleChunksMap.delete(moduleId);
|
|
1873
|
-
disposeModule(moduleId, 'clear');
|
|
1874
|
-
availableModules.delete(moduleId);
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
return true;
|
|
1878
|
-
}
|
|
1879
|
-
/**
|
|
1880
|
-
* Adds a module to a chunk.
|
|
1881
|
-
*/ function addModuleToChunk(moduleId, chunkPath) {
|
|
1882
|
-
let moduleChunks = moduleChunksMap.get(moduleId);
|
|
1883
|
-
if (!moduleChunks) {
|
|
1884
|
-
moduleChunks = new Set([
|
|
1885
|
-
chunkPath
|
|
1886
|
-
]);
|
|
1887
|
-
moduleChunksMap.set(moduleId, moduleChunks);
|
|
1888
|
-
} else {
|
|
1889
|
-
moduleChunks.add(chunkPath);
|
|
1890
|
-
}
|
|
1891
|
-
let chunkModules = chunkModulesMap.get(chunkPath);
|
|
1892
|
-
if (!chunkModules) {
|
|
1893
|
-
chunkModules = new Set([
|
|
1894
|
-
moduleId
|
|
1895
|
-
]);
|
|
1896
|
-
chunkModulesMap.set(chunkPath, chunkModules);
|
|
1897
|
-
} else {
|
|
1898
|
-
chunkModules.add(moduleId);
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
/**
|
|
1902
|
-
* Marks a chunk list as a runtime chunk list. There can be more than one
|
|
1903
|
-
* runtime chunk list. For instance, integration tests can have multiple chunk
|
|
1904
|
-
* groups loaded at runtime, each with its own chunk list.
|
|
1905
|
-
*/ function markChunkListAsRuntime(chunkListPath) {
|
|
1906
|
-
runtimeChunkLists.add(chunkListPath);
|
|
1907
|
-
}
|
|
1908
|
-
function registerChunk(registration) {
|
|
1909
|
-
const chunk = getChunkFromRegistration(registration[0]);
|
|
1910
|
-
let runtimeParams;
|
|
1911
|
-
// When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length
|
|
1912
|
-
if (registration.length === 2) {
|
|
1913
|
-
runtimeParams = registration[1];
|
|
1914
|
-
} else {
|
|
1915
|
-
let chunkPath = getPathFromScript(chunk);
|
|
1916
|
-
runtimeParams = undefined;
|
|
1917
|
-
installCompressedModuleFactories(registration, /* offset= */ 1, moduleFactories, (id)=>addModuleToChunk(id, chunkPath));
|
|
1918
|
-
}
|
|
1919
|
-
return BACKEND.registerChunk(chunk, runtimeParams);
|
|
1920
|
-
}
|
|
1921
|
-
/**
|
|
1922
|
-
* Subscribes to chunk list updates from the update server and applies them.
|
|
1923
|
-
*/ function registerChunkList(chunkList) {
|
|
1924
|
-
const chunkListScript = getChunkFromRegistration(chunkList.script);
|
|
1925
|
-
const chunkListPath = getPathFromScript(chunkListScript);
|
|
1926
|
-
// The "chunk" is also registered to finish the loading in the backend
|
|
1927
|
-
BACKEND.registerChunk(chunkListPath);
|
|
1928
|
-
globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS.push([
|
|
1929
|
-
chunkListPath,
|
|
1930
|
-
handleApply.bind(null, chunkListPath)
|
|
1931
|
-
]);
|
|
1932
|
-
// Adding chunks to chunk lists and vice versa.
|
|
1933
|
-
const chunkPaths = new Set(chunkList.chunks.map(getChunkPath));
|
|
1934
|
-
chunkListChunksMap.set(chunkListPath, chunkPaths);
|
|
1935
|
-
for (const chunkPath of chunkPaths){
|
|
1936
|
-
let chunkChunkLists = chunkChunkListsMap.get(chunkPath);
|
|
1937
|
-
if (!chunkChunkLists) {
|
|
1938
|
-
chunkChunkLists = new Set([
|
|
1939
|
-
chunkListPath
|
|
1940
|
-
]);
|
|
1941
|
-
chunkChunkListsMap.set(chunkPath, chunkChunkLists);
|
|
1942
|
-
} else {
|
|
1943
|
-
chunkChunkLists.add(chunkListPath);
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
if (chunkList.source === 'entry') {
|
|
1947
|
-
markChunkListAsRuntime(chunkListPath);
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
|
|
1951
|
-
/**
|
|
1952
|
-
* This file contains the runtime code specific to the Turbopack ECMAScript DOM runtime.
|
|
1953
|
-
*
|
|
1954
|
-
* It will be appended to the base runtime code.
|
|
1955
|
-
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
|
|
1956
|
-
/// <reference path="../../../shared/runtime/runtime-types.d.ts" />
|
|
1957
|
-
function getAssetSuffixFromScriptSrc() {
|
|
1958
|
-
// TURBOPACK_ASSET_SUFFIX is set in web workers
|
|
1959
|
-
if (self.TURBOPACK_ASSET_SUFFIX != null) return self.TURBOPACK_ASSET_SUFFIX;
|
|
1960
|
-
const src = document?.currentScript?.getAttribute?.('src') ?? '';
|
|
1961
|
-
const qi = src.indexOf('?');
|
|
1962
|
-
return qi >= 0 ? src.slice(qi) : '';
|
|
1963
|
-
}
|
|
1964
|
-
let BACKEND;
|
|
1965
|
-
/**
|
|
1966
|
-
* Maps chunk paths to the corresponding resolver.
|
|
1967
|
-
*/ const chunkResolvers = new Map();
|
|
1968
|
-
(()=>{
|
|
1969
|
-
BACKEND = {
|
|
1970
|
-
async registerChunk (chunk, params) {
|
|
1971
|
-
let chunkPath = getPathFromScript(chunk);
|
|
1972
|
-
let chunkUrl = getUrlFromScript(chunk);
|
|
1973
|
-
const resolver = getOrCreateResolver(chunkUrl);
|
|
1974
|
-
resolver.resolve();
|
|
1975
|
-
if (params == null) {
|
|
1976
|
-
return;
|
|
1977
|
-
}
|
|
1978
|
-
for (const otherChunkData of params.otherChunks){
|
|
1979
|
-
const otherChunkPath = getChunkPath(otherChunkData);
|
|
1980
|
-
const otherChunkUrl = getChunkRelativeUrl(otherChunkPath);
|
|
1981
|
-
// Chunk might have started loading, so we want to avoid triggering another load.
|
|
1982
|
-
getOrCreateResolver(otherChunkUrl);
|
|
1983
|
-
}
|
|
1984
|
-
// This waits for chunks to be loaded, but also marks included items as available.
|
|
1985
|
-
await Promise.all(params.otherChunks.map((otherChunkData)=>loadInitialChunk(chunkPath, otherChunkData)));
|
|
1986
|
-
if (params.runtimeModuleIds.length > 0) {
|
|
1987
|
-
for (const moduleId of params.runtimeModuleIds){
|
|
1988
|
-
getOrInstantiateRuntimeModule(chunkPath, moduleId);
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
},
|
|
1992
|
-
/**
|
|
1993
|
-
* Loads the given chunk, and returns a promise that resolves once the chunk
|
|
1994
|
-
* has been loaded.
|
|
1995
|
-
*/ loadChunkCached (sourceType, chunkUrl) {
|
|
1996
|
-
return doLoadChunk(sourceType, chunkUrl);
|
|
1997
|
-
},
|
|
1998
|
-
async loadWebAssembly (_sourceType, _sourceData, wasmChunkPath, _edgeModule, importsObj) {
|
|
1999
|
-
const req = fetchWebAssembly(wasmChunkPath);
|
|
2000
|
-
const { instance } = await WebAssembly.instantiateStreaming(req, importsObj);
|
|
2001
|
-
return instance.exports;
|
|
2002
|
-
},
|
|
2003
|
-
async loadWebAssemblyModule (_sourceType, _sourceData, wasmChunkPath, _edgeModule) {
|
|
2004
|
-
const req = fetchWebAssembly(wasmChunkPath);
|
|
2005
|
-
return await WebAssembly.compileStreaming(req);
|
|
2006
|
-
}
|
|
2007
|
-
};
|
|
2008
|
-
function getOrCreateResolver(chunkUrl) {
|
|
2009
|
-
let resolver = chunkResolvers.get(chunkUrl);
|
|
2010
|
-
if (!resolver) {
|
|
2011
|
-
let resolve;
|
|
2012
|
-
let reject;
|
|
2013
|
-
const promise = new Promise((innerResolve, innerReject)=>{
|
|
2014
|
-
resolve = innerResolve;
|
|
2015
|
-
reject = innerReject;
|
|
2016
|
-
});
|
|
2017
|
-
resolver = {
|
|
2018
|
-
resolved: false,
|
|
2019
|
-
loadingStarted: false,
|
|
2020
|
-
promise,
|
|
2021
|
-
resolve: ()=>{
|
|
2022
|
-
resolver.resolved = true;
|
|
2023
|
-
resolve();
|
|
2024
|
-
},
|
|
2025
|
-
reject: reject
|
|
2026
|
-
};
|
|
2027
|
-
chunkResolvers.set(chunkUrl, resolver);
|
|
2028
|
-
}
|
|
2029
|
-
return resolver;
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Loads the given chunk, and returns a promise that resolves once the chunk
|
|
2033
|
-
* has been loaded.
|
|
2034
|
-
*/ function doLoadChunk(sourceType, chunkUrl) {
|
|
2035
|
-
const resolver = getOrCreateResolver(chunkUrl);
|
|
2036
|
-
if (resolver.loadingStarted) {
|
|
2037
|
-
return resolver.promise;
|
|
2038
|
-
}
|
|
2039
|
-
if (sourceType === SourceType.Runtime) {
|
|
2040
|
-
// We don't need to load chunks references from runtime code, as they're already
|
|
2041
|
-
// present in the DOM.
|
|
2042
|
-
resolver.loadingStarted = true;
|
|
2043
|
-
if (isCss(chunkUrl)) {
|
|
2044
|
-
// CSS chunks do not register themselves, and as such must be marked as
|
|
2045
|
-
// loaded instantly.
|
|
2046
|
-
resolver.resolve();
|
|
2047
|
-
}
|
|
2048
|
-
// We need to wait for JS chunks to register themselves within `registerChunk`
|
|
2049
|
-
// before we can start instantiating runtime modules, hence the absence of
|
|
2050
|
-
// `resolver.resolve()` in this branch.
|
|
2051
|
-
return resolver.promise;
|
|
2052
|
-
}
|
|
2053
|
-
if (typeof importScripts === 'function') {
|
|
2054
|
-
// We're in a web worker
|
|
2055
|
-
if (isCss(chunkUrl)) {
|
|
2056
|
-
// ignore
|
|
2057
|
-
} else if (isJs(chunkUrl)) {
|
|
2058
|
-
self.TURBOPACK_NEXT_CHUNK_URLS.push(chunkUrl);
|
|
2059
|
-
importScripts(chunkUrl);
|
|
2060
|
-
} else {
|
|
2061
|
-
throw new Error(`can't infer type of chunk from URL ${chunkUrl} in worker`);
|
|
2062
|
-
}
|
|
2063
|
-
} else {
|
|
2064
|
-
// TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.
|
|
2065
|
-
const decodedChunkUrl = decodeURI(chunkUrl);
|
|
2066
|
-
if (isCss(chunkUrl)) {
|
|
2067
|
-
const previousLinks = document.querySelectorAll(`link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]`);
|
|
2068
|
-
if (previousLinks.length > 0) {
|
|
2069
|
-
// CSS chunks do not register themselves, and as such must be marked as
|
|
2070
|
-
// loaded instantly.
|
|
2071
|
-
resolver.resolve();
|
|
2072
|
-
} else {
|
|
2073
|
-
const link = document.createElement('link');
|
|
2074
|
-
link.rel = 'stylesheet';
|
|
2075
|
-
link.href = chunkUrl;
|
|
2076
|
-
link.onerror = ()=>{
|
|
2077
|
-
resolver.reject();
|
|
2078
|
-
};
|
|
2079
|
-
link.onload = ()=>{
|
|
2080
|
-
// CSS chunks do not register themselves, and as such must be marked as
|
|
2081
|
-
// loaded instantly.
|
|
2082
|
-
resolver.resolve();
|
|
2083
|
-
};
|
|
2084
|
-
// Append to the `head` for webpack compatibility.
|
|
2085
|
-
document.head.appendChild(link);
|
|
2086
|
-
}
|
|
2087
|
-
} else if (isJs(chunkUrl)) {
|
|
2088
|
-
const previousScripts = document.querySelectorAll(`script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]`);
|
|
2089
|
-
if (previousScripts.length > 0) {
|
|
2090
|
-
// There is this edge where the script already failed loading, but we
|
|
2091
|
-
// can't detect that. The Promise will never resolve in this case.
|
|
2092
|
-
for (const script of Array.from(previousScripts)){
|
|
2093
|
-
script.addEventListener('error', ()=>{
|
|
2094
|
-
resolver.reject();
|
|
2095
|
-
});
|
|
2096
|
-
}
|
|
2097
|
-
} else {
|
|
2098
|
-
const script = document.createElement('script');
|
|
2099
|
-
script.src = chunkUrl;
|
|
2100
|
-
// We'll only mark the chunk as loaded once the script has been executed,
|
|
2101
|
-
// which happens in `registerChunk`. Hence the absence of `resolve()` in
|
|
2102
|
-
// this branch.
|
|
2103
|
-
script.onerror = ()=>{
|
|
2104
|
-
resolver.reject();
|
|
2105
|
-
};
|
|
2106
|
-
// Append to the `head` for webpack compatibility.
|
|
2107
|
-
document.head.appendChild(script);
|
|
2108
|
-
}
|
|
2109
|
-
} else {
|
|
2110
|
-
throw new Error(`can't infer type of chunk from URL ${chunkUrl}`);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
resolver.loadingStarted = true;
|
|
2114
|
-
return resolver.promise;
|
|
2115
|
-
}
|
|
2116
|
-
function fetchWebAssembly(wasmChunkPath) {
|
|
2117
|
-
return fetch(getChunkRelativeUrl(wasmChunkPath));
|
|
2118
|
-
}
|
|
2119
|
-
})();
|
|
2120
|
-
/**
|
|
2121
|
-
* This file contains the runtime code specific to the Turbopack development
|
|
2122
|
-
* ECMAScript DOM runtime.
|
|
2123
|
-
*
|
|
2124
|
-
* It will be appended to the base development runtime code.
|
|
2125
|
-
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/runtime-base.ts" />
|
|
2126
|
-
/// <reference path="../base/dev-base.ts" />
|
|
2127
|
-
/// <reference path="./runtime-backend-dom.ts" />
|
|
2128
|
-
/// <reference path="../../../shared/require-type.d.ts" />
|
|
2129
|
-
let DEV_BACKEND;
|
|
2130
|
-
(()=>{
|
|
2131
|
-
DEV_BACKEND = {
|
|
2132
|
-
unloadChunk (chunkUrl) {
|
|
2133
|
-
deleteResolver(chunkUrl);
|
|
2134
|
-
// Strip query string so we match links regardless of cache-busting
|
|
2135
|
-
// params (e.g. ?ts=) that may differ between HMR updates.
|
|
2136
|
-
const baseChunkUrl = chunkUrl.split('?')[0];
|
|
2137
|
-
// TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.
|
|
2138
|
-
const decodedBaseChunkUrl = decodeURI(baseChunkUrl);
|
|
2139
|
-
if (isCss(chunkUrl)) {
|
|
2140
|
-
const links = document.querySelectorAll(`link[href="${baseChunkUrl}"],link[href^="${baseChunkUrl}?"],link[href="${decodedBaseChunkUrl}"],link[href^="${decodedBaseChunkUrl}?"]`);
|
|
2141
|
-
for (const link of Array.from(links)){
|
|
2142
|
-
link.remove();
|
|
2143
|
-
}
|
|
2144
|
-
} else if (isJs(chunkUrl)) {
|
|
2145
|
-
// Unloading a JS chunk would have no effect, as it lives in the JS
|
|
2146
|
-
// runtime once evaluated.
|
|
2147
|
-
// However, we still want to remove the script tag from the DOM to keep
|
|
2148
|
-
// the HTML somewhat consistent from the user's perspective.
|
|
2149
|
-
const scripts = document.querySelectorAll(`script[src="${baseChunkUrl}"],script[src^="${baseChunkUrl}?"],script[src="${decodedBaseChunkUrl}"],script[src^="${decodedBaseChunkUrl}?"]`);
|
|
2150
|
-
for (const script of Array.from(scripts)){
|
|
2151
|
-
script.remove();
|
|
2152
|
-
}
|
|
2153
|
-
} else {
|
|
2154
|
-
throw new Error(`can't infer type of chunk from URL ${chunkUrl}`);
|
|
2155
|
-
}
|
|
2156
|
-
},
|
|
2157
|
-
reloadChunk (chunkUrl) {
|
|
2158
|
-
return new Promise((resolve, reject)=>{
|
|
2159
|
-
if (!isCss(chunkUrl)) {
|
|
2160
|
-
reject(new Error('The DOM backend can only reload CSS chunks'));
|
|
2161
|
-
return;
|
|
2162
|
-
}
|
|
2163
|
-
// Strip query string so we match links regardless of cache-busting
|
|
2164
|
-
// params (e.g. ?ts=) that may differ between HMR updates.
|
|
2165
|
-
const baseChunkUrl = chunkUrl.split('?')[0];
|
|
2166
|
-
const decodedBaseChunkUrl = decodeURI(baseChunkUrl);
|
|
2167
|
-
const previousLinks = document.querySelectorAll(`link[rel=stylesheet][href="${baseChunkUrl}"],link[rel=stylesheet][href^="${baseChunkUrl}?"],link[rel=stylesheet][href="${decodedBaseChunkUrl}"],link[rel=stylesheet][href^="${decodedBaseChunkUrl}?"]`);
|
|
2168
|
-
if (previousLinks.length === 0) {
|
|
2169
|
-
reject(new Error(`No link element found for chunk ${chunkUrl}`));
|
|
2170
|
-
return;
|
|
2171
|
-
}
|
|
2172
|
-
const link = document.createElement('link');
|
|
2173
|
-
link.rel = 'stylesheet';
|
|
2174
|
-
if (navigator.userAgent.includes('Firefox') || navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome') && !navigator.userAgent.includes('Chromium')) {
|
|
2175
|
-
// Firefox won't reload CSS files that were previously loaded on the
|
|
2176
|
-
// current page: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506
|
|
2177
|
-
//
|
|
2178
|
-
// Safari serves cached CSS when a <link rel=preload> exists for the
|
|
2179
|
-
// same URL: https://bugs.webkit.org/show_bug.cgi?id=187726
|
|
2180
|
-
//
|
|
2181
|
-
// Replace or add a fresh `ts` cache-busting param without
|
|
2182
|
-
// discarding other query parameters that may already be present.
|
|
2183
|
-
const url = new URL(chunkUrl, location.origin);
|
|
2184
|
-
url.searchParams.set('ts', String(Date.now()));
|
|
2185
|
-
// Reduced timer precision in some browers could lead to an update getting dropped
|
|
2186
|
-
// in firefox if it happens fast enough (in firefox precision is sometimes 100ms!).
|
|
2187
|
-
// So trust that the server is only updating us when it is important and use a
|
|
2188
|
-
// random number to bust the cache.
|
|
2189
|
-
url.searchParams.set('_next_rand', String(Math.random()));
|
|
2190
|
-
link.href = url.pathname + url.search;
|
|
2191
|
-
} else {
|
|
2192
|
-
link.href = chunkUrl;
|
|
2193
|
-
}
|
|
2194
|
-
link.onerror = ()=>{
|
|
2195
|
-
reject();
|
|
2196
|
-
};
|
|
2197
|
-
link.onload = ()=>{
|
|
2198
|
-
// First load the new CSS, then remove the old ones. This prevents visible
|
|
2199
|
-
// flickering that would happen in-between removing the previous CSS and
|
|
2200
|
-
// loading the new one.
|
|
2201
|
-
for (const previousLink of Array.from(previousLinks))previousLink.remove();
|
|
2202
|
-
// CSS chunks do not register themselves, and as such must be marked as
|
|
2203
|
-
// loaded instantly.
|
|
2204
|
-
resolve();
|
|
2205
|
-
};
|
|
2206
|
-
// Make sure to insert the new CSS right after the previous one, so that
|
|
2207
|
-
// its precedence is higher.
|
|
2208
|
-
previousLinks[0].parentElement.insertBefore(link, previousLinks[0].nextSibling);
|
|
2209
|
-
});
|
|
2210
|
-
},
|
|
2211
|
-
restart: ()=>self.location.reload()
|
|
2212
|
-
};
|
|
2213
|
-
function deleteResolver(chunkUrl) {
|
|
2214
|
-
chunkResolvers.delete(chunkUrl);
|
|
2215
|
-
}
|
|
2216
|
-
})();
|
|
2217
|
-
function _eval({ code, url, map }) {
|
|
2218
|
-
code += `\n\n//# sourceURL=${encodeURI(location.origin + CHUNK_BASE_PATH + url + ASSET_SUFFIX)}`;
|
|
2219
|
-
if (map) {
|
|
2220
|
-
code += `\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(// btoa doesn't handle nonlatin characters, so escape them as \x sequences
|
|
2221
|
-
// See https://stackoverflow.com/a/26603875
|
|
2222
|
-
unescape(encodeURIComponent(map)))}`;
|
|
2223
|
-
}
|
|
2224
|
-
// eslint-disable-next-line no-eval
|
|
2225
|
-
return eval(code);
|
|
2226
|
-
}
|
|
2227
|
-
const chunksToRegister = globalThis["TURBOPACK"];
|
|
2228
|
-
globalThis["TURBOPACK"] = { push: registerChunk };
|
|
2229
|
-
chunksToRegister.forEach(registerChunk);
|
|
2230
|
-
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
|
|
2231
|
-
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
|
|
2232
|
-
chunkListsToRegister.forEach(registerChunkList);
|
|
2233
|
-
})();
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
//# sourceMappingURL=pages__app_1ouknez._.js.map
|