{"version":3,"names":["For","useComboboxRootContext","useGroupCollectionContext","ComboboxCollection","props","root","groupContext","items","flatFilteredItems","item","index","children"],"sources":["combobox-collection.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\nimport { For } from \"solid-js\";\nimport { useComboboxRootContext } from \"../root/combobox-root-context\";\nimport { useGroupCollectionContext } from \"./group-collection-context\";\n\nexport type ComboboxCollectionState = Record<string, never>;\n\nexport interface ComboboxCollectionProps<Item = unknown> {\n\t/**\n\t * Per-item render function. Receives `(item, index)` and returns the\n\t * JSX for that item (typically a `<Combobox.Item>`).\n\t */\n\tchildren: (item: Item, index: number) => JSX.Element;\n}\n\n/**\n * Renders filtered list items. Doesn't render its own HTML element.\n *\n * When placed inside a `<Combobox.Group>` context that publishes its own\n * sub-items, iterates those; otherwise iterates the root's\n * `filteredItems()` (flat). For grouped items, callers typically render a\n * `<Combobox.Group>` per group and put a `<Combobox.Collection>` inside\n * each — or use the `<Combobox.List>` render-function shorthand which\n * React also exposes.\n */\nexport function ComboboxCollection<Item = unknown>(\n\tprops: ComboboxCollectionProps<Item>,\n): JSX.Element {\n\tconst root = useComboboxRootContext();\n\tconst groupContext = useGroupCollectionContext();\n\n\tconst items = (): Item[] => {\n\t\tif (groupContext) return groupContext.items() as Item[];\n\t\treturn root.flatFilteredItems() as Item[];\n\t};\n\n\treturn (\n\t\t<For each={items()}>\n\t\t\t{(item, index) => props.children(item as Item, index())}\n\t\t</For>\n\t);\n}\n"],"mappings":"AACA,SAASA,GAAG,QAAQ,UAAU;AAC9B,SAASC,sBAAsB,QAAQ,+BAA+B;AACtE,SAASC,yBAAyB,QAAQ,4BAA4B;AAYtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CACjCC,KAAoC,EACtB;EACd,MAAMC,IAAI,GAAGJ,sBAAsB,CAAC,CAAC;EACrC,MAAMK,YAAY,GAAGJ,yBAAyB,CAAC,CAAC;EAEhD,MAAMK,KAAK,GAAGA,CAAA,KAAc;IAC3B,IAAID,YAAY,EAAE,OAAOA,YAAY,CAACC,KAAK,CAAC,CAAC;IAC7C,OAAOF,IAAI,CAACG,iBAAiB,CAAC,CAAC;EAChC,CAAC;EAED,OACC,CAAC,GAAG,CAAC,IAAI,CAAC,CAACD,KAAK,CAAC,CAAC,CAAC;AACrB,GAAG,CAAC,CAACE,IAAI,EAAEC,KAAK,KAAKN,KAAK,CAACO,QAAQ,CAACF,IAAI,EAAUC,KAAK,CAAC,CAAC,CAAC;AAC1D,EAAE,EAAE,GAAG,CAAC;AAER","ignoreList":[]}