(child: ReactNode, type: ComponentClass
): child is ReactElement
{\n return (\n isValidChild(child) &&\n type &&\n typeof child.type === 'function' &&\n typeof type === 'function' &&\n hasBaseDerivedRelationship(type, child.type)\n );\n}\n\n/**\n * Returns a human-readable name for a React child component.\n */\nexport function componentDisplayName(child: ReactNode) {\n if (typeof child === 'string' || typeof child === 'number') {\n return child.toString();\n } else if (isValidChild(child)) {\n if (typeof child.type === 'string') {\n return child.type;\n } else {\n type HasDisplayName = { displayName?: string; name?: string };\n return (child.type as HasDisplayName).displayName || (child.type as HasDisplayName).name;\n }\n } else {\n return undefined;\n }\n}\n\n/**\n * @returns true if class with baseConstructor is a base class of class\n * with derivedConstructor or if classes are the same; overwise false.\n *\n * @example\n * hasBaseDerivedRelationship(Mammal, Cat) === true\n * hasBaseDerivedRelationship(Dog, Dog) === true\n * hasBaseDerivedRelationship(Animal, Tomato) === false\n * hasBaseDerivedRelationship(Dog, Animal) === false\n */\nexport function hasBaseDerivedRelationship(baseConstructor: any, derivedConstructor: any) {\n return (\n derivedConstructor === baseConstructor ||\n (derivedConstructor.prototype && derivedConstructor.prototype instanceof baseConstructor)\n );\n}\n\n/**\n * Takes any {@ReactNode} children and retuns either an array or just a\n * single {@ReactElement} if the is only one child in the children array.\n * This is required to make the forms working with, for example, react-bootstrap\n * vertical tabs. See https://github.com/facebook/react/issues/4424 for details.\n */\nexport function universalChildren(children: ReactNode): ReactNode {\n return Array.isArray(children) && children.length === 1 ? children[0] : children;\n}\n","/**\n * ResearchSpace\n * Copyright (C) 2020, © Trustees of the British Museum\n * Copyright (C) 2015-2019, metaphacts GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see {\n onControlledPropChange?: (change: Partial ) => void;\n}\n\n/**\n * Returns true if the specified component class supports controlled props mode\n * by having `onControlledPropChange` prop in its `propTypes`; otherwise returns false.\n *\n * In controlled mode component notifies about its state change using provided callback\n * instead of storing the change locally inside itself.\n */\nexport function hasControlledProps(componentClass: any): boolean {\n return Boolean(\n typeof componentClass === 'function' && componentClass.propTypes && componentClass.propTypes.onControlledPropChange\n );\n}\n","/**\n * ResearchSpace\n * Copyright (C) 2020, © Trustees of the British Museum\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see
);\n lines.push(parts[i]);\n }\n return D.div({ className }, ...lines);\n}\n","/**\n * ResearchSpace\n * Copyright (C) 2020, © Trustees of the British Museum\n * Copyright (C) 2015-2019, metaphacts GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see