{"version":3,"names":["createContext","useContext","ScrollAreaViewportContext","useScrollAreaViewportContext","context","Error"],"sources":["scroll-area-viewport-context.ts"],"sourcesContent":["import { createContext, useContext } from \"solid-js\";\n\n/**\n * Context handed to descendants of `<ScrollArea.Viewport>`. Currently only\n * `<ScrollArea.Content>` uses this — it calls `computeThumbPosition()` when\n * its ResizeObserver fires.\n */\nexport interface ScrollAreaViewportContextValue {\n\tcomputeThumbPosition: () => void;\n}\n\n/**\n * `createContext<T | null>(null)` + `== null` sentinel —\n * Solid 2's `useContext` throws `ContextNotFoundError` when the default is\n * `undefined`, which would shadow the intended Base UI error message below.\n */\nexport const ScrollAreaViewportContext =\n\tcreateContext<ScrollAreaViewportContextValue | null>(null);\n\nexport function useScrollAreaViewportContext(): ScrollAreaViewportContextValue {\n\tconst context = useContext(ScrollAreaViewportContext);\n\tif (context == null) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAEpD;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GACrCF,aAAa,CAAwC,IAAI,CAAC;AAE3D,OAAO,SAASG,4BAA4BA,CAAA,EAAmC;EAC9E,MAAMC,OAAO,GAAGH,UAAU,CAACC,yBAAyB,CAAC;EACrD,IAAIE,OAAO,IAAI,IAAI,EAAE;IACpB,MAAM,IAAIC,KAAK,CACd,mHACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}