{"version":3,"sources":["../src/constants.ts","../src/render/node.ts","../src/render/element.ts","../src/blueprint/blueprint.ts","../src/errors.ts","../src/jsx/runtime.ts"],"names":["Data","Element","Text","Fragment","List","Blueprint","Predicate","props","pipe","Option","children"],"mappings":";;;;;AA0BO,IAAM,WAAA,mBAAc,MAAA,CAAO,GAAA,CAAI,aAAa,CAAA;AAE5C,IAAM,QAAA,mBAAW,MAAA,CAAO,GAAA,CAAI,iBAAiB,CAAA;AAuBpD,IAAM,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,UAAU,IAAA,EAAM,GAAA,EAAI,GACrDA,WAAA,CAAK,UAAA,EAA6B;;;ACsBnC,IAAM,EAAE,MAAA,EAAQ,OAAA,EAAAC,QAAAA,EAAS,MAAAC,KAAAA,EAAM,QAAA,EAAAC,SAAAA,EAAU,IAAA,EAAAC,KAAAA,EAAM,SAAA,EAAAC,UAAAA,EAAU,GACxDL,YAAK,UAAA,EAAuB;AAWtB,IAAM,iBAAA,GAAoB,CAAC,IAAA,KACjCC,QAAAA,CAAQ,IAAI,CAAA;AASN,IAAM,mBAAA,GAAsB,CAAC,IAAA,KACnCI,UAAAA,CAAU,IAAI,CAAA;AAmBR,IAAM,kBAAA,GAAqB,CAAC,QAAA,KAClCF,SAAAA,CAAS;AAAA,EACR,CAAC,WAAW,GAAG,IAAA;AAAA,EACf;AACD,CAAC,CAAA;ACjEK,SAAS,EAAA,CACf,cAAA,EACA,WAAA,EAAA,GAEG,IAAA,EACU;AACb,EAAA,IAAIG,gBAAAA,CAAU,QAAA,CAAS,cAAc,CAAA,EAAG;AACvC,IAAA,MAAMC,MAAAA,GAAQ,WAAA;AACd,IAAA,MAAM,QAAA,GAAW,kBAAkB,IAAqB,CAAA;AAExD,IAAA,OAAO,iBAAA,CAAkB;AAAA,MACxB,CAAC,WAAW,GAAG,IAAA;AAAA,MACf,GAAA,EAAK,cAAA;AAAA,MACL,OAAOA,MAAAA,IAAS,IAAA;AAAA,MAChB,QAAA;AAAA,M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A,EAAG;AAC5B,IAAA,OAAO,QAAA;AAAA,EACR;AAEA,EAAA,OAAO,CAAC,QAAuB,CAAA;AAChC,CAAA","file":"jsx-runtime.cjs","sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2025 Chris M. Perez\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Data } from 'effect';\n\nexport const EFFUSE_NODE = Symbol.for('effuse.node');\n\nexport const FRAGMENT = Symbol.for('effuse.fragment');\n\nexport const SIGNAL_REF = Symbol('effuse.signal.ref');\n\nexport const REACTIVE_MARKER = Symbol('effuse.reactive');\n\nexport const READONLY_MARKER = Symbol('effuse.readonly');\n\nexport const MATCH_MARKER = Symbol('effuse.match');\n\nexport const SUSPEND_TOKEN = Symbol.for('effuse/SuspendToken');\nexport const BOUNDARY_ID_PREFIX = 'suspense-boundary-';\n\nexport const HYDRATION_SCRIPT_ID = '__EFFUSE_DATA__';\n\ntype NodeTypeInternal = Data.TaggedEnum<{\n\tElement: object;\n\tText: object;\n\tBlueprint: object;\n\tFragment: object;\n\tList: object;\n}>;\n\nconst { Element, Text, Blueprint, Fragment, List, $is } =\n\tData.taggedEnum<NodeTypeInternal>();\n\nexport const NodeType = { Element, Text, Blueprint, Fragment, List };\n\nexport const isNodeElement = (n: NodeTypeInternal): boolean =>\n\t$is('Element')(n);\nexport const isNodeText = (n: NodeTypeInternal): boolean => $is('Text')(n);\nexport const isNodeBlueprint = (n: NodeTypeInternal): boolean =>\n\t$is('Blueprint')(n);\nexport const isNodeFragment = (n: NodeTypeInternal): boolean =>\n\t$is('Fragment')(n);\nexport const isNodeList = (n: NodeTypeInternal): boolean => $is('List')(n);\n\nexport const matchNodeType = <R>(\n\tnodeType: NodeTypeInternal,\n\thandlers: {\n\t\tonElement: () => R;\n\t\tonText: () => R;\n\t\tonBlueprint: () => R;\n\t\tonFragment: () => R;\n\t\tonList: () => R;\n\t}\n): R => {\n\tswitch (nodeType._tag) {\n\t\tcase 'Element':\n\t\t\treturn handlers.onElement();\n\t\tcase 'Text':\n\t\t\treturn handlers.onText();\n\t\tcase 'Blueprint':\n\t\t\treturn handlers.onBlueprint();\n\t\tcase 'Fragment':\n\t\t\treturn handlers.onFragment();\n\t\tcase 'List':\n\t\t\treturn handlers.onList();\n\t}\n};\n","import { Data, Predicate } from 'effect';\nimport type { Signal } from '../types/index.js';\nimport type { ElementProps, Portals, PortalFn } from '../schema/index.js';\nimport { EFFUSE_NODE, NodeType } from '../constants.js';\n\nexport type { ElementProps, Portals, PortalFn };\n\nexport { EFFUSE_NODE, NodeType };\n\nexport type EffuseChild =\n\t| EffuseNode\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| undefined\n\t| Signal<EffuseChild>\n\t| (() => EffuseChild)\n\t| EffuseChild[];\n\nexport interface BlueprintContext<P = Record<string, unknown>> {\n\treadonly props: P;\n\treadonly state: Record<string, unknown>;\n\treadonly portals: Portals;\n}\n\nexport interface BlueprintDef<P = Record<string, unknown>> {\n\treadonly _tag: 'Blueprint';\n\treadonly name?: string | undefined;\n\treadonly props?: P | undefined;\n\tstate?(props: P): Record<string, unknown>;\n\tview(context: BlueprintContext<P>): EffuseChild;\n\terror?(error: Error): EffuseChild;\n\tloading?(): EffuseChild;\n}\n\nexport interface Component<\n\tP = Record<string, unknown>,\n> extends BlueprintDef<P> {\n\t(props?: P): EffuseNode;\n}\n\nexport type EffuseNode = Data.TaggedEnum<{\n\tElement: {\n\t\treadonly [EFFUSE_NODE]: true;\n\t\treadonly tag: string;\n\t\treadonly props: ElementProps | null;\n\t\treadonly children: EffuseChild[];\n\t\treadonly key?: string | number | undefined;\n\t};\n\tText: {\n\t\treadonly [EFFUSE_NODE]: true;\n\t\treadonly text: string;\n\t\treadonly key?: string | number | undefined;\n\t};\n\tFragment: {\n\t\treadonly [EFFUSE_NODE]: true;\n\t\treadonly children: EffuseChild[];\n\t\treadonly key?: string | number | undefined;\n\t};\n\tList: {\n\t\treadonly [EFFUSE_NODE]: true;\n\t\treadonly children: EffuseChild[];\n\t\treadonly key?: string | number | undefined;\n\t};\n\tBlueprint: {\n\t\treadonly [EFFUSE_NODE]: true;\n\t\treadonly blueprint: BlueprintDef;\n\t\treadonly props: Record<string, unknown>;\n\t\treadonly portals: Portals | null;\n\t\treadonly key?: string | number | undefined;\n\t};\n}>;\n\nconst { $match, Element, Text, Fragment, List, Blueprint } =\n\tData.taggedEnum<EffuseNode>();\n\nexport const isEffuseNode = (u: unknown): u is EffuseNode =>\n\tPredicate.isObject(u) && Predicate.hasProperty(u, EFFUSE_NODE);\n\nexport type ElementNodeInput = Omit<ElementNode, '_tag'>;\nexport type TextNodeInput = Omit<TextNode, '_tag'>;\nexport type FragmentNodeInput = Omit<FragmentNode, '_tag'>;\nexport type ListNodeInput = Omit<ListNode, '_tag'>;\nexport type BlueprintNodeInput = Omit<BlueprintNode, '_tag'>;\n\nexport const CreateElementNode = (args: ElementNodeInput): ElementNode =>\n\tElement(args);\n\nexport const CreateTextNode = (args: TextNodeInput): TextNode => Text(args);\n\nexport const CreateFragmentNode = (args: FragmentNodeInput): FragmentNode =>\n\tFragment(args);\n\nexport const CreateListNode = (args: ListNodeInput): ListNode => List(args);\n\nexport const CreateBlueprintNode = (args: BlueprintNodeInput): BlueprintNode =>\n\tBlueprint(args);\n\nexport const matchEffuseNode = $match;\n\nexport type ElementNode = Extract<EffuseNode, { _tag: 'Element' }>;\nexport type TextNode = Extract<EffuseNode, { _tag: 'Text' }>;\nexport type FragmentNode = Extract<EffuseNode, { _tag: 'Fragment' }>;\nexport type ListNode = Extract<EffuseNode, { _tag: 'List' }>;\nexport type BlueprintNode<P = Record<string, unknown>> = Extract<\n\tEffuseNode,\n\t{ _tag: 'Blueprint' }\n> & { props: P; blueprint: BlueprintDef<P> };\n\nexport const createTextNode = (text: string): TextNode =>\n\tText({\n\t\t[EFFUSE_NODE]: true,\n\t\ttext,\n\t});\n\nexport const createFragmentNode = (children: EffuseChild[]): FragmentNode =>\n\tFragment({\n\t\t[EFFUSE_NODE]: true,\n\t\tchildren,\n\t});\n\nexport const createListNode = (children: EffuseChild[]): ListNode =>\n\tList({\n\t\t[EFFUSE_NODE]: true,\n\t\tchildren,\n\t});\n\nexport const isSignalChild = (value: unknown): value is Signal<EffuseChild> => {\n\treturn (\n\t\tPredicate.isObject(value) &&\n\t\t'value' in value &&\n\t\tPredicate.isObject((value as Record<string, unknown>)._subscribers)\n\t);\n};\n","/**\n * MIT License\n *\n * Copyright (c) 2025 Chris M. Perez\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Option, pipe, Predicate } from 'effect';\nimport {\n\ttype EffuseNode,\n\ttype EffuseChild,\n\ttype ElementProps,\n\ttype ElementNode,\n\ttype BlueprintNode,\n\ttype BlueprintDef,\n\ttype Portals,\n\ttype PortalFn,\n\tCreateElementNode,\n\tCreateBlueprintNode,\n\tcreateFragmentNode,\n\tcreateTextNode,\n} from './node.js';\nimport { EFFUSE_NODE } from '../constants.js';\n\nexport function el(\n\ttag: string,\n\tprops?: ElementProps | null,\n\t...children: EffuseChild[]\n): ElementNode;\n\nexport function el<P>(\n\tblueprint: BlueprintDef<P>,\n\tprops?: P | null,\n\n\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n\tportals?: Portals | PortalFn | null\n): BlueprintNode<P>;\n\nexport function el(\n\ttagOrBlueprint: string | BlueprintDef,\n\tpropsOrNull?: ElementProps | Record<string, never> | null,\n\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n\t...rest: (EffuseChild | Portals | PortalFn | null)[]\n): EffuseNode {\n\tif (Predicate.isString(tagOrBlueprint)) {\n\t\tconst props = propsOrNull as ElementProps | null;\n\t\tconst children = normalizeChildren(rest as EffuseChild[]);\n\n\t\treturn CreateElementNode({\n\t\t\t[EFFUSE_NODE]: true,\n\t\t\ttag: tagOrBlueprint,\n\t\t\tprops: props ?? null,\n\t\t\tchildren,\n\t\t\tkey: pipe(\n\t\t\t\tOption.fromNullable(props),\n\t\t\t\tOption.flatMap((p) => Option.fromNullable(p.key)),\n\t\t\t\tOption.getOrUndefined\n\t\t\t),\n\t\t});\n\t}\n\n\tconst blueprint = tagOrBlueprint;\n\tconst props = propsOrNull ?? {};\n\tconst portalsArg = rest[0];\n\n\tlet portals: Portals | null = null;\n\tif (Predicate.isFunction(portalsArg)) {\n\t\tportals = { default: portalsArg as PortalFn };\n\t} else if (\n\t\tportalsArg &&\n\t\tPredicate.isObject(portalsArg) &&\n\t\t!Array.isArray(portalsArg)\n\t) {\n\t\tportals = portalsArg as Portals;\n\t}\n\n\treturn CreateBlueprintNode({\n\t\t[EFFUSE_NODE]: true,\n\t\tblueprint,\n\t\tprops,\n\t\tportals,\n\t\tkey: (props as { key?: string | number }).key,\n\t});\n}\n\n// Build fragment node\nexport const fragment = (...children: EffuseChild[]): EffuseNode => {\n\treturn createFragmentNode(normalizeChildren(children));\n};\n\nconst normalizeChildren = (children: EffuseChild[]): EffuseChild[] => {\n\tconst result: EffuseChild[] = [];\n\n\tfor (const child of children) {\n\t\tif (Predicate.isNullable(child) || Predicate.isBoolean(child)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (Array.isArray(child)) {\n\t\t\tresult.push(...normalizeChildren(child));\n\t\t} else {\n\t\t\tresult.push(child);\n\t\t}\n\t}\n\n\treturn result;\n};\n\n// Convert child to reactive node\nexport const toNode = (child: EffuseChild): EffuseNode | null => {\n\tif (Predicate.isNullable(child) || Predicate.isBoolean(child)) {\n\t\treturn null;\n\t}\n\n\tif (Predicate.isString(child)) {\n\t\treturn createTextNode(child);\n\t}\n\n\tif (Predicate.isNumber(child)) {\n\t\treturn createTextNode(String(child));\n\t}\n\n\tif (Predicate.isObject(child) && EFFUSE_NODE in child) {\n\t\treturn child;\n\t}\n\n\treturn null;\n};\n","/**\n * MIT License\n *\n * Copyright (c) 2025 Chris M. Perez\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Predicate } from 'effect';\nimport type { Signal } from '../types/index.js';\nimport type {\n\tBlueprintDef,\n\tBlueprintContext,\n\tEffuseChild,\n\tPortals,\n} from '../render/node.js';\nimport type { PropSchemaBuilder } from './props.js';\n\nexport type PropsDef<P> = {\n\t[K in keyof P]?: P[K] | (() => P[K]);\n};\n\nexport interface BlueprintOptions<\n\tP extends Record<string, unknown> = Record<string, unknown>,\n> {\n\treadonly name?: string;\n\treadonly props?: PropsDef<P>;\n\treadonly propsSchema?: PropSchemaBuilder<P>;\n\treadonly state?: (props: P) => Record<string, Signal<unknown>>;\n\treadonly view: (context: BlueprintContext<P>) => EffuseChild;\n\treadonly error?: (error: Error) => EffuseChild;\n\treadonly loading?: () => EffuseChild;\n}\n\n// Build blueprint definition\nexport const blueprint = <\n\tP extends Record<string, unknown> = Record<string, unknown>,\n>(\n\toptions: BlueprintOptions<P>\n): BlueprintDef<P> => {\n\tconst def: BlueprintDef<P> = {\n\t\t_tag: 'Blueprint',\n\t\tname: options.name,\n\t\tview: options.view,\n\t};\n\n\tconst mutableDef = def as unknown as Record<string, unknown>;\n\tif (options.state) {\n\t\tmutableDef.state = options.state;\n\t}\n\tif (options.error) {\n\t\tmutableDef.error = options.error;\n\t}\n\tif (options.loading) {\n\t\tmutableDef.loading = options.loading;\n\t}\n\tif (options.propsSchema) {\n\t\tmutableDef.propsSchema = options.propsSchema;\n\t}\n\n\treturn def;\n};\n\n// Verify blueprint definition\nexport const isBlueprint = (value: unknown): value is BlueprintDef => {\n\treturn (\n\t\tPredicate.isObject(value) &&\n\t\tPredicate.hasProperty(value, '_tag') &&\n\t\tvalue._tag === 'Blueprint'\n\t);\n};\n\n// Initialize blueprint context\nexport const instantiateBlueprint = <P extends Record<string, unknown>>(\n\tdef: BlueprintDef<P>,\n\tprops: P,\n\tportals: Portals\n): BlueprintContext<P> => {\n\tlet validatedProps = props;\n\n\tconst defWithSchema = def as unknown as {\n\t\tpropsSchema?: PropSchemaBuilder<P>;\n\t};\n\tif (defWithSchema.propsSchema) {\n\t\tvalidatedProps = defWithSchema.propsSchema.validateSync(props, def.name);\n\t}\n\n\tconst state = def.state ? def.state(validatedProps) : {};\n\n\treturn {\n\t\tprops: validatedProps,\n\t\tstate,\n\t\tportals,\n\t};\n};\n\n// Build anonymous blueprint\n","/**\n * MIT License\n *\n * Copyright (c) 2025 Chris M. Perez\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Data, Effect, Predicate } from 'effect';\n\nexport class UnknownJSXTypeError extends Data.TaggedError(\n\t'UnknownJSXTypeError'\n)<{\n\treadonly type: unknown;\n}> {}\n\nexport class DuplicateKeysError extends Data.TaggedError('DuplicateKeysError')<{\n\treadonly component: string;\n}> {}\n\nexport class ResourcePendingError extends Data.TaggedError(\n\t'ResourcePendingError'\n)<{\n\treadonly message: string;\n}> {}\n\nexport class PropValidationError extends Data.TaggedError(\n\t'PropValidationError'\n)<{\n\treadonly cause: unknown;\n}> {}\n\nexport class ScriptContextError extends Data.TaggedError('ScriptContextError')<{\n\treadonly message: string;\n}> {}\n\nexport class StoreGetterNotConfiguredError extends Data.TaggedError(\n\t'StoreGetterNotConfiguredError'\n)<Record<string, never>> {}\n\nexport class CauseExtractionError extends Data.TaggedError(\n\t'CauseExtractionError'\n)<{\n\treadonly cause: unknown;\n}> {}\n\nexport class ResourceFetchError extends Data.TaggedError('ResourceFetchError')<{\n\treadonly message: string;\n\treadonly cause?: unknown;\n}> {}\n\nexport class LayerExecutionError extends Data.TaggedError(\n\t'LayerExecutionError'\n)<{\n\treadonly message: string;\n\treadonly cause?: unknown;\n}> {}\n\nexport const mapEffuseErrors = <A, E>(\n\teffect: Effect.Effect<A, E>\n): Effect.Effect<A, Error> =>\n\tEffect.catchAll(effect, (e) => {\n\t\tif (e instanceof Error && !('_tag' in e)) {\n\t\t\treturn Effect.fail(e);\n\t\t}\n\t\tif (Predicate.isObject(e) && Predicate.hasProperty(e, '_tag')) {\n\t\t\tconst tag = e._tag;\n\t\t\tconst msg = Predicate.hasProperty(e, 'message')\n\t\t\t\t? e.message\n\t\t\t\t: String(e);\n\t\t\treturn Effect.fail(new Error(`[Effuse] ${String(tag)}: ${String(msg)}`));\n\t\t}\n\t\treturn Effect.fail(new Error(String(e)));\n\t});\n","/**\n * MIT License\n *\n * Copyright (c) 2025 Chris M. Perez\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n\ttype EffuseNode,\n\ttype EffuseChild,\n\ttype BlueprintDef,\n\ttype Component,\n\ttype Portals,\n\tCreateBlueprintNode,\n} from '../render/node.js';\nimport type { ElementProps } from '../schema/index.js';\nimport { EFFUSE_NODE, FRAGMENT } from '../constants.js';\nimport { el, fragment } from '../render/element.js';\nimport { isBlueprint } from '../blueprint/blueprint.js';\nimport { UnknownJSXTypeError } from '../errors.js';\nimport type { BaseIntrinsicElements } from './types/intrinsic.js';\nimport { pipe, Predicate } from 'effect';\n\ninterface FragmentProps {\n\tchildren?: EffuseChild;\n}\n\nexport type * from './types/index.js';\n\nexport interface FragmentComponent {\n\t(props: FragmentProps): EffuseNode;\n\treadonly _tag: typeof FRAGMENT;\n}\n\nexport const Fragment: FragmentComponent = pipe(\n\t(props: FragmentProps): EffuseNode =>\n\t\tfragment(...normalizeJSXChildren(props.children)),\n\t(fn) => Object.assign(fn, { _tag: FRAGMENT } as const)\n);\n\nconst isFragment = (value: unknown): value is FragmentComponent =>\n\tPredicate.isFunction(value) &&\n\tPredicate.hasProperty(value, '_tag') &&\n\tvalue._tag === FRAGMENT;\n\nexport type JSXElement = EffuseNode;\n\nexport const jsx = (\n\ttype: string | BlueprintDef | typeof Fragment,\n\tprops: Record<string, unknown> | null,\n\tkey?: string | number\n): EffuseNode => {\n\tif (type === Fragment) {\n\t\tconst { children } = props ?? {};\n\t\tconst childArray = normalizeJSXChildren(children);\n\t\treturn fragment(...childArray);\n\t}\n\n\tconst { children, ...restProps } = props ?? {};\n\tconst propsWithKey = key !== undefined ? { ...restProps, key } : restProps;\n\n\tif (Predicate.isString(type)) {\n\t\tconst childArray = normalizeJSXChildren(children);\n\t\treturn el(type, propsWithKey as ElementProps, ...childArray);\n\t}\n\n\tif (isBlueprint(type)) {\n\t\tconst portals =\n\t\t\tPredicate.isObject(children) && !Array.isArray(children)\n\t\t\t\t? (children as Portals)\n\t\t\t\t: children\n\t\t\t\t\t? { default: () => children as EffuseChild }\n\t\t\t\t\t: null;\n\n\t\tconst blueprintProps =\n\t\t\tchildren !== undefined ? { ...propsWithKey, children } : propsWithKey;\n\n\t\treturn CreateBlueprintNode({\n\t\t\t[EFFUSE_NODE]: true,\n\t\t\tblueprint: type,\n\t\t\tprops: blueprintProps,\n\t\t\tportals,\n\t\t\tkey: propsWithKey.key as string | number | undefined,\n\t\t});\n\t}\n\n\tif (Predicate.isFunction(type) && !isFragment(type)) {\n\t\tconst componentProps =\n\t\t\tkey !== undefined\n\t\t\t\t? { ...restProps, key, children }\n\t\t\t\t: { ...restProps, children };\n\t\treturn (type as Component)(componentProps);\n\t}\n\n\tif (isFragment(type)) {\n\t\treturn type({ children: children as EffuseChild });\n\t}\n\n\tthrow new UnknownJSXTypeError({ type });\n};\n\nexport const jsxs = jsx;\n\nexport const jsxDEV = (\n\ttype: string | BlueprintDef | typeof Fragment,\n\tprops: Record<string, unknown> | null,\n\tkey?: string | number\n): EffuseNode => {\n\tif (type === Fragment) {\n\t\tconst { children } = props ?? {};\n\t\tconst childArray = normalizeJSXChildren(children);\n\t\treturn fragment(...childArray);\n\t}\n\n\treturn jsx(type, props, key);\n};\n\nconst normalizeJSXChildren = (children: unknown): EffuseChild[] => {\n\tif (Predicate.isNullable(children)) {\n\t\treturn [];\n\t}\n\n\tif (Array.isArray(children)) {\n\t\treturn children as EffuseChild[];\n\t}\n\n\treturn [children as EffuseChild];\n};\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace JSX {\n\texport type Element = EffuseNode;\n\texport type ElementClass = never;\n\n\texport interface IntrinsicAttributes {\n\t\tkey?: string | number | undefined;\n\t}\n\n\texport type ElementType =\n\t\t| string\n\t\t| BlueprintDef\n\t\t| Component\n\t\t| FragmentComponent\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t| ((props: any) => EffuseNode);\n\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\texport type LibraryManagedAttributes<_C, P> = P & IntrinsicAttributes;\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type\n\texport interface IntrinsicElements extends BaseIntrinsicElements {}\n\n\texport interface ElementChildrenAttribute {\n\t\tchildren: unknown;\n\t}\n}\n"]}