{"version":3,"names":["createContext","useContext","TooltipPositionerContext","useTooltipPositionerContext","context","Error"],"sources":["tooltip-positioner-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { MutableRef } from \"../internals/floating-ui/types\";\n\nexport type TooltipSide =\n\t| \"top\"\n\t| \"bottom\"\n\t| \"left\"\n\t| \"right\"\n\t| \"inline-end\"\n\t| \"inline-start\";\n\nexport type TooltipAlign = \"start\" | \"center\" | \"end\";\n\n/**\n * Context shape published by `<Tooltip.Positioner>` so descendants (`Popup`,\n * `Arrow`) can read the resolved placement / arrow ref / arrow styles.\n */\nexport interface TooltipPositionerContextValue {\n\t/** The resolved side (post-flip / post-shift). */\n\tside: Accessor<TooltipSide>;\n\t/** The resolved alignment (post-flip / post-shift). */\n\talign: Accessor<TooltipAlign>;\n\t/** Whether the arrow has been pushed outside the centered axis. */\n\tarrowUncentered: Accessor<boolean>;\n\t/** Inline styles to apply to the arrow element (`left`/`top`/etc.). */\n\tarrowStyles: Accessor<Record<string, string | number | undefined>>;\n\t/** Mutable ref for the arrow element — consumed by the `arrow` middleware. */\n\tarrowRef: MutableRef<HTMLDivElement | null>;\n\t/** Whether the anchor element is outside the viewport (after `hide`). */\n\tanchorHidden: Accessor<boolean>;\n}\n\nexport const TooltipPositionerContext =\n\tcreateContext<TooltipPositionerContextValue | null>(null);\n\nexport function useTooltipPositionerContext(): TooltipPositionerContextValue {\n\tconst context = useContext(TooltipPositionerContext);\n\tif (context === null) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: TooltipPositionerContext is missing. Tooltip.Popup and Tooltip.Arrow must be placed within <Tooltip.Positioner>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAanE;AACA;AACA;AACA;;AAgBA,OAAO,MAAMC,wBAAwB,GACpCF,aAAa,CAAuC,IAAI,CAAC;AAE1D,OAAO,SAASG,2BAA2BA,CAAA,EAAkC;EAC5E,MAAMC,OAAO,GAAGH,UAAU,CAACC,wBAAwB,CAAC;EACpD,IAAIE,OAAO,KAAK,IAAI,EAAE;IACrB,MAAM,IAAIC,KAAK,CACd,2HACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}