{"version":3,"names":["createContext","useContext","ToastRootContext","undefined","useToastRootContext","ctx","Error"],"sources":["toast-root-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport type { ToastObject } from \"../use-toast-manager\";\n\n/**\n * State exposed by `<Toast.Root>` via `data-*` projection. `transitionStatus`\n * maps to `data-starting-style` / `data-ending-style` exactly like the\n * collapsible port.\n */\nexport interface ToastRootState {\n\ttransitionStatus: TransitionStatus;\n\t/** Whether any toast in the viewport is being hovered or focused. */\n\texpanded: boolean;\n\t/** Whether the toast was pushed out by the provider's `limit`. */\n\tlimited: boolean;\n\t/** The toast's `type` slot, forwarded from the toast object. */\n\ttype: string | undefined;\n\t/**\n\t * Placeholder slot — kept for parity with React's state shape so\n\t * consumers can style swipe states via `data-swiping` even though the\n\t * tier-3b Solid port doesn't emit it from internal gesture tracking.\n\t */\n\tswiping: boolean;\n\t/** See {@link ToastRootState.swiping}. */\n\tswipeDirection: \"up\" | \"down\" | \"left\" | \"right\" | undefined;\n}\n\n/**\n * Context consumed by compound parts (Title, Description, Action, Close)\n * to read the current toast + its identifiers. Every reactive slot is an\n * accessor so descendants stay subscribed without a top-level reactive\n * read.\n */\nexport interface ToastRootContextValue {\n\ttoast: Accessor<ToastObject<object>>;\n\ttitleId: Accessor<string | undefined>;\n\tsetTitleId: (next: string | undefined) => void;\n\tdescriptionId: Accessor<string | undefined>;\n\tsetDescriptionId: (next: string | undefined) => void;\n\texpanded: Accessor<boolean>;\n\t/** Visible stack index (`0` = frontmost). `-1` while exiting. */\n\tvisibleIndex: Accessor<number>;\n\t/** Re-measure the root and update stack `height` in the store. */\n\trecalculateHeight: () => void;\n}\n\nexport const ToastRootContext = createContext<\n\tToastRootContextValue | undefined\n>(undefined);\n\nexport function useToastRootContext(): ToastRootContextValue {\n\tconst ctx = useContext(ToastRootContext);\n\tif (!ctx) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.\",\n\t\t);\n\t}\n\treturn ctx;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAInE;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAO,MAAMC,gBAAgB,GAAGF,aAAa,CAE3CG,SAAS,CAAC;AAEZ,OAAO,SAASC,mBAAmBA,CAAA,EAA0B;EAC5D,MAAMC,GAAG,GAAGJ,UAAU,CAACC,gBAAgB,CAAC;EACxC,IAAI,CAACG,GAAG,EAAE;IACT,MAAM,IAAIC,KAAK,CACd,qFACD,CAAC;EACF;EACA,OAAOD,GAAG;AACX","ignoreList":[]}