svelte-effect-runtime 4.2.6 → 4.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -331,6 +331,7 @@ function make_remote_client_wrapper_plugin(options) {
331
331
  configResolved(config) {
332
332
  const no_external = config.ssr.noExternal;
333
333
  const runtime_package = "svelte-effect-runtime";
334
+ keep_runtime_package_bundled(config);
334
335
  if (no_external === true) return;
335
336
  if (Array.isArray(no_external)) {
336
337
  if (!no_external.some((entry) => entry === runtime_package)) no_external.push(runtime_package);
@@ -367,6 +368,26 @@ function make_remote_client_wrapper_plugin(options) {
367
368
  }
368
369
  };
369
370
  }
371
+ /**
372
+ * SvelteKit adapters externalize every production dependency, which overrides
373
+ * `ssr.noExternal` and leaves the runtime's `$app/*` imports unresolvable.
374
+ */
375
+ function keep_runtime_package_bundled(config) {
376
+ for (const environment of Object.values(config.environments)) {
377
+ /** Vite 7 has no `rolldownOptions`; its adapters never externalize dependencies. */
378
+ const rolldown_options = environment.build.rolldownOptions;
379
+ const external = rolldown_options?.external;
380
+ if (environment.consumer !== "server" || !rolldown_options || external === void 0) continue;
381
+ rolldown_options.external = (id, parent_id, is_resolved) => !is_runtime_package_specifier(id) && is_external(external, id, parent_id, is_resolved);
382
+ }
383
+ }
384
+ function is_runtime_package_specifier(id) {
385
+ return /^svelte-effect-runtime(?:\/|$)/.test(id);
386
+ }
387
+ function is_external(external, id, parent_id, is_resolved) {
388
+ if (typeof external === "function") return external(id, parent_id, is_resolved) === true;
389
+ return [external].flat().some((entry) => typeof entry === "string" ? entry === id : entry.test(id));
390
+ }
370
391
  function is_server_runtime_module(id) {
371
392
  const [filename] = id.split("?", 2);
372
393
  return /\.(server|remote)(?:\.[cm])?\.[jt]s$/.test(filename) || /(?:^|[\\/])hooks\.server(?:\.[cm])?\.[jt]s$/.test(filename);
@@ -412,4 +433,4 @@ async function rewrite_remote_client_exports(code, options) {
412
433
  //#endregion
413
434
  export { rewrite_remote_client_exports as n, effect as t };
414
435
 
415
- //# sourceMappingURL=compiler-B2htZszc.js.map
436
+ //# sourceMappingURL=compiler-B91cq_Dh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler-B91cq_Dh.js","names":["candidate"],"sources":["../../../modules/svelte-effect-runtime/src/compiler/sveltekit-remote-bridge.ts","../../../modules/svelte-effect-runtime/src/compiler.ts"],"sourcesContent":["const sveltekit_remote_runtime_suffix =\n\t\"/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/index.js\";\n\nconst expected_sveltekit_remote_exports = [\n\t[\"command\", \"./command.svelte.js\"],\n\t[\"form\", \"./form.svelte.js\"],\n\t[\"prerender\", \"./prerender.svelte.js\"],\n\t[\"query\", \"./query/index.js\"],\n\t[\"query_batch\", \"./query-batch.svelte.js\"],\n\t[\"query_live\", \"./query-live/index.js\"],\n] as const;\n\nconst sveltekit_remote_bridge_exports = [\n\t`export { remote_request as __SER___remote_request } from './shared.svelte.js';`,\n\t`export { serialize_binary_form as __SER___serialize_binary_form, BINARY_FORM_CONTENT_TYPE as __SER___binary_form_content_type } from '../../form-utils.js';`,\n] as const;\n\nconst sveltekit_remote_bridge_names = [\n\t\"__SER___remote_request\",\n\t\"__SER___serialize_binary_form\",\n\t\"__SER___binary_form_content_type\",\n] as const;\n\nexport function is_sveltekit_remote_runtime_index(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\tconst normalized_filename = filename.replaceAll(\"\\\\\", \"/\");\n\n\treturn normalized_filename.endsWith(sveltekit_remote_runtime_suffix);\n}\n\nexport function append_sveltekit_remote_transport_bridge(code: string): string {\n\tconst has_complete_bridge = sveltekit_remote_bridge_exports.every((statement) =>\n\t\tcode.includes(statement),\n\t);\n\tconst present_bridge_names = sveltekit_remote_bridge_names.filter((name) =>\n\t\tcode.includes(name),\n\t);\n\n\tif (has_complete_bridge) {\n\t\treturn code;\n\t}\n\n\tif (present_bridge_names.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`found an incomplete SER transport bridge (${present_bridge_names.join(\", \")})`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst missing_exports = expected_sveltekit_remote_exports\n\t\t.filter(([name, source]) => !has_named_reexport(code, name, source))\n\t\t.map(([name, source]) => `${name} from ${source}`);\n\n\tif (missing_exports.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`missing ${missing_exports.join(\", \")}`,\n\t\t\t),\n\t\t);\n\t}\n\n\treturn `${code.trimEnd()}\\n${sveltekit_remote_bridge_exports.join(\"\\n\")}\\n`;\n}\n\nexport function make_missing_sveltekit_remote_runtime_message(): string {\n\treturn make_unsupported_sveltekit_remote_runtime_message(\n\t\t\"the generated client used a remote form, but the Kit client runtime index was not found\",\n\t);\n}\n\nfunction has_named_reexport(code: string, name: string, source: string): boolean {\n\tconst escaped_name = escape_regular_expression(name);\n\tconst escaped_source = escape_regular_expression(source);\n\tconst pattern = new RegExp(\n\t\t`export\\\\s*\\\\{\\\\s*${escaped_name}\\\\s*\\\\}\\\\s*from\\\\s*[\"']${escaped_source}[\"']\\\\s*;?`,\n\t);\n\n\treturn pattern.test(code);\n}\n\nfunction escape_regular_expression(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction make_unsupported_sveltekit_remote_runtime_message(reason: string): string {\n\treturn [\n\t\t\"Unsupported @sveltejs/kit remote client runtime.\",\n\t\treason,\n\t\t\"SER expects the remote runtime layout used by SvelteKit 2.69.x and 3.0.0-next.x.\",\n\t].join(\" \");\n}\n","import {\n\tappend_sveltekit_remote_transport_bridge,\n\tis_sveltekit_remote_runtime_index,\n\tmake_missing_sveltekit_remote_runtime_message,\n} from \"./compiler/sveltekit-remote-bridge.ts\";\nimport type { Plugin, ResolvedConfig, Rolldown } from \"vite\";\n\n/**\n * Options for the {@link effect} Vite plugin.\n *\n * @example\n * ```ts\n * const options: EffectOptions = { debug: true };\n * const plugins = effect(options);\n * ```\n *\n * @since 2.0.0\n */\nexport interface EffectOptions {\n\t/** Whether to emit debug logging in the generated remote client module. */\n\tdebug?: boolean;\n}\n\ninterface SvelteComponentModuleFilter {\n\tset_extensions(extensions: readonly string[]): void;\n\tis_module(id: string): boolean;\n}\n\ninterface VitePluginSvelteApi {\n\toptions?: {\n\t\textensions?: readonly unknown[];\n\t};\n}\n\ntype VitePluginSvelte = Plugin & {\n\tapi?: VitePluginSvelteApi;\n};\n\ntype VitePluginSvelteWithExtensions = Plugin & {\n\tapi: {\n\t\toptions: {\n\t\t\textensions: readonly string[];\n\t\t};\n\t};\n};\n\nconst default_svelte_component_extensions = [\".svelte\"] as const;\n\n/**\n * Vite plugin for SvelteKit. The server import plugin rewrites server-side\n * imports to the server entrypoint; the remote client plugin wraps SvelteKit's\n * generated client remote exports in Effect-returning adapters.\n *\n * @example\n * ```ts\n * import { effect } from \"svelte-effect-runtime/compiler\";\n * import { sveltekit } from \"@sveltejs/kit/vite\";\n *\n * export default defineConfig({ plugins: [effect(), sveltekit()] });\n * ```\n *\n * @since 2.0.0\n * @param options - Optional configuration.\n * @returns Vite plugins that integrate the runtime with SvelteKit.\n */\nexport function effect(options?: EffectOptions): Plugin[] {\n\tconst component_filter = make_svelte_component_module_filter();\n\n\treturn [\n\t\tmake_diagnostics_plugin(component_filter),\n\t\tmake_svelte_transform_plugin(component_filter),\n\t\tmake_server_rewrite_plugin(),\n\t\tmake_remote_client_wrapper_plugin(options),\n\t];\n}\n\nfunction make_diagnostics_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\tconst warned_diagnostics = new Set<string>();\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:diagnostics\",\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_effect_diagnostics(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst clean_id = id.split(\"?\")[0] ?? id;\n\t\t\tconst { find_svelte_effect_diagnostics } = await import(\"./diagnostics.ts\");\n\t\t\tconst diagnostics = find_svelte_effect_diagnostics(code, clean_id);\n\n\t\t\tfor (const diagnostic of diagnostics) {\n\t\t\t\tconst diagnostic_key = [\n\t\t\t\t\tclean_id,\n\t\t\t\t\tdiagnostic.line,\n\t\t\t\t\tdiagnostic.column,\n\t\t\t\t\tdiagnostic.message,\n\t\t\t\t].join(\":\");\n\n\t\t\t\tif (warned_diagnostics.has(diagnostic_key)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twarned_diagnostics.add(diagnostic_key);\n\n\t\t\t\tthis.warn({\n\t\t\t\t\tid: clean_id,\n\t\t\t\t\tmessage: diagnostic.message,\n\t\t\t\t\tloc: {\n\t\t\t\t\t\tline: diagnostic.line,\n\t\t\t\t\t\tcolumn: diagnostic.column,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t};\n}\n\nfunction make_svelte_transform_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:svelte-transform\",\n\n\t\tconfigResolved(config) {\n\t\t\tconst extensions = find_svelte_component_extensions(config.plugins);\n\t\t\tconst conflicting_plugin_names = find_pre_transform_plugin_names(config.plugins);\n\n\t\t\tif (extensions) {\n\t\t\t\tcomponent_filter.set_extensions(extensions);\n\t\t\t}\n\n\t\t\tif (conflicting_plugin_names.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.logger.info(make_pre_transform_plugin_notice(conflicting_plugin_names));\n\t\t},\n\n\t\tasync transform(code: string, id: string, options?: { ssr?: boolean | undefined }) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_ser_syntax(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { transform_svelte_effect } = await import(\"./runtime/transform.ts\");\n\t\t\tconst result = transform_svelte_effect(code, id, {\n\t\t\t\ttarget: options?.ssr ? \"server\" : \"client\",\n\t\t\t});\n\n\t\t\tif (result.code === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: result.code, map: null };\n\t\t},\n\t};\n}\n\nfunction make_svelte_component_module_filter(): SvelteComponentModuleFilter {\n\tlet extensions: readonly string[] = default_svelte_component_extensions;\n\n\treturn {\n\t\tset_extensions(next_extensions) {\n\t\t\tconst normalized_extensions = normalize_svelte_component_extensions(next_extensions);\n\n\t\t\tif (normalized_extensions.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\textensions = normalized_extensions;\n\t\t},\n\n\t\tis_module(id) {\n\t\t\treturn is_svelte_component_module(id, extensions);\n\t\t},\n\t};\n}\n\nfunction normalize_svelte_component_extensions(extensions: readonly string[]): string[] {\n\tconst normalized_extensions = extensions\n\t\t.filter((extension) => extension.length > 0)\n\t\t.map((extension) => (extension.startsWith(\".\") ? extension : `.${extension}`));\n\n\treturn [...new Set(normalized_extensions)];\n}\n\nfunction find_svelte_component_extensions(\n\tplugins: readonly Plugin[],\n): readonly string[] | undefined {\n\tconst svelte_plugin = plugins.find(has_svelte_component_extensions);\n\n\treturn svelte_plugin?.api?.options?.extensions;\n}\n\nfunction has_svelte_component_extensions(plugin: Plugin): plugin is VitePluginSvelteWithExtensions {\n\tconst candidate = plugin as VitePluginSvelte;\n\tconst extensions = candidate.api?.options?.extensions;\n\n\tif (!plugin.name.startsWith(\"vite-plugin-svelte\")) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\tArray.isArray(extensions) && extensions.every((extension) => typeof extension === \"string\")\n\t);\n}\n\nfunction find_pre_transform_plugin_names(plugins: readonly Plugin[]): string[] {\n\treturn plugins\n\t\t.filter(\n\t\t\t(plugin) =>\n\t\t\t\t!plugin.name.startsWith(\"svelte-effect-runtime:\") &&\n\t\t\t\t!is_known_framework_pre_transform_plugin(plugin.name) &&\n\t\t\t\thas_pre_transform_priority(plugin),\n\t\t)\n\t\t.map((plugin) => plugin.name);\n}\n\nconst ansi_reset = \"\\x1b[0m\";\nconst ansi_light_green = \"\\x1b[92m\";\n\nfunction make_pre_transform_plugin_notice(plugin_names: readonly string[]): string {\n\tconst formatted_plugins = plugin_names.map((plugin_name) => ` - ${plugin_name}`).join(\"\\n\");\n\n\treturn [\n\t\t`${ansi_light_green}[svelte-effect-runtime]${ansi_reset} Svelte Effect Runtime noticed possible Vite plugin ordering conflicts.`,\n\t\t\"\",\n\t\t\"These plugins run before normal Svelte component transforms:\",\n\t\tformatted_plugins,\n\t\t\"\",\n\t\t\"This is usually fine, but if you see Svelte parser errors around <script effect>\",\n\t\t\"or yield* in components, one of those plugins may be reading component files before\",\n\t\t\"SER has lowered its syntax.\",\n\t].join(\"\\n\");\n}\n\nfunction is_known_framework_pre_transform_plugin(name: string): boolean {\n\treturn name.startsWith(\"vite:\") || name === \"vite-plugin-svelte:preprocess\";\n}\n\nfunction has_pre_transform_priority(plugin: Plugin): boolean {\n\tif (plugin.enforce === \"pre\" && plugin.transform) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof plugin.transform === \"object\" &&\n\t\tplugin.transform !== null &&\n\t\t\"order\" in plugin.transform &&\n\t\tplugin.transform.order === \"pre\"\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction make_server_rewrite_plugin(): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:server-imports\",\n\n\t\tconfig() {\n\t\t\treturn { optimizeDeps: { exclude: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!is_server_runtime_module(id)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!code.includes(\"svelte-effect-runtime\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst rewritten = await rewrite_server_imports(code, id);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\nasync function rewrite_server_imports(code: string, id: string): Promise<string> {\n\tconst [{ default: MagicString }, ts] = await Promise.all([\n\t\timport(\"magic-string\"),\n\t\timport(\"typescript\"),\n\t]);\n\tconst filename = id.split(\"?\", 2)[0] ?? id;\n\tconst source_file = ts.createSourceFile(\n\t\tfilename,\n\t\tcode,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tget_script_kind(filename, ts),\n\t);\n\tconst magic = new MagicString(code);\n\tconst ser_prerender_imports = is_remote_module(id)\n\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\tif (\n\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst bindings = statement.importClause?.namedBindings;\n\n\t\t\t\tif (\n\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t!bindings ||\n\t\t\t\t\t!ts.isNamedImports(bindings)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\treturn bindings.elements.filter(\n\t\t\t\t\t(element) =>\n\t\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"Prerender\",\n\t\t\t\t);\n\t\t\t})\n\t\t: [];\n\tconst prerender_binding_names = new Set(\n\t\tser_prerender_imports.map((element) => element.name.text),\n\t);\n\tconst prerender_namespace_names = new Set(\n\t\tis_remote_module(id)\n\t\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text) ||\n\t\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t\tstatement.importClause?.namedBindings === undefined ||\n\t\t\t\t\t\t!ts.isNamespaceImport(statement.importClause.namedBindings)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [statement.importClause.namedBindings.name.text];\n\t\t\t\t})\n\t\t\t: [],\n\t);\n\tconst ser_prerender_calls = collect_exported_ser_prerender_calls(\n\t\tsource_file,\n\t\tprerender_binding_names,\n\t\tprerender_namespace_names,\n\t\tts,\n\t);\n\tconst has_sveltekit_prerender_import = source_file.statements.some(\n\t\t(statement) =>\n\t\t\tts.isImportDeclaration(statement) &&\n\t\t\tts.isStringLiteralLike(statement.moduleSpecifier) &&\n\t\t\tstatement.moduleSpecifier.text === \"$app/server\" &&\n\t\t\tstatement.importClause?.isTypeOnly !== true &&\n\t\t\tstatement.importClause?.namedBindings !== undefined &&\n\t\t\tts.isNamedImports(statement.importClause.namedBindings) &&\n\t\t\tstatement.importClause.namedBindings.elements.some(\n\t\t\t\t(element) =>\n\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"prerender\" &&\n\t\t\t\t\telement.name.text === \"prerender\",\n\t\t\t),\n\t);\n\tconst has_top_level_prerender_binding = source_file.statements.some((statement) =>\n\t\tdeclares_top_level_value_binding(statement, \"prerender\", ts),\n\t);\n\tlet changed = false;\n\n\tif (ser_prerender_calls.size > 0 && !has_sveltekit_prerender_import) {\n\t\tif (has_top_level_prerender_binding) {\n\t\t\tthrow new Error(\n\t\t\t\t`[svelte-effect-runtime] ${filename}: Prerender remote modules reserve the top-level \"prerender\" binding for SvelteKit. Rename the existing binding.`,\n\t\t\t);\n\t\t}\n\n\t\tconst last_import = [...source_file.statements].reverse().find(ts.isImportDeclaration);\n\t\tconst native_import = `import { prerender } from \"$app/server\";`;\n\n\t\tif (last_import) {\n\t\t\tmagic.appendRight(last_import.end, `\\n${native_import}`);\n\t\t} else {\n\t\t\tmagic.prepend(`${native_import}\\n`);\n\t\t}\n\n\t\tchanged = true;\n\t}\n\n\tconst rewrite_specifier = (specifier: import(\"typescript\").StringLiteralLike) => {\n\t\tconst replacement = get_server_import_replacement(specifier.text);\n\n\t\tif (!replacement) {\n\t\t\treturn;\n\t\t}\n\n\t\tmagic.overwrite(\n\t\t\tspecifier.getStart(source_file),\n\t\t\tspecifier.end,\n\t\t\tJSON.stringify(replacement),\n\t\t);\n\t\tchanged = true;\n\t};\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (ts.isImportDeclaration(node) && ts.isStringLiteralLike(node.moduleSpecifier)) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (\n\t\t\tts.isExportDeclaration(node) &&\n\t\t\tnode.moduleSpecifier &&\n\t\t\tts.isStringLiteralLike(node.moduleSpecifier)\n\t\t) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) {\n\t\t\tconst [specifier] = node.arguments;\n\n\t\t\tif (specifier && ts.isStringLiteralLike(specifier)) {\n\t\t\t\trewrite_specifier(specifier);\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && ser_prerender_calls.has(node)) {\n\t\t\tconst missing_arguments = Math.max(0, 3 - node.arguments.length);\n\t\t\tconst injected_arguments = [\n\t\t\t\t...Array.from({ length: missing_arguments }, () => \"undefined\"),\n\t\t\t\t\"prerender\",\n\t\t\t];\n\t\t\tconst separator =\n\t\t\t\tnode.arguments.length === 0 || node.arguments.hasTrailingComma ? \"\" : \",\";\n\n\t\t\tmagic.appendLeft(node.end - 1, `${separator} ${injected_arguments.join(\", \")}`);\n\t\t\tchanged = true;\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn changed ? magic.toString() : code;\n}\n\nfunction is_ser_server_import(specifier: string): boolean {\n\treturn specifier === \"svelte-effect-runtime\" || specifier === \"svelte-effect-runtime/server\";\n}\n\nfunction is_ser_prerender_callee(\n\texpression: import(\"typescript\").Expression,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(expression)) {\n\t\treturn binding_names.has(expression.text);\n\t}\n\n\treturn (\n\t\tts.isPropertyAccessExpression(expression) &&\n\t\tts.isIdentifier(expression.expression) &&\n\t\tnamespace_names.has(expression.expression.text) &&\n\t\texpression.name.text === \"Prerender\"\n\t);\n}\n\nfunction collect_exported_ser_prerender_calls(\n\tsource_file: import(\"typescript\").SourceFile,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): ReadonlySet<import(\"typescript\").CallExpression> {\n\tconst calls = new Set<import(\"typescript\").CallExpression>();\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (\n\t\t\tts.isCallExpression(node) &&\n\t\t\tis_ser_prerender_callee(node.expression, binding_names, namespace_names, ts) &&\n\t\t\tis_exported_variable_initializer(node, ts)\n\t\t) {\n\t\t\tcalls.add(node);\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn calls;\n}\n\nfunction is_exported_variable_initializer(\n\tnode: import(\"typescript\").CallExpression,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tlet initializer: import(\"typescript\").Expression = node;\n\tlet parent = initializer.parent;\n\n\twhile (is_transparent_expression_wrapper(parent, initializer, ts)) {\n\t\tinitializer = parent;\n\t\tparent = initializer.parent;\n\t}\n\n\tif (!ts.isVariableDeclaration(parent) || parent.initializer !== initializer) {\n\t\treturn false;\n\t}\n\n\tconst statement = parent.parent.parent;\n\n\treturn (\n\t\tts.isVariableStatement(statement) &&\n\t\tstatement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ===\n\t\t\ttrue\n\t);\n}\n\nfunction is_transparent_expression_wrapper(\n\tparent: import(\"typescript\").Node,\n\texpression: import(\"typescript\").Expression,\n\tts: typeof import(\"typescript\"),\n): parent is import(\"typescript\").Expression {\n\treturn (\n\t\t(ts.isParenthesizedExpression(parent) ||\n\t\t\tts.isAsExpression(parent) ||\n\t\t\tts.isSatisfiesExpression(parent) ||\n\t\t\tts.isTypeAssertionExpression(parent) ||\n\t\t\tts.isNonNullExpression(parent)) &&\n\t\tparent.expression === expression\n\t);\n}\n\nfunction declares_top_level_value_binding(\n\tstatement: import(\"typescript\").Statement,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isImportDeclaration(statement)) {\n\t\tconst import_clause = statement.importClause;\n\n\t\tif (!import_clause || import_clause.isTypeOnly) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (import_clause.name?.text === name) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst bindings = import_clause.namedBindings;\n\n\t\tif (bindings && ts.isNamespaceImport(bindings)) {\n\t\t\treturn bindings.name.text === name;\n\t\t}\n\n\t\treturn (\n\t\t\tbindings?.elements.some(\n\t\t\t\t(element) => !element.isTypeOnly && element.name.text === name,\n\t\t\t) === true\n\t\t);\n\t}\n\n\tif (ts.isVariableStatement(statement)) {\n\t\treturn statement.declarationList.declarations.some((declaration) =>\n\t\t\tbinding_name_contains(declaration.name, name, ts),\n\t\t);\n\t}\n\n\tif (\n\t\tts.isFunctionDeclaration(statement) ||\n\t\tts.isClassDeclaration(statement) ||\n\t\tts.isEnumDeclaration(statement) ||\n\t\tts.isModuleDeclaration(statement)\n\t) {\n\t\treturn statement.name?.getText() === name;\n\t}\n\n\treturn ts.isImportEqualsDeclaration(statement) && statement.name.text === name;\n}\n\nfunction binding_name_contains(\n\tbinding: import(\"typescript\").BindingName,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(binding)) {\n\t\treturn binding.text === name;\n\t}\n\n\treturn binding.elements.some(\n\t\t(element) =>\n\t\t\t!ts.isOmittedExpression(element) && binding_name_contains(element.name, name, ts),\n\t);\n}\n\nfunction get_server_import_replacement(specifier: string): string | undefined {\n\tif (specifier === \"svelte-effect-runtime\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\tif (specifier === \"svelte-effect-runtime/internal/generators\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\treturn undefined;\n}\n\nfunction get_script_kind(filename: string, ts: typeof import(\"typescript\")) {\n\tconst normalized_filename = filename.toLowerCase();\n\n\tif (has_file_extension(normalized_filename, [\".tsx\"])) {\n\t\treturn ts.ScriptKind.TSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".jsx\"])) {\n\t\treturn ts.ScriptKind.JSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".js\", \".mjs\", \".cjs\"])) {\n\t\treturn ts.ScriptKind.JS;\n\t}\n\n\treturn ts.ScriptKind.TS;\n}\n\nfunction has_file_extension(filename: string, extensions: readonly string[]): boolean {\n\treturn extensions.some((extension) => filename.endsWith(extension));\n}\n\nfunction make_remote_client_wrapper_plugin(options?: EffectOptions): Plugin {\n\tlet has_remote_form_module = false;\n\tlet has_sveltekit_remote_bridge = false;\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:remote-client\",\n\t\tenforce: \"post\",\n\n\t\tbuildStart() {\n\t\t\thas_remote_form_module = false;\n\t\t\thas_sveltekit_remote_bridge = false;\n\t\t},\n\n\t\tbuildEnd(error) {\n\t\t\tif (error || !has_remote_form_module || has_sveltekit_remote_bridge) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t},\n\n\t\tconfig() {\n\t\t\treturn { ssr: { noExternal: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tconfigResolved(config) {\n\t\t\tconst no_external = config.ssr.noExternal;\n\t\t\tconst runtime_package = \"svelte-effect-runtime\";\n\n\t\t\tkeep_runtime_package_bundled(config);\n\n\t\t\tif (no_external === true) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Array.isArray(no_external)) {\n\t\t\t\tconst has_runtime_package = no_external.some((entry) => entry === runtime_package);\n\n\t\t\t\tif (!has_runtime_package) {\n\t\t\t\t\tno_external.push(runtime_package);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.ssr.noExternal = [no_external, runtime_package].filter(\n\t\t\t\t(value): value is string | RegExp => value !== undefined,\n\t\t\t);\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (is_sveltekit_remote_runtime_index(id)) {\n\t\t\t\tconst rewritten = append_sveltekit_remote_transport_bridge(code);\n\n\t\t\t\thas_sveltekit_remote_bridge = true;\n\n\t\t\t\tif (rewritten === code) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn { code: rewritten, map: null };\n\t\t\t}\n\n\t\t\tif (!is_remote_module(id)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst remote_client = await import(\"./compiler/remote-client.ts\");\n\t\t\tconst runtime_specifier = remote_client.find_remote_client_runtime_specifier(code);\n\n\t\t\tif (!runtime_specifier) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst has_remote_form = /\\.[\\s\\n]*form[\\s\\n]*\\(/.test(code);\n\n\t\t\thas_remote_form_module ||= has_remote_form;\n\n\t\t\tif (has_remote_form) {\n\t\t\t\tconst resolved_runtime = await this.resolve(runtime_specifier, id);\n\n\t\t\t\tif (!resolved_runtime || !is_sveltekit_remote_runtime_index(resolved_runtime.id)) {\n\t\t\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst rewritten = remote_client.rewrite_remote_client_exports(code, options);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\n/**\n * SvelteKit adapters externalize every production dependency, which overrides\n * `ssr.noExternal` and leaves the runtime's `$app/*` imports unresolvable.\n */\nfunction keep_runtime_package_bundled(config: ResolvedConfig): void {\n\tfor (const environment of Object.values(config.environments)) {\n\t\t/** Vite 7 has no `rolldownOptions`; its adapters never externalize dependencies. */\n\t\tconst rolldown_options = environment.build.rolldownOptions as\n\t\t\t| Rolldown.InputOptions\n\t\t\t| undefined;\n\t\tconst external = rolldown_options?.external;\n\n\t\tif (environment.consumer !== \"server\" || !rolldown_options || external === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\trolldown_options.external = (id, parent_id, is_resolved) =>\n\t\t\t!is_runtime_package_specifier(id) && is_external(external, id, parent_id, is_resolved);\n\t}\n}\n\nfunction is_runtime_package_specifier(id: string): boolean {\n\treturn /^svelte-effect-runtime(?:\\/|$)/.test(id);\n}\n\nfunction is_external(\n\texternal: NonNullable<Rolldown.InputOptions[\"external\"]>,\n\tid: string,\n\tparent_id: string | undefined,\n\tis_resolved: boolean,\n): boolean {\n\tif (typeof external === \"function\") {\n\t\treturn external(id, parent_id, is_resolved) === true;\n\t}\n\n\treturn [external]\n\t\t.flat()\n\t\t.some((entry) => (typeof entry === \"string\" ? entry === id : entry.test(id)));\n}\n\nfunction is_server_runtime_module(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\n\treturn (\n\t\t/\\.(server|remote)(?:\\.[cm])?\\.[jt]s$/.test(filename) ||\n\t\t/(?:^|[\\\\/])hooks\\.server(?:\\.[cm])?\\.[jt]s$/.test(filename)\n\t);\n}\n\nfunction is_remote_module(id: string): boolean {\n\treturn /\\.(remote|remote\\.[cm]?)\\.[jt]s(?:\\?.*)?$/.test(id) || id.includes(\".remote.\");\n}\n\nfunction is_svelte_component_module(id: string, extensions: readonly string[]): boolean {\n\tconst [filename, query = \"\"] = id.split(\"?\", 2);\n\n\tif (!extensions.some((extension) => filename.endsWith(extension))) {\n\t\treturn false;\n\t}\n\n\tif (query.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst params = new URLSearchParams(query);\n\tconst allowed_params = [\"t\", \"v\"];\n\n\treturn [...params.keys()].every((key) => allowed_params.includes(key));\n}\n\nfunction may_have_effect_diagnostics(code: string): boolean {\n\treturn (\n\t\t/\\byield\\s*\\*/.test(code) ||\n\t\tcode.includes(\"Effect\") ||\n\t\t/[\"']effect(?:\\/Effect)?[\"']/.test(code)\n\t);\n}\n\nfunction may_have_ser_syntax(code: string): boolean {\n\treturn /\\byield\\s*\\*/.test(code) || /<script\\b[^>]*\\beffect(?:[\\s=>]|$)/i.test(code);\n}\n\n/**\n * Rewrites SvelteKit's generated client remote module from:\n *\n * `export const get_post = __remote.query(\"hash/get_post\")`\n *\n * into an Effect-aware wrapper around the same native function.\n *\n * @example\n * ```ts\n * const rewritten = await rewrite_remote_client_exports(remote_module_code);\n * ```\n *\n * @since 2.0.0\n * @param code - The generated client remote module code.\n * @param options - Optional plugin options.\n * @returns A promise that resolves to the rewritten module code.\n * @internal\n */\nexport async function rewrite_remote_client_exports(\n\tcode: string,\n\toptions?: EffectOptions,\n): Promise<string> {\n\tconst remote_client = await import(\"./compiler/remote-client.ts\");\n\n\treturn remote_client.rewrite_remote_client_exports(code, options);\n}\n"],"mappings":";AAAA,MAAM,kCACL;AAED,MAAM,oCAAoC;CACzC,CAAC,WAAW,qBAAqB;CACjC,CAAC,QAAQ,kBAAkB;CAC3B,CAAC,aAAa,uBAAuB;CACrC,CAAC,SAAS,kBAAkB;CAC5B,CAAC,eAAe,yBAAyB;CACzC,CAAC,cAAc,uBAAuB;AACvC;AAEA,MAAM,kCAAkC,CACvC,kFACA,6JACD;AAEA,MAAM,gCAAgC;CACrC;CACA;CACA;AACD;AAEA,SAAgB,kCAAkC,IAAqB;CACtE,MAAM,CAAC,YAAY,GAAG,MAAM,KAAK,CAAC;CAGlC,OAF4B,SAAS,WAAW,MAAM,GAE7B,CAAC,CAAC,SAAS,+BAA+B;AACpE;AAEA,SAAgB,yCAAyC,MAAsB;CAC9E,MA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AO;CAGR,IAAI,MAAM,WAAW,GACpB,OAAO;CAGR,MAAM,SAAS,IAAI,gBAAgB,KAAK;CACxC,MAAM,iBAAiB,CAAC,KAAK,GAAG;CAEhC,OAAO,CAAC,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,QAAQ,eAAe,SAAS,GAAG,CAAC;AACtE;AAEA,SAAS,4BAA4B,MAAuB;CAC3D,OACC,eAAe,KAAK,IAAI,KACxB,KAAK,SAAS,QAAQ,KACtB,8BAA8B,KAAK,IAAI;AAEzC;AAEA,SAAS,oBAAoB,MAAuB;CACnD,OAAO,eAAe,KAAK,IAAI,KAAK,sCAAsC,KAAK,IAAI;AACpF;;;;;;;;;;;;;;;;;;;AAoBA,eAAsB,8BACrB,MACA,SACkB;CAGlB,QAAO,MAFqB,OAAO,+BAAA,CAEd,8BAA8B,MAAM,OAAO;AACjE"}
package/.dist/compiler.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as rewrite_remote_client_exports, t as effect } from "./chunks/compiler-B2htZszc.js";
1
+ import { n as rewrite_remote_client_exports, t as effect } from "./chunks/compiler-B91cq_Dh.js";
2
2
  export { effect, rewrite_remote_client_exports };
package/.dist/mod.js CHANGED
@@ -3,7 +3,7 @@ import { n as Dispatcher } from "./chunks/dispatcher-D3Tpa5HC.js";
3
3
  import { DefineEnvVars } from "./environment.js";
4
4
  import { is_form_error, is_remote_http_error, is_remote_transport_error, is_remote_validation_error } from "./remote/shared.js";
5
5
  import { t as Live } from "./chunks/live-BW7xZKjb.js";
6
- import { t as effect } from "./chunks/compiler-B2htZszc.js";
6
+ import { t as effect } from "./chunks/compiler-B91cq_Dh.js";
7
7
  //#region src/mod.ts
8
8
  /**
9
9
  * Public API surface for `svelte-effect-runtime`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-effect-runtime",
3
- "version": "4.2.6",
3
+ "version": "4.2.7",
4
4
  "description": "Core module that houses the Vite plugin to enable effectful execution.",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiler-B2htZszc.js","names":["candidate"],"sources":["../../../modules/svelte-effect-runtime/src/compiler/sveltekit-remote-bridge.ts","../../../modules/svelte-effect-runtime/src/compiler.ts"],"sourcesContent":["const sveltekit_remote_runtime_suffix =\n\t\"/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/index.js\";\n\nconst expected_sveltekit_remote_exports = [\n\t[\"command\", \"./command.svelte.js\"],\n\t[\"form\", \"./form.svelte.js\"],\n\t[\"prerender\", \"./prerender.svelte.js\"],\n\t[\"query\", \"./query/index.js\"],\n\t[\"query_batch\", \"./query-batch.svelte.js\"],\n\t[\"query_live\", \"./query-live/index.js\"],\n] as const;\n\nconst sveltekit_remote_bridge_exports = [\n\t`export { remote_request as __SER___remote_request } from './shared.svelte.js';`,\n\t`export { serialize_binary_form as __SER___serialize_binary_form, BINARY_FORM_CONTENT_TYPE as __SER___binary_form_content_type } from '../../form-utils.js';`,\n] as const;\n\nconst sveltekit_remote_bridge_names = [\n\t\"__SER___remote_request\",\n\t\"__SER___serialize_binary_form\",\n\t\"__SER___binary_form_content_type\",\n] as const;\n\nexport function is_sveltekit_remote_runtime_index(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\tconst normalized_filename = filename.replaceAll(\"\\\\\", \"/\");\n\n\treturn normalized_filename.endsWith(sveltekit_remote_runtime_suffix);\n}\n\nexport function append_sveltekit_remote_transport_bridge(code: string): string {\n\tconst has_complete_bridge = sveltekit_remote_bridge_exports.every((statement) =>\n\t\tcode.includes(statement),\n\t);\n\tconst present_bridge_names = sveltekit_remote_bridge_names.filter((name) =>\n\t\tcode.includes(name),\n\t);\n\n\tif (has_complete_bridge) {\n\t\treturn code;\n\t}\n\n\tif (present_bridge_names.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`found an incomplete SER transport bridge (${present_bridge_names.join(\", \")})`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst missing_exports = expected_sveltekit_remote_exports\n\t\t.filter(([name, source]) => !has_named_reexport(code, name, source))\n\t\t.map(([name, source]) => `${name} from ${source}`);\n\n\tif (missing_exports.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`missing ${missing_exports.join(\", \")}`,\n\t\t\t),\n\t\t);\n\t}\n\n\treturn `${code.trimEnd()}\\n${sveltekit_remote_bridge_exports.join(\"\\n\")}\\n`;\n}\n\nexport function make_missing_sveltekit_remote_runtime_message(): string {\n\treturn make_unsupported_sveltekit_remote_runtime_message(\n\t\t\"the generated client used a remote form, but the Kit client runtime index was not found\",\n\t);\n}\n\nfunction has_named_reexport(code: string, name: string, source: string): boolean {\n\tconst escaped_name = escape_regular_expression(name);\n\tconst escaped_source = escape_regular_expression(source);\n\tconst pattern = new RegExp(\n\t\t`export\\\\s*\\\\{\\\\s*${escaped_name}\\\\s*\\\\}\\\\s*from\\\\s*[\"']${escaped_source}[\"']\\\\s*;?`,\n\t);\n\n\treturn pattern.test(code);\n}\n\nfunction escape_regular_expression(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction make_unsupported_sveltekit_remote_runtime_message(reason: string): string {\n\treturn [\n\t\t\"Unsupported @sveltejs/kit remote client runtime.\",\n\t\treason,\n\t\t\"SER expects the remote runtime layout used by SvelteKit 2.69.x and 3.0.0-next.x.\",\n\t].join(\" \");\n}\n","import {\n\tappend_sveltekit_remote_transport_bridge,\n\tis_sveltekit_remote_runtime_index,\n\tmake_missing_sveltekit_remote_runtime_message,\n} from \"./compiler/sveltekit-remote-bridge.ts\";\nimport type { Plugin } from \"vite\";\n\n/**\n * Options for the {@link effect} Vite plugin.\n *\n * @example\n * ```ts\n * const options: EffectOptions = { debug: true };\n * const plugins = effect(options);\n * ```\n *\n * @since 2.0.0\n */\nexport interface EffectOptions {\n\t/** Whether to emit debug logging in the generated remote client module. */\n\tdebug?: boolean;\n}\n\ninterface SvelteComponentModuleFilter {\n\tset_extensions(extensions: readonly string[]): void;\n\tis_module(id: string): boolean;\n}\n\ninterface VitePluginSvelteApi {\n\toptions?: {\n\t\textensions?: readonly unknown[];\n\t};\n}\n\ntype VitePluginSvelte = Plugin & {\n\tapi?: VitePluginSvelteApi;\n};\n\ntype VitePluginSvelteWithExtensions = Plugin & {\n\tapi: {\n\t\toptions: {\n\t\t\textensions: readonly string[];\n\t\t};\n\t};\n};\n\nconst default_svelte_component_extensions = [\".svelte\"] as const;\n\n/**\n * Vite plugin for SvelteKit. The server import plugin rewrites server-side\n * imports to the server entrypoint; the remote client plugin wraps SvelteKit's\n * generated client remote exports in Effect-returning adapters.\n *\n * @example\n * ```ts\n * import { effect } from \"svelte-effect-runtime/compiler\";\n * import { sveltekit } from \"@sveltejs/kit/vite\";\n *\n * export default defineConfig({ plugins: [effect(), sveltekit()] });\n * ```\n *\n * @since 2.0.0\n * @param options - Optional configuration.\n * @returns Vite plugins that integrate the runtime with SvelteKit.\n */\nexport function effect(options?: EffectOptions): Plugin[] {\n\tconst component_filter = make_svelte_component_module_filter();\n\n\treturn [\n\t\tmake_diagnostics_plugin(component_filter),\n\t\tmake_svelte_transform_plugin(component_filter),\n\t\tmake_server_rewrite_plugin(),\n\t\tmake_remote_client_wrapper_plugin(options),\n\t];\n}\n\nfunction make_diagnostics_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\tconst warned_diagnostics = new Set<string>();\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:diagnostics\",\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_effect_diagnostics(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst clean_id = id.split(\"?\")[0] ?? id;\n\t\t\tconst { find_svelte_effect_diagnostics } = await import(\"./diagnostics.ts\");\n\t\t\tconst diagnostics = find_svelte_effect_diagnostics(code, clean_id);\n\n\t\t\tfor (const diagnostic of diagnostics) {\n\t\t\t\tconst diagnostic_key = [\n\t\t\t\t\tclean_id,\n\t\t\t\t\tdiagnostic.line,\n\t\t\t\t\tdiagnostic.column,\n\t\t\t\t\tdiagnostic.message,\n\t\t\t\t].join(\":\");\n\n\t\t\t\tif (warned_diagnostics.has(diagnostic_key)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twarned_diagnostics.add(diagnostic_key);\n\n\t\t\t\tthis.warn({\n\t\t\t\t\tid: clean_id,\n\t\t\t\t\tmessage: diagnostic.message,\n\t\t\t\t\tloc: {\n\t\t\t\t\t\tline: diagnostic.line,\n\t\t\t\t\t\tcolumn: diagnostic.column,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t};\n}\n\nfunction make_svelte_transform_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:svelte-transform\",\n\n\t\tconfigResolved(config) {\n\t\t\tconst extensions = find_svelte_component_extensions(config.plugins);\n\t\t\tconst conflicting_plugin_names = find_pre_transform_plugin_names(config.plugins);\n\n\t\t\tif (extensions) {\n\t\t\t\tcomponent_filter.set_extensions(extensions);\n\t\t\t}\n\n\t\t\tif (conflicting_plugin_names.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.logger.info(make_pre_transform_plugin_notice(conflicting_plugin_names));\n\t\t},\n\n\t\tasync transform(code: string, id: string, options?: { ssr?: boolean | undefined }) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_ser_syntax(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { transform_svelte_effect } = await import(\"./runtime/transform.ts\");\n\t\t\tconst result = transform_svelte_effect(code, id, {\n\t\t\t\ttarget: options?.ssr ? \"server\" : \"client\",\n\t\t\t});\n\n\t\t\tif (result.code === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: result.code, map: null };\n\t\t},\n\t};\n}\n\nfunction make_svelte_component_module_filter(): SvelteComponentModuleFilter {\n\tlet extensions: readonly string[] = default_svelte_component_extensions;\n\n\treturn {\n\t\tset_extensions(next_extensions) {\n\t\t\tconst normalized_extensions = normalize_svelte_component_extensions(next_extensions);\n\n\t\t\tif (normalized_extensions.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\textensions = normalized_extensions;\n\t\t},\n\n\t\tis_module(id) {\n\t\t\treturn is_svelte_component_module(id, extensions);\n\t\t},\n\t};\n}\n\nfunction normalize_svelte_component_extensions(extensions: readonly string[]): string[] {\n\tconst normalized_extensions = extensions\n\t\t.filter((extension) => extension.length > 0)\n\t\t.map((extension) => (extension.startsWith(\".\") ? extension : `.${extension}`));\n\n\treturn [...new Set(normalized_extensions)];\n}\n\nfunction find_svelte_component_extensions(\n\tplugins: readonly Plugin[],\n): readonly string[] | undefined {\n\tconst svelte_plugin = plugins.find(has_svelte_component_extensions);\n\n\treturn svelte_plugin?.api?.options?.extensions;\n}\n\nfunction has_svelte_component_extensions(plugin: Plugin): plugin is VitePluginSvelteWithExtensions {\n\tconst candidate = plugin as VitePluginSvelte;\n\tconst extensions = candidate.api?.options?.extensions;\n\n\tif (!plugin.name.startsWith(\"vite-plugin-svelte\")) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\tArray.isArray(extensions) && extensions.every((extension) => typeof extension === \"string\")\n\t);\n}\n\nfunction find_pre_transform_plugin_names(plugins: readonly Plugin[]): string[] {\n\treturn plugins\n\t\t.filter(\n\t\t\t(plugin) =>\n\t\t\t\t!plugin.name.startsWith(\"svelte-effect-runtime:\") &&\n\t\t\t\t!is_known_framework_pre_transform_plugin(plugin.name) &&\n\t\t\t\thas_pre_transform_priority(plugin),\n\t\t)\n\t\t.map((plugin) => plugin.name);\n}\n\nconst ansi_reset = \"\\x1b[0m\";\nconst ansi_light_green = \"\\x1b[92m\";\n\nfunction make_pre_transform_plugin_notice(plugin_names: readonly string[]): string {\n\tconst formatted_plugins = plugin_names.map((plugin_name) => ` - ${plugin_name}`).join(\"\\n\");\n\n\treturn [\n\t\t`${ansi_light_green}[svelte-effect-runtime]${ansi_reset} Svelte Effect Runtime noticed possible Vite plugin ordering conflicts.`,\n\t\t\"\",\n\t\t\"These plugins run before normal Svelte component transforms:\",\n\t\tformatted_plugins,\n\t\t\"\",\n\t\t\"This is usually fine, but if you see Svelte parser errors around <script effect>\",\n\t\t\"or yield* in components, one of those plugins may be reading component files before\",\n\t\t\"SER has lowered its syntax.\",\n\t].join(\"\\n\");\n}\n\nfunction is_known_framework_pre_transform_plugin(name: string): boolean {\n\treturn name.startsWith(\"vite:\") || name === \"vite-plugin-svelte:preprocess\";\n}\n\nfunction has_pre_transform_priority(plugin: Plugin): boolean {\n\tif (plugin.enforce === \"pre\" && plugin.transform) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof plugin.transform === \"object\" &&\n\t\tplugin.transform !== null &&\n\t\t\"order\" in plugin.transform &&\n\t\tplugin.transform.order === \"pre\"\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction make_server_rewrite_plugin(): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:server-imports\",\n\n\t\tconfig() {\n\t\t\treturn { optimizeDeps: { exclude: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!is_server_runtime_module(id)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!code.includes(\"svelte-effect-runtime\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst rewritten = await rewrite_server_imports(code, id);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\nasync function rewrite_server_imports(code: string, id: string): Promise<string> {\n\tconst [{ default: MagicString }, ts] = await Promise.all([\n\t\timport(\"magic-string\"),\n\t\timport(\"typescript\"),\n\t]);\n\tconst filename = id.split(\"?\", 2)[0] ?? id;\n\tconst source_file = ts.createSourceFile(\n\t\tfilename,\n\t\tcode,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tget_script_kind(filename, ts),\n\t);\n\tconst magic = new MagicString(code);\n\tconst ser_prerender_imports = is_remote_module(id)\n\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\tif (\n\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst bindings = statement.importClause?.namedBindings;\n\n\t\t\t\tif (\n\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t!bindings ||\n\t\t\t\t\t!ts.isNamedImports(bindings)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\treturn bindings.elements.filter(\n\t\t\t\t\t(element) =>\n\t\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"Prerender\",\n\t\t\t\t);\n\t\t\t})\n\t\t: [];\n\tconst prerender_binding_names = new Set(\n\t\tser_prerender_imports.map((element) => element.name.text),\n\t);\n\tconst prerender_namespace_names = new Set(\n\t\tis_remote_module(id)\n\t\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text) ||\n\t\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t\tstatement.importClause?.namedBindings === undefined ||\n\t\t\t\t\t\t!ts.isNamespaceImport(statement.importClause.namedBindings)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [statement.importClause.namedBindings.name.text];\n\t\t\t\t})\n\t\t\t: [],\n\t);\n\tconst ser_prerender_calls = collect_exported_ser_prerender_calls(\n\t\tsource_file,\n\t\tprerender_binding_names,\n\t\tprerender_namespace_names,\n\t\tts,\n\t);\n\tconst has_sveltekit_prerender_import = source_file.statements.some(\n\t\t(statement) =>\n\t\t\tts.isImportDeclaration(statement) &&\n\t\t\tts.isStringLiteralLike(statement.moduleSpecifier) &&\n\t\t\tstatement.moduleSpecifier.text === \"$app/server\" &&\n\t\t\tstatement.importClause?.isTypeOnly !== true &&\n\t\t\tstatement.importClause?.namedBindings !== undefined &&\n\t\t\tts.isNamedImports(statement.importClause.namedBindings) &&\n\t\t\tstatement.importClause.namedBindings.elements.some(\n\t\t\t\t(element) =>\n\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"prerender\" &&\n\t\t\t\t\telement.name.text === \"prerender\",\n\t\t\t),\n\t);\n\tconst has_top_level_prerender_binding = source_file.statements.some((statement) =>\n\t\tdeclares_top_level_value_binding(statement, \"prerender\", ts),\n\t);\n\tlet changed = false;\n\n\tif (ser_prerender_calls.size > 0 && !has_sveltekit_prerender_import) {\n\t\tif (has_top_level_prerender_binding) {\n\t\t\tthrow new Error(\n\t\t\t\t`[svelte-effect-runtime] ${filename}: Prerender remote modules reserve the top-level \"prerender\" binding for SvelteKit. Rename the existing binding.`,\n\t\t\t);\n\t\t}\n\n\t\tconst last_import = [...source_file.statements].reverse().find(ts.isImportDeclaration);\n\t\tconst native_import = `import { prerender } from \"$app/server\";`;\n\n\t\tif (last_import) {\n\t\t\tmagic.appendRight(last_import.end, `\\n${native_import}`);\n\t\t} else {\n\t\t\tmagic.prepend(`${native_import}\\n`);\n\t\t}\n\n\t\tchanged = true;\n\t}\n\n\tconst rewrite_specifier = (specifier: import(\"typescript\").StringLiteralLike) => {\n\t\tconst replacement = get_server_import_replacement(specifier.text);\n\n\t\tif (!replacement) {\n\t\t\treturn;\n\t\t}\n\n\t\tmagic.overwrite(\n\t\t\tspecifier.getStart(source_file),\n\t\t\tspecifier.end,\n\t\t\tJSON.stringify(replacement),\n\t\t);\n\t\tchanged = true;\n\t};\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (ts.isImportDeclaration(node) && ts.isStringLiteralLike(node.moduleSpecifier)) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (\n\t\t\tts.isExportDeclaration(node) &&\n\t\t\tnode.moduleSpecifier &&\n\t\t\tts.isStringLiteralLike(node.moduleSpecifier)\n\t\t) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) {\n\t\t\tconst [specifier] = node.arguments;\n\n\t\t\tif (specifier && ts.isStringLiteralLike(specifier)) {\n\t\t\t\trewrite_specifier(specifier);\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && ser_prerender_calls.has(node)) {\n\t\t\tconst missing_arguments = Math.max(0, 3 - node.arguments.length);\n\t\t\tconst injected_arguments = [\n\t\t\t\t...Array.from({ length: missing_arguments }, () => \"undefined\"),\n\t\t\t\t\"prerender\",\n\t\t\t];\n\t\t\tconst separator =\n\t\t\t\tnode.arguments.length === 0 || node.arguments.hasTrailingComma ? \"\" : \",\";\n\n\t\t\tmagic.appendLeft(node.end - 1, `${separator} ${injected_arguments.join(\", \")}`);\n\t\t\tchanged = true;\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn changed ? magic.toString() : code;\n}\n\nfunction is_ser_server_import(specifier: string): boolean {\n\treturn specifier === \"svelte-effect-runtime\" || specifier === \"svelte-effect-runtime/server\";\n}\n\nfunction is_ser_prerender_callee(\n\texpression: import(\"typescript\").Expression,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(expression)) {\n\t\treturn binding_names.has(expression.text);\n\t}\n\n\treturn (\n\t\tts.isPropertyAccessExpression(expression) &&\n\t\tts.isIdentifier(expression.expression) &&\n\t\tnamespace_names.has(expression.expression.text) &&\n\t\texpression.name.text === \"Prerender\"\n\t);\n}\n\nfunction collect_exported_ser_prerender_calls(\n\tsource_file: import(\"typescript\").SourceFile,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): ReadonlySet<import(\"typescript\").CallExpression> {\n\tconst calls = new Set<import(\"typescript\").CallExpression>();\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (\n\t\t\tts.isCallExpression(node) &&\n\t\t\tis_ser_prerender_callee(node.expression, binding_names, namespace_names, ts) &&\n\t\t\tis_exported_variable_initializer(node, ts)\n\t\t) {\n\t\t\tcalls.add(node);\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn calls;\n}\n\nfunction is_exported_variable_initializer(\n\tnode: import(\"typescript\").CallExpression,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tlet initializer: import(\"typescript\").Expression = node;\n\tlet parent = initializer.parent;\n\n\twhile (is_transparent_expression_wrapper(parent, initializer, ts)) {\n\t\tinitializer = parent;\n\t\tparent = initializer.parent;\n\t}\n\n\tif (!ts.isVariableDeclaration(parent) || parent.initializer !== initializer) {\n\t\treturn false;\n\t}\n\n\tconst statement = parent.parent.parent;\n\n\treturn (\n\t\tts.isVariableStatement(statement) &&\n\t\tstatement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ===\n\t\t\ttrue\n\t);\n}\n\nfunction is_transparent_expression_wrapper(\n\tparent: import(\"typescript\").Node,\n\texpression: import(\"typescript\").Expression,\n\tts: typeof import(\"typescript\"),\n): parent is import(\"typescript\").Expression {\n\treturn (\n\t\t(ts.isParenthesizedExpression(parent) ||\n\t\t\tts.isAsExpression(parent) ||\n\t\t\tts.isSatisfiesExpression(parent) ||\n\t\t\tts.isTypeAssertionExpression(parent) ||\n\t\t\tts.isNonNullExpression(parent)) &&\n\t\tparent.expression === expression\n\t);\n}\n\nfunction declares_top_level_value_binding(\n\tstatement: import(\"typescript\").Statement,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isImportDeclaration(statement)) {\n\t\tconst import_clause = statement.importClause;\n\n\t\tif (!import_clause || import_clause.isTypeOnly) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (import_clause.name?.text === name) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst bindings = import_clause.namedBindings;\n\n\t\tif (bindings && ts.isNamespaceImport(bindings)) {\n\t\t\treturn bindings.name.text === name;\n\t\t}\n\n\t\treturn (\n\t\t\tbindings?.elements.some(\n\t\t\t\t(element) => !element.isTypeOnly && element.name.text === name,\n\t\t\t) === true\n\t\t);\n\t}\n\n\tif (ts.isVariableStatement(statement)) {\n\t\treturn statement.declarationList.declarations.some((declaration) =>\n\t\t\tbinding_name_contains(declaration.name, name, ts),\n\t\t);\n\t}\n\n\tif (\n\t\tts.isFunctionDeclaration(statement) ||\n\t\tts.isClassDeclaration(statement) ||\n\t\tts.isEnumDeclaration(statement) ||\n\t\tts.isModuleDeclaration(statement)\n\t) {\n\t\treturn statement.name?.getText() === name;\n\t}\n\n\treturn ts.isImportEqualsDeclaration(statement) && statement.name.text === name;\n}\n\nfunction binding_name_contains(\n\tbinding: import(\"typescript\").BindingName,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(binding)) {\n\t\treturn binding.text === name;\n\t}\n\n\treturn binding.elements.some(\n\t\t(element) =>\n\t\t\t!ts.isOmittedExpression(element) && binding_name_contains(element.name, name, ts),\n\t);\n}\n\nfunction get_server_import_replacement(specifier: string): string | undefined {\n\tif (specifier === \"svelte-effect-runtime\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\tif (specifier === \"svelte-effect-runtime/internal/generators\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\treturn undefined;\n}\n\nfunction get_script_kind(filename: string, ts: typeof import(\"typescript\")) {\n\tconst normalized_filename = filename.toLowerCase();\n\n\tif (has_file_extension(normalized_filename, [\".tsx\"])) {\n\t\treturn ts.ScriptKind.TSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".jsx\"])) {\n\t\treturn ts.ScriptKind.JSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".js\", \".mjs\", \".cjs\"])) {\n\t\treturn ts.ScriptKind.JS;\n\t}\n\n\treturn ts.ScriptKind.TS;\n}\n\nfunction has_file_extension(filename: string, extensions: readonly string[]): boolean {\n\treturn extensions.some((extension) => filename.endsWith(extension));\n}\n\nfunction make_remote_client_wrapper_plugin(options?: EffectOptions): Plugin {\n\tlet has_remote_form_module = false;\n\tlet has_sveltekit_remote_bridge = false;\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:remote-client\",\n\t\tenforce: \"post\",\n\n\t\tbuildStart() {\n\t\t\thas_remote_form_module = false;\n\t\t\thas_sveltekit_remote_bridge = false;\n\t\t},\n\n\t\tbuildEnd(error) {\n\t\t\tif (error || !has_remote_form_module || has_sveltekit_remote_bridge) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t},\n\n\t\tconfig() {\n\t\t\treturn { ssr: { noExternal: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tconfigResolved(config) {\n\t\t\tconst no_external = config.ssr.noExternal;\n\t\t\tconst runtime_package = \"svelte-effect-runtime\";\n\n\t\t\tif (no_external === true) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Array.isArray(no_external)) {\n\t\t\t\tconst has_runtime_package = no_external.some((entry) => entry === runtime_package);\n\n\t\t\t\tif (!has_runtime_package) {\n\t\t\t\t\tno_external.push(runtime_package);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.ssr.noExternal = [no_external, runtime_package].filter(\n\t\t\t\t(value): value is string | RegExp => value !== undefined,\n\t\t\t);\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (is_sveltekit_remote_runtime_index(id)) {\n\t\t\t\tconst rewritten = append_sveltekit_remote_transport_bridge(code);\n\n\t\t\t\thas_sveltekit_remote_bridge = true;\n\n\t\t\t\tif (rewritten === code) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn { code: rewritten, map: null };\n\t\t\t}\n\n\t\t\tif (!is_remote_module(id)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst remote_client = await import(\"./compiler/remote-client.ts\");\n\t\t\tconst runtime_specifier = remote_client.find_remote_client_runtime_specifier(code);\n\n\t\t\tif (!runtime_specifier) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst has_remote_form = /\\.[\\s\\n]*form[\\s\\n]*\\(/.test(code);\n\n\t\t\thas_remote_form_module ||= has_remote_form;\n\n\t\t\tif (has_remote_form) {\n\t\t\t\tconst resolved_runtime = await this.resolve(runtime_specifier, id);\n\n\t\t\t\tif (!resolved_runtime || !is_sveltekit_remote_runtime_index(resolved_runtime.id)) {\n\t\t\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst rewritten = remote_client.rewrite_remote_client_exports(code, options);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\nfunction is_server_runtime_module(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\n\treturn (\n\t\t/\\.(server|remote)(?:\\.[cm])?\\.[jt]s$/.test(filename) ||\n\t\t/(?:^|[\\\\/])hooks\\.server(?:\\.[cm])?\\.[jt]s$/.test(filename)\n\t);\n}\n\nfunction is_remote_module(id: string): boolean {\n\treturn /\\.(remote|remote\\.[cm]?)\\.[jt]s(?:\\?.*)?$/.test(id) || id.includes(\".remote.\");\n}\n\nfunction is_svelte_component_module(id: string, extensions: readonly string[]): boolean {\n\tconst [filename, query = \"\"] = id.split(\"?\", 2);\n\n\tif (!extensions.some((extension) => filename.endsWith(extension))) {\n\t\treturn false;\n\t}\n\n\tif (query.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst params = new URLSearchParams(query);\n\tconst allowed_params = [\"t\", \"v\"];\n\n\treturn [...params.keys()].every((key) => allowed_params.includes(key));\n}\n\nfunction may_have_effect_diagnostics(code: string): boolean {\n\treturn (\n\t\t/\\byield\\s*\\*/.test(code) ||\n\t\tcode.includes(\"Effect\") ||\n\t\t/[\"']effect(?:\\/Effect)?[\"']/.test(code)\n\t);\n}\n\nfunction may_have_ser_syntax(code: string): boolean {\n\treturn /\\byield\\s*\\*/.test(code) || /<script\\b[^>]*\\beffect(?:[\\s=>]|$)/i.test(code);\n}\n\n/**\n * Rewrites SvelteKit's generated client remote module from:\n *\n * `export const get_post = __remote.query(\"hash/get_post\")`\n *\n * into an Effect-aware wrapper around the same native function.\n *\n * @example\n * ```ts\n * const rewritten = await rewrite_remote_client_exports(remote_module_code);\n * ```\n *\n * @since 2.0.0\n * @param code - The generated client remote module code.\n * @param options - Optional plugin options.\n * @returns A promise that resolves to the rewritten module code.\n * @internal\n */\nexport async function rewrite_remote_client_exports(\n\tcode: string,\n\toptions?: EffectOptions,\n): Promise<string> {\n\tconst remote_client = await import(\"./compiler/remote-client.ts\");\n\n\treturn remote_client.rewrite_remote_client_exports(code, options);\n}\n"],"mappings":";AAAA,MAAM,kCACL;AAED,MAAM,oCAAoC;CACzC,CAAC,WAAW,qBAAqB;CACjC,CAAC,QAAQ,kBAAkB;CAC3B,CAAC,aAAa,uBAAuB;CACrC,CAAC,SAAS,kB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