1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="737537bd-e9b6-eaa2-d2b1-793e0949018e")}catch(e){}}(); 2(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([ 3 typeof document === "object" ? document.currentScript : undefined, 4 {"otherChunks":["static/chunks/3z5vx4lmv5g3z.js","static/chunks/30nohlr7z8isc.js","static/chunks/3akjwd0heotan.js","static/chunks/27m1314j3xp61.js","static/chunks/0znrbml2d2tku.js","static/chunks/1sij271v10ckb.js","static/chunks/1isvqvyi1b7tp.js","static/chunks/2qmetde-e3ape.js"],"runtimeModuleIds":[494553]} 5]); 6(() => { 7if (!Array.isArray(globalThis["TURBOPACK"])) { 8 return; 9} 10 11const CHUNK_BASE_PATH = "/_next/"; 12const RELATIVE_ROOT_PATH = "/ROOT"; 13const RUNTIME_PUBLIC_PATH = "/_next/"; 14const ASSET_SUFFIX = getAssetSuffixFromScriptSrc(); 15const WORKER_FORWARDED_GLOBALS = ["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"]; 16/** 17 * This file contains runtime types and functions that are shared between all 18 * TurboPack ECMAScript runtimes. 19 * 20 * It will be prepended to the runtime code of each runtime. 21 */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" /> 22/** 23 * Describes why a module was instantiated. 24 * Shared between browser and Node.js runtimes. 25 */ var SourceType = /*#__PURE__*/ function(SourceType) { 26 /** 27 * The module was instantiated because it was included in an evaluated chunk's 28 * runtime. 29 * SourceData is a ChunkPath. 30 */ SourceType[SourceType["Runtime"] = 0] = "Runtime"; 31 /** 32 * The module was instantiated because a parent module imported it. 33 * SourceData is a ModuleId. 34 */ SourceType[SourceType["Parent"] = 1] = "Parent"; 35 /** 36 * The module was instantiated because it was included in a chunk's hot module 37 * update. 38 * SourceData is an array of ModuleIds or undefined. 39 */ SourceType[SourceType["Update"] = 2] = "Update"; 40 return SourceType; 41}(SourceType || {}); 42/** 43 * Flag indicating which module object type to create when a module is merged. Set to `true` 44 * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts, 45 * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it 46 * uses plain Module objects. 47 */ let createModuleWithDirectionFlag = false; 48const REEXPORTED_OBJECTS = new WeakMap(); 49/** 50 * Constructs the `__turbopack_context__` object for a module. 51 */ function Context(module, exports) { 52 this.m = module; 53 // We need to store this here instead of accessing it from the module object to: 54 // 1. Make it available to factories directly, since we rewrite `this` to 55 // `__turbopack_context__.e` in CJS modules. 56 // 2. Support async modules which rewrite `module.exports` to a promise, so we 57 // can still access the original exports object from functions like 58 // `esmExport` 59 // Ideally we could find a new approach for async modules and drop this property altogether. 60 this.e = exports; 61} 62const contextPrototype = Context.prototype; 63const hasOwnProperty = Object.prototype.hasOwnProperty; 64const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag; 65function defineProp(obj, name, options) { 66 if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options); 67} 68function getOverwrittenModule(moduleCache, id) { 69 let module = moduleCache[id]; 70 if (!module) { 71 if (createModuleWithDirectionFlag) { 72 // set in development modes for hmr support 73 module = createModuleWithDirection(id); 74 } else { 75 module = createModuleObject(id); 76 } 77 moduleCache[id] = module; 78 } 79 return module; 80} 81/** 82 * Creates the module object. Only done here to ensure all module objects have the same shape. 83 */ function createModuleObject(id) { 84 return { 85 exports: {}, 86 error: undefined, 87 id, 88 namespaceObject: undefined 89 }; 90} 91function createModuleWithDirection(id) { 92 return { 93 exports: {}, 94 error: undefined, 95 id, 96 namespaceObject: undefined, 97 parents: [], 98 children: [] 99 }; 100} 101const BindingTag_Value = 0; 102/** 103 * Adds the getters to the exports object. 104 */ function esm(exports, bindings) { 105 defineProp(exports, '__esModule', { 106 value: true 107 }); 108 if (toStringTag) defineProp(exports, toStringTag, { 109 value: 'Module' 110 }); 111 let i = 0; 112 while(i < bindings.length){ 113 const propName = bindings[i++]; 114 const tagOrFunction = bindings[i++]; 115 if (typeof tagOrFunction === 'number') { 116 if (tagOrFunction === BindingTag_Value) { 117 defineProp(exports, propName, { 118 value: bindings[i++], 119 enumerable: true, 120 writable: false 121 }); 122 } else { 123 throw new Error("unexpected tag: ".concat(tagOrFunction)); 124 } 125 } else { 126 const getterFn = tagOrFunction; 127 if (typeof bindings[i] === 'function') { 128 const setterFn = bindings[i++]; 129 defineProp(exports, propName, { 130 get: getterFn, 131 set: setterFn, 132 enumerable: true 133 }); 134 } else { 135 defineProp(exports, propName, { 136 get: getterFn, 137 enumerable: true 138 }); 139 } 140 } 141 } 142 Object.seal(exports); 143} 144/** 145 * Makes the module an ESM with exports 146 */ function esmExport(bindings, id) { 147 let module; 148 let exports; 149 if (id != null) { 150 module = getOverwrittenModule(this.c, id); 151 exports = module.exports; 152 } else { 153 module = this.m; 154 exports = this.e; 155 } 156 module.namespaceObject = exports; 157 esm(exports, bindings); 158} 159contextPrototype.s = esmExport;
160function ensureDynamicExports(module, exports) { 161 let reexportedObjects = REEXPORTED_OBJECTS.get(module); 162 if (!reexportedObjects) { 163 REEXPORTED_OBJECTS.set(module, reexportedObjects = []); 164 module.exports = module.namespaceObject = new Proxy(exports, { 165 get (target, prop) { 166 if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') { 167 return Reflect.get(target, prop); 168 } 169 for (const obj of reexportedObjects){ 170 const value = Reflect.get(obj, prop); 171 if (value !== undefined) return value; 172 } 173 return undefined; 174 }, 175 ownKeys (target) { 176 const keys = Reflect.ownKeys(target); 177 for (const obj of reexportedObjects){ 178 for (const key of Reflect.ownKeys(obj)){ 179 if (key !== 'default' && !keys.includes(key)) keys.push(key); 180 } 181 } 182 return keys; 183 } 184 }); 185 } 186 return reexportedObjects; 187} 188/** 189 * Dynamically exports properties from an object 190 */ function dynamicExport(object, id) { 191 let module; 192 let exports; 193 if (id != null) { 194 module = getOverwrittenModule(this.c, id); 195 exports = module.exports; 196 } else { 197 module = this.m; 198 exports = this.e; 199 } 200 const reexportedObjects = ensureDynamicExports(module, exports); 201 if (typeof object === 'object' && object !== null) { 202 reexportedObjects.push(object); 203 } 204} 205contextPrototype.j = dynamicExport; 206function exportValue(value, id) { 207 let module; 208 if (id != null) { 209 module = getOverwrittenModule(this.c, id); 210 } else { 211 module = this.m; 212 } 213 module.exports = value; 214} 215contextPrototype.v = exportValue; 216function exportNamespace(namespace, id) { 217 let module; 218 if (id != null) { 219 module = getOverwrittenModule(this.c, id); 220 } else { 221 module = this.m; 222 } 223 module.exports = module.namespaceObject = namespace; 224} 225contextPrototype.n = exportNamespace; 226function createGetter(obj, key) { 227 return ()=>obj[key]; 228} 229/** 230 * @returns prototype of the object 231 */ const getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__; 232/** Prototypes that are not expanded for exports */ const LEAF_PROTOTYPES = [ 233 null, 234 getProto({}), 235 getProto([]), 236 getProto(getProto) 237]; 238/** 239 * @param raw 240 * @param ns 241 * @param allowExportDefault 242 * * `false`: will have the raw module as default export 243 * * `true`: will have the default property as default export 244 */ function interopEsm(raw, ns, allowExportDefault) { 245 const bindings = []; 246 let defaultLocation = -1; 247 for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){ 248 for (const key of Object.getOwnPropertyNames(current)){ 249 bindings.push(key, createGetter(raw, key)); 250 if (defaultLocation === -1 && key === 'default') { 251 defaultLocation = bindings.length - 1; 252 } 253 } 254 } 255 // this is not really correct 256 // we should set the `default` getter if the imported module is a `.cjs file` 257 if (!(allowExportDefault && defaultLocation >= 0)) { 258 // Replace the binding with one for the namespace itself in order to preserve iteration order. 259 if (defaultLocation >= 0) { 260 // Replace the getter with the value 261 bindings.splice(defaultLocation, 1, BindingTag_Value, raw); 262 } else { 263 bindings.push('default', BindingTag_Value, raw); 264 } 265 } 266 esm(ns, bindings); 267 return ns; 268} 269function createNS(raw) { 270 if (typeof raw === 'function') { 271 return function() { 272 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 273 args[_key] = arguments[_key]; 274 } 275 return raw.apply(this, args); 276 }; 277 } else { 278 return Object.create(null); 279 } 280} 281function esmImport(id) { 282 const module = getOrInstantiateModuleFromParent(id, this.m); 283 // any ES module has to have `module.namespaceObject` defined. 284 if (module.namespaceObject) return module.namespaceObject; 285 // only ESM can be an async module, so we don't need to worry about exports being a promise here. 286 const raw = module.exports; 287 return module.namespaceObject = interopEsm(raw, createNS(raw), raw && raw.__esModule); 288} 289contextPrototype.i = esmImport; 290function asyncLoader(moduleId) { 291 const loader = this.r(moduleId); 292 return loader(esmImport.bind(this)); 293} 294contextPrototype.A = asyncLoader; 295// Add a simple runtime require so that environments without one can still pass 296// `typeof require` CommonJS checks so that exports are correctly registered. 297const runtimeRequire = // @ts-ignore 298typeof require === 'function' ? require : function require1() { 299 throw new Error('Unexpected use of runtime require'); 300}; 301contextPrototype.t = runtimeRequire; 302function commonJsRequire(id) { 303 return getOrInstantiateModuleFromParent(id, this.m).exports; 304} 305contextPrototype.r = commonJsRequire; 306/** 307 * Remove fragments and query parameters since they are never part of the context map keys 308 * 309 * This matches how we parse patterns at resolving time. Arguably we should only do this for 310 * strings passed to `import` but the resolve does it for `import` and `require` and so we do 311 * here as well.
312 */ function parseRequest(request) { 313 // Per the URI spec fragments can contain `?` characters, so we should trim it off first 314 // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 315 const hashIndex = request.indexOf('#'); 316 if (hashIndex !== -1) { 317 request = request.substring(0, hashIndex); 318 } 319 const queryIndex = request.indexOf('?'); 320 if (queryIndex !== -1) { 321 request = request.substring(0, queryIndex); 322 } 323 return request; 324} 325/** 326 * `require.context` and require/import expression runtime. 327 */ function moduleContext(map) { 328 function moduleContext(id) { 329 id = parseRequest(id); 330 if (hasOwnProperty.call(map, id)) { 331 return map[id].module(); 332 } 333 const e = new Error("Cannot find module '".concat(id, "'")); 334 e.code = 'MODULE_NOT_FOUND'; 335 throw e; 336 } 337 moduleContext.keys = ()=>{ 338 return Object.keys(map); 339 }; 340 moduleContext.resolve = (id)=>{ 341 id = parseRequest(id); 342 if (hasOwnProperty.call(map, id)) { 343 return map[id].id(); 344 } 345 const e = new Error("Cannot find module '".concat(id, "'")); 346 e.code = 'MODULE_NOT_FOUND'; 347 throw e; 348 }; 349 moduleContext.import = async (id)=>{ 350 return await moduleContext(id); 351 }; 352 return moduleContext; 353} 354contextPrototype.f = moduleContext; 355/** 356 * Returns the path of a chunk defined by its data. 357 */ function getChunkPath(chunkData) { 358 return typeof chunkData === 'string' ? chunkData : chunkData.path; 359} 360function isPromise(maybePromise) { 361 return maybePromise != null && typeof maybePromise === 'object' && 'then' in maybePromise && typeof maybePromise.then === 'function'; 362} 363function isAsyncModuleExt(obj) { 364 return turbopackQueues in obj; 365} 366function createPromise() { 367 let resolve; 368 let reject; 369 const promise = new Promise((res, rej)=>{ 370 reject = rej; 371 resolve = res; 372 }); 373 return { 374 promise, 375 resolve: resolve, 376 reject: reject 377 }; 378} 379// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. 380// The CompressedModuleFactories format is 381// - 1 or more module ids 382// - a module factory function 383// So walking this is a little complex but the flat structure is also fast to 384// traverse, we can use `typeof` operators to distinguish the two cases. 385function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { 386 let i = offset; 387 while(i < chunkModules.length){ 388 let end = i + 1; 389 // Find our factory function 390 while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){ 391 end++; 392 } 393 if (end === chunkModules.length) { 394 throw new Error('malformed chunk format, expected a factory function'); 395 } 396 // Install the factory for each module ID that doesn't already have one. 397 // When some IDs in this group already have a factory, reuse that existing 398 // group factory for the missing IDs to keep all IDs in the group consistent. 399 // Otherwise, install the factory from this chunk. 400 const moduleFactoryFn = chunkModules[end]; 401 let existingGroupFactory = undefined; 402 for(let j = i; j < end; j++){ 403 const id = chunkModules[j]; 404 const existingFactory = moduleFactories.get(id); 405 if (existingFactory) { 406 existingGroupFactory = existingFactory; 407 break; 408 } 409 } 410 const factoryToInstall = existingGroupFactory !== null && existingGroupFactory !== void 0 ? existingGroupFactory : moduleFactoryFn; 411 let didInstallFactory = false; 412 for(let j = i; j < end; j++){ 413 const id = chunkModules[j]; 414 if (!moduleFactories.has(id)) { 415 if (!didInstallFactory) { 416 if (factoryToInstall === moduleFactoryFn) { 417 applyModuleFactoryName(moduleFactoryFn); 418 } 419 didInstallFactory = true; 420 } 421 moduleFactories.set(id, factoryToInstall); 422 newModuleId === null || newModuleId === void 0 ? void 0 : newModuleId(id); 423 } 424 } 425 i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. 426 } 427} 428// everything below is adapted from webpack 429// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13 430const turbopackQueues = Symbol('turbopack queues'); 431const turbopackExports = Symbol('turbopack exports'); 432const turbopackError = Symbol('turbopack error'); 433function resolveQueue(queue) { 434 if (queue && queue.status !== 1) { 435 queue.status = 1; 436 queue.forEach((fn)=>fn.queueCount--); 437 queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn()); 438 } 439} 440function wrapDeps(deps) { 441 return deps.map((dep)=>{ 442 if (dep !== null && typeof dep === 'object') { 443 if (isAsyncModuleExt(dep)) return dep;
444 if (isPromise(dep)) { 445 const queue = Object.assign([], { 446 status: 0 447 }); 448 const obj = { 449 [turbopackExports]: {}, 450 [turbopackQueues]: (fn)=>fn(queue) 451 }; 452 dep.then((res)=>{ 453 obj[turbopackExports] = res; 454 resolveQueue(queue); 455 }, (err)=>{ 456 obj[turbopackError] = err; 457 resolveQueue(queue); 458 }); 459 return obj; 460 } 461 } 462 return { 463 [turbopackExports]: dep, 464 [turbopackQueues]: ()=>{} 465 }; 466 }); 467} 468function asyncModule(body, hasAwait) { 469 const module = this.m; 470 const queue = hasAwait ? Object.assign([], { 471 status: -1 472 }) : undefined; 473 const depQueues = new Set(); 474 const { resolve, reject, promise: rawPromise } = createPromise(); 475 const promise = Object.assign(rawPromise, { 476 [turbopackExports]: module.exports, 477 [turbopackQueues]: (fn)=>{ 478 queue && fn(queue); 479 depQueues.forEach(fn); 480 promise['catch'](()=>{}); 481 } 482 }); 483 const attributes = { 484 get () { 485 return promise; 486 }, 487 set (v) { 488 // Calling `esmExport` leads to this. 489 if (v !== promise) { 490 promise[turbopackExports] = v; 491 } 492 } 493 }; 494 Object.defineProperty(module, 'exports', attributes);
495 Object.defineProperty(module, 'namespaceObject', attributes); 496 function handleAsyncDependencies(deps) { 497 const currentDeps = wrapDeps(deps); 498 const getResult = ()=>currentDeps.map((d)=>{ 499 if (d[turbopackError]) throw d[turbopackError]; 500 return d[turbopackExports]; 501 }); 502 const { promise, resolve } = createPromise(); 503 const fn = Object.assign(()=>resolve(getResult), { 504 queueCount: 0 505 }); 506 function fnQueue(q) { 507 if (q !== queue && !depQueues.has(q)) { 508 depQueues.add(q); 509 if (q && q.status === 0) { 510 fn.queueCount++; 511 q.push(fn); 512 } 513 } 514 } 515 currentDeps.map((dep)=>dep[turbopackQueues](fnQueue)); 516 return fn.queueCount ? promise : getResult(); 517 } 518 function asyncResult(err) { 519 if (err) { 520 reject(promise[turbopackError] = err); 521 } else { 522 resolve(promise[turbopackExports]); 523 } 524 resolveQueue(queue); 525 } 526 body(handleAsyncDependencies, asyncResult); 527 if (queue && queue.status === -1) { 528 queue.status = 0; 529 } 530} 531contextPrototype.a = asyncModule; 532/** 533 * A pseudo "fake" URL object to resolve to its relative path. 534 * 535 * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this 536 * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid 537 * hydration mismatch. 538 * 539 * This is based on webpack's existing implementation: 540 * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js 541 */ const relativeURL = function relativeURL(inputUrl) { 542 const realUrl = new URL(inputUrl, 'x:/'); 543 const values = {}; 544 for(const key in realUrl)values[key] = realUrl[key]; 545 values.href = inputUrl; 546 values.pathname = inputUrl.replace(/[?#].*/, ''); 547 values.origin = values.protocol = ''; 548 values.toString = values.toJSON = function() { 549 for(var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++){ 550 _args[_key] = arguments[_key]; 551 } 552 return inputUrl; 553 }; 554 for(const key in values)Object.defineProperty(this, key, { 555 enumerable: true, 556 configurable: true, 557 value: values[key] 558 }); 559}; 560relativeURL.prototype = URL.prototype; 561contextPrototype.U = relativeURL; 562/** 563 * Utility function to ensure all variants of an enum are handled. 564 */ function invariant(never, computeMessage) { 565 throw new Error("Invariant: ".concat(computeMessage(never))); 566} 567/** 568 * Constructs an error message for when a module factory is not available. 569 */ function factoryNotAvailableMessage(moduleId, sourceType, sourceData) { 570 let instantiationReason; 571 switch(sourceType){ 572 case 0: 573 instantiationReason = "as a runtime entry of chunk ".concat(sourceData); 574 break; 575 case 1: 576 instantiationReason = "because it was required from module ".concat(sourceData); 577 break; 578 case 2: 579 instantiationReason = 'because of an HMR update'; 580 break; 581 default: 582 invariant(sourceType, (sourceType)=>"Unknown source type: ".concat(sourceType)); 583 } 584 return "Module ".concat(moduleId, " was instantiated ").concat(instantiationReason, ", but the module factory is not available."); 585} 586/** 587 * A stub function to make `require` available but non-functional in ESM. 588 */ function requireStub(_moduleId) { 589 throw new Error('dynamic usage of require is not supported'); 590} 591contextPrototype.z = requireStub; 592// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable. 593contextPrototype.g = globalThis; 594function applyModuleFactoryName(factory) { 595 // Give the module factory a nice name to improve stack traces. 596 Object.defineProperty(factory, 'name', { 597 value: 'module evaluation' 598 }); 599} 600/** 601 * This file contains runtime types and functions that are shared between all 602 * Turbopack *browser* ECMAScript runtimes. 603 * 604 * It will be appended to the runtime code of each runtime right after the 605 * shared runtime utils. 606 */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> 607/// <reference path="../../../shared/runtime/runtime-utils.ts" /> 608// Used in WebWorkers to tell the runtime about the chunk suffix 609const browserContextPrototype = Context.prototype; 610const moduleFactories = new Map(); 611contextPrototype.M = moduleFactories; 612const availableModules = new Map(); 613const availableModuleChunks = new Map(); 614function loadChunk(chunkData) { 615 return loadChunkInternal(SourceType.Parent, this.m.id, chunkData); 616} 617browserContextPrototype.l = loadChunk; 618function loadInitialChunk(chunkPath, chunkData) { 619 return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData); 620} 621async function loadChunkInternal(sourceType, sourceData, chunkData) { 622 if (typeof chunkData === 'string') { 623 return loadChunkPath(sourceType, sourceData, chunkData); 624 } 625 const includedList = chunkData.included || []; 626 const modulesPromises = includedList.map((included)=>{ 627 if (moduleFactories.has(included)) return true; 628 return availableModules.get(included); 629 }); 630 if (modulesPromises.length > 0 && modulesPromises.every((p)=>p)) { 631 // When all included items are already loaded or loading, we can skip loading ourselves 632 await Promise.all(modulesPromises); 633 return; 634 } 635 const includedModuleChunksList = chunkData.moduleChunks || [];
636 const moduleChunksPromises = includedModuleChunksList.map((included)=>{ 637 // TODO(alexkirsz) Do we need this check? 638 // if (moduleFactories[included]) return true; 639 return availableModuleChunks.get(included); 640 }).filter((p)=>p); 641 let promise; 642 if (moduleChunksPromises.length > 0) { 643 // Some module chunks are already loaded or loading. 644 if (moduleChunksPromises.length === includedModuleChunksList.length) { 645 // When all included module chunks are already loaded or loading, we can skip loading ourselves 646 await Promise.all(moduleChunksPromises); 647 return; 648 } 649 const moduleChunksToLoad = new Set(); 650 for (const moduleChunk of includedModuleChunksList){ 651 if (!availableModuleChunks.has(moduleChunk)) { 652 moduleChunksToLoad.add(moduleChunk); 653 } 654 } 655 for (const moduleChunkToLoad of moduleChunksToLoad){ 656 const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad); 657 availableModuleChunks.set(moduleChunkToLoad, promise); 658 moduleChunksPromises.push(promise); 659 } 660 promise = Promise.all(moduleChunksPromises); 661 } else { 662 promise = loadChunkPath(sourceType, sourceData, chunkData.path); 663 // Mark all included module chunks as loading if they are not already loaded or loading. 664 for (const includedModuleChunk of includedModuleChunksList){ 665 if (!availableModuleChunks.has(includedModuleChunk)) { 666 availableModuleChunks.set(includedModuleChunk, promise); 667 } 668 } 669 } 670 for (const included of includedList){ 671 if (!availableModules.has(included)) { 672 // 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. 673 // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway. 674 availableModules.set(included, promise); 675 } 676 } 677 await promise; 678} 679const loadedChunk = Promise.resolve(undefined); 680const instrumentedBackendLoadChunks = new WeakMap(); 681// Do not make this async. React relies on referential equality of the returned Promise. 682function loadChunkByUrl(chunkUrl) { 683 return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl); 684} 685browserContextPrototype.L = loadChunkByUrl; 686// Do not make this async. React relies on referential equality of the returned Promise. 687function loadChunkByUrlInternal(sourceType, sourceData, chunkUrl) { 688 const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl); 689 let entry = instrumentedBackendLoadChunks.get(thenable); 690 if (entry === undefined) { 691 const resolve = instrumentedBackendLoadChunks.set.bind(instrumentedBackendLoadChunks, thenable, loadedChunk); 692 entry = thenable.then(resolve).catch((cause)=>{ 693 let loadReason; 694 switch(sourceType){ 695 case SourceType.Runtime: 696 loadReason = "as a runtime dependency of chunk ".concat(sourceData); 697 break; 698 case SourceType.Parent: 699 loadReason = "from module ".concat(sourceData); 700 break; 701 case SourceType.Update: 702 loadReason = 'from an HMR update'; 703 break; 704 default: 705 invariant(sourceType, (sourceType)=>"Unknown source type: ".concat(sourceType)); 706 } 707 let error = new Error("Failed to load chunk ".concat(chunkUrl, " ").concat(loadReason).concat(cause ? ": ".concat(cause) : ''), cause ? { 708 cause 709 } : undefined); 710 error.name = 'ChunkLoadError'; 711 throw error; 712 }); 713 instrumentedBackendLoadChunks.set(thenable, entry); 714 } 715 return entry; 716} 717// Do not make this async. React relies on referential equality of the returned Promise. 718function loadChunkPath(sourceType, sourceData, chunkPath) { 719 const url = getChunkRelativeUrl(chunkPath); 720 return loadChunkByUrlInternal(sourceType, sourceData, url); 721} 722/** 723 * Returns an absolute url to an asset. 724 */ function resolvePathFromModule(moduleId) { 725 var _ref; 726 const exported = this.r(moduleId); 727 return (_ref = exported === null || exported === void 0 ? void 0 : exp
727orted.default) !== null && _ref !== void 0 ? _ref : exported; 728} 729browserContextPrototype.R = resolvePathFromModule; 730/** 731 * no-op for browser 732 * @param modulePath 733 */ function resolveAbsolutePath(modulePath) { 734 return "/ROOT/".concat(modulePath !== null && modulePath !== void 0 ? modulePath : ''); 735} 736browserContextPrototype.P = resolveAbsolutePath; 737/** 738 * Exports a URL with the static suffix appended. 739 */ function exportUrl(url, id) { 740 exportValue.call(this, "".concat(url).concat(ASSET_SUFFIX), id); 741} 742browserContextPrototype.q = exportUrl; 743/** 744 * Creates a worker by instantiating the given WorkerConstructor with the 745 * appropriate URL and options. 746 * 747 * The entrypoint is a pre-compiled worker runtime file. The params configure 748 * which module chunks to load and which module to run as the entry point. 749 * 750 * The params are a JSON array of the following structure: 751 * `[TURBOPACK_NEXT_CHUNK_URLS, ASSET_SUFFIX, ...WORKER_FORWARDED_GLOBALS values]` 752 * 753 * @param WorkerConstructor The Worker or SharedWorker constructor 754 * @param entrypoint URL path to the worker entrypoint chunk 755 * @param moduleChunks list of module chunk paths to load 756 * @param workerOptions options to pass to the Worker constructor (optional) 757 */ function createWorker(WorkerConstructor, entrypoint, moduleChunks, workerOptions) { 758 const isSharedWorker = WorkerConstructor.name === 'SharedWorker'; 759 const chunkUrls = moduleChunks.map((chunk)=>getChunkRelativeUrl(chunk)).reverse(); 760 const params = [ 761 chunkUrls, 762 ASSET_SUFFIX 763 ]; 764 for (const globalName of WORKER_FORWARDED_GLOBALS){ 765 params.push(globalThis[globalName]); 766 } 767 const url = new URL(getChunkRelativeUrl(entrypoint), location.origin); 768 const paramsJson = JSON.stringify(params); 769 if (isSharedWorker) { 770 url.searchParams.set('params', paramsJson); 771 } else { 772 url.hash = '#params=' + encodeURIComponent(paramsJson); 773 } 774 // Remove type: "module" from options since our worker entrypoint is not a module 775 const options = workerOptions ? { 776 ...workerOptions, 777 type: undefined 778 } : undefined; 779 return new WorkerConstructor(url, options); 780} 781browserContextPrototype.b = createWorker; 782/** 783 * Instantiates a runtime module. 784 */ function instantiateRuntimeModule(moduleId, chunkPath) { 785 return instantiateModule(moduleId, SourceType.Runtime, chunkPath); 786} 787/** 788 * Returns the URL relative to the origin where a chunk can be fetched from. 789 */ function getChunkRelativeUrl(chunkPath) { 790 return "".concat(CHUNK_BASE_PATH).concat(chunkPath.split('/').map((p)=>encodeURIComponent(p)).join('/')).concat(ASSET_SUFFIX); 791} 792function getPathFromScript(chunkScript) { 793 if (typeof chunkScript === 'string') { 794 return chunkScript; 795 } 796 const chunkUrl = chunkScript.src; 797 const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, '')); 798 const path = src.startsWith(CHUNK_BASE_PATH) ? src.slice(CHUNK_BASE_PATH.length) : src; 799 return path; 800} 801/** 802 * Return the ChunkUrl from a ChunkScript. 803 */ function getUrlFromScript(chunk) { 804 if (typeof chunk === 'string') { 805 return getChunkRelativeUrl(chunk); 806 } else { 807 // This is already exactly what we want 808 return chunk.src; 809 } 810} 811/** 812 * Determine the chunk to register. Note that this function has side-effects! 813 */ function getChunkFromRegistration(chunk) { 814 if (typeof chunk === 'string') { 815 return chunk; 816 } else if (!chunk) { 817 if (typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined') { 818 return { 819 src: TURBOPACK_NEXT_CHUNK_URLS.pop() 820 }; 821 } else { 822 throw new Error('chunk path empty but not in a worker'); 823 } 824 } else { 825 return { 826 src: chunk.getAttribute('src') 827 }; 828 } 829} 830const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/; 831/** 832 * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment. 833 */ function isJs(chunkUrlOrPath) { 834 return regexJsUrl.test(chunkUrlOrPath); 835} 836const regexCssUrl = /\.css(?:\?[^#]*)?(?:#.*)?$/; 837/** 838 * Checks if a given path/URL ends with .css, optionally followed by ?query or #fragment. 839 */ function isCss(chunkUrl) { 840 return regexCssUrl.test(chunkUrl); 841} 842function loadWebAssembly(chunkPath, edgeModule, importsObj) { 843 return BACKEND.loadWebAssembly(SourceType.Parent, this.m.id, chunkPath, edgeModule, importsObj); 844} 845contextPrototype.w = loadWebAssembly;
846function loadWebAssemblyModule(chunkPath, edgeModule) { 847 return BACKEND.loadWebAssemblyModule(SourceType.Parent, this.m.id, chunkPath, edgeModule); 848} 849contextPrototype.u = loadWebAssemblyModule; 850/// <reference path="./runtime-base.ts" /> 851/// <reference path="./dummy.ts" /> 852const moduleCache = {}; 853contextPrototype.c = moduleCache; 854/** 855 * Gets or instantiates a runtime module. 856 */ // @ts-ignore 857// eslint-disable-next-line @typescript-eslint/no-unused-vars 858function getOrInstantiateRuntimeModule(chunkPath, moduleId) { 859 const module = moduleCache[moduleId]; 860 if (module) { 861 if (module.error) { 862 throw module.error; 863 } 864 return module; 865 } 866 return instantiateModule(moduleId, SourceType.Runtime, chunkPath); 867} 868/** 869 * Retrieves a module from the cache, or instantiate it if it is not cached. 870 */ // Used by the backend 871// @ts-ignore 872// eslint-disable-next-line @typescript-eslint/no-unused-vars 873const getOrInstantiateModuleFromParent = (id, sourceModule)=>{ 874 const module = moduleCache[id]; 875 if (module) { 876 if (module.error) { 877 throw module.error; 878 } 879 return module; 880 } 881 return instantiateModule(id, SourceType.Parent, sourceModule.id); 882}; 883function instantiateModule(id, sourceType, sourceData) { 884 const moduleFactory = moduleFactories.get(id); 885 if (typeof moduleFactory !== 'function') { 886 // This can happen if modules incorrectly handle HMR disposes/updates, 887 // e.g. when they keep a `setTimeout` around which still executes old code 888 // and contains e.g. a `require("something")` call. 889 throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData)); 890 } 891 const module = createModuleObject(id); 892 const exports = module.exports; 893 moduleCache[id] = module; 894 // NOTE(alexkirsz) This can fail when the module encounters a runtime error. 895 const context = new Context(module, exports); 896 try { 897 moduleFactory(context, module, exports); 898 } catch (error) { 899 module.error = error; 900 throw error; 901 } 902 if (module.namespaceObject && module.exports !== module.namespaceObject) { 903 // in case of a circular dependency: cjs1 -> esm2 -> cjs1 904 interopEsm(module.exports, module.namespaceObject); 905 } 906 return module; 907} 908// eslint-disable-next-line @typescript-eslint/no-unused-vars 909function registerChunk(registration) { 910 const chunk = getChunkFromRegistration(registration[0]); 911 let runtimeParams; 912 // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length 913 if (registration.length === 2) { 914 runtimeParams = registration[1]; 915 } else { 916 runtimeParams = undefined; 917 installCompressedModuleFactories(registration, /* offset= */ 1, moduleFactories); 918 } 919 return BACKEND.registerChunk(chunk, runtimeParams); 920} 921/** 922 * This file contains the runtime code specific to the Turbopack ECMAScript DOM runtime. 923 * 924 * It will be appended to the base runtime code. 925 */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> 926/// <reference path="../../../shared/runtime/runtime-types.d.ts" /> 927function getAssetSuffixFromScriptSrc() { 928 var _ref; 929 var _document_currentScript_getAttribute, _document_currentScript, _document; 930 // TURBOPACK_ASSET_SUFFIX is set in web workers 931 if (self.TURBOPACK_ASSET_SUFFIX != null) return self.TURBOPACK_ASSET_SUFFIX; 932 const src = (_ref = (_document = document) === null || _document === void 0 ? void 0 : (_document_currentScript = _document.currentScript) === null || _document_currentScript === void 0 ? void 0 : (_document_currentScript_getAttribute = _document_currentScript.getAttribute) === null || _document_currentScript_getAttribute === void 0 ? void 0 : _document_currentScript_getAttribute.call(_document_currentScript, 'src')) !== null && _ref !== void 0 ? _ref : ''; 933 const qi = src.indexOf('?'); 934 return qi >= 0 ? src.slice(qi) : ''; 935} 936let BACKEND; 937/** 938 * Maps chunk paths to the corresponding resolver.
939 */ const chunkResolvers = new Map(); 940(()=>{ 941 BACKEND = { 942 async registerChunk (chunk, params) { 943 let chunkPath = getPathFromScript(chunk); 944 let chunkUrl = getUrlFromScript(chunk); 945 const resolver = getOrCreateResolver(chunkUrl); 946 resolver.resolve(); 947 if (params == null) { 948 return; 949 } 950 for (const otherChunkData of params.otherChunks){ 951 const otherChunkPath = getChunkPath(otherChunkData); 952 const otherChunkUrl = getChunkRelativeUrl(otherChunkPath); 953 // Chunk might have started loading, so we want to avoid triggering another load. 954 getOrCreateResolver(otherChunkUrl); 955 } 956 // This waits for chunks to be loaded, but also marks included items as available. 957 await Promise.all(params.otherChunks.map((otherChunkData)=>loadInitialChunk(chunkPath, otherChunkData))); 958 if (params.runtimeModuleIds.length > 0) { 959 for (const moduleId of params.runtimeModuleIds){ 960 getOrInstantiateRuntimeModule(chunkPath, moduleId); 961 } 962 } 963 }, 964 /** 965 * Loads the given chunk, and returns a promise that resolves once the chunk 966 * has been loaded. 967 */ loadChunkCached (sourceType, chunkUrl) { 968 return doLoadChunk(sourceType, chunkUrl); 969 }, 970 async loadWebAssembly (_sourceType, _sourceData, wasmChunkPath, _edgeModule, importsObj) { 971 const req = fetchWebAssembly(wasmChunkPath); 972 const { instance } = await WebAssembly.instantiateStreaming(req, importsObj); 973 return instance.exports; 974 }, 975 async loadWebAssemblyModule (_sourceType, _sourceData, wasmChunkPath, _edgeModule) { 976 const req = fetchWebAssembly(wasmChunkPath); 977 return await WebAssembly.compileStreaming(req); 978 } 979 }; 980 function getOrCreateResolver(chunkUrl) { 981 let resolver = chunkResolvers.get(chunkUrl); 982 if (!resolver) { 983 let resolve; 984 let reject; 985 const promise = new Promise((innerResolve, innerReject)=>{ 986 resolve = innerResolve; 987 reject = innerReject; 988 }); 989 resolver = { 990 resolved: false, 991 loadingStarted: false, 992 promise, 993 resolve: ()=>{ 994 resolver.resolved = true; 995 resolve(); 996 }, 997 reject: reject 998 }; 999 chunkResolvers.set(chunkUrl, resolver); 1000 } 1001 return resolver; 1002 } 1003 /** 1004 * Loads the given chunk, and returns a promise that resolves once the chunk 1005 * has been loaded. 1006 */ function doLoadChunk(sourceType, chunkUrl) { 1007 const resolver = getOrCreateResolver(chunkUrl); 1008 if (resolver.loadingStarted) { 1009 return resolver.promise; 1010 } 1011 if (sourceType === SourceType.Runtime) { 1012 // We don't need to load chunks references from runtime code, as they're already 1013 // present in the DOM. 1014 resolver.loadingStarted = true; 1015 if (isCss(chunkUrl)) { 1016 // CSS chunks do not register themselves, and as such must be marked as 1017 // loaded instantly. 1018 resolver.resolve(); 1019 } 1020 // We need to wait for JS chunks to register themselves within `registerChunk` 1021 // before we can start instantiating runtime modules, hence the absence of 1022 // `resolver.resolve()` in this branch. 1023 return resolver.promise; 1024 } 1025 if (typeof importScripts === 'function') { 1026 // We're in a web worker 1027 if (isCss(chunkUrl)) { 1028 // ignore 1029 } else if (isJs(chunkUrl)) { 1030 self.TURBOPACK_NEXT_CHUNK_URLS.push(chunkUrl); 1031 importScripts(chunkUrl); 1032 } else { 1033 throw new Error("can't infer type of chunk from URL ".concat(chunkUrl, " in worker")); 1034 } 1035 } else { 1036 // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped. 1037 const decodedChunkUrl = decodeURI(chunkUrl); 1038 if (isCss(chunkUrl)) { 1039 const previousLinks = document.querySelectorAll('link[rel=stylesheet][href="'.concat(chunkUrl, '"],link[rel=stylesheet][href^="').concat(chunkUrl, '?"],link[rel=stylesheet][href="').concat(decodedChunkUrl, '"],link[rel=stylesheet][href^="').concat(decodedChunkUrl, '?"]')); 1040 if (previousLinks.length > 0) { 1041 // CSS chunks do not register themselves, and as such must be marked as 1042 // loaded instantly. 1043 resolver.resolve(); 1044 } else { 1045 const link = document.createElement('link'); 1046 link.rel = 'stylesheet'; 1047 link.href = chunkUrl; 1048 link.onerror = ()=>{ 1049 resolver.reject(); 1050 }; 1051 link.onload = ()=>{ 1052 // CSS chunks do not register themselves, and as such must be marked as 1053 // loaded instantly. 1054 resolver.resolve(); 1055 }; 1056 // Append to the `head` for webpack compatibility. 1057 document.head.appendChild(link); 1058 } 1059 } else if (isJs(chunkUrl)) { 1060 const previousScripts = document.querySelectorAll('script[src="'.concat(chunkUrl, '"],script[src^="').concat(chunkUrl, '?"],script[src="').concat(decodedChunkUrl, '"],script[src^="').concat(decodedChunkUrl, '?"]')); 1061 if (previousScripts.length > 0) { 1062 // There is this edge where the script already failed loading, but we 1063 // can't detect that. The Promise will never resolve in this case. 1064 for (const script of Array.from(previousScripts)){ 1065 script.addEventListener('error', ()=>{ 1066 resolver.reject(); 1067 }); 1068 } 1069 } else { 1070 const script = document.createElement('script'); 1071 script.src = chunkUrl; 1072 // We'll only mark the chunk as loaded once the script has been executed, 1073 // which happens in `registerChunk`. Hence the absence of `resolve()` in 1074 // this branch. 1075 script.onerror = ()=>{ 1076 resolver.reject(); 1077 }; 1078 // Append to the `head` for webpack compatibility. 1079 document.head.appendChild(script); 1080 } 1081 } else { 1082 throw new Error("can't infer type of chunk from URL ".concat(chunkUrl)); 1083 } 1084 } 1085 resolver.loadingStarted = true; 1086 return resolver.promise; 1087 } 1088 function fetchWebAssembly(wasmChunkPath) { 1089 return fetch(getChunkRelativeUrl(wasmChunkPath)); 1090 } 1091})(); 1092const chunksToRegister = globalThis["TURBOPACK"]; 1093globalThis["TURBOPACK"] = { push: registerChunk }; 1094chunksToRegister.forEach(registerChunk); 1095})(); 1096 1097 1098//# debugId=737537bd-e9b6-eaa2-d2b1-793e0949018e
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.