svelte-effect-runtime 4.2.4 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/chunks/{client-CpWfP_1f.js → client-Bi7SwVVy.js} +23 -13
- package/.dist/chunks/client-Bi7SwVVy.js.map +1 -0
- package/.dist/chunks/{compiler-Dpyu4Owd.js → compiler-B2htZszc.js} +8 -5
- package/.dist/chunks/{compiler-Dpyu4Owd.js.map → compiler-B2htZszc.js.map} +1 -1
- package/.dist/chunks/{remote-client-mkQAfP1G.js → remote-client-C_3kdug0.js} +15 -4
- package/.dist/chunks/remote-client-C_3kdug0.js.map +1 -0
- package/.dist/chunks/{server-BNxq-pUH.js → server-Dxb9zr99.js} +16 -3
- package/.dist/chunks/server-Dxb9zr99.js.map +1 -0
- package/.dist/compiler/remote-client.d.ts +1 -0
- package/.dist/compiler.js +1 -1
- package/.dist/environment.d.ts +9 -3
- package/.dist/environment.js.map +1 -1
- package/.dist/internal/remote-client.js +1 -1
- package/.dist/internal/remote-server.js +1 -1
- package/.dist/mod.js +1 -1
- package/.dist/remote/client/form-data.d.ts +8 -1
- package/.dist/remote/client/form.d.ts +2 -2
- package/.dist/remote/client/types.d.ts +10 -11
- package/.dist/remote/client.js +1 -1
- package/.dist/remote/native-types.d.ts +292 -0
- package/.dist/remote/server.js +1 -1
- package/.dist/server/factories.d.ts +4 -4
- package/.dist/server/live-snapshot.d.ts +2 -2
- package/.dist/server/types.d.ts +7 -7
- package/.dist/server.js +3 -3
- package/.dist/server.js.map +1 -1
- package/package.json +2 -2
- package/.dist/chunks/client-CpWfP_1f.js.map +0 -1
- package/.dist/chunks/remote-client-mkQAfP1G.js.map +0 -1
- package/.dist/chunks/server-BNxq-pUH.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-BNxq-pUH.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/remote/diagnostics.ts","../../../modules/svelte-effect-runtime/src/remote/cause-codec.ts","../../../modules/svelte-effect-runtime/src/remote/server.ts"],"sourcesContent":["import { Cause } from \"effect\";\n\n/**\n * Why a remote failure reached the client without its original detail.\n *\n * @example\n * ```ts\n * const reason: OpaqueRemoteFailureReason = \"untagged\";\n * ```\n *\n * @since 4.2.0\n */\nexport type OpaqueRemoteFailureReason = \"untagged\" | \"unserializable\" | \"unknown\" | \"interrupted\";\n\n/**\n * Request detail attached to an opaque remote failure report so the log line\n * points at the handler that produced it.\n *\n * @example\n * ```ts\n * const context: RemoteFailureContext = { method: \"POST\", url: \"/checkout\" };\n * ```\n *\n * @since 4.2.0\n */\nexport type RemoteFailureContext = {\n\treadonly method?: string;\n\treadonly route?: string;\n\treadonly url?: string;\n};\n\n/**\n * Defers building a {@link RemoteFailureContext} until a report is actually\n * rendered.\n *\n * The context describes a request SER never otherwise inspects, so resolving\n * it eagerly would read request-event properties on every remote call to\n * describe the few that fail.\n *\n * @example\n * ```ts\n * const resolve: ResolveRemoteFailureContext = () => ({ url: event.url.pathname });\n * ```\n *\n * @since 4.2.1\n */\nexport type ResolveRemoteFailureContext = () => RemoteFailureContext | undefined;\n\ntype Reporter = (message: string) => void;\n\nconst explanations: Readonly<Record<OpaqueRemoteFailureReason, string>> = {\n\tuntagged:\n\t\t\"the failure has no string `_tag`, so it cannot be told apart from an arbitrary object on the wire\",\n\tunserializable:\n\t\t\"the failure could not be serialized, even after being reduced to its own enumerable properties\",\n\tunknown: \"the cause carries no failure reason, so there was nothing to serialize\",\n\tinterrupted: \"the handler's fiber was interrupted before it produced a result\",\n};\n\nconst remedies: Readonly<Record<OpaqueRemoteFailureReason, string>> = {\n\tuntagged:\n\t\t\"Fail with a tagged error (`Data.TaggedError` or `Schema.TaggedError`) so SER can carry it to the client.\",\n\tunserializable:\n\t\t\"Remove non-transportable values (functions, class instances, cycles) from the error, or map it to a tagged error first.\",\n\tunknown:\n\t\t\"Check for a defect thrown outside the Effect error channel; the original value is shown above.\",\n\tinterrupted:\n\t\t\"An interrupt usually means the runtime was disposed mid-request, for example when the dev server restarted while this request was in flight.\",\n};\n\n/**\n * Reports a remote failure that had to be replaced with an opaque envelope.\n *\n * SER cannot send an unrecognized failure to the browser, so the client only\n * ever sees a generic 500. Without this report the original error would be\n * lost entirely, which is the difference between a debuggable failure and a\n * silent one.\n *\n * @example\n * ```ts\n * report_opaque_remote_failure(\"untagged\", cause, value, { url: \"/checkout\" });\n * ```\n *\n * @since 4.2.0\n * @param reason - Why the failure could not be transported.\n * @param cause - Full Effect cause behind the failure.\n * @param value - The original failure value, when one was found.\n * @param context - Optional request detail for the log header.\n * @param report - Sink for the rendered report; defaults to `console.error`.\n */\nexport function report_opaque_remote_failure(\n\treason: OpaqueRemoteFailureReason,\n\tcause: Cause.Cause<unknown>,\n\tvalue: unknown,\n\tresolve_context?: ResolveRemoteFailureContext,\n\treport: Reporter = default_reporter,\n): void {\n\t/**\n\t * Reporting runs before SvelteKit's error helper, and both the failure and\n\t * the request it describes are arbitrary values SER does not own. Resolve\n\t * the context in here so a request event that refuses a property cannot\n\t * replace the 500 the handler owes the client.\n\t */\n\ttry {\n\t\treport(render_opaque_remote_failure(reason, cause, value, resolve_context?.()));\n\t} catch {\n\t\t/** A diagnostic is never worth failing the request over. */\n\t}\n}\n\n/**\n * Renders the report emitted by {@link report_opaque_remote_failure}.\n *\n * @example\n * ```ts\n * const message = render_opaque_remote_failure(\"untagged\", cause, value);\n * ```\n *\n * @since 4.2.0\n * @param reason - Why the failure could not be transported.\n * @param cause - Full Effect cause behind the failure.\n * @param value - The original failure value, when one was found.\n * @param context - Optional request detail for the log header.\n * @returns The multi-line report.\n */\nexport function render_opaque_remote_failure(\n\treason: OpaqueRemoteFailureReason,\n\tcause: Cause.Cause<unknown>,\n\tvalue: unknown,\n\tcontext?: RemoteFailureContext,\n): string {\n\tconst request = render_request(context);\n\tconst lines = [\n\t\t\"[svelte-effect-runtime] A remote handler failed with an error that could not be sent to the client.\",\n\t\t` Reason: ${explanations[reason]}.`,\n\t];\n\n\tif (request) {\n\t\tlines.push(` Request: ${request}`);\n\t}\n\n\tif (reason !== \"interrupted\") {\n\t\tlines.push(` Failure: ${inspect_failure(value)}`);\n\t}\n\n\tlines.push(\" Cause:\", indent(pretty_cause(cause)), ` Fix: ${remedies[reason]}`);\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction render_request(context?: RemoteFailureContext): string | undefined {\n\tif (!context) {\n\t\treturn undefined;\n\t}\n\n\tconst target = context.url ?? context.route;\n\tconst parts = [context.method, target].filter(Boolean);\n\tconst names_route = Boolean(context.route && context.url && context.route !== context.url);\n\tconst route = names_route ? ` (route ${context.route})` : \"\";\n\n\tif (parts.length === 0) {\n\t\treturn undefined;\n\t}\n\n\treturn `${parts.join(\" \")}${route}`;\n}\n\nfunction pretty_cause(cause: Cause.Cause<unknown>): string {\n\ttry {\n\t\treturn Cause.pretty(cause);\n\t} catch {\n\t\treturn String(cause);\n\t}\n}\n\n/**\n * Renders the failure value itself. Errors keep their stack because that is\n * the only part of an untagged failure that identifies its source.\n */\nfunction inspect_failure(value: unknown): string {\n\tif (value === undefined) {\n\t\treturn \"(none)\";\n\t}\n\n\tif (value instanceof globalThis.Error) {\n\t\treturn value.stack ?? `${value.name}: ${value.message}`;\n\t}\n\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn describe_primitive(value);\n\t}\n\n\ttry {\n\t\treturn JSON.stringify(value, undefined, 2) ?? describe_object(value);\n\t} catch {\n\t\treturn describe_object(value);\n\t}\n}\n\n/** A primitive can still carry a throwing `Symbol.toPrimitive`. */\nfunction describe_primitive(value: unknown): string {\n\ttry {\n\t\treturn String(value);\n\t} catch {\n\t\treturn typeof value;\n\t}\n}\n\n/**\n * Falls back through conversions an object can subvert. A null-prototype or\n * hostile object may throw from `toString` and lack `Object.prototype`, so the\n * last resort must not touch the value at all.\n */\nfunction describe_object(value: object): string {\n\ttry {\n\t\treturn String(value);\n\t} catch {\n\t\t/** Fall through to a conversion the value cannot override. */\n\t}\n\n\ttry {\n\t\treturn Object.prototype.toString.call(value);\n\t} catch {\n\t\treturn \"[unrenderable failure]\";\n\t}\n}\n\nfunction indent(value: string): string {\n\treturn value\n\t\t.split(\"\\n\")\n\t\t.map((line) => ` ${line}`)\n\t\t.join(\"\\n\");\n}\n\nfunction default_reporter(message: string): void {\n\tconsole.error(message);\n}\n","import type { OpaqueRemoteFailureReason } from \"$/remote/diagnostics.ts\";\nimport { isHttpError, isRedirect, isValidationError } from \"@sveltejs/kit\";\nimport { is_form_error, type FormIssue } from \"$/remote/shared.ts\";\nimport { Cause, Schema } from \"effect\";\nimport { stringify } from \"devalue\";\n\n/**\n * Records that a failure lost its detail on the way to the client, so callers\n * can report the original error instead of dropping it silently.\n *\n * @example\n * ```ts\n * const diagnostic: OpaqueRemoteFailure = { reason: \"untagged\", value: err };\n * ```\n *\n * @since 4.2.0\n */\nexport type OpaqueRemoteFailure = {\n\treadonly reason: OpaqueRemoteFailureReason;\n\treadonly value: unknown;\n};\n\ntype EncodedRemoteFailure = {\n\treadonly encoded: string;\n\treadonly opaque?: OpaqueRemoteFailure;\n};\n\nexport type RemoteCauseResolution =\n\t| {\n\t\t\treadonly _tag: \"SvelteKitControlFlow\";\n\t\t\treadonly value: unknown;\n\t }\n\t| {\n\t\t\treadonly _tag: \"InterruptOnly\";\n\t\t\treadonly cause: Cause.Cause<unknown>;\n\t }\n\t| {\n\t\t\treadonly _tag: \"FormInvalid\";\n\t\t\treadonly issues: readonly FormIssue[];\n\t }\n\t| {\n\t\t\treadonly _tag: \"RemoteFailure\";\n\t\t\treadonly encoded: string;\n\t\t\treadonly opaque?: OpaqueRemoteFailure;\n\t };\n\n/** Preserves SvelteKit control flow before classifying transportable Effect failures. */\nexport function classify_remote_cause(cause: Cause.Cause<unknown>): RemoteCauseResolution {\n\tconst control_flow = find_sveltekit_control_flow(cause);\n\n\tif (control_flow !== undefined) {\n\t\treturn {\n\t\t\t_tag: \"SvelteKitControlFlow\",\n\t\t\tvalue: control_flow,\n\t\t};\n\t}\n\n\tif (Cause.hasInterruptsOnly(cause)) {\n\t\treturn {\n\t\t\t_tag: \"InterruptOnly\",\n\t\t\tcause,\n\t\t};\n\t}\n\n\tconst form_error_issues = find_form_error_issues(cause);\n\n\tif (form_error_issues !== undefined) {\n\t\treturn {\n\t\t\t_tag: \"FormInvalid\",\n\t\t\tissues: form_error_issues,\n\t\t};\n\t}\n\n\tconst failure = encode_remote_failure_detailed(cause);\n\n\treturn {\n\t\t_tag: \"RemoteFailure\",\n\t\tencoded: failure.encoded,\n\t\t...(failure.opaque ? { opaque: failure.opaque } : {}),\n\t};\n}\n\n/** Encodes a remote failure into the transport ABI shared with generated clients. */\nexport function encode_remote_failure(cause: Cause.Cause<unknown>): string {\n\treturn encode_remote_failure_detailed(cause).encoded;\n}\n\n/**\n * Encodes a remote failure and reports whether its detail survived encoding.\n *\n * @example\n * ```ts\n * const { encoded, opaque } = encode_remote_failure_detailed(cause);\n * ```\n *\n * @since 4.2.0\n * @param cause - Cause carrying the handler's failure.\n * @returns The encoded payload and, when detail was lost, why.\n */\nexport function encode_remote_failure_detailed(cause: Cause.Cause<unknown>): EncodedRemoteFailure {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isFailReason(reason)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst tagged = has_public_remote_failure_tag(reason.error);\n\n\t\tif (!tagged) {\n\t\t\treturn {\n\t\t\t\tencoded: stringify_unknown_remote_failure(),\n\t\t\t\topaque: { reason: \"untagged\", value: reason.error },\n\t\t\t};\n\t\t}\n\n\t\tconst failure = to_serializable_public_failure(reason.error);\n\t\tconst encoded = failure === undefined ? undefined : stringify_failure(failure);\n\n\t\tif (encoded !== undefined) {\n\t\t\treturn { encoded };\n\t\t}\n\n\t\treturn {\n\t\t\tencoded: stringify_unknown_remote_failure(),\n\t\t\topaque: { reason: \"unserializable\", value: reason.error },\n\t\t};\n\t}\n\n\treturn {\n\t\tencoded: stringify_unknown_remote_failure(),\n\t\topaque: { reason: \"unknown\", value: find_defect(cause) },\n\t};\n}\n\n/** Surfaces a defect so an unencodable cause still names something concrete. */\nfunction find_defect(cause: Cause.Cause<unknown>): unknown {\n\tfor (const reason of cause.reasons) {\n\t\tif (Cause.isDieReason(reason)) {\n\t\t\treturn reason.defect;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction find_sveltekit_control_flow(cause: Cause.Cause<unknown>): unknown | undefined {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isDieReason(reason)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (is_sveltekit_control_flow(reason.defect)) {\n\t\t\treturn reason.defect;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction find_form_error_issues(cause: Cause.Cause<unknown>): readonly FormIssue[] | undefined {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isFailReason(reason)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst issues = get_form_error_issues(reason.error);\n\n\t\tif (issues !== undefined) {\n\t\t\treturn issues;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction get_form_error_issues(value: unknown): readonly FormIssue[] | undefined {\n\tif (is_form_error(value)) {\n\t\treturn value.issues;\n\t}\n\n\treturn is_tagged_form_error(value) ? [] : undefined;\n}\n\nfunction is_sveltekit_control_flow(value: unknown): boolean {\n\treturn isRedirect(value) || isHttpError(value) || isValidationError(value);\n}\n\nfunction stringify_failure(value: unknown): string | undefined {\n\ttry {\n\t\treturn stringify(value);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction to_serializable_public_failure(value: unknown, seen = new WeakSet<object>()): unknown {\n\tif (typeof value === \"function\" || typeof value === \"symbol\") {\n\t\treturn undefined;\n\t}\n\n\tif (!is_object_like(value)) {\n\t\treturn value;\n\t}\n\n\tif (stringify_failure(value) !== undefined) {\n\t\treturn value;\n\t}\n\n\tif (is_internal_object(value)) {\n\t\treturn undefined;\n\t}\n\n\tif (seen.has(value)) {\n\t\treturn undefined;\n\t}\n\n\tseen.add(value);\n\n\tconst serializable = Array.isArray(value)\n\t\t? value.map((item) => to_serializable_public_failure(item, seen))\n\t\t: to_plain_record(value, seen);\n\n\tseen.delete(value);\n\n\treturn serializable;\n}\n\nfunction to_plain_record(value: object, seen: WeakSet<object>): Record<string, unknown> {\n\tconst descriptors = Object.getOwnPropertyDescriptors(value);\n\tconst record: Record<string, unknown> = {};\n\n\tfor (const [key, descriptor] of Object.entries(descriptors)) {\n\t\tif (key === \"stack\" || !(\"value\" in descriptor)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\trecord[key] = to_serializable_public_failure(descriptor.value, seen);\n\t}\n\n\tif (value instanceof Error && !(\"message\" in record)) {\n\t\trecord.message = value.message;\n\t}\n\n\treturn record;\n}\n\nfunction is_object_like(value: unknown): value is object {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nfunction has_public_remote_failure_tag(value: unknown): boolean {\n\treturn is_object_like(value) && typeof (value as { _tag?: unknown })._tag === \"string\";\n}\n\nfunction is_internal_object(value: object): boolean {\n\treturn (\n\t\t!Array.isArray(value) && !is_plain_record(value) && !has_public_remote_failure_tag(value)\n\t);\n}\n\nfunction is_plain_record(value: object): boolean {\n\tconst prototype = Object.getPrototypeOf(value);\n\n\treturn prototype === Object.prototype || prototype === null;\n}\n\nfunction create_unknown_remote_failure(): { readonly message: string } {\n\treturn { message: \"[UNKNOWN_REMOTE_FAILURE]: Unknown error\" };\n}\n\nfunction stringify_unknown_remote_failure(): string {\n\treturn stringify(create_unknown_remote_failure());\n}\n\nconst is_tagged_form_error = Schema.is(\n\tSchema.Struct({\n\t\t_tag: Schema.Literal(\"FormError\"),\n\t}),\n);\n","import { create_serialized_remote_failure_envelope } from \"$/remote/shared.ts\";\nimport { report_opaque_remote_failure } from \"$/remote/diagnostics.ts\";\nimport { RemoteHelperContextError, RemoteHelperError } from \"$/errors.ts\";\nimport type { RemoteFailureContext, ResolveRemoteFailureContext } from \"$/remote/diagnostics.ts\";\nimport { classify_remote_cause } from \"$/remote/cause-codec.ts\";\nimport type { FormIssue } from \"$/remote/shared.ts\";\nimport { Cause, Effect, Exit } from \"effect\";\n\ntype SvelteInvalid = (...issues: readonly (FormIssue | string)[]) => never;\n\ntype SvelteError = (status: number, body: unknown) => never;\n\nconst request_event_context_error_start =\n\t\"Can only read the current request event inside functions invoked during `handle`\";\n\nconst request_store_context_error = \"Could not get the request store.\";\n\nexport { encode_remote_failure } from \"$/remote/cause-codec.ts\";\n\n/** Maps a remote Effect exit into the control flow expected by SvelteKit. */\nexport async function run_remote_effect<A>(\n\teffect: Effect.Effect<A, unknown, unknown>,\n\truntime: {\n\t\trunPromise: (e: Effect.Effect<unknown, unknown, unknown>) => Promise<unknown>;\n\t},\n\tinvalid: SvelteInvalid,\n\terror: SvelteError,\n\tresolve_context?: ResolveRemoteFailureContext,\n): Promise<A> {\n\tconst exit: Exit.Exit<A, unknown> = (await runtime.runPromise(\n\t\tEffect.exit(effect) as Effect.Effect<unknown, unknown, unknown>,\n\t)) as Exit.Exit<A, unknown>;\n\n\tif (Exit.isSuccess(exit)) {\n\t\treturn exit.value;\n\t}\n\n\tthrow_remote_cause(exit.cause, invalid, error, resolve_context);\n}\n\n/** Applies a classified remote Cause decision to SvelteKit's server helpers. */\nexport function throw_remote_cause(\n\tcause: Cause.Cause<unknown>,\n\tinvalid: SvelteInvalid,\n\terror: SvelteError,\n\tresolve_context?: ResolveRemoteFailureContext,\n\treport?: (message: string) => void,\n): never {\n\tconst resolution = classify_remote_cause(cause);\n\n\tswitch (resolution._tag) {\n\t\tcase \"SvelteKitControlFlow\": {\n\t\t\tthrow resolution.value;\n\t\t}\n\t\tcase \"InterruptOnly\": {\n\t\t\treport_opaque_remote_failure(\n\t\t\t\t\"interrupted\",\n\t\t\t\tresolution.cause,\n\t\t\t\tundefined,\n\t\t\t\tresolve_context,\n\t\t\t\treport,\n\t\t\t);\n\n\t\t\tthrow Cause.squash(resolution.cause);\n\t\t}\n\t\tcase \"FormInvalid\": {\n\t\t\tinvalid(...resolution.issues);\n\t\t}\n\t\tcase \"RemoteFailure\": {\n\t\t\tconst envelope = create_serialized_remote_failure_envelope(resolution.encoded);\n\n\t\t\t/**\n\t\t\t * The client only receives a generic 500 for a failure SER could not\n\t\t\t * encode, so the original error is reported here or lost entirely.\n\t\t\t */\n\t\t\tif (resolution.opaque) {\n\t\t\t\treport_opaque_remote_failure(\n\t\t\t\t\tresolution.opaque.reason,\n\t\t\t\t\tcause,\n\t\t\t\t\tresolution.opaque.value,\n\t\t\t\t\tresolve_context,\n\t\t\t\t\treport,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\terror(500, envelope);\n\t\t}\n\t}\n}\n\n/**\n * Describes the request a remote failure occurred in.\n *\n * @example\n * ```ts\n * const context = to_remote_failure_context(event);\n * ```\n *\n * @since 4.2.0\n * @param event - Request event the handler ran under.\n * @returns Request detail for opaque failure reports.\n */\nexport function to_remote_failure_context(event: {\n\treadonly request?: { readonly method?: string };\n\treadonly route?: { readonly id?: string | null };\n\treadonly url?: { readonly pathname?: string };\n}): RemoteFailureContext {\n\tconst method = read_event_detail(() => event.request?.method);\n\tconst route = read_event_detail(() => event.route?.id ?? undefined);\n\tconst url = read_event_detail(() => event.url?.pathname);\n\n\treturn {\n\t\t...(method ? { method } : {}),\n\t\t...(route ? { route } : {}),\n\t\t...(url ? { url } : {}),\n\t};\n}\n\n/**\n * Reads one request detail, tolerating an event that refuses it.\n *\n * SvelteKit restricts which parts of a request a remote function may observe,\n * and the set has changed across releases. A diagnostic must never be the\n * reason a handler cannot answer, so an unavailable detail is simply omitted.\n */\nfunction read_event_detail(read: () => string | undefined): string | undefined {\n\ttry {\n\t\treturn read();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function throw_form_error(issues: readonly FormIssue[], invalid: SvelteInvalid): never {\n\tinvalid(...issues);\n}\n\n/** Rebrands SvelteKit context failures with the remote helper that triggered them. */\nexport function normalize_remote_helper_error(err: unknown, helper_name: string): Error {\n\tif (is_sveltekit_remote_context_error(err)) {\n\t\treturn new RemoteHelperContextError(helper_name);\n\t}\n\n\treturn err instanceof Error ? err : new RemoteHelperError(err);\n}\n\nfunction is_sveltekit_remote_context_error(err: unknown): err is Error {\n\tif (!(err instanceof Error)) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\terr.message.startsWith(request_event_context_error_start) ||\n\t\terr.message === request_store_context_error\n\t);\n}\n"],"mappings":";;;;;;AAkDA,MAAM,eAAoE;CACzE,UACC;CACD,gBACC;CACD,SAAS;CACT,aAAa;AACd;AAEA,MAAM,WAAgE;CACrE,UACC;CACD,gBACC;CACD,SACC;CACD,aACC;AACF;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,6BACf,QACA,OACA,OACA,iBACA,SAAmB,kBACZ;;;;;;;CAOP,IAAI;EACH,OAAO,6BAA6B,QAAQ,OAAO,OAAO,kBAAkB,CAAC,CAAC;CAC/E,QAAQ,CAER;AACD;;;;;;;;;;;;;;;;AAiBA,SAAgB,6BACf,QACA,OACA,OACA,SACS;CACT,MAAM,UAAU,eAAe,OAAO;CACtC,MAAM,QAAQ,CACb,uGACA,aAAa,aAAa,QAAQ,EACnC;CAEA,IAAI,SACH,MAAM,KAAK,cAAc,SAAS;CAGnC,IAAI,WAAW,eACd,MAAM,KAAK,cAAc,gBAAgB,KAAK,GAAG;CAGlD,MAAM,KAAK,YAAY,OAAO,aAAa,KAAK,CAAC,GAAG,UAAU,SAAS,SAAS;CAEhF,OAAO,MAAM,KAAK,IAAI;AACvB;AAEA,SAAS,eAAe,SAAoD;CAC3E,IAAI,CAAC,SACJ;CAGD,MAAM,SAAS,QAAQ,OAAO,QAAQ;CACtC,MAAM,QAAQ,CAAC,QAAQ,QAAQ,MAAM,CAAC,CAAC,OAAO,OAAO;CAErD,MAAM,QADc,QAAQ,QAAQ,SAAS,QAAQ,OAAO,QAAQ,UAAU,QAAQ,GAC9D,IAAI,WAAW,QAAQ,MAAM,KAAK;CAE1D,IAAI,MAAM,WAAW,G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