From 4394539d9951c5df5fe3ef7aed29dca25917680f Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:33:00 +0100 Subject: [PATCH 01/25] Bump swc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Donny/강동윤 f f --- Cargo.lock | 1065 ++++++++++------- Cargo.toml | 22 +- crates/napi/src/rspack.rs | 6 +- crates/next-api/src/server_actions.rs | 24 +- .../src/next_shared/transforms/next_font.rs | 14 +- crates/next-core/src/segment_config.rs | 7 +- crates/next-custom-transforms/Cargo.toml | 1 + .../src/chain_transforms.rs | 6 +- .../src/transforms/cjs_optimizer.rs | 22 +- .../src/transforms/dynamic.rs | 25 +- .../find_functions_outside_module_scope.rs | 2 +- .../fonts/font_functions_collector.rs | 6 +- .../fonts/font_imports_generator.rs | 13 +- .../src/transforms/fonts/mod.rs | 11 +- .../src/transforms/import_analyzer.rs | 14 +- .../src/transforms/named_import_transform.rs | 13 +- .../src/transforms/next_ssg.rs | 12 +- .../src/transforms/optimize_barrel.rs | 36 +- .../src/transforms/optimize_server_react.rs | 4 +- .../src/transforms/react_server_components.rs | 29 +- .../src/transforms/server_actions.rs | 57 +- .../src/transforms/strip_page_exports.rs | 10 +- .../src/transforms/warn_for_edge_runtime.rs | 10 +- crates/next-custom-transforms/tests/errors.rs | 15 +- .../src/transform/styled_components.rs | 7 +- .../src/analyzer/graph.rs | 4 +- .../src/analyzer/imports.rs | 37 +- .../turbopack-ecmascript/src/analyzer/mod.rs | 17 +- .../src/analyzer/well_known.rs | 2 +- .../turbopack-ecmascript/src/path_visitor.rs | 2 +- .../src/references/mod.rs | 17 +- .../src/references/unreachable.rs | 2 +- .../src/tree_shake/graph.rs | 8 +- .../src/tree_shake/merge.rs | 10 +- .../src/tree_shake/tests.rs | 7 +- .../crates/turbopack-ecmascript/src/utils.rs | 2 +- .../turbopack-ecmascript/src/webpack/mod.rs | 4 +- 37 files changed, 899 insertions(+), 644 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db1dc39001228d..72a421901545b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -328,6 +328,17 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "ast_node" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb025ef00a6da925cf40870b9c8d008526b6004ece399cb0974209720f0b194" +dependencies = [ + "quote", + "swc_macros_common", + "syn 2.0.104", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -594,21 +605,21 @@ dependencies = [ [[package]] name = "binding_macros" -version = "43.0.0" +version = "45.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555840100e29306f39cf0cdd08410e6fafc17ded3452133c4b081d6efc72855b" +checksum = "15d37c4fc1ff2cfc99b1d5d022cec4b3f9299c6ef2f7690b408ae3e124a9a9e2" dependencies = [ "anyhow", "console_error_panic_hook", "js-sys", "once_cell", "serde", - "serde-wasm-bindgen 0.4.5", + "serde-wasm-bindgen 0.6.5", "swc", - "swc_common", - "swc_ecma_ast", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_transforms", - "swc_ecma_visit", + "swc_ecma_visit 18.0.1", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -941,6 +952,12 @@ dependencies = [ "rustversion", ] +[[package]] +name = "cbor4ii" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b28d2802395e3bccd95cc4ae984bff7444b6c1f5981da46a41360c42a2c7e2d9" + [[package]] name = "cc" version = "1.2.31" @@ -2315,6 +2332,16 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "from_variant" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ff35a391aef949120a0340d690269b3d9f63460a6106e99bd07b961f345ea9" +dependencies = [ + "swc_macros_common", + "syn 2.0.104", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -2744,9 +2771,9 @@ dependencies = [ [[package]] name = "hstr" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced1416104790052518d199e753d49a7d8130d476c664bc9e53f40cfecb8e615" +checksum = "31f11d91d7befd2ffd9d216e9e5ea1fae6174b20a2a1b67a688138003d2f4122" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", @@ -2755,6 +2782,20 @@ dependencies = [ "triomphe 0.1.13", ] +[[package]] +name = "hstr" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c43c0a9e8fbdb3bb9dc8eee85e1e2ac81605418b4c83b6b7413cbf14d56ca5c" +dependencies = [ + "hashbrown 0.14.5", + "new_debug_unreachable", + "once_cell", + "rustc-hash 2.1.1", + "serde", + "triomphe 0.1.13", +] + [[package]] name = "http" version = "0.2.11" @@ -3923,7 +3964,7 @@ dependencies = [ "markdown", "rustc-hash 2.1.1", "serde", - "swc_core", + "swc_core 45.0.2", ] [[package]] @@ -3961,23 +4002,22 @@ dependencies = [ [[package]] name = "miette" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror 1.0.69", "unicode-width 0.1.13", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -4093,20 +4133,20 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.99.0" +version = "0.101.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd567f0495a231885cb79c0a0314c4b5afe88f0a232e36afa816c829bb45477" +checksum = "dbd34545e153e519389791c32a8da9ea088008e9123c9a45bb0f8e881ee209e2" dependencies = [ "convert_case", "handlebars", "once_cell", "regex", "serde", - "swc_atoms", + "swc_atoms 9.0.0", "swc_cached", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] @@ -4260,7 +4300,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_core", + "swc_core 47.0.7", "tempfile", "tokio", "tracing", @@ -4302,7 +4342,7 @@ dependencies = [ "num_cpus", "rand 0.9.0", "serde_json", - "swc_core", + "swc_core 47.0.7", "tokio", "tokio-stream", "tracing", @@ -4342,7 +4382,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "swc_core", + "swc_core 47.0.7", "swc_sourcemap", "thiserror 1.0.69", "tracing", @@ -4393,7 +4433,8 @@ dependencies = [ "sha1", "styled_components", "styled_jsx", - "swc_core", + "swc_atoms 9.0.0", + "swc_core 47.0.7", "swc_emotion", "swc_relay", "testing", @@ -4432,7 +4473,7 @@ dependencies = [ "serde", "serde_json", "supports-hyperlinks", - "swc_core", + "swc_core 47.0.7", "terminal_hyperlink", "tokio", "tracing", @@ -5238,14 +5279,14 @@ checksum = "84350ffee5cedfabf9bee3e8825721f651da8ff79d50fe7a37cf0ca015c428ee" [[package]] name = "preset_env_base" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e82699979593636125cbeeedaf538d11f3dc4645287bbd594041404ad4a88a" +checksum = "30a2c7fa37f659cd9a5a1231752c785b07ae7994122069720b576cb50da9fe8b" dependencies = [ "anyhow", "browserslist-rs", "dashmap 5.5.3", - "from_variant", + "from_variant 3.0.0", "once_cell", "rustc-hash 2.1.1", "semver", @@ -5718,16 +5759,16 @@ dependencies = [ [[package]] name = "react_remove_properties" -version = "0.53.0" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9206185f0bb1feedad3bb74096989add941cf4ea637d866037ddfadccdedff3c" +checksum = "231d29b20b318e992c94ccc729acf46cb0d767ca8d88c16ff3e4eff17f54a370" dependencies = [ "serde", - "swc_atoms", + "swc_atoms 9.0.0", "swc_cached", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] @@ -5831,16 +5872,16 @@ checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" [[package]] name = "remove_console" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f6e5cc263bc6d0d9284fe4f6f808470d94098f7bfdac7bdc4b55c2935782626" +checksum = "a2cd55dd38f1133d0e4d07057b490283eeb7328d06317c3b4075455383422985" dependencies = [ "serde", - "swc_atoms", + "swc_atoms 9.0.0", "swc_cached", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] @@ -6759,12 +6800,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" - [[package]] name = "smoltcp" version = "0.8.2" @@ -6909,28 +6944,28 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "styled_components" -version = "0.127.0" +version = "0.129.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6994d5b6ba60327ccb08a9e4ef814c3a4660cf0dda7092a286d5db323393808c" +checksum = "6d3471f72eef9580d451d05de9aefc4b5c391c0145766b7bd723353725218cb2" dependencies = [ "Inflector", "once_cell", "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] [[package]] name = "styled_jsx" -version = "0.103.0" +version = "0.105.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513c153e0fba36b0fd4e04ca1d60617de172e7c38d18a9bd680484650d2de8de" +checksum = "a560b1c2fd9e4bd051024676d22db51c8f90d2d05988a08feeefc7f7511fe245" dependencies = [ "anyhow", "lightningcss", @@ -6939,8 +6974,8 @@ dependencies = [ "preset_env_base", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_css_codegen", "swc_css_compat", @@ -6948,12 +6983,12 @@ dependencies = [ "swc_css_parser", "swc_css_prefixer", "swc_css_visit", - "swc_ecma_ast", + "swc_ecma_ast 18.0.0", "swc_ecma_minifier", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_parser 27.0.5", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_plugin_macro", "tracing", ] @@ -6972,9 +7007,9 @@ checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "swc" -version = "43.0.0" +version = "45.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37aa6523fc9d76cbc14f5abafdf326860c5ad0b1195c1b11a5dd66623745ff43" +checksum = "120e178c4c0826616b9daabaabcc9196e51c43dac9e42dbe3ee792458b045594" dependencies = [ "anyhow", "base64 0.22.1", @@ -6991,24 +7026,23 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_compiler_base", "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", "swc_ecma_ext_transforms", - "swc_ecma_lints", "swc_ecma_loader", "swc_ecma_minifier", - "swc_ecma_parser", + "swc_ecma_parser 27.0.5", "swc_ecma_preset_env", "swc_ecma_transforms", - "swc_ecma_transforms_base", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_compat", "swc_ecma_transforms_optimization", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_error_reporters", "swc_node_comments", "swc_plugin_backend_wasmer", @@ -7017,7 +7051,6 @@ dependencies = [ "swc_sourcemap", "swc_timer", "swc_transform_common", - "swc_typescript", "swc_visit", "tokio", "tracing", @@ -7032,7 +7065,7 @@ dependencies = [ "clap", "owo-colors", "regex", - "swc_core", + "swc_core 47.0.7", ] [[package]] @@ -7052,9 +7085,21 @@ name = "swc_atoms" version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3500dcf04c84606b38464561edc5e46f5132201cb3e23cf9613ed4033d6b1bb2" +dependencies = [ + "hstr 2.1.0", + "once_cell", + "serde", +] + +[[package]] +name = "swc_atoms" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a" dependencies = [ "bytecheck 0.8.1", - "hstr", + "cbor4ii", + "hstr 3.0.3", "once_cell", "rancor", "rkyv 0.8.10", @@ -7083,12 +7128,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13be0317490fc330a53ee9e64b26891503c35336b509eb69c4fc1dc4e0119ff9" dependencies = [ "anyhow", - "ast_node", + "ast_node 4.0.0", + "better_scoped_tls", + "bytes-str", + "either", + "from_variant 2.0.2", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "rustc-hash 2.1.1", + "serde", + "siphasher", + "swc_atoms 7.0.0", + "swc_eq_ignore_macros", + "swc_visit", + "tracing", + "unicode-width 0.1.13", + "url", +] + +[[package]] +name = "swc_common" +version = "17.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "259b675d633a26d24efe3802a9d88858c918e6e8f062d3222d3aa02d56a2cf4c" +dependencies = [ + "anyhow", + "ast_node 5.0.0", "better_scoped_tls", "bytecheck 0.8.1", "bytes-str", + "cbor4ii", "either", - "from_variant", + "from_variant 3.0.0", "new_debug_unreachable", "num-bigint", "once_cell", @@ -7099,21 +7171,21 @@ dependencies = [ "serde", "shrink-to-fit", "siphasher", - "swc_atoms", + "swc_atoms 9.0.0", "swc_eq_ignore_macros", "swc_sourcemap", "swc_visit", "termcolor", "tracing", - "unicode-width 0.1.13", + "unicode-width 0.2.1", "url", ] [[package]] name = "swc_compiler_base" -version = "37.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c391731b37a8dc4ec47824b03a11cd835309250ac705c109a78ee75be727eb" +checksum = "cdae5cb6d579bcd48deb37b0edf29c2178934b13b350e876072d4bce435febe9" dependencies = [ "anyhow", "base64 0.22.1", @@ -7123,14 +7195,14 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", "swc_ecma_minifier", - "swc_ecma_parser", - "swc_ecma_visit", + "swc_ecma_parser 27.0.5", + "swc_ecma_visit 18.0.1", "swc_sourcemap", "swc_timer", ] @@ -7170,33 +7242,50 @@ dependencies = [ [[package]] name = "swc_core" -version = "45.0.1" +version = "45.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e3f7a14efb82fd970b90afb1fc1afe34d969ad4b2adc4a63803cfc95249f08" +dependencies = [ + "swc_allocator", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", + "swc_ecma_codegen 18.0.0", + "swc_ecma_parser 25.0.0", + "swc_ecma_transforms_base 28.0.1", + "swc_ecma_visit 16.0.0", + "vergen", +] + +[[package]] +name = "swc_core" +version = "47.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c765366589d67d0883250b7aa66997da5de2cefd9081ee6ec881d50117b6e6a5" +checksum = "e47f64ffe01d83bf6c474743a9f686ea55e88229c8fa936e676d46fe3951687e" dependencies = [ "binding_macros", "par-core", "swc", "swc_allocator", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", "swc_ecma_lints", "swc_ecma_loader", "swc_ecma_minifier", - "swc_ecma_parser", + "swc_ecma_parser 27.0.5", "swc_ecma_preset_env", "swc_ecma_quote_macros", - "swc_ecma_transforms_base", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_module", "swc_ecma_transforms_optimization", "swc_ecma_transforms_proposal", "swc_ecma_transforms_react", "swc_ecma_transforms_testing", "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_plugin_proxy", "swc_plugin_runner", "testing", @@ -7205,28 +7294,28 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145b3ee43b11a92a13bb319c66fed9e34d5953ef4be67e5667075aae68a394c7" +checksum = "c556ef58d7a318b4388c3d90e78a43f993a83eb458b95520f00727480e8b2f16" dependencies = [ "is-macro", "string_enum", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", ] [[package]] name = "swc_css_codegen" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d385256478953a45a010fd759368ad4b9162f6f601d6e200e32024b6a879f2e9" +checksum = "007c5acffea80166ab695f0680cc443a0e517e2a58c979024474322370127a59" dependencies = [ "auto_impl", "bitflags 2.9.1", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_css_codegen_macros", "swc_css_utils", @@ -7244,14 +7333,14 @@ dependencies = [ [[package]] name = "swc_css_compat" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4428f93e54915a676a22f8b04fcc19a77e3e35a5a8609635874d263a1227e22c" +checksum = "fafd61bfd3a0f764abdcd49b89119a2befa027b1aff701eb10d1968a705e186c" dependencies = [ "bitflags 2.9.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7259,14 +7348,14 @@ dependencies = [ [[package]] name = "swc_css_minifier" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d068270dd9b8f7f432ba8cc24fb51a7ebc0fd254a57f5cfc4f5a82f74e6ebcaf" +checksum = "577704829410febeb5683c710840bb59edd614dc64d8390084e13a02ad35fcfc" dependencies = [ "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7274,30 +7363,30 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e681f9c66208b1ec98e6f69cd068effaa7f0797581d11b88c772a2c312368" +checksum = "6ea88d8d24b80dff949fd830026cdbc5f534e450ecab2c81251ed71a07c5927d" dependencies = [ "lexical", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", ] [[package]] name = "swc_css_prefixer" -version = "18.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcaacf911f12c0c946ea394b927715202ece653536a89628463b3498ae76c36" +checksum = "34d3ae49504eadd549ac4a8e0064d828308fcddd9dba8cf56a1c41234535b795" dependencies = [ "once_cell", "preset_env_base", "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7305,28 +7394,28 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7bd6d3ecd934a0ee3d057f78628cc1f058b4f13bed963e51112d85c86c9ebf" +checksum = "9d463bcfe89f5c208f439317da9a66671531072a9afdb4395777893eeaa7b075" dependencies = [ "once_cell", "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", + "swc_atoms 9.0.0", "swc_css_ast", "swc_css_visit", ] [[package]] name = "swc_css_visit" -version = "15.0.0" +version = "17.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e023a02a0fd04354415d6dcdfcb39d1a37d35873732f801f7d2b67576500d96a" +checksum = "8bbf6cc10351eefef24b16dd2ef778313518a9611e132e57bd0771b113bcd3eb" dependencies = [ "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_css_ast", "swc_visit", ] @@ -7338,19 +7427,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9298e06af471f29aea2f8d1b6232885bd2a634521d0e95dc9d5bde3d39d3d" dependencies = [ "bitflags 2.9.1", - "bytecheck 0.8.1", "is-macro", "num-bigint", "once_cell", "phf", - "rancor", - "rkyv 0.8.10", + "rustc-hash 2.1.1", + "string_enum", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_visit", + "unicode-id-start", +] + +[[package]] +name = "swc_ecma_ast" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a573a0c72850dec8d4d8085f152d5778af35a2520c3093b242d2d1d50776da7c" +dependencies = [ + "bitflags 2.9.1", + "cbor4ii", + "is-macro", + "num-bigint", + "once_cell", + "phf", "rustc-hash 2.1.1", "serde", "shrink-to-fit", "string_enum", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_visit", "unicode-id-start", ] @@ -7371,9 +7477,33 @@ dependencies = [ "ryu-js", "serde", "swc_allocator", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", + "swc_ecma_codegen_macros", + "swc_sourcemap", + "tracing", +] + +[[package]] +name = "swc_ecma_codegen" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a278bb4395127390f3a2ae2cacf6e276b446654fc7b31d0c7e7917035f8e86c3" +dependencies = [ + "ascii", + "compact_str", + "memchr", + "num-bigint", + "once_cell", + "regex", + "rustc-hash 2.1.1", + "ryu-js", + "serde", + "swc_allocator", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_codegen_macros", "swc_sourcemap", "tracing", @@ -7392,39 +7522,39 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce408152ee3f1119ec91192381d7fa65dc65715ac52444fda51a74c29f62e8e7" +checksum = "196ed37b7543d40ed330380c600ef8cb70bc26405dd8885614cc470a7a0d4209" dependencies = [ "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_es2015", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_common" -version = "22.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c8e4400709546f3b62b23c3f777be41a068a972a153bab779f4976b9545c14" +checksum = "a4b2330d0340d6c59733b6dd7382950d01a55e151e51e312346b0b20f33d1e81" dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_compat_es2015" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d0917a1eca37bc184540d64685ce066201b96c9eb2c50f38c69ce296c2c686" +checksum = "a522544927e02136ef402a589dc118cda486aaf89ceca7f3ba512644c0a6a4af" dependencies = [ "arrayvec 0.7.6", "indexmap 2.9.0", @@ -7433,186 +7563,186 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_common", - "swc_ecma_transforms_base", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_classes", "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es2016" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ead70453d65d02ce1d283c0159408dc4e5dd9a7b4635f2a3cc94d7346fdcf74a" +checksum = "834d2646e55f908e57ad45af1c774f0ea9c330f2d9f24f62fbce9ee2a89c350e" dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es2017" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4549bc226e0f359d6906a4b67dcb1f28d377e38976fb959f2297dd3a9eb38f" +checksum = "040a793beb2c07a85581ffaf2adc84336ad5f8cf144f74830210f870c52007ef" dependencies = [ "serde", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es2018" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc24a4b66caa22afcf5b42464f302675a38ce09a1e2eea0e0374c36923adbe0" +checksum = "c9ab1f76516d475f02dcd8ee25687068fb9d61382fb5aef67183a6a6e678fb68" dependencies = [ "serde", - "swc_common", - "swc_ecma_ast", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_common", - "swc_ecma_transforms_base", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es2019" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129658fc4634c8ad08cb039ddbc3ce3689aa269548cb8bac8f7b838c1ba5e953" +checksum = "a031c85293d82d3d8fccdc13f7ddc07c897ceb209faa8a5286e2daf2e707ae3c" dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es2020" -version = "29.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4cbb6cbba95100f8db2c0317cb8989ce58fc570bd4e1c9da204e52ac0b2d366" +checksum = "2be3a3ab318b1995bbab55b952486b6c4d57859f84e214265e5b7cd40bb87d5f" dependencies = [ "serde", - "swc_common", - "swc_ecma_ast", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_es2022", "swc_ecma_compiler", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] [[package]] name = "swc_ecma_compat_es2021" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36529cd59e0855608b031fb6fe8b1d35f585fb5d361e97444763cc1386442fb" +checksum = "5ddc7ea940c8cf69126e5d8d955f917ddce17983af461109fe6604b30fb5641e" dependencies = [ - "swc_ecma_ast", + "swc_ecma_ast 18.0.0", "swc_ecma_compiler", - "swc_ecma_transforms_base", - "swc_ecma_utils", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", "tracing", ] [[package]] name = "swc_ecma_compat_es2022" -version = "29.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714b9b562308c78d60f9776a1b80160da2157968943481ff5c2d9c5982d4e951" +checksum = "78f86e65bce3f8485c777e7893ec1219819f16233cb912d7cb50a4b36032696a" dependencies = [ "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_common", "swc_ecma_compiler", - "swc_ecma_transforms_base", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_classes", "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compat_es3" -version = "23.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e151f8a93d6ddba163ec700a25737089b207d4cd86b8916a0e750c52379576" +checksum = "53af7d08462be6315e3befb48b0aa0e4a2a40e34238835b5a432fb1a7dff750b" dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_compiler" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f09a1096f454cc4685f75040ae90a7ea6d25aad7b4d6c3b6a947c595d8b23c" +checksum = "1ad37749c3906d1046f6790fb79d88cc3ba05e84c8ca39ddef4078a4ee89164c" dependencies = [ "bitflags 2.9.1", "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_trace_macro", "tracing", ] [[package]] name = "swc_ecma_ext_transforms" -version = "22.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf4fdcbb1431079b5c0cc008715e7e4856dad739754dd985e4aa9e0b6ffd857" +checksum = "88bd60c8f244d33d5d42c518908238dd4f0dc6e0cf74b1ed39b7aff2daab3b9d" dependencies = [ "phf", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_lexer" -version = "24.0.0" +version = "24.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc7dca92e2239f09d177999b0fae2efe6e68a51eae1d9bae85b2efa78537924" +checksum = "d64b5db3b7cdba77d4063f7a0747333685cfb843fa2260d0c0765eff4bc82d0b" dependencies = [ "arrayvec 0.7.6", "bitflags 2.9.1", @@ -7625,17 +7755,17 @@ dependencies = [ "smallvec", "smartstring", "stacker", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", "tracing", ] [[package]] name = "swc_ecma_lints" -version = "23.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f4eb9e2ee9676e6986194320d97dd28466db6d0852cadd9669e7ea5a687196" +checksum = "9ec3cbee5df6e55ed4799ec12f83872da6c8ee2c592e78549a03b586c22fd6f1" dependencies = [ "auto_impl", "dashmap 5.5.3", @@ -7644,19 +7774,19 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_loader" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e63f947d3263a0a3f41b6dd4d3fceac3788268a7fac9888f2d78ac9c71cf676" +checksum = "fbcababb48f0d46587a0a854b2c577eb3a56fa99687de558338021e93cd2c8f5" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -7669,16 +7799,16 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "tracing", ] [[package]] name = "swc_ecma_minifier" -version = "34.0.1" +version = "36.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977ee617c78a4ace62abc8733222f6c3c51c6a9000c074a567b361377f6b756c" +checksum = "6e07508fefa4a1aedd7937da5829a49d15553a461b696bb0590705b0abd7416c" dependencies = [ "arrayvec 0.7.6", "bitflags 2.9.1", @@ -7695,17 +7825,17 @@ dependencies = [ "ryu-js", "serde", "serde_json", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_parser", - "swc_ecma_transforms_base", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", + "swc_ecma_parser 27.0.5", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_optimization", "swc_ecma_usage_analyzer", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_timer", "tracing", ] @@ -7719,18 +7849,39 @@ dependencies = [ "either", "num-bigint", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", "swc_ecma_lexer", "tracing", ] +[[package]] +name = "swc_ecma_parser" +version = "27.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5fb46c651289a49664e66c035533bc06633faf48f659d8d71c3e2e5c6524469" +dependencies = [ + "bitflags 2.9.1", + "either", + "num-bigint", + "phf", + "rustc-hash 2.1.1", + "seq-macro", + "serde", + "smartstring", + "stacker", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "tracing", +] + [[package]] name = "swc_ecma_preset_env" -version = "37.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f823c2a9ff3576ba2b8bf498e371eb6e86ffdeeaa98ab151a1f9eaa589f4e360" +checksum = "290d285b03b2f81be198f2dd64cc13310130bbebe814037a533be75cf2640f81" dependencies = [ "anyhow", "foldhash 0.1.5", @@ -7742,38 +7893,38 @@ dependencies = [ "serde", "serde_json", "string_enum", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compiler", "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_quote_macros" -version = "25.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b83953c928934f0b0b242c0bbda51a5895fec8c55409b3073c5fe851e11177" +checksum = "4516276b6a9864eb43fca35008074e827fa9368b78ee4be8b964fbe4c05efc85" dependencies = [ "anyhow", "proc-macro2", "quote", "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_parser 27.0.5", "swc_macros_common", "syn 2.0.104", ] [[package]] name = "swc_ecma_testing" -version = "16.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464be50bb5a907f43cf3559ccecec38bd69f91b580bcdbda9a65a35d8627b7f3" +checksum = "d3e17d20c5c8f5618423bf45e6caa642866ca5463e42475667325ead6490f2a2" dependencies = [ "anyhow", "hex", @@ -7784,28 +7935,50 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "36.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "932e4ff767145e75a64a837b589c87ad4abd133eef37abd9ca095fbd0721f6f4" +checksum = "6f61ecb0d5c35287cefbc6b0282ac01c694739da6483abf3913d068ce45a1223" dependencies = [ "par-core", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_compat", "swc_ecma_transforms_module", "swc_ecma_transforms_optimization", "swc_ecma_transforms_proposal", "swc_ecma_transforms_react", "swc_ecma_transforms_typescript", - "swc_ecma_utils", + "swc_ecma_utils 24.0.0", +] + +[[package]] +name = "swc_ecma_transforms_base" +version = "28.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f892bb70d780486b86485493a3c7f4df8d84d5caba7e1d83e2e700836c29d613" +dependencies = [ + "better_scoped_tls", + "indexmap 2.9.0", + "once_cell", + "par-core", + "phf", + "rustc-hash 2.1.1", + "serde", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", + "swc_ecma_parser 25.0.0", + "swc_ecma_utils 22.0.0", + "swc_ecma_visit 16.0.0", + "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72ecdabae8bccf20d9d030c787e9f2b7dbeddef3282c4732f5a28494d814764" +checksum = "305080c8ce2a5280549ad9715f958c093686705fa67108d00cb17c7ddf5f1e4a" dependencies = [ "better_scoped_tls", "indexmap 2.9.0", @@ -7814,40 +7987,40 @@ dependencies = [ "phf", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_parser 27.0.5", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] [[package]] name = "swc_ecma_transforms_classes" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552e3f1541e74eef1d9c30c7eeeb0c5716a7655f3a2361f822d9c53291ddb98b" +checksum = "3d3ab35eff4a980e02d708798ae4c35bc017612292adbffe7b7b554df772fdf5" dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_transforms_compat" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a1edea2695a75dee6acf54eb4c32a91e4b28843bde8bbdc47fc928ae005440" +checksum = "2a21cfdc337873ab5959652c7efb6d3d72eb87f6ae225bbb038691e1c14b0d33" dependencies = [ "indexmap 2.9.0", "par-core", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_ecma_compat_bugfixes", "swc_ecma_compat_common", "swc_ecma_compat_es2015", @@ -7859,9 +8032,9 @@ dependencies = [ "swc_ecma_compat_es2021", "swc_ecma_compat_es2022", "swc_ecma_compat_es3", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] @@ -7879,9 +8052,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86153dade5ae62dc05e42a7298cb53ed13c2b61a907e6a2c5c1ed8d414f7eb3c" +checksum = "5ca16d6a2f0567b876a775b0eacf4df99cfa4551831b8c81f3962795fa4f50ac" dependencies = [ "Inflector", "anyhow", @@ -7893,23 +8066,23 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", + "swc_ecma_ast 18.0.0", "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_parser 27.0.5", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] [[package]] name = "swc_ecma_transforms_optimization" -version = "30.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b572cc5ef6532d006cdf5365b50802dfa94b030676be4164939f34c75b88dc9d" +checksum = "49b3eba5fd24fb4cf7b5092474711a40e47e4cff973b839a7c1c69c1557b272d" dependencies = [ "bytes-str", "dashmap 5.5.3", @@ -7919,39 +8092,39 @@ dependencies = [ "petgraph 0.7.1", "rustc-hash 2.1.1", "serde_json", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_parser 27.0.5", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] [[package]] name = "swc_ecma_transforms_proposal" -version = "28.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae20a71fad49a8e2784bacd146328c435854160ad2c7428529d5fa9d740acb6" +checksum = "c2d7748d4112c87ce1885260035e4a43cebfe7661a40174b7d77a0a04760a257" dependencies = [ "either", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_classes", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_transforms_react" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46abf63b0ee1dd746d9069ce1eeacc257ff1ef514619acd69db06279669e58bd" +checksum = "03de12e38e47ac1c96ac576f793ad37a9d7b16fbf4f2203881f89152f2498682" dependencies = [ "base64 0.22.1", "bytes-str", @@ -7961,21 +8134,21 @@ dependencies = [ "serde", "sha1", "string_enum", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_ast 18.0.0", + "swc_ecma_parser 27.0.5", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_transforms_testing" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba723011d5a35faa99e61ca0de21f6c61c3449423b3709d7dce52b7ac4d10aa4" +checksum = "78a5b3fd779beb4838a0d4bf0376889aa6dc365d7c9243b6d0cb6e95bcfb3a94" dependencies = [ "ansi_term", "anyhow", @@ -7984,14 +8157,14 @@ dependencies = [ "serde", "serde_json", "sha2", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_parser", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", + "swc_ecma_parser 27.0.5", "swc_ecma_testing", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_transforms_base 30.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_sourcemap", "tempfile", "testing", @@ -7999,36 +8172,36 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "31.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2608b63e08955f0795de7e1dd1ab8b6e95f722fbc2eeb6902132c1702f61c131" +checksum = "4408800fdeb541fabf3659db622189a0aeb386f57b6103f9294ff19dfde4f7b0" dependencies = [ "bytes-str", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_transforms_base 30.0.0", "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", ] [[package]] name = "swc_ecma_usage_analyzer" -version = "23.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4faf08438c2ba8f48732eccc4630cf4ef7e0b998df8ba0ab20e1a8bebc05d2" +checksum = "1fb062da3df269979e543693e16f21c351c371626a704afc7332c79251d73114" dependencies = [ "bitflags 2.9.1", "indexmap 2.9.0", "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_timer", "tracing", ] @@ -8045,10 +8218,29 @@ dependencies = [ "par-core", "rustc-hash 2.1.1", "ryu-js", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", + "swc_ecma_visit 16.0.0", + "tracing", +] + +[[package]] +name = "swc_ecma_utils" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fb99e179988cabd473779a4452ab942bcb777176983ca3cbaf22a8f056a65b0" +dependencies = [ + "indexmap 2.9.0", + "num_cpus", + "once_cell", + "par-core", + "rustc-hash 2.1.1", + "ryu-js", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] @@ -8057,22 +8249,37 @@ name = "swc_ecma_visit" version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8763b91f52a54d5836c1f922dd393b157d47c121c7aab87308f582daf345f77" +dependencies = [ + "new_debug_unreachable", + "num-bigint", + "swc_atoms 7.0.0", + "swc_common 15.0.0", + "swc_ecma_ast 16.0.0", + "swc_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_visit" +version = "18.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9611a72a4008d62608547a394e5d72a5245413104db096d95a52368a8cc1d63" dependencies = [ "new_debug_unreachable", "num-bigint", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_visit", "tracing", ] [[package]] name = "swc_emotion" -version = "0.103.0" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb43c7ccc87825b8b520962e8fa777808d8e4198b57af164fa920495b0f2187a" +checksum = "d04f36710715a4fcb937f661dcbceaaca4dd091ad84098ec4bf486d189162450" dependencies = [ "base64 0.22.1", "byteorder", @@ -8082,13 +8289,13 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_codegen 20.0.0", "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "swc_sourcemap", "swc_trace_macro", "tracing", @@ -8107,15 +8314,15 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "17.0.0" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f991c703dea8982ebfb955a0b1c35fdfe551b24d8d13039c5a0b66e381edbd" +checksum = "30c41e7b4f78298094092765ddf5b667491026a53a1d149c25b983188d471cbc" dependencies = [ "anyhow", "miette", "once_cell", "serde", - "swc_common", + "swc_common 17.0.1", ] [[package]] @@ -8131,26 +8338,26 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b71569a4f63edcf31b34c261a6062ec3ad8f1a7b5d3838e8b570f2b2a055a8f" +checksum = "614f452f71edf142525dea290ae1faa8a9bcc972888327848297a4785c6628a1" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", + "swc_atoms 9.0.0", + "swc_common 17.0.1", ] [[package]] name = "swc_plugin_backend_wasmer" -version = "3.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee6799f2d74b7e12c7d5a69c434cb872bf7163e40affda2cb8147039e6e7fdb" +checksum = "477529a149d83dc52cb08c5404a253a6dbb34ba1f9e274cfe46546a5b2a86ac9" dependencies = [ "anyhow", "enumset", "parking_lot", - "swc_common", + "swc_common 17.0.1", "swc_plugin_runner", "wasmer", "wasmer-compiler-cranelift", @@ -8170,26 +8377,24 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "16.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef02609fd5dc946a13448833f8443173f45ff1477eb7e3683c0abb03018cdf20" +checksum = "b25858a2f1caa93f300f6bc2ba3985d5fe3e774c5b8aa2a63fb5ec0d1b24f1d5" dependencies = [ "better_scoped_tls", - "bytecheck 0.8.1", - "rancor", - "rkyv 0.8.10", + "cbor4ii", "rustc-hash 2.1.1", - "swc_common", - "swc_ecma_ast", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_trace_macro", "tracing", ] [[package]] name = "swc_plugin_runner" -version = "20.0.0" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d593f644b9803819cf40934aa6217aeafc787417eb91434cea7a1ee00bbca2" +checksum = "1d875909ee0360eebf60ed4e3412cecf123bef96d1bc0c4a14cdf44b75b6d276" dependencies = [ "anyhow", "blake3", @@ -8197,9 +8402,9 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms", - "swc_common", - "swc_ecma_ast", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", "swc_plugin_proxy", "swc_transform_common", "tracing", @@ -8208,19 +8413,19 @@ dependencies = [ [[package]] name = "swc_relay" -version = "0.73.0" +version = "0.75.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82d6f54d53eb65b910f757f212053d891416c403dfd013dc2278d68ff29b6d0" +checksum = "6d831bbee3b1d8a4d574c6efdbcb1966d1621c5eb68b730bf14ca26cf600d0a0" dependencies = [ "once_cell", "regex", "serde", "serde_json", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_atoms 9.0.0", + "swc_common 17.0.1", + "swc_ecma_ast 18.0.0", + "swc_ecma_utils 24.0.0", + "swc_ecma_visit 18.0.1", "tracing", ] @@ -8264,30 +8469,14 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "9.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0ccbb3fe8a93a2bbe6df94c205a0ca909bb8786705031d355904efbb89a2a3" +checksum = "b47c33161dab7f531cc6a9f9bc1c00e485ff9bdee063b35f2195ca97da0a7dd2" dependencies = [ "better_scoped_tls", "rustc-hash 2.1.1", "serde", - "swc_common", -] - -[[package]] -name = "swc_typescript" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef4d6eace0eddb82337005a1fb9330f0eb5940b7f8211d7adeabf89bbe80098" -dependencies = [ - "bitflags 2.9.1", - "petgraph 0.7.1", - "rustc-hash 2.1.1", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_common 17.0.1", ] [[package]] @@ -8468,9 +8657,9 @@ dependencies = [ [[package]] name = "testing" -version = "16.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f0f5f27bd9f0c9429a9330a223bc654804dcd9797f3414a491ac5190bf3cbc" +checksum = "77e633123aa8ec1da20243f9eb885e55666f1182d451d6a5372d879f2f272aad" dependencies = [ "cargo_metadata 0.18.1", "difference", @@ -8480,7 +8669,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_common", + "swc_common 17.0.1", "swc_error_reporters", "testing_macros", "tracing", @@ -8509,7 +8698,6 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "smawk", "unicode-linebreak", "unicode-width 0.1.13", ] @@ -9538,7 +9726,7 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_core", + "swc_core 47.0.7", "tokio", "tracing", "tracing-subscriber", @@ -9607,7 +9795,7 @@ dependencies = [ "serde_bytes", "serde_json", "smallvec", - "swc_core", + "swc_core 47.0.7", "swc_sourcemap", "tokio", "tracing", @@ -9650,7 +9838,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "smallvec", - "swc_core", + "swc_core 47.0.7", "tokio", "tracing", "turbo-rcstr", @@ -9723,7 +9911,7 @@ dependencies = [ "serde_json", "smallvec", "strsim 0.11.1", - "swc_core", + "swc_core 47.0.7", "swc_sourcemap", "tokio", "tracing", @@ -9765,7 +9953,7 @@ dependencies = [ "serde_json", "styled_components", "styled_jsx", - "swc_core", + "swc_core 47.0.7", "swc_emotion", "swc_plugin_backend_wasmer", "swc_relay", @@ -9860,7 +10048,7 @@ dependencies = [ "console-subscriber", "rustc-hash 2.1.1", "serde", - "swc_core", + "swc_core 47.0.7", "tokio", "tracing", "tracing-subscriber", @@ -9964,7 +10152,7 @@ version = "0.1.0" dependencies = [ "anyhow", "parking_lot", - "swc_core", + "swc_core 47.0.7", "turbo-rcstr", "turbo-tasks", "turbopack-core", @@ -10591,7 +10779,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde-wasm-bindgen 0.4.5", "serde_json", - "swc_core", + "swc_core 47.0.7", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -10624,12 +10812,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] @@ -11047,9 +11236,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index e685d439e41fec..3cdc296502dc08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -337,25 +337,25 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } # SWC crates -swc_core = { version = "45.0.1", features = [ +swc_core = { version = "47.0.8", features = [ "ecma_loader_lru", "ecma_loader_parking_lot", "parallel_rayon", ] } -swc_plugin_backend_wasmer = { version = "3.0.0" } -testing = "16.0.0" +swc_plugin_backend_wasmer = { version = "5.0.0" } +testing = "18.0.0" # Keep consistent with preset_env_base through swc_core browserslist-rs = "0.19.0" mdxjs = "1.0.3" -modularize_imports = "0.99.0" -styled_components = "0.127.0" -styled_jsx = "0.103.0" -swc_emotion = "0.103.0" -swc_relay = "0.73.0" -react_remove_properties = "0.53.0" -remove_console = "0.54.0" -preset_env_base = "5.0.0" +modularize_imports = "0.101.0" +styled_components = "0.129.0" +styled_jsx = "0.105.1" +swc_emotion = "0.105.0" +swc_relay = "0.75.0" +react_remove_properties = "0.55.0" +remove_console = "0.56.0" +preset_env_base = "6.0.0" # General Deps diff --git a/crates/napi/src/rspack.rs b/crates/napi/src/rspack.rs index 521b047df6adf6..2cf717913007a4 100644 --- a/crates/napi/src/rspack.rs +++ b/crates/napi/src/rspack.rs @@ -49,9 +49,9 @@ impl Visit for Finder { fn visit_export_named_specifier(&mut self, node: &swc_core::ecma::ast::ExportNamedSpecifier) { let named_export = if let Some(exported) = &node.exported { - exported.atom().clone() + exported.atom().into_owned() } else { - node.orig.atom().clone() + node.orig.atom().into_owned() }; self.named_exports.push(named_export); } @@ -60,7 +60,7 @@ impl Visit for Finder { &mut self, node: &swc_core::ecma::ast::ExportNamespaceSpecifier, ) { - self.named_exports.push(node.name.atom().clone()); + self.named_exports.push(node.name.atom().into_owned()); } } diff --git a/crates/next-api/src/server_actions.rs b/crates/next-api/src/server_actions.rs index 480033600954de..f119bdd26bc6c4 100644 --- a/crates/next-api/src/server_actions.rs +++ b/crates/next-api/src/server_actions.rs @@ -12,8 +12,8 @@ use swc_core::{ common::comments::Comments, ecma::{ ast::{ - Decl, ExportSpecifier, Id, ModuleDecl, ModuleItem, ObjectLit, Program, - PropOrSpread::Prop, + Decl, ExportSpecifier, Id, ModuleDecl, ModuleExportName, ModuleItem, ObjectLit, + Program, PropOrSpread::Prop, }, utils::find_pat_ids, }, @@ -363,20 +363,15 @@ fn all_export_names(program: &Program) -> Vec { for s in decl.specifiers.iter() { match s { ExportSpecifier::Named(named) => { - exports.push( - named - .exported - .as_ref() - .unwrap_or(&named.orig) - .atom() - .clone(), - ); + exports.push(module_export_name_to_atom( + named.exported.as_ref().unwrap_or(&named.orig), + )); } ExportSpecifier::Default(_) => { exports.push(atom!("default")); } ExportSpecifier::Namespace(e) => { - exports.push(e.name.atom().clone()); + exports.push(module_export_name_to_atom(&e.name)); } } } @@ -413,6 +408,13 @@ fn is_turbopack_internal_var(with: &Option>) -> bool { .unwrap_or(false) } +fn module_export_name_to_atom(name: &ModuleExportName) -> Atom { + match name { + ModuleExportName::Ident(ident) => ident.sym.clone(), + ModuleExportName::Str(s) => s.value.to_atom_lossy().into_owned(), + } +} + type HashToLayerNameModule = Vec<(String, (ActionLayer, String, ResolvedVc>))>; /// A mapping of every module which exports a Server Action, with the hashed id diff --git a/crates/next-core/src/next_shared/transforms/next_font.rs b/crates/next-core/src/next_shared/transforms/next_font.rs index b40bcf080ff1c1..e73700636e0940 100644 --- a/crates/next-core/src/next_shared/transforms/next_font.rs +++ b/crates/next-core/src/next_shared/transforms/next_font.rs @@ -2,8 +2,8 @@ use anyhow::Result; use async_trait::async_trait; use next_custom_transforms::transforms::fonts::*; use swc_core::{ - atoms::atom, - ecma::{ast::Program, atoms::Atom, visit::VisitMutWith}, + atoms::{Wtf8Atom, atom}, + ecma::{ast::Program, visit::VisitMutWith}, }; use turbo_tasks::ResolvedVc; use turbopack::module_options::{ModuleRule, ModuleRuleEffect}; @@ -14,10 +14,10 @@ use super::module_rule_match_js_no_url; /// Returns a rule which applies the Next.js font transform. pub fn get_next_font_transform_rule(enable_mdx_rs: bool) -> ModuleRule { let font_loaders = vec![ - atom!("next/font/google"), - atom!("@next/font/google"), - atom!("next/font/local"), - atom!("@next/font/local"), + atom!("next/font/google").into(), + atom!("@next/font/google").into(), + atom!("next/font/local").into(), + atom!("@next/font/local").into(), ]; let transformer = @@ -37,7 +37,7 @@ pub fn get_next_font_transform_rule(enable_mdx_rs: bool) -> ModuleRule { #[derive(Debug)] struct NextJsFont { - font_loaders: Vec, + font_loaders: Vec, } #[async_trait] diff --git a/crates/next-core/src/segment_config.rs b/crates/next-core/src/segment_config.rs index af87e10ffc40a7..6a9927d37c04fa 100644 --- a/crates/next-core/src/segment_config.rs +++ b/crates/next-core/src/segment_config.rs @@ -470,8 +470,11 @@ pub async fn parse_segment_config_from_source( if let ExportSpecifier::Named(named) = specifier { parse( match named.exported.as_ref().unwrap_or(&named.orig) { - ModuleExportName::Ident(ident) => &ident.sym, - ModuleExportName::Str(s) => &*s.value, + ModuleExportName::Ident(ident) => &*ident.sym, + ModuleExportName::Str(s) => &*s + .value + .as_str() + .expect("unpaired unicode surrgate in export name"), }, None, specifier.span(), diff --git a/crates/next-custom-transforms/Cargo.toml b/crates/next-custom-transforms/Cargo.toml index d6a29b386ab772..fb87925ddfca3b 100644 --- a/crates/next-custom-transforms/Cargo.toml +++ b/crates/next-custom-transforms/Cargo.toml @@ -66,6 +66,7 @@ swc_relay = { workspace = true } turbopack-ecmascript-plugins = { workspace = true, optional = true } turbo-rcstr = { workspace = true } urlencoding = { workspace = true } +swc_atoms = "9.0.0" react_remove_properties = { workspace = true } remove_console = { workspace = true } diff --git a/crates/next-custom-transforms/src/chain_transforms.rs b/crates/next-custom-transforms/src/chain_transforms.rs index 0c791ee63179e7..529389d7dda818 100644 --- a/crates/next-custom-transforms/src/chain_transforms.rs +++ b/crates/next-custom-transforms/src/chain_transforms.rs @@ -8,12 +8,12 @@ use serde::Deserialize; use swc_core::{ atoms::Atom, common::{ + FileName, Mark, SourceFile, SourceMap, SyntaxContext, comments::{Comments, NoopComments}, pass::Optional, - FileName, Mark, SourceFile, SourceMap, SyntaxContext, }, ecma::{ - ast::{fn_pass, noop_pass, EsVersion, Pass}, + ast::{EsVersion, Pass, fn_pass, noop_pass}, parser::parse_file_as_module, visit::visit_mut_pass, }, @@ -23,7 +23,7 @@ use crate::{ linter::linter, transforms::{ cjs_finder::contains_cjs, - dynamic::{next_dynamic, NextDynamicMode}, + dynamic::{NextDynamicMode, next_dynamic}, fonts::next_font_loaders, lint_codemod_comments::lint_codemod_comments, react_server_components, diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index 83e4d9aed43c6e..dbd8b59f981b4b 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::atom, - common::{util::take::Take, SyntaxContext, DUMMY_SP}, + atoms::{Wtf8Atom, atom}, + common::{DUMMY_SP, SyntaxContext, util::take::Take}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, - visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, + utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, + visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, }, }; @@ -47,7 +47,7 @@ struct State { imports: FxHashMap, /// `(module_specifier, property): (identifier)` - replaced: FxHashMap<(Atom, Atom), Id>, + replaced: FxHashMap<(Wtf8Atom, Atom), Id>, extra_stmts: Vec, @@ -61,11 +61,11 @@ struct State { #[derive(Debug)] struct ImportRecord { - module_specifier: Atom, + module_specifier: Wtf8Atom, } impl CjsOptimizer { - fn should_rewrite(&self, module_specifier: &Atom) -> Option<&FxHashMap> { + fn should_rewrite(&self, module_specifier: &Wtf8Atom) -> Option<&FxHashMap> { self.packages.get(module_specifier).map(|v| &v.transforms) } } @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![Expr::Lit(Lit::Str( - renamed.clone().into(), - )) - .as_arg()], + args: vec![ + Expr::Lit(Lit::Str(renamed.clone().into())) + .as_arg(), + ], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index 136ae0eeefc9ea..40dc5d526fb707 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{atom, Atom}, - common::{errors::HANDLER, FileName, Span, DUMMY_SP}, + atoms::{Atom, Wtf8Atom, atom}, + common::{DUMMY_SP, FileName, Span, errors::HANDLER}, ecma::{ ast::{ - op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, - Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, + ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, }, - utils::{private_ident, quote_ident, ExprFactory}, - visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, + utils::{ExprFactory, private_ident, quote_ident}, + visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, }, quote, }; @@ -91,7 +91,7 @@ struct NextDynamicPatcher { filename: Arc, dynamic_bindings: Vec, is_next_dynamic_first_arg: bool, - dynamically_imported_specifier: Option<(Atom, Span)>, + dynamically_imported_specifier: Option<(Wtf8Atom, Span)>, state: NextDynamicPatcherState, } @@ -111,7 +111,10 @@ enum NextDynamicPatcherState { #[derive(Debug, Clone, Eq, PartialEq)] enum TurbopackImport { // TODO do we need more variants? server vs client vs dev vs prod? - Import { id_ident: Ident, specifier: Atom }, + Import { + id_ident: Ident, + specifier: Wtf8Atom, + }, } impl Fold for NextDynamicPatcher { @@ -149,7 +152,7 @@ impl Fold for NextDynamicPatcher { } Expr::Tpl(Tpl { exprs, quasis, .. }) if exprs.is_empty() => { self.dynamically_imported_specifier = - Some((quasis[0].raw.clone(), quasis[0].span)); + Some((quasis[0].raw.clone().into(), quasis[0].span)); } _ => {} } @@ -541,7 +544,7 @@ impl NextDynamicPatcher { fn exec_expr_when_resolve_weak_available(expr: &Expr) -> Expr { let undefined_str_literal = Expr::Lit(Lit::Str(Str { span: DUMMY_SP, - value: atom!("undefined"), + value: "undefined".into(), raw: None, })); diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index bdfc46e0016191..a233a74ec4e976 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index c9099efd7cd1ea..912631b9e3c31f 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -1,14 +1,14 @@ use swc_core::{ + atoms::Wtf8Atom, common::errors::HANDLER, ecma::{ ast::*, - atoms::Atom, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; pub struct FontFunctionsCollector<'a> { - pub font_loaders: &'a [Atom], + pub font_loaders: &'a [Wtf8Atom], pub state: &'a mut super::State, } diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index 692b2d54ee95f4..aaef6f15d82278 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ - common::{errors::HANDLER, Spanned, DUMMY_SP}, + atoms::Wtf8Atom, + common::{DUMMY_SP, Spanned, errors::HANDLER}, ecma::{ ast::*, - atoms::Atom, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; @@ -66,9 +66,10 @@ impl FontImportsGenerator<'_> { return Some(ImportDecl { src: Box::new(Str { - value: Atom::from(format!( + value: Wtf8Atom::from(format!( "{}/target.css?{}", - font_function.loader, query_json + font_function.loader.to_string_lossy(), + query_json )), raw: None, span: DUMMY_SP, @@ -223,7 +224,7 @@ fn object_lit_to_json(object_lit: &ObjectLit) -> Value { fn expr_to_json(expr: &Expr) -> Result { match expr { - Expr::Lit(Lit::Str(str)) => Ok(Value::String(String::from(&*str.value))), + Expr::Lit(Lit::Str(str)) => Ok(Value::String(str.value.to_string_lossy().into_owned())), Expr::Lit(Lit::Bool(Bool { value, .. })) => Ok(Value::Bool(*value)), Expr::Lit(Lit::Num(Number { value, .. })) => { Ok(Value::Number(serde_json::Number::from_f64(*value).unwrap())) diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index 8fb8156e85486c..9c43c13337cc2b 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -1,11 +1,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ + atoms::Wtf8Atom, common::{BytePos, Spanned}, ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, + visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, }, }; @@ -16,8 +17,8 @@ mod font_imports_generator; #[derive(Clone, Debug, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Config { - pub font_loaders: Vec, - pub relative_file_path_from_root: Atom, + pub font_loaders: Vec, + pub relative_file_path_from_root: Wtf8Atom, } pub fn next_font_loaders(config: Config) -> impl Pass + VisitMut { @@ -31,7 +32,7 @@ pub fn next_font_loaders(config: Config) -> impl Pass + VisitMut { #[derive(Debug)] pub struct FontFunction { - loader: Atom, + loader: Wtf8Atom, function_name: Option, } #[derive(Debug, Default)] @@ -63,7 +64,7 @@ impl VisitMut for NextFontLoaders { // Generate imports from font function calls let mut import_generator = font_imports_generator::FontImportsGenerator { state: &mut self.state, - relative_path: &self.config.relative_file_path_from_root, + relative_path: &self.config.relative_file_path_from_root.to_string_lossy(), }; items.visit_with(&mut import_generator); diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index e129cb0839545e..3e2b1d6cb0f06c 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,28 +1,28 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, Wtf8Atom, atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Module, ModuleExportName, }, - visit::{noop_visit_type, Visit, VisitWith}, + visit::{Visit, VisitWith, noop_visit_type}, }, }; #[derive(Debug, Default)] pub(crate) struct ImportMap { /// Map from module name to (module path, exported symbol) - imports: FxHashMap, + imports: FxHashMap, - namespace_imports: FxHashMap, + namespace_imports: FxHashMap, - imported_modules: FxHashSet, + imported_modules: FxHashSet, } #[allow(unused)] impl ImportMap { - pub fn is_module_imported(&mut self, module: &Atom) -> bool { + pub fn is_module_imported(&mut self, module: &Wtf8Atom) -> bool { self.imported_modules.contains(module) } @@ -99,6 +99,6 @@ impl Visit for Analyzer<'_> { fn orig_name(n: &ModuleExportName) -> Atom { match n { ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone(), + ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), } } diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index d690460c993e2e..783310f3ae4d3b 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,7 +5,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; @@ -31,7 +31,11 @@ impl Fold for NamedImportTransform { // Match named imports and check if it's included in the packages let src_value = decl.src.value.clone(); - if self.packages.iter().any(|p| src_value == *p) { + if self + .packages + .iter() + .any(|p| src_value.as_str() == Some(&**p)) + { let mut specifier_names = HashSet::new(); // Skip the transform if the default or namespace import is present @@ -47,7 +51,8 @@ impl Fold for NamedImportTransform { specifier_names.insert(ident.sym.to_string()); } ModuleExportName::Str(str_) => { - specifier_names.insert(str_.value.to_string()); + specifier_names + .insert(str_.value.to_string_lossy().into_owned()); } } } else { @@ -73,7 +78,7 @@ impl Fold for NamedImportTransform { let new_src = format!( "__barrel_optimize__?names={}!=!{}", names.join(","), - src_value + src_value.to_string_lossy() ); // Create a new import declaration, keep everything the same except the source diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 2ce396c4849a5c..9cba705cd84e60 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{bail, Error}; +use easy_error::{Error, bail}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass, noop_fold_type}, }, }; @@ -383,12 +383,12 @@ impl Fold for NextSsg { if self.state.is_server_props // filter out non-packages import // third part packages must start with `a-z` or `@` - && import_src.starts_with(|c: char| c.is_ascii_lowercase() || c == '@') + && import_src.as_str().unwrap_or_default().starts_with(|c: char| c.is_ascii_lowercase() || c == '@') { self.state .eliminated_packages .borrow_mut() - .insert(import_src.clone()); + .insert(import_src.clone().to_atom_lossy().into_owned()); } tracing::trace!( "Dropping import `{}{:?}` because it should be removed", diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 2b6b6bb4f1124b..91ee9d8c802990 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -1,13 +1,14 @@ use std::collections::HashMap; use serde::Deserialize; +use swc_atoms::Wtf8Atom; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; @@ -47,7 +48,9 @@ impl Fold for OptimizeBarrel { match &s.imported { Some(n) => match &n { ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => n.value.clone(), + ModuleExportName::Str(n) => { + n.value.clone().to_atom_lossy().into_owned() + } }, None => s.local.sym.clone(), }, @@ -94,7 +97,9 @@ impl Fold for OptimizeBarrel { ExportSpecifier::Namespace(s) => { let name_str = match &s.name { ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => n.value.clone(), + ModuleExportName::Str(n) => { + n.value.clone().to_atom_lossy().into_owned() + } }; if let Some(src) = &export_named.src { export_map.push(( @@ -105,7 +110,7 @@ impl Fold for OptimizeBarrel { } else if self.wildcard { export_map.push(( name_str.clone(), - Atom::default(), + Wtf8Atom::default(), atom!("*"), )); } else { @@ -116,12 +121,16 @@ impl Fold for OptimizeBarrel { ExportSpecifier::Named(s) => { let orig_str = match &s.orig { ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => n.value.clone(), + ModuleExportName::Str(n) => { + n.value.clone().to_atom_lossy().into_owned() + } }; let name_str = match &s.exported { Some(n) => match &n { ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => n.value.clone(), + ModuleExportName::Str(n) => { + n.value.clone().to_atom_lossy().into_owned() + } }, None => orig_str.clone(), }; @@ -143,7 +152,7 @@ impl Fold for OptimizeBarrel { } else if self.wildcard { export_map.push(( name_str.clone(), - Atom::default(), + Wtf8Atom::default(), orig_str.clone(), )); } else { @@ -161,7 +170,8 @@ impl Fold for OptimizeBarrel { } } ModuleDecl::ExportAll(export_all) => { - export_wildcards.push(export_all.src.value.to_string()); + export_wildcards + .push(export_all.src.value.to_string_lossy().into_owned()); } ModuleDecl::ExportDecl(export_decl) => { // Export declarations are not allowed in barrel files. @@ -174,21 +184,21 @@ impl Fold for OptimizeBarrel { Decl::Class(class) => { export_map.push(( class.ident.sym.clone(), - Atom::default(), + Wtf8Atom::default(), Atom::default(), )); } Decl::Fn(func) => { export_map.push(( func.ident.sym.clone(), - Atom::default(), + Wtf8Atom::default(), Atom::default(), )); } Decl::Var(var) => { let ids = collect_idents_in_var_decls(&var.decls); for id in ids { - export_map.push((id, Atom::default(), Atom::default())); + export_map.push((id, Wtf8Atom::default(), Atom::default())); } } _ => {} @@ -208,7 +218,7 @@ impl Fold for OptimizeBarrel { Expr::Lit(l) => { if let Lit::Str(s) = l { if allowed_directives && s.value.starts_with("use ") { - directives.push(s.value.to_string()); + directives.push(s.value.to_string_lossy().into_owned()); } } else { allowed_directives = false; diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index f801120888a8d4..e985b69b7911bb 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -8,7 +8,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass}, }, }; @@ -109,7 +109,7 @@ impl Fold for OptimizeServerReact { let name = match &named_import.imported { Some(n) => match &n { ModuleExportName::Ident(n) => n.sym.to_string(), - ModuleExportName::Str(n) => n.value.to_string(), + ModuleExportName::Str(n) => n.value.to_string_lossy().into_owned(), }, None => named_import.local.sym.to_string(), }; diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index 767c668b23ddfe..d77279913f641f 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,19 +11,19 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, - FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, + utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, visit::{ - noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, - VisitWith, + Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, + visit_mut_pass, }, }, }; @@ -470,7 +470,7 @@ fn collect_module_info( type_only: false, .. }, )) => { - let source = import.src.value.clone(); + let source = import.src.value.clone().to_atom_lossy().into_owned(); let specifiers = import .specifiers .iter() @@ -487,7 +487,9 @@ fn collect_module_info( ImportSpecifier::Named(named) => match &named.imported { Some(imported) => match &imported { ModuleExportName::Ident(i) => (i.to_id().0, i.span), - ModuleExportName::Str(s) => (s.value.clone(), s.span), + ModuleExportName::Str(s) => { + (s.value.clone().to_atom_lossy().into_owned(), s.span) + } }, None => (named.local.to_id().0, named.local.span), }, @@ -512,11 +514,15 @@ fn collect_module_info( ExportSpecifier::Named(named) => match &named.exported { Some(exported) => match &exported { ModuleExportName::Ident(i) => i.sym.clone(), - ModuleExportName::Str(s) => s.value.clone(), + ModuleExportName::Str(s) => { + s.value.clone().to_atom_lossy().into_owned() + } }, _ => match &named.orig { ModuleExportName::Ident(i) => i.sym.clone(), - ModuleExportName::Str(s) => s.value.clone(), + ModuleExportName::Str(s) => { + s.value.clone().to_atom_lossy().into_owned() + } }, }, }) @@ -905,7 +911,10 @@ impl ReactServerComponentValidator { collect_possibly_invalid_exports(&i.sym, &named.span); } ModuleExportName::Str(s) => { - collect_possibly_invalid_exports(&s.value, &named.span); + collect_possibly_invalid_exports( + &s.value.to_atom_lossy().into_owned(), + &named.span, + ); } } } diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index e232172b1a898e..569cafaae4fdb4 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -1528,10 +1528,18 @@ impl VisitMut for ServerActions { self.server_reference_exports.push( ServerReferenceExport { ident: ident.clone(), - export_name: str.value.clone(), + export_name: str + .value + .clone() + .to_atom_lossy() + .into_owned(), reference_id: self .generate_server_reference_id( - str.value.as_ref(), + str.value + .clone() + .to_atom_lossy() + .into_owned() + .as_ref(), in_cache_file, None, ), @@ -1828,7 +1836,7 @@ impl VisitMut for ServerActions { ], src: Box::new(Str { span: DUMMY_SP, - value: atom!("private-next-rsc-action-client-wrapper"), + value: "private-next-rsc-action-client-wrapper".into(), raw: None, }), type_only: false, @@ -1965,7 +1973,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: atom!("private-next-rsc-action-validate"), + value: "private-next-rsc-action-validate".into(), raw: None, }), type_only: false, @@ -2016,7 +2024,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: atom!("private-next-rsc-cache-wrapper"), + value: "private-next-rsc-cache-wrapper".into(), raw: None, }), type_only: false, @@ -2059,7 +2067,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: atom!("private-next-rsc-server-reference"), + value: "private-next-rsc-server-reference".into(), raw: None, }), type_only: false, @@ -2828,26 +2836,30 @@ impl DirectiveVisitor<'_> { } else { emit_error(ServerActionsErrorKind::MisplacedDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), location: self.location.clone(), }); } - } else if detect_similar_strings(value, "use server") { + } else if detect_similar_strings( + value.to_string_lossy().into_owned().as_ref(), + "use server", + ) { // Detect typo of "use server" emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), expected_directive: "use server".to_string(), }); } else if value == "use action" { emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), expected_directive: "use server".to_string(), }); } else // `use cache` or `use cache: foo` - if let Some(rest) = value.strip_prefix("use cache") { + if let Some(rest) = value.as_str().and_then(|s| s.strip_prefix("use cache")) + { // Increment telemetry counter tracking usage of "use cache" directives if in_fn_body && !allow_inline { @@ -2863,7 +2875,7 @@ impl DirectiveVisitor<'_> { if !self.config.use_cache_enabled { emit_error(ServerActionsErrorKind::UseCacheWithoutCacheComponents { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), }); } @@ -2878,7 +2890,7 @@ impl DirectiveVisitor<'_> { } if rest.starts_with(": ") { - let cache_kind = RcStr::from(rest.split_at(": ".len()).1); + let cache_kind = RcStr::from(rest.split_at(": ".len()).1.to_string()); if !cache_kind.is_empty() { if !self.config.cache_kinds.contains(&cache_kind) { @@ -2917,7 +2929,7 @@ impl DirectiveVisitor<'_> { emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), expected_directive, }); @@ -2925,16 +2937,19 @@ impl DirectiveVisitor<'_> { } else { emit_error(ServerActionsErrorKind::MisplacedDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), location: self.location.clone(), }); } } else { // Detect typo of "use cache" - if detect_similar_strings(value, "use cache") { + if detect_similar_strings( + value.to_string_lossy().into_owned().as_ref(), + "use cache", + ) { emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, - directive: value.to_string(), + directive: value.to_string_lossy().into_owned(), expected_directive: "use cache".to_string(), }); } @@ -2950,7 +2965,9 @@ impl DirectiveVisitor<'_> { .. }) => { // Match `("use server")`. - if value == "use server" || detect_similar_strings(value, "use server") { + if value == "use server" + || detect_similar_strings(value.as_str().unwrap_or_default(), "use server") + { if self.is_allowed_position { emit_error(ServerActionsErrorKind::WrappedDirective { span: *span, @@ -2963,7 +2980,9 @@ impl DirectiveVisitor<'_> { location: self.location.clone(), }); } - } else if value == "use cache" || detect_similar_strings(value, "use cache") { + } else if value == "use cache" + || detect_similar_strings(value.as_str().unwrap_or_default(), "use cache") + { if self.is_allowed_position { emit_error(ServerActionsErrorKind::WrappedDirective { span: *span, diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index c25368e2f2a94f..cd6a74ed24ce82 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, + visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, }, }; @@ -729,12 +729,12 @@ impl Fold for NextSsg { && matches!(self.state.filter, ExportFilter::StripDataExports) // filter out non-packages import // third part packages must start with `a-z` or `@` - && import_src.starts_with(|c: char| c.is_ascii_lowercase() || c == '@') + && import_src.as_str().unwrap_or_default().starts_with(|c: char| c.is_ascii_lowercase() || c == '@') { self.state .ssr_removed_packages .borrow_mut() - .insert(import_src.clone()); + .insert(import_src.clone().to_atom_lossy().into_owned()); } tracing::trace!( "Dropping import `{}{:?}` because it should be removed", @@ -789,7 +789,7 @@ impl Fold for NextSsg { match &i { ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(e)) if e.specifiers.is_empty() => { - return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP })) + return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP })); } ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(e)) => match &e.decl { Decl::Fn(f) => { diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 2f23c02d3f9d4f..0b900fa433fe70 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -1,12 +1,13 @@ use std::sync::Arc; +use swc_atoms::Wtf8Atom; use swc_core::{ atoms::Atom, - common::{errors::HANDLER, SourceMap, Span}, + common::{SourceMap, Span, errors::HANDLER}, ecma::{ ast::{ - op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, + BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, op, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, @@ -187,7 +188,8 @@ where EmitWarn: Fn(Span, String), EmitError: Fn(Span, String), { - fn warn_if_nodejs_module(&self, span: Span, module_specifier: &str) -> Option<()> { + fn warn_if_nodejs_module(&self, span: Span, module_specifier: &Wtf8Atom) -> Option<()> { + let module_specifier = module_specifier.as_str()?; if self.guarded_runtime { return None; } diff --git a/crates/next-custom-transforms/tests/errors.rs b/crates/next-custom-transforms/tests/errors.rs index 0b98634421f195..9188512d5357d0 100644 --- a/crates/next-custom-transforms/tests/errors.rs +++ b/crates/next-custom-transforms/tests/errors.rs @@ -2,22 +2,21 @@ use std::{iter::FromIterator, path::PathBuf}; use next_custom_transforms::transforms::{ disallow_re_export_all_in_page::disallow_re_export_all_in_page, - dynamic::{next_dynamic, NextDynamicMode}, - fonts::{next_font_loaders, Config as FontLoaderConfig}, + dynamic::{NextDynamicMode, next_dynamic}, + fonts::{Config as FontLoaderConfig, next_font_loaders}, next_ssg::next_ssg, react_server_components::server_components, - server_actions::{self, server_actions, ServerActionsMode}, - strip_page_exports::{next_transform_strip_page_exports, ExportFilter}, + server_actions::{self, ServerActionsMode, server_actions}, + strip_page_exports::{ExportFilter, next_transform_strip_page_exports}, }; use rustc_hash::FxHashSet; use swc_core::{ - atoms::atom, common::{FileName, Mark}, ecma::{ parser::{EsSyntax, Syntax}, transforms::{ base::resolver, - testing::{test_fixture, FixtureTestConfig}, + testing::{FixtureTestConfig, test_fixture}, }, }, }; @@ -135,8 +134,8 @@ fn next_font_loaders_errors(input: PathBuf) { syntax(), &|_tr| { next_font_loaders(FontLoaderConfig { - relative_file_path_from_root: atom!("pages/test.tsx"), - font_loaders: vec![atom!("@next/font/google"), atom!("cool-fonts")], + relative_file_path_from_root: "pages/test.tsx".into(), + font_loaders: vec!["@next/font/google".into(), "cool-fonts".into()], }) }, &input, diff --git a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs index 9fd978d3c81ce1..dcfb1b93de07fc 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs +++ b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs @@ -1,9 +1,6 @@ use anyhow::Result; use async_trait::async_trait; -use swc_core::{ - common::comments::NoopComments, - ecma::{ast::Program, atoms::Atom}, -}; +use swc_core::{atoms::Wtf8Atom, common::comments::NoopComments, ecma::ast::Program}; use turbo_tasks::{ValueDefault, Vc}; use turbopack_ecmascript::{CustomTransformer, TransformContext}; @@ -71,7 +68,7 @@ impl StyledComponentsTransformer { if !top_level_import_paths.is_empty() { options.top_level_import_paths = top_level_import_paths .iter() - .map(|s| Atom::from(s.clone())) + .map(|s| Wtf8Atom::from(s.clone())) .collect(); } let meaningless_file_names = &config.meaningless_file_names; diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs index 11b2bf80c9e593..22d1ca5a1ddec3 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs @@ -406,7 +406,7 @@ impl EvalContext { fn eval_prop_name(&self, prop: &PropName) -> JsValue { match prop { PropName::Ident(ident) => ident.sym.clone().into(), - PropName::Str(str) => str.value.clone().into(), + PropName::Str(str) => str.value.clone().to_atom_lossy().into_owned().into(), PropName::Num(num) => num.value.into(), PropName::Computed(ComputedPropName { expr, .. }) => self.eval(expr), PropName::BigInt(bigint) => (*bigint.value.clone()).into(), @@ -440,7 +440,7 @@ impl EvalContext { match &e.cooked { Some(v) => { if !v.is_empty() { - values.push(JsValue::from(v.clone())); + values.push(JsValue::from(v.clone().to_atom_lossy().into_owned())); } } // This is actually unreachable diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs index 11dc6d364b2723..eb02f30fce9e67 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs @@ -1,8 +1,9 @@ -use std::{collections::BTreeMap, fmt::Display}; +use std::{borrow::Cow, collections::BTreeMap, fmt::Display}; use once_cell::sync::Lazy; use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ + atoms::Wtf8Atom, common::{BytePos, Span, Spanned, SyntaxContext, comments::Comments, source_map::SmallPos}, ecma::{ ast::*, @@ -63,13 +64,16 @@ impl ImportAnnotations { Some((&kv.key, str)) }) { let key = match key { - PropName::Ident(ident) => ident.sym.as_str(), - PropName::Str(str) => str.value.as_str(), + PropName::Ident(ident) => Cow::Borrowed(ident.sym.as_str()), + PropName::Str(str) => str.value.to_string_lossy(), // the rest are invalid, ignore for now till SWC ast is correct _ => continue, }; - map.insert(key.into(), value.value.as_str().into()); + map.insert( + key.into(), + value.value.to_string_lossy().into_owned().into(), + ); } ImportAnnotations { map } @@ -182,7 +186,7 @@ pub(crate) struct ImportMap { /// The module specifiers of star imports that are accessed dynamically and should be imported /// as a whole. - full_star_imports: FxHashSet, + full_star_imports: FxHashSet, pub(crate) exports: FxHashMap, } @@ -241,7 +245,7 @@ pub(crate) enum ImportedSymbol { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub(crate) struct ImportMapReference { - pub module_path: Atom, + pub module_path: Wtf8Atom, pub imported_symbol: ImportedSymbol, pub annotations: ImportAnnotations, pub issue_source: Option, @@ -360,8 +364,8 @@ impl ImportMap { struct StarImportAnalyzer<'a> { /// The local identifiers of the star imports - candidates: FxIndexMap, - full_star_imports: &'a mut FxHashSet, + candidates: FxIndexMap, + full_star_imports: &'a mut FxHashSet, } impl Visit for StarImportAnalyzer<'_> { @@ -427,7 +431,7 @@ impl Analyzer<'_> { fn ensure_reference( &mut self, span: Span, - module_path: Atom, + module_path: Wtf8Atom, imported_symbol: ImportedSymbol, annotations: ImportAnnotations, ) -> Option { @@ -451,10 +455,10 @@ impl Analyzer<'_> { } } -fn export_as_atom(name: &ModuleExportName) -> &Atom { +fn export_as_atom(name: &'_ ModuleExportName) -> Cow<'_, Atom> { match name { - ModuleExportName::Ident(ident) => &ident.sym, - ModuleExportName::Str(s) => &s.value, + ModuleExportName::Ident(ident) => Cow::Borrowed(&ident.sym), + ModuleExportName::Str(s) => s.value.to_atom_lossy(), } } @@ -580,7 +584,7 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Namespace { - exported: export_as_atom(&n.name).clone(), + exported: export_as_atom(&n.name).clone().into_owned(), }, )); } @@ -597,9 +601,10 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Named { - imported: export_as_atom(&n.orig).clone(), + imported: export_as_atom(&n.orig).clone().into_owned(), exported: export_as_atom(n.exported.as_ref().unwrap_or(&n.orig)) - .clone(), + .clone() + .into_owned(), }, )); } @@ -813,7 +818,7 @@ fn parse_ignore_directive(comments: &dyn Comments, value: Option<&ExprOrSpread>) pub(crate) fn orig_name(n: &ModuleExportName) -> Atom { match n { ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone(), + ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), } } diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs index 83d477bde6e0fb..c44e75c424dcc4 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -15,6 +15,7 @@ use num_bigint::BigInt; use num_traits::identities::Zero; use once_cell::sync::Lazy; use rustc_hash::FxHasher; +use swc_atoms::Wtf8Atom; use swc_core::{ common::Mark, ecma::{ @@ -251,7 +252,9 @@ impl From<&'_ str> for ConstantValue { impl From for ConstantValue { fn from(v: Lit) -> Self { match v { - Lit::Str(v) => ConstantValue::Str(ConstantString::Atom(v.value)), + Lit::Str(v) => { + ConstantValue::Str(ConstantString::Atom(v.value.to_atom_lossy().into_owned())) + } Lit::Bool(v) => { if v.value { ConstantValue::True @@ -285,7 +288,7 @@ impl Display for ConstantValue { #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct ModuleValue { - pub module: Atom, + pub module: Wtf8Atom, pub annotations: ImportAnnotations, } @@ -567,7 +570,7 @@ impl From for JsValue { impl From for JsValue { fn from(v: swc_core::ecma::ast::Str) -> Self { - ConstantValue::Str(v.value.into()).into() + ConstantValue::Str(ConstantString::Atom(v.value.to_atom_lossy().into_owned())).into() } } @@ -787,7 +790,7 @@ impl Display for JsValue { module: name, annotations, }) => { - write!(f, "Module({name}, {annotations})") + write!(f, "Module({}, {annotations})", name.to_string_lossy()) } JsValue::Unknown { .. } => write!(f, "???"), JsValue::WellKnownObject(obj) => write!(f, "WellKnownObject({obj:?})"), @@ -1713,7 +1716,7 @@ impl JsValue { module: name, annotations, }) => { - format!("module<{name}, {annotations}>") + format!("module<{}, {annotations}>", name.to_string_lossy()) } JsValue::Unknown { original_value: inner, @@ -2117,7 +2120,7 @@ impl JsValue { let first_str: &str = first_str; if var_graph .free_var_ids - .get(&first_str.into()) + .get(&Atom::from(first_str)) .is_some_and(|id| var_graph.values.contains_key(id)) { // `typeof foo...` but `foo` was reassigned @@ -3702,7 +3705,7 @@ pub mod test_utils { ) => match &args[0] { JsValue::Constant(ConstantValue::Str(v)) => { JsValue::promise(JsValue::Module(ModuleValue { - module: v.as_atom().into_owned(), + module: v.as_atom().into_owned().into(), annotations: ImportAnnotations::default(), })) } diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/well_known.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/well_known.rs index 363dd732140977..e4143f58071215 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/well_known.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/well_known.rs @@ -347,7 +347,7 @@ pub fn import(args: Vec) -> JsValue { match &args[..] { [JsValue::Constant(ConstantValue::Str(v))] => { JsValue::promise(JsValue::Module(ModuleValue { - module: v.as_atom().into_owned(), + module: v.as_atom().into_owned().into(), annotations: ImportAnnotations::default(), })) } diff --git a/turbopack/crates/turbopack-ecmascript/src/path_visitor.rs b/turbopack/crates/turbopack-ecmascript/src/path_visitor.rs index c32b6ba0b66612..bd23251c7ebf0b 100644 --- a/turbopack/crates/turbopack-ecmascript/src/path_visitor.rs +++ b/turbopack/crates/turbopack-ecmascript/src/path_visitor.rs @@ -199,7 +199,7 @@ mod tests { impl AstModifier for StrReplacer<'_> { fn visit_mut_str(&self, s: &mut Str) { - s.value = s.value.replace(self.from, self.to).into(); + s.value = s.value.to_string_lossy().replace(self.from, self.to).into(); s.raw = None; } } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs index e2d48246a7c5a9..9337f55ec85313 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs @@ -755,7 +755,7 @@ async fn analyze_ecmascript_module_internal( let mut should_add_evaluation = false; let reference = EsmAssetReference::new( origin, - RcStr::from(&*r.module_path), + RcStr::from(&*r.module_path.to_string_lossy()), r.issue_source .unwrap_or_else(|| IssueSource::from_source_only(source)), r.annotations.clone(), @@ -774,7 +774,7 @@ async fn analyze_ecmascript_module_internal( "Internal imports only exist in reexports only mode when \ importing {:?} from {}", r.imported_symbol, - r.module_path + r.module_path.to_string_lossy() ); } if matches!(&r.imported_symbol, ImportedSymbol::PartEvaluation(_)) { @@ -3454,7 +3454,9 @@ impl StaticAnalyser { fn evaluate_expr(&self, expr: &Expr) -> StaticExpr { match expr { - Expr::Lit(Lit::Str(str)) => StaticExpr::String(str.value.to_string()), + Expr::Lit(Lit::Str(str)) => { + StaticExpr::String(str.value.to_string_lossy().into_owned()) + } Expr::Ident(ident) => { let str = ident.sym.to_string(); match self.imports.get(&str) { @@ -3761,7 +3763,7 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> { ast_path: &mut AstNodePath>, ) { let path = as_parent_path(ast_path).into(); - let src = import.src.value.to_string(); + let src = import.src.value.to_string_lossy().into_owned(); import.visit_children_with_ast_path(self, ast_path); if import.type_only { return; @@ -3776,7 +3778,9 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> { src.clone(), vec![match &named.imported { Some(ModuleExportName::Ident(ident)) => ident.sym.to_string(), - Some(ModuleExportName::Str(str)) => str.value.to_string(), + Some(ModuleExportName::Str(str)) => { + str.value.to_string_lossy().into_owned() + } None => named.local.sym.to_string(), }], ), @@ -3816,7 +3820,8 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> { && let [ExprOrSpread { spread: None, expr }] = &call.args[..] && let Some(Lit::Str(str)) = expr.as_lit() { - self.webpack_runtime = Some((str.value.as_str().into(), call.span)); + self.webpack_runtime = + Some((str.value.to_string_lossy().into_owned().into(), call.span)); return; } decl.visit_children_with_ast_path(self, ast_path); diff --git a/turbopack/crates/turbopack-ecmascript/src/references/unreachable.rs b/turbopack/crates/turbopack-ecmascript/src/references/unreachable.rs index 805d51d1509535..087375d6ac9325 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/unreachable.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/unreachable.rs @@ -54,7 +54,7 @@ impl AstModifier for UnreachableModifier { *node = Expr::Lit(Lit::Str(Str { span, - value: unreachable_atom(), + value: unreachable_atom().into(), raw: None, })); } diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs index 9d4b235e84516c..fc2adaf91e6882 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -954,7 +954,7 @@ impl DepGraph { local = local.into_private(); } - exports.push((local.to_id(), exported.atom().clone())); + exports.push((local.to_id(), exported.atom().into_owned())); if let Some(src) = &item.src { let id = ItemId::Item { @@ -1688,10 +1688,12 @@ pub(crate) fn find_turbopack_part_id_in_asserts(asserts: &ObjectLit) -> Option

match &*s.value { + })) if &*key.sym == ASSERT_CHUNK_KEY => match s.value.as_str()? { "module evaluation" => Some(PartId::ModuleEvaluation), "exports" => Some(PartId::Exports), - _ if s.value.starts_with("export ") => Some(PartId::Export(s.value[7..].into())), + _ if s.value.starts_with("export ") => { + Some(PartId::Export(s.value.as_str()?[7..].into())) + } _ => None, }, _ => None, diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs index a9457f7c4bcfe4..5bb897f14f167d 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs @@ -1,16 +1,14 @@ use anyhow::Error; use rustc_hash::FxHashSet; -use swc_core::ecma::{ - ast::{Module, ModuleDecl, ModuleItem}, - atoms::Atom, -}; +use swc_atoms::Wtf8Atom; +use swc_core::ecma::ast::{Module, ModuleDecl, ModuleItem}; use super::{PartId, graph::find_turbopack_part_id_in_asserts}; /// A loader used to merge module items after splitting. pub trait Load { /// Loads a module while returning [None] if the module is already loaded. - fn load(&mut self, uri: &str, part_id: u32) -> Result, Error>; + fn load(&mut self, uri: &Wtf8Atom, part_id: u32) -> Result, Error>; } /// A module merger. @@ -22,7 +20,7 @@ where { loader: L, - done: FxHashSet<(Atom, u32)>, + done: FxHashSet<(Wtf8Atom, u32)>, } impl Merger diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs index 31f975d757a682..b664e165798369 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs @@ -2,6 +2,7 @@ use std::{collections::BTreeMap, fmt::Write, hash::Hash, path::PathBuf, sync::Ar use anyhow::Error; use serde::Deserialize; +use swc_atoms::Wtf8Atom; use swc_core::{ atoms::atom, common::{Mark, SourceMap, SyntaxContext, comments::SingleThreadedComments, util::take::Take}, @@ -175,7 +176,7 @@ fn run(input: PathBuf) { ) .unwrap(); - let uri_of_module = atom!("entry.js"); + let uri_of_module = atom!("entry.js").into(); let mut describe = |is_debug: bool, title: &str, entries: Vec, skip_parts: bool| { @@ -263,12 +264,12 @@ fn run(input: PathBuf) { } struct SingleModuleLoader<'a> { - entry_module_uri: &'a str, + entry_module_uri: &'a Wtf8Atom, modules: &'a [Module], } impl super::merge::Load for SingleModuleLoader<'_> { - fn load(&mut self, uri: &str, chunk_id: u32) -> Result, Error> { + fn load(&mut self, uri: &Wtf8Atom, chunk_id: u32) -> Result, Error> { if self.entry_module_uri == uri { return Ok(Some(self.modules[chunk_id as usize].clone())); } diff --git a/turbopack/crates/turbopack-ecmascript/src/utils.rs b/turbopack/crates/turbopack-ecmascript/src/utils.rs index 4f0b24d6e17492..b2aaace99aff37 100644 --- a/turbopack/crates/turbopack-ecmascript/src/utils.rs +++ b/turbopack/crates/turbopack-ecmascript/src/utils.rs @@ -190,7 +190,7 @@ pub enum AstPathRange { /// Converts a module value (ie an import) to a well known object, /// which we specifically handle. pub fn module_value_to_well_known_object(module_value: &ModuleValue) -> Option { - Some(match &*module_value.module { + Some(match &*module_value.module.as_str()? { "node:path" | "path" => JsValue::WellKnownObject(WellKnownObjectKind::PathModule), "node:fs/promises" | "fs/promises" => { JsValue::WellKnownObject(WellKnownObjectKind::FsModule) diff --git a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs index 201de6bc63359c..1809adec194bdb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs @@ -89,7 +89,7 @@ impl ModuleReference for WebpackChunkAssetReference { } => { // TODO determine filename from chunk_request_expr let chunk_id = match &self.chunk_id { - Lit::Str(str) => str.value.to_string(), + Lit::Str(str) => str.value.to_string_lossy().into_owned(), Lit::Num(num) => format!("{num}"), _ => todo!(), }; @@ -112,7 +112,7 @@ impl ValueToString for WebpackChunkAssetReference { #[turbo_tasks::function] fn to_string(&self) -> Vc { let chunk_id = match &self.chunk_id { - Lit::Str(str) => str.value.to_string(), + Lit::Str(str) => str.value.to_string_lossy().into_owned(), Lit::Num(num) => format!("{num}"), _ => todo!(), }; From f49d48d4a00d5259393406bd5a97c2ffc17719ec Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:43:26 +0100 Subject: [PATCH 02/25] Bump mdxjs-rs --- Cargo.lock | 780 +++++++++++++++++++---------------------------------- 1 file changed, 277 insertions(+), 503 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72a421901545b6..b330c47f7f4997 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,17 +317,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "ast_node" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4902c7f39335a2390500ee791d6cb1778e742c7b97952497ec81449a5bfa3a7" -dependencies = [ - "quote", - "swc_macros_common", - "syn 2.0.104", -] - [[package]] name = "ast_node" version = "5.0.0" @@ -616,10 +605,10 @@ dependencies = [ "serde", "serde-wasm-bindgen 0.6.5", "swc", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_common", + "swc_ecma_ast", "swc_ecma_transforms", - "swc_ecma_visit 18.0.1", + "swc_ecma_visit", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -2322,16 +2311,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "from_variant" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308530a56b099da144ebc5d8e179f343ad928fa2b3558d1eb3db9af18d6eff43" -dependencies = [ - "swc_macros_common", - "syn 2.0.104", -] - [[package]] name = "from_variant" version = "3.0.0" @@ -2769,19 +2748,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hstr" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f11d91d7befd2ffd9d216e9e5ea1fae6174b20a2a1b67a688138003d2f4122" -dependencies = [ - "hashbrown 0.14.5", - "new_debug_unreachable", - "once_cell", - "rustc-hash 2.1.1", - "triomphe 0.1.13", -] - [[package]] name = "hstr" version = "3.0.3" @@ -3959,12 +3925,12 @@ dependencies = [ [[package]] name = "mdxjs" version = "1.0.4" -source = "git+https://github.com/mischnic/mdxjs-rs.git?branch=swc-core-32#cbeff4d812882805e581aa8245f0189090ab1336" +source = "git+https://github.com/mischnic/mdxjs-rs.git?branch=swc-core-32#2ea3e2e484e4983e8ee2f2054a5772880e8fc38d" dependencies = [ "markdown", "rustc-hash 2.1.1", "serde", - "swc_core 45.0.2", + "swc_core", ] [[package]] @@ -4142,11 +4108,11 @@ dependencies = [ "once_cell", "regex", "serde", - "swc_atoms 9.0.0", + "swc_atoms", "swc_cached", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", ] [[package]] @@ -4300,7 +4266,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_core 47.0.7", + "swc_core", "tempfile", "tokio", "tracing", @@ -4342,7 +4308,7 @@ dependencies = [ "num_cpus", "rand 0.9.0", "serde_json", - "swc_core 47.0.7", + "swc_core", "tokio", "tokio-stream", "tracing", @@ -4382,7 +4348,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "swc_core 47.0.7", + "swc_core", "swc_sourcemap", "thiserror 1.0.69", "tracing", @@ -4433,8 +4399,8 @@ dependencies = [ "sha1", "styled_components", "styled_jsx", - "swc_atoms 9.0.0", - "swc_core 47.0.7", + "swc_atoms", + "swc_core", "swc_emotion", "swc_relay", "testing", @@ -4473,7 +4439,7 @@ dependencies = [ "serde", "serde_json", "supports-hyperlinks", - "swc_core 47.0.7", + "swc_core", "terminal_hyperlink", "tokio", "tracing", @@ -5286,7 +5252,7 @@ dependencies = [ "anyhow", "browserslist-rs", "dashmap 5.5.3", - "from_variant 3.0.0", + "from_variant", "once_cell", "rustc-hash 2.1.1", "semver", @@ -5764,11 +5730,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "231d29b20b318e992c94ccc729acf46cb0d767ca8d88c16ff3e4eff17f54a370" dependencies = [ "serde", - "swc_atoms 9.0.0", + "swc_atoms", "swc_cached", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", ] [[package]] @@ -5877,11 +5843,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2cd55dd38f1133d0e4d07057b490283eeb7328d06317c3b4075455383422985" dependencies = [ "serde", - "swc_atoms 9.0.0", + "swc_atoms", "swc_cached", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", ] [[package]] @@ -6953,11 +6919,11 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -6974,8 +6940,8 @@ dependencies = [ "preset_env_base", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_css_codegen", "swc_css_compat", @@ -6983,12 +6949,12 @@ dependencies = [ "swc_css_parser", "swc_css_prefixer", "swc_css_visit", - "swc_ecma_ast 18.0.0", + "swc_ecma_ast", "swc_ecma_minifier", - "swc_ecma_parser 27.0.5", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_plugin_macro", "tracing", ] @@ -7026,23 +6992,23 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_compiler_base", "swc_config", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", + "swc_ecma_ast", + "swc_ecma_codegen", "swc_ecma_ext_transforms", "swc_ecma_loader", "swc_ecma_minifier", - "swc_ecma_parser 27.0.5", + "swc_ecma_parser", "swc_ecma_preset_env", "swc_ecma_transforms", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_transforms_base", "swc_ecma_transforms_compat", "swc_ecma_transforms_optimization", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_error_reporters", "swc_node_comments", "swc_plugin_backend_wasmer", @@ -7065,7 +7031,7 @@ dependencies = [ "clap", "owo-colors", "regex", - "swc_core 47.0.7", + "swc_core", ] [[package]] @@ -7080,17 +7046,6 @@ dependencies = [ "rustc-hash 2.1.1", ] -[[package]] -name = "swc_atoms" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3500dcf04c84606b38464561edc5e46f5132201cb3e23cf9613ed4033d6b1bb2" -dependencies = [ - "hstr 2.1.0", - "once_cell", - "serde", -] - [[package]] name = "swc_atoms" version = "9.0.0" @@ -7099,7 +7054,7 @@ checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a" dependencies = [ "bytecheck 0.8.1", "cbor4ii", - "hstr 3.0.3", + "hstr", "once_cell", "rancor", "rkyv 0.8.10", @@ -7121,32 +7076,6 @@ dependencies = [ "serde", ] -[[package]] -name = "swc_common" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13be0317490fc330a53ee9e64b26891503c35336b509eb69c4fc1dc4e0119ff9" -dependencies = [ - "anyhow", - "ast_node 4.0.0", - "better_scoped_tls", - "bytes-str", - "either", - "from_variant 2.0.2", - "new_debug_unreachable", - "num-bigint", - "once_cell", - "rustc-hash 2.1.1", - "serde", - "siphasher", - "swc_atoms 7.0.0", - "swc_eq_ignore_macros", - "swc_visit", - "tracing", - "unicode-width 0.1.13", - "url", -] - [[package]] name = "swc_common" version = "17.0.1" @@ -7154,13 +7083,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "259b675d633a26d24efe3802a9d88858c918e6e8f062d3222d3aa02d56a2cf4c" dependencies = [ "anyhow", - "ast_node 5.0.0", + "ast_node", "better_scoped_tls", "bytecheck 0.8.1", "bytes-str", "cbor4ii", "either", - "from_variant 3.0.0", + "from_variant", "new_debug_unreachable", "num-bigint", "once_cell", @@ -7171,7 +7100,7 @@ dependencies = [ "serde", "shrink-to-fit", "siphasher", - "swc_atoms 9.0.0", + "swc_atoms", "swc_eq_ignore_macros", "swc_sourcemap", "swc_visit", @@ -7195,14 +7124,14 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", + "swc_ecma_ast", + "swc_ecma_codegen", "swc_ecma_minifier", - "swc_ecma_parser 27.0.5", - "swc_ecma_visit 18.0.1", + "swc_ecma_parser", + "swc_ecma_visit", "swc_sourcemap", "swc_timer", ] @@ -7240,23 +7169,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "swc_core" -version = "45.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e3f7a14efb82fd970b90afb1fc1afe34d969ad4b2adc4a63803cfc95249f08" -dependencies = [ - "swc_allocator", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_ecma_codegen 18.0.0", - "swc_ecma_parser 25.0.0", - "swc_ecma_transforms_base 28.0.1", - "swc_ecma_visit 16.0.0", - "vergen", -] - [[package]] name = "swc_core" version = "47.0.8" @@ -7267,25 +7179,25 @@ dependencies = [ "par-core", "swc", "swc_allocator", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen", "swc_ecma_lints", "swc_ecma_loader", "swc_ecma_minifier", - "swc_ecma_parser 27.0.5", + "swc_ecma_parser", "swc_ecma_preset_env", "swc_ecma_quote_macros", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_transforms_base", "swc_ecma_transforms_module", "swc_ecma_transforms_optimization", "swc_ecma_transforms_proposal", "swc_ecma_transforms_react", "swc_ecma_transforms_testing", "swc_ecma_transforms_typescript", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_plugin_proxy", "swc_plugin_runner", "testing", @@ -7300,8 +7212,8 @@ checksum = "c556ef58d7a318b4388c3d90e78a43f993a83eb458b95520f00727480e8b2f16" dependencies = [ "is-macro", "string_enum", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", ] [[package]] @@ -7314,8 +7226,8 @@ dependencies = [ "bitflags 2.9.1", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_css_codegen_macros", "swc_css_utils", @@ -7339,8 +7251,8 @@ checksum = "fafd61bfd3a0f764abdcd49b89119a2befa027b1aff701eb10d1968a705e186c" dependencies = [ "bitflags 2.9.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7354,8 +7266,8 @@ checksum = "577704829410febeb5683c710840bb59edd614dc64d8390084e13a02ad35fcfc" dependencies = [ "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7369,8 +7281,8 @@ checksum = "6ea88d8d24b80dff949fd830026cdbc5f534e450ecab2c81251ed71a07c5927d" dependencies = [ "lexical", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", ] @@ -7385,8 +7297,8 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_css_utils", "swc_css_visit", @@ -7402,7 +7314,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", + "swc_atoms", "swc_css_ast", "swc_css_visit", ] @@ -7414,31 +7326,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bbf6cc10351eefef24b16dd2ef778313518a9611e132e57bd0771b113bcd3eb" dependencies = [ "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_css_ast", "swc_visit", ] -[[package]] -name = "swc_ecma_ast" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add9298e06af471f29aea2f8d1b6232885bd2a634521d0e95dc9d5bde3d39d3d" -dependencies = [ - "bitflags 2.9.1", - "is-macro", - "num-bigint", - "once_cell", - "phf", - "rustc-hash 2.1.1", - "string_enum", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_visit", - "unicode-id-start", -] - [[package]] name = "swc_ecma_ast" version = "18.0.0" @@ -7455,36 +7348,12 @@ dependencies = [ "serde", "shrink-to-fit", "string_enum", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_visit", "unicode-id-start", ] -[[package]] -name = "swc_ecma_codegen" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c70760095f23e70a295bc86dd52d454f5de4050621c9e27681ae26d166b77be4" -dependencies = [ - "ascii", - "compact_str", - "memchr", - "num-bigint", - "once_cell", - "regex", - "rustc-hash 2.1.1", - "ryu-js", - "serde", - "swc_allocator", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_ecma_codegen_macros", - "swc_sourcemap", - "tracing", -] - [[package]] name = "swc_ecma_codegen" version = "20.0.0" @@ -7501,9 +7370,9 @@ dependencies = [ "ryu-js", "serde", "swc_allocator", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_ecma_codegen_macros", "swc_sourcemap", "tracing", @@ -7527,13 +7396,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "196ed37b7543d40ed330380c600ef8cb70bc26405dd8885614cc470a7a0d4209" dependencies = [ "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_ecma_compat_es2015", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7544,10 +7413,10 @@ version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b2330d0340d6c59733b6dd7382950d01a55e151e51e312346b0b20f33d1e81" dependencies = [ - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -7563,16 +7432,16 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", + "swc_ecma_ast", "swc_ecma_compat_common", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_transforms_base", "swc_ecma_transforms_classes", "swc_ecma_transforms_macros", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7583,12 +7452,12 @@ version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "834d2646e55f908e57ad45af1c774f0ea9c330f2d9f24f62fbce9ee2a89c350e" dependencies = [ - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", "swc_ecma_transforms_macros", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7600,11 +7469,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "040a793beb2c07a85581ffaf2adc84336ad5f8cf144f74830210f870c52007ef" dependencies = [ "serde", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7616,13 +7485,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9ab1f76516d475f02dcd8ee25687068fb9d61382fb5aef67183a6a6e678fb68" dependencies = [ "serde", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_common", + "swc_ecma_ast", "swc_ecma_compat_common", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_transforms_base", "swc_ecma_transforms_macros", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7633,11 +7502,11 @@ version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a031c85293d82d3d8fccdc13f7ddc07c897ceb209faa8a5286e2daf2e707ae3c" dependencies = [ - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7649,13 +7518,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2be3a3ab318b1995bbab55b952486b6c4d57859f84e214265e5b7cd40bb87d5f" dependencies = [ "serde", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_common", + "swc_ecma_ast", "swc_ecma_compat_es2022", "swc_ecma_compiler", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -7665,10 +7534,10 @@ version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ddc7ea940c8cf69126e5d8d955f917ddce17983af461109fe6604b30fb5641e" dependencies = [ - "swc_ecma_ast 18.0.0", + "swc_ecma_ast", "swc_ecma_compiler", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", + "swc_ecma_transforms_base", + "swc_ecma_utils", "tracing", ] @@ -7679,16 +7548,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78f86e65bce3f8485c777e7893ec1219819f16233cb912d7cb50a4b36032696a" dependencies = [ "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_ecma_compat_common", "swc_ecma_compiler", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_transforms_base", "swc_ecma_transforms_classes", "swc_ecma_transforms_macros", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7699,10 +7568,10 @@ version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53af7d08462be6315e3befb48b0aa0e4a2a40e34238835b5a432fb1a7dff750b" dependencies = [ - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7715,12 +7584,12 @@ checksum = "1ad37749c3906d1046f6790fb79d88cc3ba05e84c8ca39ddef4078a4ee89164c" dependencies = [ "bitflags 2.9.1", "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_trace_macro", "tracing", ] @@ -7732,33 +7601,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88bd60c8f244d33d5d42c518908238dd4f0dc6e0cf74b1ed39b7aff2daab3b9d" dependencies = [ "phf", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", -] - -[[package]] -name = "swc_ecma_lexer" -version = "24.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64b5db3b7cdba77d4063f7a0747333685cfb843fa2260d0c0765eff4bc82d0b" -dependencies = [ - "arrayvec 0.7.6", - "bitflags 2.9.1", - "either", - "num-bigint", - "phf", - "rustc-hash 2.1.1", - "seq-macro", - "serde", - "smallvec", - "smartstring", - "stacker", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "tracing", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -7774,12 +7620,12 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -7799,8 +7645,8 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "tracing", ] @@ -7825,37 +7671,21 @@ dependencies = [ "ryu-js", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", - "swc_ecma_parser 27.0.5", - "swc_ecma_transforms_base 30.0.0", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_parser", + "swc_ecma_transforms_base", "swc_ecma_transforms_optimization", "swc_ecma_usage_analyzer", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_timer", "tracing", ] -[[package]] -name = "swc_ecma_parser" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a43a89976cdbb42f152cfbd89a430b1fb693a9e0f2b5e2b1959466a88c3de0" -dependencies = [ - "either", - "num-bigint", - "serde", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_ecma_lexer", - "tracing", -] - [[package]] name = "swc_ecma_parser" version = "27.0.5" @@ -7871,9 +7701,9 @@ dependencies = [ "serde", "smartstring", "stacker", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "tracing", ] @@ -7893,13 +7723,13 @@ dependencies = [ "serde", "serde_json", "string_enum", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_ecma_compiler", "swc_ecma_transforms", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -7912,10 +7742,10 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_parser 27.0.5", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", "swc_macros_common", "syn 2.0.104", ] @@ -7940,38 +7770,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f61ecb0d5c35287cefbc6b0282ac01c694739da6483abf3913d068ce45a1223" dependencies = [ "par-core", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", "swc_ecma_transforms_compat", "swc_ecma_transforms_module", "swc_ecma_transforms_optimization", "swc_ecma_transforms_proposal", "swc_ecma_transforms_react", "swc_ecma_transforms_typescript", - "swc_ecma_utils 24.0.0", -] - -[[package]] -name = "swc_ecma_transforms_base" -version = "28.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f892bb70d780486b86485493a3c7f4df8d84d5caba7e1d83e2e700836c29d613" -dependencies = [ - "better_scoped_tls", - "indexmap 2.9.0", - "once_cell", - "par-core", - "phf", - "rustc-hash 2.1.1", - "serde", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_ecma_parser 25.0.0", - "swc_ecma_utils 22.0.0", - "swc_ecma_visit 16.0.0", - "tracing", + "swc_ecma_utils", ] [[package]] @@ -7987,12 +7795,12 @@ dependencies = [ "phf", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_parser 27.0.5", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -8002,11 +7810,11 @@ version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3ab35eff4a980e02d708798ae4c35bc017612292adbffe7b7b554df772fdf5" dependencies = [ - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -8018,9 +7826,9 @@ dependencies = [ "indexmap 2.9.0", "par-core", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_ecma_compat_bugfixes", "swc_ecma_compat_common", "swc_ecma_compat_es2015", @@ -8032,9 +7840,9 @@ dependencies = [ "swc_ecma_compat_es2021", "swc_ecma_compat_es2022", "swc_ecma_compat_es3", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -8066,15 +7874,15 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", + "swc_ecma_ast", "swc_ecma_loader", - "swc_ecma_parser 27.0.5", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -8092,13 +7900,13 @@ dependencies = [ "petgraph 0.7.1", "rustc-hash 2.1.1", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_parser 27.0.5", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -8111,13 +7919,13 @@ dependencies = [ "either", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", "swc_ecma_transforms_classes", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -8134,14 +7942,14 @@ dependencies = [ "serde", "sha1", "string_enum", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", "swc_config", - "swc_ecma_ast 18.0.0", - "swc_ecma_parser 27.0.5", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -8157,14 +7965,14 @@ dependencies = [ "serde", "serde_json", "sha2", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", - "swc_ecma_parser 27.0.5", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_parser", "swc_ecma_testing", - "swc_ecma_transforms_base 30.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", "swc_sourcemap", "tempfile", "testing", @@ -8179,13 +7987,13 @@ dependencies = [ "bytes-str", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_transforms_base 30.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", "swc_ecma_transforms_react", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] @@ -8197,34 +8005,15 @@ dependencies = [ "bitflags 2.9.1", "indexmap 2.9.0", "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", "swc_timer", "tracing", ] -[[package]] -name = "swc_ecma_utils" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "110befba503dcec034023f4ad3559b84991c7a4be977287300db9562955bda1d" -dependencies = [ - "indexmap 2.9.0", - "num_cpus", - "once_cell", - "par-core", - "rustc-hash 2.1.1", - "ryu-js", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_ecma_visit 16.0.0", - "tracing", -] - [[package]] name = "swc_ecma_utils" version = "24.0.0" @@ -8237,25 +8026,10 @@ dependencies = [ "par-core", "rustc-hash 2.1.1", "ryu-js", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_visit 18.0.1", - "tracing", -] - -[[package]] -name = "swc_ecma_visit" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8763b91f52a54d5836c1f922dd393b157d47c121c7aab87308f582daf345f77" -dependencies = [ - "new_debug_unreachable", - "num-bigint", - "swc_atoms 7.0.0", - "swc_common 15.0.0", - "swc_ecma_ast 16.0.0", - "swc_visit", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", "tracing", ] @@ -8268,9 +8042,9 @@ dependencies = [ "new_debug_unreachable", "num-bigint", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_visit", "tracing", ] @@ -8289,13 +8063,13 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_codegen 20.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen", "swc_ecma_transforms", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_ecma_utils", + "swc_ecma_visit", "swc_sourcemap", "swc_trace_macro", "tracing", @@ -8322,7 +8096,7 @@ dependencies = [ "miette", "once_cell", "serde", - "swc_common 17.0.1", + "swc_common", ] [[package]] @@ -8344,8 +8118,8 @@ checksum = "614f452f71edf142525dea290ae1faa8a9bcc972888327848297a4785c6628a1" dependencies = [ "dashmap 5.5.3", "rustc-hash 2.1.1", - "swc_atoms 9.0.0", - "swc_common 17.0.1", + "swc_atoms", + "swc_common", ] [[package]] @@ -8357,7 +8131,7 @@ dependencies = [ "anyhow", "enumset", "parking_lot", - "swc_common 17.0.1", + "swc_common", "swc_plugin_runner", "wasmer", "wasmer-compiler-cranelift", @@ -8384,8 +8158,8 @@ dependencies = [ "better_scoped_tls", "cbor4ii", "rustc-hash 2.1.1", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_common", + "swc_ecma_ast", "swc_trace_macro", "tracing", ] @@ -8402,9 +8176,9 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", + "swc_atoms", + "swc_common", + "swc_ecma_ast", "swc_plugin_proxy", "swc_transform_common", "tracing", @@ -8421,11 +8195,11 @@ dependencies = [ "regex", "serde", "serde_json", - "swc_atoms 9.0.0", - "swc_common 17.0.1", - "swc_ecma_ast 18.0.0", - "swc_ecma_utils 24.0.0", - "swc_ecma_visit 18.0.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", "tracing", ] @@ -8476,7 +8250,7 @@ dependencies = [ "better_scoped_tls", "rustc-hash 2.1.1", "serde", - "swc_common 17.0.1", + "swc_common", ] [[package]] @@ -8669,7 +8443,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "swc_common 17.0.1", + "swc_common", "swc_error_reporters", "testing_macros", "tracing", @@ -9726,7 +9500,7 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "serde", - "swc_core 47.0.7", + "swc_core", "tokio", "tracing", "tracing-subscriber", @@ -9795,7 +9569,7 @@ dependencies = [ "serde_bytes", "serde_json", "smallvec", - "swc_core 47.0.7", + "swc_core", "swc_sourcemap", "tokio", "tracing", @@ -9838,7 +9612,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "smallvec", - "swc_core 47.0.7", + "swc_core", "tokio", "tracing", "turbo-rcstr", @@ -9911,7 +9685,7 @@ dependencies = [ "serde_json", "smallvec", "strsim 0.11.1", - "swc_core 47.0.7", + "swc_core", "swc_sourcemap", "tokio", "tracing", @@ -9953,7 +9727,7 @@ dependencies = [ "serde_json", "styled_components", "styled_jsx", - "swc_core 47.0.7", + "swc_core", "swc_emotion", "swc_plugin_backend_wasmer", "swc_relay", @@ -10048,7 +9822,7 @@ dependencies = [ "console-subscriber", "rustc-hash 2.1.1", "serde", - "swc_core 47.0.7", + "swc_core", "tokio", "tracing", "tracing-subscriber", @@ -10152,7 +9926,7 @@ version = "0.1.0" dependencies = [ "anyhow", "parking_lot", - "swc_core 47.0.7", + "swc_core", "turbo-rcstr", "turbo-tasks", "turbopack-core", @@ -10779,7 +10553,7 @@ dependencies = [ "rustc-hash 2.1.1", "serde-wasm-bindgen 0.4.5", "serde_json", - "swc_core 47.0.7", + "swc_core", "wasm-bindgen", "wasm-bindgen-futures", ] From 93a8e3e34a9bcc149996be836aa89eedf3f25b47 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:56:16 +0100 Subject: [PATCH 03/25] fixup --- .../src/transforms/react_server_components.rs | 2 +- .../next-custom-transforms/src/transforms/server_actions.rs | 4 ++-- turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs | 2 +- .../crates/turbopack-ecmascript/src/tree_shake/merge.rs | 6 ++++-- .../crates/turbopack-ecmascript/src/tree_shake/tests.rs | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index d77279913f641f..65a175cc75c2e5 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -912,7 +912,7 @@ impl ReactServerComponentValidator { } ModuleExportName::Str(s) => { collect_possibly_invalid_exports( - &s.value.to_atom_lossy().into_owned(), + &s.value.to_atom_lossy(), &named.span, ); } diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index 569cafaae4fdb4..92d2be210cede0 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -2042,7 +2042,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: atom!("react"), + value: atom!("react").into(), raw: None, }), type_only: false, @@ -2099,7 +2099,7 @@ impl VisitMut for ServerActions { ], src: Box::new(Str { span: DUMMY_SP, - value: atom!("private-next-rsc-action-encryption"), + value: atom!("private-next-rsc-action-encryption").into(), raw: None, }), type_only: false, diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs index c44e75c424dcc4..981086bdd490df 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -15,8 +15,8 @@ use num_bigint::BigInt; use num_traits::identities::Zero; use once_cell::sync::Lazy; use rustc_hash::FxHasher; -use swc_atoms::Wtf8Atom; use swc_core::{ + atoms::Wtf8Atom, common::Mark, ecma::{ ast::{Id, Ident, Lit}, diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs index 5bb897f14f167d..faa9c0a3c0ac4a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/merge.rs @@ -1,7 +1,9 @@ use anyhow::Error; use rustc_hash::FxHashSet; -use swc_atoms::Wtf8Atom; -use swc_core::ecma::ast::{Module, ModuleDecl, ModuleItem}; +use swc_core::{ + atoms::Wtf8Atom, + ecma::ast::{Module, ModuleDecl, ModuleItem}, +}; use super::{PartId, graph::find_turbopack_part_id_in_asserts}; diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs index b664e165798369..5aa0d1f58a357f 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs @@ -2,9 +2,8 @@ use std::{collections::BTreeMap, fmt::Write, hash::Hash, path::PathBuf, sync::Ar use anyhow::Error; use serde::Deserialize; -use swc_atoms::Wtf8Atom; use swc_core::{ - atoms::atom, + atoms::{Wtf8Atom, atom}, common::{Mark, SourceMap, SyntaxContext, comments::SingleThreadedComments, util::take::Take}, ecma::{ ast::{EsVersion, Id, Module}, From 7943c5679475ff4a98a3f71988fa1ded3021beae Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:58:58 +0100 Subject: [PATCH 04/25] fixup --- .../crates/turbopack-ecmascript/src/utils.rs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/utils.rs b/turbopack/crates/turbopack-ecmascript/src/utils.rs index b2aaace99aff37..a8649de3acd737 100644 --- a/turbopack/crates/turbopack-ecmascript/src/utils.rs +++ b/turbopack/crates/turbopack-ecmascript/src/utils.rs @@ -190,38 +190,38 @@ pub enum AstPathRange { /// Converts a module value (ie an import) to a well known object, /// which we specifically handle. pub fn module_value_to_well_known_object(module_value: &ModuleValue) -> Option { - Some(match &*module_value.module.as_str()? { - "node:path" | "path" => JsValue::WellKnownObject(WellKnownObjectKind::PathModule), - "node:fs/promises" | "fs/promises" => { + Some(match module_value.module.as_bytes() { + b"node:path" | b"path" => JsValue::WellKnownObject(WellKnownObjectKind::PathModule), + b"node:fs/promises" | b"fs/promises" => { JsValue::WellKnownObject(WellKnownObjectKind::FsModule) } - "node:fs" | "fs" => JsValue::WellKnownObject(WellKnownObjectKind::FsModule), - "node:child_process" | "child_process" => { + b"node:fs" | b"fs" => JsValue::WellKnownObject(WellKnownObjectKind::FsModule), + b"node:child_process" | b"child_process" => { JsValue::WellKnownObject(WellKnownObjectKind::ChildProcessModule) } - "node:os" | "os" => JsValue::WellKnownObject(WellKnownObjectKind::OsModule), - "node:process" | "process" => { + b"node:os" | b"os" => JsValue::WellKnownObject(WellKnownObjectKind::OsModule), + b"node:process" | b"process" => { JsValue::WellKnownObject(WellKnownObjectKind::NodeProcessModule) } - "node:url" | "url" => JsValue::WellKnownObject(WellKnownObjectKind::UrlModule), - "node:module" | "module" => JsValue::WellKnownObject(WellKnownObjectKind::ModuleModule), - "node:worker_threads" | "worker_threads" => { + b"node:url" | b"url" => JsValue::WellKnownObject(WellKnownObjectKind::UrlModule), + b"node:module" | b"module" => JsValue::WellKnownObject(WellKnownObjectKind::ModuleModule), + b"node:worker_threads" | b"worker_threads" => { JsValue::WellKnownObject(WellKnownObjectKind::WorkerThreadsModule) } - "node-pre-gyp" | "@mapbox/node-pre-gyp" => { + b"node-pre-gyp" | b"@mapbox/node-pre-gyp" => { JsValue::WellKnownObject(WellKnownObjectKind::NodePreGyp) } - "node-gyp-build" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeGypBuild), - "node:bindings" | "bindings" => { + b"node-gyp-build" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeGypBuild), + b"node:bindings" | b"bindings" => { JsValue::WellKnownFunction(WellKnownFunctionKind::NodeBindings) } - "express" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeExpress), - "strong-globalize" => { + b"express" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeExpress), + b"strong-globalize" => { JsValue::WellKnownFunction(WellKnownFunctionKind::NodeStrongGlobalize) } - "resolve-from" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeResolveFrom), - "@grpc/proto-loader" => JsValue::WellKnownObject(WellKnownObjectKind::NodeProtobufLoader), - "fs-extra" => JsValue::WellKnownObject(WellKnownObjectKind::FsExtraModule), + b"resolve-from" => JsValue::WellKnownFunction(WellKnownFunctionKind::NodeResolveFrom), + b"@grpc/proto-loader" => JsValue::WellKnownObject(WellKnownObjectKind::NodeProtobufLoader), + b"fs-extra" => JsValue::WellKnownObject(WellKnownObjectKind::FsExtraModule), _ => return None, }) } From 26b6e7fd7c06b2ff0cd45537b51a41a17880ab83 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:06:48 +0100 Subject: [PATCH 05/25] fixup --- crates/next-core/src/segment_config.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/next-core/src/segment_config.rs b/crates/next-core/src/segment_config.rs index 6a9927d37c04fa..c6065d16804f53 100644 --- a/crates/next-core/src/segment_config.rs +++ b/crates/next-core/src/segment_config.rs @@ -417,7 +417,7 @@ pub async fn parse_segment_config_from_source( ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(decl)) => match &decl.decl { Decl::Class(decl) => { parse( - &decl.ident.sym, + Cow::Borrowed(decl.ident.sym.as_str()), Some(Cow::Owned(Expr::Class(ClassExpr { ident: None, class: decl.class.clone(), @@ -428,7 +428,7 @@ pub async fn parse_segment_config_from_source( } Decl::Fn(decl) => { parse( - &decl.ident.sym, + Cow::Borrowed(decl.ident.sym.as_str()), Some(Cow::Owned(Expr::Fn(FnExpr { ident: None, function: decl.function.clone(), @@ -446,7 +446,7 @@ pub async fn parse_segment_config_from_source( let key = &ident.id.sym; parse( - key, + Cow::Borrowed(key.as_str()), Some( decl.init.as_deref().map(Cow::Borrowed).unwrap_or_else( || Cow::Owned(*Expr::undefined(DUMMY_SP)), @@ -470,11 +470,10 @@ pub async fn parse_segment_config_from_source( if let ExportSpecifier::Named(named) = specifier { parse( match named.exported.as_ref().unwrap_or(&named.orig) { - ModuleExportName::Ident(ident) => &*ident.sym, - ModuleExportName::Str(s) => &*s - .value - .as_str() - .expect("unpaired unicode surrgate in export name"), + ModuleExportName::Ident(ident) => { + Cow::Borrowed(ident.sym.as_str()) + } + ModuleExportName::Str(s) => s.value.to_string_lossy(), }, None, specifier.span(), @@ -563,7 +562,7 @@ async fn parse_config_value( mode: ParseSegmentMode, config: &mut NextSegmentConfig, eval_context: &EvalContext, - key: &str, + key: Cow<'_, str>, init: Option>, span: Span, ) -> Result<()> { @@ -589,7 +588,7 @@ async fn parse_config_value( }) }; - match key { + match &*key { "config" => { let Some(value) = get_value() else { return invalid_config( From aad464abd744880d84fe11f88728c1f61b277b83 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:12:17 +0100 Subject: [PATCH 06/25] fix --- .../src/chain_transforms.rs | 6 +++--- .../src/transforms/cjs_optimizer.rs | 16 ++++++++-------- .../src/transforms/dynamic.rs | 14 +++++++------- .../fonts/find_functions_outside_module_scope.rs | 2 +- .../transforms/fonts/font_functions_collector.rs | 2 +- .../transforms/fonts/font_imports_generator.rs | 4 ++-- .../src/transforms/fonts/mod.rs | 2 +- .../src/transforms/import_analyzer.rs | 4 ++-- .../src/transforms/named_import_transform.rs | 2 +- .../src/transforms/next_ssg.rs | 8 ++++---- .../src/transforms/optimize_barrel.rs | 4 ++-- .../src/transforms/optimize_server_react.rs | 2 +- .../src/transforms/react_server_components.rs | 10 +++++----- .../src/transforms/strip_page_exports.rs | 4 ++-- .../src/transforms/warn_for_edge_runtime.rs | 6 +++--- crates/next-custom-transforms/tests/errors.rs | 10 +++++----- 16 files changed, 48 insertions(+), 48 deletions(-) diff --git a/crates/next-custom-transforms/src/chain_transforms.rs b/crates/next-custom-transforms/src/chain_transforms.rs index 529389d7dda818..0c791ee63179e7 100644 --- a/crates/next-custom-transforms/src/chain_transforms.rs +++ b/crates/next-custom-transforms/src/chain_transforms.rs @@ -8,12 +8,12 @@ use serde::Deserialize; use swc_core::{ atoms::Atom, common::{ - FileName, Mark, SourceFile, SourceMap, SyntaxContext, comments::{Comments, NoopComments}, pass::Optional, + FileName, Mark, SourceFile, SourceMap, SyntaxContext, }, ecma::{ - ast::{EsVersion, Pass, fn_pass, noop_pass}, + ast::{fn_pass, noop_pass, EsVersion, Pass}, parser::parse_file_as_module, visit::visit_mut_pass, }, @@ -23,7 +23,7 @@ use crate::{ linter::linter, transforms::{ cjs_finder::contains_cjs, - dynamic::{NextDynamicMode, next_dynamic}, + dynamic::{next_dynamic, NextDynamicMode}, fonts::next_font_loaders, lint_codemod_comments::lint_codemod_comments, react_server_components, diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index dbd8b59f981b4b..1ce7d0ded12912 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::{Wtf8Atom, atom}, - common::{DUMMY_SP, SyntaxContext, util::take::Take}, + atoms::{atom, Wtf8Atom}, + common::{util::take::Take, SyntaxContext, DUMMY_SP}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, - visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, + utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, + visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, }, }; @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![ - Expr::Lit(Lit::Str(renamed.clone().into())) - .as_arg(), - ], + args: vec![Expr::Lit(Lit::Str( + renamed.clone().into(), + )) + .as_arg()], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index 40dc5d526fb707..7e49aef9ba0557 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, - common::{DUMMY_SP, FileName, Span, errors::HANDLER}, + atoms::{atom, Atom, Wtf8Atom}, + common::{errors::HANDLER, FileName, Span, DUMMY_SP}, ecma::{ ast::{ - ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, - ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, + Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, }, - utils::{ExprFactory, private_ident, quote_ident}, - visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, + utils::{private_ident, quote_ident, ExprFactory}, + visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index a233a74ec4e976..bdfc46e0016191 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index 912631b9e3c31f..2da4eaa7cf41bf 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -3,7 +3,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index aaef6f15d82278..da2ad8a0b7e4e5 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ atoms::Wtf8Atom, - common::{DUMMY_SP, Spanned, errors::HANDLER}, + common::{errors::HANDLER, Spanned, DUMMY_SP}, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index 9c43c13337cc2b..8155ba4bfc0901 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -6,7 +6,7 @@ use swc_core::{ ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index 3e2b1d6cb0f06c..29fdb5d22f8804 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,12 +1,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Module, ModuleExportName, }, - visit::{Visit, VisitWith, noop_visit_type}, + visit::{noop_visit_type, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index 783310f3ae4d3b..a611517e9b101f 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,7 +5,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 9cba705cd84e60..15219051d9e607 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{Error, bail}; +use easy_error::{bail, Error}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass, noop_fold_type}, + visit::{fold_pass, noop_fold_type, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 91ee9d8c802990..7b6629a03e3561 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -3,12 +3,12 @@ use std::collections::HashMap; use serde::Deserialize; use swc_atoms::Wtf8Atom; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index e985b69b7911bb..bf88fb20b44f3b 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -8,7 +8,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass}, + visit::{fold_pass, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index 65a175cc75c2e5..82d308aec7a1c7 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,19 +11,19 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, + FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, + utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, visit::{ - Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, - visit_mut_pass, + noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, + VisitWith, }, }, }; diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index cd6a74ed24ce82..b8bb0508fd0fb9 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, + visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 0b900fa433fe70..3e3ab0996d4a23 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -3,11 +3,11 @@ use std::sync::Arc; use swc_atoms::Wtf8Atom; use swc_core::{ atoms::Atom, - common::{SourceMap, Span, errors::HANDLER}, + common::{errors::HANDLER, SourceMap, Span}, ecma::{ ast::{ - BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, op, + op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, diff --git a/crates/next-custom-transforms/tests/errors.rs b/crates/next-custom-transforms/tests/errors.rs index 9188512d5357d0..b5f029896d7705 100644 --- a/crates/next-custom-transforms/tests/errors.rs +++ b/crates/next-custom-transforms/tests/errors.rs @@ -2,12 +2,12 @@ use std::{iter::FromIterator, path::PathBuf}; use next_custom_transforms::transforms::{ disallow_re_export_all_in_page::disallow_re_export_all_in_page, - dynamic::{NextDynamicMode, next_dynamic}, - fonts::{Config as FontLoaderConfig, next_font_loaders}, + dynamic::{next_dynamic, NextDynamicMode}, + fonts::{next_font_loaders, Config as FontLoaderConfig}, next_ssg::next_ssg, react_server_components::server_components, - server_actions::{self, ServerActionsMode, server_actions}, - strip_page_exports::{ExportFilter, next_transform_strip_page_exports}, + server_actions::{self, server_actions, ServerActionsMode}, + strip_page_exports::{next_transform_strip_page_exports, ExportFilter}, }; use rustc_hash::FxHashSet; use swc_core::{ @@ -16,7 +16,7 @@ use swc_core::{ parser::{EsSyntax, Syntax}, transforms::{ base::resolver, - testing::{FixtureTestConfig, test_fixture}, + testing::{test_fixture, FixtureTestConfig}, }, }, }; From 754ce18b4963ff0484807cf4a36cbbfdbed4eee4 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:24:25 +0100 Subject: [PATCH 07/25] fixup --- Cargo.lock | 1 - crates/next-custom-transforms/Cargo.toml | 1 - crates/next-custom-transforms/src/transforms/dynamic.rs | 2 +- .../next-custom-transforms/src/transforms/optimize_barrel.rs | 3 +-- .../src/transforms/warn_for_edge_runtime.rs | 3 +-- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b330c47f7f4997..80d61597f8e4a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4399,7 +4399,6 @@ dependencies = [ "sha1", "styled_components", "styled_jsx", - "swc_atoms", "swc_core", "swc_emotion", "swc_relay", diff --git a/crates/next-custom-transforms/Cargo.toml b/crates/next-custom-transforms/Cargo.toml index fb87925ddfca3b..d6a29b386ab772 100644 --- a/crates/next-custom-transforms/Cargo.toml +++ b/crates/next-custom-transforms/Cargo.toml @@ -66,7 +66,6 @@ swc_relay = { workspace = true } turbopack-ecmascript-plugins = { workspace = true, optional = true } turbo-rcstr = { workspace = true } urlencoding = { workspace = true } -swc_atoms = "9.0.0" react_remove_properties = { workspace = true } remove_console = { workspace = true } diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index 7e49aef9ba0557..b5ee1508ec07c7 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -544,7 +544,7 @@ impl NextDynamicPatcher { fn exec_expr_when_resolve_weak_available(expr: &Expr) -> Expr { let undefined_str_literal = Expr::Lit(Lit::Str(Str { span: DUMMY_SP, - value: "undefined".into(), + value: atom!("undefined").into(), raw: None, })); diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 7b6629a03e3561..c717e6884606cf 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -1,9 +1,8 @@ use std::collections::HashMap; use serde::Deserialize; -use swc_atoms::Wtf8Atom; use swc_core::{ - atoms::{atom, Atom}, + atoms::{atom, Atom, Wtf8Atom}, common::DUMMY_SP, ecma::{ ast::*, diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 3e3ab0996d4a23..9d91a1e0bae9bc 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -1,8 +1,7 @@ use std::sync::Arc; -use swc_atoms::Wtf8Atom; use swc_core::{ - atoms::Atom, + atoms::{Atom, Wtf8Atom}, common::{errors::HANDLER, SourceMap, Span}, ecma::{ ast::{ From 03dbecaeb4a4462c152f3ca60609611e3fdeb043 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:27:30 +0100 Subject: [PATCH 08/25] fixup --- .../src/transforms/server_actions.rs | 8 ++++---- crates/next-custom-transforms/tests/errors.rs | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index 92d2be210cede0..113498abe2c48e 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -1836,7 +1836,7 @@ impl VisitMut for ServerActions { ], src: Box::new(Str { span: DUMMY_SP, - value: "private-next-rsc-action-client-wrapper".into(), + value: atom!("private-next-rsc-action-client-wrapper").into(), raw: None, }), type_only: false, @@ -1973,7 +1973,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: "private-next-rsc-action-validate".into(), + value: atom!("private-next-rsc-action-validate").into(), raw: None, }), type_only: false, @@ -2024,7 +2024,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: "private-next-rsc-cache-wrapper".into(), + value: atom!("private-next-rsc-cache-wrapper").into(), raw: None, }), type_only: false, @@ -2067,7 +2067,7 @@ impl VisitMut for ServerActions { })], src: Box::new(Str { span: DUMMY_SP, - value: "private-next-rsc-server-reference".into(), + value: atom!("private-next-rsc-server-reference").into(), raw: None, }), type_only: false, diff --git a/crates/next-custom-transforms/tests/errors.rs b/crates/next-custom-transforms/tests/errors.rs index b5f029896d7705..e0c3c7a43f6248 100644 --- a/crates/next-custom-transforms/tests/errors.rs +++ b/crates/next-custom-transforms/tests/errors.rs @@ -11,6 +11,7 @@ use next_custom_transforms::transforms::{ }; use rustc_hash::FxHashSet; use swc_core::{ + atoms::atom, common::{FileName, Mark}, ecma::{ parser::{EsSyntax, Syntax}, @@ -134,8 +135,11 @@ fn next_font_loaders_errors(input: PathBuf) { syntax(), &|_tr| { next_font_loaders(FontLoaderConfig { - relative_file_path_from_root: "pages/test.tsx".into(), - font_loaders: vec!["@next/font/google".into(), "cool-fonts".into()], + relative_file_path_from_root: atom!("pages/test.tsx").into(), + font_loaders: vec![ + atom!("@next/font/google").into(), + atom!("cool-fonts").into(), + ], }) }, &input, From 94c25d219691c390ec00d7a4b89c30866ca886c9 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:36:02 +0100 Subject: [PATCH 09/25] update turbopack-test snapshots --- ..._basic_top-level-await_input_bae4bbe2._.js | 2 +- ...ic_top-level-await_input_bae4bbe2._.js.map | 2 +- ...ug-ids_browser_input_index_0151fefb.js.map | 12 ++++---- ..._debug-ids_browser_input_index_0151fefb.js | 29 ++----------------- .../node/output/[turbopack]_runtime.js | 10 ++----- .../node/output/[turbopack]_runtime.js.map | 10 +++---- ...rbopack-tests_tests_snapshot_ee254e53._.js | 6 ++-- ...ack-tests_tests_snapshot_ee254e53._.js.map | 2 +- ...shot_export-alls_cjs-2_input_ff2fb449._.js | 6 ++-- ..._export-alls_cjs-2_input_ff2fb449._.js.map | 6 ++-- .../[root-of-the-server]__696857be._.js | 2 +- .../[root-of-the-server]__696857be._.js.map | 2 +- .../output/[turbopack]_runtime.js | 10 ++----- .../output/[turbopack]_runtime.js.map | 10 +++---- ...efault_dev_runtime_input_index_c0f7e0b0.js | 27 +---------------- ...lt_dev_runtime_input_index_c0f7e0b0.js.map | 10 +++---- ...nsforms_preset_env_input_index_5aaf1327.js | 22 -------------- ...rms_preset_env_input_index_5aaf1327.js.map | 8 ++--- 18 files changed, 46 insertions(+), 130 deletions(-) diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js index 6acc222bba7f3b..765ae67d2f7ceb 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js @@ -2,13 +2,13 @@ "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -// import() doesn't care about whether a module is an async module or not __turbopack_context__.s([ "AlternativeCreateUserAction", ()=>AlternativeCreateUserAction, "CreateUserAction", ()=>CreateUserAction ]); +// import() doesn't care about whether a module is an async module or not const UserApi = __turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js [test] (ecmascript, async loader)"); const CreateUserAction = async (name)=>{ console.log('Creating user', name); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js.map index 4ab05e9b77e3e4..b970aa7747bffc 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/aaf3a_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_bae4bbe2._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js"],"sourcesContent":["// import() doesn't care about whether a module is an async module or not\nconst UserApi = import('./UserAPI.js')\n\nexport const CreateUserAction = async (name) => {\n console.log('Creating user', name)\n // These are normal awaits, because they are in an async function\n const { createUser } = await UserApi\n await createUser(name)\n}\n\n// You can place import() where you like\n// Placing it at top-level will start loading and evaluating on\n// module evaluation.\n// see CreateUserAction above\n// Here: Connecting to the DB starts when the application starts\n// Placing it inside of an (async) function will start loading\n// and evaluating when the function is called for the first time\n// which basically makes it lazy-loaded.\n// see AlternativeCreateUserAction below\n// Here: Connecting to the DB starts when AlternativeCreateUserAction\n// is called\nexport const AlternativeCreateUserAction = async (name) => {\n const { createUser } = await import('./UserAPI.js')\n await createUser(name)\n}\n\n// Note: Using await import() at top-level doesn't make much sense\n// except in rare cases. It will import modules sequentially.\n"],"names":[],"mappings":"AAAA,yEAAyE;;;;;;;AACzE,MAAM;AAEC,MAAM,mBAAmB,OAAO;IACrC,QAAQ,GAAG,CAAC,iBAAiB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM;IAC7B,MAAM,WAAW;AACnB;AAaO,MAAM,8BAA8B,OAAO;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG;IACvB,MAAM,WAAW;AACnB,EAEA,kEAAkE;CAClE,mEAAmE"}}, + {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js"],"sourcesContent":["// import() doesn't care about whether a module is an async module or not\nconst UserApi = import('./UserAPI.js')\n\nexport const CreateUserAction = async (name) => {\n console.log('Creating user', name)\n // These are normal awaits, because they are in an async function\n const { createUser } = await UserApi\n await createUser(name)\n}\n\n// You can place import() where you like\n// Placing it at top-level will start loading and evaluating on\n// module evaluation.\n// see CreateUserAction above\n// Here: Connecting to the DB starts when the application starts\n// Placing it inside of an (async) function will start loading\n// and evaluating when the function is called for the first time\n// which basically makes it lazy-loaded.\n// see AlternativeCreateUserAction below\n// Here: Connecting to the DB starts when AlternativeCreateUserAction\n// is called\nexport const AlternativeCreateUserAction = async (name) => {\n const { createUser } = await import('./UserAPI.js')\n await createUser(name)\n}\n\n// Note: Using await import() at top-level doesn't make much sense\n// except in rare cases. It will import modules sequentially.\n"],"names":[],"mappings":";;;;;;AAAA,yEAAyE;AACzE,MAAM;AAEC,MAAM,mBAAmB,OAAO;IACrC,QAAQ,GAAG,CAAC,iBAAiB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM;IAC7B,MAAM,WAAW;AACnB;AAaO,MAAM,8BAA8B,OAAO;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG;IACvB,MAAM,WAAW;AACnB,EAEA,kEAAkE;CAClE,mEAAmE"}}, {"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/index.js"],"sourcesContent":["import { CreateUserAction } from './Actions.js'\n;(async () => {\n await CreateUserAction('John')\n console.log('created user John')\n})()\n"],"names":[],"mappings":";AAAA;;AACC,CAAC;IACA,MAAM,IAAA,kOAAgB,EAAC;IACvB,QAAQ,GAAG,CAAC;AACd,CAAC"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map index 45d3431f842e28..075e60752d3ccb 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map @@ -1,11 +1,11 @@ { "version": 3, "sources": [], - "debugId": "9cc3c4ae-b6b3-7945-3645-c0e627a5103b", + "debugId": "d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d", "sections": [ - {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+C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,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 494, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;AAEzD,mEAAmE;AAcnE,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;IAEpB,OAAO,qBAAqC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;AACzD;AACA,wBAAwB,CAAC,GAAG;AAE5B,SAAS,iBAAiB,SAAoB,EAAE,SAAoB;IAClE,OAAO,qBAAsC,WAAW;AAC1D;AAEA,eAAe,kBACb,UAAsB,EACtB,UAAsB,EACtB,SAAoB;IAEpB,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,YAA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AAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 718, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4CAA4C;AAC5C,4CAA4C;AAM5C,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,q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aAAa,WAAY;QAClC,IAAI,kBAAkB,mBAAmB,GAAG,CAAC;QAC7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, - {"offset": {"line": 1572, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;AAU3D,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,MAAM,gBAAgB,oBAAoB;gBAE1C,iFAAiF;gBACjF,oBAAoB;YACtB;YAEA,kFAAkF;YAClF,MAAM,QAAQ,GAAG,CACf,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,iBACtB,iBAAiB,WAAW;YAIhC,IAAI,OAAO,gBAAgB,CAAC,MAAM,GAAG,GAAG;gBACtC,KAAK,MAAM,YAAY,OAAO,gBAAgB,CAAE;oBAC9C,8BAA8B,WAAW;gBAC3C;YACF;QACF;QAEA;;;KAGC,GACD,iBAAgB,UAAsB,EAAE,QAAkB;YACxD,OAAO,YAAY,YAAY;QACjC;QAEA,MAAM,iBACJ,WAAuB,EACvB,WAAuB,EACvB,aAAwB,EACxB,WAAqC,EACrC,UAA+B;YAE/B,MAAM,MAAM,iBAAiB;YAE7B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,KACA;YAGF,OAAO,SAAS,OAAO;QACzB;QAEA,MAAM,uBACJ,WAAuB,EACvB,WAAuB,EACvB,aAAwB,EACxB,WAAqC;YAErC,MAAM,MAAM,iBAAiB;YAE7B,OAAO,MAAM,YAAY,gBAAgB,CAAC;Q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[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kB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,oFAAoF;oBACpF,6FAA6F;oBAC7F,KAAK,IAAI,GAAG,GAAG,SAAS,IAAI,EAAE,KAAK,GAAG,IAAI;gBAC5C,OAAO;oBACL,KAAK,IAAI,GAAG;gBACd;gBAEA,KAAK,OAAO,GAAG;oBACb;gBACF;gBACA,KAAK,MAAM,GAAG;oBACZ,0EAA0E;oBAC1E,wEAAwE;oBACxE,uBAAuB;oBACvB,KAAK,MAAM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] + {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GAAG,GAAG;IACpB;IACA,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,mBAAmB,EAAY;IACtC,OAAO;QACL,SAAS,CAAC;QACV,OAAO;QACP;QACA,iBAAiB;IACnB;AACF;AAGA,MAAM,mBAAmB;AAUzB;;CAEC,GACD,SAAS,IAAI,OAAgB,EAAE,QAAqB;IAClD,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAI,IAAI;IACR,MAAO,IAAI,SAAS,MAAM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yB;IAE9B,IAAI,SAAS,MAAM,MAAM,SAA0B;QACjD,MAAM,MAAM;IACd;AACF;AACA,iBAAiB,CAAC,GAAG;AAErB;;;;;;;;;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 488, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AA2BA,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;IAEpB,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CAAC;IAC/B,MAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,MAAM,OAAO,IAAI,UAAU,CAAC,mBACxB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,OAAO;AACT;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,MAAM,cAAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 703, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAQA,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,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AAa,CAAC;IACtB,WAAW,gCAAgC,CAAE,IAAI,CAAC;QAChD;QACA,YAAY,IAAI,CAAC,MAAM;KACxB;IAED,+CAA+C;IAC/C,MAAM,aAAa,IAAI,IAAI,UAAU,MAAM,CAAC,GAAG,CAAC;IAChD,mBAAmB,GAAG,CAAC,eAAe;IACtC,KAAK,MAAM,aAAa,WAAY;QAClC,IAAI,kBAAkB,mBAAmB,GAAG,CAAC;QAC7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, + {"offset": {"line": 1554, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAoBA,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,MAAM,gBAAgB,oBAAoB;gBAE1C,iFAAiF;gBACjF,oBAAoB;YACtB;YAEA,kFAAkF;YAClF,MAAM,QAAQ,GAAG,CACf,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,iBACtB,iBAAiB,WAAW;YAIhC,IAAI,OAAO,gBAAgB,CAAC,MAAM,GAAG,GAAG;gBACtC,KAAK,MAAM,YAAY,OAAO,gBAAgB,CAAE;oBAC9C,8BAA8B,WAAW;gBAC3C;YACF;QACF;QAEA;;;KAGC,GACD,iBAAgB,UAAsB,EAAE,QAAkB;YACxD,OAAO,YAAY,YAAY;QACjC;QAEA,MAAM,iBACJ,WAAuB,EACvB,WAAuB,EACvB,aAAwB,EACxB,WAAqC,EACrC,UAA+B;YAE/B,MAAM,MAAM,iBAAiB;YAE7B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,KACA;YAGF,OA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O,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, + {"offset": {"line": 1709, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,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;gBACpC,KAAK,GAAG,GAAG;gBAEX,IAAI,UAAU,SAAS,CAAC,QAAQ,CAAC,YAAY;oBAC3C,kFAAkF;oBAClF,sFAAsF;oBACtF,EAAE;oBACF,qFAAqF;oBACrF,EAAE;oBACF,oFAAoF;oBACpF,6FAA6F;oBAC7F,KAAK,IAAI,GAAG,GAAG,SAAS,IAAI,EAAE,KAAK,GAAG,IAAI;gBAC5C,OAAO;oBACL,KAAK,IAAI,GAAG;gBACd;gBAEA,KAAK,OAAO,GAAG;oBACb;gBACF;gBACA,KAAK,MAAM,GAAG;oBACZ,0EAA0E;oBAC1E,wEAAwE;oBACxE,uBAAuB;oBACvB,KAAK,MAAM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js index 703090a1895937..b5e22c7c422552 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js @@ -1,4 +1,4 @@ -;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="9cc3c4ae-b6b3-7945-3645-c0e627a5103b")}catch(e){}}(); +;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d")}catch(e){}}(); (globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push([ "output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js", {"otherChunks":["output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0b8736b3.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]} @@ -12,12 +12,6 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; -/** - * This file contains runtime types and functions that are shared between all - * TurboPack ECMAScript runtimes. - * - * It will be prepended to the runtime code of each runtime. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -492,15 +486,6 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } -/** - * This file contains runtime types and functions that are shared between all - * Turbopack *development* ECMAScript runtimes. - * - * It will be appended to the runtime code of each runtime right after the - * shared runtime utils. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// -// Used in WebWorkers to tell the runtime about the chunk base path const browserContextPrototype = Context.prototype; var SourceType = /*#__PURE__*/ function(SourceType) { /** @@ -716,9 +701,6 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); } contextPrototype.u = loadWebAssemblyModule; -/// -/// -/// const devContextPrototype = Context.prototype; /** * This file contains runtime types and functions that are shared between all @@ -1570,13 +1552,6 @@ function registerChunk(registration) { } } globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; -/** - * This file contains the runtime code specific to the Turbopack development - * ECMAScript DOM runtime. - * - * It will be appended to the base development runtime code. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// let BACKEND; /** * Maps chunk paths to the corresponding resolver. @@ -1834,5 +1809,5 @@ chunkListsToRegister.forEach(registerChunkList); })(); -//# debugId=9cc3c4ae-b6b3-7945-3645-c0e627a5103b +//# debugId=d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d //# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js index b8b9d34795f955..fc5b3598d60bd6 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js @@ -1,12 +1,6 @@ const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js"; const RELATIVE_ROOT_PATH = "../../../../../../.."; const ASSET_PREFIX = "/"; -/** - * This file contains runtime types and functions that are shared between all - * TurboPack ECMAScript runtimes. - * - * It will be prepended to the runtime code of each runtime. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -522,7 +516,7 @@ externalRequire.resolve = (id, options)=>{ return require.resolve(id, options); }; contextPrototype.x = externalRequire; -/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path'); +const path = require('path'); const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.'); // Compute the relative path to the `distDir`. const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH); @@ -767,4 +761,4 @@ module.exports = (sourcePath)=>({ }); -//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map +//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map index 421b4b1c4acaed..bbe31b1fac80ed 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GAAG,GAAG;IACpB;IACA,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,mBAAmB,EAAY;IACtC,OAAO;QACL,SAAS,CAAC;QACV,OAAO;QACP;QACA,iBAAiB;IACnB;AACF;AAGA,MAAM,mBAAmB;AAUzB;;CAEC,GACD,SAAS,IAAI,OAAgB,EAAE,QAAqB;IAClD,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAI,IAAI;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aAAa;IACf;IAEA,KAAK,yBAAyB;IAE9B,IAAI,SAAS,MAAM,MAAM,SAA0B;QACjD,MAAM,MAAM;IACd;AACF;AACA,iBAAiB,CAAC,GAAG;AAErB;;;;;;;;;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 483, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 524, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 545, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, - {"offset": {"line": 566, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IAAI;AAC7C,qBAAqB,CAAC,GAAG;AACzB,MAAM,cAAmC,OAAO,MAAM,CAAC;AACvD,qBAAqB,CAAC,GAAG;AAEzB;;CAEC,GACD,SAAS,sBAEP,QAAgB;IAEhB,MAAM,WAAW,IAAI,CAAC,CAAC,CAAC;IACxB,MAAM,eAAe,UAAU,WAAW;IAC1C,IAAI,OAAO,iBAAiB,UAAU;QACpC,OAAO;IACT;IAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;IAClE,MAAM,WAAW,KAAK,OAAO,CAAC,cAAc;IAE5C,OAAO,IAAI,aAAa,CAAC,UAAU,IAAI;AACzC;AACA,qBAAqB,CAAC,GAAG;AAEzB,SAAS,iBAAiB,UAAqB,EAAE,SAAoB;IACnE,IAAI,OAAO,cAAc,UAAU;QACjC,qBAAqB,YAAY;IACnC,OAAO;QACL,qBAAqB,YAAY,UAAU,IAAI;IACjD;AACF;AAEA,MAAM,eAAe,IAAI;AACzB,MAAM,uBAAuB,QAAQ,OAAO,CAAC;AAC7C,MAAM,cAA6B,QAAQ,OAAO,CAAC;AACnD,MAAM,aAAa,IAAI;AAEvB,SAAS;IACP,WAAW,KAAK;AAClB;AAEA,SAAS,qBACP,UAAqB,EACrB,SAAoB;IAEpB,IAAI,CAAC,KAAK,YAAY;QACpB,gDAAgD;QAChD,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AO;AACT;AAEA;;CAEC,GACD,aAAa;AACb,SAAS,iCACP,EAAY,EACZ,YAAoB;IAEpB,MAAM,UAAS,WAAW,CAAC,GAAG;IAE9B,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QAEA,OAAO;IACT;IAEA,OAAO,kBAAkB,OAAuB,aAAa,EAAE;AACjE;AAEA;;CAEC,GACD,SAAS,yBACP,SAAoB,EACpB,QAAkB;IAElB,OAAO,kBAAkB,aAA8B;AACzD;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] + {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GAAG,GAAG;IACpB;IACA,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,mBAAmB,EAAY;IACtC,OAAO;QACL,SAAS,CAAC;QACV,OAAO;QACP;QACA,iBAAiB;IACnB;AACF;AAGA,MAAM,mBAAmB;AAUzB;;CAEC,GACD,SAAS,IAAI,OAAgB,EAAE,QAAqB;IAClD,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAI,IAAI;IACR,MAAO,IAAI,SAAS,MAAM,CAAE;QAC1B,MAAM,WAAW,QAAQ,CAAC,IAAI;QAC9B,MAAM,gBAAgB,QAAQ,CAAC,IAAI;QACnC,IAAI,OAAO,kBAA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;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 477, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 518, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAMA,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 539, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, + {"offset": {"line": 560, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD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E;YAChB,MAAM,QAAO,KAAK;QACpB;QAEA,OAAO;IACT;IAEA,OAAO,kBAAkB,OAAuB,aAAa,EAAE;AACjE;AAEA;;CAEC,GACD,SAAS,yBACP,SAAoB,EACpB,QAAkB;IAElB,OAAO,kBAAkB,aAA8B;AACzD;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js index 9f16b27ae49f66..b13ccb1f5407c9 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js @@ -2,15 +2,15 @@ "[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -/** @jsxImportSource @emotion/react */ __turbopack_context__.s([]); +__turbopack_context__.s([]); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js [test] (ecmascript)"); -var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$react$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js [test] (ecmascript)"); +/** @jsxImportSource @emotion/react */ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$react$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js [test] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js [test] (ecmascript)"); ; ; ; const StyledButton = (0, /*#__PURE__*/ __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", { - target: "e6tdad40" + target: "e16emnxi0" })("background:blue;"); function ClassNameButton({ children }) { return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$test$5d$__$28$ecmascript$29$__["jsxDEV"])("button", { diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js.map index 404166647c9047..0fdea788ad1242 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n \n {children}\n \n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":"AAAA,oCAAoC;;AAEpC;AACA;;;;AAEA,MAAM,iCAAe,mNAAM;;;AAI3B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}}, + {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n \n {children}\n \n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":";;AAAA,oCAAoC,GAEpC;AACA;;;;AAEA,MAAM,iCAAe,mNAAM;;;AAI3B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}}, {"offset": {"line": 31, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 42, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js"],"sourcesContent":["export function jsx() {\n return 'purposefully empty stub for @emotion/react/index.js'\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 52, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"@emtion/styled/index.js\";\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}] diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js b/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js index b7c01941168896..45b3e0dab6ddc3 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js @@ -7,8 +7,8 @@ exports.hello = 'World'; "[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -// c.js __turbopack_context__.s([]); +// c.js var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$commonjs$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js [test] (ecmascript)"); // This would be handled by existing logic __turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$commonjs$2e$js__$5b$test$5d$__$28$ecmascript$29$__); ; @@ -16,8 +16,8 @@ __turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopac "[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -// b.js __turbopack_context__.s([]); +// b.js var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$c$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js [test] (ecmascript)"); // This would not be handled, but still need __turbopack__cjs__ // as there are properties dynamically added by __turbopack__cjs__ in c.js __turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$c$2e$js__$5b$test$5d$__$28$ecmascript$29$__); @@ -26,8 +26,8 @@ __turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopac "[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -// a.js __turbopack_context__.s([]); +// a.js var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)"); ; console.log(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js.map index e6dbeeb487e222..bc6891f0345b77 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/output/turbopack_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_ff2fb449._.js.map @@ -3,7 +3,7 @@ "sources": [], "sections": [ {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js"],"sourcesContent":["// commonjs.js\nexports.hello = 'World'\n"],"names":[],"mappings":"AAAA,cAAc;AACd,QAAQ,KAAK,GAAG"}}, - {"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js"],"sourcesContent":["// c.js\nexport * from './commonjs.js'\n// This would be handled by existing logic\n"],"names":[],"mappings":"AAAA,OAAO;;AACP,gWACA,0CAA0C"}}, - {"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js"],"sourcesContent":["// b.js\nexport * from './c'\n// This would not be handled, but still need __turbopack__cjs__\n// as there are properties dynamically added by __turbopack__cjs__ in c.js\n"],"names":[],"mappings":"AAAA,OAAO;;AACP,kVACA,+DAA+D;CAC/D,0EAA0E"}}, - {"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js"],"sourcesContent":["// a.js\nimport * as B from './b'\nconsole.log(B)\n"],"names":[],"mappings":"AAAA,OAAO;;AACP;;AACA,QAAQ,GAAG,CAAC"}}] + {"offset": {"line": 9, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js"],"sourcesContent":["// c.js\nexport * from './commonjs.js'\n// This would be handled by existing logic\n"],"names":[],"mappings":";AAAA,OAAO;AACP,gWACA,0CAA0C"}}, + {"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js"],"sourcesContent":["// b.js\nexport * from './c'\n// This would not be handled, but still need __turbopack__cjs__\n// as there are properties dynamically added by __turbopack__cjs__ in c.js\n"],"names":[],"mappings":";AAAA,OAAO;AACP,kVACA,+DAA+D;CAC/D,0EAA0E"}}, + {"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js"],"sourcesContent":["// a.js\nimport * as B from './b'\nconsole.log(B)\n"],"names":[],"mappings":";AAAA,OAAO;AACP;;AACA,QAAQ,GAAG,CAAC"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js b/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js index 02b33911bed475..b6bd2c1c58ce8f 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js @@ -38,8 +38,8 @@ module.exports = mod; "[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "use strict"; -// Test that Bun builtins are treated as external __turbopack_context__.s([]); +// Test that Bun builtins are treated as external var __TURBOPACK__imported__module__$5b$externals$5d2f$bun$3a$ffi__$5b$external$5d$__$28$bun$3a$ffi$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/bun:ffi [external] (bun:ffi, cjs)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$bun$3a$jsc__$5b$external$5d$__$28$bun$3a$jsc$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/bun:jsc [external] (bun:jsc, cjs)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$bun$3a$sqlite__$5b$external$5d$__$28$bun$3a$sqlite$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/bun:sqlite [external] (bun:sqlite, cjs)"); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js.map index dca72420e53cb0..d2cc704951f2eb 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/output/[root-of-the-server]__696857be._.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 40, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/input/index.js"],"sourcesContent":["// Test that Bun builtins are treated as external\nimport bunFfi from 'bun:ffi'\nimport bunJsc from 'bun:jsc'\nimport bunSqlite from 'bun:sqlite'\nimport bunTest from 'bun:test'\nimport bunWrap from 'bun:wrap'\nimport bun from 'bun'\n\nconsole.log('bun:ffi:', bunFfi)\nconsole.log('bun:jsc:', bunJsc)\nconsole.log('bun:sqlite:', bunSqlite)\nconsole.log('bun:test:', bunTest)\nconsole.log('bun:wrap:', bunWrap)\nconsole.log('bun:', bun)\n"],"names":[],"mappings":"AAAA,iDAAiD;;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;AAEA,QAAQ,GAAG,CAAC,YAAY,wHAAM;AAC9B,QAAQ,GAAG,CAAC,YAAY,wHAAM;AAC9B,QAAQ,GAAG,CAAC,eAAe,8HAAS;AACpC,QAAQ,GAAG,CAAC,aAAa,0HAAO;AAChC,QAAQ,GAAG,CAAC,aAAa,0HAAO;AAChC,QAAQ,GAAG,CAAC,QAAQ,0GAAG"}}] + {"offset": {"line": 40, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/bun_protocol_external/input/index.js"],"sourcesContent":["// Test that Bun builtins are treated as external\nimport bunFfi from 'bun:ffi'\nimport bunJsc from 'bun:jsc'\nimport bunSqlite from 'bun:sqlite'\nimport bunTest from 'bun:test'\nimport bunWrap from 'bun:wrap'\nimport bun from 'bun'\n\nconsole.log('bun:ffi:', bunFfi)\nconsole.log('bun:jsc:', bunJsc)\nconsole.log('bun:sqlite:', bunSqlite)\nconsole.log('bun:test:', bunTest)\nconsole.log('bun:wrap:', bunWrap)\nconsole.log('bun:', bun)\n"],"names":[],"mappings":";AAAA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;AAEA,QAAQ,GAAG,CAAC,YAAY,wHAAM;AAC9B,QAAQ,GAAG,CAAC,YAAY,wHAAM;AAC9B,QAAQ,GAAG,CAAC,eAAe,8HAAS;AACpC,QAAQ,GAAG,CAAC,aAAa,0HAAO;AAChC,QAAQ,GAAG,CAAC,aAAa,0HAAO;AAChC,QAAQ,GAAG,CAAC,QAAQ,0GAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js index b8b9d34795f955..fc5b3598d60bd6 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js @@ -1,12 +1,6 @@ const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js"; const RELATIVE_ROOT_PATH = "../../../../../../.."; const ASSET_PREFIX = "/"; -/** - * This file contains runtime types and functions that are shared between all - * TurboPack ECMAScript runtimes. - * - * It will be prepended to the runtime code of each runtime. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -522,7 +516,7 @@ externalRequire.resolve = (id, options)=>{ return require.resolve(id, options); }; contextPrototype.x = externalRequire; -/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path'); +const path = require('path'); const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.'); // Compute the relative path to the `distDir`. const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH); @@ -767,4 +761,4 @@ module.exports = (sourcePath)=>({ }); -//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map +//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map index 421b4b1c4acaed..bbe31b1fac80ed 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;A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,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 483, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 524, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 545, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, - {"offset": {"line": 566, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GA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;;CAEC,GACD,SAAS,yBACP,SAAoB,EACpB,QAAkB;IAElB,OAAO,kBAAkB,aAA8B;AACzD;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] + {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;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AU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 477, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 518, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAMA,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 539, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, + {"offset": {"line": 560, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IA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AM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js index c7c791d25794b6..7db36098e0e2c2 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js @@ -11,12 +11,6 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; -/** - * This file contains runtime types and functions that are shared between all - * TurboPack ECMAScript runtimes. - * - * It will be prepended to the runtime code of each runtime. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -491,15 +485,6 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } -/** - * This file contains runtime types and functions that are shared between all - * Turbopack *development* ECMAScript runtimes. - * - * It will be appended to the runtime code of each runtime right after the - * shared runtime utils. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// -// Used in WebWorkers to tell the runtime about the chunk base path const browserContextPrototype = Context.prototype; var SourceType = /*#__PURE__*/ function(SourceType) { /** @@ -715,9 +700,6 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); } contextPrototype.u = loadWebAssemblyModule; -/// -/// -/// const devContextPrototype = Context.prototype; /** * This file contains runtime types and functions that are shared between all @@ -1569,13 +1551,6 @@ function registerChunk(registration) { } } globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; -/** - * This file contains the runtime code specific to the Turbopack development - * ECMAScript DOM runtime. - * - * It will be appended to the base development runtime code. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// let BACKEND; /** * Maps chunk paths to the corresponding resolver. @@ -1833,4 +1808,4 @@ chunkListsToRegister.forEach(registerChunkList); })(); -//# sourceMappingURL=780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map +//# sourceMappingURL=780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map index 6c714a9cd38b2a..67cdc3ce77f5f4 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IA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EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 493, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;AAEzD,mEAAmE;AAcnE,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AA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{"line": 717, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4CAA4C;AAC5C,4CAA4C;AAM5C,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,qBAAyD,IAAI;AAEnE;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AAEpD;;CAEC,GACD,aAAa;AACb,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,SAAS,cAAc,CAAC,SAAS;IACvC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,aAAa;IACb,OAAO,kBAAkB,UAAU,WAAW,OAAO,EAAE;AACzD;AAEA;;CAEC,GACD,2CAA2C;A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C;SAAS;QACjC,gBAAgB,GAAG,CAAC,WAAW;IACjC,OAAO;QACL,aAAa,GAAG,CAAC;IACnB;AACF;AAEA;;;;CAIC,GACD,SAAS,uBAAuB,aAA4B;IAC1D,kBAAkB,GAAG,CAAC;AACxB;AAEA,SAAS,cAAc,YAA+B;IACpD,MAAM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd,iBACA,CAAC,KAAiB,iBAAiB,IAAI;IAE3C;IACA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C;AAEA;;CAEC,GACD,SAAS,kBAAkB,SAAoB;IAC7C,MAAM,kBAAkB,UAAU,MAAM;IACxC,MAAM,gBAAgB,kBAAkB;IACxC,sEAAsE;IACtE,QAAQ,aAAa,CAAC;IACtB,WAAW,gCAAgC,CAAE,IAAI,CAAC;QAChD;QACA,YAAY,IAAI,CAAC,MAAM;KACxB;IAED,+CAA+C;IAC/C,MAAM,aAAa,IAAI,IAAI,UAAU,MAAM,CAAC,GAAG,CAAC;IAChD,mBAAmB,GAAG,CAAC,eAAe;IACtC,KAAK,MAAM,aAAa,WAAY;QAClC,IAAI,kBAAkB,mBAAmB,GAAG,CAAC;QAC7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, - {"offset": {"line": 1571, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;AAU3D,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,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MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, - {"offset": {"line": 1733, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,MAAM,WAAW;gBACnB,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAAS,eAAe,EAAE,gBAAgB,eAAe,EAAE,gBAAgB,GAAG,CAAC;gBAEzH,KAAK,MAAM,QAAQ,MAAM,IAAI,CAAC,OAAQ;oBACpC,KAAK,MAAM;gBACb;YACF,OAAO,IAAI,KAAK,WAAW;gBACzB,mEAAmE;gBACnE,0BAA0B;gBAC1B,uEAAuE;gBACvE,4DAA4D;gBAC5D,MAAM,UAAU,SAAS,gBAAgB,CACvC,CAAC,YAAY,EAAE,SAAS,gBAA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,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F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ClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 487, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AA2BA,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;IAEpB,OAAO,qBAAqC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;AACzD;AACA,wBAAwB,CAAC,GAAG;AAE5B,SAAS,iBAAiB,SAAoB,EAAE,SAAoB;IAClE,OAAO,qBAAsC,WAAW;AAC1D;AAEA,eAAe,kBACb,UAAsB,EACtB,UAAsB,EACtB,SAAoB;IAEpB,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,YAAY,YAAY;IAC/C;IAEA,MAAM,eAAe,UAAU,QAAQ,IAAI,EAAE;IAC7C,MAAM,kBAAkB,aAAa,GAAG,CAAC,CAAC;QACxC,IAAI,gBAAgB,GAAG,CAAC,WAAW,OAAO;Q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Q,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 702, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAQA,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,qBAAyD,IAAI;AAEnE;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AAEpD;;CAEC,GACD,aAAa;AACb,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAEl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ACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, + {"offset": {"line": 1553, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAoBA,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C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;wBACZ,uEAAuE;wBACvE,oBAAoB;wBACpB,SAAS,OAAO;oBAClB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO,IAAI,KAAK,WAAW;gBACzB,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, + {"offset": {"line": 1708, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,MAAM,WAAW;gBACnB,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAAS,eAAe,EAAE,gBAAgB,eAAe,EAAE,gBAAgB,GAAG,CAAC;gBAEzH,KAAK,MAAM,QAAQ,MAAM,IAAI,CAAC,OAAQ;oBACpC,KAAK,MAAM;gBACb;YACF,OA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AK,MAAM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js index 8386cd98ebffae..2d01b4b1d904f5 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js @@ -11,12 +11,6 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; -/** - * This file contains runtime types and functions that are shared between all - * TurboPack ECMAScript runtimes. - * - * It will be prepended to the runtime code of each runtime. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -731,15 +725,6 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } -/** - * This file contains runtime types and functions that are shared between all - * Turbopack *development* ECMAScript runtimes. - * - * It will be appended to the runtime code of each runtime right after the - * shared runtime utils. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// -// Used in WebWorkers to tell the runtime about the chunk base path function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -1270,13 +1255,6 @@ function registerChunk(registration) { } return BACKEND.registerChunk(chunkPath, runtimeParams); } -/** - * This file contains the runtime code specific to the Turbopack development - * ECMAScript DOM runtime. - * - * It will be appended to the base development runtime code. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map index b868cee4a14da9..9fd8d4a7a144a9 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map @@ -2,8 +2,8 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU7C,IAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,IAAM,mBAAmB,QAAQ,SAAS;AA+B1C,IAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,IAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,E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, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;AAEzD,mEAAmE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcnE,IAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,IAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,IAAM,mBAAuD,IAAI;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,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,IAAM,OAAO,IAAI,UAAU,CAAC,mBACxB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,OAAO;AACT;AAEA,IAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,IAAM,cAAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 1201, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {}\ncontextPrototype.c = moduleCache\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData))\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n\n moduleCache[id] = module\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories\n )\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,mCAAmC;AAEnC,IAAM,cAAmC,CAAC;AAC1C,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,aAAa;AACb,6DAA6D;AAC7D,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,IAAM,SAAS,WAAW,CAAC,SAAS;IACpC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;Q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AC,WAAW;AAC1C","ignoreList":[0]}}, - {"offset": {"line": 1272, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;oBACtC,QAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,QAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C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C,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 727, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAoB,SAAoC;IAC/D,OAAO,GAAG,kBAAkB,UACzB,KAAK,CAAC,KACN,GAAG,CAAC,SAAC;eAAM,mBAAmB;OAC9B,IAAI,CAAC,OAAO,mBAAmB;AACpC;AASA,SAAS,kBACP,WAAsE;IAEtE,IAAI,OAAO,gBAAgB,UAAU;QACnC,OAAO;IACT;IACA,IAAM,WACJ,OAAO,8BAA8B,cACjC,0BAA0B,GAAG,KAC7B,YAAY,YAAY,CAAC;IAC/B,IAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,IAAM,OAAO,IAAI,UAAU,CAAC,mBACxB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,OAAO;AACT;AAEA,IAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,IAAM,cAAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 1186, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {}\ncontextPrototype.c = moduleCache\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData))\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n\n moduleCache[id] = module\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories\n )\n }\n\n return BACKEND.registerChunk(ch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,eAAe;IACnD;IAEA,OAAO;AACT;AAEA,6DAA6D;AAC7D,SAAS,cAAc,YAA+B;IACpD,IAAM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd;IAEJ;IAEA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C","ignoreList":[0]}}, + {"offset": {"line": 1257, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI;AAEJ;;CAEC,GACD,IAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACF,eAAN,SAAM,cAAc,SAAS,EAAE,MAAM;;oBAC7B,UAEA,UAOD,2BAAA,mBAAA,gBAAA,WAAA,OAAM,gBACH,gBACA,eAcD,4BAAA,oBAAA,iBAAA,YAAA,QAAM;;;;4BAzBP,WAAW,oBAAoB;4BAE/B,WAAW,oBAAoB;4BACrC,SAAS,OAAO;4BAEhB,IAAI,UAAU,MAAM;gCAClB;;;4BACF;4BAEK,kCAAA,2BAAA;;gCAAL,IAAK,YAAwB,OAAO,WAAW,uBAA1C,6BAAA,QAAA,yBAAA,iCAA4C;oCAAtC,iBAAN;oCACG,iBAAiB,aAAa;oCAC9B,gBAAgB,oBAAoB;oCAE1C,iFAAiF;oCACjF,oBAAoB;gCACtB;;gCANK;gCAAA;;;yCAAA,6BAAA;wCAAA;;;wCAAA;8CAAA;;;;4BAQL,kFAAkF;4BAClF;;gCAAM,QAAQ,GAAG,CACf,OAAO,WAAW,CAAC,GAAG,CAAC,SAAC;2CACtB,iBAAiB,WAAW;;;;4BAFhC;4BAMA,IAAI,OAAO,gBAAgB,CAAC,MAAM,GAAG,GAAG;gCACjC,mCAAA,4BAAA;;oCAAL,IAAK,aAAkB,OAAO,gBAAgB,uBAAzC,8BAAA,SAAA,0BAAA,kCAA2C;wCAArC,WAAN;wCACH,8BAA8B,WAAW;oCAC3C;;oCAFK;oCAA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,IAAI,CAAC,qCAA3B,SAAA,6BAAA,QAAA,yBAAA,iCAA6C;4BAA7C,IAAM,SAAN;4BACH,OAAO,gBAAgB,CAAC,SAAS;gCAC/B,SAAS,MAAM;4BACjB;wBACF;;wBAJK;wBAAA;;;iCAAA,6BAAA;gCAAA;;;gCAAA;sCAAA;;;;gBAKP,OAAO;oBACL,IAAM,UAAS,SAAS,aAAa,CAAC;oBACtC,QAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,QAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}] } \ No newline at end of file From fb09d0ee6cab2663a4f0810bed8a69182107a414 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:51:58 +0100 Subject: [PATCH 10/25] update next-custom-transforms tests --- .../tests/fixture/optimize-barrel/normal/2/output.js | 1 - .../tests/fixture/optimize-barrel/normal/4/output.js | 5 +---- .../client-graph/client-entry/output.js | 4 ++-- .../server-graph/client-entry/output.js | 3 +-- .../tests/fixture/server-actions/client-graph/1/output.js | 1 - .../tests/fixture/server-actions/client-graph/2/output.js | 1 - .../tests/fixture/server-actions/server-graph/27/output.js | 6 +++--- .../tests/fixture/server-actions/server-graph/3/output.js | 1 - .../tests/fixture/server-actions/server-graph/46/output.js | 4 ++-- .../tests/fixture/server-actions/server-graph/9/output.js | 1 - .../tests/loader/auto-cjs/react-prod/output.js | 2 +- 11 files changed, 10 insertions(+), 19 deletions(-) diff --git a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js index 3fe5e5efedc73d..e69de29bb2d1d6 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js @@ -1 +0,0 @@ -// De-optimize this file \ No newline at end of file diff --git a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js index 4f0a733801c733..98e09a6f987582 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js @@ -1,5 +1,2 @@ -/* Test */ /* Test directives inside comments -'use server' -*/ // This should be kept export const __next_private_export_map__ = '[["x","foo","a"],["y","1","y"],["b","foo","b"],["default","foo","default"],["z","bar","default"]]'; -export const __next_private_directive_list__ = '["use client"]'; \ No newline at end of file +export const __next_private_directive_list__ = '["use client"]'; diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js index cbef357e0a8f3f..b1f4fb1826ed34 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js @@ -1,5 +1,5 @@ -// This is a comment. -/* __next_internal_client_entry_do_not_use__ default auto */ 'use strict'; +/* __next_internal_client_entry_do_not_use__ default auto */ // This is a comment. +'use strict'; // This is a comment. 'foo'; import 'fs'; diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js index c2fb0f7bcd2e33..ac2f1f2651c8f9 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js @@ -1,3 +1,2 @@ -// This is a comment. -/* __next_internal_client_entry_do_not_use__ default,a,b,c,*,f auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ default,a,b,c,*,f auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/some-project/src/some-file.js"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js index c19f55642934b4..6a7d1aff3ca08f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js @@ -1,4 +1,3 @@ -// app/send.ts /* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var myAction = /*#__PURE__*/ createServerReference("70e10665baac148856374b2789aceb970f66fec33e", callServer, void 0, findSourceMapURL, "myAction"); export default /*#__PURE__*/ createServerReference("00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js index 3a85bb2c0107de..c400ea1163260e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js @@ -1,3 +1,2 @@ -// app/send.ts /* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var foo = /*#__PURE__*/ createServerReference("7fab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js index ee38e802379e1f..c60a975d390445 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js @@ -1,8 +1,8 @@ -// Rules here: +/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +export const // Rules here: // 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`. // 2. Actual action functions should be renamed to `$$ACTION_...` and got exported. -/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -export const $$RSC_SERVER_ACTION_0 = async function foo() { +$$RSC_SERVER_ACTION_0 = async function foo() { console.log(1); }; registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js index 8f6423eb8c6cd5..d6b54a2cdd7330 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js @@ -1,4 +1,3 @@ -// app/send.ts /* __next_internal_action_entry_do_not_use__ {"70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export async function myAction(a, b, c) { console.log('a'); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js index 23462c0f5f5edc..b1edb481fdd848 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js @@ -1,8 +1,8 @@ -// This is for testing the "information byte" of Server Action / Cache IDs. -// Should be 1 110000 0, which is "e0" in hex. /* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7ea9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","ff471a5eb0be1c31686dd4ba938a80328b80b1615d":"$$RSC_SERVER_CACHE_5","ff69348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; +// This is for testing the "information byte" of Server Action / Cache IDs. +// Should be 1 110000 0, which is "e0" in hex. const $$RSC_SERVER_CACHE_0_INNER = async function f1(a, b) { return [ a, diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js index 819c150ad859ad..ba4fff3e6b9ef7 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js @@ -1,4 +1,3 @@ -// app/send.ts /* __next_internal_action_entry_do_not_use__ {"7f050e3854b72b19e3c7e3966a67535543a90bf7e0":"baz","7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; async function foo() {} export { foo }; diff --git a/crates/next-custom-transforms/tests/loader/auto-cjs/react-prod/output.js b/crates/next-custom-transforms/tests/loader/auto-cjs/react-prod/output.js index ea48c9707f0a95..a5f75804fc7f51 100644 --- a/crates/next-custom-transforms/tests/loader/auto-cjs/react-prod/output.js +++ b/crates/next-custom-transforms/tests/loader/auto-cjs/react-prod/output.js @@ -1,9 +1,9 @@ -// This file should not import helpers using ESM syntax "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _class_call_check = require("@swc/helpers/_/_class_call_check"); +// This file should not import helpers using ESM syntax var E = function Foo() { "use strict"; _class_call_check._(this, Foo); From e51c4afb87e2f732f812925b1d51ae38eb350d58 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:35:46 +0100 Subject: [PATCH 11/25] cleanup --- crates/next-api/src/server_actions.rs | 6 +- crates/next-custom-transforms/Cargo.toml | 2 +- .../src/transforms/fonts/mod.rs | 6 +- .../src/transforms/import_analyzer.rs | 17 ++-- .../src/transforms/mod.rs | 9 +++ .../src/transforms/named_import_transform.rs | 21 +++-- .../src/transforms/optimize_barrel.rs | 40 +++------- .../src/transforms/optimize_server_react.rs | 15 ++-- .../src/transforms/react_server_components.rs | 50 ++++-------- .../src/transforms/server_actions.rs | 79 +++++-------------- crates/next-custom-transforms/tests/errors.rs | 12 +-- .../src/analyzer/imports.rs | 38 +++------ .../crates/turbopack-ecmascript/src/utils.rs | 10 ++- 13 files changed, 112 insertions(+), 193 deletions(-) diff --git a/crates/next-api/src/server_actions.rs b/crates/next-api/src/server_actions.rs index f119bdd26bc6c4..e047d6e9929685 100644 --- a/crates/next-api/src/server_actions.rs +++ b/crates/next-api/src/server_actions.rs @@ -363,7 +363,7 @@ fn all_export_names(program: &Program) -> Vec { for s in decl.specifiers.iter() { match s { ExportSpecifier::Named(named) => { - exports.push(module_export_name_to_atom( + exports.push(export_name_to_atom_lossy( named.exported.as_ref().unwrap_or(&named.orig), )); } @@ -371,7 +371,7 @@ fn all_export_names(program: &Program) -> Vec { exports.push(atom!("default")); } ExportSpecifier::Namespace(e) => { - exports.push(module_export_name_to_atom(&e.name)); + exports.push(export_name_to_atom_lossy(&e.name)); } } } @@ -408,7 +408,7 @@ fn is_turbopack_internal_var(with: &Option>) -> bool { .unwrap_or(false) } -fn module_export_name_to_atom(name: &ModuleExportName) -> Atom { +fn export_name_to_atom_lossy(name: &ModuleExportName) -> Atom { match name { ModuleExportName::Ident(ident) => ident.sym.clone(), ModuleExportName::Str(s) => s.value.to_atom_lossy().into_owned(), diff --git a/crates/next-custom-transforms/Cargo.toml b/crates/next-custom-transforms/Cargo.toml index d6a29b386ab772..9c697f24ab6c2d 100644 --- a/crates/next-custom-transforms/Cargo.toml +++ b/crates/next-custom-transforms/Cargo.toml @@ -72,5 +72,5 @@ remove_console = { workspace = true } preset_env_base = { workspace = true } [dev-dependencies] -swc_core = { workspace = true, features = ["testing_transform", "plugin_backend_wasmer"] } +swc_core = { workspace = true, features = ["testing_transform"] } testing = { workspace = true } diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index 8155ba4bfc0901..a430883405599b 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -6,7 +6,7 @@ use swc_core::{ ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, + visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, }, }; @@ -18,7 +18,7 @@ mod font_imports_generator; #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Config { pub font_loaders: Vec, - pub relative_file_path_from_root: Wtf8Atom, + pub relative_file_path_from_root: Atom, } pub fn next_font_loaders(config: Config) -> impl Pass + VisitMut { @@ -64,7 +64,7 @@ impl VisitMut for NextFontLoaders { // Generate imports from font function calls let mut import_generator = font_imports_generator::FontImportsGenerator { state: &mut self.state, - relative_path: &self.config.relative_file_path_from_root.to_string_lossy(), + relative_path: &self.config.relative_file_path_from_root, }; items.visit_with(&mut import_generator); diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index 29fdb5d22f8804..e0c137ad060d41 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,15 +1,17 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, + atoms::{Atom, Wtf8Atom, atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, - Module, ModuleExportName, + Module, }, - visit::{noop_visit_type, Visit, VisitWith}, + visit::{Visit, VisitWith, noop_visit_type}, }, }; +use crate::transforms::export_name_to_atom_lossy; + #[derive(Debug, Default)] pub(crate) struct ImportMap { /// Map from module name to (module path, exported symbol) @@ -77,7 +79,7 @@ impl Visit for Analyzer<'_> { ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => match imported { - Some(imported) => (local.to_id(), orig_name(imported)), + Some(imported) => (local.to_id(), export_name_to_atom_lossy(imported)), _ => (local.to_id(), local.sym.clone()), }, ImportSpecifier::Default(s) => (s.local.to_id(), atom!("default")), @@ -95,10 +97,3 @@ impl Visit for Analyzer<'_> { } } } - -fn orig_name(n: &ModuleExportName) -> Atom { - match n { - ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), - } -} diff --git a/crates/next-custom-transforms/src/transforms/mod.rs b/crates/next-custom-transforms/src/transforms/mod.rs index 287bfec0a24728..9a5904ac7b322a 100644 --- a/crates/next-custom-transforms/src/transforms/mod.rs +++ b/crates/next-custom-transforms/src/transforms/mod.rs @@ -1,3 +1,5 @@ +use swc_core::{atoms::Atom, ecma::ast::ModuleExportName}; + pub mod cjs_finder; pub mod cjs_optimizer; pub mod debug_fn_name; @@ -21,3 +23,10 @@ pub mod warn_for_edge_runtime; //[TODO] PACK-1564: need to decide reuse vs. turbopack specific pub mod named_import_transform; + +pub(crate) fn export_name_to_atom_lossy(n: &ModuleExportName) -> Atom { + match n { + ModuleExportName::Ident(v) => v.sym.clone(), + ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), + } +} diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index a611517e9b101f..cbb39e8b5ace1c 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,10 +5,12 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; +use crate::transforms::export_name_to_atom_lossy; + #[derive(Clone, Debug, Deserialize)] pub struct Config { pub packages: Vec, @@ -46,17 +48,9 @@ impl Fold for NamedImportTransform { ImportSpecifier::Named(specifier) => { // Add the import name as string to the set if let Some(imported) = &specifier.imported { - match imported { - ModuleExportName::Ident(ident) => { - specifier_names.insert(ident.sym.to_string()); - } - ModuleExportName::Str(str_) => { - specifier_names - .insert(str_.value.to_string_lossy().into_owned()); - } - } + specifier_names.insert(export_name_to_atom_lossy(imported)); } else { - specifier_names.insert(specifier.local.sym.to_string()); + specifier_names.insert(specifier.local.sym.clone()); } } ImportSpecifier::Default(_) => { @@ -71,7 +65,10 @@ impl Fold for NamedImportTransform { } if !skip_transform { - let mut names = specifier_names.into_iter().collect::>(); + let mut names = specifier_names + .iter() + .map(|n| n.as_str()) + .collect::>(); // Sort the names to make sure the order is consistent names.sort(); diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index c717e6884606cf..a62dbd3aa375e1 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -2,15 +2,17 @@ use std::collections::HashMap; use serde::Deserialize; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, + atoms::{Atom, Wtf8Atom, atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; +use crate::transforms::export_name_to_atom_lossy; + #[derive(Clone, Debug, Deserialize)] pub struct Config { pub wildcard: bool, @@ -45,12 +47,7 @@ impl Fold for OptimizeBarrel { ( src.clone(), match &s.imported { - Some(n) => match &n { - ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => { - n.value.clone().to_atom_lossy().into_owned() - } - }, + Some(n) => export_name_to_atom_lossy(n), None => s.local.sym.clone(), }, ), @@ -94,12 +91,7 @@ impl Fold for OptimizeBarrel { for spec in &export_named.specifiers { match spec { ExportSpecifier::Namespace(s) => { - let name_str = match &s.name { - ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => { - n.value.clone().to_atom_lossy().into_owned() - } - }; + let name_str = export_name_to_atom_lossy(&s.name); if let Some(src) = &export_named.src { export_map.push(( name_str.clone(), @@ -118,21 +110,11 @@ impl Fold for OptimizeBarrel { } } ExportSpecifier::Named(s) => { - let orig_str = match &s.orig { - ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => { - n.value.clone().to_atom_lossy().into_owned() - } - }; - let name_str = match &s.exported { - Some(n) => match &n { - ModuleExportName::Ident(n) => n.sym.clone(), - ModuleExportName::Str(n) => { - n.value.clone().to_atom_lossy().into_owned() - } - }, - None => orig_str.clone(), - }; + let orig_str = export_name_to_atom_lossy(&s.orig); + let name_str = s.exported.as_ref().map_or_else( + || orig_str.clone(), + export_name_to_atom_lossy, + ); if let Some(src) = &export_named.src { export_map.push(( diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index bf88fb20b44f3b..cbc367eca44725 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -8,10 +8,12 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass}, }, }; +use crate::transforms::export_name_to_atom_lossy; + #[derive(Clone, Debug, Deserialize)] pub struct Config { pub optimize_use_state: bool, @@ -106,13 +108,10 @@ impl Fold for OptimizeServerReact { } for specifier in &import_decl.specifiers { if let ImportSpecifier::Named(named_import) = specifier { - let name = match &named_import.imported { - Some(n) => match &n { - ModuleExportName::Ident(n) => n.sym.to_string(), - ModuleExportName::Str(n) => n.value.to_string_lossy().into_owned(), - }, - None => named_import.local.sym.to_string(), - }; + let name = named_import.imported.as_ref().map_or_else( + || named_import.local.sym.clone(), + export_name_to_atom_lossy, + ); if name == "useState" { self.use_state_ident = Some(named_import.local.to_id()); diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index 82d308aec7a1c7..6eb357d6d7ebc3 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,25 +11,25 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, - FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, + utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, visit::{ - noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, - VisitWith, + Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, + visit_mut_pass, }, }, }; use super::{cjs_finder::contains_cjs, import_analyzer::ImportMap}; -use crate::FxIndexMap; +use crate::{FxIndexMap, transforms::export_name_to_atom_lossy}; #[derive(Clone, Debug, Deserialize)] #[serde(untagged)] @@ -485,12 +485,9 @@ fn collect_module_info( }) .map(|specifier| match specifier { ImportSpecifier::Named(named) => match &named.imported { - Some(imported) => match &imported { - ModuleExportName::Ident(i) => (i.to_id().0, i.span), - ModuleExportName::Str(s) => { - (s.value.clone().to_atom_lossy().into_owned(), s.span) - } - }, + Some(imported) => { + (export_name_to_atom_lossy(imported), imported.span()) + } None => (named.local.to_id().0, named.local.span), }, ImportSpecifier::Default(d) => (atom!(""), d.span), @@ -512,18 +509,8 @@ fn collect_module_info( ExportSpecifier::Default(_) => atom!("default"), ExportSpecifier::Namespace(_) => atom!("*"), ExportSpecifier::Named(named) => match &named.exported { - Some(exported) => match &exported { - ModuleExportName::Ident(i) => i.sym.clone(), - ModuleExportName::Str(s) => { - s.value.clone().to_atom_lossy().into_owned() - } - }, - _ => match &named.orig { - ModuleExportName::Ident(i) => i.sym.clone(), - ModuleExportName::Str(s) => { - s.value.clone().to_atom_lossy().into_owned() - } - }, + Some(exported) => export_name_to_atom_lossy(exported), + None => export_name_to_atom_lossy(&named.orig), }, }) } @@ -906,17 +893,10 @@ impl ReactServerComponentValidator { ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(export)) => { for specifier in &export.specifiers { if let ExportSpecifier::Named(named) = specifier { - match &named.orig { - ModuleExportName::Ident(i) => { - collect_possibly_invalid_exports(&i.sym, &named.span); - } - ModuleExportName::Str(s) => { - collect_possibly_invalid_exports( - &s.value.to_atom_lossy(), - &named.span, - ); - } - } + collect_possibly_invalid_exports( + &export_name_to_atom_lossy(&named.orig), + &named.span, + ); } } } diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index 113498abe2c48e..c50c9c9a849210 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -34,7 +34,7 @@ use swc_core::{ }; use turbo_rcstr::{rcstr, RcStr}; -use crate::FxIndexMap; +use crate::{transforms::export_name_to_atom_lossy, FxIndexMap}; #[derive(Clone, Copy, Debug, Deserialize)] pub enum ServerActionsMode { @@ -1503,64 +1503,25 @@ impl VisitMut for ServerActions { }) = spec { if !*is_type_only { - if let Some(export_name) = exported { - if let ModuleExportName::Ident(Ident { - sym, .. - }) = export_name - { - // export { foo as bar } - self.server_reference_exports.push( - ServerReferenceExport { - ident: ident.clone(), - export_name: sym.clone(), - reference_id: self - .generate_server_reference_id( - sym.as_ref(), - in_cache_file, - None, - ), - }, - ); - } else if let ModuleExportName::Str(str) = - export_name - { - // export { foo as "bar" } - self.server_reference_exports.push( - ServerReferenceExport { - ident: ident.clone(), - export_name: str - .value - .clone() - .to_atom_lossy() - .into_owned(), - reference_id: self - .generate_server_reference_id( - str.value - .clone() - .to_atom_lossy() - .into_owned() - .as_ref(), - in_cache_file, - None, - ), - }, - ); - } - } else { - // export { foo } - self.server_reference_exports.push( - ServerReferenceExport { - ident: ident.clone(), - export_name: ident.sym.clone(), - reference_id: self - .generate_server_reference_id( - ident.sym.as_ref(), - in_cache_file, - None, - ), - }, - ); - } + // export { foo as bar } + // export { foo as "bar" } + // export { foo } + let export_name = exported.as_ref().map_or_else( + || ident.sym.clone(), + export_name_to_atom_lossy, + ); + let id = self.generate_server_reference_id( + &export_name, + in_cache_file, + None, + ); + self.server_reference_exports.push( + ServerReferenceExport { + ident: ident.clone(), + export_name, + reference_id: id, + }, + ); } } else { disallowed_export_span = named.span; diff --git a/crates/next-custom-transforms/tests/errors.rs b/crates/next-custom-transforms/tests/errors.rs index e0c3c7a43f6248..8bd88ef11b06db 100644 --- a/crates/next-custom-transforms/tests/errors.rs +++ b/crates/next-custom-transforms/tests/errors.rs @@ -2,12 +2,12 @@ use std::{iter::FromIterator, path::PathBuf}; use next_custom_transforms::transforms::{ disallow_re_export_all_in_page::disallow_re_export_all_in_page, - dynamic::{next_dynamic, NextDynamicMode}, - fonts::{next_font_loaders, Config as FontLoaderConfig}, + dynamic::{NextDynamicMode, next_dynamic}, + fonts::{Config as FontLoaderConfig, next_font_loaders}, next_ssg::next_ssg, react_server_components::server_components, - server_actions::{self, server_actions, ServerActionsMode}, - strip_page_exports::{next_transform_strip_page_exports, ExportFilter}, + server_actions::{self, ServerActionsMode, server_actions}, + strip_page_exports::{ExportFilter, next_transform_strip_page_exports}, }; use rustc_hash::FxHashSet; use swc_core::{ @@ -17,7 +17,7 @@ use swc_core::{ parser::{EsSyntax, Syntax}, transforms::{ base::resolver, - testing::{test_fixture, FixtureTestConfig}, + testing::{FixtureTestConfig, test_fixture}, }, }, }; @@ -135,7 +135,7 @@ fn next_font_loaders_errors(input: PathBuf) { syntax(), &|_tr| { next_font_loaders(FontLoaderConfig { - relative_file_path_from_root: atom!("pages/test.tsx").into(), + relative_file_path_from_root: atom!("pages/test.tsx"), font_loaders: vec![ atom!("@next/font/google").into(), atom!("cool-fonts").into(), diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs index eb02f30fce9e67..4c378b8b4c95a9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs @@ -22,6 +22,7 @@ use crate::{ analyzer::{ConstantValue, ObjectPart}, magic_identifier, tree_shake::{PartId, find_turbopack_part_id_in_asserts}, + utils::export_name_to_atom_lossy, }; #[turbo_tasks::value] @@ -455,13 +456,6 @@ impl Analyzer<'_> { } } -fn export_as_atom(name: &'_ ModuleExportName) -> Cow<'_, Atom> { - match name { - ModuleExportName::Ident(ident) => Cow::Borrowed(&ident.sym), - ModuleExportName::Str(s) => s.value.to_atom_lossy(), - } -} - impl Visit for Analyzer<'_> { fn visit_import_decl(&mut self, import: &ImportDecl) { self.data.has_imports = true; @@ -498,7 +492,7 @@ impl Visit for Analyzer<'_> { ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => match imported { - Some(imported) => (local.to_id(), orig_name(imported)), + Some(imported) => (local.to_id(), export_name_to_atom_lossy(imported)), _ => (local.to_id(), local.sym.clone()), }, ImportSpecifier::Default(s) => (s.local.to_id(), atom!("default")), @@ -584,7 +578,7 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Namespace { - exported: export_as_atom(&n.name).clone().into_owned(), + exported: export_name_to_atom_lossy(&n.name), }, )); } @@ -601,10 +595,10 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Named { - imported: export_as_atom(&n.orig).clone().into_owned(), - exported: export_as_atom(n.exported.as_ref().unwrap_or(&n.orig)) - .clone() - .into_owned(), + imported: export_name_to_atom_lossy(&n.orig), + exported: export_name_to_atom_lossy( + n.exported.as_ref().unwrap_or(&n.orig), + ), }, )); } @@ -700,9 +694,10 @@ impl Visit for Analyzer<'_> { unreachable!("string reexports should have been already handled in visit_named_export"); }; let exported = n.exported.as_ref().unwrap_or(&n.orig); - self.data - .exports - .insert(export_as_atom(exported).as_str().into(), local.to_id()); + self.data.exports.insert( + export_name_to_atom_lossy(exported).as_str().into(), + local.to_id(), + ); } fn visit_export_default_specifier(&mut self, n: &ExportDefaultSpecifier) { @@ -815,13 +810,6 @@ fn parse_ignore_directive(comments: &dyn Comments, value: Option<&ExprOrSpread>) .next() } -pub(crate) fn orig_name(n: &ModuleExportName) -> Atom { - match n { - ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), - } -} - fn parse_with(with: Option<&ObjectLit>) -> Option { find_turbopack_part_id_in_asserts(with?).map(|v| match v { PartId::Internal(index, true) => ImportedSymbol::PartEvaluation(index), @@ -837,7 +825,7 @@ fn get_import_symbol_from_import(specifier: &ImportSpecifier) -> ImportedSymbol ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => ImportedSymbol::Symbol(match imported { - Some(imported) => orig_name(imported), + Some(imported) => export_name_to_atom_lossy(imported), _ => local.sym.clone(), }), ImportSpecifier::Default(..) => ImportedSymbol::Symbol(atom!("default")), @@ -848,7 +836,7 @@ fn get_import_symbol_from_import(specifier: &ImportSpecifier) -> ImportedSymbol fn get_import_symbol_from_export(specifier: &ExportSpecifier) -> ImportedSymbol { match specifier { ExportSpecifier::Named(ExportNamedSpecifier { orig, .. }) => { - ImportedSymbol::Symbol(orig_name(orig)) + ImportedSymbol::Symbol(export_name_to_atom_lossy(orig)) } ExportSpecifier::Default(..) => ImportedSymbol::Symbol(atom!("default")), ExportSpecifier::Namespace(..) => ImportedSymbol::Exports, diff --git a/turbopack/crates/turbopack-ecmascript/src/utils.rs b/turbopack/crates/turbopack-ecmascript/src/utils.rs index a8649de3acd737..9fd44991e29e36 100644 --- a/turbopack/crates/turbopack-ecmascript/src/utils.rs +++ b/turbopack/crates/turbopack-ecmascript/src/utils.rs @@ -2,9 +2,10 @@ use std::ops::Deref; use serde::{Deserialize, Serialize}; use swc_core::{ + atoms::Atom, common::{DUMMY_SP, SyntaxContext}, ecma::{ - ast::{Expr, Lit, Str}, + ast::{Expr, Lit, ModuleExportName, Str}, visit::AstParentKind, }, }; @@ -96,6 +97,13 @@ pub fn module_id_to_lit(module_id: &ModuleId) -> Expr { }) } +pub(crate) fn export_name_to_atom_lossy(n: &ModuleExportName) -> Atom { + match n { + ModuleExportName::Ident(v) => v.sym.clone(), + ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), + } +} + pub struct StringifyModuleId<'a>(pub &'a ModuleId); impl std::fmt::Display for StringifyModuleId<'_> { From be4ad6247bf7c41146b33a374806b11f959dfa97 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:03:23 +0100 Subject: [PATCH 12/25] Fixup --- .../src/transforms/cjs_optimizer.rs | 16 ++++++++-------- .../src/transforms/debug_fn_name.rs | 4 ++-- .../src/transforms/dynamic.rs | 14 +++++++------- .../fonts/find_functions_outside_module_scope.rs | 2 +- .../transforms/fonts/font_functions_collector.rs | 2 +- .../transforms/fonts/font_imports_generator.rs | 4 ++-- .../src/transforms/named_import_transform.rs | 11 +++++------ .../src/transforms/next_ssg.rs | 8 ++++---- .../src/transforms/page_config.rs | 4 ++-- .../src/transforms/pure.rs | 4 ++-- .../src/transforms/shake_exports.rs | 6 +++--- .../src/transforms/strip_page_exports.rs | 4 ++-- .../src/transforms/track_dynamic_imports.rs | 4 ++-- .../src/transforms/warn_for_edge_runtime.rs | 6 +++--- 14 files changed, 44 insertions(+), 45 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index 1ce7d0ded12912..dbd8b59f981b4b 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::{atom, Wtf8Atom}, - common::{util::take::Take, SyntaxContext, DUMMY_SP}, + atoms::{Wtf8Atom, atom}, + common::{DUMMY_SP, SyntaxContext, util::take::Take}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, - visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, + utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, + visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, }, }; @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![Expr::Lit(Lit::Str( - renamed.clone().into(), - )) - .as_arg()], + args: vec![ + Expr::Lit(Lit::Str(renamed.clone().into())) + .as_arg(), + ], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs index de43510ef2c3b4..a11fd6a132d105 100644 --- a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs +++ b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs @@ -2,14 +2,14 @@ use std::fmt::Write; use swc_core::{ atoms::Atom, - common::{util::take::Take, DUMMY_SP}, + common::{DUMMY_SP, util::take::Take}, ecma::{ ast::{ CallExpr, Callee, ExportDefaultDecl, ExportDefaultExpr, Expr, FnDecl, FnExpr, KeyValueProp, MemberProp, ObjectLit, Pass, PropOrSpread, VarDeclarator, }, utils::ExprFactory, - visit::{visit_mut_pass, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, visit_mut_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index b5ee1508ec07c7..d1b86c7748bc18 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, - common::{errors::HANDLER, FileName, Span, DUMMY_SP}, + atoms::{Atom, Wtf8Atom, atom}, + common::{DUMMY_SP, FileName, Span, errors::HANDLER}, ecma::{ ast::{ - op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, - Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, + ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, }, - utils::{private_ident, quote_ident, ExprFactory}, - visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, + utils::{ExprFactory, private_ident, quote_ident}, + visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index bdfc46e0016191..a233a74ec4e976 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index 2da4eaa7cf41bf..912631b9e3c31f 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -3,7 +3,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index da2ad8a0b7e4e5..aaef6f15d82278 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ atoms::Wtf8Atom, - common::{errors::HANDLER, Spanned, DUMMY_SP}, + common::{DUMMY_SP, Spanned, errors::HANDLER}, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index cbb39e8b5ace1c..057ac551a096fa 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -31,7 +31,7 @@ struct NamedImportTransform { impl Fold for NamedImportTransform { fn fold_import_decl(&mut self, decl: ImportDecl) -> ImportDecl { // Match named imports and check if it's included in the packages - let src_value = decl.src.value.clone(); + let src_value = &decl.src.value; if self .packages @@ -47,11 +47,10 @@ impl Fold for NamedImportTransform { match specifier { ImportSpecifier::Named(specifier) => { // Add the import name as string to the set - if let Some(imported) = &specifier.imported { - specifier_names.insert(export_name_to_atom_lossy(imported)); - } else { - specifier_names.insert(specifier.local.sym.clone()); - } + specifier_names.insert(specifier.imported.as_ref().map_or_else( + || specifier.local.sym.clone(), + export_name_to_atom_lossy, + )); } ImportSpecifier::Default(_) => { skip_transform = true; diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 15219051d9e607..9cba705cd84e60 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{bail, Error}; +use easy_error::{Error, bail}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass, noop_fold_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/page_config.rs b/crates/next-custom-transforms/src/transforms/page_config.rs index da98feb2b263b7..be857334dc11b9 100644 --- a/crates/next-custom-transforms/src/transforms/page_config.rs +++ b/crates/next-custom-transforms/src/transforms/page_config.rs @@ -1,9 +1,9 @@ use chrono::Utc; use swc_core::{ - common::{errors::HANDLER, Span, DUMMY_SP}, + common::{DUMMY_SP, Span, errors::HANDLER}, ecma::{ ast::*, - visit::{fold_pass, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/pure.rs b/crates/next-custom-transforms/src/transforms/pure.rs index b0ffbfe905823c..8c020075ad5a35 100644 --- a/crates/next-custom-transforms/src/transforms/pure.rs +++ b/crates/next-custom-transforms/src/transforms/pure.rs @@ -1,8 +1,8 @@ use swc_core::{ - common::{comments::Comments, errors::HANDLER, util::take::Take, Span, Spanned, DUMMY_SP}, + common::{DUMMY_SP, Span, Spanned, comments::Comments, errors::HANDLER, util::take::Take}, ecma::{ ast::{CallExpr, Callee, EmptyStmt, Expr, Module, ModuleDecl, ModuleItem, Stmt}, - visit::{noop_visit_mut_type, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, noop_visit_mut_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/shake_exports.rs b/crates/next-custom-transforms/src/transforms/shake_exports.rs index 5217ca8f3f1941..1cbf32c6a423dc 100644 --- a/crates/next-custom-transforms/src/transforms/shake_exports.rs +++ b/crates/next-custom-transforms/src/transforms/shake_exports.rs @@ -3,9 +3,9 @@ use swc_core::{ common::Mark, ecma::{ ast::*, - atoms::{atom, Atom}, - transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, - visit::{fold_pass, Fold, FoldWith, VisitMutWith}, + atoms::{Atom, atom}, + transforms::optimization::simplify::dce::{Config as DCEConfig, dce}, + visit::{Fold, FoldWith, VisitMutWith, fold_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index b8bb0508fd0fb9..cd6a74ed24ce82 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, + visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs index 60c8badf7dc5d9..871d13e878e4d9 100644 --- a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs +++ b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs @@ -1,9 +1,9 @@ use swc_core::{ - common::{source_map::PURE_SP, util::take::Take, Mark, SyntaxContext}, + common::{Mark, SyntaxContext, source_map::PURE_SP, util::take::Take}, ecma::{ ast::*, utils::{prepend_stmt, private_ident, quote_ident, quote_str}, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 9d91a1e0bae9bc..bb845d8c123b81 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -2,11 +2,11 @@ use std::sync::Arc; use swc_core::{ atoms::{Atom, Wtf8Atom}, - common::{errors::HANDLER, SourceMap, Span}, + common::{SourceMap, Span, errors::HANDLER}, ecma::{ ast::{ - op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, + BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, op, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, From 194ab02413935acf509d00f951331d994176d5de Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:05:47 +0100 Subject: [PATCH 13/25] format --- .../src/transforms/cjs_optimizer.rs | 16 ++++++++-------- .../src/transforms/debug_fn_name.rs | 4 ++-- .../src/transforms/dynamic.rs | 14 +++++++------- .../fonts/find_functions_outside_module_scope.rs | 2 +- .../transforms/fonts/font_functions_collector.rs | 2 +- .../transforms/fonts/font_imports_generator.rs | 4 ++-- .../src/transforms/fonts/mod.rs | 2 +- .../src/transforms/import_analyzer.rs | 4 ++-- .../src/transforms/named_import_transform.rs | 2 +- .../src/transforms/next_ssg.rs | 8 ++++---- .../src/transforms/optimize_barrel.rs | 4 ++-- .../src/transforms/optimize_server_react.rs | 2 +- .../src/transforms/page_config.rs | 4 ++-- .../src/transforms/pure.rs | 4 ++-- .../src/transforms/react_server_components.rs | 12 ++++++------ .../src/transforms/shake_exports.rs | 6 +++--- .../src/transforms/strip_page_exports.rs | 4 ++-- .../src/transforms/track_dynamic_imports.rs | 4 ++-- .../src/transforms/warn_for_edge_runtime.rs | 6 +++--- crates/next-custom-transforms/tests/errors.rs | 10 +++++----- 20 files changed, 57 insertions(+), 57 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index dbd8b59f981b4b..1ce7d0ded12912 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::{Wtf8Atom, atom}, - common::{DUMMY_SP, SyntaxContext, util::take::Take}, + atoms::{atom, Wtf8Atom}, + common::{util::take::Take, SyntaxContext, DUMMY_SP}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, - visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, + utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, + visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, }, }; @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![ - Expr::Lit(Lit::Str(renamed.clone().into())) - .as_arg(), - ], + args: vec![Expr::Lit(Lit::Str( + renamed.clone().into(), + )) + .as_arg()], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs index a11fd6a132d105..de43510ef2c3b4 100644 --- a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs +++ b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs @@ -2,14 +2,14 @@ use std::fmt::Write; use swc_core::{ atoms::Atom, - common::{DUMMY_SP, util::take::Take}, + common::{util::take::Take, DUMMY_SP}, ecma::{ ast::{ CallExpr, Callee, ExportDefaultDecl, ExportDefaultExpr, Expr, FnDecl, FnExpr, KeyValueProp, MemberProp, ObjectLit, Pass, PropOrSpread, VarDeclarator, }, utils::ExprFactory, - visit::{VisitMut, VisitMutWith, visit_mut_pass}, + visit::{visit_mut_pass, VisitMut, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index d1b86c7748bc18..b5ee1508ec07c7 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, - common::{DUMMY_SP, FileName, Span, errors::HANDLER}, + atoms::{atom, Atom, Wtf8Atom}, + common::{errors::HANDLER, FileName, Span, DUMMY_SP}, ecma::{ ast::{ - ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, - ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, + Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, }, - utils::{ExprFactory, private_ident, quote_ident}, - visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, + utils::{private_ident, quote_ident, ExprFactory}, + visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index a233a74ec4e976..bdfc46e0016191 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index 912631b9e3c31f..2da4eaa7cf41bf 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -3,7 +3,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index aaef6f15d82278..da2ad8a0b7e4e5 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ atoms::Wtf8Atom, - common::{DUMMY_SP, Spanned, errors::HANDLER}, + common::{errors::HANDLER, Spanned, DUMMY_SP}, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index a430883405599b..b5a24ae35027e9 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -6,7 +6,7 @@ use swc_core::{ ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index e0c137ad060d41..a21f7ad6d954b0 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,12 +1,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Module, }, - visit::{Visit, VisitWith, noop_visit_type}, + visit::{noop_visit_type, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index 057ac551a096fa..4980d351c8af9f 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,7 +5,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 9cba705cd84e60..15219051d9e607 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{Error, bail}; +use easy_error::{bail, Error}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass, noop_fold_type}, + visit::{fold_pass, noop_fold_type, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index a62dbd3aa375e1..53b7f4b8678442 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -2,12 +2,12 @@ use std::collections::HashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index cbc367eca44725..0aeffb506a8d38 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -8,7 +8,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass}, + visit::{fold_pass, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/page_config.rs b/crates/next-custom-transforms/src/transforms/page_config.rs index be857334dc11b9..da98feb2b263b7 100644 --- a/crates/next-custom-transforms/src/transforms/page_config.rs +++ b/crates/next-custom-transforms/src/transforms/page_config.rs @@ -1,9 +1,9 @@ use chrono::Utc; use swc_core::{ - common::{DUMMY_SP, Span, errors::HANDLER}, + common::{errors::HANDLER, Span, DUMMY_SP}, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass}, + visit::{fold_pass, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/pure.rs b/crates/next-custom-transforms/src/transforms/pure.rs index 8c020075ad5a35..b0ffbfe905823c 100644 --- a/crates/next-custom-transforms/src/transforms/pure.rs +++ b/crates/next-custom-transforms/src/transforms/pure.rs @@ -1,8 +1,8 @@ use swc_core::{ - common::{DUMMY_SP, Span, Spanned, comments::Comments, errors::HANDLER, util::take::Take}, + common::{comments::Comments, errors::HANDLER, util::take::Take, Span, Spanned, DUMMY_SP}, ecma::{ ast::{CallExpr, Callee, EmptyStmt, Expr, Module, ModuleDecl, ModuleItem, Stmt}, - visit::{VisitMut, VisitMutWith, noop_visit_mut_type}, + visit::{noop_visit_mut_type, VisitMut, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index 6eb357d6d7ebc3..bd510c42f3b740 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,25 +11,25 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, + FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, + utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, visit::{ - Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, - visit_mut_pass, + noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, + VisitWith, }, }, }; use super::{cjs_finder::contains_cjs, import_analyzer::ImportMap}; -use crate::{FxIndexMap, transforms::export_name_to_atom_lossy}; +use crate::{transforms::export_name_to_atom_lossy, FxIndexMap}; #[derive(Clone, Debug, Deserialize)] #[serde(untagged)] diff --git a/crates/next-custom-transforms/src/transforms/shake_exports.rs b/crates/next-custom-transforms/src/transforms/shake_exports.rs index 1cbf32c6a423dc..5217ca8f3f1941 100644 --- a/crates/next-custom-transforms/src/transforms/shake_exports.rs +++ b/crates/next-custom-transforms/src/transforms/shake_exports.rs @@ -3,9 +3,9 @@ use swc_core::{ common::Mark, ecma::{ ast::*, - atoms::{Atom, atom}, - transforms::optimization::simplify::dce::{Config as DCEConfig, dce}, - visit::{Fold, FoldWith, VisitMutWith, fold_pass}, + atoms::{atom, Atom}, + transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, + visit::{fold_pass, Fold, FoldWith, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index cd6a74ed24ce82..b8bb0508fd0fb9 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, + visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs index 871d13e878e4d9..60c8badf7dc5d9 100644 --- a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs +++ b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs @@ -1,9 +1,9 @@ use swc_core::{ - common::{Mark, SyntaxContext, source_map::PURE_SP, util::take::Take}, + common::{source_map::PURE_SP, util::take::Take, Mark, SyntaxContext}, ecma::{ ast::*, utils::{prepend_stmt, private_ident, quote_ident, quote_str}, - visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index bb845d8c123b81..9d91a1e0bae9bc 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -2,11 +2,11 @@ use std::sync::Arc; use swc_core::{ atoms::{Atom, Wtf8Atom}, - common::{SourceMap, Span, errors::HANDLER}, + common::{errors::HANDLER, SourceMap, Span}, ecma::{ ast::{ - BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, op, + op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, diff --git a/crates/next-custom-transforms/tests/errors.rs b/crates/next-custom-transforms/tests/errors.rs index 8bd88ef11b06db..4d6714691e533e 100644 --- a/crates/next-custom-transforms/tests/errors.rs +++ b/crates/next-custom-transforms/tests/errors.rs @@ -2,12 +2,12 @@ use std::{iter::FromIterator, path::PathBuf}; use next_custom_transforms::transforms::{ disallow_re_export_all_in_page::disallow_re_export_all_in_page, - dynamic::{NextDynamicMode, next_dynamic}, - fonts::{Config as FontLoaderConfig, next_font_loaders}, + dynamic::{next_dynamic, NextDynamicMode}, + fonts::{next_font_loaders, Config as FontLoaderConfig}, next_ssg::next_ssg, react_server_components::server_components, - server_actions::{self, ServerActionsMode, server_actions}, - strip_page_exports::{ExportFilter, next_transform_strip_page_exports}, + server_actions::{self, server_actions, ServerActionsMode}, + strip_page_exports::{next_transform_strip_page_exports, ExportFilter}, }; use rustc_hash::FxHashSet; use swc_core::{ @@ -17,7 +17,7 @@ use swc_core::{ parser::{EsSyntax, Syntax}, transforms::{ base::resolver, - testing::{FixtureTestConfig, test_fixture}, + testing::{test_fixture, FixtureTestConfig}, }, }, }; From bd43f1d7280163407251ea5f6e635cecd3ef349b Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:20:31 +0100 Subject: [PATCH 14/25] cleanup --- crates/next-api/src/server_actions.rs | 24 +++++++------- .../src/transforms/import_analyzer.rs | 8 ++--- .../src/transforms/mod.rs | 9 ----- .../src/transforms/named_import_transform.rs | 6 ++-- .../src/transforms/optimize_barrel.rs | 14 ++++---- .../src/transforms/optimize_server_react.rs | 33 +++++++++++-------- .../src/transforms/react_server_components.rs | 31 ++++++++--------- .../src/transforms/server_actions.rs | 20 +++++------ .../src/analyzer/imports.rs | 22 +++++-------- .../crates/turbopack-ecmascript/src/utils.rs | 10 +----- 10 files changed, 75 insertions(+), 102 deletions(-) diff --git a/crates/next-api/src/server_actions.rs b/crates/next-api/src/server_actions.rs index e047d6e9929685..258bc4d2a765a9 100644 --- a/crates/next-api/src/server_actions.rs +++ b/crates/next-api/src/server_actions.rs @@ -12,8 +12,8 @@ use swc_core::{ common::comments::Comments, ecma::{ ast::{ - Decl, ExportSpecifier, Id, ModuleDecl, ModuleExportName, ModuleItem, ObjectLit, - Program, PropOrSpread::Prop, + Decl, ExportSpecifier, Id, ModuleDecl, ModuleItem, ObjectLit, Program, + PropOrSpread::Prop, }, utils::find_pat_ids, }, @@ -363,15 +363,20 @@ fn all_export_names(program: &Program) -> Vec { for s in decl.specifiers.iter() { match s { ExportSpecifier::Named(named) => { - exports.push(export_name_to_atom_lossy( - named.exported.as_ref().unwrap_or(&named.orig), - )); + exports.push( + named + .exported + .as_ref() + .unwrap_or(&named.orig) + .atom() + .into_owned(), + ); } ExportSpecifier::Default(_) => { exports.push(atom!("default")); } ExportSpecifier::Namespace(e) => { - exports.push(export_name_to_atom_lossy(&e.name)); + exports.push(e.name.atom().into_owned()); } } } @@ -408,13 +413,6 @@ fn is_turbopack_internal_var(with: &Option>) -> bool { .unwrap_or(false) } -fn export_name_to_atom_lossy(name: &ModuleExportName) -> Atom { - match name { - ModuleExportName::Ident(ident) => ident.sym.clone(), - ModuleExportName::Str(s) => s.value.to_atom_lossy().into_owned(), - } -} - type HashToLayerNameModule = Vec<(String, (ActionLayer, String, ResolvedVc>))>; /// A mapping of every module which exports a Server Action, with the hashed id diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index a21f7ad6d954b0..31169557349844 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,17 +1,15 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, + atoms::{Atom, Wtf8Atom, atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Module, }, - visit::{noop_visit_type, Visit, VisitWith}, + visit::{Visit, VisitWith, noop_visit_type}, }, }; -use crate::transforms::export_name_to_atom_lossy; - #[derive(Debug, Default)] pub(crate) struct ImportMap { /// Map from module name to (module path, exported symbol) @@ -79,7 +77,7 @@ impl Visit for Analyzer<'_> { ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => match imported { - Some(imported) => (local.to_id(), export_name_to_atom_lossy(imported)), + Some(imported) => (local.to_id(), imported.atom().into_owned()), _ => (local.to_id(), local.sym.clone()), }, ImportSpecifier::Default(s) => (s.local.to_id(), atom!("default")), diff --git a/crates/next-custom-transforms/src/transforms/mod.rs b/crates/next-custom-transforms/src/transforms/mod.rs index 9a5904ac7b322a..287bfec0a24728 100644 --- a/crates/next-custom-transforms/src/transforms/mod.rs +++ b/crates/next-custom-transforms/src/transforms/mod.rs @@ -1,5 +1,3 @@ -use swc_core::{atoms::Atom, ecma::ast::ModuleExportName}; - pub mod cjs_finder; pub mod cjs_optimizer; pub mod debug_fn_name; @@ -23,10 +21,3 @@ pub mod warn_for_edge_runtime; //[TODO] PACK-1564: need to decide reuse vs. turbopack specific pub mod named_import_transform; - -pub(crate) fn export_name_to_atom_lossy(n: &ModuleExportName) -> Atom { - match n { - ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), - } -} diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index 4980d351c8af9f..f5daad547f17c3 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,12 +5,10 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; -use crate::transforms::export_name_to_atom_lossy; - #[derive(Clone, Debug, Deserialize)] pub struct Config { pub packages: Vec, @@ -49,7 +47,7 @@ impl Fold for NamedImportTransform { // Add the import name as string to the set specifier_names.insert(specifier.imported.as_ref().map_or_else( || specifier.local.sym.clone(), - export_name_to_atom_lossy, + |i| i.atom().into_owned(), )); } ImportSpecifier::Default(_) => { diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 53b7f4b8678442..96e46d51122fde 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -2,17 +2,15 @@ use std::collections::HashMap; use serde::Deserialize; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, + atoms::{Atom, Wtf8Atom, atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{fold_pass, Fold}, + visit::{Fold, fold_pass}, }, }; -use crate::transforms::export_name_to_atom_lossy; - #[derive(Clone, Debug, Deserialize)] pub struct Config { pub wildcard: bool, @@ -47,7 +45,7 @@ impl Fold for OptimizeBarrel { ( src.clone(), match &s.imported { - Some(n) => export_name_to_atom_lossy(n), + Some(n) => n.atom().into_owned(), None => s.local.sym.clone(), }, ), @@ -91,7 +89,7 @@ impl Fold for OptimizeBarrel { for spec in &export_named.specifiers { match spec { ExportSpecifier::Namespace(s) => { - let name_str = export_name_to_atom_lossy(&s.name); + let name_str = s.name.atom().into_owned(); if let Some(src) = &export_named.src { export_map.push(( name_str.clone(), @@ -110,10 +108,10 @@ impl Fold for OptimizeBarrel { } } ExportSpecifier::Named(s) => { - let orig_str = export_name_to_atom_lossy(&s.orig); + let orig_str = s.orig.atom().into_owned(); let name_str = s.exported.as_ref().map_or_else( || orig_str.clone(), - export_name_to_atom_lossy, + |i| i.atom().into_owned(), ); if let Some(src) = &export_named.src { diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index 0aeffb506a8d38..8617c877894532 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -2,18 +2,18 @@ // - Removes `useEffect` and `useLayoutEffect` calls // - Refactors `useState` calls (under the `optimize_use_state` flag) +use std::borrow::Cow; + use serde::Deserialize; use swc_core::{ atoms::atom, common::DUMMY_SP, ecma::{ ast::*, - visit::{fold_pass, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass}, }, }; -use crate::transforms::export_name_to_atom_lossy; - #[derive(Clone, Debug, Deserialize)] pub struct Config { pub optimize_use_state: bool, @@ -108,17 +108,22 @@ impl Fold for OptimizeServerReact { } for specifier in &import_decl.specifiers { if let ImportSpecifier::Named(named_import) = specifier { - let name = named_import.imported.as_ref().map_or_else( - || named_import.local.sym.clone(), - export_name_to_atom_lossy, - ); - - if name == "useState" { - self.use_state_ident = Some(named_import.local.to_id()); - } else if name == "useEffect" { - self.use_effect_ident = Some(named_import.local.to_id()); - } else if name == "useLayoutEffect" { - self.use_layout_effect_ident = Some(named_import.local.to_id()); + let name = named_import + .imported + .as_ref() + .map_or_else(|| Cow::Borrowed(&named_import.local.sym), |i| i.atom()); + + match &**name { + "useState" => { + self.use_state_ident = Some(named_import.local.to_id()); + } + "useEffect" => { + self.use_effect_ident = Some(named_import.local.to_id()); + } + "useLayoutEffect" => { + self.use_layout_effect_ident = Some(named_import.local.to_id()); + } + _ => {} } } else if let ImportSpecifier::Default(default_import) = specifier { self.react_ident = Some(default_import.local.to_id()); diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index bd510c42f3b740..e9177c9e713aca 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,25 +11,25 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, - FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, + utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, visit::{ - noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, - VisitWith, + Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, + visit_mut_pass, }, }, }; use super::{cjs_finder::contains_cjs, import_analyzer::ImportMap}; -use crate::{transforms::export_name_to_atom_lossy, FxIndexMap}; +use crate::FxIndexMap; #[derive(Clone, Debug, Deserialize)] #[serde(untagged)] @@ -485,9 +485,7 @@ fn collect_module_info( }) .map(|specifier| match specifier { ImportSpecifier::Named(named) => match &named.imported { - Some(imported) => { - (export_name_to_atom_lossy(imported), imported.span()) - } + Some(imported) => (imported.atom().into_owned(), imported.span()), None => (named.local.to_id().0, named.local.span), }, ImportSpecifier::Default(d) => (atom!(""), d.span), @@ -508,10 +506,12 @@ fn collect_module_info( export_names.push(match specifier { ExportSpecifier::Default(_) => atom!("default"), ExportSpecifier::Namespace(_) => atom!("*"), - ExportSpecifier::Named(named) => match &named.exported { - Some(exported) => export_name_to_atom_lossy(exported), - None => export_name_to_atom_lossy(&named.orig), - }, + ExportSpecifier::Named(named) => named + .exported + .as_ref() + .unwrap_or(&named.orig) + .atom() + .into_owned(), }) } finished_directives = true; @@ -893,10 +893,7 @@ impl ReactServerComponentValidator { ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(export)) => { for specifier in &export.specifiers { if let ExportSpecifier::Named(named) = specifier { - collect_possibly_invalid_exports( - &export_name_to_atom_lossy(&named.orig), - &named.span, - ); + collect_possibly_invalid_exports(&named.orig.atom(), &named.span); } } } diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index c50c9c9a849210..98cdbf64218add 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -1,6 +1,6 @@ use std::{ cell::RefCell, - collections::{hash_map, BTreeMap}, + collections::{BTreeMap, hash_map}, convert::{TryFrom, TryInto}, mem::{replace, take}, path::{Path, PathBuf}, @@ -16,25 +16,25 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use sha1::{Digest, Sha1}; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + BytePos, DUMMY_SP, FileName, Mark, SourceMap, Span, SyntaxContext, comments::{Comment, CommentKind, Comments, SingleThreadedComments}, errors::HANDLER, - source_map::{SourceMapGenConfig, PURE_SP}, + source_map::{PURE_SP, SourceMapGenConfig}, util::take::Take, - BytePos, FileName, Mark, SourceMap, Span, SyntaxContext, DUMMY_SP, }, ecma::{ ast::*, - codegen::{self, text_writer::JsWriter, Emitter}, - utils::{private_ident, quote_ident, ExprFactory}, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, + codegen::{self, Emitter, text_writer::JsWriter}, + utils::{ExprFactory, private_ident, quote_ident}, + visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, }, quote, }; -use turbo_rcstr::{rcstr, RcStr}; +use turbo_rcstr::{RcStr, rcstr}; -use crate::{transforms::export_name_to_atom_lossy, FxIndexMap}; +use crate::FxIndexMap; #[derive(Clone, Copy, Debug, Deserialize)] pub enum ServerActionsMode { @@ -1508,7 +1508,7 @@ impl VisitMut for ServerActions { // export { foo } let export_name = exported.as_ref().map_or_else( || ident.sym.clone(), - export_name_to_atom_lossy, + |i| i.atom().into_owned(), ); let id = self.generate_server_reference_id( &export_name, diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs index 4c378b8b4c95a9..e098d3f1f47dbc 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs @@ -22,7 +22,6 @@ use crate::{ analyzer::{ConstantValue, ObjectPart}, magic_identifier, tree_shake::{PartId, find_turbopack_part_id_in_asserts}, - utils::export_name_to_atom_lossy, }; #[turbo_tasks::value] @@ -492,7 +491,7 @@ impl Visit for Analyzer<'_> { ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => match imported { - Some(imported) => (local.to_id(), export_name_to_atom_lossy(imported)), + Some(imported) => (local.to_id(), imported.atom().into_owned()), _ => (local.to_id(), local.sym.clone()), }, ImportSpecifier::Default(s) => (s.local.to_id(), atom!("default")), @@ -578,7 +577,7 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Namespace { - exported: export_name_to_atom_lossy(&n.name), + exported: n.name.atom().into_owned(), }, )); } @@ -595,10 +594,8 @@ impl Visit for Analyzer<'_> { self.data.reexports.push(( i, Reexport::Named { - imported: export_name_to_atom_lossy(&n.orig), - exported: export_name_to_atom_lossy( - n.exported.as_ref().unwrap_or(&n.orig), - ), + imported: n.orig.atom().into_owned(), + exported: n.exported.as_ref().unwrap_or(&n.orig).atom().into_owned(), }, )); } @@ -694,10 +691,9 @@ impl Visit for Analyzer<'_> { unreachable!("string reexports should have been already handled in visit_named_export"); }; let exported = n.exported.as_ref().unwrap_or(&n.orig); - self.data.exports.insert( - export_name_to_atom_lossy(exported).as_str().into(), - local.to_id(), - ); + self.data + .exports + .insert(exported.atom().as_str().into(), local.to_id()); } fn visit_export_default_specifier(&mut self, n: &ExportDefaultSpecifier) { @@ -825,7 +821,7 @@ fn get_import_symbol_from_import(specifier: &ImportSpecifier) -> ImportedSymbol ImportSpecifier::Named(ImportNamedSpecifier { local, imported, .. }) => ImportedSymbol::Symbol(match imported { - Some(imported) => export_name_to_atom_lossy(imported), + Some(imported) => imported.atom().into_owned(), _ => local.sym.clone(), }), ImportSpecifier::Default(..) => ImportedSymbol::Symbol(atom!("default")), @@ -836,7 +832,7 @@ fn get_import_symbol_from_import(specifier: &ImportSpecifier) -> ImportedSymbol fn get_import_symbol_from_export(specifier: &ExportSpecifier) -> ImportedSymbol { match specifier { ExportSpecifier::Named(ExportNamedSpecifier { orig, .. }) => { - ImportedSymbol::Symbol(export_name_to_atom_lossy(orig)) + ImportedSymbol::Symbol(orig.atom().into_owned()) } ExportSpecifier::Default(..) => ImportedSymbol::Symbol(atom!("default")), ExportSpecifier::Namespace(..) => ImportedSymbol::Exports, diff --git a/turbopack/crates/turbopack-ecmascript/src/utils.rs b/turbopack/crates/turbopack-ecmascript/src/utils.rs index 9fd44991e29e36..a8649de3acd737 100644 --- a/turbopack/crates/turbopack-ecmascript/src/utils.rs +++ b/turbopack/crates/turbopack-ecmascript/src/utils.rs @@ -2,10 +2,9 @@ use std::ops::Deref; use serde::{Deserialize, Serialize}; use swc_core::{ - atoms::Atom, common::{DUMMY_SP, SyntaxContext}, ecma::{ - ast::{Expr, Lit, ModuleExportName, Str}, + ast::{Expr, Lit, Str}, visit::AstParentKind, }, }; @@ -97,13 +96,6 @@ pub fn module_id_to_lit(module_id: &ModuleId) -> Expr { }) } -pub(crate) fn export_name_to_atom_lossy(n: &ModuleExportName) -> Atom { - match n { - ModuleExportName::Ident(v) => v.sym.clone(), - ModuleExportName::Str(v) => v.value.clone().to_atom_lossy().into_owned(), - } -} - pub struct StringifyModuleId<'a>(pub &'a ModuleId); impl std::fmt::Display for StringifyModuleId<'_> { From 54a0dcde9ace866ba56b18e5012525ba46395414 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:22:56 +0100 Subject: [PATCH 15/25] fixup --- .../src/transforms/cjs_optimizer.rs | 16 ++++++++-------- .../src/transforms/debug_fn_name.rs | 4 ++-- .../src/transforms/dynamic.rs | 14 +++++++------- .../fonts/find_functions_outside_module_scope.rs | 2 +- .../transforms/fonts/font_functions_collector.rs | 2 +- .../transforms/fonts/font_imports_generator.rs | 4 ++-- .../src/transforms/fonts/mod.rs | 2 +- .../src/transforms/next_ssg.rs | 8 ++++---- .../src/transforms/page_config.rs | 4 ++-- .../src/transforms/pure.rs | 4 ++-- .../src/transforms/shake_exports.rs | 6 +++--- .../src/transforms/strip_page_exports.rs | 4 ++-- .../src/transforms/track_dynamic_imports.rs | 4 ++-- .../src/transforms/warn_for_edge_runtime.rs | 6 +++--- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index 1ce7d0ded12912..dbd8b59f981b4b 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::{atom, Wtf8Atom}, - common::{util::take::Take, SyntaxContext, DUMMY_SP}, + atoms::{Wtf8Atom, atom}, + common::{DUMMY_SP, SyntaxContext, util::take::Take}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, - visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, + utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, + visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, }, }; @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![Expr::Lit(Lit::Str( - renamed.clone().into(), - )) - .as_arg()], + args: vec![ + Expr::Lit(Lit::Str(renamed.clone().into())) + .as_arg(), + ], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs index de43510ef2c3b4..a11fd6a132d105 100644 --- a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs +++ b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs @@ -2,14 +2,14 @@ use std::fmt::Write; use swc_core::{ atoms::Atom, - common::{util::take::Take, DUMMY_SP}, + common::{DUMMY_SP, util::take::Take}, ecma::{ ast::{ CallExpr, Callee, ExportDefaultDecl, ExportDefaultExpr, Expr, FnDecl, FnExpr, KeyValueProp, MemberProp, ObjectLit, Pass, PropOrSpread, VarDeclarator, }, utils::ExprFactory, - visit::{visit_mut_pass, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, visit_mut_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index b5ee1508ec07c7..d1b86c7748bc18 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{atom, Atom, Wtf8Atom}, - common::{errors::HANDLER, FileName, Span, DUMMY_SP}, + atoms::{Atom, Wtf8Atom, atom}, + common::{DUMMY_SP, FileName, Span, errors::HANDLER}, ecma::{ ast::{ - op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, - Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, + ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, }, - utils::{private_ident, quote_ident, ExprFactory}, - visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, + utils::{ExprFactory, private_ident, quote_ident}, + visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index bdfc46e0016191..a233a74ec4e976 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index 2da4eaa7cf41bf..912631b9e3c31f 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -3,7 +3,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index da2ad8a0b7e4e5..aaef6f15d82278 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ atoms::Wtf8Atom, - common::{errors::HANDLER, Spanned, DUMMY_SP}, + common::{DUMMY_SP, Spanned, errors::HANDLER}, ecma::{ ast::*, - visit::{noop_visit_type, Visit}, + visit::{Visit, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index b5a24ae35027e9..a430883405599b 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -6,7 +6,7 @@ use swc_core::{ ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, + visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 15219051d9e607..9cba705cd84e60 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{bail, Error}; +use easy_error::{Error, bail}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{atom, Atom}, + atoms::{Atom, atom}, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass, noop_fold_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/page_config.rs b/crates/next-custom-transforms/src/transforms/page_config.rs index da98feb2b263b7..be857334dc11b9 100644 --- a/crates/next-custom-transforms/src/transforms/page_config.rs +++ b/crates/next-custom-transforms/src/transforms/page_config.rs @@ -1,9 +1,9 @@ use chrono::Utc; use swc_core::{ - common::{errors::HANDLER, Span, DUMMY_SP}, + common::{DUMMY_SP, Span, errors::HANDLER}, ecma::{ ast::*, - visit::{fold_pass, Fold, FoldWith}, + visit::{Fold, FoldWith, fold_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/pure.rs b/crates/next-custom-transforms/src/transforms/pure.rs index b0ffbfe905823c..8c020075ad5a35 100644 --- a/crates/next-custom-transforms/src/transforms/pure.rs +++ b/crates/next-custom-transforms/src/transforms/pure.rs @@ -1,8 +1,8 @@ use swc_core::{ - common::{comments::Comments, errors::HANDLER, util::take::Take, Span, Spanned, DUMMY_SP}, + common::{DUMMY_SP, Span, Spanned, comments::Comments, errors::HANDLER, util::take::Take}, ecma::{ ast::{CallExpr, Callee, EmptyStmt, Expr, Module, ModuleDecl, ModuleItem, Stmt}, - visit::{noop_visit_mut_type, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, noop_visit_mut_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/shake_exports.rs b/crates/next-custom-transforms/src/transforms/shake_exports.rs index 5217ca8f3f1941..1cbf32c6a423dc 100644 --- a/crates/next-custom-transforms/src/transforms/shake_exports.rs +++ b/crates/next-custom-transforms/src/transforms/shake_exports.rs @@ -3,9 +3,9 @@ use swc_core::{ common::Mark, ecma::{ ast::*, - atoms::{atom, Atom}, - transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, - visit::{fold_pass, Fold, FoldWith, VisitMutWith}, + atoms::{Atom, atom}, + transforms::optimization::simplify::dce::{Config as DCEConfig, dce}, + visit::{Fold, FoldWith, VisitMutWith, fold_pass}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index b8bb0508fd0fb9..cd6a74ed24ce82 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ + DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, - DUMMY_SP, }, ecma::{ ast::*, - visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, + visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs index 60c8badf7dc5d9..871d13e878e4d9 100644 --- a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs +++ b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs @@ -1,9 +1,9 @@ use swc_core::{ - common::{source_map::PURE_SP, util::take::Take, Mark, SyntaxContext}, + common::{Mark, SyntaxContext, source_map::PURE_SP, util::take::Take}, ecma::{ ast::*, utils::{prepend_stmt, private_ident, quote_ident, quote_str}, - visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, + visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 9d91a1e0bae9bc..bb845d8c123b81 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -2,11 +2,11 @@ use std::sync::Arc; use swc_core::{ atoms::{Atom, Wtf8Atom}, - common::{errors::HANDLER, SourceMap, Span}, + common::{SourceMap, Span, errors::HANDLER}, ecma::{ ast::{ - op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, + BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, op, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, From 495d0437c196730417b02fed627bb1cfec72fd3f Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:34:03 +0100 Subject: [PATCH 16/25] fixups --- .../src/transforms/optimize_barrel.rs | 2 +- .../src/transforms/react_server_components.rs | 76 ++++++++++--------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 96e46d51122fde..04616f8550cd94 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -197,7 +197,7 @@ impl Fold for OptimizeBarrel { Expr::Lit(l) => { if let Lit::Str(s) = l { if allowed_directives && s.value.starts_with("use ") { - directives.push(s.value.to_string_lossy().into_owned()); + directives.push(&s.value); } } else { allowed_directives = false; diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index e9177c9e713aca..18aa637edf187c 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,7 +11,7 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, atom}, + atoms::{Atom, Wtf8Atom, atom}, common::{ DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, @@ -70,7 +70,7 @@ struct ReactServerComponents { #[derive(Clone, Debug)] struct ModuleImports { - source: (Atom, Span), + source: (Wtf8Atom, Span), specifiers: Vec<(Atom, Span)>, } @@ -470,7 +470,7 @@ fn collect_module_info( type_only: false, .. }, )) => { - let source = import.src.value.clone().to_atom_lossy().into_owned(); + let source = import.src.value.clone(); let specifiers = import .specifiers .iter() @@ -578,11 +578,11 @@ struct ReactServerComponentValidator { use_cache_enabled: bool, filepath: String, app_dir: Option, - invalid_server_imports: Vec, - invalid_server_lib_apis_mapping: FxHashMap<&'static str, Vec<&'static str>>, - deprecated_apis_mapping: FxHashMap<&'static str, Vec<&'static str>>, - invalid_client_imports: Vec, - invalid_client_lib_apis_mapping: FxHashMap<&'static str, Vec<&'static str>>, + invalid_server_imports: Vec, + invalid_server_lib_apis_mapping: FxHashMap>, + deprecated_apis_mapping: FxHashMap>, + invalid_client_imports: Vec, + invalid_client_lib_apis_mapping: FxHashMap>, pub module_directive: Option, pub export_names: Vec, imports: ImportMap, @@ -609,7 +609,7 @@ impl ReactServerComponentValidator { // next/navigation -> [apis] invalid_server_lib_apis_mapping: FxHashMap::from_iter([ ( - "react", + atom!("react").into(), vec![ "Component", "createContext", @@ -631,7 +631,7 @@ impl ReactServerComponentValidator { ], ), ( - "react-dom", + atom!("react-dom").into(), vec![ "flushSync", "unstable_batchedUpdates", @@ -640,7 +640,7 @@ impl ReactServerComponentValidator { ], ), ( - "next/navigation", + atom!("next/navigation").into(), vec![ "useSearchParams", "usePathname", @@ -653,27 +653,30 @@ impl ReactServerComponentValidator { "unstable_isUnrecognizedActionError", ], ), - ("next/link", vec!["useLinkStatus"]), + (atom!("next/link").into(), vec!["useLinkStatus"]), ]), - deprecated_apis_mapping: FxHashMap::from_iter([("next/server", vec!["ImageResponse"])]), + deprecated_apis_mapping: FxHashMap::from_iter([( + atom!("next/server").into(), + vec!["ImageResponse"], + )]), invalid_server_imports: vec![ - Atom::from("client-only"), - Atom::from("react-dom/client"), - Atom::from("react-dom/server"), - Atom::from("next/router"), + atom!("client-only").into(), + atom!("react-dom/client").into(), + atom!("react-dom/server").into(), + atom!("next/router").into(), ], invalid_client_imports: vec![ - Atom::from("server-only"), - Atom::from("next/headers"), - Atom::from("next/root-params"), + atom!("server-only").into(), + atom!("next/headers").into(), + atom!("next/root-params").into(), ], invalid_client_lib_apis_mapping: FxHashMap::from_iter([ - ("next/server", vec!["after"]), + (atom!("next/server").into(), vec!["after"]), ( - "next/cache", + atom!("next/cache").into(), vec![ "revalidatePath", "revalidateTag", @@ -706,8 +709,8 @@ impl ReactServerComponentValidator { // e.g. // assert_invalid_server_lib_apis("react", import) // assert_invalid_server_lib_apis("react-dom", import) - fn assert_invalid_server_lib_apis(&self, import_source: String, import: &ModuleImports) { - let deprecated_apis = self.deprecated_apis_mapping.get(import_source.as_str()); + fn assert_invalid_server_lib_apis(&self, import_source: &Wtf8Atom, import: &ModuleImports) { + let deprecated_apis = self.deprecated_apis_mapping.get(import_source); if let Some(deprecated_apis) = deprecated_apis { for specifier in &import.specifiers { if deprecated_apis.contains(&specifier.0.as_str()) { @@ -715,7 +718,7 @@ impl ReactServerComponentValidator { &self.app_dir, &self.filepath, RSCErrorKind::NextRscErrDeprecatedApi(( - import_source.clone(), + import_source.to_string_lossy().into_owned(), specifier.0.to_string(), specifier.1, )), @@ -724,9 +727,7 @@ impl ReactServerComponentValidator { } } - let invalid_apis = self - .invalid_server_lib_apis_mapping - .get(import_source.as_str()); + let invalid_apis = self.invalid_server_lib_apis_mapping.get(import_source); if let Some(invalid_apis) = invalid_apis { for specifier in &import.specifiers { if invalid_apis.contains(&specifier.0.as_str()) { @@ -746,17 +747,19 @@ impl ReactServerComponentValidator { return; } for import in imports { - let source = import.source.0.clone(); - let source_str = source.to_string(); - if self.invalid_server_imports.contains(&source) { + let source = &import.source.0; + if self.invalid_server_imports.contains(source) { report_error( &self.app_dir, &self.filepath, - RSCErrorKind::NextRscErrServerImport((source_str.clone(), import.source.1)), + RSCErrorKind::NextRscErrServerImport(( + source.to_string_lossy().into_owned(), + import.source.1, + )), ); } - self.assert_invalid_server_lib_apis(source_str, import); + self.assert_invalid_server_lib_apis(source, import); } self.assert_invalid_api(module, false); @@ -804,11 +807,14 @@ impl ReactServerComponentValidator { report_error( &self.app_dir, &self.filepath, - RSCErrorKind::NextRscErrClientImport((source.to_string(), import.source.1)), + RSCErrorKind::NextRscErrClientImport(( + source.to_string_lossy().into_owned(), + import.source.1, + )), ); } - let invalid_apis = self.invalid_client_lib_apis_mapping.get(source.as_str()); + let invalid_apis = self.invalid_client_lib_apis_mapping.get(source); if let Some(invalid_apis) = invalid_apis { for specifier in &import.specifiers { if invalid_apis.contains(&specifier.0.as_str()) { From 7ea91b46d45299bb81ffe11ace4aca788a6b7fcb Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:39:41 +0100 Subject: [PATCH 17/25] fixup --- .../src/transforms/server_actions.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index 98cdbf64218add..90d0b73f935e20 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -2801,10 +2801,7 @@ impl DirectiveVisitor<'_> { location: self.location.clone(), }); } - } else if detect_similar_strings( - value.to_string_lossy().into_owned().as_ref(), - "use server", - ) { + } else if detect_similar_strings(&value.to_string_lossy(), "use server") { // Detect typo of "use server" emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, @@ -2904,10 +2901,7 @@ impl DirectiveVisitor<'_> { } } else { // Detect typo of "use cache" - if detect_similar_strings( - value.to_string_lossy().into_owned().as_ref(), - "use cache", - ) { + if detect_similar_strings(&value.to_string_lossy(), "use cache") { emit_error(ServerActionsErrorKind::MisspelledDirective { span: *span, directive: value.to_string_lossy().into_owned(), @@ -2927,7 +2921,7 @@ impl DirectiveVisitor<'_> { }) => { // Match `("use server")`. if value == "use server" - || detect_similar_strings(value.as_str().unwrap_or_default(), "use server") + || detect_similar_strings(&value.to_string_lossy(), "use server") { if self.is_allowed_position { emit_error(ServerActionsErrorKind::WrappedDirective { @@ -2942,7 +2936,7 @@ impl DirectiveVisitor<'_> { }); } } else if value == "use cache" - || detect_similar_strings(value.as_str().unwrap_or_default(), "use cache") + || detect_similar_strings(&value.to_string_lossy(), "use cache") { if self.is_allowed_position { emit_error(ServerActionsErrorKind::WrappedDirective { From 00b3db683a6eebea53793cc5f09e6a65f70dde40 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:42:53 +0100 Subject: [PATCH 18/25] format again --- crates/next-custom-transforms/Cargo.toml | 2 +- .../src/transforms/cjs_optimizer.rs | 16 ++++++++-------- .../src/transforms/debug_fn_name.rs | 4 ++-- .../src/transforms/dynamic.rs | 14 +++++++------- .../fonts/find_functions_outside_module_scope.rs | 2 +- .../transforms/fonts/font_functions_collector.rs | 2 +- .../transforms/fonts/font_imports_generator.rs | 4 ++-- .../src/transforms/fonts/mod.rs | 2 +- .../src/transforms/import_analyzer.rs | 4 ++-- .../src/transforms/named_import_transform.rs | 2 +- .../src/transforms/next_ssg.rs | 8 ++++---- .../src/transforms/optimize_barrel.rs | 4 ++-- .../src/transforms/optimize_server_react.rs | 2 +- .../src/transforms/page_config.rs | 4 ++-- .../src/transforms/pure.rs | 4 ++-- .../src/transforms/react_server_components.rs | 10 +++++----- .../src/transforms/server_actions.rs | 16 ++++++++-------- .../src/transforms/shake_exports.rs | 6 +++--- .../src/transforms/strip_page_exports.rs | 4 ++-- .../src/transforms/track_dynamic_imports.rs | 4 ++-- .../src/transforms/warn_for_edge_runtime.rs | 6 +++--- 21 files changed, 60 insertions(+), 60 deletions(-) diff --git a/crates/next-custom-transforms/Cargo.toml b/crates/next-custom-transforms/Cargo.toml index 9c697f24ab6c2d..d6a29b386ab772 100644 --- a/crates/next-custom-transforms/Cargo.toml +++ b/crates/next-custom-transforms/Cargo.toml @@ -72,5 +72,5 @@ remove_console = { workspace = true } preset_env_base = { workspace = true } [dev-dependencies] -swc_core = { workspace = true, features = ["testing_transform"] } +swc_core = { workspace = true, features = ["testing_transform", "plugin_backend_wasmer"] } testing = { workspace = true } diff --git a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs index dbd8b59f981b4b..1ce7d0ded12912 100644 --- a/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs +++ b/crates/next-custom-transforms/src/transforms/cjs_optimizer.rs @@ -1,16 +1,16 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use swc_core::{ - atoms::{Wtf8Atom, atom}, - common::{DUMMY_SP, SyntaxContext, util::take::Take}, + atoms::{atom, Wtf8Atom}, + common::{util::take::Take, SyntaxContext, DUMMY_SP}, ecma::{ ast::{ CallExpr, Callee, Decl, Expr, Id, Ident, IdentName, Lit, MemberExpr, MemberProp, Module, ModuleItem, Pat, Script, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::Atom, - utils::{ExprFactory, IdentRenamer, prepend_stmts, private_ident}, - visit::{Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type}, + utils::{prepend_stmts, private_ident, ExprFactory, IdentRenamer}, + visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith}, }, }; @@ -119,10 +119,10 @@ impl VisitMut for CjsOptimizer { self.unresolved_ctxt, ) .as_callee(), - args: vec![ - Expr::Lit(Lit::Str(renamed.clone().into())) - .as_arg(), - ], + args: vec![Expr::Lit(Lit::Str( + renamed.clone().into(), + )) + .as_arg()], ..Default::default() })), prop: MemberProp::Ident(IdentName::new( diff --git a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs index a11fd6a132d105..de43510ef2c3b4 100644 --- a/crates/next-custom-transforms/src/transforms/debug_fn_name.rs +++ b/crates/next-custom-transforms/src/transforms/debug_fn_name.rs @@ -2,14 +2,14 @@ use std::fmt::Write; use swc_core::{ atoms::Atom, - common::{DUMMY_SP, util::take::Take}, + common::{util::take::Take, DUMMY_SP}, ecma::{ ast::{ CallExpr, Callee, ExportDefaultDecl, ExportDefaultExpr, Expr, FnDecl, FnExpr, KeyValueProp, MemberProp, ObjectLit, Pass, PropOrSpread, VarDeclarator, }, utils::ExprFactory, - visit::{VisitMut, VisitMutWith, visit_mut_pass}, + visit::{visit_mut_pass, VisitMut, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/dynamic.rs b/crates/next-custom-transforms/src/transforms/dynamic.rs index d1b86c7748bc18..b5ee1508ec07c7 100644 --- a/crates/next-custom-transforms/src/transforms/dynamic.rs +++ b/crates/next-custom-transforms/src/transforms/dynamic.rs @@ -5,17 +5,17 @@ use std::{ use pathdiff::diff_paths; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, - common::{DUMMY_SP, FileName, Span, errors::HANDLER}, + atoms::{atom, Atom, Wtf8Atom}, + common::{errors::HANDLER, FileName, Span, DUMMY_SP}, ecma::{ ast::{ - ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr, - ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, + op, ArrayLit, ArrowExpr, BinExpr, BlockStmt, BlockStmtOrExpr, Bool, CallExpr, Callee, + Expr, ExprOrSpread, ExprStmt, Id, Ident, IdentName, ImportDecl, ImportNamedSpecifier, ImportSpecifier, KeyValueProp, Lit, ModuleDecl, ModuleItem, ObjectLit, Pass, Prop, - PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, op, + PropName, PropOrSpread, Stmt, Str, Tpl, UnaryExpr, UnaryOp, }, - utils::{ExprFactory, private_ident, quote_ident}, - visit::{Fold, FoldWith, VisitMut, VisitMutWith, fold_pass}, + utils::{private_ident, quote_ident, ExprFactory}, + visit::{fold_pass, Fold, FoldWith, VisitMut, VisitMutWith}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs index a233a74ec4e976..bdfc46e0016191 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs @@ -2,7 +2,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; pub struct FindFunctionsOutsideModuleScope<'a> { diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs index 912631b9e3c31f..2da4eaa7cf41bf 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs @@ -3,7 +3,7 @@ use swc_core::{ common::errors::HANDLER, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs index aaef6f15d82278..da2ad8a0b7e4e5 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs @@ -1,10 +1,10 @@ use serde_json::Value; use swc_core::{ atoms::Wtf8Atom, - common::{DUMMY_SP, Spanned, errors::HANDLER}, + common::{errors::HANDLER, Spanned, DUMMY_SP}, ecma::{ ast::*, - visit::{Visit, noop_visit_type}, + visit::{noop_visit_type, Visit}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/fonts/mod.rs b/crates/next-custom-transforms/src/transforms/fonts/mod.rs index a430883405599b..b5a24ae35027e9 100644 --- a/crates/next-custom-transforms/src/transforms/fonts/mod.rs +++ b/crates/next-custom-transforms/src/transforms/fonts/mod.rs @@ -6,7 +6,7 @@ use swc_core::{ ecma::{ ast::{Id, ModuleItem, Pass}, atoms::Atom, - visit::{VisitMut, VisitWith, noop_visit_mut_type, visit_mut_pass}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/import_analyzer.rs b/crates/next-custom-transforms/src/transforms/import_analyzer.rs index 31169557349844..aca0a163172991 100644 --- a/crates/next-custom-transforms/src/transforms/import_analyzer.rs +++ b/crates/next-custom-transforms/src/transforms/import_analyzer.rs @@ -1,12 +1,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, ecma::{ ast::{ Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Module, }, - visit::{Visit, VisitWith, noop_visit_type}, + visit::{noop_visit_type, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/named_import_transform.rs b/crates/next-custom-transforms/src/transforms/named_import_transform.rs index f5daad547f17c3..481a542f21dea9 100644 --- a/crates/next-custom-transforms/src/transforms/named_import_transform.rs +++ b/crates/next-custom-transforms/src/transforms/named_import_transform.rs @@ -5,7 +5,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/next_ssg.rs b/crates/next-custom-transforms/src/transforms/next_ssg.rs index 9cba705cd84e60..15219051d9e607 100644 --- a/crates/next-custom-transforms/src/transforms/next_ssg.rs +++ b/crates/next-custom-transforms/src/transforms/next_ssg.rs @@ -1,17 +1,17 @@ use std::{cell::RefCell, mem::take, rc::Rc}; -use easy_error::{Error, bail}; +use easy_error::{bail, Error}; use rustc_hash::FxHashSet; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass, noop_fold_type}, + visit::{fold_pass, noop_fold_type, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs index 04616f8550cd94..7a51c1ae1cf96c 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_barrel.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_barrel.rs @@ -2,12 +2,12 @@ use std::collections::HashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, common::DUMMY_SP, ecma::{ ast::*, utils::private_ident, - visit::{Fold, fold_pass}, + visit::{fold_pass, Fold}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index 8617c877894532..8897a7d3573540 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -10,7 +10,7 @@ use swc_core::{ common::DUMMY_SP, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass}, + visit::{fold_pass, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/page_config.rs b/crates/next-custom-transforms/src/transforms/page_config.rs index be857334dc11b9..da98feb2b263b7 100644 --- a/crates/next-custom-transforms/src/transforms/page_config.rs +++ b/crates/next-custom-transforms/src/transforms/page_config.rs @@ -1,9 +1,9 @@ use chrono::Utc; use swc_core::{ - common::{DUMMY_SP, Span, errors::HANDLER}, + common::{errors::HANDLER, Span, DUMMY_SP}, ecma::{ ast::*, - visit::{Fold, FoldWith, fold_pass}, + visit::{fold_pass, Fold, FoldWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/pure.rs b/crates/next-custom-transforms/src/transforms/pure.rs index 8c020075ad5a35..b0ffbfe905823c 100644 --- a/crates/next-custom-transforms/src/transforms/pure.rs +++ b/crates/next-custom-transforms/src/transforms/pure.rs @@ -1,8 +1,8 @@ use swc_core::{ - common::{DUMMY_SP, Span, Spanned, comments::Comments, errors::HANDLER, util::take::Take}, + common::{comments::Comments, errors::HANDLER, util::take::Take, Span, Spanned, DUMMY_SP}, ecma::{ ast::{CallExpr, Callee, EmptyStmt, Expr, Module, ModuleDecl, ModuleItem, Stmt}, - visit::{VisitMut, VisitMutWith, noop_visit_mut_type}, + visit::{noop_visit_mut_type, VisitMut, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/react_server_components.rs b/crates/next-custom-transforms/src/transforms/react_server_components.rs index 18aa637edf187c..f279bca68c3679 100644 --- a/crates/next-custom-transforms/src/transforms/react_server_components.rs +++ b/crates/next-custom-transforms/src/transforms/react_server_components.rs @@ -11,19 +11,19 @@ use regex::Regex; use rustc_hash::FxHashMap; use serde::Deserialize; use swc_core::{ - atoms::{Atom, Wtf8Atom, atom}, + atoms::{atom, Atom, Wtf8Atom}, common::{ - DUMMY_SP, FileName, Span, Spanned, comments::{Comment, CommentKind, Comments}, errors::HANDLER, util::take::Take, + FileName, Span, Spanned, DUMMY_SP, }, ecma::{ ast::*, - utils::{ExprFactory, prepend_stmts, quote_ident, quote_str}, + utils::{prepend_stmts, quote_ident, quote_str, ExprFactory}, visit::{ - Visit, VisitMut, VisitMutWith, VisitWith, noop_visit_mut_type, noop_visit_type, - visit_mut_pass, + noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, + VisitWith, }, }, }; diff --git a/crates/next-custom-transforms/src/transforms/server_actions.rs b/crates/next-custom-transforms/src/transforms/server_actions.rs index 90d0b73f935e20..1bff29c41fb289 100644 --- a/crates/next-custom-transforms/src/transforms/server_actions.rs +++ b/crates/next-custom-transforms/src/transforms/server_actions.rs @@ -1,6 +1,6 @@ use std::{ cell::RefCell, - collections::{BTreeMap, hash_map}, + collections::{hash_map, BTreeMap}, convert::{TryFrom, TryInto}, mem::{replace, take}, path::{Path, PathBuf}, @@ -16,23 +16,23 @@ use rustc_hash::{FxHashMap, FxHashSet}; use serde::Deserialize; use sha1::{Digest, Sha1}; use swc_core::{ - atoms::{Atom, atom}, + atoms::{atom, Atom}, common::{ - BytePos, DUMMY_SP, FileName, Mark, SourceMap, Span, SyntaxContext, comments::{Comment, CommentKind, Comments, SingleThreadedComments}, errors::HANDLER, - source_map::{PURE_SP, SourceMapGenConfig}, + source_map::{SourceMapGenConfig, PURE_SP}, util::take::Take, + BytePos, FileName, Mark, SourceMap, Span, SyntaxContext, DUMMY_SP, }, ecma::{ ast::*, - codegen::{self, Emitter, text_writer::JsWriter}, - utils::{ExprFactory, private_ident, quote_ident}, - visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, + codegen::{self, text_writer::JsWriter, Emitter}, + utils::{private_ident, quote_ident, ExprFactory}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, }, quote, }; -use turbo_rcstr::{RcStr, rcstr}; +use turbo_rcstr::{rcstr, RcStr}; use crate::FxIndexMap; diff --git a/crates/next-custom-transforms/src/transforms/shake_exports.rs b/crates/next-custom-transforms/src/transforms/shake_exports.rs index 1cbf32c6a423dc..5217ca8f3f1941 100644 --- a/crates/next-custom-transforms/src/transforms/shake_exports.rs +++ b/crates/next-custom-transforms/src/transforms/shake_exports.rs @@ -3,9 +3,9 @@ use swc_core::{ common::Mark, ecma::{ ast::*, - atoms::{Atom, atom}, - transforms::optimization::simplify::dce::{Config as DCEConfig, dce}, - visit::{Fold, FoldWith, VisitMutWith, fold_pass}, + atoms::{atom, Atom}, + transforms::optimization::simplify::dce::{dce, Config as DCEConfig}, + visit::{fold_pass, Fold, FoldWith, VisitMutWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs index cd6a74ed24ce82..b8bb0508fd0fb9 100644 --- a/crates/next-custom-transforms/src/transforms/strip_page_exports.rs +++ b/crates/next-custom-transforms/src/transforms/strip_page_exports.rs @@ -9,13 +9,13 @@ use rustc_hash::{FxHashMap, FxHashSet}; use swc_core::{ atoms::Atom, common::{ - DUMMY_SP, errors::HANDLER, pass::{Repeat, Repeated}, + DUMMY_SP, }, ecma::{ ast::*, - visit::{Fold, FoldWith, Visit, VisitWith, fold_pass, noop_fold_type, noop_visit_type}, + visit::{fold_pass, noop_fold_type, noop_visit_type, Fold, FoldWith, Visit, VisitWith}, }, }; diff --git a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs index 871d13e878e4d9..60c8badf7dc5d9 100644 --- a/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs +++ b/crates/next-custom-transforms/src/transforms/track_dynamic_imports.rs @@ -1,9 +1,9 @@ use swc_core::{ - common::{Mark, SyntaxContext, source_map::PURE_SP, util::take::Take}, + common::{source_map::PURE_SP, util::take::Take, Mark, SyntaxContext}, ecma::{ ast::*, utils::{prepend_stmt, private_ident, quote_ident, quote_str}, - visit::{VisitMut, VisitMutWith, noop_visit_mut_type, visit_mut_pass}, + visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, }, quote, }; diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index bb845d8c123b81..9d91a1e0bae9bc 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -2,11 +2,11 @@ use std::sync::Arc; use swc_core::{ atoms::{Atom, Wtf8Atom}, - common::{SourceMap, Span, errors::HANDLER}, + common::{errors::HANDLER, SourceMap, Span}, ecma::{ ast::{ - BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, - MemberExpr, MemberProp, NamedExport, UnaryExpr, op, + op, BinExpr, CallExpr, Callee, CondExpr, Expr, IdentName, IfStmt, ImportDecl, Lit, + MemberExpr, MemberProp, NamedExport, UnaryExpr, }, utils::{ExprCtx, ExprExt}, visit::{Visit, VisitWith}, From cfce5d4a6825b2a53dc7f92a26047064b56a35ea Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Wed, 19 Nov 2025 13:07:54 +0100 Subject: [PATCH 19/25] bump swc --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80d61597f8e4a5..e9c5345a332461 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7170,9 +7170,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "47.0.8" +version = "47.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47f64ffe01d83bf6c474743a9f686ea55e88229c8fa936e676d46fe3951687e" +checksum = "686662222a635f512f39547b4d9ccb0e7c5ad2a56d9850b6822108ef4771a15c" dependencies = [ "binding_macros", "par-core", @@ -7355,9 +7355,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "20.0.0" +version = "20.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a278bb4395127390f3a2ae2cacf6e276b446654fc7b31d0c7e7917035f8e86c3" +checksum = "78c3817344a95767419e9f0ae6df4edd01294e270f10480f6ddd0defda3d5436" dependencies = [ "ascii", "compact_str", @@ -7687,9 +7687,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "27.0.5" +version = "27.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fb46c651289a49664e66c035533bc06633faf48f659d8d71c3e2e5c6524469" +checksum = "0d55d5ad2d312b346f0ac295f8948e151943a711247b3652b2872b3a233e683d" dependencies = [ "bitflags 2.9.1", "either", diff --git a/Cargo.toml b/Cargo.toml index 3cdc296502dc08..57f11506f2662b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -337,7 +337,7 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } # SWC crates -swc_core = { version = "47.0.8", features = [ +swc_core = { version = "47.0.9", features = [ "ecma_loader_lru", "ecma_loader_parking_lot", "parallel_rayon", From e8d28545f971d4b3af9aa2b5521b94edf001805d Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 20 Nov 2025 10:42:20 +0100 Subject: [PATCH 20/25] bump swc --- Cargo.lock | 110 ++++++++++++++++++++++++++++++++++------------------- Cargo.toml | 14 +++---- 2 files changed, 77 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9c5345a332461..787e140251b15b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "binding_macros" -version = "45.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d37c4fc1ff2cfc99b1d5d022cec4b3f9299c6ef2f7690b408ae3e124a9a9e2" +checksum = "16e7003eecc20a5fb751e44c6e2ff799643fb894496eb946834d9ca2395fdbf8" dependencies = [ "anyhow", "console_error_panic_hook", @@ -3925,7 +3925,7 @@ dependencies = [ [[package]] name = "mdxjs" version = "1.0.4" -source = "git+https://github.com/mischnic/mdxjs-rs.git?branch=swc-core-32#2ea3e2e484e4983e8ee2f2054a5772880e8fc38d" +source = "git+https://github.com/mischnic/mdxjs-rs.git?branch=swc-core-32#677a68f7a2d93cb4fa60c50a6bf3e65e7d002b53" dependencies = [ "markdown", "rustc-hash 2.1.1", @@ -4099,9 +4099,9 @@ dependencies = [ [[package]] name = "modularize_imports" -version = "0.101.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd34545e153e519389791c32a8da9ea088008e9123c9a45bb0f8e881ee209e2" +checksum = "f54cf20ea9b5e1970cecdea127a4f97ddd1f003b7224ded9b9e2b799adc37eba" dependencies = [ "convert_case", "handlebars", @@ -5724,9 +5724,9 @@ dependencies = [ [[package]] name = "react_remove_properties" -version = "0.55.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231d29b20b318e992c94ccc729acf46cb0d767ca8d88c16ff3e4eff17f54a370" +checksum = "35f4745c52b2dc2630a2cc7639c3cf26543018cfcd2ce40b1263a64638c76e82" dependencies = [ "serde", "swc_atoms", @@ -5837,9 +5837,9 @@ checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" [[package]] name = "remove_console" -version = "0.56.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2cd55dd38f1133d0e4d07057b490283eeb7328d06317c3b4075455383422985" +checksum = "bf7460a881857b4b5c6c86afc8a53ad8fd91a370fb32a86d2ef249864ffcd7e4" dependencies = [ "serde", "swc_atoms", @@ -6909,9 +6909,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "styled_components" -version = "0.129.0" +version = "0.130.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3471f72eef9580d451d05de9aefc4b5c391c0145766b7bd723353725218cb2" +checksum = "9cc769504c1c754a95aa31bf69965b36fb6e22a4150b095d5fe12c18b086b8cb" dependencies = [ "Inflector", "once_cell", @@ -6972,9 +6972,9 @@ checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "swc" -version = "45.0.1" +version = "46.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e178c4c0826616b9daabaabcc9196e51c43dac9e42dbe3ee792458b045594" +checksum = "d530a187802af0d4e77ab20f0d09b1d3572addd47b56c4d8c84b3fa96038c9d5" dependencies = [ "anyhow", "base64 0.22.1", @@ -7170,9 +7170,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "47.0.9" +version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686662222a635f512f39547b4d9ccb0e7c5ad2a56d9850b6822108ef4771a15c" +checksum = "ac9fecd2de65d40ad1324a727cde1d94034ef4693cb919b18b36395a56825b19" dependencies = [ "binding_macros", "par-core", @@ -7355,9 +7355,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "20.0.1" +version = "20.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c3817344a95767419e9f0ae6df4edd01294e270f10480f6ddd0defda3d5436" +checksum = "ff2a6ee1ec49dda8dedeac54e4147b4e8b3f278d9bb34ab28983257a393d34ed" dependencies = [ "ascii", "compact_str", @@ -7390,9 +7390,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "33.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196ed37b7543d40ed330380c600ef8cb70bc26405dd8885614cc470a7a0d4209" +checksum = "e9525d4a1ef45d0bf107e3072ca66f6be32347497f96fac943d239be254366f8" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -7408,21 +7408,21 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b2330d0340d6c59733b6dd7382950d01a55e151e51e312346b0b20f33d1e81" +checksum = "9832454b771ecf27b29025f320c57700171a7600adfe02d7379cd849b8089e4d" dependencies = [ "swc_common", "swc_ecma_ast", + "swc_ecma_transformer", "swc_ecma_utils", - "swc_ecma_visit", ] [[package]] name = "swc_ecma_compat_es2015" -version = "33.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a522544927e02136ef402a589dc118cda486aaf89ceca7f3ba512644c0a6a4af" +checksum = "6755009006cd90c696ee1da34e2b1466b26d3d20f3630ef5fc2a321e705ebfaf" dependencies = [ "arrayvec 0.7.6", "indexmap 2.9.0", @@ -7479,9 +7479,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "30.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ab1f76516d475f02dcd8ee25687068fb9d61382fb5aef67183a6a6e678fb68" +checksum = "6eedffee837269b21d658ce837dd05931b6db137068c2e67f8c33cf225df8c35" dependencies = [ "serde", "swc_common", @@ -7512,15 +7512,16 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "31.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be3a3ab318b1995bbab55b952486b6c4d57859f84e214265e5b7cd40bb87d5f" +checksum = "4fe66e8a43f8cfb322735aabc2874329e9af0f87c6f4789e81e511acfd17390e" dependencies = [ "serde", "swc_common", "swc_ecma_ast", "swc_ecma_compat_es2022", "swc_ecma_compiler", + "swc_ecma_transformer", "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", @@ -7542,9 +7543,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "31.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f86e65bce3f8485c777e7893ec1219819f16233cb912d7cb50a4b36032696a" +checksum = "d3af635819beff23533a5dcbf34b2b33f345b1a63c4f76a587dbdbbe5df13e4b" dependencies = [ "rustc-hash 2.1.1", "swc_atoms", @@ -7606,6 +7607,18 @@ dependencies = [ "swc_ecma_visit", ] +[[package]] +name = "swc_ecma_hooks" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff438d7a3e371eaa990ea7172981265043d74e1b9d491cc1667ba913dbe97344" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", +] + [[package]] name = "swc_ecma_lints" version = "25.0.0" @@ -7708,9 +7721,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "39.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d285b03b2f81be198f2dd64cc13310130bbebe814037a533be75cf2640f81" +checksum = "0d37834f13f4590a74c8b0a100fc008734fff540dfea55768959d67f710f5222" dependencies = [ "anyhow", "foldhash 0.1.5", @@ -7726,6 +7739,7 @@ dependencies = [ "swc_common", "swc_ecma_ast", "swc_ecma_compiler", + "swc_ecma_transformer", "swc_ecma_transforms", "swc_ecma_utils", "swc_ecma_visit", @@ -7762,11 +7776,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "swc_ecma_transformer" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7856317f75549687e726937c3fc67d7c3b4dc4c0354a9a913e510e583fbe50e" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_hooks", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + [[package]] name = "swc_ecma_transforms" -version = "38.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61ecb0d5c35287cefbc6b0282ac01c694739da6483abf3913d068ce45a1223" +checksum = "a4dbf6e40c4c9e0fa2c5593a83cb882f78e94ffac73cb18f5b7089d801761999" dependencies = [ "par-core", "swc_common", @@ -7818,9 +7848,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "34.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a21cfdc337873ab5959652c7efb6d3d72eb87f6ae225bbb038691e1c14b0d33" +checksum = "1f0eb510cf092f42f222946bbfc8346f6070b8e2d76ea5820d3620b6b848af17" dependencies = [ "indexmap 2.9.0", "par-core", @@ -8050,9 +8080,9 @@ dependencies = [ [[package]] name = "swc_emotion" -version = "0.105.0" +version = "0.106.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04f36710715a4fcb937f661dcbceaaca4dd091ad84098ec4bf486d189162450" +checksum = "eb9118816598276a4ab41bf415e55b0f398ea4ec9f28667c33af5744dad58581" dependencies = [ "base64 0.22.1", "byteorder", @@ -8186,9 +8216,9 @@ dependencies = [ [[package]] name = "swc_relay" -version = "0.75.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d831bbee3b1d8a4d574c6efdbcb1966d1621c5eb68b730bf14ca26cf600d0a0" +checksum = "eef118b010bbbb4860902eef6df2b97ab2592310325f81829356f97cc5080a9f" dependencies = [ "once_cell", "regex", diff --git a/Cargo.toml b/Cargo.toml index 57f11506f2662b..1f1bfbe3844bbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -337,7 +337,7 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } # SWC crates -swc_core = { version = "47.0.9", features = [ +swc_core = { version = "48.0.1", features = [ "ecma_loader_lru", "ecma_loader_parking_lot", "parallel_rayon", @@ -348,13 +348,13 @@ testing = "18.0.0" # Keep consistent with preset_env_base through swc_core browserslist-rs = "0.19.0" mdxjs = "1.0.3" -modularize_imports = "0.101.0" -styled_components = "0.129.0" +modularize_imports = "0.102.0" +styled_components = "0.130.0" styled_jsx = "0.105.1" -swc_emotion = "0.105.0" -swc_relay = "0.75.0" -react_remove_properties = "0.55.0" -remove_console = "0.56.0" +swc_emotion = "0.106.0" +swc_relay = "0.76.0" +react_remove_properties = "0.56.0" +remove_console = "0.57.0" preset_env_base = "6.0.0" From 545a77c17bd8db475d4af678d0c57111baca02b5 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Wed, 19 Nov 2025 13:18:12 +0100 Subject: [PATCH 21/25] update snapshots --- .../errors/server-actions/client-graph/1/output.js | 2 +- .../errors/server-actions/client-graph/2/output.js | 2 +- .../errors/server-actions/server-graph/1/output.js | 2 +- .../server-actions/server-graph/12/output.js | 2 +- .../server-actions/server-graph/13/output.js | 2 +- .../errors/server-actions/server-graph/2/output.js | 4 ++-- .../server-actions/server-graph/29/output.js | 2 +- .../server-actions/server-graph/30/output.js | 2 +- .../errors/server-actions/server-graph/6/output.js | 2 +- .../errors/server-actions/server-graph/8/output.js | 4 ++-- .../next-font-with-directive/use-cache/output.js | 2 +- .../next-font-with-directive/use-server/output.js | 2 +- .../fixture/optimize-barrel/normal/2/output.js | 1 + .../client-graph/actions/output.js | 2 +- .../client-graph/cache-life/output.js | 2 +- .../client-graph/cache-tag/output.js | 2 +- .../client-graph/client-entry/output.js | 4 ++-- .../server-graph/client-entry-cjs/output.js | 2 +- .../server-graph/client-entry/output.js | 2 +- .../server-actions/client-graph/1/output.js | 2 +- .../server-actions/client-graph/2/output.js | 2 +- .../server-actions/client-graph/3/output.js | 2 +- .../server-actions/client-graph/4/output.js | 2 +- .../server-actions/client-graph/5/output.js | 2 +- .../server-actions/client-graph/6/output.js | 2 +- .../server-actions/client-graph/7/output.js | 2 +- .../server-actions/client-graph/8/output.js | 2 +- .../client-graph/turbopack/1/output.js | 4 ++-- .../server-actions/server-graph/1/output.js | 4 ++-- .../server-actions/server-graph/10/output.js | 2 +- .../server-actions/server-graph/11/output.js | 2 +- .../server-actions/server-graph/12/output.js | 2 +- .../server-actions/server-graph/13/output.js | 2 +- .../server-actions/server-graph/14/output.js | 2 +- .../server-actions/server-graph/15/output.js | 2 +- .../server-actions/server-graph/16/output.js | 4 ++-- .../server-actions/server-graph/17/output.js | 2 +- .../server-actions/server-graph/18/output.js | 4 ++-- .../server-actions/server-graph/19/output.js | 4 ++-- .../server-actions/server-graph/2/output.js | 4 ++-- .../server-actions/server-graph/20/output.js | 2 +- .../server-actions/server-graph/21/output.js | 4 ++-- .../server-actions/server-graph/22/output.js | 2 +- .../server-actions/server-graph/23/output.js | 4 ++-- .../server-actions/server-graph/24/output.js | 4 ++-- .../server-actions/server-graph/25/output.js | 4 ++-- .../server-actions/server-graph/26/output.js | 4 ++-- .../server-actions/server-graph/27/output.js | 6 +++--- .../server-actions/server-graph/28/output.js | 4 ++-- .../server-actions/server-graph/29/output.js | 2 +- .../server-actions/server-graph/3/output.js | 2 +- .../server-actions/server-graph/30/output.js | 2 +- .../server-actions/server-graph/31/output.js | 2 +- .../server-actions/server-graph/32/output.js | 4 ++-- .../server-actions/server-graph/33/output.js | 4 ++-- .../server-actions/server-graph/34/output.js | 2 +- .../server-actions/server-graph/35/output.js | 2 +- .../server-actions/server-graph/36/output.js | 2 +- .../server-actions/server-graph/37/output.js | 2 +- .../server-actions/server-graph/38/output.js | 2 +- .../server-actions/server-graph/39/output.js | 2 +- .../server-actions/server-graph/4/output.js | 2 +- .../server-actions/server-graph/40/output.js | 4 ++-- .../server-actions/server-graph/41/output.js | 2 +- .../server-actions/server-graph/42/output.js | 2 +- .../server-actions/server-graph/43/output.js | 4 ++-- .../server-actions/server-graph/44/output.js | 4 ++-- .../server-actions/server-graph/45/output.js | 2 +- .../server-actions/server-graph/46/output.js | 4 ++-- .../server-actions/server-graph/47/output.js | 4 ++-- .../server-actions/server-graph/48/output.js | 2 +- .../server-actions/server-graph/49/output.js | 2 +- .../server-actions/server-graph/5/output.js | 4 ++-- .../server-actions/server-graph/50/output.js | 2 +- .../server-actions/server-graph/51/output.js | 2 +- .../server-actions/server-graph/52/output.js | 4 ++-- .../server-actions/server-graph/53/output.js | 4 ++-- .../server-actions/server-graph/54/output.js | 4 ++-- .../server-actions/server-graph/55/output.js | 4 ++-- .../server-actions/server-graph/57/output.js | 4 ++-- .../server-actions/server-graph/58/output.js | 4 ++-- .../server-actions/server-graph/59/output.js | 2 +- .../server-actions/server-graph/6/output.js | 4 ++-- .../server-actions/server-graph/60/output.ts | 2 +- .../server-actions/server-graph/61/output.js | 4 ++-- .../server-actions/server-graph/62/output.ts | 2 +- .../server-actions/server-graph/7/output.js | 4 ++-- .../server-actions/server-graph/8/output.js | 4 ++-- .../server-actions/server-graph/9/output.js | 2 +- .../development/server-actions/1/output.js | 2 +- .../production/server-actions/1/output.js | 2 +- .../source-maps/server-graph/use-cache/1/output.js | 2 +- .../development/server-actions/1/output.js | 14 +++++++------- .../production/server-actions/1/output.js | 14 +++++++------- ...es_turbopack-tests_tests_snapshot_ee254e53._.js | 2 +- 95 files changed, 142 insertions(+), 141 deletions(-) diff --git a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js index a05fa05acd5c4c..479427d7714297 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js @@ -1,4 +1,4 @@ -/* __next_internal_client_entry_do_not_use__ default auto */ export default function App() { +export default function App() { async function fn() { 'use server'; } diff --git a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js index dcbfb41c1fe3a1..0e75aae0ae2d5d 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js @@ -1,4 +1,4 @@ -/* __next_internal_client_entry_do_not_use__ default auto */ export default function App() { +export default function App() { async function fn() { 'use cache'; } diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js index 4ff2ec9c1abe40..a1fcfd99e14647 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export function foo() {} import { ensureServerEntryExports } from "private-next-rsc-action-validate"; ensureServerEntryExports([ diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js index 8d62fb0b348294..f86253fd78d134 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js index 8d62fb0b348294..f86253fd78d134 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.js index 248cf16357a275..a8973e36351a1f 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/2/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"00ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -'use strict'; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ 'use strict'; export function bar() {} import { ensureServerEntryExports } from "private-next-rsc-action-validate"; ensureServerEntryExports([ diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js index 8d62fb0b348294..f86253fd78d134 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js index 8d62fb0b348294..f86253fd78d134 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js index c343a11fe629f3..42030df849230d 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export default $$RSC_SERVER_ACTION_0 = ()=>{}; var $$RSC_SERVER_ACTION_0; Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", { diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.js index 18a10cefdc509a..bcc7f53d8e07ad 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/output.js @@ -1,9 +1,9 @@ -/* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export const $$RSC_SERVER_ACTION_0 = async function foo() { 'use strict'; }; registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); -const foo = $$RSC_SERVER_ACTION_0; +/* __next_internal_action_entry_do_not_use__ {"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ const foo = $$RSC_SERVER_ACTION_0; const bar = async ()=>{ const x = 1; // prettier-ignore diff --git a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js index a622326cd2574e..95e25c217b720e 100644 --- a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js +++ b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"c0dd5bb6fef67f5ab84327f5164ac2c3111a159337":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; import React from 'react'; diff --git a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js index 83241ae20a6c6a..a77d03a570eb62 100644 --- a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js +++ b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00f8b140eeaaaa6c987593016c19b3fe41bc812c62":"myCoolServerAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import React from 'react'; import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; export async function myCoolServerAction() { diff --git a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js index e69de29bb2d1d6..06d21e5bd4a5fe 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/2/output.js @@ -0,0 +1 @@ +// De-optimize this file diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js index abae51f8fca2db..c523a72a59b01e 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"00a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("00a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js index 0cd1b311b9dbf3..8a43a9d7cf661a 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"80a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("80a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js index 0cd1b311b9dbf3..8a43a9d7cf661a 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"80a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("80a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js index b1f4fb1826ed34..cbef357e0a8f3f 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/output.js @@ -1,5 +1,5 @@ -/* __next_internal_client_entry_do_not_use__ default auto */ // This is a comment. -'use strict'; +// This is a comment. +/* __next_internal_client_entry_do_not_use__ default auto */ 'use strict'; // This is a comment. 'foo'; import 'fs'; diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js index 73e84de2638bcf..528a61c8513a18 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ cjs */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/some-project/src/some-file.js"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js index ac2f1f2651c8f9..528a61c8513a18 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js @@ -1,2 +1,2 @@ -/* __next_internal_client_entry_do_not_use__ default,a,b,c,*,f auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/some-project/src/some-file.js"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js index 6a7d1aff3ca08f..bd29e70664997a 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js @@ -1,3 +1,3 @@ -/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var myAction = /*#__PURE__*/ createServerReference("70e10665baac148856374b2789aceb970f66fec33e", callServer, void 0, findSourceMapURL, "myAction"); export default /*#__PURE__*/ createServerReference("00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js index c400ea1163260e..875aad2c887b63 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var foo = /*#__PURE__*/ createServerReference("7fab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js index 6da7ba6824becb..fa3a3188b6bf1b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fa0c73dd6f5af839e3335c6b19262ecb86cca6af4":"sampleFunction2","7fbd336abe00c3c59da66acb696fc8e151d8e54ea4":"sampleFunction","7fd4f2e95bc745b6500b439c0847003511748c8ece":"sampleFunction3","7ff03b256ee88a51700367acee3082894e25e6e7d9":"sampleFunction4"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var sampleFunction = /*#__PURE__*/ createServerReference("7fbd336abe00c3c59da66acb696fc8e151d8e54ea4", callServer, void 0, findSourceMapURL, "sampleFunction"); export var sampleFunction2 = /*#__PURE__*/ createServerReference("7fa0c73dd6f5af839e3335c6b19262ecb86cca6af4", callServer, void 0, findSourceMapURL, "sampleFunction2"); export var sampleFunction3 = /*#__PURE__*/ createServerReference("7fd4f2e95bc745b6500b439c0847003511748c8ece", callServer, void 0, findSourceMapURL, "sampleFunction3"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js index bce4e0b29e293c..6354599379f2dc 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var bar = /*#__PURE__*/ createServerReference("7fac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js index 6f99ff70a9d7e2..241742cab4e52a 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var action0 = /*#__PURE__*/ createServerReference("7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c", callServer, void 0, findSourceMapURL, "action0"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js index d495141ce77491..3f5054e6a1364e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js @@ -1,3 +1,3 @@ -/* __next_internal_action_entry_do_not_use__ {"80ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","ffac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var foo = /*#__PURE__*/ createServerReference("80ab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo"); export var bar = /*#__PURE__*/ createServerReference("ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js index 30647bb277b152..ce0c81d9285354 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export default /*#__PURE__*/ createServerReference("00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js index 2eda815b72dd61..f05909693edc07 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js @@ -1,2 +1,2 @@ -/* __next_internal_action_entry_do_not_use__ {"80ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var bar = /*#__PURE__*/ createServerReference("80ac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js index d6064545a19501..fcafef70cd0cf8 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js @@ -1,3 +1,3 @@ "use turbopack no side effects"; -export { foo } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%3A%22foo%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20foo%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22foo%22%29%3B"; -export { bar } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%3A%22bar%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20bar%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22bar%22%29%3B"; +export { foo } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20foo%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22foo%22%29%3B"; +export { bar } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20bar%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22bar%22%29%3B"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/1/output.js index 1432f4825f90bc..4a775c839c1787 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/1/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { Button } from 'components'; import deleteFromDb from 'db'; export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js index 9055b582d1b66c..b0962e318cbe2e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export default async function foo() {} import { ensureServerEntryExports } from "private-next-rsc-action-validate"; ensureServerEntryExports([ diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js index 8a28337dca3f9d..fae517f31ab537 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export default async function $$RSC_SERVER_ACTION_0() {} Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", { value: "default" diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js index d516e22b8fd7b5..ebe29b233937dd 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; async function foo() {} export default foo; import { ensureServerEntryExports } from "private-next-rsc-action-validate"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js index 56094ec9d453b9..886486f4aeab3a 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; const foo = async function() {}; export default foo; const bar = async function() {}; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js index 579d4b4e0ef1d7..77e617a001d5ff 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export async function foo() { async function bar() {} } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js index 927045f5ee9f53..efc2737f252f82 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export default $$RSC_SERVER_ACTION_0 = async (a, b)=>{ console.log(a, b); }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/16/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/16/output.js index afe737df3456e0..1052758792d555 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/16/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/16/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","7f90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7f1c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","7f90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { Button } from 'components'; import deleteFromDb from 'db'; const v1 = 'v1'; export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js index 015e9bc1d9a73e..b6c516ae07c78b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export const foo = async ()=>{}; const bar = async ()=>{}; export { bar }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/18/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/18/output.js index 2f097649c261f4..e16a9e247fe455 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/18/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/18/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { Button } from 'components'; import deleteFromDb from 'db'; const v1 = 'v1'; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/19/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/19/output.js index 790dab5a61566c..4518b36fd0be0f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/19/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/19/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { Button } from 'components'; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, value2) { var [$$ACTION_ARG_0] = await decryptActionBoundArgs("606a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); return $$ACTION_ARG_0 * value2; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/2/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/2/output.js index 7ff1d8ae3e1885..fbd31945473221 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/2/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -import { validator } from 'auth'; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { validator } from 'auth'; import { Button } from 'components'; export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { console.log('a'); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js index 31b512d528d6a8..dcb5d503dd397e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; /** @type {[any]} */ const [foo] = [ null ]; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/21/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/21/output.js index 9e9d48e65a27ce..478418280dfd4f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/21/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/21/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { validator, another } from 'auth'; +/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { validator, another } from 'auth'; import { Button } from 'components'; const x = 1; export const $$RSC_SERVER_ACTION_0 = async function($$ACTION_CLOSURE_BOUND, z) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js index 8ee28669f813d7..bb5cae24c04365 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { validator } from 'auth'; export const action = validator(async ()=>{}); export default $$RSC_SERVER_ACTION_0 = validator(async ()=>{}); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/23/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/23/output.js index 7572fe19191a8b..4ffbe64bec6e7f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/23/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/23/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7c90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, d) { var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); @@ -10,7 +10,7 @@ export const $$RSC_SERVER_ACTION_1 = async function action2($$ACTION_CLOSURE_BOU console.log(a, b, $$ACTION_ARG_0, c, d); }; registerServerReference($$RSC_SERVER_ACTION_1, "7c90b5db271335765a4b0eab01f044b381b5ebd5cd", null); -export default function Page({ foo, x, y }) { +/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","7c90b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ export default function Page({ foo, x, y }) { var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", x)); action.bind(null, foo[0], foo[1], foo.x, foo[y]); const action2 = $$RSC_SERVER_ACTION_1.bind(null, encryptActionBoundArgs("7c90b5db271335765a4b0eab01f044b381b5ebd5cd", x)); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/24/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/24/output.js index 69b16d7ed34481..5828184b282bab 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/24/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/24/output.js @@ -1,10 +1,10 @@ -/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND, a, b, c, { d }) { var [$$ACTION_ARG_0] = await decryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); console.log(a, b, $$ACTION_ARG_0, d); }; registerServerReference($$RSC_SERVER_ACTION_0, "7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); -export default function Page({ foo, x, y }) { +/* __next_internal_action_entry_do_not_use__ {"7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ export default function Page({ foo, x, y }) { var action = $$RSC_SERVER_ACTION_0.bind(null, encryptActionBoundArgs("7c6a88810ecce4a4e8b59d53b8327d7e98bbf251d7", foo)); } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/25/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/25/output.js index b9fb1b6f159419..810ae69cfd9c2e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/25/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/25/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { Button } from 'components'; import deleteFromDb from 'db'; export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/26/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/26/output.js index 0608cf81c5a6df..3d279d6b057d06 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/26/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/26/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -const noop = (action)=>action; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ const noop = (action)=>action; export const $$RSC_SERVER_ACTION_0 = async function(data) { console.log(data); }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js index c60a975d390445..5fffa41ca93cd7 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js @@ -1,8 +1,8 @@ -/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -export const // Rules here: +import { registerServerReference } from "private-next-rsc-server-reference"; +export const $$RSC_SERVER_ACTION_0 = // Rules here: // 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`. // 2. Actual action functions should be renamed to `$$ACTION_...` and got exported. -$$RSC_SERVER_ACTION_0 = async function foo() { +/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ async function foo() { console.log(1); }; registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/28/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/28/output.js index fc419fbf7d9cd0..43431c00cb7ea6 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/28/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/28/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -let a, f; +/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ let a, f; export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) // (remove output.js from `tsconfig.json#exclude` to see the error) $$RSC_SERVER_ACTION_0 = async function action2($$ACTION_CLOSURE_BOUND, e) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js index 356d385134aea8..e6484168ac6ecc 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7f28baf972d345b86b747ad0df73d75a0088a42214":"dec","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export const dec = async (value)=>{ return value - 1; }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js index d6b54a2cdd7330..725b2b04a64fa5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export async function myAction(a, b, c) { console.log('a'); } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js index 1b77b56e114ec2..799363189ee9e5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; let a, f; export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js index c478b0519f7a8f..2a28a738f8a7f2 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7fabf760c735ba66c4c26a2913864dd7e28fb88a91":"action2","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export const action = { async f (x) { ; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/32/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/32/output.js index 03156e0ca76e13..12af2b3c4cb6cd 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/32/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/32/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); @@ -6,7 +6,7 @@ export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUN console.log($$ACTION_ARG_2.push.call($$ACTION_ARG_2, 5)); }; registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); -export function Component() { +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ export function Component() { const data = [ 1, 2, diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/33/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/33/output.js index 88bac7f0173c0b..a5a728fc7aebc5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/33/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/33/output.js @@ -1,7 +1,7 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; -const v = 'world'; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ const v = 'world'; const $$RSC_SERVER_CACHE_0_INNER = async function fn() { return 'hello, ' + v; }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js index 36e57a994f27ca..56a48d51311cf6 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","8069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js index b0d7c1781c3864..a076a22f05222e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function my_fn() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js index 7e66d7d1215eef..e89c7c6ab15d70 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","c069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js index c1ceabfc05913b..2ecaea3a252dda 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function fn() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js index 48ba664f083fdf..1dc399aa189c08 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js index da71805957d32b..b82210bf54f15d 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js index 83c692dd852779..e2ae5187cecc35 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"001ab723c80dcca470e0410b4b2a2fc2bf21f41476":"c","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","006e7bc104e4d6e7fda190c4a51be969cfd0be6d6d":"a","00d1f7eb64271d7c601dfef7d4d7053de1c2ca4338":"b"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export async function a() {} export async function b() {} export async function c() {} diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/40/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/40/output.js index 5e506f46d78699..a241eaaf6426b3 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/40/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/40/output.js @@ -1,8 +1,8 @@ -/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; -import { Form } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { Form } from 'components'; const $$RSC_SERVER_CACHE_0_INNER = async function cache([$$ACTION_ARG_0, $$ACTION_ARG_1], e) { const f = $$ACTION_ARG_0 + e; return [ diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js index a693fa136665a5..4e7e81c7dd8fde 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js index b61436cd491841..3f03be5aa933a5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/43/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/43/output.js index c19536b6dc559b..37d4caccc7ab3c 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/43/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/43/output.js @@ -1,8 +1,8 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","e0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","e0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { Button } from 'components'; const secret = 'my password is qwerty123'; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/44/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/44/output.js index 73505be60288ae..a232a80a55a38c 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/44/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/44/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -import { Form } from 'components'; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { Form } from 'components'; export const $$RSC_SERVER_ACTION_0 = async function foo() { return 'declarator arrow function expression'; }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js index 9b766a82a77faf..0d9a9907cc69c3 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Expect no error here, this is allowed to be sync because it's not exported. diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js index b1edb481fdd848..05ea4bf5165e44 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/46/output.js @@ -1,9 +1,9 @@ -/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7ea9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","ff471a5eb0be1c31686dd4ba938a80328b80b1615d":"$$RSC_SERVER_CACHE_5","ff69348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // This is for testing the "information byte" of Server Action / Cache IDs. // Should be 1 110000 0, which is "e0" in hex. -const $$RSC_SERVER_CACHE_0_INNER = async function f1(a, b) { +/* __next_internal_action_entry_do_not_use__ {"6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7c9ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7ea9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","ff471a5eb0be1c31686dd4ba938a80328b80b1615d":"$$RSC_SERVER_CACHE_5","ff69348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ const $$RSC_SERVER_CACHE_0_INNER = async function f1(a, b) { return [ a, b diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/47/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/47/output.js index ada27d451dc644..d8b9e22612d041 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/47/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/47/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -import { redirect } from 'navigation'; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { redirect } from 'navigation'; export const $$RSC_SERVER_ACTION_0 = async function action(formData) { redirect('/header?name=' + formData.get('name') + '&hidden-info=' + formData.get('hidden-info')); }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js index e64f94ee38f9e2..ff999a55d94fff 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"60079087479e4c103d815f273878c7d1b8e902cc39":"action3","70f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Should be 0 111000 0, which is "70" in hex. diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js index 50db8ae1e38b8a..3f8cb8a604bf72 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/5/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/5/output.js index 44acd5e91e0c62..d7a86d577e02f7 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/5/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/5/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { Button } from 'components'; import deleteFromDb from 'db'; const v1 = 'v1'; export const $$RSC_SERVER_ACTION_0 = async function deleteItem($$ACTION_CLOSURE_BOUND) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js index fbd449c432f52e..2b1f8945d7614b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js index 854240e0796e3b..a0cafccbc47355 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","609ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export const $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b, c) { return

{a} diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/52/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/52/output.js index 122c51190480b3..d06cec33dee690 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/52/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/52/output.js @@ -1,8 +1,8 @@ -/* __next_internal_action_entry_do_not_use__ {"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; -import { Client } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { Client } from 'components'; const $$RSC_SERVER_CACHE_0_INNER = async function // Should be 1 110000 0, which is "e0" in hex (counts as two params, // because of the encrypted bound args param) fn1([$$ACTION_ARG_0, $$ACTION_ARG_1], c) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/53/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/53/output.js index 463df138ebef7a..5008da2125544b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/53/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/53/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {}; @@ -11,7 +11,7 @@ Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { }); export const $$RSC_SERVER_ACTION_1 = async function bar() {}; registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null); -export const obj = { +/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ export const obj = { foo: $$RSC_SERVER_CACHE_0, bar: $$RSC_SERVER_ACTION_1 }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/54/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/54/output.js index 7da7a776c577e4..8b7db379c43189 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/54/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/54/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; @@ -17,7 +17,7 @@ export const $$RSC_SERVER_ACTION_1 = async function bar($$ACTION_CLOSURE_BOUND) console.log($$ACTION_ARG_0); }; registerServerReference($$RSC_SERVER_ACTION_1, "4090b5db271335765a4b0eab01f044b381b5ebd5cd", null); -function createObj(n) { +/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ function createObj(n) { const m = n + 1; return { foo: $$RSC_SERVER_CACHE_0.bind(null, encryptActionBoundArgs("c03128060c414d59f8552e4788b846c0d2b7f74743", n, m)), diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/55/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/55/output.js index 064a43bc9c394d..51077a9d706f23 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/55/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/55/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function fetch1() { @@ -11,7 +11,7 @@ registerServerReference($$RSC_SERVER_CACHE_0, "803128060c414d59f8552e4788b846c0d Object["defineProperty"]($$RSC_SERVER_CACHE_0, "name", { value: "fetch" }); -export const api = { +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ export const api = { product: { fetch: $$RSC_SERVER_CACHE_0 } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/57/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/57/output.js index 7e75bf62e5cead..e162faf3afc89e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/57/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/57/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { @@ -15,7 +15,7 @@ export const $$RSC_SERVER_ACTION_1 = async function bar() { console.log(42); }; registerServerReference($$RSC_SERVER_ACTION_1, "0090b5db271335765a4b0eab01f044b381b5ebd5cd", null); -export class MyClass { +/* __next_internal_action_entry_do_not_use__ {"0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ export class MyClass { static foo = $$RSC_SERVER_CACHE_0; static bar = $$RSC_SERVER_ACTION_1; } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/58/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/58/output.js index 3147f3b01d49b4..e06b9a58eaedcb 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/58/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/58/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; @@ -12,7 +12,7 @@ export var $$RSC_SERVER_CACHE_0 = $$reactCache__(function() { return $$cache__("default", "c03128060c414d59f8552e4788b846c0d2b7f74743", 1, $$RSC_SERVER_CACHE_0_INNER, arguments); }); registerServerReference($$RSC_SERVER_CACHE_0, "c03128060c414d59f8552e4788b846c0d2b7f74743", null); -function createCachedFn(start) { +/* __next_internal_action_entry_do_not_use__ {"4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ function createCachedFn(start) { function fn() { return start + Math.random(); } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js index 9357632ba8215d..a5a816598afc39 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"00b98e10c56c1bee7af6ff753c91a4c70ab0419f0a":"test","7f7a40999f9833d2bb66a82d6a20a7f2a7810315f8":"createItem"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { db } from 'database'; export const createItem = async (title)=>{ return new Promise((resolve, reject)=>{ diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/6/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/6/output.js index d288b240ba654e..0f59a3f895c981 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/6/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/6/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import ANYTHING from 'anything'; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import ANYTHING from 'anything'; import f, { f1, f2 } from 'foo'; import { Button } from 'components'; const f3 = 1; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts index 4cf6bfdab3a7cd..bfb0c02fb81126 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Exported TypeScript nodes should be ignored when validating that all module diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/61/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/61/output.js index c5fc27a9b4e7e6..d2ad593adffa54 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/61/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/61/output.js @@ -1,11 +1,11 @@ -/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; export const $$RSC_SERVER_ACTION_0 = async function action($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0, $$ACTION_ARG_1] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); console.log($$ACTION_ARG_0.find((x)=>x === $$ACTION_ARG_1)); }; registerServerReference($$RSC_SERVER_ACTION_0, "406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); -export function ComponentA({ list, y }) { +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ export function ComponentA({ list, y }) { return
; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts index 63f04788b17dea..24acfd136146e2 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"0095ef8ede0a8a4c822fcbdb018cb264731cb15281":"actionA"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; export type X = string; // @ts-ignore -- that file does not exist export { type A } from './a'; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/7/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/7/output.js index 6225342e615680..6e16e58f9a4c17 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/7/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/7/output.js @@ -1,6 +1,6 @@ -/* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; -import { Button } from 'components'; +/* __next_internal_action_entry_do_not_use__ {"401c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","4090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","409ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3"} */ import { Button } from 'components'; import deleteFromDb from 'db'; export const $$RSC_SERVER_ACTION_0 = async function deleteItem1($$ACTION_CLOSURE_BOUND) { var [$$ACTION_ARG_0, $$ACTION_ARG_1, $$ACTION_ARG_2] = await decryptActionBoundArgs("406a88810ecce4a4e8b59d53b8327d7e98bbf251d7", $$ACTION_CLOSURE_BOUND); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/8/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/8/output.js index d989699cde36b9..d0e535c0eb2c3c 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/8/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/8/output.js @@ -1,5 +1,5 @@ -/* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; -import { Button } from 'components'; +import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"706a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0"} */ import { Button } from 'components'; export const $$RSC_SERVER_ACTION_0 = async function myAction(a, b, c) { // comment 'use strict'; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js index ba4fff3e6b9ef7..44b8b97d538ba6 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"7f050e3854b72b19e3c7e3966a67535543a90bf7e0":"baz","7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; async function foo() {} export { foo }; async function bar() {} diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js index e34370d76db7c1..73d8f67301e16a 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"006c24672f968b0713dae406536f7dd6fe7d9a7fa0":"getHeaders","4028baf972d345b86b747ad0df73d75a0088a42214":"dec","403724e93433a7e950ef2f8479f31225e4b0dd0cc5":"redirectAction","40c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","40e44b877cc9d02556f56639c94229621ab0af0f5f":"inc","40f4ad91903d1bf66bfd4e0788888852badc924261":"slowInc","7f1e1a741f85a589443b50c4863618893572cfb178":"renamed"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var getHeaders = /*#__PURE__*/ createServerReference("006c24672f968b0713dae406536f7dd6fe7d9a7fa0", callServer, void 0, findSourceMapURL, "getHeaders"); export var inc = /*#__PURE__*/ createServerReference("40e44b877cc9d02556f56639c94229621ab0af0f5f", callServer, void 0, findSourceMapURL, "inc"); export var slowInc = /*#__PURE__*/ createServerReference("40f4ad91903d1bf66bfd4e0788888852badc924261", callServer, void 0, findSourceMapURL, "slowInc"); diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js index e34370d76db7c1..73d8f67301e16a 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"006c24672f968b0713dae406536f7dd6fe7d9a7fa0":"getHeaders","4028baf972d345b86b747ad0df73d75a0088a42214":"dec","403724e93433a7e950ef2f8479f31225e4b0dd0cc5":"redirectAction","40c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","40e44b877cc9d02556f56639c94229621ab0af0f5f":"inc","40f4ad91903d1bf66bfd4e0788888852badc924261":"slowInc","7f1e1a741f85a589443b50c4863618893572cfb178":"renamed"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var getHeaders = /*#__PURE__*/ createServerReference("006c24672f968b0713dae406536f7dd6fe7d9a7fa0", callServer, void 0, findSourceMapURL, "getHeaders"); export var inc = /*#__PURE__*/ createServerReference("40e44b877cc9d02556f56639c94229621ab0af0f5f", callServer, void 0, findSourceMapURL, "inc"); export var slowInc = /*#__PURE__*/ createServerReference("40f4ad91903d1bf66bfd4e0788888852badc924261", callServer, void 0, findSourceMapURL, "slowInc"); diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js index 13690ff79c8655..f5e6c73108cfc6 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js @@ -1,4 +1,4 @@ -/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {}; diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js index 0d47f485ae4515..e54d61d1796d84 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js @@ -1,8 +1,8 @@ "use turbopack no side effects"; -export { getHeaders } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%3A%22getHeaders%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImdSQU9zQiJ9"; -export { inc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%3A%22inc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InlRQVlzQiJ9"; -export { slowInc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%3A%22slowInc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjZRQWdCc0IifQ%3D%3D"; -export { dec } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%224028baf972d345b86b747ad0df73d75a0088a42214%22%3A%22dec%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InlRQXFCc0IifQ%3D%3D"; -export { default } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%3A%22default%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20createServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlSQXlCZSJ9"; -export { redirectAction } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%3A%22redirectAction%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Im9SQThCc0IifQ%3D%3D"; -export { renamed } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%227f1e1a741f85a589443b50c4863618893572cfb178%22%3A%22renamed%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjZRQXFDUyJ9"; +export { getHeaders } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQU9zQiJ9"; +export { inc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%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kaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQVlzQiJ9"; +export { slowInc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQWdCc0IifQ%3D%3D"; +export { dec } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdh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%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20createServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InFKQXlCZSJ9"; +export { redirectAction } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQThCc0IifQ%3D%3D"; +export { renamed } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uI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UubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQXFDUyJ9"; diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js index e560564a77a871..cd616d993f9309 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js @@ -1,8 +1,8 @@ "use turbopack no side effects"; -export { getHeaders } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%3A%22getHeaders%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B"; -export { inc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%3A%22inc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B"; -export { slowInc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%3A%22slowInc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B"; -export { dec } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%224028baf972d345b86b747ad0df73d75a0088a42214%22%3A%22dec%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B"; -export { default } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%3A%22default%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B"; -export { redirectAction } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%3A%22redirectAction%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B"; -export { renamed } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%227f1e1a741f85a589443b50c4863618893572cfb178%22%3A%22renamed%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B"; +export { getHeaders } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B"; +export { inc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B"; +export { slowInc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B"; +export { dec } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B"; +export { default } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B"; +export { redirectAction } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B"; +export { renamed } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B"; diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js index b13ccb1f5407c9..0dae3bafefdec7 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_ee254e53._.js @@ -10,7 +10,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ; ; const StyledButton = (0, /*#__PURE__*/ __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", { - target: "e16emnxi0" + target: "egm8rku0" })("background:blue;"); function ClassNameButton({ children }) { return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$test$5d$__$28$ecmascript$29$__["jsxDEV"])("button", { From f4615edc96ca6fda8df35c3b4d38a28efa1ceb8b Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 20 Nov 2025 10:42:29 +0100 Subject: [PATCH 22/25] snapshots --- .../errors/server-actions/client-graph/1/output.js | 2 +- .../errors/server-actions/client-graph/2/output.js | 2 +- .../errors/server-actions/server-graph/1/output.js | 2 +- .../server-actions/server-graph/12/output.js | 2 +- .../server-actions/server-graph/13/output.js | 2 +- .../server-actions/server-graph/29/output.js | 2 +- .../server-actions/server-graph/30/output.js | 2 +- .../errors/server-actions/server-graph/6/output.js | 2 +- .../next-font-with-directive/use-cache/output.js | 2 +- .../next-font-with-directive/use-server/output.js | 2 +- .../fixture/optimize-barrel/normal/4/output.js | 3 +++ .../client-graph/actions/output.js | 2 +- .../client-graph/cache-life/output.js | 2 +- .../client-graph/cache-tag/output.js | 2 +- .../server-graph/client-entry-cjs/output.js | 2 +- .../server-graph/client-entry/output.js | 3 ++- .../server-actions/client-graph/1/output.js | 3 ++- .../server-actions/client-graph/2/output.js | 3 ++- .../server-actions/client-graph/3/output.js | 2 +- .../server-actions/client-graph/4/output.js | 2 +- .../server-actions/client-graph/5/output.js | 2 +- .../server-actions/client-graph/6/output.js | 2 +- .../server-actions/client-graph/7/output.js | 2 +- .../server-actions/client-graph/8/output.js | 2 +- .../client-graph/turbopack/1/output.js | 4 ++-- .../server-actions/server-graph/10/output.js | 2 +- .../server-actions/server-graph/11/output.js | 2 +- .../server-actions/server-graph/12/output.js | 2 +- .../server-actions/server-graph/13/output.js | 2 +- .../server-actions/server-graph/14/output.js | 2 +- .../server-actions/server-graph/15/output.js | 2 +- .../server-actions/server-graph/17/output.js | 2 +- .../server-actions/server-graph/20/output.js | 2 +- .../server-actions/server-graph/22/output.js | 2 +- .../server-actions/server-graph/27/output.js | 6 +++--- .../server-actions/server-graph/29/output.js | 2 +- .../server-actions/server-graph/3/output.js | 3 ++- .../server-actions/server-graph/30/output.js | 2 +- .../server-actions/server-graph/31/output.js | 2 +- .../server-actions/server-graph/34/output.js | 2 +- .../server-actions/server-graph/35/output.js | 2 +- .../server-actions/server-graph/36/output.js | 2 +- .../server-actions/server-graph/37/output.js | 2 +- .../server-actions/server-graph/38/output.js | 2 +- .../server-actions/server-graph/39/output.js | 2 +- .../server-actions/server-graph/4/output.js | 2 +- .../server-actions/server-graph/41/output.js | 2 +- .../server-actions/server-graph/42/output.js | 2 +- .../server-actions/server-graph/45/output.js | 2 +- .../server-actions/server-graph/48/output.js | 2 +- .../server-actions/server-graph/49/output.js | 2 +- .../server-actions/server-graph/50/output.js | 2 +- .../server-actions/server-graph/51/output.js | 2 +- .../server-actions/server-graph/59/output.js | 2 +- .../server-actions/server-graph/60/output.ts | 2 +- .../server-actions/server-graph/62/output.ts | 2 +- .../server-actions/server-graph/9/output.js | 3 ++- .../development/server-actions/1/output.js | 2 +- .../production/server-actions/1/output.js | 2 +- .../source-maps/server-graph/use-cache/1/output.js | 2 +- .../development/server-actions/1/output.js | 14 +++++++------- .../production/server-actions/1/output.js | 14 +++++++------- 62 files changed, 84 insertions(+), 76 deletions(-) diff --git a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js index 479427d7714297..a05fa05acd5c4c 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/1/output.js @@ -1,4 +1,4 @@ -export default function App() { +/* __next_internal_client_entry_do_not_use__ default auto */ export default function App() { async function fn() { 'use server'; } diff --git a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js index 0e75aae0ae2d5d..dcbfb41c1fe3a1 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/client-graph/2/output.js @@ -1,4 +1,4 @@ -export default function App() { +/* __next_internal_client_entry_do_not_use__ default auto */ export default function App() { async function fn() { 'use cache'; } diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js index a1fcfd99e14647..4ff2ec9c1abe40 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/1/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export function foo() {} import { ensureServerEntryExports } from "private-next-rsc-action-validate"; ensureServerEntryExports([ diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js index f86253fd78d134..8d62fb0b348294 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/12/output.js @@ -1,2 +1,2 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js index f86253fd78d134..8d62fb0b348294 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/13/output.js @@ -1,2 +1,2 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js index f86253fd78d134..8d62fb0b348294 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/29/output.js @@ -1,2 +1,2 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js index f86253fd78d134..8d62fb0b348294 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/30/output.js @@ -1,2 +1,2 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ foo auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/app/item.js"); diff --git a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js index 42030df849230d..c343a11fe629f3 100644 --- a/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js +++ b/crates/next-custom-transforms/tests/errors/server-actions/server-graph/6/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export default $$RSC_SERVER_ACTION_0 = ()=>{}; var $$RSC_SERVER_ACTION_0; Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", { diff --git a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js index 95e25c217b720e..a622326cd2574e 100644 --- a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js +++ b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-cache/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"c0dd5bb6fef67f5ab84327f5164ac2c3111a159337":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; import React from 'react'; diff --git a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js index a77d03a570eb62..83241ae20a6c6a 100644 --- a/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js +++ b/crates/next-custom-transforms/tests/fixture/next-font-with-directive/use-server/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00f8b140eeaaaa6c987593016c19b3fe41bc812c62":"myCoolServerAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import React from 'react'; import inter from '@next/font/google/target.css?{"path":"app/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; export async function myCoolServerAction() { diff --git a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js index 98e09a6f987582..e8b83e296a06b4 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/output.js @@ -1,2 +1,5 @@ +/* Test */ /* Test directives inside comments +'use server' +*/ // This should be kept export const __next_private_export_map__ = '[["x","foo","a"],["y","1","y"],["b","foo","b"],["default","foo","default"],["z","bar","default"]]'; export const __next_private_directive_list__ = '["use client"]'; diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js index c523a72a59b01e..abae51f8fca2db 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/actions/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"00a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("00a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js index 8a43a9d7cf661a..0cd1b311b9dbf3 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-life/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"80a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("80a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js index 8a43a9d7cf661a..0cd1b311b9dbf3 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/cache-tag/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"80a275d5b08d0553a04df65d28075d3cad57073dca":"test"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var test = /*#__PURE__*/ createServerReference("80a275d5b08d0553a04df65d28075d3cad57073dca", callServer, void 0, findSourceMapURL, "test"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js index 528a61c8513a18..a87fed988f4e59 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry-cjs/output.js @@ -1,2 +1,2 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +/* __next_internal_client_entry_do_not_use__ cjs */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/some-project/src/some-file.js"); diff --git a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js index 528a61c8513a18..06e11929e06bdf 100644 --- a/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js +++ b/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/output.js @@ -1,2 +1,3 @@ -const { createProxy } = require("private-next-rsc-mod-ref-proxy"); +// This is a comment. +/* __next_internal_client_entry_do_not_use__ default,a,b,c,*,f auto */ const { createProxy } = require("private-next-rsc-mod-ref-proxy"); module.exports = createProxy("/some-project/src/some-file.js"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js index bd29e70664997a..c19f55642934b4 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/1/output.js @@ -1,3 +1,4 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +// app/send.ts +/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var myAction = /*#__PURE__*/ createServerReference("70e10665baac148856374b2789aceb970f66fec33e", callServer, void 0, findSourceMapURL, "myAction"); export default /*#__PURE__*/ createServerReference("00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js index 875aad2c887b63..3a85bb2c0107de 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/2/output.js @@ -1,2 +1,3 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +// app/send.ts +/* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var foo = /*#__PURE__*/ createServerReference("7fab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js index fa3a3188b6bf1b..6da7ba6824becb 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/3/output.js @@ -1,4 +1,4 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"7fa0c73dd6f5af839e3335c6b19262ecb86cca6af4":"sampleFunction2","7fbd336abe00c3c59da66acb696fc8e151d8e54ea4":"sampleFunction","7fd4f2e95bc745b6500b439c0847003511748c8ece":"sampleFunction3","7ff03b256ee88a51700367acee3082894e25e6e7d9":"sampleFunction4"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var sampleFunction = /*#__PURE__*/ createServerReference("7fbd336abe00c3c59da66acb696fc8e151d8e54ea4", callServer, void 0, findSourceMapURL, "sampleFunction"); export var sampleFunction2 = /*#__PURE__*/ createServerReference("7fa0c73dd6f5af839e3335c6b19262ecb86cca6af4", callServer, void 0, findSourceMapURL, "sampleFunction2"); export var sampleFunction3 = /*#__PURE__*/ createServerReference("7fd4f2e95bc745b6500b439c0847003511748c8ece", callServer, void 0, findSourceMapURL, "sampleFunction3"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js index 6354599379f2dc..bce4e0b29e293c 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/4/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var bar = /*#__PURE__*/ createServerReference("7fac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js index 241742cab4e52a..6f99ff70a9d7e2 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/5/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var action0 = /*#__PURE__*/ createServerReference("7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c", callServer, void 0, findSourceMapURL, "action0"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js index 3f5054e6a1364e..d495141ce77491 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/6/output.js @@ -1,3 +1,3 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"80ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","ffac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var foo = /*#__PURE__*/ createServerReference("80ab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo"); export var bar = /*#__PURE__*/ createServerReference("ffac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js index ce0c81d9285354..30647bb277b152 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/7/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export default /*#__PURE__*/ createServerReference("00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js index f05909693edc07..2eda815b72dd61 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/8/output.js @@ -1,2 +1,2 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"80ac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var bar = /*#__PURE__*/ createServerReference("80ac840dcaf5e8197cb02b7f3a43c119b7a770b272", callServer, void 0, findSourceMapURL, "bar"); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js index fcafef70cd0cf8..d6064545a19501 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/client-graph/turbopack/1/output.js @@ -1,3 +1,3 @@ "use turbopack no side effects"; -export { foo } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20foo%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22foo%22%29%3B"; -export { bar } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20bar%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22bar%22%29%3B"; +export { foo } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%3A%22foo%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20foo%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ab21efdafbe611287bc25c0462b1e0510d13e48b%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22foo%22%29%3B"; +export { bar } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%3A%22bar%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20bar%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2200ac840dcaf5e8197cb02b7f3a43c119b7a770b272%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22bar%22%29%3B"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js index b0962e318cbe2e..9055b582d1b66c 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/10/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export default async function foo() {} import { ensureServerEntryExports } from "private-next-rsc-action-validate"; ensureServerEntryExports([ diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js index fae517f31ab537..8a28337dca3f9d 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/11/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export default async function $$RSC_SERVER_ACTION_0() {} Object["defineProperty"]($$RSC_SERVER_ACTION_0, "name", { value: "default" diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js index ebe29b233937dd..d516e22b8fd7b5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/12/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; async function foo() {} export default foo; import { ensureServerEntryExports } from "private-next-rsc-action-validate"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js index 886486f4aeab3a..56094ec9d453b9 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/13/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; const foo = async function() {}; export default foo; const bar = async function() {}; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js index 77e617a001d5ff..579d4b4e0ef1d7 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/14/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export async function foo() { async function bar() {} } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js index efc2737f252f82..927045f5ee9f53 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"60c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export default $$RSC_SERVER_ACTION_0 = async (a, b)=>{ console.log(a, b); }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js index b6c516ae07c78b..015e9bc1d9a73e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/17/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fac840dcaf5e8197cb02b7f3a43c119b7a770b272":"bar"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export const foo = async ()=>{}; const bar = async ()=>{}; export { bar }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js index dcb5d503dd397e..31b512d528d6a8 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/20/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; /** @type {[any]} */ const [foo] = [ null ]; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js index bb5cae24c04365..8ee28669f813d7 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/22/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { validator } from 'auth'; export const action = validator(async ()=>{}); export default $$RSC_SERVER_ACTION_0 = validator(async ()=>{}); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js index 5fffa41ca93cd7..ee38e802379e1f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/27/output.js @@ -1,8 +1,8 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; -export const $$RSC_SERVER_ACTION_0 = // Rules here: +// Rules here: // 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`. // 2. Actual action functions should be renamed to `$$ACTION_...` and got exported. -/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ async function foo() { +/* __next_internal_action_entry_do_not_use__ {"001c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","0090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","009ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","00a9b2939c1f39073a6bed227fd20233064c8b7869":"$$RSC_SERVER_ACTION_4"} */ import { registerServerReference } from "private-next-rsc-server-reference"; +export const $$RSC_SERVER_ACTION_0 = async function foo() { console.log(1); }; registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js index e6484168ac6ecc..356d385134aea8 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/29/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7f28baf972d345b86b747ad0df73d75a0088a42214":"dec","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export const dec = async (value)=>{ return value - 1; }; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js index 725b2b04a64fa5..8f6423eb8c6cd5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/3/output.js @@ -1,4 +1,5 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +// app/send.ts +/* __next_internal_action_entry_do_not_use__ {"70e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export async function myAction(a, b, c) { console.log('a'); } diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js index 799363189ee9e5..1b77b56e114ec2 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","6090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1","7f0090eaf4e1f08a2d94f6be401e54a2ded399b87c":"action0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; let a, f; export const // FIXME: invalid transformation of hoisted functions (https://github.com/vercel/next.js/issues/57392) diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js index 2a28a738f8a7f2..c478b0519f7a8f 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/31/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"7fabf760c735ba66c4c26a2913864dd7e28fb88a91":"action2","7ff14702b5a021dd117f7ec7a3c838f397c2046d3b":"action"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export const action = { async f (x) { ; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js index 56a48d51311cf6..36e57a994f27ca 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/34/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","8069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js index a076a22f05222e..b0d7c1781c3864 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/35/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function my_fn() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js index e89c7c6ab15d70..7e66d7d1215eef 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/36/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"8012a8d21b6362b4cc8f5b15560525095bc48dba80":"$$RSC_SERVER_CACHE_3","803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1","c069348c79fce073bae2f70f139565a2fda1c74c74":"$$RSC_SERVER_CACHE_2"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js index 2ecaea3a252dda..c1ceabfc05913b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/37/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function fn() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js index 1dc399aa189c08..48ba664f083fdf 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/38/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js index b82210bf54f15d..da71805957d32b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/39/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js index e2ae5187cecc35..83c692dd852779 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/4/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"001ab723c80dcca470e0410b4b2a2fc2bf21f41476":"c","006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","006e7bc104e4d6e7fda190c4a51be969cfd0be6d6d":"a","00d1f7eb64271d7c601dfef7d4d7053de1c2ca4338":"b"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export async function a() {} export async function b() {} export async function c() {} diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js index 4e7e81c7dd8fde..a693fa136665a5 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/41/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"406a88810ecce4a4e8b59d53b8327d7e98bbf251d7":"$$RSC_SERVER_ACTION_0","c0951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js index 3f03be5aa933a5..b61436cd491841 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/42/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"c03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js index 0d9a9907cc69c3..9b766a82a77faf 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/45/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Expect no error here, this is allowed to be sync because it's not exported. diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js index ff999a55d94fff..e64f94ee38f9e2 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/48/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"60079087479e4c103d815f273878c7d1b8e902cc39":"action3","70f14702b5a021dd117f7ec7a3c838f397c2046d3b":"action","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","e03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Should be 0 111000 0, which is "70" in hex. diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js index 3f8cb8a604bf72..50db8ae1e38b8a 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/49/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js index 2b1f8945d7614b..fbd449c432f52e 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/50/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"f03128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function(a, b, c) { diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js index a0cafccbc47355..854240e0796e3b 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/51/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":"$$RSC_SERVER_ACTION_2","609ed0cc47abc4e1c64320cf42b74ae60b58c40f00":"$$RSC_SERVER_ACTION_3","7090b5db271335765a4b0eab01f044b381b5ebd5cd":"$$RSC_SERVER_ACTION_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export const $$RSC_SERVER_ACTION_1 = async function $$RSC_SERVER_ACTION_0(a, b, c) { return
{a} diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js index a5a816598afc39..9357632ba8215d 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/59/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"00b98e10c56c1bee7af6ff753c91a4c70ab0419f0a":"test","7f7a40999f9833d2bb66a82d6a20a7f2a7810315f8":"createItem"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { db } from 'database'; export const createItem = async (title)=>{ return new Promise((resolve, reject)=>{ diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts index bfb0c02fb81126..4cf6bfdab3a7cd 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/60/output.ts @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; // Exported TypeScript nodes should be ignored when validating that all module diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts index 24acfd136146e2..63f04788b17dea 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/62/output.ts @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"0095ef8ede0a8a4c822fcbdb018cb264731cb15281":"actionA"} */ import { registerServerReference } from "private-next-rsc-server-reference"; export type X = string; // @ts-ignore -- that file does not exist export { type A } from './a'; diff --git a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js index 44b8b97d538ba6..819c150ad859ad 100644 --- a/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js +++ b/crates/next-custom-transforms/tests/fixture/server-actions/server-graph/9/output.js @@ -1,4 +1,5 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +// app/send.ts +/* __next_internal_action_entry_do_not_use__ {"7f050e3854b72b19e3c7e3966a67535543a90bf7e0":"baz","7fab21efdafbe611287bc25c0462b1e0510d13e48b":"foo","7fc18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default"} */ import { registerServerReference } from "private-next-rsc-server-reference"; async function foo() {} export { foo }; async function bar() {} diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js index 73d8f67301e16a..e34370d76db7c1 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/development/server-actions/1/output.js @@ -1,4 +1,4 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"006c24672f968b0713dae406536f7dd6fe7d9a7fa0":"getHeaders","4028baf972d345b86b747ad0df73d75a0088a42214":"dec","403724e93433a7e950ef2f8479f31225e4b0dd0cc5":"redirectAction","40c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","40e44b877cc9d02556f56639c94229621ab0af0f5f":"inc","40f4ad91903d1bf66bfd4e0788888852badc924261":"slowInc","7f1e1a741f85a589443b50c4863618893572cfb178":"renamed"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var getHeaders = /*#__PURE__*/ createServerReference("006c24672f968b0713dae406536f7dd6fe7d9a7fa0", callServer, void 0, findSourceMapURL, "getHeaders"); export var inc = /*#__PURE__*/ createServerReference("40e44b877cc9d02556f56639c94229621ab0af0f5f", callServer, void 0, findSourceMapURL, "inc"); export var slowInc = /*#__PURE__*/ createServerReference("40f4ad91903d1bf66bfd4e0788888852badc924261", callServer, void 0, findSourceMapURL, "slowInc"); diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js index 73d8f67301e16a..e34370d76db7c1 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/client-graph/production/server-actions/1/output.js @@ -1,4 +1,4 @@ -import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; +/* __next_internal_action_entry_do_not_use__ {"006c24672f968b0713dae406536f7dd6fe7d9a7fa0":"getHeaders","4028baf972d345b86b747ad0df73d75a0088a42214":"dec","403724e93433a7e950ef2f8479f31225e4b0dd0cc5":"redirectAction","40c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","40e44b877cc9d02556f56639c94229621ab0af0f5f":"inc","40f4ad91903d1bf66bfd4e0788888852badc924261":"slowInc","7f1e1a741f85a589443b50c4863618893572cfb178":"renamed"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper"; export var getHeaders = /*#__PURE__*/ createServerReference("006c24672f968b0713dae406536f7dd6fe7d9a7fa0", callServer, void 0, findSourceMapURL, "getHeaders"); export var inc = /*#__PURE__*/ createServerReference("40e44b877cc9d02556f56639c94229621ab0af0f5f", callServer, void 0, findSourceMapURL, "inc"); export var slowInc = /*#__PURE__*/ createServerReference("40f4ad91903d1bf66bfd4e0788888852badc924261", callServer, void 0, findSourceMapURL, "slowInc"); diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js index f5e6c73108cfc6..13690ff79c8655 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/server-graph/use-cache/1/output.js @@ -1,4 +1,4 @@ -import { registerServerReference } from "private-next-rsc-server-reference"; +/* __next_internal_action_entry_do_not_use__ {"803128060c414d59f8552e4788b846c0d2b7f74743":"$$RSC_SERVER_CACHE_0","80951c375b4a6a6e89d67b743ec5808127cfde405d":"$$RSC_SERVER_CACHE_1"} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; import { cache as $$reactCache__ } from "react"; const $$RSC_SERVER_CACHE_0_INNER = async function foo() {}; diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js index e54d61d1796d84..0d47f485ae4515 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/development/server-actions/1/output.js @@ -1,8 +1,8 @@ "use turbopack no side effects"; -export { getHeaders } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQU9zQiJ9"; -export { inc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQVlzQiJ9"; -export { slowInc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B%0A%2F%2F%23%20sourceMappingURL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3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQWdCc0IifQ%3D%3D"; -export { dec } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQXFCc0IifQ%3D%3D"; -export { default } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20createServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InFKQXlCZSJ9"; -export { redirectAction } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQThCc0IifQ%3D%3D"; -export { renamed } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlKQXFDUyJ9"; +export { getHeaders } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%3A%22getHeaders%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200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KHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImdSQU9zQiJ9"; +export { inc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%3A%22inc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InlRQVlzQiJ9"; +export { slowInc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%3A%22slowInc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2Cf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GgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjZRQWdCc0IifQ%3D%3D"; +export { dec } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%224028baf972d345b86b747ad0df73d75a0088a42214%22%3A%22dec%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6InlRQXFCc0IifQ%3D%3D"; +export { default } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%3A%22default%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20createServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B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F0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6ImlSQXlCZSJ9"; +export { redirectAction } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%3A%22redirectAction%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B%0A%2F%2F%23%20sourceMappingURL%3Ddata%3Aapplication%2Fjson%3Bbase64%2CeyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc2VydmVyJ1xuXG5pbXBvcnQgJ3NlcnZlci1vbmx5J1xuXG5pbXBvcnQgeyByZWRpcmVjdCB9IGZyb20gJ25leHQvbmF2aWdhdGlvbidcbmltcG9ydCB7IGhlYWRlcnMsIGNvb2tpZXMgfSBmcm9tICduZXh0L2hlYWRlcnMnXG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRIZWFkZXJzKCkge1xuICBjb25zb2xlLmxvZygnYWNjZXB0IGhlYWRlcjonLCAoYXdhaXQgaGVhZGVycygpKS5nZXQoJ2FjY2VwdCcpKVxuICA7KGF3YWl0IGNvb2tpZXMoKSkuc2V0KCd0ZXN0LWNvb2tpZScsIERhdGUubm93KCkpXG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpbmModmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICsgMVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gc2xvd0luYyh2YWx1ZSkge1xuICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAxMDAwMCkpXG4gIHJldHVybiB2YWx1ZSArIDFcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGRlYyh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgLSAxXG59XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICh2YWx1ZSkge1xuICBjb25zb2xlLmxvZygndGhpc19pc19zZW5zaXRpdmVfaW5mbycpXG4gIHJldHVybiB2YWx1ZSAqIDJcbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHJlZGlyZWN0QWN0aW9uKHBhdGgpIHtcbiAgcmVkaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Im9SQThCc0IifQ%3D%3D"; +export { renamed } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%227f1e1a741f85a589443b50c4863618893572cfb178%22%3A%22renamed%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22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kaXJlY3QocGF0aClcbn1cblxuY29uc3Qgb3JpZ2luYWwgPSBhc3luYyAoKSA9PiB7XG4gIGNvbnNvbGUubG9nKCdhY3Rpb24nKVxufVxuZXhwb3J0IHsgb3JpZ2luYWwgYXMgcmVuYW1lZCB9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjZRQXFDUyJ9"; diff --git a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js index cd616d993f9309..e560564a77a871 100644 --- a/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/source-maps/turbopack/client-graph/production/server-actions/1/output.js @@ -1,8 +1,8 @@ "use turbopack no side effects"; -export { getHeaders } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B"; -export { inc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B"; -export { slowInc } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B"; -export { dec } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B"; -export { default } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B"; -export { redirectAction } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B"; -export { renamed } from "data:text/javascript,%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B"; +export { getHeaders } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%3A%22getHeaders%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20getHeaders%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22006c24672f968b0713dae406536f7dd6fe7d9a7fa0%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22getHeaders%22%29%3B"; +export { inc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%3A%22inc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20inc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240e44b877cc9d02556f56639c94229621ab0af0f5f%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22inc%22%29%3B"; +export { slowInc } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%3A%22slowInc%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20slowInc%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240f4ad91903d1bf66bfd4e0788888852badc924261%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22slowInc%22%29%3B"; +export { dec } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%224028baf972d345b86b747ad0df73d75a0088a42214%22%3A%22dec%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20dec%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%224028baf972d345b86b747ad0df73d75a0088a42214%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22dec%22%29%3B"; +export { default } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%3A%22default%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20default%20%2F%2A%23__PURE__%2A%2FcreateServerReference%28%2240c18c215a6b7cdc64bf709f3a714ffdef1bf9651d%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22default%22%29%3B"; +export { redirectAction } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%3A%22redirectAction%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20redirectAction%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%22403724e93433a7e950ef2f8479f31225e4b0dd0cc5%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22redirectAction%22%29%3B"; +export { renamed } from "data:text/javascript,%2F%2A%20__next_internal_action_entry_do_not_use__%20%5B%7B%227f1e1a741f85a589443b50c4863618893572cfb178%22%3A%22renamed%22%7D%2C%22%2Fapp%2Fitem.js%22%2C%22%22%5D%20%2A%2F%22use%20turbopack%20no%20side%20effects%22%3Bimport%7BcreateServerReference%2CcallServer%2CfindSourceMapURL%7Dfrom%22private-next-rsc-action-client-wrapper%22%3Bexport%20var%20renamed%3D%2F%2A%23__PURE__%2A%2FcreateServerReference%28%227f1e1a741f85a589443b50c4863618893572cfb178%22%2CcallServer%2Cvoid%200%2CfindSourceMapURL%2C%22renamed%22%29%3B"; From b479814ae49a3cff20a6d88c99a49f70b9cc8ac7 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 20 Nov 2025 10:48:09 +0100 Subject: [PATCH 23/25] snapshots --- ...ug-ids_browser_input_index_0151fefb.js.map | 12 ++++---- ..._debug-ids_browser_input_index_0151fefb.js | 29 +++++++++++++++++-- .../node/output/[turbopack]_runtime.js | 8 ++++- .../node/output/[turbopack]_runtime.js.map | 10 +++---- .../output/[turbopack]_runtime.js | 8 ++++- .../output/[turbopack]_runtime.js.map | 10 +++---- ...efault_dev_runtime_input_index_c0f7e0b0.js | 25 ++++++++++++++++ ...lt_dev_runtime_input_index_c0f7e0b0.js.map | 10 +++---- ...nsforms_preset_env_input_index_5aaf1327.js | 22 ++++++++++++++ ...rms_preset_env_input_index_5aaf1327.js.map | 8 ++--- 10 files changed, 113 insertions(+), 29 deletions(-) diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map index 075e60752d3ccb..45d3431f842e28 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map @@ -1,11 +1,11 @@ { "version": 3, "sources": [], - "debugId": "d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d", + "debugId": "9cc3c4ae-b6b3-7945-3645-c0e627a5103b", "sections": [ - {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qB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E,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 488, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AA2BA,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;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ack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAQA,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,qBAAyD,IAAI;AAEnE;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AAEpD;;CAEC,GACD,aAAa;AACb,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,SAAS,cAAc,CAAC,SAAS;IACvC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,aAAa;IACb,OAAO,kBAAkB,UAAU,WAAW,OAAO,EAAE;AACzD;AAEA;;CAEC,GACD,2CAA2C;AAC3C,MAAM,mCAEF,CAAC,IAAI;IACP,IAAI,CAAC,aAAa,GAAG,CAAC,MAAM,EAAE;QAC5B,QAAQ,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;;;CAIC,GACD,SAAS,uBAAuB,aAA4B;IAC1D,kBAAkB,GAAG,CAAC;AACxB;AAEA,SAAS,cAAc,YAA+B;IACpD,MAAM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd,iBACA,CAAC,KAAiB,iBAAiB,IAAI;IAE3C;IACA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C;AAEA;;CAEC,GACD,SAAS,kBAAkB,SAAoB;IAC7C,MAAM,kBAAkB,UAAU,MAAM;IACxC,MAAM,gBAAgB,kBAAkB;IACxC,sEAAsE;IACtE,QAAQ,aAAa,CAAC;IACtB,WAAW,gCAAgC,CAAE,IAAI,CAAC;QAChD;QACA,YAAY,IAAI,CAAC,MAAM;KACxB;IAED,+CAA+C;IAC/C,MAAM,aAAa,IAAI,IAAI,UAAU,MAAM,CAAC,GAAG,CAAC;IAChD,mBAAmB,GAAG,CAAC,eAAe;IACtC,KAAK,MAAM,aAAa,WAAY;QAClC,IAAI,kBAAkB,mBAAmB,GAAG,CAAC;QAC7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, - {"offset": {"line": 1554, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAoBA,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,MAAM,gBAAgB,oBAAoB;gBAE1C,iFAAiF;gBACjF,oBAAoB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gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, - {"offset": {"line": 1709, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,MAAM,WAAW;gBACnB,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAAS,eAAe,EAAE,gBAAgB,eAAe,EAAE,gBAAgB,GAAG,CAAC;gBAEzH,KAAK,MAAM,QAAQ,MAAM,IAAI,CAAC,OAAQ;oBACpC,KAAK,MAAM;gBACb;YACF,OAAO,IAAI,KAAK,WAAW;gBACzB,mEAAmE;gBACnE,0BAA0B;gBAC1B,uEAAuE;gBACvE,4DAA4D;gBAC5D,MAAM,UAAU,SAAS,gBAAgB,CACvC,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,SAAU;oBACxC,OAAO,MAAM;gBACf;YACF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;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] + {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAA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C,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 494, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadW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CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 718, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4CAA4C;AAC5C,4CAA4C;AAM5C,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,qBAAyD,IAAI;AAEnE;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AAEpD;;CAEC,GACD,aAAa;AACb,SAAS,8BACP,SAAoB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AAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, + {"offset": {"line": 1572, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAo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AAG;oBACZ,KAAK,OAAO,GAAG;wBACb,SAAS,MAAM;oBACjB;oBACA,KAAK,MAAM,GAAG;wBACZ,uEAAuE;wBACvE,oBAAoB;wBACpB,SAAS,OAAO;oBAClB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO,IAAI,KAAK,WAAW;gBACzB,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, + {"offset": {"line": 1734, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,MAAM,WAAW;gBACnB,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAAS,eAAe,EAAE,gBAAgB,eAAe,EAAE,gBAAgB,GAAG,CAAC;gBAEzH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A,KAAK,MAAM,GAAG;oBACZ,0EAA0E;oBAC1E,wEAAwE;oBACxE,uBAAuB;oBACvB,KAAK,MAAM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js index b5e22c7c422552..703090a1895937 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js @@ -1,4 +1,4 @@ -;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d")}catch(e){}}(); +;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="9cc3c4ae-b6b3-7945-3645-c0e627a5103b")}catch(e){}}(); (globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push([ "output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js", {"otherChunks":["output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0b8736b3.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]} @@ -12,6 +12,12 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; +/** + * This file contains runtime types and functions that are shared between all + * TurboPack ECMAScript runtimes. + * + * It will be prepended to the runtime code of each runtime. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -486,6 +492,15 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } +/** + * This file contains runtime types and functions that are shared between all + * Turbopack *development* ECMAScript runtimes. + * + * It will be appended to the runtime code of each runtime right after the + * shared runtime utils. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// +// Used in WebWorkers to tell the runtime about the chunk base path const browserContextPrototype = Context.prototype; var SourceType = /*#__PURE__*/ function(SourceType) { /** @@ -701,6 +716,9 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); } contextPrototype.u = loadWebAssemblyModule; +/// +/// +/// const devContextPrototype = Context.prototype; /** * This file contains runtime types and functions that are shared between all @@ -1552,6 +1570,13 @@ function registerChunk(registration) { } } globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript DOM runtime. + * + * It will be appended to the base development runtime code. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// let BACKEND; /** * Maps chunk paths to the corresponding resolver. @@ -1809,5 +1834,5 @@ chunkListsToRegister.forEach(registerChunkList); })(); -//# debugId=d57d5a8d-1ddf-6c8a-9ae1-9d08a5ea2d4d +//# debugId=9cc3c4ae-b6b3-7945-3645-c0e627a5103b //# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js index fc5b3598d60bd6..6f7962640c58cc 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js @@ -1,6 +1,12 @@ const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js"; const RELATIVE_ROOT_PATH = "../../../../../../.."; const ASSET_PREFIX = "/"; +/** + * This file contains runtime types and functions that are shared between all + * TurboPack ECMAScript runtimes. + * + * It will be prepended to the runtime code of each runtime. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -516,7 +522,7 @@ externalRequire.resolve = (id, options)=>{ return require.resolve(id, options); }; contextPrototype.x = externalRequire; -const path = require('path'); +/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path'); const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.'); // Compute the relative path to the `distDir`. const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map index bbe31b1fac80ed..421b4b1c4acaed 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1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AAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 477, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 518, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAMA,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 539, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, - {"offset": {"line": 560, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IAAI;AAC7C,qBAAqB,CAAC,GAAG;AACzB,MAAM,cAAmC,OAAO,MAAM,CAAC;AACvD,qBAAqB,CAAC,GAAG;AAEzB;;CAEC,GACD,SAAS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T;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] + {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,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IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 483, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 524, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 545, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, + {"offset": {"line": 566, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IAAI;AAC7C,qBAAqB,CAAC,GAAG;AACzB,MAAM,cAAmC,OAAO,MAAM,CAAC;AACvD,qBAAqB,CAAC,GAAG;AAEzB;;CAEC,GACD,SAAS,sBAEP,QAAgB;IAEhB,MAAM,WAAW,IAAI,CAAC,CAAC,CAAC;IACxB,MAAM,eAAe,UAAU,WAAW;IA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IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js index fc5b3598d60bd6..6f7962640c58cc 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js @@ -1,6 +1,12 @@ const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js"; const RELATIVE_ROOT_PATH = "../../../../../../.."; const ASSET_PREFIX = "/"; +/** + * This file contains runtime types and functions that are shared between all + * TurboPack ECMAScript runtimes. + * + * It will be prepended to the runtime code of each runtime. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -516,7 +522,7 @@ externalRequire.resolve = (id, options)=>{ return require.resolve(id, options); }; contextPrototype.x = externalRequire; -const path = require('path'); +/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path'); const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.'); // Compute the relative path to the `distDir`. const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map index bbe31b1fac80ed..421b4b1c4acaed 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAA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AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 477, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 518, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAMA,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 539, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, - {"offset": {"line": 560, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IAAI;AAC7C,qBAAqB,CAAC,GAAG;AACzB,MAAM,cAAmC,OAAO,MAAM,CAAC;AACvD,qBAAqB,CAAC,GAAG;AAEzB;;CAEC,GACD,SAAS,sBAEP,QAAgB;IAEhB,MAAM,WAAW,IAAI,CAAC,CAAC,CAAC;IACxB,MAAM,eAAe,UAAU,WAAW;IAC1C,IAAI,OAAO,iBAAiB,UAAU;QACpC,OAAO;IACT;IAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;IAClE,MAAM,WAAW,KAAK,OAAO,CAAC,cAAc;IAE5C,OAAO,IAAI,aAAa,CAAC,UAAU,IAAI;AACzC;AACA,qBAA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": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GA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AAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 483, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw\n try {\n raw = await import(id)\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n return interopEsm(raw.default, createNS(raw), true)\n }\n\n return raw\n}\ncontextPrototype.y = externalImport\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw\n try {\n raw = thunk()\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`)\n }\n\n if (!esm || raw.__esModule) {\n return raw\n }\n\n return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[]\n }\n) => {\n return require.resolve(id, options)\n}\ncontextPrototype.x = externalRequire\n"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 524, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string\ndeclare var RELATIVE_ROOT_PATH: string\ndeclare var ASSET_PREFIX: string\n\nconst path = require('path')\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.')\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n relativePathToRuntimeRoot,\n RELATIVE_ROOT_PATH\n)\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot)\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot)\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath)\n }\n return ABSOLUTE_ROOT\n}\nContext.prototype.P = resolveAbsolutePath\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT;AACA,QAAQ,SAAS,CAAC,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 545, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require('fs') as typeof import('fs')\n const { Readable } = require('stream') as typeof import('stream')\n\n const stream = createReadStream(path)\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n 'content-type': 'application/wasm',\n },\n })\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n return await WebAssembly.compileStreaming(response)\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n )\n\n return instance.exports\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}}, + {"offset": {"line": 566, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n}\n\ntype SourceData = ChunkPath | ModuleId\n\nprocess.env.TURBOPACK = '1'\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n x: ExternalRequire\n y: ExternalImport\n}\n\nconst nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackNodeBuildContext\n) => unknown\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nnodeContextPrototype.M = moduleFactories\nconst moduleCache: ModuleCache = Object.create(null)\nnodeContextPrototype.c = moduleCache\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n const exportedPath = exported?.default ?? exported\n if (typeof exportedPath !== 'string') {\n return exported as any\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n return url.pathToFileURL(resolved).href\n}\nnodeContextPrototype.R = resolvePathFromModule\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n if (typeof chunkData === 'string') {\n loadRuntimeChunkPath(sourcePath, chunkData)\n } else {\n loadRuntimeChunkPath(sourcePath, chunkData.path)\n }\n}\n\nconst loadedChunks = new Set()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise = Promise.resolve(undefined)\nconst chunkCache = new Map>()\n\nfunction clearChunkCache() {\n chunkCache.clear()\n}\n\nfunction loadRuntimeChunkPath(\n sourcePath: ChunkPath,\n chunkPath: ChunkPath\n): void {\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return\n }\n\n if (loadedChunks.has(chunkPath)) {\n return\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n loadedChunks.add(chunkPath)\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`\n\n if (sourcePath) {\n errorMessage += ` from runtime for chunk ${sourcePath}`\n }\n\n throw new Error(errorMessage, {\n cause: e,\n })\n }\n}\n\nfunction loadChunkAsync(\n this: TurbopackBaseContext,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n if (!isJs(chunkPath)) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return unsupportedLoadChunk\n }\n\n let entry = chunkCache.get(chunkPath)\n if (entry === undefined) {\n try {\n // resolve to an absolute path to simplify `require` handling\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n const chunkModules: CompressedModuleFactories = require(resolved)\n installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n entry = loadedChunk\n } catch (e) {\n const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n\n // Cache the failure promise, future requests will also get this same rejection\n entry = Promise.reject(\n new Error(errorMessage, {\n cause: e,\n })\n )\n }\n chunkCache.set(chunkPath, entry)\n }\n // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl(\n this: TurbopackBaseContext,\n chunkUrl: string\n) {\n const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n imports: WebAssembly.Imports\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n chunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error('Worker blobs are not implemented yet for Node.js')\n}\n\nnodeContextPrototype.b = getWorkerBlobURL\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`\n )\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n moduleCache[id] = module\n\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n module.loaded = true\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;WAVE;EAAA;AAgBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAQxB,MAAM,uBAAuB,QAAQ,SAAS;AAO9C,MAAM,MAAM,QAAQ;AAEpB,MAAM,kBAAmC,IAAI;AAC7C,qBAAqB,CAAC,GAAG;AACzB,MAAM,cAAmC,OAAO,MAAM,CAAC;AACvD,qBAAqB,CAAC,GAAG;AAEzB;;CAEC,GACD,SAAS,sBAEP,QAAgB;IAEhB,MAAM,WAAW,IAAI,CAAC,CAAC,CAAC;IACxB,MAAM,eAAe,UAAU,WAAW;IAC1C,IAAI,OAAO,iBAAiB,UAAU;QACpC,OAAO;IACT;IAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;IAClE,MAAM,WAAW,KAAK,OAAO,CAAC,cAAc;IAE5C,OAAO,IAAI,aAAa,CAAC,UAAU,IAAI;AACzC;AACA,qBAAqB,CAAC,GAAG;AAEzB,SAAS,iBAAiB,UAAqB,EAAE,SAAoB;IACnE,IAAI,OAAO,cAAc,UAAU;QACj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C,GAAG,GAAG;IAElB,MAAM,UAAU,IAAK,QACnB,SACA;IAEF,4EAA4E;IAC5E,IAAI;QACF,cAAc,SAAS,SAAQ;IACjC,EAAE,OAAO,OAAO;QACd,QAAO,KAAK,GAAG;QACf,MAAM;IACR;IAEA,QAAO,MAAM,GAAG;IAChB,IAAI,QAAO,eAAe,IAAI,QAAO,OAAO,KAAK,QAAO,eAAe,EAAE;QACvE,yDAAyD;QACzD,WAAW,QAAO,OAAO,EAAE,QAAO,eAAe;IACnD;IAEA,OAAO;AACT;AAEA;;CAEC,GACD,aAAa;AACb,SAAS,iCACP,EAAY,EACZ,YAAoB;IAEpB,MAAM,UAAS,WAAW,CAAC,GAAG;IAE9B,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QAEA,OAAO;IACT;IAEA,OAAO,kBAAkB,OAAuB,aAAa,EAAE;AACjE;AAEA;;CAEC,GACD,SAAS,yBACP,SAAoB,EACpB,QAAkB;IAElB,OAAO,kBAAkB,aAA8B;AACzD;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,WAAW;AAC7C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG,CAAC,aAA0B,CAAC;QAC3C,GAAG,CAAC,KAAiB,8BAA8B,YAAY;QAC/D,GAAG,CAAC,YAAyB,iBAAiB,YAAY;IAC5D,CAAC","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js index 7db36098e0e2c2..9ae60e99d2d3ef 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/5c1d0_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js @@ -11,6 +11,12 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; +/** + * This file contains runtime types and functions that are shared between all + * TurboPack ECMAScript runtimes. + * + * It will be prepended to the runtime code of each runtime. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -485,6 +491,15 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } +/** + * This file contains runtime types and functions that are shared between all + * Turbopack *development* ECMAScript runtimes. + * + * It will be appended to the runtime code of each runtime right after the + * shared runtime utils. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// +// Used in WebWorkers to tell the runtime about the chunk base path const browserContextPrototype = Context.prototype; var SourceType = /*#__PURE__*/ function(SourceType) { /** @@ -700,6 +715,9 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); } contextPrototype.u = loadWebAssemblyModule; +/// +/// +/// const devContextPrototype = Context.prototype; /** * This file contains runtime types and functions that are shared between all @@ -1551,6 +1569,13 @@ function registerChunk(registration) { } } globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript DOM runtime. + * + * It will be appended to the base development runtime code. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// let BACKEND; /** * Maps chunk paths to the corresponding resolver. diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map index 67cdc3ce77f5f4..6c714a9cd38b2a 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/780ce_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_c0f7e0b0.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAmBA,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB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C,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 487, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AA2BA,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;IAEpB,OAAO,qBAAqC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;AACzD;AACA,wBAAwB,CAAC,GAAG;AAE5B,SAAS,iBAAiB,SAAoB,EAAE,SAAoB;IAClE,OAAO,qBAAsC,WAAW;AAC1D;AAEA,eAAe,kBACb,UAAsB,EACtB,UAAsB,EACtB,SAAoB;IAEpB,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,YAAY,YAAY;I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;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 702, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAQA,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAE1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,qBAAyD,IAAI;AACnE;;CAEC,GACD,MAAM,qBAAyD,IAAI;AAEnE;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AA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7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, - {"offset": {"line": 1553, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\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SAAS,aAAa,CAAC;oBACpC,KAAK,GAAG,GAAG;oBACX,KAAK,IAAI,GAAG;oBACZ,KAAK,OAAO,GAAG;wBACb,SAAS,MAAM;oBACjB;oBACA,KAAK,MAAM,GAAG;wBACZ,uEAAuE;wBACvE,oBAAoB;wBACpB,SAAS,OAAO;oBAClB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO,IAAI,KAAK,WAAW;gBACzB,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, - {"offset": {"line": 1708, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`\n }\n\n // eslint-disable-next-line no-eval\n return eval(code)\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AACH,CAAC;IACA,cAAc;QACZ,aAAY,QAAQ;YAClB,eAAe;YAEf,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,MAAM,WAAW;gBACnB,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAA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AK,IAAI,GAAG;gBACd;gBAEA,KAAK,OAAO,GAAG;oBACb;gBACF;gBACA,KAAK,MAAM,GAAG;oBACZ,0EAA0E;oBAC1E,wEAAwE;oBACxE,uBAAuB;oBACvB,KAAK,MAAM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,QAAkB;QACxC,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,MAAM,oBACzC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,QAC3B;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd","ignoreList":[0]}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MAAc,EACd,OAAgB;IAEhB,IAAI,CAAC,CAAC,GAAG;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAAC,CAAC,GAAG;AACX;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAAO,OAAO,cAAc,CAAC,KAAK,MAAM;AACxE;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GAAG,GAAG;IACpB;IACA,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,mBAAmB,EAAY;IACtC,OAAO;QACL,SAAS,CAAC;QACV,OAAO;QACP;QACA,iBAAiB;IACnB;AACF;AAGA,MAAM,mBAAmB;AAUzB;;CAEC,GACD,SAAS,IAAI,OAAgB,EAAE,QAAqB;IAClD,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAI,IAAI;IACR,MAAO,IAAI,SAAS,MAAM,CAAE;QAC1B,MAAM,WAAW,QAAQ,CAAC,IAAI;QAC9B,MAAM,gBAAgB,QAA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ACA,iBAAiB,CAAC,GAAG;AAErB;;;;;;;;;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 493, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;AAEzD,mEAAmE;AAcnE,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;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,YAAY,CAAC;IAC/B,MAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,MAAM,OAAO,IAAI,UAAU,CAAC,mBACxB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,OAAO;AACT;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,MAAM,cAAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 717, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\ninterface TurbopackDevContext extends TurbopackBrowserBaseContext {\n k: RefreshContext\n}\n\nconst devContextPrototype = Context.prototype as TurbopackDevContext\n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst devModuleCache: ModuleCache = Object.create(null)\ndevContextPrototype.c = devModuleCache\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import('@next/react-refresh-utils/dist/runtime').RefreshRuntimeGlobals\n\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals['$RefreshHelpers$']\ndeclare var $RefreshReg$: RefreshRuntimeGlobals['$RefreshReg$']\ndeclare var $RefreshSig$: RefreshRuntimeGlobals['$RefreshSig$']\ndeclare var $RefreshInterceptModuleExecution$: RefreshRuntimeGlobals['$RefreshInterceptModuleExecution$']\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals['$RefreshReg$']\n signature: RefreshRuntimeGlobals['$RefreshSig$']\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh\n}\n\ntype RefreshHelpers = RefreshRuntimeGlobals['$RefreshHelpers$']\n\ntype ModuleFactory = (\n this: Module['exports'],\n context: TurbopackDevContext\n) => unknown\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nclass UpdateApplyError extends Error {\n name = 'UpdateApplyError'\n\n dependencyChain: ModuleId[]\n\n constructor(message: string, dependencyChain: ModuleId[]) {\n super(message)\n this.dependencyChain = dependencyChain\n }\n}\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set()\n\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map()\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set()\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map()\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map()\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map()\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map()\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set()\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = devModuleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n HotModule\n> = (id, sourceModule) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n )\n }\n\n const module = devModuleCache[id]\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id)\n }\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id)\n }\n\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction DevContext(\n this: TurbopackDevContext,\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n) {\n Context.call(this, module, exports)\n this.k = refresh\n}\nDevContext.prototype = Context.prototype\n\ntype DevContextConstructor = {\n new (\n module: HotModule,\n exports: Exports,\n refresh: RefreshContext\n ): TurbopackDevContext\n}\n\nfunction instantiateModule(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n // We are in development, this is always a string.\n let id = moduleId as string\n\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(\n factoryNotAvailableMessage(id, sourceType, sourceData) +\n ' It might have been deleted in an HMR update.'\n )\n }\n\n const hotData = moduleHotData.get(id)!\n const { hot, hotState } = createModuleHot(id, hotData)\n\n let parents: ModuleId[]\n switch (sourceType) {\n case SourceType.Runtime:\n runtimeModules.add(id)\n parents = []\n break\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [sourceData as ModuleId]\n break\n case SourceType.Update:\n parents = (sourceData as ModuleId[]) || []\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n\n const module: HotModule = createModuleObject(id) as HotModule\n const exports = module.exports\n module.parents = parents\n module.children = []\n module.hot = hot\n\n devModuleCache[id] = module\n moduleHotState.set(module, hotState)\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n runModuleExecutionHooks(module, (refresh) => {\n const context = new (DevContext as any as DevContextConstructor)(\n module,\n exports,\n refresh\n )\n moduleFactory(context, module, exports)\n })\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\nconst DUMMY_REFRESH_CONTEXT = {\n register: (_type: unknown, _id: unknown) => {},\n signature: () => (_type: unknown) => {},\n registerExports: (_module: unknown, _helpers: unknown) => {},\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: HotModule,\n executeModule: (ctx: RefreshContext) => void\n) {\n if (typeof globalThis.$RefreshInterceptModuleExecution$ === 'function') {\n const cleanupReactRefreshIntercept =\n globalThis.$RefreshInterceptModuleExecution$(module.id)\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n })\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept()\n }\n } else {\n // If the react refresh hooks are not installed we need to bind dummy functions.\n // This is expected when running in a Web Worker. It is also common in some of\n // our test environments.\n executeModule(DUMMY_REFRESH_CONTEXT)\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports\n const prevExports = module.hot.data.prevExports ?? null\n\n helpers.registerExportsForReactRefresh(currentExports, module.id)\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports\n })\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept()\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate()\n } else {\n helpers.scheduleUpdate()\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null\n if (isNoLongerABoundary) {\n module.hot.invalidate()\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set\n newModuleFactories: Map\n} {\n const newModuleFactories = new Map()\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys())\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry))\n }\n\n return { outdatedModules, newModuleFactories }\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set()\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId)\n\n switch (effect.type) {\n case 'unaccepted':\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'self-declined':\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n )\n case 'accepted':\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId)\n }\n break\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n }\n }\n\n return outdatedModules\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[] = []\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n })\n }\n }\n return outdatedSelfAcceptedModules\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath)\n }\n }\n\n const disposedModules: Set = new Set()\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId)\n }\n }\n }\n\n return { disposedModules }\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, 'replace')\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, 'clear')\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map()\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId]\n outdatedModuleParents.set(moduleId, oldModule?.parents)\n delete devModuleCache[moduleId]\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents }\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n const module = devModuleCache[moduleId]\n if (!module) {\n return\n }\n\n const hotState = moduleHotState.get(module)!\n const data = {}\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data)\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false\n\n moduleHotState.delete(module)\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId]\n if (!child) {\n continue\n }\n\n const idx = child.parents.indexOf(module.id)\n if (idx >= 0) {\n child.parents.splice(idx, 1)\n }\n }\n\n switch (mode) {\n case 'clear':\n delete devModuleCache[module.id]\n moduleHotData.delete(module.id)\n break\n case 'replace':\n moduleHotData.set(module.id, data)\n break\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`)\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId\n errorHandler: true | Function\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n applyModuleFactoryName(factory)\n moduleFactories.set(moduleId, factory)\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(\n moduleId,\n SourceType.Update,\n outdatedModuleParents.get(moduleId)\n )\n } catch (err) {\n if (typeof errorHandler === 'function') {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n } catch (err2) {\n reportError(err2)\n reportError(err)\n }\n } else {\n reportError(err)\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case 'ChunkListUpdate':\n applyChunkListUpdate(update)\n break\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`)\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case 'EcmascriptMergedUpdate':\n applyEcmascriptMergedUpdate(merged)\n break\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`)\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(\n update.chunks\n ) as Array<[ChunkPath, ChunkUpdate]>) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n switch (chunkUpdate.type) {\n case 'added':\n BACKEND.loadChunkCached(SourceType.Update, chunkUrl)\n break\n case 'total':\n DEV_BACKEND.reloadChunk?.(chunkUrl)\n break\n case 'deleted':\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n break\n case 'partial':\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n )\n break\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n )\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n )\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n )\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted)\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories)\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId)\n })\n\n queuedInvalidatedModules.clear()\n }\n\n return outdatedModules\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules)\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules)\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n )\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any\n\n function reportError(err: any) {\n if (!error) error = err\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n )\n\n if (error) {\n throw error\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map())\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map\n modified: Map\n deleted: Set\n chunksAdded: Map>\n chunksDeleted: Map>\n} {\n const chunksAdded = new Map()\n const chunksDeleted = new Map()\n const added: Map = new Map()\n const modified = new Map()\n const deleted: Set = new Set()\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n switch (mergedChunkUpdate.type) {\n case 'added': {\n const updateAdded = new Set(mergedChunkUpdate.modules)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n chunksAdded.set(chunkPath, updateAdded)\n break\n }\n case 'deleted': {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath))\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n case 'partial': {\n const updateAdded = new Set(mergedChunkUpdate.added)\n const updateDeleted = new Set(mergedChunkUpdate.deleted)\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId])\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId)\n }\n chunksAdded.set(chunkPath, updateAdded)\n chunksDeleted.set(chunkPath, updateDeleted)\n break\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n )\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId)\n deleted.delete(moduleId)\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry)\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\ntype ModuleEffect =\n | {\n type: 'unaccepted'\n dependencyChain: ModuleId[]\n }\n | {\n type: 'self-declined'\n dependencyChain: ModuleId[]\n moduleId: ModuleId\n }\n | {\n type: 'accepted'\n moduleId: ModuleId\n outdatedModules: Set\n }\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set()\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ]\n\n let nextItem\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue\n }\n\n outdatedModules.add(moduleId)\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: 'unaccepted',\n dependencyChain,\n }\n }\n\n const module = devModuleCache[moduleId]\n const hotState = moduleHotState.get(module)!\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue\n }\n\n if (hotState.selfDeclined) {\n return {\n type: 'self-declined',\n dependencyChain,\n moduleId,\n }\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n })\n continue\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId]\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n })\n }\n }\n\n return {\n type: 'accepted',\n moduleId,\n outdatedModules,\n }\n}\n\nfunction handleApply(chunkListPath: ChunkListPath, update: ServerMessage) {\n switch (update.type) {\n case 'partial': {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction)\n break\n }\n case 'restart': {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart()\n break\n }\n case 'notFound': {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart()\n } else {\n disposeChunkList(chunkListPath)\n }\n break\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`)\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n }\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true\n } else if (typeof modules === 'function') {\n hotState.selfAccepted = modules\n } else {\n throw new Error('unsupported `accept` signature')\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true\n } else {\n throw new Error('unsupported `decline` signature')\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback)\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback)\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1)\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true\n queuedInvalidatedModules.add(moduleId)\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => 'idle',\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n }\n\n return { hot, hotState }\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const chunkModules = chunkModulesMap.get(chunkPath)!\n chunkModules.delete(moduleId)\n\n const noRemainingModules = chunkModules.size === 0\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath)\n }\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n }\n\n return noRemainingChunks\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkListPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath)\n if (chunkPaths == null) {\n return false\n }\n chunkListChunksMap.delete(chunkListPath)\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!\n chunkChunkLists.delete(chunkListPath)\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath)\n disposeChunk(chunkPath)\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n const chunkListUrl = getChunkRelativeUrl(chunkListPath)\n\n DEV_BACKEND.unloadChunk?.(chunkListUrl)\n\n return true\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkUrl)\n\n const chunkModules = chunkModulesMap.get(chunkPath)\n if (chunkModules == null) {\n return false\n }\n chunkModules.delete(chunkPath)\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!\n moduleChunks.delete(chunkPath)\n\n const noRemainingChunks = moduleChunks.size === 0\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId)\n disposeModule(moduleId, 'clear')\n availableModules.delete(moduleId)\n }\n }\n\n return true\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId)\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath])\n moduleChunksMap.set(moduleId, moduleChunks)\n } else {\n moduleChunks.add(chunkPath)\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath)\n if (!chunkModules) {\n chunkModules = new Set([moduleId])\n chunkModulesMap.set(chunkPath, chunkModules)\n } else {\n chunkModules.add(moduleId)\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkListPath) {\n runtimeChunkLists.add(chunkListPath)\n}\n\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories,\n (id: ModuleId) => addModuleToChunk(id, chunkPath)\n )\n }\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(chunkList: ChunkList) {\n const chunkListScript = chunkList.script\n const chunkListPath = getPathFromScript(chunkListScript)\n // The \"chunk\" is also registered to finish the loading in the backend\n BACKEND.registerChunk(chunkListPath as string as ChunkPath)\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([\n chunkListPath,\n handleApply.bind(null, chunkListPath),\n ])\n\n // Adding chunks to chunk lists and vice versa.\n const chunkPaths = new Set(chunkList.chunks.map(getChunkPath))\n chunkListChunksMap.set(chunkListPath, chunkPaths)\n for (const chunkPath of chunkPaths) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath)\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkListPath])\n chunkChunkListsMap.set(chunkPath, chunkChunkLists)\n } else {\n chunkChunkLists.add(chunkListPath)\n }\n }\n\n if (chunkList.source === 'entry') {\n markChunkListAsRuntime(chunkListPath)\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []\n"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4CAA4C;AAC5C,4CAA4C;AAM5C,MAAM,sBAAsB,QAAQ,SAAS;AAE7C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AAC7D,oBAAoB,CAAC,GAAG;AAgCxB,MAAM,yBAAyB;IAC7B,OAAO,mBAAkB;IAEzB,gBAA2B;IAE3B,YAAY,OAAe,EAAE,eAA2B,CAAE;QACxD,KAAK,CAAC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C,MAAM,gBAAgB,kBAAkB;IACxC,sEAAsE;IACtE,QAAQ,aAAa,CAAC;IACtB,WAAW,gCAAgC,CAAE,IAAI,CAAC;QAChD;QACA,YAAY,IAAI,CAAC,MAAM;KACxB;IAED,+CAA+C;IAC/C,MAAM,aAAa,IAAI,IAAI,UAAU,MAAM,CAAC,GAAG,CAAC;IAChD,mBAAmB,GAAG,CAAC,eAAe;IACtC,KAAK,MAAM,aAAa,WAAY;QAClC,IAAI,kBAAkB,mBAAmB,GAAG,CAAC;QAC7C,IAAI,CAAC,iBAAiB;YACpB,kBAAkB,IAAI,IAAI;gBAAC;aAAc;YACzC,mBAAmB,GAAG,CAAC,WAAW;QACpC,OAAO;YACL,gBAAgB,GAAG,CAAC;QACtB;IACF;IAEA,IAAI,UAAU,MAAM,KAAK,SAAS;QAChC,uBAAuB;IACzB;AACF;AAEA,WAAW,gCAAgC,KAAK,EAAE","ignoreList":[0]}}, + {"offset": {"line": 1571, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;AAU3D,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,MAAM,gBAAgB,oBAAoB;gBAE1C,iFAAiF;gBACjF,oBAAoB;YACtB;YAEA,kFAAkF;YAClF,MAAM,QAAQ,GAAG,CACf,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,iBACtB,iBAAiB,WAAW;YAIhC,IAAI,OAAO,gBAAgB,CAAC,MAAM,GAAG,GAAG;gBACtC,KAAK,MAAM,YAAY,OAAO,gBAAgB,CAAE;oBAC9C,8BAA8B,WAAW;gBAC3C;YACF;QACF;QAEA;;;KAGC,GACD,iBAAgB,UAAsB,EAAE,QAAkB;YACxD,OAAO,YAAY,YAAY;QACjC;QAEA,MAAM,iBACJ,WAAuB,EACvB,WAAuB,EACvB,aAAwB,EACxB,WAAqC,EACrC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BAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}, + {"offset": {"line": 1733, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend\n;(() => {\n DEV_BACKEND = {\n unloadChunk(chunkUrl) {\n deleteResolver(chunkUrl)\n\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n )\n for (const link of Array.from(links)) {\n link.remove()\n }\n } else if (isJs(chunkUrl)) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n for (const script of Array.from(scripts)) {\n script.remove()\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n },\n\n reloadChunk(chunkUrl) {\n return new Promise((resolve, reject) => {\n if (!isCss(chunkUrl)) {\n reject(new Error('The DOM backend can only reload CSS chunks'))\n return\n }\n\n const decodedChunkUrl = decodeURI(chunkUrl)\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkUrl}`))\n return\n }\n\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n\n if (navigator.userAgent.includes('Firefox')) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`\n } else {\n link.href = chunkUrl\n }\n\n link.onerror = () => {\n reject()\n }\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove()\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve()\n }\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n )\n })\n },\n\n restart: () => self.location.reload(),\n }\n\n function deleteResolver(chunkUrl: ChunkUrl) {\n chunkResolvers.delete(chunkUrl)\n }\n})()\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url + CHUNK_SUFFIX_PATH\n )}`\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875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swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js index 2d01b4b1d904f5..8386cd98ebffae 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/5c1d0_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js @@ -11,6 +11,12 @@ const CHUNK_BASE_PATH = ""; const CHUNK_SUFFIX_PATH = ""; const RELATIVE_ROOT_PATH = "../../../../../../.."; const RUNTIME_PUBLIC_PATH = ""; +/** + * This file contains runtime types and functions that are shared between all + * TurboPack ECMAScript runtimes. + * + * It will be prepended to the runtime code of each runtime. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -725,6 +731,15 @@ function applyModuleFactoryName(factory) { value: 'module evaluation' }); } +/** + * This file contains runtime types and functions that are shared between all + * Turbopack *development* ECMAScript runtimes. + * + * It will be appended to the runtime code of each runtime right after the + * shared runtime utils. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// +// Used in WebWorkers to tell the runtime about the chunk base path function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -1255,6 +1270,13 @@ function registerChunk(registration) { } return BACKEND.registerChunk(chunkPath, runtimeParams); } +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript DOM runtime. + * + * It will be appended to the base development runtime code. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map index 9fd8d4a7a144a9..b868cee4a14da9 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/output/780ce_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_5aaf1327.js.map @@ -2,8 +2,8 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,qBAAqB,IAAI;AAE/B;;CAEC,GACD,SAAS,QAEP,MA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;QACd,OAAO,MAAM,CAAC,KAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 727, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\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ACD,SAAS,yBACP,QAAkB,EAClB,SAAoB;IAEpB,OAAO,kBAAkB,aAA8B;AACzD;AACA;;CAEC,GACD,SAAS,oBAAoB,SAAoC;IAC/D,OAAO,GAAG,kBAAkB,UACzB,KAAK,CAAC,KACN,GAAG,CAAC,SAAC;eAAM,mBAAmB;OAC9B,IAAI,CAAC,OAAO,mBAAmB;AACpC;AASA,SAAS,kBACP,WAAsE;IAEtE,IAAI,OAAO,gBAAgB,UAAU;QACnC,OAAO;IACT;IACA,IAAM,WACJ,OAAO,8BAA8B,cACjC,0BAA0B,GAAG,KAC7B,YAAY,YAAY,CAAC;IAC/B,IAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,IAAM,OAAO,IAAI,UAAU,CAAC,mBACxB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,OAAO;AACT;AAEA,IAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,IAAM,cAAc;AACpB;;CAEC,GACD,SAAS,MAAM,QAAkB;IAC/B,OAAO,YAAY,IAAI,CAAC;AAC1B;AAEA,SAAS,gBAEP,SAAoB,EACpB,UAAoC,EACpC,UAA+B;IAE/B,OAAO,QAAQ,eAAe,IAE5B,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA,YACA;AAEJ;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, - {"offset": {"line": 1186, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {}\ncontextPrototype.c = moduleCache\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData))\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n\n moduleCache[id] = module\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories\n )\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,mCAAmC;AAEnC,IAAM,cAAmC,CAAC;AAC1C,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,aAAa;AACb,6DAA6D;AAC7D,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,IAAM,SAAS,WAAW,CAAC,SAAS;IACpC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,kBAAkB,UAAU,WAAW,OAAO,EAAE;AACzD;AAEA;;CAEC,GACD,sBAAsB;AACtB,aAAa;AACb,6DAA6D;AAC7D,IAAM,mCAEF,SAAC,IAAI;IACP,IAAM,SAAS,WAAW,CAAC,GAAG;IAE9B,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,kBAAkB,IAAI,WAAW,MAAM,EAAE,aAAa,EAAE;AACjE;AAEA,SAAS,kBACP,EAAY,EACZ,UAAsB,EACtB,UAAsB;IAEtB,IAAM,gBAAgB,gBAAgB,GAAG,CAAC;IAC1C,IAAI,OAAO,kBAAkB,YAAY;QACvC,sEAAsE;QACtE,0EAA0E;QAC1E,mDAAmD;QACnD,MAAM,IAAI,MAAM,2BAA2B,IAAI,YAAY;IAC7D;IAEA,IAAM,SAAiB,mBAAmB;IAC1C,IAAM,UAAU,OAAO,OAAO;IAE9B,WAAW,CAAC,GAAG,GAAG;IAElB,4EAA4E;IAC5E,IAAM,UAAU,IAAK,QACnB,QACA;IAEF,IAAI;QACF,cAAc,SAAS,QAAQ;IACjC,EAAE,OAAO,OAAO;QACd,OAAO,KAAK,GAAG;QACf,MAAM;IACR;IAEA,IAAI,OAAO,eAAe,IAAI,OAAO,OAAO,KAAK,OAAO,eAAe,EAAE;QACvE,yDAAyD;QACzD,WAAW,OAAO,OAAO,EAAE,OAAO,eAAe;IACnD;IAEA,OAAO;AACT;AAEA,6DAA6D;AAC7D,SAAS,cAAc,YAA+B;IACpD,IAAM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd;IAEJ;IAEA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C","ignoreList":[0]}}, - {"offset": {"line": 1257, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI;AAEJ;;CAEC,GACD,IAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACF,eAAN,SAAM,cAAc,SAAS,EAAE,MAAM;;oBAC7B,UAEA,UAOD,2BAAA,mBAAA,gBAAA,WAAA,OAAM,gBACH,gBACA,eAcD,4BAAA,oBAAA,iBAAA,YAAA,QAAM;;;;4BAzBP,WAAW,oBAAoB;4BAE/B,WAAW,oBAAoB;4BACrC,SAAS,OAAO;4BAEhB,IAAI,UAAU,MAAM;gCAClB;;;4BACF;4BAEK,kCAAA,2BAAA;;gCAAL,IAAK,YAAwB,OAAO,WAAW,uBAA1C,6BAAA,QAAA,yBAAA,iCAA4C;oCAAtC,iBAAN;oCACG,iBAAiB,aAAa;oCAC9B,gBAAgB,oBAAoB;oCAE1C,iFAAiF;oCACjF,oBAAoB;gCACtB;;gCANK;gCAAA;;;yCAAA,6BAAA;wCAAA;;;wCAAA;8CAAA;;;;4BAQL,kFAAkF;4BAClF;;gCAAM,QAAQ,GAAG,CACf,OAAO,WAAW,CAAC,GAAG,CAAC,SAAC;2CACtB,iBAAiB,WAAW;;;;4BAFhC;4BAMA,IAAI,OAAO,gBAAgB,CAAC,MAAM,GAAG,GAAG;gCACjC,mCAAA,4BAAA;;oCAAL,IAAK,aAAkB,OAAO,gBAAg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M,GAAG,GAAG;wBAGzB,kCAAA,2BAAA;;wBAFL,qEAAqE;wBACrE,kEAAkE;wBAClE,QAAK,YAAgB,MAAM,IAAI,CAAC,qCAA3B,SAAA,6BAAA,QAAA,yBAAA,iCAA6C;4BAA7C,IAAM,SAAN;4BACH,OAAO,gBAAgB,CAAC,SAAS;gCAC/B,SAAS,MAAM;4BACjB;wBACF;;wBAJK;wBAAA;;;iCAAA,6BAAA;gCAAA;;;gCAAA;sCAAA;;;;gBAKP,OAAO;oBACL,IAAM,UAAS,SAAS,aAAa,CAAC;oBACtC,QAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,QAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;IAEA,SAAS,iBAAiB,aAAwB;QAChD,OAAO,MAAM,oBAAoB;IACnC;AACF,CAAC","ignoreList":[0]}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: ModuleId): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: ModuleId): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id)\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\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AAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG;yCAAI;YAAA;;eAAsB;;IAC5D,IAAK,IAAM,QAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,MAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,KAAI;IACpB;AACJ;AACA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAErB,kGAAkG;AAClG,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 733, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var CHUNK_SUFFIX_PATH: string\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // 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.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((error) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : ''\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n )\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Returns a blob URL for the worker.\n * @param chunks list of chunks to load\n */\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n // It is important to reverse the array so when bootstrapping we can infer what chunk is being\n // evaluated by poping urls off of this array. See `getPathFromScript`\n let bootstrap = `self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};\nself.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(chunks.reverse().map(getChunkRelativeUrl), null, 2)};\nimportScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`\n let blob = new Blob([bootstrap], { type: 'text/javascript' })\n return URL.createObjectURL(blob)\n}\nbrowserContextPrototype.b = getWorkerBlobURL\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${CHUNK_SUFFIX_PATH}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined'\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute('src')!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath)\n}\n\nconst regexCssUrl = /\\.css(?:\\?[^#]*)?(?:#.*)?$/\n/**\n * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment.\n */\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return regexCssUrl.test(chunkUrl)\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;AAEzD,mEAAmE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcnE,IAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAgDL,IAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,IAAM,mBAAuD,IAAI;AAEjE,IAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,SAAC;uBAAe,CAAC,qBAAqB,EAAE,YAAY;;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,SAAS,UAEP,SAAoB;IAEpB,OAAO,qBAAqC,IAAI,CAAC,CAAC,CAAC,EAAE,EA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ACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,sBAEP,SAAoB,EACpB,UAAoC;IAEpC,OAAO,QAAQ,qBAAqB,IAElC,IAAI,CAAC,CAAC,CAAC,EAAE,EACT,WACA;AAEJ;AACA,iBAAiB,CAAC,GAAG","ignoreList":[0]}}, + {"offset": {"line": 1201, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {}\ncontextPrototype.c = moduleCache\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module {\n const module = moduleCache[moduleId]\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id]\n\n if (module) {\n if (module.error) {\n throw module.error\n }\n return module\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id)\n}\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData))\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n\n moduleCache[id] = module\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories\n )\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,mCAAmC;AAEnC,IAAM,cAAmC,CAAC;AAC1C,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,aAAa;AACb,6DAA6D;AAC7D,SAAS,8BACP,SAAoB,EACpB,QAAkB;IAElB,IAAM,SAAS,WAAW,CAAC,SAAS;IACpC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,kBAAkB,UAAU,WAAW,OAAO,EAAE;AACzD;AAEA;;CAEC,GACD,sBAAsB;AACtB,aAAa;AACb,6DAA6D;AAC7D,IAAM,mCAEF,SAAC,IAAI;IACP,IAAM,SAAS,WAAW,CAAC,GAAG;IAE9B,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,kBAAkB,IAAI,WAAW,MAAM,EAAE,aAAa,EAAE;AACjE;AAEA,SAAS,kBACP,EAAY,EACZ,UAAsB,EACtB,UAAsB;IAEtB,IAAM,gBAAgB,gBAAgB,GAAG,CAAC;IAC1C,IAAI,OAAO,kBAAkB,YAAY;QACvC,sEAAsE;QACtE,0EAA0E;QAC1E,mDAAmD;QACnD,MAAM,IAAI,MAAM,2BAA2B,IAAI,YAAY;IAC7D;IAEA,IAAM,SAAiB,mBAAmB;IAC1C,IAAM,UAAU,OAAO,OAAO;IAE9B,WAAW,CAAC,GAAG,GAAG;IAElB,4EAA4E;IAC5E,IAAM,UAAU,IAAK,QACnB,QACA;IAEF,IAAI;QACF,cAAc,SAAS,QAAQ;IACjC,EAAE,OAAO,OAAO;QACd,OAAO,KAAK,GAAG;QACf,MAAM;IACR;IAEA,IAAI,OAAO,eAAe,IAAI,OAAO,OAAO,KAAK,OAAO,eAAe,EAAE;QACvE,yDAAyD;QACzD,WAAW,OAAO,OAAO,EAAE,OAAO,eAAe;IACnD;IAEA,OAAO;AACT;AAEA,6DAA6D;AAC7D,SAAS,cAAc,YAA+B;IACpD,IAAM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd;IAEJ;IAEA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C","ignoreList":[0]}}, + {"offset": {"line": 1272, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean\n loadingStarted: boolean\n resolve: () => void\n reject: (error?: Error) => void\n promise: Promise\n}\n\nlet BACKEND: RuntimeBackend\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map()\n\n;(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath)\n\n const resolver = getOrCreateResolver(chunkUrl)\n resolver.resolve()\n\n if (params == null) {\n return\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData)\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath)\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl)\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadInitialChunk(chunkPath, otherChunkData)\n )\n )\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId)\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(sourceType: SourceType, chunkUrl: ChunkUrl) {\n return doLoadChunk(sourceType, chunkUrl)\n },\n\n async loadWebAssembly(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n const { instance } = await WebAssembly.instantiateStreaming(\n req,\n importsObj\n )\n\n return instance.exports\n },\n\n async loadWebAssemblyModule(\n _sourceType: SourceType,\n _sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n _edgeModule: () => WebAssembly.Module\n ): Promise {\n const req = fetchWebAssembly(wasmChunkPath)\n\n return await WebAssembly.compileStreaming(req)\n },\n }\n\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl)\n if (!resolver) {\n let resolve: () => void\n let reject: (error?: Error) => void\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve\n reject = innerReject\n })\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true\n resolve()\n },\n reject: reject!,\n }\n chunkResolvers.set(chunkUrl, resolver)\n }\n return resolver\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(sourceType: SourceType, chunkUrl: ChunkUrl) {\n const resolver = getOrCreateResolver(chunkUrl)\n if (resolver.loadingStarted) {\n return resolver.promise\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true\n\n if (isCss(chunkUrl)) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise\n }\n\n if (typeof importScripts === 'function') {\n // We're in a web worker\n if (isCss(chunkUrl)) {\n // ignore\n } else if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl)\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl)\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`\n )\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl)\n\n if (isCss(chunkUrl)) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n )\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n } else {\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = chunkUrl\n link.onerror = () => {\n resolver.reject()\n }\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(link)\n }\n } else if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n )\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener('error', () => {\n resolver.reject()\n })\n }\n } else {\n const script = document.createElement('script')\n script.src = chunkUrl\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject()\n }\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script)\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`)\n }\n }\n\n resolver.loadingStarted = true\n return resolver.promise\n }\n\n function fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath))\n }\n})()\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU3D,IAAI;AAEJ;;CAEC,GACD,IAAM,iBAA+C,IAAI;AAExD,CAAC;IACA,UAAU;QACF,eAAN,SAAM,cAAc,SAAS,EAAE,MAAM;;oBAC7B,UAEA,UAOD,2BAAA,mBAAA,gBAAA,WAAA,OAAM,gBACH,gBACA,eAcD,4BAAA,oBAAA,iBAAA,YAAA,QAAM;;;;4BAzBP,WAAW,oBAAoB;4BAE/B,WAAW,oBAAoB;4BACrC,SAAS,OAAO;4BAEhB,IAAI,UAAU,MAAM;gCAClB;;;4BACF;4BAEK,kCAAA,2BAAA;;gCAAL,IAAK,YAAwB,OA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:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:19:21 +0100 Subject: [PATCH 24/25] update plugin --- test/e2e/swc-plugins/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/swc-plugins/index.test.ts b/test/e2e/swc-plugins/index.test.ts index 8c5c70af08ebed..338a957e57debb 100644 --- a/test/e2e/swc-plugins/index.test.ts +++ b/test/e2e/swc-plugins/index.test.ts @@ -6,7 +6,7 @@ describe('swcPlugins', () => { files: __dirname, skipDeployment: true, dependencies: { - '@swc/plugin-react-remove-properties': '7.0.2', + '@swc/plugin-react-remove-properties': '11.1.0', }, }) if (skipped) return From 87d086245af14af79616b4163ec304696836886c Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Fri, 21 Nov 2025 10:08:32 +0100 Subject: [PATCH 25/25] fewer conversions --- .../src/transforms/warn_for_edge_runtime.rs | 7 ++-- .../src/analyzer/imports.rs | 37 ++++++++++--------- .../src/references/esm/base.rs | 21 +++++++---- .../src/references/mod.rs | 6 ++- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs index 9d91a1e0bae9bc..4da0570808ef87 100644 --- a/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs +++ b/crates/next-custom-transforms/src/transforms/warn_for_edge_runtime.rs @@ -188,18 +188,19 @@ where EmitError: Fn(Span, String), { fn warn_if_nodejs_module(&self, span: Span, module_specifier: &Wtf8Atom) -> Option<()> { - let module_specifier = module_specifier.as_str()?; + let module_specifier_str = module_specifier.as_str()?; if self.guarded_runtime { return None; } // Node.js modules can be loaded with `node:` prefix or directly - if module_specifier.starts_with("node:") || NODEJS_MODULE_NAMES.contains(&module_specifier) + if module_specifier.starts_with("node:") + || NODEJS_MODULE_NAMES.contains(&module_specifier_str) { let loc = self.cm.lookup_line(span.lo).ok()?; let msg = format!( - "A Node.js module is loaded ('{module_specifier}' at line {}) which is not \ + "A Node.js module is loaded ('{module_specifier_str}' at line {}) which is not \ supported in the Edge Runtime. Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime", loc.line + 1 diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs index e098d3f1f47dbc..efd891e87a564a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs @@ -29,19 +29,19 @@ use crate::{ pub struct ImportAnnotations { // TODO store this in more structured way #[turbo_tasks(trace_ignore)] - map: BTreeMap, + map: BTreeMap, } /// Enables a specified transition for the annotated import -static ANNOTATION_TRANSITION: Lazy = +static ANNOTATION_TRANSITION: Lazy = Lazy::new(|| crate::annotations::ANNOTATION_TRANSITION.into()); /// Changes the chunking type for the annotated import -static ANNOTATION_CHUNKING_TYPE: Lazy = +static ANNOTATION_CHUNKING_TYPE: Lazy = Lazy::new(|| crate::annotations::ANNOTATION_CHUNKING_TYPE.into()); /// Changes the type of the resolved module (only "json" is supported currently) -static ATTRIBUTE_MODULE_TYPE: Lazy = Lazy::new(|| atom!("type")); +static ATTRIBUTE_MODULE_TYPE: Lazy = Lazy::new(|| atom!("type").into()); impl ImportAnnotations { pub fn parse(with: Option<&ObjectLit>) -> ImportAnnotations { @@ -64,16 +64,13 @@ impl ImportAnnotations { Some((&kv.key, str)) }) { let key = match key { - PropName::Ident(ident) => Cow::Borrowed(ident.sym.as_str()), - PropName::Str(str) => str.value.to_string_lossy(), + PropName::Ident(ident) => ident.sym.clone().into(), + PropName::Str(str) => str.value.clone(), // the rest are invalid, ignore for now till SWC ast is correct _ => continue, }; - map.insert( - key.into(), - value.value.to_string_lossy().into_owned().into(), - ); + map.insert(key, value.value.clone()); } ImportAnnotations { map } @@ -98,29 +95,33 @@ impl ImportAnnotations { continue; }; - map.insert(key.as_str().into(), value.as_str().into()); + map.insert( + key.as_atom().into_owned().into(), + value.as_atom().into_owned().into(), + ); } Some(ImportAnnotations { map }) } /// Returns the content on the transition annotation - pub fn transition(&self) -> Option<&str> { + pub fn transition(&self) -> Option> { self.get(&ANNOTATION_TRANSITION) + .map(|v| v.to_string_lossy()) } /// Returns the content on the chunking-type annotation - pub fn chunking_type(&self) -> Option<&str> { + pub fn chunking_type(&self) -> Option<&Wtf8Atom> { self.get(&ANNOTATION_CHUNKING_TYPE) } /// Returns the content on the type attribute - pub fn module_type(&self) -> Option<&str> { + pub fn module_type(&self) -> Option<&Wtf8Atom> { self.get(&ATTRIBUTE_MODULE_TYPE) } - pub fn get(&self, key: &Atom) -> Option<&str> { - self.map.get(key).map(|w| w.as_str()) + pub fn get(&self, key: &Wtf8Atom) -> Option<&Wtf8Atom> { + self.map.get(key) } } @@ -128,12 +129,12 @@ impl Display for ImportAnnotations { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let mut it = self.map.iter(); if let Some((k, v)) = it.next() { - write!(f, "{{ {k}: {v}")? + write!(f, "{{ {}: {}", k.to_string_lossy(), v.to_string_lossy())? } else { return f.write_str("{}"); }; for (k, v) in it { - write!(f, ", {k}: {v}")? + write!(f, ", {}: {}", k.to_string_lossy(), v.to_string_lossy())? } f.write_str(" }") } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs index 00c9102bf36bb9..1b106967b041eb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs @@ -391,9 +391,9 @@ impl EsmAssetReference { impl ModuleReference for EsmAssetReference { #[turbo_tasks::function] async fn resolve_reference(&self) -> Result> { - let ty = if matches!(self.annotations.module_type(), Some("json")) { + let ty = if self.annotations.module_type().is_some_and(|v| v == "json") { EcmaScriptModulesReferenceSubType::ImportWithType(ImportWithType::Json) - } else if matches!(self.annotations.module_type(), Some("bytes")) { + } else if self.annotations.module_type().is_some_and(|v| v == "bytes") { EcmaScriptModulesReferenceSubType::ImportWithType(ImportWithType::Bytes) } else if let Some(part) = &self.export_name { EcmaScriptModulesReferenceSubType::ImportPart(part.clone()) @@ -489,13 +489,18 @@ impl ChunkableModuleReference for EsmAssetReference { fn chunking_type(&self) -> Result> { Ok(Vc::cell( if let Some(chunking_type) = self.annotations.chunking_type() { - match chunking_type { - "parallel" => Some(ChunkingType::Parallel { + if chunking_type == "parallel" { + Some(ChunkingType::Parallel { inherit_async: true, hoisted: true, - }), - "none" => None, - _ => return Err(anyhow!("unknown chunking_type: {}", chunking_type)), + }) + } else if chunking_type == "none" { + None + } else { + return Err(anyhow!( + "unknown chunking_type: {}", + chunking_type.to_string_lossy() + )); } } else { Some(ChunkingType::Parallel { @@ -525,7 +530,7 @@ impl EsmAssetReference { let this = &*self.await?; // only chunked references can be imported - if this.annotations.chunking_type() != Some("none") { + if this.annotations.chunking_type().is_none_or(|v| v != "none") { let import_externals = this.import_externals; let referenced_asset = self.get_referenced_asset().await?; diff --git a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs index 9337f55ec85313..f4f8d61622d447 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs @@ -41,7 +41,7 @@ use regex::Regex; use rustc_hash::{FxHashMap, FxHashSet}; use serde::{Deserialize, Serialize}; use swc_core::{ - atoms::{Atom, atom}, + atoms::{Atom, Wtf8Atom, atom}, common::{ GLOBALS, Globals, Span, Spanned, comments::{CommentKind, Comments}, @@ -3920,11 +3920,13 @@ impl From> for AstPath { } pub static TURBOPACK_HELPER: Lazy = Lazy::new(|| atom!("__turbopack-helper__")); +pub static TURBOPACK_HELPER_WTF8: Lazy = + Lazy::new(|| atom!("__turbopack-helper__").into()); pub fn is_turbopack_helper_import(import: &ImportDecl) -> bool { let annotations = ImportAnnotations::parse(import.with.as_deref()); - annotations.get(&TURBOPACK_HELPER).is_some() + annotations.get(&TURBOPACK_HELPER_WTF8).is_some() } pub fn is_swc_helper_import(import: &ImportDecl) -> bool {