diff --git a/crates/pack-core/Cargo.toml b/crates/pack-core/Cargo.toml index 26a24d51b..b0c41bb66 100644 --- a/crates/pack-core/Cargo.toml +++ b/crates/pack-core/Cargo.toml @@ -40,6 +40,7 @@ swc_core = { workspace = true, features = [ "ecma_parser", "ecma_parser_typescript", "ecma_preset_env", + "ecma_quote", "ecma_transforms", "ecma_transforms_optimization", "ecma_transforms_react", diff --git a/crates/pack-core/js/src/library/runtime-backend-dom.ts b/crates/pack-core/js/src/library/runtime-backend-dom.ts index 47e1f4e18..0d351ffca 100644 --- a/crates/pack-core/js/src/library/runtime-backend-dom.ts +++ b/crates/pack-core/js/src/library/runtime-backend-dom.ts @@ -64,8 +64,11 @@ contextPrototype.Q = loadScript; } if (params.runtimeModuleIds.length > 0) { - for (const moduleId of params.runtimeModuleIds) { - getOrInstantiateRuntimeModule(chunk as ChunkPath, moduleId); + for (let i = 0; i < params.runtimeModuleIds.length; i++) { + getOrInstantiateRuntimeModule( + chunk as ChunkPath, + params.runtimeModuleIds[i], + ); } } }, diff --git a/crates/pack-core/src/client/context.rs b/crates/pack-core/src/client/context.rs index 2bb424bdd..bb45ed344 100644 --- a/crates/pack-core/src/client/context.rs +++ b/crates/pack-core/src/client/context.rs @@ -63,6 +63,7 @@ use crate::{ default_export_namer::get_default_export_namer_rule, emotion::get_emotion_transform_rule, jsx_dev_filename::get_jsx_dev_filename_rule, jsx_import_preserver::get_jsx_import_preserver_rule, + legacy_for_of::get_legacy_for_of_rule, remove_console::get_remove_console_transform_rule, styled_components::get_styled_components_transform_rule, styled_jsx::get_styled_jsx_transform_rule, @@ -371,6 +372,12 @@ pub async fn get_client_module_options_context( client_rules.push(get_type_only_import_rule(enable_mdx_rs.is_some())); foreign_client_rules.push(get_type_only_import_rule(enable_mdx_rs.is_some())); + if target_browsers.await?.ie.is_some() { + let legacy_for_of_rule = get_legacy_for_of_rule(enable_mdx_rs.is_some()); + client_rules.push(legacy_for_of_rule.clone()); + foreign_client_rules.push(legacy_for_of_rule); + } + // Ignore .d.ts files - they are TypeScript declaration files and should not be bundled let ignore_dts_rule = ModuleRule::new( turbopack::module_options::RuleCondition::ResourcePathEndsWith(".d.ts".to_string()), diff --git a/crates/pack-core/src/library/chunking_context.rs b/crates/pack-core/src/library/chunking_context.rs index 9da1b745c..1f415a7df 100644 --- a/crates/pack-core/src/library/chunking_context.rs +++ b/crates/pack-core/src/library/chunking_context.rs @@ -715,6 +715,10 @@ impl ChunkingContext for LibraryChunkingContext { ..Default::default() }, ); + // Use default CSS chunking to keep single-file libraries in one chunk. + if !self.shared_chunks { + return Ok(Vc::cell(map)); + } map.insert( ResolvedVc::upcast(Vc::::default().to_resolved().await?), ChunkingConfig { diff --git a/crates/pack-core/src/library/ecmascript/target.rs b/crates/pack-core/src/library/ecmascript/target.rs index 380c3001d..8237d2b03 100644 --- a/crates/pack-core/src/library/ecmascript/target.rs +++ b/crates/pack-core/src/library/ecmascript/target.rs @@ -36,6 +36,8 @@ use turbopack_core::{ }; use turbopack_ecmascript::parse::{IdentCollector, generate_js_source_map}; +use crate::shared::transforms::legacy_for_of::add_legacy_for_of_fallback; + pub(super) enum CodegenStage { Lower, EmitMinified, @@ -50,6 +52,7 @@ pub(super) async fn generate_library_code( stage: CodegenStage, ) -> Result { let versions = *environment.runtime_versions().await?; + let legacy_for_of = versions.ie.is_some(); let target = if *environment .runtime_versions() .supports_arrow_functions() @@ -121,9 +124,11 @@ pub(super) async fn generate_library_code( .into(), Assumptions::default(), )); + let has_for_of_helper = + legacy_for_of && add_legacy_for_of_fallback(&mut program, unresolved_mark); let statements_before = statement_count(&program); program.mutate(inject_helpers(unresolved_mark)); - statement_count(&program) > statements_before + has_for_of_helper || statement_count(&program) > statements_before }) } else { false diff --git a/crates/pack-core/src/shared/transforms/legacy_for_of.rs b/crates/pack-core/src/shared/transforms/legacy_for_of.rs new file mode 100644 index 000000000..066a1ed0a --- /dev/null +++ b/crates/pack-core/src/shared/transforms/legacy_for_of.rs @@ -0,0 +1,155 @@ +use anyhow::Result; +use async_trait::async_trait; +use swc_core::{ + common::{DUMMY_SP, Mark, SyntaxContext, util::take::Take}, + ecma::{ + ast::*, + transforms::base::resolver, + utils::{prepend_stmt, private_ident}, + visit::{VisitMut, VisitMutWith}, + }, + quote, +}; +use turbopack::module_options::ModuleRule; +use turbopack_ecmascript::{CustomTransformer, TransformContext}; + +use super::{EcmascriptTransformStage, get_ecma_transform_rule}; + +pub fn get_legacy_for_of_rule(enable_mdx_rs: bool) -> ModuleRule { + get_ecma_transform_rule( + Box::new(LegacyForOfTransformer), + enable_mdx_rs, + EcmascriptTransformStage::Postprocess, + ) +} + +#[derive(Debug)] +struct LegacyForOfTransformer; + +#[async_trait] +impl CustomTransformer for LegacyForOfTransformer { + async fn transform(&self, program: &mut Program, ctx: &TransformContext<'_>) -> Result<()> { + add_legacy_for_of_fallback(program, ctx.unresolved_mark); + Ok(()) + } +} + +/// SWC's strict for-of lowering assumes Symbol.iterator exists. Supply Babel-compatible +/// fallbacks while retaining SWC's iterator closing, labels and error handling unchanged. +/// Run immediately after preset-env, before emission loses the generated-node provenance. +pub(crate) fn add_legacy_for_of_fallback(program: &mut Program, unresolved_mark: Mark) -> bool { + let helper = private_ident!("__utoo_iterator__"); + let mut visitor = LegacyForOfVisitor { + helper: helper.clone(), + changed: false, + }; + program.visit_mut_with(&mut visitor); + if !visitor.changed { + return false; + } + + // Keep the real iterator first, including overrides on arrays. Only the fallback copies + // strings/Arguments/typed arrays; ordinary arrays retain their live length semantics. + let statement = quote!( + "function iterator(value) { + var method = typeof Symbol !== 'undefined' && value[Symbol.iterator] || value['@@iterator']; + if (method) return method.call(value); + if (!Array.isArray(value)) { + var name; + if (typeof value === 'string') name = 'Arguments'; + else { + name = Object.prototype.toString.call(value).slice(8, -1); + if (name === 'Object' && value.constructor) name = value.constructor.name; + } + if (name === 'Map' || name === 'Set') value = Array.from(value); + else if (name === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(name)) { + var copy = Array(value.length); + for (var i = 0; i < copy.length; i++) copy[i] = value[i]; + value = copy; + } else throw new TypeError('Invalid attempt to iterate non-iterable instance.'); + } + var index = 0; + return { next: function() { + return index >= value.length ? { done: true } : { done: false, value: value[index++] }; + } }; + }" as Stmt + ); + let mut helper_program = Program::Script(Script { + body: vec![statement], + ..Default::default() + }); + helper_program.mutate(resolver(unresolved_mark, Mark::new(), false)); + let Program::Script(mut script) = helper_program else { + unreachable!(); + }; + let mut statement = script.body.pop().unwrap(); + let Stmt::Decl(Decl::Fn(function)) = &mut statement else { + unreachable!(); + }; + function.ident = helper; + match program { + Program::Module(module) => prepend_stmt(&mut module.body, statement.into()), + Program::Script(script) => prepend_stmt(&mut script.body, statement), + } + true +} + +struct LegacyForOfVisitor { + helper: Ident, + changed: bool, +} + +impl VisitMut for LegacyForOfVisitor { + fn visit_mut_for_stmt(&mut self, statement: &mut ForStmt) { + statement.visit_mut_children_with(self); + let Some(VarDeclOrExpr::VarDecl(declaration)) = &mut statement.init else { + return; + }; + let [iterator, step] = declaration.decls.as_mut_slice() else { + return; + }; + // Source-written loops/calls have non-dummy spans. The two fresh bindings and + // generated call identify SWC's strict lowering, not arbitrary Symbol.iterator use. + if declaration.span != DUMMY_SP || iterator.span != DUMMY_SP || step.span != DUMMY_SP { + return; + } + let (Pat::Ident(iterator_ident), Pat::Ident(step_ident)) = (&iterator.name, &step.name) + else { + return; + }; + if iterator_ident.id.sym != "_iterator" + || step_ident.id.sym != "_step" + || iterator_ident.id.ctxt == SyntaxContext::empty() + || iterator_ident.id.ctxt != step_ident.id.ctxt + || step.init.is_some() + { + return; + } + let Some(box Expr::Call(call)) = &mut iterator.init else { + return; + }; + if call.span != DUMMY_SP || !call.args.is_empty() { + return; + } + let Callee::Expr(box Expr::Member(member)) = &mut call.callee else { + return; + }; + let MemberProp::Computed(property) = &member.prop else { + return; + }; + if !matches!(property.expr.as_ref(), Expr::Member(MemberExpr { + obj: box Expr::Ident(Ident { sym, .. }), + prop: MemberProp::Ident(IdentName { sym: property, .. }), + .. + }) if sym == "Symbol" && property == "iterator") + { + return; + } + call.args.push(ExprOrSpread { + spread: None, + expr: member.obj.take(), + }); + call.callee = Callee::Expr(Box::new(Expr::Ident(self.helper.clone()))); + self.changed = true; + } +} diff --git a/crates/pack-core/src/shared/transforms/mod.rs b/crates/pack-core/src/shared/transforms/mod.rs index 40e84ae3b..f11a64a74 100644 --- a/crates/pack-core/src/shared/transforms/mod.rs +++ b/crates/pack-core/src/shared/transforms/mod.rs @@ -20,6 +20,7 @@ pub mod image; pub mod inline_css; pub mod jsx_dev_filename; pub mod jsx_import_preserver; +pub mod legacy_for_of; pub mod modularize_imports; pub mod remove_console; pub mod styled_components; diff --git a/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/entries/server.5d80c3de.js b/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/entries/server.5d80c3de.js index a8ee2a340..8c669ccdd 100644 --- a/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/entries/server.5d80c3de.js +++ b/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/entries/server.5d80c3de.js @@ -44,6 +44,9 @@ const SUPPORT_COMPONENT_CHUNKS = false; * uses plain Module objects. */ let createModuleWithDirectionFlag = false; const REEXPORTED_OBJECTS = new WeakMap(); +// Legacy re-exports need the original CommonJS enumerable keys, not the +// namespace's synthetic getters for non-enumerable properties. +const LEGACY_CJS_SOURCES = typeof Proxy === 'function' ? undefined : new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. */ function Context(module, exports) { @@ -279,6 +282,10 @@ function ensureDynamicExports(module, exports) { let reexportedObjects = REEXPORTED_OBJECTS.get(module); if (!reexportedObjects) { REEXPORTED_OBJECTS.set(module, reexportedObjects = []); + if (typeof Proxy !== 'function') { + module.exports = module.namespaceObject = exports; + return reexportedObjects; + } // Returns the re-exported object that provides `prop` as an own property, // or `undefined` if none does. The traps share this logic so they always // agree on which keys are synthesized from `reexportedObjects`. `default` @@ -380,7 +387,20 @@ function ensureDynamicExports(module, exports) { exports = this.e; } const reexportedObjects = ensureDynamicExports(module, exports); - if (typeof object === 'object' && object !== null) { + if (typeof Proxy !== 'function') { + if (object !== null && (typeof object === 'object' || typeof object === 'function')) { + const source = LEGACY_CJS_SOURCES?.has(object) ? LEGACY_CJS_SOURCES.get(object) : object; + // Like webpack, snapshot export names while keeping their values live. + for(const key in source){ + if (key !== 'default' && key !== '__esModule') { + defineProp(exports, key, { + enumerable: true, + get: createGetter(source, key) + }); + } + } + } + } else if (typeof object === 'object' && object !== null) { reexportedObjects.push(object); } } @@ -426,8 +446,10 @@ function createGetter(obj, key) { */ function interopEsm(raw, ns, allowExportDefault) { const bindings = []; let defaultLocation = -1; - for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){ - for (const key of Object.getOwnPropertyNames(current)){ + for(let current = raw; (typeof current === 'object' || typeof current === 'function') && LEAF_PROTOTYPES.indexOf(current) === -1; current = getProto(current)){ + const keys = Object.getOwnPropertyNames(current); + for(let i = 0; i < keys.length; i++){ + const key = keys[i]; bindings.push(key, createGetter(raw, key)); if (defaultLocation === -1 && key === 'default') { defaultLocation = bindings.length - 1; @@ -446,6 +468,7 @@ function createGetter(obj, key) { } } esm(ns, bindings); + LEGACY_CJS_SOURCES?.set(ns, raw); return ns; } function createNS(raw) { @@ -610,7 +633,9 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, value: values[key] }); }; -relativeURL.prototype = URL.prototype; +if (typeof URL === 'function') { + relativeURL.prototype = URL.prototype; +} contextPrototype.U = relativeURL; /** * Utility function to ensure all variants of an enum are handled. diff --git a/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/stats.json b/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/stats.json index 81282c96b..8b8e071e0 100644 --- a/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/stats.json +++ b/crates/pack-tests/tests/snapshot/basic/multi_server_entries/output/server/stats.json @@ -85,7 +85,7 @@ "entry": false, "recorded": false, "id": "entries/detail-server.5d841f26.js", - "size": 39218, + "size": 40388, "hash": "", "files": [ "entries/detail-server.5d841f26.js" @@ -97,7 +97,7 @@ "entry": false, "recorded": false, "id": "entries/index-server.5c83aa4e.js", - "size": 39230, + "size": 40400, "hash": "", "files": [ "entries/index-server.5c83aa4e.js" @@ -109,7 +109,7 @@ "entry": false, "recorded": false, "id": "entries/server.5d80c3de.js", - "size": 39197, + "size": 40367, "hash": "", "files": [ "entries/server.5d80c3de.js" @@ -145,7 +145,7 @@ "type": "asset", "name": "entries/detail-server.5d841f26.js", "info": {}, - "size": 39218, + "size": 40388, "emitted": false, "comparedForEmit": false, "cached": false, @@ -157,7 +157,7 @@ "type": "asset", "name": "entries/index-server.5c83aa4e.js", "info": {}, - "size": 39230, + "size": 40400, "emitted": false, "comparedForEmit": false, "cached": false, @@ -169,7 +169,7 @@ "type": "asset", "name": "entries/server.5d80c3de.js", "info": {}, - "size": 39197, + "size": 40367, "emitted": false, "comparedForEmit": false, "cached": false, diff --git a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js index be7740c36..7a3479689 100644 --- a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js +++ b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js @@ -44,6 +44,9 @@ const SUPPORT_COMPONENT_CHUNKS = false; * uses plain Module objects. */ let createModuleWithDirectionFlag = false; const REEXPORTED_OBJECTS = new WeakMap(); +// Legacy re-exports need the original CommonJS enumerable keys, not the +// namespace's synthetic getters for non-enumerable properties. +const LEGACY_CJS_SOURCES = typeof Proxy === 'function' ? undefined : new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. */ function Context(module, exports) { @@ -279,6 +282,10 @@ function ensureDynamicExports(module, exports) { let reexportedObjects = REEXPORTED_OBJECTS.get(module); if (!reexportedObjects) { REEXPORTED_OBJECTS.set(module, reexportedObjects = []); + if (typeof Proxy !== 'function') { + module.exports = module.namespaceObject = exports; + return reexportedObjects; + } // Returns the re-exported object that provides `prop` as an own property, // or `undefined` if none does. The traps share this logic so they always // agree on which keys are synthesized from `reexportedObjects`. `default` @@ -380,7 +387,20 @@ function ensureDynamicExports(module, exports) { exports = this.e; } const reexportedObjects = ensureDynamicExports(module, exports); - if (typeof object === 'object' && object !== null) { + if (typeof Proxy !== 'function') { + if (object !== null && (typeof object === 'object' || typeof object === 'function')) { + const source = LEGACY_CJS_SOURCES?.has(object) ? LEGACY_CJS_SOURCES.get(object) : object; + // Like webpack, snapshot export names while keeping their values live. + for(const key in source){ + if (key !== 'default' && key !== '__esModule') { + defineProp(exports, key, { + enumerable: true, + get: createGetter(source, key) + }); + } + } + } + } else if (typeof object === 'object' && object !== null) { reexportedObjects.push(object); } } @@ -426,8 +446,10 @@ function createGetter(obj, key) { */ function interopEsm(raw, ns, allowExportDefault) { const bindings = []; let defaultLocation = -1; - for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){ - for (const key of Object.getOwnPropertyNames(current)){ + for(let current = raw; (typeof current === 'object' || typeof current === 'function') && LEAF_PROTOTYPES.indexOf(current) === -1; current = getProto(current)){ + const keys = Object.getOwnPropertyNames(current); + for(let i = 0; i < keys.length; i++){ + const key = keys[i]; bindings.push(key, createGetter(raw, key)); if (defaultLocation === -1 && key === 'default') { defaultLocation = bindings.length - 1; @@ -446,6 +468,7 @@ function createGetter(obj, key) { } } esm(ns, bindings); + LEGACY_CJS_SOURCES?.set(ns, raw); return ns; } function createNS(raw) { @@ -610,7 +633,9 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, value: values[key] }); }; -relativeURL.prototype = URL.prototype; +if (typeof URL === 'function') { + relativeURL.prototype = URL.prototype; +} contextPrototype.U = relativeURL; /** * Utility function to ensure all variants of an enum are handled. diff --git a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js.map b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js.map index dd15ef45c..163096b42 100644 --- a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js.map +++ b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/entries/server.6de379ea.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 12, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/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/// \n\ntype EsmNamespaceObject = Record\n\n/**\n * Describes why a module was instantiated.\n * Shared between browser and Node.js runtimes.\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\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\n/**\n * Flag indicating which module object type to create when a module is merged. Set to `true`\n * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,\n * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it\n * uses plain Module objects.\n */\nlet createModuleWithDirectionFlag = false\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: string): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: string): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: string): 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.get(id)\n if (module === undefined) {\n if (createModuleWithDirectionFlag) {\n // set in development modes for hmr support\n module = createModuleWithDirection(id)\n } else {\n module = createModuleObject(id)\n }\n moduleCache.set(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\nfunction createModuleWithDirection(id: ModuleId): ModuleWithDirection {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n parents: [],\n children: [],\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 * Terminates a module's group of entries in an {@link EsmReexports} list.\n */\nconst REEXPORT_GROUP_END = 0\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings, dynamic?: boolean) {\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 // The properties defined above are already non-configurable and\n // non-writable, so the namespace's existing exports are effectively\n // immutable. Sealing additionally makes the object non-extensible, matching\n // real ESM-namespace semantics. Modules with dynamic re-exports\n // (`export *` from a CommonJS module) must stay extensible so the dynamic\n // export proxy can surface keys discovered at runtime, so skip the seal for\n // them.\n if (!dynamic) 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 dynamic?: boolean\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, dynamic)\n}\ncontextPrototype.s = esmExport\n\n/**\n * Registers re-exports that all forward to properties of other modules.\n *\n * This is a compact spelling of the pattern\n *\n * ```js\n * var ns = context.i(moduleId)\n * context.s([exportName, () => ns[importedName], ...])\n * ```\n *\n * The list is a flat sequence of groups. Each group starts with the source the exports come from,\n * followed by that group's entries, and is terminated by the `0` sentinel (or the end of the list).\n *\n * The group head is either a **module id**, which is instantiated here:\n *\n * ```js\n * context.S([\n * 76061, 'default', 'f', 'named', 'A', 0,\n * 29842, 'otherModule', 'f',\n * ])\n * ```\n *\n * or the **namespace value** of a module that has already been imported, which is used directly:\n *\n * ```js\n * var ns1 = context.i(76061)\n * context.S([ns1, 'default', 'f', 'named', 'A'])\n * ```\n *\n * The producer picks the namespace form when it has generated the import anyway -- because some\n * later import must not be reordered past it -- so nothing is instantiated twice. The two are told\n * apart by type: a module id is always a string or number. A CommonJS function export produces a\n * callable namespace value, so namespace heads can be functions as well as objects.\n *\n * Entries are `exportName, importedName` pairs, except when a group holds exactly one string. That\n * string is then a comma-joined list of the same pairs, which saves the repeated quoting:\n *\n * ```js\n * context.S([\n * 76061, 'default,f,named,A', 0,\n * 29842, 'otherModule,f',\n * ])\n * ```\n *\n * The producer picks that spelling independently for each group whose names contain no commas,\n * since that group's names are recovered by splitting on them.\n *\n * Groups whose head is a module id are instantiated in list order, at the point where the call\n * appears, so the producer must not merge such a group across an import of another module. The\n * destination reuses a source data value or getter descriptor when one exists, falling back to a\n * wrapper getter for dynamic/proxy/inherited properties.\n *\n * `id` names the module the exports belong to when this module was merged into a scope-hoisting\n * group, exactly as it does for {@link EsmExport}.\n *\n * Only the source descriptor's payload (value or getter) is reused. {@link esm} still defines a\n * fresh enumerable, non-configurable destination property, and no source setter is ever forwarded.\n */\nfunction esmReexport(\n this: TurbopackBaseContext,\n list: EsmReexports,\n id?: ModuleId\n): void {\n const bindings: EsmBindings = []\n let i = 0\n while (i < list.length) {\n const head = list[i++]\n const start = i\n while (i < list.length && list[i] !== REEXPORT_GROUP_END) i++\n const end = i\n // Skip the sentinel, if this group was terminated by one rather than by the end of the list.\n i++\n\n // Module ids are always strings or numbers. Other values are already-imported namespaces;\n // notably, interop with a CommonJS function export produces a callable namespace function.\n // `esmImport` may return a promise for an async module, but re-exports of async modules keep\n // going through `context.s`, so the producer never routes them here and this stays synchronous.\n const namespace = (\n typeof head === 'string' || typeof head === 'number'\n ? esmImport.call(this, head)\n : head\n ) as Record\n if (end - start === 1) {\n const pairs = (list[start] as string).split(',')\n for (let j = 0; j < pairs.length; j += 2) {\n appendReexportBinding(bindings, pairs[j], namespace, pairs[j + 1])\n }\n } else {\n for (let j = start; j < end; j += 2) {\n appendReexportBinding(\n bindings,\n list[j] as string,\n namespace,\n list[j + 1] as string\n )\n }\n }\n }\n esmExport.call(this, bindings, id)\n}\ncontextPrototype.S = esmReexport\n\nfunction appendReexportBinding(\n bindings: EsmBindings,\n exportedName: string,\n namespace: Record,\n importedName: string\n): void {\n const descriptor = Reflect.getOwnPropertyDescriptor(namespace, importedName)\n if (descriptor) {\n if ('value' in descriptor) {\n // Code generation only routes immutable imported bindings through this helper, so a data\n // descriptor is a constant export and can be captured once.\n bindings.push(exportedName, BindingTag_Value, descriptor.value)\n return\n }\n if (descriptor.get) {\n // Accessors remain live by reusing the source getter. `esmReexport` is only called by\n // generated code: every group head is either produced by\n // `this.i` or is the namespace variable from a generated `this.i` call. Every getter on such\n // a namespace is receiver-independent: ESM bindings are compiler-generated arrow functions,\n // and the CommonJS/dynamic-namespace paths create arrows in `createGetter` and\n // `getOwnPropertyDescriptor`. The destination can therefore reuse the exact function instead\n // of allocating another wrapper getter.\n bindings.push(exportedName, descriptor.get)\n return\n }\n }\n\n // Dynamic/proxy/inherited CommonJS edge cases may not expose a usable own descriptor.\n bindings.push(exportedName, () => namespace[importedName])\n}\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 // Returns the re-exported object that provides `prop` as an own property,\n // or `undefined` if none does. The traps share this logic so they always\n // agree on which keys are synthesized from `reexportedObjects`. `default`\n // is never re-exported by `export *`, so it is never synthesized.\n const reexportOwning = (prop: PropertyKey) => {\n if (prop !== 'default') {\n for (const obj of reexportedObjects!) {\n if (hasOwnProperty.call(obj, prop)) return obj\n }\n }\n return undefined\n }\n // Modules with dynamic re-exports are not sealed by `esm()`, so the\n // target beneath the namespace stays extensible. That is what lets the\n // `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that\n // exist on `reexportedObjects` but not on the target itself.\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 const obj = reexportOwning(prop)\n return obj && Reflect.get(obj, prop)\n },\n // The namespace is read-only, like a real esm namespace object. The\n // re-exported modules can still mutate their own exports (exposed live\n // via `get`), but mutating the namespace itself is rejected. Refusing\n // here, rather than forwarding to the extensible target, also prevents an\n // assignment/definition from shadowing a dynamic re-export. It also\n // prevents delete from removing a static export.\n set() {\n return false\n },\n defineProperty() {\n return false\n },\n deleteProperty() {\n return false\n },\n // The `has` trap ensures that `'exportName' in starImports` will reflect\n // the truth of whether a key is exported.\n has(target, prop) {\n if (Reflect.has(target, prop)) return true\n if (prop === 'default' || prop === '__esModule') return false\n return reexportOwning(prop) !== undefined\n },\n // ownKeys and getOwnPropertyDescriptor together make the keys enumerable.\n // If a value is returned from `ownKeys` but its property descriptor is\n // not enumerable, it will not be visible to iterator methods.\n // Collectively, they allow code like the following:\n //\n // ```\n // // module.js re-exports dynamic CJS exports\n // export * from './legacyModule.cjs'\n //\n // // from another JS file, reference the re-exported dynamic values\n // import * as Namespace from './module.js'\n // Object.keys(Namespace)\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 getOwnPropertyDescriptor(target, prop) {\n const own = Reflect.getOwnPropertyDescriptor(target, prop)\n if (own || prop === 'default' || prop === '__esModule') return own\n const obj = reexportOwning(prop)\n if (obj) {\n // Synthetic keys don't exist on the target, so they MUST be\n // reported as configurable. However the set/delete traps above will\n // prevent them from actually being changed\n return {\n enumerable: true,\n configurable: true,\n get: () => Reflect.get(obj, prop),\n }\n }\n return undefined\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 * Remove fragments and query parameters since they are never part of the context map keys\n *\n * This matches how we parse patterns at resolving time. Arguably we should only do this for\n * strings passed to `import` but the resolve does it for `import` and `require` and so we do\n * here as well.\n */\nfunction parseRequest(request: string): string {\n // Per the URI spec fragments can contain `?` characters, so we should trim it off first\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\n const hashIndex = request.indexOf('#')\n if (hashIndex !== -1) {\n request = request.substring(0, hashIndex)\n }\n\n const queryIndex = request.indexOf('?')\n if (queryIndex !== -1) {\n request = request.substring(0, queryIndex)\n }\n\n return request\n}\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: string): Exports {\n id = parseRequest(id)\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 = (): string[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: string): ModuleId => {\n id = parseRequest(id)\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: string) => {\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\n// Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.\n// The flat format alternates one or more module IDs with their factory function.\n// Strict factories can be prepended as a nested array.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n const strictFactories = chunkModules[i]\n if (Array.isArray(strictFactories)) {\n installCompressedModuleFactories(\n strictFactories,\n 0,\n moduleFactories,\n newModuleId\n )\n i++\n }\n while (i < chunkModules.length) {\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\n // Install the factory for each module ID that doesn't already have one.\n // When some IDs in this group already have a factory, reuse that existing\n // group factory for the missing IDs to keep all IDs in the group consistent.\n // Otherwise, install the factory from this chunk.\n const moduleFactoryFn = chunkModules[end] as Function\n let existingGroupFactory: Function | undefined = undefined\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n const existingFactory = moduleFactories.get(id)\n if (existingFactory) {\n existingGroupFactory = existingFactory\n break\n }\n }\n const factoryToInstall = existingGroupFactory ?? moduleFactoryFn\n\n let didInstallFactory = false\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n if (!moduleFactories.has(id)) {\n if (!didInstallFactory) {\n if (factoryToInstall === moduleFactoryFn) {\n applyModuleFactoryName(moduleFactoryFn)\n }\n didInstallFactory = true\n }\n moduleFactories.set(id, factoryToInstall)\n newModuleId?.(id)\n }\n }\n i = end + 1\n }\n}\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 * Constructs an error message for when a module factory is not available.\n */\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\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 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\n/**\n * Returns a `file://` URL under a synthetic directory named after `root`\n * (`ROOT` for the project root), for when the real filesystem path is unknown.\n * The root name and path segments are percent-encoded so the result is always\n * a valid file URI.\n */\nfunction placeholderFileUrl(modulePath: string, root?: string): string {\n return `file:///${encodeURIComponent(root ?? 'ROOT')}/${modulePath\n .split('/')\n .map(encodeURIComponent)\n .join('/')}`\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\n// Each runtime keeps its own public path. Other applications on the page may\n// change the global path after this runtime has started.\nlet runtimePublicPath: unknown =\n typeof globalThis !== 'undefined'\n ? (globalThis as any).publicPath\n : undefined\nObject.defineProperty(contextPrototype, 'runtimePublicPath', {\n get: () => runtimePublicPath,\n set: (value: unknown) => {\n runtimePublicPath = value\n },\n})\n\nlet cachedAutomaticPublicPath: string | undefined\n\nfunction getAutomaticPublicPath(): string {\n if (cachedAutomaticPublicPath !== undefined) {\n return cachedAutomaticPublicPath\n }\n\n let scriptUrl: string | undefined\n if (typeof document === 'object') {\n const currentScript = document.currentScript as HTMLScriptElement | null\n scriptUrl = currentScript?.src\n\n if (!scriptUrl) {\n const scripts = document.getElementsByTagName('script')\n const script = scripts[scripts.length - 1]\n scriptUrl = script?.src\n }\n }\n\n if (\n !scriptUrl &&\n typeof (globalThis as any).importScripts === 'function' &&\n (globalThis as any).location\n ) {\n scriptUrl = String((globalThis as any).location)\n }\n\n cachedAutomaticPublicPath = scriptUrl\n ? scriptUrl\n .replace(/^blob:/, '')\n .replace(/#.*$/, '')\n .replace(/\\?.*$/, '')\n .replace(/\\/[^/]*$/, '/')\n : ''\n\n return cachedAutomaticPublicPath\n}\n\n/**\n * Gets the public path for runtime assets.\n * Uses this runtime's public path and falls back to \"/\".\n */\nfunction getPublicPath(mode?: 'auto'): string {\n if (mode === 'auto') {\n return getAutomaticPublicPath()\n }\n\n if (typeof runtimePublicPath === 'string') {\n const publicPath = runtimePublicPath\n return publicPath.endsWith('/') ? publicPath : `${publicPath}/`\n }\n return '/'\n}\ncontextPrototype.p = getPublicPath\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":["SourceType","createModuleWithDirectionFlag","REEXPORTED_OBJECTS","WeakMap","Context","module","exports","m","e","contextPrototype","prototype","hasOwnProperty","Object","toStringTag","Symbol","defineProp","obj","name","options","call","defineProperty","getOverwrittenModule","moduleCache","id","get","undefined","createModuleWithDirection","createModuleObject","set","error","namespaceObject","parents","children","BindingTag_Value","REEXPORT_GROUP_END","esm","bindings","dynamic","value","i","length","propName","tagOrFunction","enumerable","writable","Error","getterFn","setterFn","seal","esmExport","c","s","esmReexport","list","head","start","end","namespace","esmImport","pairs","split","j","appendReexportBinding","S","exportedName","importedName","descriptor","Reflect","getOwnPropertyDescriptor","push","ensureDynamicExports","reexportedObjects","reexportOwning","prop","Proxy","target","deleteProperty","has","ownKeys","keys","key","includes","own","configurable","dynamicExport","object","exportValue","v","exportNamespace","n","createGetter","getProto","getPrototypeOf","__proto__","LEAF_PROTOTYPES","interopEsm","raw","ns","allowExportDefault","defaultLocation","current","getOwnPropertyNames","splice","createNS","args","apply","create","getOrInstantiateModuleFromParent","__esModule","asyncLoader","moduleId","loader","r","bind","A","runtimeRequire","require","require1","t","commonJsRequire","parseRequest","request","hashIndex","indexOf","substring","queryIndex","moduleContext","map","code","resolve","import","f","getChunkPath","chunkData","path","installCompressedModuleFactories","chunkModules","offset","moduleFactories","newModuleId","strictFactories","Array","isArray","moduleFactoryFn","existingGroupFactory","existingFactory","factoryToInstall","didInstallFactory","applyModuleFactoryName","relativeURL","inputUrl","realUrl","URL","values","href","pathname","replace","origin","protocol","toString","toJSON","_args","U","invariant","never","computeMessage","factoryNotAvailableMessage","sourceType","sourceData","instantiationReason","placeholderFileUrl","modulePath","root","encodeURIComponent","join","requireStub","_moduleId","z","g","globalThis","runtimePublicPath","publicPath","cachedAutomaticPublicPath","getAutomaticPublicPath","scriptUrl","document","currentScript","src","scripts","getElementsByTagName","script","importScripts","location","String","getPublicPath","mode","endsWith","p","factory"],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,0CAA0C;AAI1C;;;CAGC,GACD,IAAA,AAAK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9I;IACtB;AACF;AAEA,IAAIgJ;AAEJ,SAASC;IACP,IAAID,8BAA8B7J,WAAW;QAC3C,OAAO6J;IACT;IAEA,IAAIE;IACJ,IAAI,OAAOC,aAAa,UAAU;QAChC,MAAMC,gBAAgBD,SAASC,aAAa;QAC5CF,YAAYE,eAAeC;QAE3B,IAAI,CAACH,WAAW;YACd,MAAMI,UAAUH,SAASI,oBAAoB,CAAC;YAC9C,MAAMC,SAASF,OAAO,CAACA,QAAQpJ,MAAM,GAAG,EAAE;YAC1CgJ,YAAYM,QAAQH;QACtB;IACF;IAEA,IACE,CAACH,aACD,OAAO,AAACL,WAAmBY,aAAa,KAAK,cAC7C,AAACZ,WAAmBa,QAAQ,EAC5B;QACAR,YAAYS,OAAO,AAACd,WAAmBa,QAAQ;IACjD;IAEAV,4BAA4BE,YACxBA,UACG5B,OAAO,CAAC,UAAU,IAClBA,OAAO,CAAC,QAAQ,IAChBA,OAAO,CAAC,SAAS,IACjBA,OAAO,CAAC,YAAY,OACvB;IAEJ,OAAO0B;AACT;AAEA;;;CAGC,GACD,SAASY,cAAcC,IAAa;IAClC,IAAIA,SAAS,QAAQ;QACnB,OAAOZ;IACT;IAEA,IAAI,OAAOH,sBAAsB,UAAU;QACzC,MAAMC,aAAaD;QACnB,OAAOC,WAAWe,QAAQ,CAAC,OAAOf,aAAa,GAAGA,WAAW,CAAC,CAAC;IACjE;IACA,OAAO;AACT;AACA5K,iBAAiB4L,CAAC,GAAGH;AAMrB,SAAS9C,uBAAuBkD,OAAiB;IAC/C,+DAA+D;IAC/D1L,OAAOQ,cAAc,CAACkL,SAAS,QAAQ;QACrChK,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 704, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/library/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack UMD library runtimes (DOM and Node.js).\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// Provided by build\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n): Module;\n\ntype RuntimeParams = {\n runtimeModuleIds: ModuleId[];\n};\n\n// Used by upstream build-base.ts for chunk registration\ntype ChunkRegistrationChunk =\n | ChunkPath\n | { getAttribute: (name: string) => string | null }\n | undefined;\n\ntype ChunkRegistration = [\n chunkPath: ChunkRegistrationChunk,\n ...([RuntimeParams] | CompressedModuleFactories),\n];\n\n// SourceType and SourceData are provided by shared/runtime/runtime-utils.ts\ninterface RuntimeBackend {\n registerChunk: (\n chunkPath: ChunkPath | ChunkScript,\n params?: RuntimeParams,\n ) => void;\n}\n\nlet BACKEND: RuntimeBackend;\n\nconst moduleFactories: ModuleFactories = new Map();\ncontextPrototype.M = moduleFactories;\n\n/**\n * Determine the chunk to register from a registration entry.\n * In library builds, chunks are always string paths or script objects.\n */\nfunction getChunkFromRegistration(\n chunk: ChunkRegistrationChunk,\n): ChunkPath | ChunkScript {\n if (typeof chunk === \"string\") {\n return chunk;\n } else if (chunk) {\n return { src: chunk.getAttribute(\"src\")! } as unknown as ChunkScript;\n } else {\n throw new Error(\"chunk path is empty\");\n }\n}\n\n/**\n * Load CommonJS externals when a UMD bundle runs in a CommonJS environment.\n * Browser-targeted UMD bundles need this too because their wrapper supports\n * both global and CommonJS consumers.\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 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\n/**\n * Adds Webpack-compatible ESM metadata to external values while preserving\n * native ESM live bindings.\n */\nfunction externalNamespace(mod: any) {\n if (mod && mod.__esModule) return mod;\n\n const ns = Object.create(null);\n const isEsmNamespace = mod && toStringTag && mod[toStringTag] === \"Module\";\n\n if (mod && (typeof mod === \"object\" || typeof mod === \"function\")) {\n for (const key in mod) {\n if (key === \"__esModule\" || (!isEsmNamespace && key === \"default\")) {\n continue;\n }\n\n Object.defineProperty(ns, key, {\n enumerable: true,\n get: createGetter(mod, key),\n });\n }\n }\n\n if (!isEsmNamespace) {\n Object.defineProperty(ns, \"default\", { enumerable: true, value: mod });\n }\n Object.defineProperty(ns, \"__esModule\", { value: true });\n if (toStringTag) {\n Object.defineProperty(ns, toStringTag, { value: \"Module\" });\n }\n\n return ns;\n}\ncontextPrototype.N = externalNamespace;\n"],"names":["BACKEND","moduleFactories","Map","contextPrototype","M","getChunkFromRegistration","chunk","src","getAttribute","Error","externalRequire","id","thunk","esm","raw","err","__esModule","interopEsm","createNS","resolve","options","require","x","externalNamespace","mod","ns","Object","create","isEsmNamespace","toStringTag","key","defineProperty","enumerable","get","createGetter","value","N"],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,oIAAoI;AACpI,sIAAsI;AAEtI,oBAAoB;AA8BpB,IAAIA;AAEJ,MAAMC,kBAAmC,IAAIC;AAC7CC,iBAAiBC,CAAC,GAAGH;AAErB;;;CAGC,GACD,SAASI,yBACPC,KAA6B;IAE7B,IAAI,OAAOA,UAAU,UAAU;QAC7B,OAAOA;IACT,OAAO,IAAIA,OAAO;QAChB,OAAO;YAAEC,KAAKD,MAAME,YAAY,CAAC;QAAQ;IAC3C,OAAO;QACL,MAAM,IAAIC,MAAM;IAClB;AACF;AAEA;;;;CAIC,GACD,SAASC,gBACPC,EAAY,EACZC,KAAgB,EAChBC,MAAe,KAAK;IAEpB,IAAIC;IACJ,IAAI;QACFA,MAAMF;IACR,EAAE,OAAOG,KAAK;QACZ,MAAM,IAAIN,MAAM,CAAC,+BAA+B,EAAEE,GAAG,EAAE,EAAEI,KAAK;IAChE;IAEA,IAAI,CAACF,OAAOC,IAAIE,UAAU,EAAE;QAC1B,OAAOF;IACT;IAEA,OAAOG,WAAWH,KAAKI,SAASJ,MAAM;AACxC;AAEAJ,gBAAgBS,OAAO,GAAG,CACxBR,IACAS;IAIA,OAAOC,QAAQF,OAAO,CAACR,IAAIS;AAC7B;AACAjB,iBAAiBmB,CAAC,GAAGZ;AAErB;;;CAGC,GACD,SAASa,kBAAkBC,GAAQ;IACjC,IAAIA,OAAOA,IAAIR,UAAU,EAAE,OAAOQ;IAElC,MAAMC,KAAKC,OAAOC,MAAM,CAAC;IACzB,MAAMC,iBAAiBJ,OAAOK,eAAeL,GAAG,CAACK,YAAY,KAAK;IAElE,IAAIL,OAAO,CAAC,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU,GAAG;QACjE,IAAK,MAAMM,OAAON,IAAK;YACrB,IAAIM,QAAQ,gBAAiB,CAACF,kBAAkBE,QAAQ,WAAY;gBAClE;YACF;YAEAJ,OAAOK,cAAc,CAACN,IAAIK,KAAK;gBAC7BE,YAAY;gBACZC,KAAKC,aAAaV,KAAKM;YACzB;QACF;IACF;IAEA,IAAI,CAACF,gBAAgB;QACnBF,OAAOK,cAAc,CAACN,IAAI,WAAW;YAAEO,YAAY;YAAMG,OAAOX;QAAI;IACtE;IACAE,OAAOK,cAAc,CAACN,IAAI,cAAc;QAAEU,OAAO;IAAK;IACtD,IAAIN,aAAa;QACfH,OAAOK,cAAc,CAACN,IAAII,aAAa;YAAEM,OAAO;QAAS;IAC3D;IAEA,OAAOV;AACT;AACAtB,iBAAiBiC,CAAC,GAAGb"}}, - {"offset": {"line": 785, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = new Map()\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 | undefined,\n moduleId: ModuleId\n): Module {\n const module = moduleCache.get(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.get(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.set(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 | RuntimeParams) {\n // An inlined entry-only registration is a bare params object (no source chunk).\n if (!Array.isArray(registration)) {\n return BACKEND.registerChunk(undefined, registration)\n }\n const chunk = getChunkFromRegistration(registration[0]) as\n | ChunkScript\n | ChunkPath\n if (SUPPORT_COMPONENT_CHUNKS) {\n markChunkComponentsAvailable(chunk)\n }\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(chunk, runtimeParams)\n}\n"],"names":["moduleCache","Map","contextPrototype","c","getOrInstantiateRuntimeModule","chunkPath","moduleId","module","get","error","instantiateModule","SourceType","Runtime","getOrInstantiateModuleFromParent","id","sourceModule","Parent","sourceType","sourceData","moduleFactory","moduleFactories","Error","factoryNotAvailableMessage","createModuleObject","exports","set","context","Context","namespaceObject","interopEsm","registerChunk","registration","Array","isArray","BACKEND","undefined","chunk","getChunkFromRegistration","SUPPORT_COMPONENT_CHUNKS","markChunkComponentsAvailable","runtimeParams","length","installCompressedModuleFactories"],"mappings":"AAAA,0CAA0C;AAC1C,mCAAmC;AAEnC,MAAMA,cAAmC,IAAIC;AAC7CC,iBAAiBC,CAAC,GAAGH;AAErB;;CAEC,GACD,aAAa;AACb,6DAA6D;AAC7D,SAASI,8BACPC,SAAgC,EAChCC,QAAkB;IAElB,MAAMC,SAASP,YAAYQ,GAAG,CAACF;IAC/B,IAAIC,QAAQ;QACV,IAAIA,OAAOE,KAAK,EAAE;YAChB,MAAMF,OAAOE,KAAK;QACpB;QACA,OAAOF;IACT;IAEA,OAAOG,kBAAkBJ,UAAUK,WAAWC,OAAO,EAAEP;AACzD;AAEA;;CAEC,GACD,sBAAsB;AACtB,aAAa;AACb,6DAA6D;AAC7D,MAAMQ,mCAEF,CAACC,IAAIC;IACP,MAAMR,SAASP,YAAYQ,GAAG,CAACM;IAE/B,IAAIP,QAAQ;QACV,IAAIA,OAAOE,KAAK,EAAE;YAChB,MAAMF,OAAOE,KAAK;QACpB;QACA,OAAOF;IACT;IAEA,OAAOG,kBAAkBI,IAAIH,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": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/library/runtime-backend-node.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack\n * ECMAScript Node.js runtime for library builds.\n *\n * It will be appended to the base runtime code in place of\n * runtime-backend-dom.ts when the target platform is Node.js.\n *\n * Server library entry chunks can reference shared chunks. Those chunks are\n * CommonJS modules exporting compressed module factories, so the backend can\n * load them synchronously before instantiating runtime entries.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/**\n * Resolve source modules relative to the library bundle's directory.\n */\nfunction resolveFileUrl(modulePath?: string, root?: string): string {\n // ImportMetaBinding escapes percent signs and control characters before codegen.\n const decodedPath = decodeURIComponent(modulePath ?? \"\");\n if (root !== undefined) return placeholderFileUrl(decodedPath, root);\n const absolutePath = require(\"path\").resolve(\n __dirname,\n RELATIVE_ROOT_PATH,\n decodedPath,\n );\n return require(\"url\").pathToFileURL(absolutePath).href;\n}\ncontextPrototype.F = resolveFileUrl;\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\n/**\n * Exports a URL value. No suffix is added in Node.js runtime.\n */\nfunction exportUrl(\n this: TurbopackBaseContext,\n url: string,\n id: ModuleId | undefined,\n) {\n exportValue.call(this, url, id);\n}\ncontextPrototype.q = exportUrl;\n\n(() => {\n BACKEND = {\n registerChunk(chunk, params) {\n const chunkPath =\n typeof chunk === \"string\"\n ? chunk\n : (chunk.src! as unknown as ChunkPath);\n\n if (params == null) {\n return;\n }\n\n const otherChunks = (\n params as RuntimeParams & { otherChunks: ChunkData[] }\n ).otherChunks;\n const nodePath = require(\"path\");\n for (const otherChunk of otherChunks) {\n const otherChunkPath = getChunkPath(otherChunk);\n if (!/\\.(?:c|m)?js(?:\\?|$)/.test(otherChunkPath)) {\n continue;\n }\n const relativeChunkPath = nodePath.relative(\n nodePath.dirname(chunkPath),\n otherChunkPath,\n );\n const chunkModules: CompressedModuleFactories = require(\n nodePath.resolve(__dirname, relativeChunkPath),\n );\n installCompressedModuleFactories(chunkModules, 0, moduleFactories);\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"],"names":["resolveFileUrl","modulePath","root","decodedPath","decodeURIComponent","undefined","placeholderFileUrl","absolutePath","require","resolve","__dirname","RELATIVE_ROOT_PATH","pathToFileURL","href","contextPrototype","F","externalImport","id","raw","err","Error","__esModule","default","interopEsm","createNS","y","exportUrl","url","exportValue","call","q","BACKEND","registerChunk","chunk","params","chunkPath","src","otherChunks","nodePath","otherChunk","otherChunkPath","getChunkPath","test","relativeChunkPath","relative","dirname","chunkModules","installCompressedModuleFactories","moduleFactories","runtimeModuleIds","length","moduleId","getOrInstantiateRuntimeModule"],"mappings":"AAAA;;;;;;;;;;CAUC,GAED,oDAAoD,GAEpD,0CAA0C;AAE1C;;CAEC,GACD,SAASA,eAAeC,UAAmB,EAAEC,IAAa;IACxD,iFAAiF;IACjF,MAAMC,cAAcC,mBAAmBH,cAAc;IACrD,IAAIC,SAASG,WAAW,OAAOC,mBAAmBH,aAAaD;IAC/D,MAAMK,eAAeC,QAAQ,QAAQC,OAAO,CAC1CC,WACAC,oBACAR;IAEF,OAAOK,QAAQ,OAAOI,aAAa,CAACL,cAAcM,IAAI;AACxD;AACAC,iBAAiBC,CAAC,GAAGf;AAErB,eAAegB,eAAeC,EAAuB;IACnD,IAAIC;IACJ,IAAI;QACFA,MAAM,MAAM,MAAM,CAACD;IACrB,EAAE,OAAOE,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAIC,MAAM,CAAC,+BAA+B,EAAEH,GAAG,EAAE,EAAEE,KAAK;IAChE;IAEA,IAAID,OAAOA,IAAIG,UAAU,IAAIH,IAAII,OAAO,IAAI,aAAaJ,IAAII,OAAO,EAAE;QACpE,OAAOC,WAAWL,IAAII,OAAO,EAAEE,SAASN,MAAM;IAChD;IAEA,OAAOA;AACT;AACAJ,iBAAiBW,CAAC,GAAGT;AAErB;;CAEC,GACD,SAASU,UAEPC,GAAW,EACXV,EAAwB;IAExBW,YAAYC,IAAI,CAAC,IAAI,EAAEF,KAAKV;AAC9B;AACAH,iBAAiBgB,CAAC,GAAGJ;AAErB,CAAC;IACCK,UAAU;QACRC,eAAcC,KAAK,EAAEC,MAAM;YACzB,MAAMC,YACJ,OAAOF,UAAU,WACbA,QACCA,MAAMG,GAAG;YAEhB,IAAIF,UAAU,MAAM;gBAClB;YACF;YAEA,MAAMG,cAAc,AAClBH,OACAG,WAAW;YACb,MAAMC,WAAW9B,QAAQ;YACzB,KAAK,MAAM+B,cAAcF,YAAa;gBACpC,MAAMG,iBAAiBC,aAAaF;gBACpC,IAAI,CAAC,uBAAuBG,IAAI,CAACF,iBAAiB;oBAChD;gBACF;gBACA,MAAMG,oBAAoBL,SAASM,QAAQ,CACzCN,SAASO,OAAO,CAACV,YACjBK;gBAEF,MAAMM,eAA0CtC,QAC9C8B,SAAS7B,OAAO,CAACC,WAAWiC;gBAE9BI,iCAAiCD,cAAc,GAAGE;YACpD;YAEA,IAAId,OAAOe,gBAAgB,CAACC,MAAM,GAAG,GAAG;gBACtC,KAAK,MAAMC,YAAYjB,OAAOe,gBAAgB,CAAE;oBAC9CG,8BAA8BjB,WAAWgB;gBAC3C;YACF;QACF;IACF;AACF,CAAC"}}, - {"offset": {"line": 968, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/basic/multi_server_entries_sourcemap/input/server.ts"],"sourcesContent":["import { shared } from \"./shared\";\n\nconsole.log(\"server runtime\", shared);\n"],"names":["console","log"],"mappings":";AAAA;;AAEAA,QAAQC,GAAG,CAAC,kBAAkB,gKAAM"}}] + {"offset": {"line": 12, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/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/// \n\ntype EsmNamespaceObject = Record\n\n/**\n * Describes why a module was instantiated.\n * Shared between browser and Node.js runtimes.\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\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\n/**\n * Flag indicating which module object type to create when a module is merged. Set to `true`\n * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,\n * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it\n * uses plain Module objects.\n */\nlet createModuleWithDirectionFlag = false\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n// Legacy re-exports need the original CommonJS enumerable keys, not the\n// namespace's synthetic getters for non-enumerable properties.\nconst LEGACY_CJS_SOURCES =\n typeof Proxy === 'function'\n ? undefined\n : 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: string): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: string): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: string): 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.get(id)\n if (module === undefined) {\n if (createModuleWithDirectionFlag) {\n // set in development modes for hmr support\n module = createModuleWithDirection(id)\n } else {\n module = createModuleObject(id)\n }\n moduleCache.set(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\nfunction createModuleWithDirection(id: ModuleId): ModuleWithDirection {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n parents: [],\n children: [],\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 * Terminates a module's group of entries in an {@link EsmReexports} list.\n */\nconst REEXPORT_GROUP_END = 0\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings, dynamic?: boolean) {\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 // The properties defined above are already non-configurable and\n // non-writable, so the namespace's existing exports are effectively\n // immutable. Sealing additionally makes the object non-extensible, matching\n // real ESM-namespace semantics. Modules with dynamic re-exports\n // (`export *` from a CommonJS module) must stay extensible so the dynamic\n // export proxy can surface keys discovered at runtime, so skip the seal for\n // them.\n if (!dynamic) 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 dynamic?: boolean\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, dynamic)\n}\ncontextPrototype.s = esmExport\n\n/**\n * Registers re-exports that all forward to properties of other modules.\n *\n * This is a compact spelling of the pattern\n *\n * ```js\n * var ns = context.i(moduleId)\n * context.s([exportName, () => ns[importedName], ...])\n * ```\n *\n * The list is a flat sequence of groups. Each group starts with the source the exports come from,\n * followed by that group's entries, and is terminated by the `0` sentinel (or the end of the list).\n *\n * The group head is either a **module id**, which is instantiated here:\n *\n * ```js\n * context.S([\n * 76061, 'default', 'f', 'named', 'A', 0,\n * 29842, 'otherModule', 'f',\n * ])\n * ```\n *\n * or the **namespace value** of a module that has already been imported, which is used directly:\n *\n * ```js\n * var ns1 = context.i(76061)\n * context.S([ns1, 'default', 'f', 'named', 'A'])\n * ```\n *\n * The producer picks the namespace form when it has generated the import anyway -- because some\n * later import must not be reordered past it -- so nothing is instantiated twice. The two are told\n * apart by type: a module id is always a string or number. A CommonJS function export produces a\n * callable namespace value, so namespace heads can be functions as well as objects.\n *\n * Entries are `exportName, importedName` pairs, except when a group holds exactly one string. That\n * string is then a comma-joined list of the same pairs, which saves the repeated quoting:\n *\n * ```js\n * context.S([\n * 76061, 'default,f,named,A', 0,\n * 29842, 'otherModule,f',\n * ])\n * ```\n *\n * The producer picks that spelling independently for each group whose names contain no commas,\n * since that group's names are recovered by splitting on them.\n *\n * Groups whose head is a module id are instantiated in list order, at the point where the call\n * appears, so the producer must not merge such a group across an import of another module. The\n * destination reuses a source data value or getter descriptor when one exists, falling back to a\n * wrapper getter for dynamic/proxy/inherited properties.\n *\n * `id` names the module the exports belong to when this module was merged into a scope-hoisting\n * group, exactly as it does for {@link EsmExport}.\n *\n * Only the source descriptor's payload (value or getter) is reused. {@link esm} still defines a\n * fresh enumerable, non-configurable destination property, and no source setter is ever forwarded.\n */\nfunction esmReexport(\n this: TurbopackBaseContext,\n list: EsmReexports,\n id?: ModuleId\n): void {\n const bindings: EsmBindings = []\n let i = 0\n while (i < list.length) {\n const head = list[i++]\n const start = i\n while (i < list.length && list[i] !== REEXPORT_GROUP_END) i++\n const end = i\n // Skip the sentinel, if this group was terminated by one rather than by the end of the list.\n i++\n\n // Module ids are always strings or numbers. Other values are already-imported namespaces;\n // notably, interop with a CommonJS function export produces a callable namespace function.\n // `esmImport` may return a promise for an async module, but re-exports of async modules keep\n // going through `context.s`, so the producer never routes them here and this stays synchronous.\n const namespace = (\n typeof head === 'string' || typeof head === 'number'\n ? esmImport.call(this, head)\n : head\n ) as Record\n if (end - start === 1) {\n const pairs = (list[start] as string).split(',')\n for (let j = 0; j < pairs.length; j += 2) {\n appendReexportBinding(bindings, pairs[j], namespace, pairs[j + 1])\n }\n } else {\n for (let j = start; j < end; j += 2) {\n appendReexportBinding(\n bindings,\n list[j] as string,\n namespace,\n list[j + 1] as string\n )\n }\n }\n }\n esmExport.call(this, bindings, id)\n}\ncontextPrototype.S = esmReexport\n\nfunction appendReexportBinding(\n bindings: EsmBindings,\n exportedName: string,\n namespace: Record,\n importedName: string\n): void {\n const descriptor = Reflect.getOwnPropertyDescriptor(namespace, importedName)\n if (descriptor) {\n if ('value' in descriptor) {\n // Code generation only routes immutable imported bindings through this helper, so a data\n // descriptor is a constant export and can be captured once.\n bindings.push(exportedName, BindingTag_Value, descriptor.value)\n return\n }\n if (descriptor.get) {\n // Accessors remain live by reusing the source getter. `esmReexport` is only called by\n // generated code: every group head is either produced by\n // `this.i` or is the namespace variable from a generated `this.i` call. Every getter on such\n // a namespace is receiver-independent: ESM bindings are compiler-generated arrow functions,\n // and the CommonJS/dynamic-namespace paths create arrows in `createGetter` and\n // `getOwnPropertyDescriptor`. The destination can therefore reuse the exact function instead\n // of allocating another wrapper getter.\n bindings.push(exportedName, descriptor.get)\n return\n }\n }\n\n // Dynamic/proxy/inherited CommonJS edge cases may not expose a usable own descriptor.\n bindings.push(exportedName, () => namespace[importedName])\n}\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 if (typeof Proxy !== 'function') {\n module.exports = module.namespaceObject = exports\n return reexportedObjects\n }\n // Returns the re-exported object that provides `prop` as an own property,\n // or `undefined` if none does. The traps share this logic so they always\n // agree on which keys are synthesized from `reexportedObjects`. `default`\n // is never re-exported by `export *`, so it is never synthesized.\n const reexportOwning = (prop: PropertyKey) => {\n if (prop !== 'default') {\n for (const obj of reexportedObjects!) {\n if (hasOwnProperty.call(obj, prop)) return obj\n }\n }\n return undefined\n }\n // Modules with dynamic re-exports are not sealed by `esm()`, so the\n // target beneath the namespace stays extensible. That is what lets the\n // `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that\n // exist on `reexportedObjects` but not on the target itself.\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 const obj = reexportOwning(prop)\n return obj && Reflect.get(obj, prop)\n },\n // The namespace is read-only, like a real esm namespace object. The\n // re-exported modules can still mutate their own exports (exposed live\n // via `get`), but mutating the namespace itself is rejected. Refusing\n // here, rather than forwarding to the extensible target, also prevents an\n // assignment/definition from shadowing a dynamic re-export. It also\n // prevents delete from removing a static export.\n set() {\n return false\n },\n defineProperty() {\n return false\n },\n deleteProperty() {\n return false\n },\n // The `has` trap ensures that `'exportName' in starImports` will reflect\n // the truth of whether a key is exported.\n has(target, prop) {\n if (Reflect.has(target, prop)) return true\n if (prop === 'default' || prop === '__esModule') return false\n return reexportOwning(prop) !== undefined\n },\n // ownKeys and getOwnPropertyDescriptor together make the keys enumerable.\n // If a value is returned from `ownKeys` but its property descriptor is\n // not enumerable, it will not be visible to iterator methods.\n // Collectively, they allow code like the following:\n //\n // ```\n // // module.js re-exports dynamic CJS exports\n // export * from './legacyModule.cjs'\n //\n // // from another JS file, reference the re-exported dynamic values\n // import * as Namespace from './module.js'\n // Object.keys(Namespace)\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 getOwnPropertyDescriptor(target, prop) {\n const own = Reflect.getOwnPropertyDescriptor(target, prop)\n if (own || prop === 'default' || prop === '__esModule') return own\n const obj = reexportOwning(prop)\n if (obj) {\n // Synthetic keys don't exist on the target, so they MUST be\n // reported as configurable. However the set/delete traps above will\n // prevent them from actually being changed\n return {\n enumerable: true,\n configurable: true,\n get: () => Reflect.get(obj, prop),\n }\n }\n return undefined\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 Proxy !== 'function') {\n if (\n object !== null &&\n (typeof object === 'object' || typeof object === 'function')\n ) {\n const source = LEGACY_CJS_SOURCES?.has(object)\n ? LEGACY_CJS_SOURCES.get(object)\n : object\n // Like webpack, snapshot export names while keeping their values live.\n for (const key in source) {\n if (key !== 'default' && key !== '__esModule') {\n defineProp(exports, key, {\n enumerable: true,\n get: createGetter(source, key),\n })\n }\n }\n }\n } else 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.indexOf(current) === -1;\n current = getProto(current)\n ) {\n const keys = Object.getOwnPropertyNames(current)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\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 LEGACY_CJS_SOURCES?.set(ns, raw)\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 * Remove fragments and query parameters since they are never part of the context map keys\n *\n * This matches how we parse patterns at resolving time. Arguably we should only do this for\n * strings passed to `import` but the resolve does it for `import` and `require` and so we do\n * here as well.\n */\nfunction parseRequest(request: string): string {\n // Per the URI spec fragments can contain `?` characters, so we should trim it off first\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\n const hashIndex = request.indexOf('#')\n if (hashIndex !== -1) {\n request = request.substring(0, hashIndex)\n }\n\n const queryIndex = request.indexOf('?')\n if (queryIndex !== -1) {\n request = request.substring(0, queryIndex)\n }\n\n return request\n}\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: string): Exports {\n id = parseRequest(id)\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 = (): string[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: string): ModuleId => {\n id = parseRequest(id)\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: string) => {\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\n// Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.\n// The flat format alternates one or more module IDs with their factory function.\n// Strict factories can be prepended as a nested array.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n const strictFactories = chunkModules[i]\n if (Array.isArray(strictFactories)) {\n installCompressedModuleFactories(\n strictFactories,\n 0,\n moduleFactories,\n newModuleId\n )\n i++\n }\n while (i < chunkModules.length) {\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\n // Install the factory for each module ID that doesn't already have one.\n // When some IDs in this group already have a factory, reuse that existing\n // group factory for the missing IDs to keep all IDs in the group consistent.\n // Otherwise, install the factory from this chunk.\n const moduleFactoryFn = chunkModules[end] as Function\n let existingGroupFactory: Function | undefined = undefined\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n const existingFactory = moduleFactories.get(id)\n if (existingFactory) {\n existingGroupFactory = existingFactory\n break\n }\n }\n const factoryToInstall = existingGroupFactory ?? moduleFactoryFn\n\n let didInstallFactory = false\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n if (!moduleFactories.has(id)) {\n if (!didInstallFactory) {\n if (factoryToInstall === moduleFactoryFn) {\n applyModuleFactoryName(moduleFactoryFn)\n }\n didInstallFactory = true\n }\n moduleFactories.set(id, factoryToInstall)\n newModuleId?.(id)\n }\n }\n i = end + 1\n }\n}\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}\nif (typeof URL === 'function') {\n relativeURL.prototype = URL.prototype\n}\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 * Constructs an error message for when a module factory is not available.\n */\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\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 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\n/**\n * Returns a `file://` URL under a synthetic directory named after `root`\n * (`ROOT` for the project root), for when the real filesystem path is unknown.\n * The root name and path segments are percent-encoded so the result is always\n * a valid file URI.\n */\nfunction placeholderFileUrl(modulePath: string, root?: string): string {\n return `file:///${encodeURIComponent(root ?? 'ROOT')}/${modulePath\n .split('/')\n .map(encodeURIComponent)\n .join('/')}`\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\n// Each runtime keeps its own public path. Other applications on the page may\n// change the global path after this runtime has started.\nlet runtimePublicPath: unknown =\n typeof globalThis !== 'undefined' ? (globalThis as any).publicPath : undefined\nObject.defineProperty(contextPrototype, 'runtimePublicPath', {\n get: () => runtimePublicPath,\n set: (value: unknown) => {\n runtimePublicPath = value\n },\n})\n\nlet cachedAutomaticPublicPath: string | undefined\n\nfunction getAutomaticPublicPath(): string {\n if (cachedAutomaticPublicPath !== undefined) {\n return cachedAutomaticPublicPath\n }\n\n let scriptUrl: string | undefined\n if (typeof document === 'object') {\n const currentScript = document.currentScript as HTMLScriptElement | null\n scriptUrl = currentScript?.src\n\n if (!scriptUrl) {\n const scripts = document.getElementsByTagName('script')\n const script = scripts[scripts.length - 1]\n scriptUrl = script?.src\n }\n }\n\n if (\n !scriptUrl &&\n typeof (globalThis as any).importScripts === 'function' &&\n (globalThis as any).location\n ) {\n scriptUrl = String((globalThis as any).location)\n }\n\n cachedAutomaticPublicPath = scriptUrl\n ? scriptUrl\n .replace(/^blob:/, '')\n .replace(/#.*$/, '')\n .replace(/\\?.*$/, '')\n .replace(/\\/[^/]*$/, '/')\n : ''\n\n return cachedAutomaticPublicPath\n}\n\n/**\n * Gets the public path for runtime assets.\n * Uses this runtime's public path and falls back to \"/\".\n */\nfunction getPublicPath(mode?: 'auto'): string {\n if (mode === 'auto') {\n return getAutomaticPublicPath()\n }\n\n if (typeof runtimePublicPath === 'string') {\n const publicPath = runtimePublicPath\n return publicPath.endsWith('/') ? publicPath : `${publicPath}/`\n }\n return '/'\n}\ncontextPrototype.p = getPublicPath\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":["SourceType","createModuleWithDirectionFlag","REEXPORTED_OBJECTS","WeakMap","LEGACY_CJS_SOURCES","Proxy","undefined","Context","module","exports","m","e","contextPrototype","prototype","hasOwnProperty","Object","toStringTag","Symbol","defineProp","obj","name","options","call","defineProperty","getOverwrittenModule","moduleCache","id","get","createModuleWithDirection","createModuleObject","set","error","namespaceObject","parents","children","BindingTag_Value","REEXPORT_GROUP_END","esm","bindings","dynamic","value","i","length","propName","tagOrFunction","enumerable","writable","Error","getterFn","setterFn","seal","esmExport","c","s","esmReexport","list","head","start","end","namespace","esmImport","pairs","split","j","appendReexportBinding","S","exportedName","importedName","descriptor","Reflect","getOwnPropertyDescriptor","push","ensureDynamicExports","reexportedObjects","reexportOwning","prop","target","deleteProperty","has","ownKeys","keys","key","includes","own","configurable","dynamicExport","object","source","createGetter","exportValue","v","exportNamespace","n","getProto","getPrototypeOf","__proto__","LEAF_PROTOTYPES","interopEsm","raw","ns","allowExportDefault","defaultLocation","current","indexOf","getOwnPropertyNames","splice","createNS","args","apply","create","getOrInstantiateModuleFromParent","__esModule","asyncLoader","moduleId","loader","r","bind","A","runtimeRequire","require","require1","t","commonJsRequire","parseRequest","request","hashIndex","substring","queryIndex","moduleContext","map","code","resolve","import","f","getChunkPath","chunkData","path","installCompressedModuleFactories","chunkModules","offset","moduleFactories","newModuleId","strictFactories","Array","isArray","moduleFactoryFn","existingGroupFactory","existingFactory","factoryToInstall","didInstallFactory","applyModuleFactoryName","relativeURL","inputUrl","realUrl","URL","values","href","pathname","replace","origin","protocol","toString","toJSON","_args","U","invariant","never","computeMessage","factoryNotAvailableMessage","sourceType","sourceData","instantiationReason","placeholderFileUrl","modulePath","root","encodeURIComponent","join","requireStub","_moduleId","z","g","globalThis","runtimePublicPath","publicPath","cachedAutomaticPublicPath","getAutomaticPublicPath","scriptUrl","document","currentScript","src","scripts","getElementsByTagName","script","importScripts","location","String","getPublicPath","mode","endsWith","p","factory"],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,0CAA0C;AAI1C;;;CAGC,GACD,IAAA,AAAKA,oCAAAA;IACH;;;;GAIC,sCACS;IACV;;;GAGC,qCACQ;IACT;;;;GAIC,qCACQ;WAjBNA;EAAAA;AA4BL;;;;;CAKC,GACD,IAAIC,gCAAgC;AAEpC,MAAMC,qBAAqB,IAAIC;AAC/B,wEAAwE;AACxE,+DAA+D;AAC/D,MAAMC,qBACJ,OAAOC,UAAU,aACbC,YACA,IAAIH;AAEV;;CAEC,GACD,SAASI,QAEPC,MAAc,EACdC,OAAgB;IAEhB,IAAI,CAACC,CAAC,GAAGF;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAACG,CAAC,GAAGF;AACX;AACA,MAAMG,mBAAmBL,QAAQM,SAAS;AA+B1C,MAAMC,iBAAiBC,OAAOF,SAAS,CAACC,cAAc;AACtD,MAAME,cAAc,OAAOC,WAAW,eAAeA,OAAOD,WAAW;AAEvE,SAASE,WACPC,GAAQ,EACRC,IAAiB,EACjBC,OAA2C;IAE3C,IAAI,CAACP,eAAeQ,IAAI,CAACH,KAAKC,OAAOL,OAAOQ,cAAc,CAACJ,KAAKC,MAAMC;AACxE;AAEA,SAASG,qBACPC,WAAgC,EAChCC,EAAY;IAEZ,IAAIlB,SAASiB,YAAYE,GAAG,CAACD;IAC7B,IAAIlB,WAAWF,WAAW;QACxB,IAAIL,+BAA+B;YACjC,2CAA2C;YAC3CO,SAASoB,0BAA0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YAAYE,eAAeC;QAE3B,IAAI,CAACH,WAAW;YACd,MAAMI,UAAUH,SAASI,oBAAoB,CAAC;YAC9C,MAAMC,SAASF,OAAO,CAACA,QAAQpJ,MAAM,GAAG,EAAE;YAC1CgJ,YAAYM,QAAQH;QACtB;IACF;IAEA,IACE,CAACH,aACD,OAAO,AAACL,WAAmBY,aAAa,KAAK,cAC7C,AAACZ,WAAmBa,QAAQ,EAC5B;QACAR,YAAYS,OAAO,AAACd,WAAmBa,QAAQ;IACjD;IAEAV,4BAA4BE,YACxBA,UACG5B,OAAO,CAAC,UAAU,IAClBA,OAAO,CAAC,QAAQ,IAChBA,OAAO,CAAC,SAAS,IACjBA,OAAO,CAAC,YAAY,OACvB;IAEJ,OAAO0B;AACT;AAEA;;;CAGC,GACD,SAASY,cAAcC,IAAa;IAClC,IAAIA,SAAS,QAAQ;QACnB,OAAOZ;IACT;IAEA,IAAI,OAAOH,sBAAsB,UAAU;QACzC,MAAMC,aAAaD;QACnB,OAAOC,WAAWe,QAAQ,CAAC,OAAOf,aAAa,GAAGA,WAAW,CAAC,CAAC;IACjE;IACA,OAAO;AACT;AACA3K,iBAAiB2L,CAAC,GAAGH;AAMrB,SAAS9C,uBAAuBkD,OAAiB;IAC/C,+DAA+D;IAC/DzL,OAAOQ,cAAc,CAACiL,SAAS,QAAQ;QACrChK,OAAO;IACT;AACF","ignoreList":[0]}}, + {"offset": {"line": 729, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/library/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack UMD library runtimes (DOM and Node.js).\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// Provided by build\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n): Module;\n\ntype RuntimeParams = {\n runtimeModuleIds: ModuleId[];\n};\n\n// Used by upstream build-base.ts for chunk registration\ntype ChunkRegistrationChunk =\n | ChunkPath\n | { getAttribute: (name: string) => string | null }\n | undefined;\n\ntype ChunkRegistration = [\n chunkPath: ChunkRegistrationChunk,\n ...([RuntimeParams] | CompressedModuleFactories),\n];\n\n// SourceType and SourceData are provided by shared/runtime/runtime-utils.ts\ninterface RuntimeBackend {\n registerChunk: (\n chunkPath: ChunkPath | ChunkScript,\n params?: RuntimeParams,\n ) => void;\n}\n\nlet BACKEND: RuntimeBackend;\n\nconst moduleFactories: ModuleFactories = new Map();\ncontextPrototype.M = moduleFactories;\n\n/**\n * Determine the chunk to register from a registration entry.\n * In library builds, chunks are always string paths or script objects.\n */\nfunction getChunkFromRegistration(\n chunk: ChunkRegistrationChunk,\n): ChunkPath | ChunkScript {\n if (typeof chunk === \"string\") {\n return chunk;\n } else if (chunk) {\n return { src: chunk.getAttribute(\"src\")! } as unknown as ChunkScript;\n } else {\n throw new Error(\"chunk path is empty\");\n }\n}\n\n/**\n * Load CommonJS externals when a UMD bundle runs in a CommonJS environment.\n * Browser-targeted UMD bundles need this too because their wrapper supports\n * both global and CommonJS consumers.\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 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\n/**\n * Adds Webpack-compatible ESM metadata to external values while preserving\n * native ESM live bindings.\n */\nfunction externalNamespace(mod: any) {\n if (mod && mod.__esModule) return mod;\n\n const ns = Object.create(null);\n const isEsmNamespace = mod && toStringTag && mod[toStringTag] === \"Module\";\n\n if (mod && (typeof mod === \"object\" || typeof mod === \"function\")) {\n for (const key in mod) {\n if (key === \"__esModule\" || (!isEsmNamespace && key === \"default\")) {\n continue;\n }\n\n Object.defineProperty(ns, key, {\n enumerable: true,\n get: createGetter(mod, key),\n });\n }\n }\n\n if (!isEsmNamespace) {\n Object.defineProperty(ns, \"default\", { enumerable: true, value: mod });\n }\n Object.defineProperty(ns, \"__esModule\", { value: true });\n if (toStringTag) {\n Object.defineProperty(ns, toStringTag, { value: \"Module\" });\n }\n\n return ns;\n}\ncontextPrototype.N = externalNamespace;\n"],"names":["BACKEND","moduleFactories","Map","contextPrototype","M","getChunkFromRegistration","chunk","src","getAttribute","Error","externalRequire","id","thunk","esm","raw","err","__esModule","interopEsm","createNS","resolve","options","require","x","externalNamespace","mod","ns","Object","create","isEsmNamespace","toStringTag","key","defineProperty","enumerable","get","createGetter","value","N"],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,oIAAoI;AACpI,sIAAsI;AAEtI,oBAAoB;AA8BpB,IAAIA;AAEJ,MAAMC,kBAAmC,IAAIC;AAC7CC,iBAAiBC,CAAC,GAAGH;AAErB;;;CAGC,GACD,SAASI,yBACPC,KAA6B;IAE7B,IAAI,OAAOA,UAAU,UAAU;QAC7B,OAAOA;IACT,OAAO,IAAIA,OAAO;QAChB,OAAO;YAAEC,KAAKD,MAAME,YAAY,CAAC;QAAQ;IAC3C,OAAO;QACL,MAAM,IAAIC,MAAM;IAClB;AACF;AAEA;;;;CAIC,GACD,SAASC,gBACPC,EAAY,EACZC,KAAgB,EAChBC,MAAe,KAAK;IAEpB,IAAIC;IACJ,IAAI;QACFA,MAAMF;IACR,EAAE,OAAOG,KAAK;QACZ,MAAM,IAAIN,MAAM,CAAC,+BAA+B,EAAEE,GAAG,EAAE,EAAEI,KAAK;IAChE;IAEA,IAAI,CAACF,OAAOC,IAAIE,UAAU,EAAE;QAC1B,OAAOF;IACT;IAEA,OAAOG,WAAWH,KAAKI,SAASJ,MAAM;AACxC;AAEAJ,gBAAgBS,OAAO,GAAG,CACxBR,IACAS;IAIA,OAAOC,QAAQF,OAAO,CAACR,IAAIS;AAC7B;AACAjB,iBAAiBmB,CAAC,GAAGZ;AAErB;;;CAGC,GACD,SAASa,kBAAkBC,GAAQ;IACjC,IAAIA,OAAOA,IAAIR,UAAU,EAAE,OAAOQ;IAElC,MAAMC,KAAKC,OAAOC,MAAM,CAAC;IACzB,MAAMC,iBAAiBJ,OAAOK,eAAeL,GAAG,CAACK,YAAY,KAAK;IAElE,IAAIL,OAAO,CAAC,OAAOA,QAAQ,YAAY,OAAOA,QAAQ,UAAU,GAAG;QACjE,IAAK,MAAMM,OAAON,IAAK;YACrB,IAAIM,QAAQ,gBAAiB,CAACF,kBAAkBE,QAAQ,WAAY;gBAClE;YACF;YAEAJ,OAAOK,cAAc,CAACN,IAAIK,KAAK;gBAC7BE,YAAY;gBACZC,KAAKC,aAAaV,KAAKM;YACzB;QACF;IACF;IAEA,IAAI,CAACF,gBAAgB;QACnBF,OAAOK,cAAc,CAACN,IAAI,WAAW;YAAEO,YAAY;YAAMG,OAAOX;QAAI;IACtE;IACAE,OAAOK,cAAc,CAACN,IAAI,cAAc;QAAEU,OAAO;IAAK;IACtD,IAAIN,aAAa;QACfH,OAAOK,cAAc,CAACN,IAAII,aAAa;YAAEM,OAAO;QAAS;IAC3D;IAEA,OAAOV;AACT;AACAtB,iBAAiBiC,CAAC,GAAGb"}}, + {"offset": {"line": 810, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = new Map()\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 | undefined,\n moduleId: ModuleId\n): Module {\n const module = moduleCache.get(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.get(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.set(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 | RuntimeParams) {\n // An inlined entry-only registration is a bare params object (no source chunk).\n if (!Array.isArray(registration)) {\n return BACKEND.registerChunk(undefined, registration)\n }\n const chunk = getChunkFromRegistration(registration[0]) as\n | ChunkScript\n | ChunkPath\n if (SUPPORT_COMPONENT_CHUNKS) {\n markChunkComponentsAvailable(chunk)\n }\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(chunk, runtimeParams)\n}\n"],"names":["moduleCache","Map","contextPrototype","c","getOrInstantiateRuntimeModule","chunkPath","moduleId","module","get","error","instantiateModule","SourceType","Runtime","getOrInstantiateModuleFromParent","id","sourceModule","Parent","sourceType","sourceData","moduleFactory","moduleFactories","Error","factoryNotAvailableMessage","createModuleObject","exports","set","context","Context","namespaceObject","interopEsm","registerChunk","registration","Array","isArray","BACKEND","undefined","chunk","getChunkFromRegistration","SUPPORT_COMPONENT_CHUNKS","markChunkComponentsAvailable","runtimeParams","length","installCompressedModuleFactories"],"mappings":"AAAA,0CAA0C;AAC1C,mCAAmC;AAEnC,MAAMA,cAAmC,IAAIC;AAC7CC,iBAAiBC,CAAC,GAAGH;AAErB;;CAEC,GACD,aAAa;AACb,6DAA6D;AAC7D,SAASI,8BACPC,SAAgC,EAChCC,QAAkB;IAElB,MAAMC,SAASP,YAAYQ,GAAG,CAACF;IAC/B,IAAIC,QAAQ;QACV,IAAIA,OAAOE,KAAK,EAAE;YAChB,MAAMF,OAAOE,KAAK;QACpB;QACA,OAAOF;IACT;IAEA,OAAOG,kBAAkBJ,UAAUK,WAAWC,OAAO,EAAEP;AACzD;AAEA;;CAEC,GACD,sBAAsB;AACtB,aAAa;AACb,6DAA6D;AAC7D,MAAMQ,mCAEF,CAACC,IAAIC;IACP,MAAMR,SAASP,YAAYQ,GAAG,CAACM;IAE/B,IAAIP,QAAQ;QACV,IAAIA,OAAOE,KAAK,EAAE;YAChB,MAAMF,OAAOE,KAAK;QACpB;QACA,OAAOF;IACT;IAEA,OAAOG,kBAAkBI,IAAIH,WAAWK,MAAM,EAAED,aAAaD,EAAE;AACjE;AAEA,SAASJ,kBACPI,EAAY,EACZG,UAAsB,EACtBC,UAAsB;IAEtB,MAAMC,gBAAgBC,gBAAgBZ,GAAG,CAACM;IAC1C,IAAI,OAAOK,kBAAkB,YAAY;QACvC,sEAAsE;QACtE,0EAA0E;QAC1E,mDAAmD;QACnD,MAAM,IAAIE,MAAMC,2BAA2BR,IAAIG,YAAYC;IAC7D;IAEA,MAAMX,SAAiBgB,mBAAmBT;IAC1C,MAAMU,UAAUjB,OAAOiB,OAAO;IAE9BxB,YAAYyB,GAAG,CAACX,IAAIP;IAEpB,4EAA4E;IAC5E,MAAMmB,UAAU,IAAKC,QACnBpB,QACAiB;IAEF,IAAI;QACFL,cAAcO,SAASnB,QAAQiB;IACjC,EAAE,OAAOf,OAAO;QACdF,OAAOE,KAAK,GAAGA;QACf,MAAMA;IACR;IAEA,IAAIF,OAAOqB,eAAe,IAAIrB,OAAOiB,OAAO,KAAKjB,OAAOqB,eAAe,EAAE;QACvE,yDAAyD;QACzDC,WAAWtB,OAAOiB,OAAO,EAAEjB,OAAOqB,eAAe;IACnD;IAEA,OAAOrB;AACT;AAEA,6DAA6D;AAC7D,SAASuB,cAAcC,YAA+C;IACpE,gFAAgF;IAChF,IAAI,CAACC,MAAMC,OAAO,CAACF,eAAe;QAChC,OAAOG,QAAQJ,aAAa,CAACK,WAAWJ;IAC1C;IACA,MAAMK,QAAQC,yBAAyBN,YAAY,CAAC,EAAE;IAGtD,IAAIO,0BAA0B;QAC5BC,6BAA6BH;IAC/B;IACA,IAAII;IACJ,8GAA8G;IAC9G,IAAIT,aAAaU,MAAM,KAAK,GAAG;QAC7BD,gBAAgBT,YAAY,CAAC,EAAE;IACjC,OAAO;QACLS,gBAAgBL;QAChBO,iCACEX,cACA,WAAW,GAAG,GACdX;IAEJ;IAEA,OAAOc,QAAQJ,aAAa,CAACM,OAAOI;AACtC","ignoreList":[0]}}, + {"offset": {"line": 888, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/library/runtime-backend-node.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack\n * ECMAScript Node.js runtime for library builds.\n *\n * It will be appended to the base runtime code in place of\n * runtime-backend-dom.ts when the target platform is Node.js.\n *\n * Server library entry chunks can reference shared chunks. Those chunks are\n * CommonJS modules exporting compressed module factories, so the backend can\n * load them synchronously before instantiating runtime entries.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/**\n * Resolve source modules relative to the library bundle's directory.\n */\nfunction resolveFileUrl(modulePath?: string, root?: string): string {\n // ImportMetaBinding escapes percent signs and control characters before codegen.\n const decodedPath = decodeURIComponent(modulePath ?? \"\");\n if (root !== undefined) return placeholderFileUrl(decodedPath, root);\n const absolutePath = require(\"path\").resolve(\n __dirname,\n RELATIVE_ROOT_PATH,\n decodedPath,\n );\n return require(\"url\").pathToFileURL(absolutePath).href;\n}\ncontextPrototype.F = resolveFileUrl;\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\n/**\n * Exports a URL value. No suffix is added in Node.js runtime.\n */\nfunction exportUrl(\n this: TurbopackBaseContext,\n url: string,\n id: ModuleId | undefined,\n) {\n exportValue.call(this, url, id);\n}\ncontextPrototype.q = exportUrl;\n\n(() => {\n BACKEND = {\n registerChunk(chunk, params) {\n const chunkPath =\n typeof chunk === \"string\"\n ? chunk\n : (chunk.src! as unknown as ChunkPath);\n\n if (params == null) {\n return;\n }\n\n const otherChunks = (\n params as RuntimeParams & { otherChunks: ChunkData[] }\n ).otherChunks;\n const nodePath = require(\"path\");\n for (const otherChunk of otherChunks) {\n const otherChunkPath = getChunkPath(otherChunk);\n if (!/\\.(?:c|m)?js(?:\\?|$)/.test(otherChunkPath)) {\n continue;\n }\n const relativeChunkPath = nodePath.relative(\n nodePath.dirname(chunkPath),\n otherChunkPath,\n );\n const chunkModules: CompressedModuleFactories = require(\n nodePath.resolve(__dirname, relativeChunkPath),\n );\n installCompressedModuleFactories(chunkModules, 0, moduleFactories);\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"],"names":["resolveFileUrl","modulePath","root","decodedPath","decodeURIComponent","undefined","placeholderFileUrl","absolutePath","require","resolve","__dirname","RELATIVE_ROOT_PATH","pathToFileURL","href","contextPrototype","F","externalImport","id","raw","err","Error","__esModule","default","interopEsm","createNS","y","exportUrl","url","exportValue","call","q","BACKEND","registerChunk","chunk","params","chunkPath","src","otherChunks","nodePath","otherChunk","otherChunkPath","getChunkPath","test","relativeChunkPath","relative","dirname","chunkModules","installCompressedModuleFactories","moduleFactories","runtimeModuleIds","length","moduleId","getOrInstantiateRuntimeModule"],"mappings":"AAAA;;;;;;;;;;CAUC,GAED,oDAAoD,GAEpD,0CAA0C;AAE1C;;CAEC,GACD,SAASA,eAAeC,UAAmB,EAAEC,IAAa;IACxD,iFAAiF;IACjF,MAAMC,cAAcC,mBAAmBH,cAAc;IACrD,IAAIC,SAASG,WAAW,OAAOC,mBAAmBH,aAAaD;IAC/D,MAAMK,eAAeC,QAAQ,QAAQC,OAAO,CAC1CC,WACAC,oBACAR;IAEF,OAAOK,QAAQ,OAAOI,aAAa,CAACL,cAAcM,IAAI;AACxD;AACAC,iBAAiBC,CAAC,GAAGf;AAErB,eAAegB,eAAeC,EAAuB;IACnD,IAAIC;IACJ,IAAI;QACFA,MAAM,MAAM,MAAM,CAACD;IACrB,EAAE,OAAOE,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAIC,MAAM,CAAC,+BAA+B,EAAEH,GAAG,EAAE,EAAEE,KAAK;IAChE;IAEA,IAAID,OAAOA,IAAIG,UAAU,IAAIH,IAAII,OAAO,IAAI,aAAaJ,IAAII,OAAO,EAAE;QACpE,OAAOC,WAAWL,IAAII,OAAO,EAAEE,SAASN,MAAM;IAChD;IAEA,OAAOA;AACT;AACAJ,iBAAiBW,CAAC,GAAGT;AAErB;;CAEC,GACD,SAASU,UAEPC,GAAW,EACXV,EAAwB;IAExBW,YAAYC,IAAI,CAAC,IAAI,EAAEF,KAAKV;AAC9B;AACAH,iBAAiBgB,CAAC,GAAGJ;AAErB,CAAC;IACCK,UAAU;QACRC,eAAcC,KAAK,EAAEC,MAAM;YACzB,MAAMC,YACJ,OAAOF,UAAU,WACbA,QACCA,MAAMG,GAAG;YAEhB,IAAIF,UAAU,MAAM;gBAClB;YACF;YAEA,MAAMG,cAAc,AAClBH,OACAG,WAAW;YACb,MAAMC,WAAW9B,QAAQ;YACzB,KAAK,MAAM+B,cAAcF,YAAa;gBACpC,MAAMG,iBAAiBC,aAAaF;gBACpC,IAAI,CAAC,uBAAuBG,IAAI,CAACF,iBAAiB;oBAChD;gBACF;gBACA,MAAMG,oBAAoBL,SAASM,QAAQ,CACzCN,SAASO,OAAO,CAACV,YACjBK;gBAEF,MAAMM,eAA0CtC,QAC9C8B,SAAS7B,OAAO,CAACC,WAAWiC;gBAE9BI,iCAAiCD,cAAc,GAAGE;YACpD;YAEA,IAAId,OAAOe,gBAAgB,CAACC,MAAM,GAAG,GAAG;gBACtC,KAAK,MAAMC,YAAYjB,OAAOe,gBAAgB,CAAE;oBAC9CG,8BAA8BjB,WAAWgB;gBAC3C;YACF;QACF;IACF;AACF,CAAC"}}, + {"offset": {"line": 993, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/basic/multi_server_entries_sourcemap/input/server.ts"],"sourcesContent":["import { shared } from \"./shared\";\n\nconsole.log(\"server runtime\", shared);\n"],"names":["console","log"],"mappings":";AAAA;;AAEAA,QAAQC,GAAG,CAAC,kBAAkB,gKAAM"}}] } \ No newline at end of file diff --git a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/stats.json b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/stats.json index d94cc653c..46d25e281 100644 --- a/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/stats.json +++ b/crates/pack-tests/tests/snapshot/basic/multi_server_entries_sourcemap/output/server/stats.json @@ -85,7 +85,7 @@ "entry": false, "recorded": false, "id": "entries/detail-server.2c817ca8.js", - "size": 39344, + "size": 40514, "hash": "", "files": [ "entries/detail-server.2c817ca8.js" @@ -97,7 +97,7 @@ "entry": false, "recorded": false, "id": "entries/index-server.3095d849.js", - "size": 39355, + "size": 40525, "hash": "", "files": [ "entries/index-server.3095d849.js" @@ -109,7 +109,7 @@ "entry": false, "recorded": false, "id": "entries/server.6de379ea.js", - "size": 39316, + "size": 40486, "hash": "", "files": [ "entries/server.6de379ea.js" @@ -169,7 +169,7 @@ "type": "asset", "name": "entries/detail-server.2c817ca8.js", "info": {}, - "size": 39344, + "size": 40514, "emitted": false, "comparedForEmit": false, "cached": false, @@ -181,7 +181,7 @@ "type": "asset", "name": "entries/detail-server.2c817ca8.js.map", "info": {}, - "size": 63290, + "size": 65097, "emitted": false, "comparedForEmit": false, "cached": false, @@ -193,7 +193,7 @@ "type": "asset", "name": "entries/index-server.3095d849.js", "info": {}, - "size": 39355, + "size": 40525, "emitted": false, "comparedForEmit": false, "cached": false, @@ -205,7 +205,7 @@ "type": "asset", "name": "entries/index-server.3095d849.js.map", "info": {}, - "size": 63278, + "size": 65085, "emitted": false, "comparedForEmit": false, "cached": false, @@ -217,7 +217,7 @@ "type": "asset", "name": "entries/server.6de379ea.js", "info": {}, - "size": 39316, + "size": 40486, "emitted": false, "comparedForEmit": false, "cached": false, @@ -229,7 +229,7 @@ "type": "asset", "name": "entries/server.6de379ea.js.map", "info": {}, - "size": 63269, + "size": 65076, "emitted": false, "comparedForEmit": false, "cached": false, diff --git a/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.9954de0a.js b/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js similarity index 97% rename from crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.9954de0a.js rename to crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js index 943f5f010..119ad6345 100644 --- a/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.9954de0a.js +++ b/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js @@ -55,6 +55,9 @@ var WORKER_FORWARDED_GLOBALS = []; * uses plain Module objects. */ let createModuleWithDirectionFlag = false; const REEXPORTED_OBJECTS = new WeakMap(); +// Legacy re-exports need the original CommonJS enumerable keys, not the +// namespace's synthetic getters for non-enumerable properties. +const LEGACY_CJS_SOURCES = typeof Proxy === 'function' ? undefined : new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. */ function Context(module, exports) { @@ -290,6 +293,10 @@ function ensureDynamicExports(module, exports) { let reexportedObjects = REEXPORTED_OBJECTS.get(module); if (!reexportedObjects) { REEXPORTED_OBJECTS.set(module, reexportedObjects = []); + if (typeof Proxy !== 'function') { + module.exports = module.namespaceObject = exports; + return reexportedObjects; + } // Returns the re-exported object that provides `prop` as an own property, // or `undefined` if none does. The traps share this logic so they always // agree on which keys are synthesized from `reexportedObjects`. `default` @@ -391,7 +398,20 @@ function ensureDynamicExports(module, exports) { exports = this.e; } const reexportedObjects = ensureDynamicExports(module, exports); - if (typeof object === 'object' && object !== null) { + if (typeof Proxy !== 'function') { + if (object !== null && (typeof object === 'object' || typeof object === 'function')) { + const source = LEGACY_CJS_SOURCES?.has(object) ? LEGACY_CJS_SOURCES.get(object) : object; + // Like webpack, snapshot export names while keeping their values live. + for(const key in source){ + if (key !== 'default' && key !== '__esModule') { + defineProp(exports, key, { + enumerable: true, + get: createGetter(source, key) + }); + } + } + } + } else if (typeof object === 'object' && object !== null) { reexportedObjects.push(object); } } @@ -437,8 +457,10 @@ function createGetter(obj, key) { */ function interopEsm(raw, ns, allowExportDefault) { const bindings = []; let defaultLocation = -1; - for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){ - for (const key of Object.getOwnPropertyNames(current)){ + for(let current = raw; (typeof current === 'object' || typeof current === 'function') && LEAF_PROTOTYPES.indexOf(current) === -1; current = getProto(current)){ + const keys = Object.getOwnPropertyNames(current); + for(let i = 0; i < keys.length; i++){ + const key = keys[i]; bindings.push(key, createGetter(raw, key)); if (defaultLocation === -1 && key === 'default') { defaultLocation = bindings.length - 1; @@ -457,6 +479,7 @@ function createGetter(obj, key) { } } esm(ns, bindings); + LEGACY_CJS_SOURCES?.set(ns, raw); return ns; } function createNS(raw) { @@ -621,7 +644,9 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, value: values[key] }); }; -relativeURL.prototype = URL.prototype; +if (typeof URL === 'function') { + relativeURL.prototype = URL.prototype; +} contextPrototype.U = relativeURL; /** * Utility function to ensure all variants of an enum are handled. @@ -1429,4 +1454,4 @@ chunksToRegister.forEach(registerChunk); })(); -//# sourceMappingURL=main.9954de0a.js.map \ No newline at end of file +//# sourceMappingURL=main.b08cb30e.js.map \ No newline at end of file diff --git a/crates/pack-tests/tests/snapshot/public_path/auto/output/turbopack-1viuhcq1bv85z.js.map b/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js.map similarity index 55% rename from crates/pack-tests/tests/snapshot/public_path/auto/output/turbopack-1viuhcq1bv85z.js.map rename to crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js.map index f46672110..63811a619 100644 --- a/crates/pack-tests/tests/snapshot/public_path/auto/output/turbopack-1viuhcq1bv85z.js.map +++ b/crates/pack-tests/tests/snapshot/basic/sourcemap_filename_hash/output/scripts/main.b08cb30e.js.map @@ -2,8 +2,8 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/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/// \n\ntype EsmNamespaceObject = Record\n\n/**\n * Describes why a module was instantiated.\n * Shared between browser and Node.js runtimes.\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\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\n/**\n * Flag indicating which module object type to create when a module is merged. Set to `true`\n * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,\n * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it\n * uses plain Module objects.\n */\nlet createModuleWithDirectionFlag = false\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: string): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: string): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: string): 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.get(id)\n if (module === undefined) {\n if (createModuleWithDirectionFlag) {\n // set in development modes for hmr support\n module = createModuleWithDirection(id)\n } else {\n module = createModuleObject(id)\n }\n moduleCache.set(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\nfunction createModuleWithDirection(id: ModuleId): ModuleWithDirection {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n parents: [],\n children: [],\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 * Terminates a module's group of entries in an {@link EsmReexports} list.\n */\nconst REEXPORT_GROUP_END = 0\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings, dynamic?: boolean) {\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 // The properties defined above are already non-configurable and\n // non-writable, so the namespace's existing exports are effectively\n // immutable. Sealing additionally makes the object non-extensible, matching\n // real ESM-namespace semantics. Modules with dynamic re-exports\n // (`export *` from a CommonJS module) must stay extensible so the dynamic\n // export proxy can surface keys discovered at runtime, so skip the seal for\n // them.\n if (!dynamic) 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 dynamic?: boolean\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, dynamic)\n}\ncontextPrototype.s = esmExport\n\n/**\n * Registers re-exports that all forward to properties of other modules.\n *\n * This is a compact spelling of the pattern\n *\n * ```js\n * var ns = context.i(moduleId)\n * context.s([exportName, () => ns[importedName], ...])\n * ```\n *\n * The list is a flat sequence of groups. Each group starts with the source the exports come from,\n * followed by that group's entries, and is terminated by the `0` sentinel (or the end of the list).\n *\n * The group head is either a **module id**, which is instantiated here:\n *\n * ```js\n * context.S([\n * 76061, 'default', 'f', 'named', 'A', 0,\n * 29842, 'otherModule', 'f',\n * ])\n * ```\n *\n * or the **namespace value** of a module that has already been imported, which is used directly:\n *\n * ```js\n * var ns1 = context.i(76061)\n * context.S([ns1, 'default', 'f', 'named', 'A'])\n * ```\n *\n * The producer picks the namespace form when it has generated the import anyway -- because some\n * later import must not be reordered past it -- so nothing is instantiated twice. The two are told\n * apart by type: a module id is always a string or number. A CommonJS function export produces a\n * callable namespace value, so namespace heads can be functions as well as objects.\n *\n * Entries are `exportName, importedName` pairs, except when a group holds exactly one string. That\n * string is then a comma-joined list of the same pairs, which saves the repeated quoting:\n *\n * ```js\n * context.S([\n * 76061, 'default,f,named,A', 0,\n * 29842, 'otherModule,f',\n * ])\n * ```\n *\n * The producer picks that spelling independently for each group whose names contain no commas,\n * since that group's names are recovered by splitting on them.\n *\n * Groups whose head is a module id are instantiated in list order, at the point where the call\n * appears, so the producer must not merge such a group across an import of another module. The\n * destination reuses a source data value or getter descriptor when one exists, falling back to a\n * wrapper getter for dynamic/proxy/inherited properties.\n *\n * `id` names the module the exports belong to when this module was merged into a scope-hoisting\n * group, exactly as it does for {@link EsmExport}.\n *\n * Only the source descriptor's payload (value or getter) is reused. {@link esm} still defines a\n * fresh enumerable, non-configurable destination property, and no source setter is ever forwarded.\n */\nfunction esmReexport(\n this: TurbopackBaseContext,\n list: EsmReexports,\n id?: ModuleId\n): void {\n const bindings: EsmBindings = []\n let i = 0\n while (i < list.length) {\n const head = list[i++]\n const start = i\n while (i < list.length && list[i] !== REEXPORT_GROUP_END) i++\n const end = i\n // Skip the sentinel, if this group was terminated by one rather than by the end of the list.\n i++\n\n // Module ids are always strings or numbers. Other values are already-imported namespaces;\n // notably, interop with a CommonJS function export produces a callable namespace function.\n // `esmImport` may return a promise for an async module, but re-exports of async modules keep\n // going through `context.s`, so the producer never routes them here and this stays synchronous.\n const namespace = (\n typeof head === 'string' || typeof head === 'number'\n ? esmImport.call(this, head)\n : head\n ) as Record\n if (end - start === 1) {\n const pairs = (list[start] as string).split(',')\n for (let j = 0; j < pairs.length; j += 2) {\n appendReexportBinding(bindings, pairs[j], namespace, pairs[j + 1])\n }\n } else {\n for (let j = start; j < end; j += 2) {\n appendReexportBinding(\n bindings,\n list[j] as string,\n namespace,\n list[j + 1] as string\n )\n }\n }\n }\n esmExport.call(this, bindings, id)\n}\ncontextPrototype.S = esmReexport\n\nfunction appendReexportBinding(\n bindings: EsmBindings,\n exportedName: string,\n namespace: Record,\n importedName: string\n): void {\n const descriptor = Reflect.getOwnPropertyDescriptor(namespace, importedName)\n if (descriptor) {\n if ('value' in descriptor) {\n // Code generation only routes immutable imported bindings through this helper, so a data\n // descriptor is a constant export and can be captured once.\n bindings.push(exportedName, BindingTag_Value, descriptor.value)\n return\n }\n if (descriptor.get) {\n // Accessors remain live by reusing the source getter. `esmReexport` is only called by\n // generated code: every group head is either produced by\n // `this.i` or is the namespace variable from a generated `this.i` call. Every getter on such\n // a namespace is receiver-independent: ESM bindings are compiler-generated arrow functions,\n // and the CommonJS/dynamic-namespace paths create arrows in `createGetter` and\n // `getOwnPropertyDescriptor`. The destination can therefore reuse the exact function instead\n // of allocating another wrapper getter.\n bindings.push(exportedName, descriptor.get)\n return\n }\n }\n\n // Dynamic/proxy/inherited CommonJS edge cases may not expose a usable own descriptor.\n bindings.push(exportedName, () => namespace[importedName])\n}\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 // Returns the re-exported object that provides `prop` as an own property,\n // or `undefined` if none does. The traps share this logic so they always\n // agree on which keys are synthesized from `reexportedObjects`. `default`\n // is never re-exported by `export *`, so it is never synthesized.\n const reexportOwning = (prop: PropertyKey) => {\n if (prop !== 'default') {\n for (const obj of reexportedObjects!) {\n if (hasOwnProperty.call(obj, prop)) return obj\n }\n }\n return undefined\n }\n // Modules with dynamic re-exports are not sealed by `esm()`, so the\n // target beneath the namespace stays extensible. That is what lets the\n // `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that\n // exist on `reexportedObjects` but not on the target itself.\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 const obj = reexportOwning(prop)\n return obj && Reflect.get(obj, prop)\n },\n // The namespace is read-only, like a real esm namespace object. The\n // re-exported modules can still mutate their own exports (exposed live\n // via `get`), but mutating the namespace itself is rejected. Refusing\n // here, rather than forwarding to the extensible target, also prevents an\n // assignment/definition from shadowing a dynamic re-export. It also\n // prevents delete from removing a static export.\n set() {\n return false\n },\n defineProperty() {\n return false\n },\n deleteProperty() {\n return false\n },\n // The `has` trap ensures that `'exportName' in starImports` will reflect\n // the truth of whether a key is exported.\n has(target, prop) {\n if (Reflect.has(target, prop)) return true\n if (prop === 'default' || prop === '__esModule') return false\n return reexportOwning(prop) !== undefined\n },\n // ownKeys and getOwnPropertyDescriptor together make the keys enumerable.\n // If a value is returned from `ownKeys` but its property descriptor is\n // not enumerable, it will not be visible to iterator methods.\n // Collectively, they allow code like the following:\n //\n // ```\n // // module.js re-exports dynamic CJS exports\n // export * from './legacyModule.cjs'\n //\n // // from another JS file, reference the re-exported dynamic values\n // import * as Namespace from './module.js'\n // Object.keys(Namespace)\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 getOwnPropertyDescriptor(target, prop) {\n const own = Reflect.getOwnPropertyDescriptor(target, prop)\n if (own || prop === 'default' || prop === '__esModule') return own\n const obj = reexportOwning(prop)\n if (obj) {\n // Synthetic keys don't exist on the target, so they MUST be\n // reported as configurable. However the set/delete traps above will\n // prevent them from actually being changed\n return {\n enumerable: true,\n configurable: true,\n get: () => Reflect.get(obj, prop),\n }\n }\n return undefined\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 * Remove fragments and query parameters since they are never part of the context map keys\n *\n * This matches how we parse patterns at resolving time. Arguably we should only do this for\n * strings passed to `import` but the resolve does it for `import` and `require` and so we do\n * here as well.\n */\nfunction parseRequest(request: string): string {\n // Per the URI spec fragments can contain `?` characters, so we should trim it off first\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\n const hashIndex = request.indexOf('#')\n if (hashIndex !== -1) {\n request = request.substring(0, hashIndex)\n }\n\n const queryIndex = request.indexOf('?')\n if (queryIndex !== -1) {\n request = request.substring(0, queryIndex)\n }\n\n return request\n}\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: string): Exports {\n id = parseRequest(id)\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 = (): string[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: string): ModuleId => {\n id = parseRequest(id)\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: string) => {\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\n// Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.\n// The flat format alternates one or more module IDs with their factory function.\n// Strict factories can be prepended as a nested array.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n const strictFactories = chunkModules[i]\n if (Array.isArray(strictFactories)) {\n installCompressedModuleFactories(\n strictFactories,\n 0,\n moduleFactories,\n newModuleId\n )\n i++\n }\n while (i < chunkModules.length) {\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\n // Install the factory for each module ID that doesn't already have one.\n // When some IDs in this group already have a factory, reuse that existing\n // group factory for the missing IDs to keep all IDs in the group consistent.\n // Otherwise, install the factory from this chunk.\n const moduleFactoryFn = chunkModules[end] as Function\n let existingGroupFactory: Function | undefined = undefined\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n const existingFactory = moduleFactories.get(id)\n if (existingFactory) {\n existingGroupFactory = existingFactory\n break\n }\n }\n const factoryToInstall = existingGroupFactory ?? moduleFactoryFn\n\n let didInstallFactory = false\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n if (!moduleFactories.has(id)) {\n if (!didInstallFactory) {\n if (factoryToInstall === moduleFactoryFn) {\n applyModuleFactoryName(moduleFactoryFn)\n }\n didInstallFactory = true\n }\n moduleFactories.set(id, factoryToInstall)\n newModuleId?.(id)\n }\n }\n i = end + 1\n }\n}\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 * Constructs an error message for when a module factory is not available.\n */\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\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 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\n/**\n * Returns a `file://` URL under a synthetic directory named after `root`\n * (`ROOT` for the project root), for when the real filesystem path is unknown.\n * The root name and path segments are percent-encoded so the result is always\n * a valid file URI.\n */\nfunction placeholderFileUrl(modulePath: string, root?: string): string {\n return `file:///${encodeURIComponent(root ?? 'ROOT')}/${modulePath\n .split('/')\n .map(encodeURIComponent)\n .join('/')}`\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\n// Each runtime keeps its own public path. Other applications on the page may\n// change the global path after this runtime has started.\nlet runtimePublicPath: unknown =\n typeof globalThis !== 'undefined'\n ? (globalThis as any).publicPath\n : undefined\nObject.defineProperty(contextPrototype, 'runtimePublicPath', {\n get: () => runtimePublicPath,\n set: (value: unknown) => {\n runtimePublicPath = value\n },\n})\n\nlet cachedAutomaticPublicPath: string | undefined\n\nfunction getAutomaticPublicPath(): string {\n if (cachedAutomaticPublicPath !== undefined) {\n return cachedAutomaticPublicPath\n }\n\n let scriptUrl: string | undefined\n if (typeof document === 'object') {\n const currentScript = document.currentScript as HTMLScriptElement | null\n scriptUrl = currentScript?.src\n\n if (!scriptUrl) {\n const scripts = document.getElementsByTagName('script')\n const script = scripts[scripts.length - 1]\n scriptUrl = script?.src\n }\n }\n\n if (\n !scriptUrl &&\n typeof (globalThis as any).importScripts === 'function' &&\n (globalThis as any).location\n ) {\n scriptUrl = String((globalThis as any).location)\n }\n\n cachedAutomaticPublicPath = scriptUrl\n ? scriptUrl\n .replace(/^blob:/, '')\n .replace(/#.*$/, '')\n .replace(/\\?.*$/, '')\n .replace(/\\/[^/]*$/, '/')\n : ''\n\n return cachedAutomaticPublicPath\n}\n\n/**\n * Gets the public path for runtime assets.\n * Uses this runtime's public path and falls back to \"/\".\n */\nfunction getPublicPath(mode?: 'auto'): string {\n if (mode === 'auto') {\n return getAutomaticPublicPath()\n }\n\n if (typeof runtimePublicPath === 'string') {\n const publicPath = runtimePublicPath\n return publicPath.endsWith('/') ? publicPath : `${publicPath}/`\n }\n return '/'\n}\ncontextPrototype.p = getPublicPath\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":["SourceType","createModuleWithDirectionFlag","REEXPORTED_OBJECTS","WeakMap","Context","module","exports","m","e","contextPrototype","prototype","hasOwnProperty","Object","toStringTag","Symbol","defineProp","obj","name","options","call","defineProperty","getOverwrittenModule","moduleCache","id","get","undefined","createModuleWithDirection","createModuleObject","set","error","namespaceObject","parents","children","BindingTag_Value","REEXPORT_GROUP_END","esm","bindings","dynamic","value","i","length","propName","tagOrFunction","enumerable","writable","Error","getterFn","setterFn","seal","esmExport","c","s","esmReexport","list","head","start","end","namespace","esmImport","pairs","split","j","appendReexportBinding","S","exportedName","importedName","descriptor","Reflect","getOwnPropertyDescriptor","push","ensureDynamicExports","reexportedObjects","reexportOwning","prop","Proxy","target","deleteProperty","has","ownKeys","keys","key","includes","own","configurable","dynamicExport","object","exportValue","v","exportNamespace","n","createGetter","getProto","getPrototypeOf","__proto__","LEAF_PROTOTYPES","interopEsm","raw","ns","allowExportDefault","defaultLocation","current","getOwnPropertyNames","splice","createNS","args","apply","create","getOrInstantiateModuleFromParent","__esModule","asyncLoader","moduleId","loader","r","bind","A","runtimeRequire","require","require1","t","commonJsRequire","parseRequest","request","hashIndex","indexOf","substring","queryIndex","moduleContext","map","code","resolve","import","f","getChunkPath","chunkData","path","installCompressedModuleFactories","chunkModules","offset","moduleFactories","newModuleId","strictFactories","Array","isArray","moduleFactoryFn","existingGroupFactory","existingFactory","factoryToInstall","didInstallFactory","applyModuleFactoryName","relativeURL","inputUrl","realUrl","URL","values","href","pathname","replace","origin","protocol","toString","toJSON","_args","U","invariant","never","computeMessage","factoryNotAvailableMessage","sourceType","sourceData","instantiationReason","placeholderFileUrl","modulePath","root","encodeURIComponent","join","requireStub","_moduleId","z","g","globalThis","runtimePublicPath","publicPath","cachedAutomaticPublicPath","getAutomaticPublicPath","scriptUrl","document","currentScript","src","scripts","getElementsByTagName","script","importScripts","location","String","getPublicPath","mode","endsWith","p","factory"],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,0CAA0C;AAI1C;;;CAGC,GACD,IAAA,AAAKA,oCAAAA;IACH;;;;GAIC,sCACS;IACV;;;GAGC,qCACQ;IACT;;;;GAIC,qCACQ;WAjBNA;EAAAA;AA4BL;;;;;CAKC,GACD,IAAIC,gCAAgC;AAEpC,MAAMC,qBAAqB,IAAIC;AAE/B;;CAEC,GACD,SAASC,QAEPC,MAAc,EACdC,OAAgB;IAEhB,IAAI,CAACC,CAAC,GAAGF;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAACG,CAAC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ACH,aACD,OAAO,AAACL,WAAmBY,aAAa,KAAK,cAC7C,AAACZ,WAAmBa,QAAQ,EAC5B;QACAR,YAAYS,OAAO,AAACd,WAAmBa,QAAQ;IACjD;IAEAV,4BAA4BE,YACxBA,UACG5B,OAAO,CAAC,UAAU,IAClBA,OAAO,CAAC,QAAQ,IAChBA,OAAO,CAAC,SAAS,IACjBA,OAAO,CAAC,YAAY,OACvB;IAEJ,OAAO0B;AACT;AAEA;;;CAGC,GACD,SAASY,cAAcC,IAAa;IAClC,IAAIA,SAAS,QAAQ;QACnB,OAAOZ;IACT;IAEA,IAAI,OAAOH,sBAAsB,UAAU;QACzC,MAAMC,aAAaD;QACnB,OAAOC,WAAWe,QAAQ,CAAC,OAAOf,aAAa,GAAGA,WAAW,CAAC,CAAC;IACjE;IACA,OAAO;AACT;AACA5K,iBAAiB4L,CAAC,GAAGH;AAMrB,SAAS9C,uBAAuBkD,OAAiB;IAC/C,+DAA+D;IAC/D1L,OAAOQ,cAAc,CAACkL,SAAS,QAAQ;QACrChK,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 715, "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 *browser* 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 suffix\ndeclare var TURBOPACK_ASSET_SUFFIX: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it\n// can't be detected via `document.currentScript`. Note it's stored in reversed\n// order to use `push` and `pop`\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n// Used in WebWorkers to override the regular chunk base path with the base\n// used for the worker entrypoint and its initial chunks.\ndeclare var TURBOPACK_CHUNK_BASE_PATH: string | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var ASSET_SUFFIX: string\ndeclare var CROSS_ORIGIN: 'anonymous' | 'use-credentials' | null\ndeclare var CHUNK_LOAD_RETRY_MAX_ATTEMPTS: number\ndeclare var CHUNK_LOAD_RETRY_BASE_DELAY_MS: number\ndeclare var CHUNK_LOAD_RETRY_MAX_JITTER_MS: number\ndeclare const SUPPORT_COMPONENT_CHUNKS: boolean\n\n// Support runtime public path modes.\nfunction getRuntimeChunkBasePath(basePath: string = CHUNK_BASE_PATH): string {\n if (basePath === '__RUNTIME_PUBLIC_PATH__') {\n return contextPrototype.p()\n }\n if (basePath === '__AUTO_PUBLIC_PATH__') {\n return contextPrototype.p('auto')\n }\n return basePath\n}\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\nconst RUNTIME_CHUNK_BASE_PATH =\n typeof TURBOPACK_CHUNK_BASE_PATH === 'string'\n ? TURBOPACK_CHUNK_BASE_PATH\n : CHUNK_BASE_PATH\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 ChunkRegistrationChunk =\n | ChunkPath\n | { getAttribute: (name: string) => string | null }\n | undefined\n\ntype ChunkRegistration = [\n chunkPath: ChunkRegistrationChunk,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkRegistrationChunk\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\ninterface RuntimeBackend {\n /**\n * Registers a chunk. `chunk` is `undefined` for an inlined entry-only registration\n * (no source chunk): the params' other chunks are loaded and its runtime modules run\n * with no self chunk identity.\n */\n registerChunk: (\n chunk: ChunkPath | ChunkScript | undefined,\n params?: RuntimeParams\n ) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => 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\n// Registry mapping a merged chunk's path to its constituent component chunk paths.\nconst chunkComponents: Map = new Map()\n\n// Registry mapping a component chunk's path to its size in bytes, used by the\n// split-vs-whole cost heuristic.\nconst componentChunkSizes: Map = new Map()\n\nfunction registerComponentChunkSizes(\n componentChunks: ChunkPath[],\n sizes: number[]\n): void {\n for (let i = 0; i < componentChunks.length; i++) {\n const size = sizes[i]\n if (size !== undefined) {\n componentChunkSizes.set(componentChunks[i], size)\n }\n }\n}\n\ntype ChunkUrlOrMerged = ChunkUrl | [ChunkUrl, ChunkPath[], number[]]\n\n// Memoizes the composite promise returned for a merged chunk loaded by URL, keyed by URL.\nconst splitChunkPromises: Map> = new Map()\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\n// `chunkPath` is the source chunk; it is `undefined` for entry-only registrations,\n// which have no self chunk.\nfunction loadInitialChunk(\n chunkPath: ChunkPath | undefined,\n chunkData: ChunkData\n) {\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 let promise: Promise\n if (SUPPORT_COMPONENT_CHUNKS) {\n const componentChunks = chunkData.moduleChunks || []\n // We already have this chunk's component list inline (chunkData.moduleChunks) and split on it\n // here, so the whole-chunk fallback uses loadChunkByUrlWhole to skip loadChunkByUrlInternal's\n // chunkComponents-registry lookup, which would just repeat the same split decision.\n promise = loadComponentChunksOrWhole(\n sourceType,\n sourceData,\n componentChunks,\n getChunkRelativeUrl(chunkData.path)\n )\n } else {\n promise = loadChunkByUrlWhole(\n sourceType,\n sourceData,\n getChunkRelativeUrl(chunkData.path)\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\n/**\n * Approximate cost of an extra HTTP request, expressed in emitted (minified, uncompressed) chunk\n * bytes, used to decide whether splitting a merged chunk into individually-cached component\n * chunks is worthwhile.\n */\nconst REQUEST_COST_BYTES = 20_000\n\n/**\n * Decides whether to load a merged chunk's component chunks individually instead of the whole\n * merged chunk, weighing the bytes saved (the available components we avoid re-downloading)\n * against the extra network requests splitting incurs.\n *\n * Splitting issues one request per unavailable component vs. a single request for the merged\n * chunk, so it adds `unavailableCount - 1` extra requests. When at most one component needs the\n * network, splitting never costs more requests than the merged load (and transfers fewer bytes),\n * so it always wins. Otherwise it's only worth it when the available bytes exceed the extra\n * request cost.\n */\nfunction shouldLoadComponentChunks(\n availableBytes: number,\n unavailableCount: number\n): boolean {\n if (unavailableCount <= 1) {\n return true\n }\n return availableBytes > REQUEST_COST_BYTES * (unavailableCount - 1)\n}\n\n/**\n * Loads a chunk's component chunks individually when enough of them are already available\n * in memory (avoiding re-downloading the ones we have, per `shouldLoadComponentChunks`),\n * otherwise loads the whole chunk from `chunkUrl` and records its component chunks as available.\n */\nfunction loadComponentChunksOrWhole(\n sourceType: SourceType,\n sourceData: SourceData,\n componentChunks: ChunkPath[],\n chunkUrl: ChunkUrl\n): Promise {\n const componentChunkPromises: Array | true> = []\n let availableBytes = 0\n let unavailableCount = 0\n for (const componentChunk of componentChunks) {\n const available = availableModuleChunks.get(componentChunk)\n if (available) {\n componentChunkPromises.push(available)\n availableBytes += componentChunkSizes.get(componentChunk) ?? 0\n } else {\n unavailableCount++\n }\n }\n\n if (\n componentChunkPromises.length > 0 &&\n shouldLoadComponentChunks(availableBytes, unavailableCount)\n ) {\n // Enough component chunks are already loaded or loading that splitting saves more\n // bytes than the extra requests cost.\n for (const componentChunk of componentChunks) {\n if (!availableModuleChunks.has(componentChunk)) {\n const promise = loadChunkPath(sourceType, sourceData, componentChunk)\n availableModuleChunks.set(componentChunk, promise)\n componentChunkPromises.push(promise)\n }\n }\n return Promise.all(componentChunkPromises)\n }\n\n // Not enough is available in memory for splitting to pay off. Load the\n // whole chunk in a single request and record its component chunks as available.\n const promise = loadChunkByUrlWhole(sourceType, sourceData, chunkUrl)\n for (const componentChunk of componentChunks) {\n if (!availableModuleChunks.has(componentChunk)) {\n availableModuleChunks.set(componentChunk, promise)\n }\n }\n return 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 chunkEntry: ChunkUrlOrMerged\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkEntry)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\nconst loadedScripts = new Map>()\n\n/**\n * Load an external script by creating a