{"version":3,"names":["createMemo","useComboboxRootContext","AutocompleteValue","props","root","resolved","value","String","inputValue","children"],"sources":["autocomplete-value.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n/**\n * `<Autocomplete.Value>` — displays the current input value (the\n * autocomplete's source of truth). Render-function children receive\n * `(value: string)` matching React's `AutocompleteValue`.\n */\n\nimport { createMemo } from \"solid-js\";\nimport { useComboboxRootContext } from \"../../combobox/root/combobox-root-context\";\n\nexport interface AutocompleteValueProps {\n\tchildren?: ((value: string) => JSX.Element) | JSX.Element;\n}\n\nexport function AutocompleteValue(props: AutocompleteValueProps): JSX.Element {\n\tconst root = useComboboxRootContext();\n\n\tconst resolved = createMemo<JSX.Element>(() => {\n\t\tconst value = String(root.inputValue());\n\t\tif (typeof props.children === \"function\") {\n\t\t\treturn (props.children as (v: string) => JSX.Element)(value);\n\t\t}\n\t\tif (props.children != null) return props.children as JSX.Element;\n\t\treturn value as JSX.Element;\n\t});\n\n\treturn <>{resolved()}</>;\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,UAAU;AACrC,SAASC,sBAAsB,QAAQ,2CAA2C;AAMlF,OAAO,SAASC,iBAAiBA,CAACC,KAA6B,EAAe;EAC7E,MAAMC,IAAI,GAAGH,sBAAsB,CAAC,CAAC;EAErC,MAAMI,QAAQ,GAAGL,UAAU,CAAc,MAAM;IAC9C,MAAMM,KAAK,GAAGC,MAAM,CAACH,IAAI,CAACI,UAAU,CAAC,CAAC,CAAC;IACvC,IAAI,OAAOL,KAAK,CAACM,QAAQ,KAAK,UAAU,EAAE;MACzC,OAAQN,KAAK,CAACM,QAAQ,CAAgCH,KAAK,CAAC;IAC7D;IACA,IAAIH,KAAK,CAACM,QAAQ,IAAI,IAAI,EAAE,OAAON,KAAK,CAACM,QAAQ;IACjD,OAAOH,KAAK;EACb,CAAC,CAAC;EAEF,OAAO,EAAE,CAACD,QAAQ,CAAC,CAAC,CAAC,GAAG;AACzB","ignoreList":[]}