{"version":3,"file":"author-select.cjs","names":["buildTermsTree","TreeSelect"],"sources":["../../src/query-controls/author-select.tsx"],"sourcesContent":["import { buildTermsTree } from './terms';\nimport TreeSelect from '../tree-select';\nimport type { AuthorSelectProps } from './types';\n\nexport default function AuthorSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tauthorList,\n\tselectedAuthorId,\n\tonChange: onChangeProp,\n}: AuthorSelectProps ) {\n\tif ( ! authorList ) {\n\t\treturn null;\n\t}\n\tconst termsTree = buildTermsTree( authorList );\n\treturn (\n\t\t<TreeSelect\n\t\t\t{ ...{\n\t\t\t\tlabel,\n\t\t\t\tnoOptionLabel,\n\t\t\t\tonChange: onChangeProp,\n\t\t\t} }\n\t\t\ttree={ termsTree }\n\t\t\tselectedId={\n\t\t\t\tselectedAuthorId !== undefined\n\t\t\t\t\t? String( selectedAuthorId )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAAwB,aAAc,EACrC,OACA,eACA,YACA,kBACA,UAAU,gBACY;CACtB,IAAK,CAAE,YACN,OAAO;CAER,MAAM,aAAA,GAAYA,WAAAA,eAAAA,CAAgB,UAAW;CAC7C,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,SAAD;EAEE;EACA;EACA,UAAU;EAEX,MAAO;EACP,YACC,qBAAqB,KAAA,IAClB,OAAQ,gBAAiB,IACzB,KAAA;CAEJ,CAAA;AAEH"}