{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","mergeRootProps","resolveClassStyle","useTooltipPositionerContext","useTooltipRootContext","TooltipPopup","props","rootContext","positionerContext","floatingProps","interactions","getFloatingProps","state","open","side","align","instant","instantType","transitionStatus","popupRef","el","setPopupElement","stateAttrs","data-open","undefined","data-closed","data-side","data-align","data-instant","v","data-starting-style","data-ending-style","userClassStyle","userProps","merged","Tag","as"],"sources":["tooltip-popup.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, omit } from \"solid-js\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport {\n\ttype TooltipAlign,\n\ttype TooltipSide,\n\tuseTooltipPositionerContext,\n} from \"../tooltip-positioner-context\";\nimport {\n\ttype TooltipInstantType,\n\tuseTooltipRootContext,\n} from \"../tooltip-root-context\";\n\nexport interface TooltipPopupState {\n\topen: boolean;\n\tside: TooltipSide;\n\talign: TooltipAlign;\n\tinstant: TooltipInstantType;\n\ttransitionStatus: TransitionStatus;\n}\n\nexport interface TooltipPopupProps\n\textends BaseUIComponentProps<\"div\", TooltipPopupState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"div\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n}\n\n/**\n * A container for the tooltip contents. Renders a `<div>` element. Mirrors\n * Base UI React's `<Tooltip.Popup>`.\n *\n * Solid 2.0-native rewire (§1 wave 2): replaces `renderElement` with\n * `dynamic(() => props.as ?? \"div\")` and composes\n * `floatingProps` + state-attr getters via `mergeRootProps`.\n */\nexport function TooltipPopup(props: TooltipPopupProps): JSX.Element {\n\tconst rootContext = useTooltipRootContext();\n\tconst positionerContext = useTooltipPositionerContext();\n\n\tconst floatingProps = rootContext.interactions.getFloatingProps();\n\n\tconst state = createMemo<TooltipPopupState>(() => ({\n\t\topen: rootContext.open(),\n\t\tside: positionerContext.side(),\n\t\talign: positionerContext.align(),\n\t\tinstant: rootContext.instantType(),\n\t\ttransitionStatus: rootContext.transitionStatus(),\n\t}));\n\n\tconst popupRef = (el: HTMLElement | null) => {\n\t\trootContext.setPopupElement(el);\n\t};\n\n\tconst stateAttrs = {\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-closed\"() {\n\t\t\treturn state().open ? undefined : \"\";\n\t\t},\n\t\tget \"data-side\"() {\n\t\t\treturn state().side;\n\t\t},\n\t\tget \"data-align\"() {\n\t\t\treturn state().align;\n\t\t},\n\t\tget \"data-instant\"() {\n\t\t\tconst v = state().instant;\n\t\t\treturn v ? v : undefined;\n\t\t},\n\t\tget \"data-starting-style\"() {\n\t\t\treturn state().transitionStatus === \"starting\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-ending-style\"() {\n\t\t\treturn state().transitionStatus === \"ending\" ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\n\tconst userProps = omit(props, \"as\", \"class\", \"style\", \"attrs\");\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tfloatingProps ?? {},\n\t\tstateAttrs,\n\t);\n\tmerged = mergeRootProps(merged, userClassStyle);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"div\");\n\treturn <Tag {...merged} ref={composeRefs(popupRef, userRef(props))} />;\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,UAAU,EAAEC,IAAI,QAAQ,UAAU;AAC3C,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAq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