1 |
- {"ast":null,"code":"import _extends from '@babel/runtime/helpers/esm/extends';\nimport prettyFormat from 'pretty-format';\nexport { default as prettyFormat } from 'pretty-format';\nimport { computeAccessibleName } from 'dom-accessibility-api';\nimport { elementRoles, roles } from 'aria-query';\nimport _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator';\nimport _regeneratorRuntime from '@babel/runtime/regenerator';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { compressToEncodedURIComponent } from 'lz-string'; // We try to load node dependencies\n\nvar chalk = null;\nvar readFileSync = null;\nvar codeFrameColumns = null;\n\ntry {\n var nodeRequire = module && module.require;\n readFileSync = nodeRequire.call(module, 'fs').readFileSync;\n codeFrameColumns = nodeRequire.call(module, '@babel/code-frame').codeFrameColumns;\n chalk = nodeRequire.call(module, 'chalk');\n} catch (_unused) {// We're in a browser environment\n} // frame has the form \"at myMethod (location/to/my/file.js:10:2)\"\n\n\nfunction getCodeFrame(frame) {\n var locationStart = frame.indexOf('(') + 1;\n var locationEnd = frame.indexOf(')');\n var frameLocation = frame.slice(locationStart, locationEnd);\n var frameLocationElements = frameLocation.split(':');\n var _ref = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)],\n filename = _ref[0],\n line = _ref[1],\n column = _ref[2];\n var rawFileContents = '';\n\n try {\n rawFileContents = readFileSync(filename, 'utf-8');\n } catch (_unused2) {\n return '';\n }\n\n var codeFrame = codeFrameColumns(rawFileContents, {\n start: {\n line: line,\n column: column\n }\n }, {\n highlightCode: true,\n linesBelow: 0\n });\n return chalk.dim(frameLocation) + \"\\n\" + codeFrame + \"\\n\";\n}\n\nfunction getUserCodeFrame() {\n // If we couldn't load dependencies, we can't generate the user trace\n\n /* istanbul ignore next */\n if (!readFileSync || !codeFrameColumns) {\n return '';\n }\n\n var err = new Error();\n var firstClientCodeFrame = err.stack.split('\\n').slice(1) // Remove first line which has the form \"Error: TypeError\"\n .find(function (frame) {\n return !frame.includes('node_modules/');\n }); // Ignore frames from 3rd party libraries\n\n return getCodeFrame(firstClientCodeFrame);\n}\n\nvar globalObj = typeof window === 'undefined' ? global : window; // Constant node.nodeType for text nodes, see:\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#Node_type_constants\n\nvar TEXT_NODE = 3; // Currently this fn only supports jest timers, but it could support other test runners in the future.\n\nfunction runWithRealTimers(callback) {\n return hasJestTimers() ? runWithJestRealTimers(callback).callbackReturnValue : // istanbul ignore next\n callback();\n}\n\nfunction hasJestTimers() {\n return typeof jest !== 'undefined' && jest !== null && typeof jest.useRealTimers === 'function';\n}\n\nfunction runWithJestRealTimers(callback) {\n var timerAPI = {\n clearInterval: clearInterval,\n clearTimeout: clearTimeout,\n setInterval: setInterval,\n setTimeout: setTimeout\n }; // For more on why we have the check here,\n // checkout https://github.com/testing-library/dom-testing-library/issues/914\n\n if (typeof setImmediate === 'function') {\n timerAPI.setImmediate = setImmediate;\n }\n\n if (typeof clearImmediate === 'function') {\n timerAPI.clearImmediate = clearImmediate;\n }\n\n jest.useRealTimers();\n var callbackReturnValue = callback();\n var usedFakeTimers = Object.entries(timerAPI).some(function (_ref) {\n var name = _ref[0],\n func = _ref[1];\n return func !== globalObj[name];\n });\n\n if (usedFakeTimers) {\n var _timerAPI$setTimeout;\n\n jest.useFakeTimers((_timerAPI$setTimeout = timerAPI.setTimeout) != null && _timerAPI$setTimeout.clock ? 'modern' : 'legacy');\n }\n\n return {\n callbackReturnValue: callbackReturnValue,\n usedFakeTimers: usedFakeTimers\n };\n}\n\nfunction jestFakeTimersAreEnabled() {\n return hasJestTimers() ? runWithJestRealTimers(function () {}).usedFakeTimers : // istanbul ignore next\n false;\n} // we only run our tests in node, and setImmediate is supported in node.\n// istanbul ignore next\n\n\nfunction setImmediatePolyfill(fn) {\n return globalObj.setTimeout(fn, 0);\n}\n\nfunction getTimeFunctions() {\n // istanbul ignore next\n return {\n clearTimeoutFn: globalObj.clearTimeout,\n setImmediateFn: globalObj.setImmediate || setImmediatePolyfill,\n setTimeoutFn: globalObj.setTimeout\n };\n}\n\nvar _runWithRealTimers = runWithRealTimers(getTimeFunctions),\n clearTimeoutFn = _runWithRealTimers.clearTimeoutFn,\n setImmediateFn = _runWithRealTimers.setImmediateFn,\n setTimeoutFn = _runWithRealTimers.setTimeoutFn;\n\nfunction getDocument() {\n /* istanbul ignore if */\n if (typeof window === 'undefined') {\n throw new Error('Could not find default container');\n }\n\n return window.document;\n}\n\nfunction getWindowFromNode(node) {\n if (node.defaultView) {\n // node is document\n return node.defaultView;\n } else if (node.ownerDocument && node.ownerDocument.defaultView) {\n // node is a DOM node\n return node.ownerDocument.defaultView;\n } else if (node.window) {\n // node is window\n return node.window;\n } else if (node.then instanceof Function) {\n throw new Error(\"It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?\");\n } else if (Array.isArray(node)) {\n throw new Error(\"It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?\");\n } else if (typeof node.debug === 'function' && typeof node.logTestingPlaygroundURL === 'function') {\n throw new Error(\"It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?\");\n } else {\n // The user passed something unusual to a calling function\n throw new Error(\"Unable to find the \\\"window\\\" object for the given node. Please file an issue with the code that's causing you to see this error: https://github.com/testing-library/dom-testing-library/issues/new\");\n }\n}\n\nfunction checkContainerType(container) {\n if (!container || !(typeof container.querySelector === 'function') || !(typeof container.querySelectorAll === 'function')) {\n throw new TypeError(\"Expected container to be an Element, a Document or a DocumentFragment but got \" + getTypeName(container) + \".\");\n }\n\n function getTypeName(object) {\n if (typeof object === 'object') {\n return object === null ? 'null' : object.constructor.name;\n }\n\n return typeof object;\n }\n}\n\nfunction inCypress(dom) {\n var window = dom.ownerDocument && dom.ownerDocument.defaultView || undefined;\n return typeof global !== 'undefined' && global.Cypress || typeof window !== 'undefined' && window.Cypress;\n}\n\nvar inNode = function inNode() {\n return typeof process !== 'undefined' && process.versions !== undefined && process.versions.node !== undefined;\n};\n\nvar getMaxLength = function getMaxLength(dom) {\n return inCypress(dom) ? 0 : typeof process !== 'undefined' && process.env.DEBUG_PRINT_LIMIT || 7000;\n};\n\nvar _prettyFormat$plugins = prettyFormat.plugins,\n DOMElement = _prettyFormat$plugins.DOMElement,\n DOMCollection = _prettyFormat$plugins.DOMCollection;\n\nfunction prettyDOM(dom, maxLength, options) {\n if (!dom) {\n dom = getDocument().body;\n }\n\n if (typeof maxLength !== 'number') {\n maxLength = getMaxLength(dom);\n }\n\n if (maxLength === 0) {\n return '';\n }\n\n if (dom.documentElement) {\n dom = dom.documentElement;\n }\n\n var domTypeName = typeof dom;\n\n if (domTypeName === 'object') {\n domTypeName = dom.constructor.name;\n } else {\n // To don't fall with `in` operator\n dom = {};\n }\n\n if (!('outerHTML' in dom)) {\n throw new TypeError(\"Expected an element or document but got \" + domTypeName);\n }\n\n var debugContent = prettyFormat(dom, _extends({\n plugins: [DOMElement, DOMCollection],\n printFunctionName: false,\n highlight: inNode()\n }, options));\n return maxLength !== undefined && dom.outerHTML.length > maxLength ? debugContent.slice(0, maxLength) + \"...\" : debugContent;\n}\n\nvar logDOM = function logDOM() {\n var userCodeFrame = getUserCodeFrame();\n\n if (userCodeFrame) {\n console.log(prettyDOM.apply(void 0, arguments) + \"\\n\\n\" + userCodeFrame);\n } else {\n console.log(prettyDOM.apply(void 0, arguments));\n }\n}; // It would be cleaner for this to live inside './queries', but\n// other parts of the code assume that all exports from\n// './queries' are query functions.\n\n\nvar config = {\n testIdAttribute: 'data-testid',\n asyncUtilTimeout: 1000,\n // this is to support React's async `act` function.\n // forcing react-testing-library to wrap all async functions would've been\n // a total nightmare (consider wrapping every findBy* query and then also\n // updating `within` so those would be wrapped too. Total nightmare).\n // so we have this config option that's really only intended for\n // react-testing-library to use. For that reason, this feature will remain\n // undocumented.\n asyncWrapper: function asyncWrapper(cb) {\n return cb();\n },\n eventWrapper: function eventWrapper(cb) {\n return cb();\n },\n // default value for the `hidden` option in `ByRole` queries\n defaultHidden: false,\n // showOriginalStackTrace flag to show the full error stack traces for async errors\n showOriginalStackTrace: false,\n // throw errors w/ suggestions for better queries. Opt in so off by default.\n throwSuggestions: false,\n // called when getBy* queries fail. (message, container) => Error\n getElementError: function getElementError(message, container) {\n var error = new Error([message, prettyDOM(container)].filter(Boolean).join('\\n\\n'));\n error.name = 'TestingLibraryElementError';\n return error;\n },\n _disableExpensiveErrorDiagnostics: false,\n computedStyleSupportsPseudoElements: false\n};\nvar DEFAULT_IGNORE_TAGS = 'script, style';\n\nfunction runWithExpensiveErrorDiagnosticsDisabled(callback) {\n try {\n config._disableExpensiveErrorDiagnostics = true;\n return callback();\n } finally {\n config._disableExpensiveErrorDiagnostics = false;\n }\n}\n\nfunction configure(newConfig) {\n if (typeof newConfig === 'function') {\n // Pass the existing config out to the provided function\n // and accept a delta in return\n newConfig = newConfig(config);\n } // Merge the incoming config delta\n\n\n config = _extends({}, config, newConfig);\n}\n\nfunction getConfig() {\n return config;\n}\n\nvar labelledNodeNames = ['button', 'meter', 'output', 'progress', 'select', 'textarea', 'input'];\n\nfunction getTextContent(node) {\n if (labelledNodeNames.includes(node.nodeName.toLowerCase())) {\n return '';\n }\n\n if (node.nodeType === TEXT_NODE) return node.textContent;\n return Array.from(node.childNodes).map(function (childNode) {\n return getTextContent(childNode);\n }).join('');\n}\n\nfunction getLabelContent(element) {\n var textContent;\n\n if (element.tagName.toLowerCase() === 'label') {\n textContent = getTextContent(element);\n } else {\n textContent = element.value || element.textContent;\n }\n\n return textContent;\n} // Based on https://github.com/eps1lon/dom-accessibility-api/pull/352\n\n\nfunction getRealLabels(element) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- types are not aware of older browsers that don't implement `labels`\n if (element.labels !== undefined) {\n var _labels;\n\n return (_labels = element.labels) != null ? _labels : [];\n }\n\n if (!isLabelable(element)) return [];\n var labels = element.ownerDocument.querySelectorAll('label');\n return Array.from(labels).filter(function (label) {\n return label.control === element;\n });\n}\n\nfunction isLabelable(element) {\n return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === 'INPUT' && element.getAttribute('type') !== 'hidden';\n}\n\nfunction getLabels(container, element, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$selector = _ref.selector,\n selector = _ref$selector === void 0 ? '*' : _ref$selector;\n\n var ariaLabelledBy = element.getAttribute('aria-labelledby');\n var labelsId = ariaLabelledBy ? ariaLabelledBy.split(' ') : [];\n return labelsId.length ? labelsId.map(function (labelId) {\n var labellingElement = container.querySelector(\"[id=\\\"\" + labelId + \"\\\"]\");\n return labellingElement ? {\n content: getLabelContent(labellingElement),\n formControl: null\n } : {\n content: '',\n formControl: null\n };\n }) : Array.from(getRealLabels(element)).map(function (label) {\n var textToMatch = getLabelContent(label);\n var formControlSelector = 'button, input, meter, output, progress, select, textarea';\n var labelledFormControl = Array.from(label.querySelectorAll(formControlSelector)).filter(function (formControlElement) {\n return formControlElement.matches(selector);\n })[0];\n return {\n content: textToMatch,\n formControl: labelledFormControl\n };\n });\n}\n\nfunction assertNotNullOrUndefined(matcher) {\n if (matcher === null || matcher === undefined) {\n throw new Error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`\n \"It looks like \" + matcher + \" was passed instead of a matcher. Did you do something like getByText(\" + matcher + \")?\");\n }\n}\n\nfunction fuzzyMatches(textToMatch, node, matcher, normalizer) {\n if (typeof textToMatch !== 'string') {\n return false;\n }\n\n assertNotNullOrUndefined(matcher);\n var normalizedText = normalizer(textToMatch);\n\n if (typeof matcher === 'string' || typeof matcher === 'number') {\n return normalizedText.toLowerCase().includes(matcher.toString().toLowerCase());\n } else if (typeof matcher === 'function') {\n return matcher(normalizedText, node);\n } else {\n return matcher.test(normalizedText);\n }\n}\n\nfunction matches(textToMatch, node, matcher, normalizer) {\n if (typeof textToMatch !== 'string') {\n return false;\n }\n\n assertNotNullOrUndefined(matcher);\n var normalizedText = normalizer(textToMatch);\n\n if (matcher instanceof Function) {\n return matcher(normalizedText, node);\n } else if (matcher instanceof RegExp) {\n return matcher.test(normalizedText);\n } else {\n return normalizedText === String(matcher);\n }\n}\n\nfunction getDefaultNormalizer(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$trim = _ref.trim,\n trim = _ref$trim === void 0 ? true : _ref$trim,\n _ref$collapseWhitespa = _ref.collapseWhitespace,\n collapseWhitespace = _ref$collapseWhitespa === void 0 ? true : _ref$collapseWhitespa;\n\n return function (text) {\n var normalizedText = text;\n normalizedText = trim ? normalizedText.trim() : normalizedText;\n normalizedText = collapseWhitespace ? normalizedText.replace(/\\s+/g, ' ') : normalizedText;\n return normalizedText;\n };\n}\n/**\n * Constructs a normalizer to pass to functions in matches.js\n * @param {boolean|undefined} trim The user-specified value for `trim`, without\n * any defaulting having been applied\n * @param {boolean|undefined} collapseWhitespace The user-specified value for\n * `collapseWhitespace`, without any defaulting having been applied\n * @param {Function|undefined} normalizer The user-specified normalizer\n * @returns {Function} A normalizer\n */\n\n\nfunction makeNormalizer(_ref2) {\n var trim = _ref2.trim,\n collapseWhitespace = _ref2.collapseWhitespace,\n normalizer = _ref2.normalizer;\n\n if (normalizer) {\n // User has specified a custom normalizer\n if (typeof trim !== 'undefined' || typeof collapseWhitespace !== 'undefined') {\n // They've also specified a value for trim or collapseWhitespace\n throw new Error('trim and collapseWhitespace are not supported with a normalizer. ' + 'If you want to use the default trim and collapseWhitespace logic in your normalizer, ' + 'use \"getDefaultNormalizer({trim, collapseWhitespace})\" and compose that into your normalizer');\n }\n\n return normalizer;\n } else {\n // No custom normalizer specified. Just use default.\n return getDefaultNormalizer({\n trim: trim,\n collapseWhitespace: collapseWhitespace\n });\n }\n}\n\nfunction getNodeText(node) {\n if (node.matches('input[type=submit], input[type=button]')) {\n return node.value;\n }\n\n return Array.from(node.childNodes).filter(function (child) {\n return child.nodeType === TEXT_NODE && Boolean(child.textContent);\n }).map(function (c) {\n return c.textContent;\n }).join('');\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nvar elementRoleList = buildElementRoleList(elementRoles);\n/**\n * @param {Element} element -\n * @returns {boolean} - `true` if `element` and its subtree are inaccessible\n */\n\nfunction isSubtreeInaccessible(element) {\n if (element.hidden === true) {\n return true;\n }\n\n if (element.getAttribute('aria-hidden') === 'true') {\n return true;\n }\n\n var window = element.ownerDocument.defaultView;\n\n if (window.getComputedStyle(element).display === 'none') {\n return true;\n }\n\n return false;\n}\n/**\n * Partial implementation https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion\n * which should only be used for elements with a non-presentational role i.e.\n * `role=\"none\"` and `role=\"presentation\"` will not be excluded.\n *\n * Implements aria-hidden semantics (i.e. parent overrides child)\n * Ignores \"Child Presentational: True\" characteristics\n *\n * @param {Element} element -\n * @param {object} [options] -\n * @param {function (element: Element): boolean} options.isSubtreeInaccessible -\n * can be used to return cached results from previous isSubtreeInaccessible calls\n * @returns {boolean} true if excluded, otherwise false\n */\n\n\nfunction isInaccessible(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$isSubtreeIna = _options.isSubtreeInaccessible,\n isSubtreeInaccessibleImpl = _options$isSubtreeIna === void 0 ? isSubtreeInaccessible : _options$isSubtreeIna;\n var window = element.ownerDocument.defaultView; // since visibility is inherited we can exit early\n\n if (window.getComputedStyle(element).visibility === 'hidden') {\n return true;\n }\n\n var currentElement = element;\n\n while (currentElement) {\n if (isSubtreeInaccessibleImpl(currentElement)) {\n return true;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return false;\n}\n\nfunction getImplicitAriaRoles(currentNode) {\n // eslint bug here:\n // eslint-disable-next-line no-unused-vars\n for (var _iterator = _createForOfIteratorHelperLoose(elementRoleList), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n match = _step$value.match,\n roles = _step$value.roles;\n\n if (match(currentNode)) {\n return [].concat(roles);\n }\n }\n\n return [];\n}\n\nfunction buildElementRoleList(elementRolesMap) {\n function makeElementSelector(_ref) {\n var name = _ref.name,\n attributes = _ref.attributes;\n return \"\" + name + attributes.map(function (_ref2) {\n var attributeName = _ref2.name,\n value = _ref2.value,\n _ref2$constraints = _ref2.constraints,\n constraints = _ref2$constraints === void 0 ? [] : _ref2$constraints;\n var shouldNotExist = constraints.indexOf('undefined') !== -1;\n\n if (shouldNotExist) {\n return \":not([\" + attributeName + \"])\";\n } else if (value) {\n return \"[\" + attributeName + \"=\\\"\" + value + \"\\\"]\";\n } else {\n return \"[\" + attributeName + \"]\";\n }\n }).join('');\n }\n\n function getSelectorSpecificity(_ref3) {\n var _ref3$attributes = _ref3.attributes,\n attributes = _ref3$attributes === void 0 ? [] : _ref3$attributes;\n return attributes.length;\n }\n\n function bySelectorSpecificity(_ref4, _ref5) {\n var leftSpecificity = _ref4.specificity;\n var rightSpecificity = _ref5.specificity;\n return rightSpecificity - leftSpecificity;\n }\n\n function match(element) {\n return function (node) {\n var _element$attributes = element.attributes,\n attributes = _element$attributes === void 0 ? [] : _element$attributes; // https://github.com/testing-library/dom-testing-library/issues/814\n\n var typeTextIndex = attributes.findIndex(function (attribute) {\n return attribute.value && attribute.name === 'type' && attribute.value === 'text';\n });\n\n if (typeTextIndex >= 0) {\n // not using splice to not mutate the attributes array\n attributes = [].concat(attributes.slice(0, typeTextIndex), attributes.slice(typeTextIndex + 1));\n\n if (node.type !== 'text') {\n return false;\n }\n }\n\n return node.matches(makeElementSelector(_extends({}, element, {\n attributes: attributes\n })));\n };\n }\n\n var result = []; // eslint bug here:\n // eslint-disable-next-line no-unused-vars\n\n for (var _iterator2 = _createForOfIteratorHelperLoose(elementRolesMap.entries()), _step2; !(_step2 = _iterator2()).done;) {\n var _step2$value = _step2.value,\n element = _step2$value[0],\n roles = _step2$value[1];\n result = [].concat(result, [{\n match: match(element),\n roles: Array.from(roles),\n specificity: getSelectorSpecificity(element)\n }]);\n }\n\n return result.sort(bySelectorSpecificity);\n}\n\nfunction getRoles(container, _temp) {\n var _ref6 = _temp === void 0 ? {} : _temp,\n _ref6$hidden = _ref6.hidden,\n hidden = _ref6$hidden === void 0 ? false : _ref6$hidden;\n\n function flattenDOM(node) {\n return [node].concat(Array.from(node.children).reduce(function (acc, child) {\n return [].concat(acc, flattenDOM(child));\n }, []));\n }\n\n return flattenDOM(container).filter(function (element) {\n return hidden === false ? isInaccessible(element) === false : true;\n }).reduce(function (acc, node) {\n var roles = []; // TODO: This violates html-aria which does not allow any role on every element\n\n if (node.hasAttribute('role')) {\n roles = node.getAttribute('role').split(' ').slice(0, 1);\n } else {\n roles = getImplicitAriaRoles(node);\n }\n\n return roles.reduce(function (rolesAcc, role) {\n var _extends2, _extends3;\n\n return Array.isArray(rolesAcc[role]) ? _extends({}, rolesAcc, (_extends2 = {}, _extends2[role] = [].concat(rolesAcc[role], [node]), _extends2)) : _extends({}, rolesAcc, (_extends3 = {}, _extends3[role] = [node], _extends3));\n }, acc);\n }, {});\n}\n\nfunction prettyRoles(dom, _ref7) {\n var hidden = _ref7.hidden;\n var roles = getRoles(dom, {\n hidden: hidden\n }); // We prefer to skip generic role, we don't recommend it\n\n return Object.entries(roles).filter(function (_ref8) {\n var role = _ref8[0];\n return role !== 'generic';\n }).map(function (_ref9) {\n var role = _ref9[0],\n elements = _ref9[1];\n var delimiterBar = '-'.repeat(50);\n var elementsString = elements.map(function (el) {\n var nameString = \"Name \\\"\" + computeAccessibleName(el, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n }) + \"\\\":\\n\";\n var domString = prettyDOM(el.cloneNode(false));\n return \"\" + nameString + domString;\n }).join('\\n\\n');\n return role + \":\\n\\n\" + elementsString + \"\\n\\n\" + delimiterBar;\n }).join('\\n');\n}\n\nvar logRoles = function logRoles(dom, _temp2) {\n var _ref10 = _temp2 === void 0 ? {} : _temp2,\n _ref10$hidden = _ref10.hidden,\n hidden = _ref10$hidden === void 0 ? false : _ref10$hidden;\n\n return console.log(prettyRoles(dom, {\n hidden: hidden\n }));\n};\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)selected, undefined if not selectable\n */\n\n\nfunction computeAriaSelected(element) {\n // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings\n // https://www.w3.org/TR/html-aam-1.0/#details-id-97\n if (element.tagName === 'OPTION') {\n return element.selected;\n } // explicit value\n\n\n return checkBooleanAttribute(element, 'aria-selected');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)checked, undefined if not checked-able\n */\n\n\nfunction computeAriaChecked(element) {\n // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings\n // https://www.w3.org/TR/html-aam-1.0/#details-id-56\n // https://www.w3.org/TR/html-aam-1.0/#details-id-67\n if ('indeterminate' in element && element.indeterminate) {\n return undefined;\n }\n\n if ('checked' in element) {\n return element.checked;\n } // explicit value\n\n\n return checkBooleanAttribute(element, 'aria-checked');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)pressed, undefined if not press-able\n */\n\n\nfunction computeAriaPressed(element) {\n // https://www.w3.org/TR/wai-aria-1.1/#aria-pressed\n return checkBooleanAttribute(element, 'aria-pressed');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able\n */\n\n\nfunction computeAriaExpanded(element) {\n // https://www.w3.org/TR/wai-aria-1.1/#aria-expanded\n return checkBooleanAttribute(element, 'aria-expanded');\n}\n\nfunction checkBooleanAttribute(element, attribute) {\n var attributeValue = element.getAttribute(attribute);\n\n if (attributeValue === 'true') {\n return true;\n }\n\n if (attributeValue === 'false') {\n return false;\n }\n\n return undefined;\n}\n/**\n * @param {Element} element -\n * @returns {number | undefined} - number if implicit heading or aria-level present, otherwise undefined\n */\n\n\nfunction computeHeadingLevel(element) {\n // https://w3c.github.io/html-aam/#el-h1-h6\n // https://w3c.github.io/html-aam/#el-h1-h6\n var implicitHeadingLevels = {\n H1: 1,\n H2: 2,\n H3: 3,\n H4: 4,\n H5: 5,\n H6: 6\n }; // explicit aria-level value\n // https://www.w3.org/TR/wai-aria-1.2/#aria-level\n\n var ariaLevelAttribute = element.getAttribute('aria-level') && Number(element.getAttribute('aria-level'));\n return ariaLevelAttribute || implicitHeadingLevels[element.tagName];\n}\n\nvar normalize = getDefaultNormalizer();\n\nfunction escapeRegExp(string) {\n return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nfunction getRegExpMatcher(string) {\n return new RegExp(escapeRegExp(string.toLowerCase()), 'i');\n}\n\nfunction makeSuggestion(queryName, element, content, _ref) {\n var variant = _ref.variant,\n name = _ref.name;\n var warning = '';\n var queryOptions = {};\n var queryArgs = [['Role', 'TestId'].includes(queryName) ? content : getRegExpMatcher(content)];\n\n if (name) {\n queryOptions.name = getRegExpMatcher(name);\n }\n\n if (queryName === 'Role' && isInaccessible(element)) {\n queryOptions.hidden = true;\n warning = \"Element is inaccessible. This means that the element and all its children are invisible to screen readers.\\n If you are using the aria-hidden prop, make sure this is the right choice for your case.\\n \";\n }\n\n if (Object.keys(queryOptions).length > 0) {\n queryArgs.push(queryOptions);\n }\n\n var queryMethod = variant + \"By\" + queryName;\n return {\n queryName: queryName,\n queryMethod: queryMethod,\n queryArgs: queryArgs,\n variant: variant,\n warning: warning,\n toString: function toString() {\n if (warning) {\n console.warn(warning);\n }\n\n var text = queryArgs[0],\n options = queryArgs[1];\n text = typeof text === 'string' ? \"'\" + text + \"'\" : text;\n options = options ? \", { \" + Object.entries(options).map(function (_ref2) {\n var k = _ref2[0],\n v = _ref2[1];\n return k + \": \" + v;\n }).join(', ') + \" }\" : '';\n return queryMethod + \"(\" + text + options + \")\";\n }\n };\n}\n\nfunction canSuggest(currentMethod, requestedMethod, data) {\n return data && (!requestedMethod || requestedMethod.toLowerCase() === currentMethod.toLowerCase());\n}\n\nfunction getSuggestedQuery(element, variant, method) {\n var _element$getAttribute, _getImplicitAriaRoles;\n\n if (variant === void 0) {\n variant = 'get';\n } // don't create suggestions for script and style elements\n\n\n if (element.matches(DEFAULT_IGNORE_TAGS)) {\n return undefined;\n } //We prefer to suggest something else if the role is generic\n\n\n var role = (_element$getAttribute = element.getAttribute('role')) != null ? _element$getAttribute : (_getImplicitAriaRoles = getImplicitAriaRoles(element)) == null ? void 0 : _getImplicitAriaRoles[0];\n\n if (role !== 'generic' && canSuggest('Role', method, role)) {\n return makeSuggestion('Role', element, role, {\n variant: variant,\n name: computeAccessibleName(element, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n })\n });\n }\n\n var labelText = getLabels(document, element).map(function (label) {\n return label.content;\n }).join(' ');\n\n if (canSuggest('LabelText', method, labelText)) {\n return makeSuggestion('LabelText', element, labelText, {\n variant: variant\n });\n }\n\n var placeholderText = element.getAttribute('placeholder');\n\n if (canSuggest('PlaceholderText', method, placeholderText)) {\n return makeSuggestion('PlaceholderText', element, placeholderText, {\n variant: variant\n });\n }\n\n var textContent = normalize(getNodeText(element));\n\n if (canSuggest('Text', method, textContent)) {\n return makeSuggestion('Text', element, textContent, {\n variant: variant\n });\n }\n\n if (canSuggest('DisplayValue', method, element.value)) {\n return makeSuggestion('DisplayValue', element, normalize(element.value), {\n variant: variant\n });\n }\n\n var alt = element.getAttribute('alt');\n\n if (canSuggest('AltText', method, alt)) {\n return makeSuggestion('AltText', element, alt, {\n variant: variant\n });\n }\n\n var title = element.getAttribute('title');\n\n if (canSuggest('Title', method, title)) {\n return makeSuggestion('Title', element, title, {\n variant: variant\n });\n }\n\n var testId = element.getAttribute(getConfig().testIdAttribute);\n\n if (canSuggest('TestId', method, testId)) {\n return makeSuggestion('TestId', element, testId, {\n variant: variant\n });\n }\n\n return undefined;\n} // closer to their code (because async stack traces are hard to follow).\n\n\nfunction copyStackTrace(target, source) {\n target.stack = source.stack.replace(source.message, target.message);\n}\n\nfunction waitFor(callback, _ref) {\n var _ref$container = _ref.container,\n container = _ref$container === void 0 ? getDocument() : _ref$container,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? getConfig().asyncUtilTimeout : _ref$timeout,\n _ref$showOriginalStac = _ref.showOriginalStackTrace,\n showOriginalStackTrace = _ref$showOriginalStac === void 0 ? getConfig().showOriginalStackTrace : _ref$showOriginalStac,\n stackTraceError = _ref.stackTraceError,\n _ref$interval = _ref.interval,\n interval = _ref$interval === void 0 ? 50 : _ref$interval,\n _ref$onTimeout = _ref.onTimeout,\n onTimeout = _ref$onTimeout === void 0 ? function (error) {\n error.message = getConfig().getElementError(error.message, container).message;\n return error;\n } : _ref$onTimeout,\n _ref$mutationObserver = _ref.mutationObserverOptions,\n mutationObserverOptions = _ref$mutationObserver === void 0 ? {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true\n } : _ref$mutationObserver;\n\n if (typeof callback !== 'function') {\n throw new TypeError('Received `callback` arg must be a function');\n }\n\n return new Promise( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) {\n var lastError, intervalId, observer, finished, promiseStatus, overallTimeoutTimer, usingJestFakeTimers, error, _getWindowFromNode, MutationObserver, onDone, checkRealTimersCallback, checkCallback, handleTimeout;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n handleTimeout = function _handleTimeout() {\n var error;\n\n if (lastError) {\n error = lastError;\n\n if (!showOriginalStackTrace && error.name === 'TestingLibraryElementError') {\n copyStackTrace(error, stackTraceError);\n }\n } else {\n error = new Error('Timed out in waitFor.');\n\n if (!showOriginalStackTrace) {\n copyStackTrace(error, stackTraceError);\n }\n }\n\n onDone(onTimeout(error), null);\n };\n\n checkCallback = function _checkCallback() {\n if (promiseStatus === 'pending') return;\n\n try {\n var result = runWithExpensiveErrorDiagnosticsDisabled(callback);\n\n if (typeof (result == null ? void 0 : result.then) === 'function') {\n promiseStatus = 'pending';\n result.then(function (resolvedValue) {\n promiseStatus = 'resolved';\n onDone(null, resolvedValue);\n }, function (rejectedValue) {\n promiseStatus = 'rejected';\n lastError = rejectedValue;\n });\n } else {\n onDone(null, result);\n } // If `callback` throws, wait for the next mutation, interval, or timeout.\n\n } catch (error) {\n // Save the most recent callback error to reject the promise with it in the event of a timeout\n lastError = error;\n }\n };\n\n checkRealTimersCallback = function _checkRealTimersCallb() {\n if (jestFakeTimersAreEnabled()) {\n var _error = new Error(\"Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830\");\n\n if (!showOriginalStackTrace) copyStackTrace(_error, stackTraceError);\n return reject(_error);\n } else {\n return checkCallback();\n }\n };\n\n onDone = function _onDone(error, result) {\n finished = true;\n clearTimeoutFn(overallTimeoutTimer);\n\n if (!usingJestFakeTimers) {\n clearInterval(intervalId);\n observer.disconnect();\n }\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n };\n\n finished = false;\n promiseStatus = 'idle';\n overallTimeoutTimer = setTimeoutFn(handleTimeout, timeout);\n usingJestFakeTimers = jestFakeTimersAreEnabled();\n\n if (!usingJestFakeTimers) {\n _context.next = 24;\n break;\n }\n\n checkCallback();\n // this is a dangerous rule to disable because it could lead to an\n // infinite loop. However, eslint isn't smart enough to know that we're\n // setting finished inside `onDone` which will be called when we're done\n // waiting or when we've timed out.\n // eslint-disable-next-line no-unmodified-loop-condition\n\n case 10:\n if (finished) {\n _context.next = 22;\n break;\n }\n\n if (jestFakeTimersAreEnabled()) {\n _context.next = 16;\n break;\n }\n\n error = new Error(\"Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830\");\n if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);\n reject(error);\n return _context.abrupt(\"return\");\n\n case 16:\n // we *could* (maybe should?) use `advanceTimersToNextTimer` but it's\n // possible that could make this loop go on forever if someone is using\n // third party code that's setting up recursive timers so rapidly that\n // the user's timer's don't get a chance to resolve. So we'll advance\n // by an interval instead. (We have a test for this case).\n jest.advanceTimersByTime(interval); // It's really important that checkCallback is run *before* we flush\n // in-flight promises. To be honest, I'm not sure why, and I can't quite\n // think of a way to reproduce the problem in a test, but I spent\n // an entire day banging my head against a wall on this.\n\n checkCallback(); // In this rare case, we *need* to wait for in-flight promises\n // to resolve before continuing. We don't need to take advantage\n // of parallelization so we're fine.\n // https://stackoverflow.com/a/59243586/971592\n // eslint-disable-next-line no-await-in-loop\n\n _context.next = 20;\n return new Promise(function (r) {\n return setImmediateFn(r);\n });\n\n case 20:\n _context.next = 10;\n break;\n\n case 22:\n _context.next = 37;\n break;\n\n case 24:\n _context.prev = 24;\n checkContainerType(container);\n _context.next = 32;\n break;\n\n case 28:\n _context.prev = 28;\n _context.t0 = _context[\"catch\"](24);\n reject(_context.t0);\n return _context.abrupt(\"return\");\n\n case 32:\n intervalId = setInterval(checkRealTimersCallback, interval);\n _getWindowFromNode = getWindowFromNode(container), MutationObserver = _getWindowFromNode.MutationObserver;\n observer = new MutationObserver(checkRealTimersCallback);\n observer.observe(container, mutationObserverOptions);\n checkCallback();\n\n case 37:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[24, 28]]);\n }));\n\n return function (_x, _x2) {\n return _ref2.apply(this, arguments);\n };\n }());\n}\n\nfunction waitForWrapper(callback, options) {\n // create the error here so its stack trace is as close to the\n // calling code as possible\n var stackTraceError = new Error('STACK_TRACE_MESSAGE');\n return getConfig().asyncWrapper(function () {\n return waitFor(callback, _extends({\n stackTraceError: stackTraceError\n }, options));\n });\n}\n\nvar hasWarned$2 = false; // deprecated... TODO: remove this method. We renamed this to `waitFor` so the\n// code people write reads more clearly.\n\nfunction wait() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n } // istanbul ignore next\n\n\n var _args$ = args[0],\n first = _args$ === void 0 ? function () {} : _args$,\n rest = args.slice(1);\n\n if (!hasWarned$2) {\n hasWarned$2 = true;\n console.warn(\"`wait` has been deprecated and replaced by `waitFor` instead. In most cases you should be able to find/replace `wait` with `waitFor`. Learn more: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.\");\n }\n\n return waitForWrapper.apply(void 0, [first].concat(rest));\n}\n/*\neslint\n max-lines-per-function: [\"error\", {\"max\": 200}],\n*/\n\n\nfunction getElementError(message, container) {\n return getConfig().getElementError(message, container);\n}\n\nfunction getMultipleElementsFoundError(message, container) {\n return getElementError(message + \"\\n\\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).\", container);\n}\n\nfunction queryAllByAttribute(attribute, container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll(\"[\" + attribute + \"]\")).filter(function (node) {\n return matcher(node.getAttribute(attribute), node, text, matchNormalizer);\n });\n}\n\nfunction queryByAttribute(attribute, container, text) {\n for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n args[_key - 3] = arguments[_key];\n }\n\n var els = queryAllByAttribute.apply(void 0, [attribute, container, text].concat(args));\n\n if (els.length > 1) {\n throw getMultipleElementsFoundError(\"Found multiple elements by [\" + attribute + \"=\" + text + \"]\", container);\n }\n\n return els[0] || null;\n} // this accepts a query function and returns a function which throws an error\n// if more than one elements is returned, otherwise it returns the first\n// element or null\n\n\nfunction makeSingleQuery(allQuery, getMultipleError) {\n return function (container) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n var els = allQuery.apply(void 0, [container].concat(args));\n\n if (els.length > 1) {\n var elementStrings = els.map(function (element) {\n return getElementError(null, element).message;\n }).join('\\n\\n');\n throw getMultipleElementsFoundError(getMultipleError.apply(void 0, [container].concat(args)) + \"\\n\\nHere are the matching elements:\\n\\n\" + elementStrings, container);\n }\n\n return els[0] || null;\n };\n}\n\nfunction getSuggestionError(suggestion, container) {\n return getConfig().getElementError(\"A better query is available, try this:\\n\" + suggestion.toString() + \"\\n\", container);\n} // this accepts a query function and returns a function which throws an error\n// if an empty list of elements is returned\n\n\nfunction makeGetAllQuery(allQuery, getMissingError) {\n return function (container) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n var els = allQuery.apply(void 0, [container].concat(args));\n\n if (!els.length) {\n throw getConfig().getElementError(getMissingError.apply(void 0, [container].concat(args)), container);\n }\n\n return els;\n };\n} // this accepts a getter query function and returns a function which calls\n// waitFor and passing a function which invokes the getter.\n\n\nfunction makeFindQuery(getter) {\n return function (container, text, options, waitForOptions) {\n return waitForWrapper(function () {\n return getter(container, text, options);\n }, _extends({\n container: container\n }, waitForOptions));\n };\n}\n\nvar wrapSingleQueryWithSuggestion = function wrapSingleQueryWithSuggestion(query, queryAllByName, variant) {\n return function (container) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n var element = query.apply(void 0, [container].concat(args));\n\n var _args$slice = args.slice(-1),\n _args$slice$ = _args$slice[0];\n\n _args$slice$ = _args$slice$ === void 0 ? {} : _args$slice$;\n var _args$slice$$suggest = _args$slice$.suggest,\n suggest = _args$slice$$suggest === void 0 ? getConfig().throwSuggestions : _args$slice$$suggest;\n\n if (element && suggest) {\n var suggestion = getSuggestedQuery(element, variant);\n\n if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) {\n throw getSuggestionError(suggestion.toString(), container);\n }\n }\n\n return element;\n };\n};\n\nvar wrapAllByQueryWithSuggestion = function wrapAllByQueryWithSuggestion(query, queryAllByName, variant) {\n return function (container) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n\n var els = query.apply(void 0, [container].concat(args));\n\n var _args$slice2 = args.slice(-1),\n _args$slice2$ = _args$slice2[0];\n\n _args$slice2$ = _args$slice2$ === void 0 ? {} : _args$slice2$;\n var _args$slice2$$suggest = _args$slice2$.suggest,\n suggest = _args$slice2$$suggest === void 0 ? getConfig().throwSuggestions : _args$slice2$$suggest;\n\n if (els.length && suggest) {\n // get a unique list of all suggestion messages. We are only going to make a suggestion if\n // all the suggestions are the same\n var uniqueSuggestionMessages = [].concat(new Set(els.map(function (element) {\n var _getSuggestedQuery;\n\n return (_getSuggestedQuery = getSuggestedQuery(element, variant)) == null ? void 0 : _getSuggestedQuery.toString();\n })));\n\n if ( // only want to suggest if all the els have the same suggestion.\n uniqueSuggestionMessages.length === 1 && !queryAllByName.endsWith(getSuggestedQuery(els[0], variant).queryName)) {\n throw getSuggestionError(uniqueSuggestionMessages[0], container);\n }\n }\n\n return els;\n };\n};\n\nfunction buildQueries(queryAllBy, getMultipleError, getMissingError) {\n var queryBy = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllBy, getMultipleError), queryAllBy.name, 'query');\n var getAllBy = makeGetAllQuery(queryAllBy, getMissingError);\n var getBy = makeSingleQuery(getAllBy, getMultipleError);\n var getByWithSuggestions = wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'get');\n var getAllWithSuggestions = wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name.replace('query', 'get'), 'getAll');\n var findAllBy = makeFindQuery(wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name, 'findAll'));\n var findBy = makeFindQuery(wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'find'));\n return [queryBy, getAllWithSuggestions, getByWithSuggestions, findAllBy, findBy];\n}\n\nvar queryHelpers = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getElementError: getElementError,\n wrapAllByQueryWithSuggestion: wrapAllByQueryWithSuggestion,\n wrapSingleQueryWithSuggestion: wrapSingleQueryWithSuggestion,\n getMultipleElementsFoundError: getMultipleElementsFoundError,\n queryAllByAttribute: queryAllByAttribute,\n queryByAttribute: queryByAttribute,\n makeSingleQuery: makeSingleQuery,\n makeGetAllQuery: makeGetAllQuery,\n makeFindQuery: makeFindQuery,\n buildQueries: buildQueries\n});\n\nfunction queryAllLabels(container) {\n return Array.from(container.querySelectorAll('label,input')).map(function (node) {\n return {\n node: node,\n textToMatch: getLabelContent(node)\n };\n }).filter(function (_ref) {\n var textToMatch = _ref.textToMatch;\n return textToMatch !== null;\n });\n}\n\nvar queryAllLabelsByText = function queryAllLabelsByText(container, text, _temp) {\n var _ref2 = _temp === void 0 ? {} : _temp,\n _ref2$exact = _ref2.exact,\n exact = _ref2$exact === void 0 ? true : _ref2$exact,\n trim = _ref2.trim,\n collapseWhitespace = _ref2.collapseWhitespace,\n normalizer = _ref2.normalizer;\n\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var textToMatchByLabels = queryAllLabels(container);\n return textToMatchByLabels.filter(function (_ref3) {\n var node = _ref3.node,\n textToMatch = _ref3.textToMatch;\n return matcher(textToMatch, node, text, matchNormalizer);\n }).map(function (_ref4) {\n var node = _ref4.node;\n return node;\n });\n};\n\nvar queryAllByLabelText = function queryAllByLabelText(container, text, _temp2) {\n var _ref5 = _temp2 === void 0 ? {} : _temp2,\n _ref5$selector = _ref5.selector,\n selector = _ref5$selector === void 0 ? '*' : _ref5$selector,\n _ref5$exact = _ref5.exact,\n exact = _ref5$exact === void 0 ? true : _ref5$exact,\n collapseWhitespace = _ref5.collapseWhitespace,\n trim = _ref5.trim,\n normalizer = _ref5.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var matchingLabelledElements = Array.from(container.querySelectorAll('*')).filter(function (element) {\n return getRealLabels(element).length || element.hasAttribute('aria-labelledby');\n }).reduce(function (labelledElements, labelledElement) {\n var labelList = getLabels(container, labelledElement, {\n selector: selector\n });\n labelList.filter(function (label) {\n return Boolean(label.formControl);\n }).forEach(function (label) {\n if (matcher(label.content, label.formControl, text, matchNormalizer) && label.formControl) labelledElements.push(label.formControl);\n });\n var labelsValue = labelList.filter(function (label) {\n return Boolean(label.content);\n }).map(function (label) {\n return label.content;\n });\n if (matcher(labelsValue.join(' '), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n\n if (labelsValue.length > 1) {\n labelsValue.forEach(function (labelValue, index) {\n if (matcher(labelValue, labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n var labelsFiltered = [].concat(labelsValue);\n labelsFiltered.splice(index, 1);\n\n if (labelsFiltered.length > 1) {\n if (matcher(labelsFiltered.join(' '), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n }\n });\n }\n\n return labelledElements;\n }, []).concat( // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n queryAllByAttribute('aria-label', container, text, {\n exact: exact,\n normalizer: matchNormalizer\n }));\n return Array.from(new Set(matchingLabelledElements)).filter(function (element) {\n return element.matches(selector);\n });\n}; // the getAll* query would normally look like this:\n// const getAllByLabelText = makeGetAllQuery(\n// queryAllByLabelText,\n// (c, text) => `Unable to find a label with the text of: ${text}`,\n// )\n// however, we can give a more helpful error message than the generic one,\n// so we're writing this one out by hand.\n\n\nvar getAllByLabelText = function getAllByLabelText(container, text) {\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n var els = queryAllByLabelText.apply(void 0, [container, text].concat(rest));\n\n if (!els.length) {\n var labels = queryAllLabelsByText.apply(void 0, [container, text].concat(rest));\n\n if (labels.length) {\n var tagNames = labels.map(function (label) {\n return getTagNameOfElementAssociatedWithLabelViaFor(container, label);\n }).filter(function (tagName) {\n return !!tagName;\n });\n\n if (tagNames.length) {\n throw getConfig().getElementError(tagNames.map(function (tagName) {\n return \"Found a label with the text of: \" + text + \", however the element associated with this label (<\" + tagName + \" />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <\" + tagName + \" />, you can use aria-label or aria-labelledby instead.\";\n }).join('\\n\\n'), container);\n } else {\n throw getConfig().getElementError(\"Found a label with the text of: \" + text + \", however no form control was found associated to that label. Make sure you're using the \\\"for\\\" attribute or \\\"aria-labelledby\\\" attribute correctly.\", container);\n }\n } else {\n throw getConfig().getElementError(\"Unable to find a label with the text of: \" + text, container);\n }\n }\n\n return els;\n};\n\nfunction getTagNameOfElementAssociatedWithLabelViaFor(container, label) {\n var htmlFor = label.getAttribute('for');\n\n if (!htmlFor) {\n return null;\n }\n\n var element = container.querySelector(\"[id=\\\"\" + htmlFor + \"\\\"]\");\n return element ? element.tagName.toLowerCase() : null;\n} // the reason mentioned above is the same reason we're not using buildQueries\n\n\nvar getMultipleError$7 = function getMultipleError(c, text) {\n return \"Found multiple elements with the text of: \" + text;\n};\n\nvar queryByLabelText = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText, getMultipleError$7), queryAllByLabelText.name, 'query');\nvar getByLabelText = makeSingleQuery(getAllByLabelText, getMultipleError$7);\nvar findAllByLabelText = makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'findAll'));\nvar findByLabelText = makeFindQuery(wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'find'));\nvar getAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'getAll');\nvar getByLabelTextWithSuggestions = wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'get');\nvar queryAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByLabelText, queryAllByLabelText.name, 'queryAll');\n\nvar queryAllByPlaceholderText = function queryAllByPlaceholderText() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n checkContainerType(args[0]); // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n\n return queryAllByAttribute.apply(void 0, ['placeholder'].concat(args));\n};\n\nvar getMultipleError$6 = function getMultipleError(c, text) {\n return \"Found multiple elements with the placeholder text of: \" + text;\n};\n\nvar getMissingError$6 = function getMissingError(c, text) {\n return \"Unable to find an element with the placeholder text of: \" + text;\n};\n\nvar queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll');\n\nvar _buildQueries$6 = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6),\n queryByPlaceholderText = _buildQueries$6[0],\n getAllByPlaceholderText = _buildQueries$6[1],\n getByPlaceholderText = _buildQueries$6[2],\n findAllByPlaceholderText = _buildQueries$6[3],\n findByPlaceholderText = _buildQueries$6[4];\n\nvar queryAllByText = function queryAllByText(container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$selector = _ref.selector,\n selector = _ref$selector === void 0 ? '*' : _ref$selector,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n _ref$ignore = _ref.ignore,\n ignore = _ref$ignore === void 0 ? DEFAULT_IGNORE_TAGS : _ref$ignore,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var baseArray = [];\n\n if (typeof container.matches === 'function' && container.matches(selector)) {\n baseArray = [container];\n }\n\n return [].concat(baseArray, Array.from(container.querySelectorAll(selector))) // TODO: `matches` according lib.dom.d.ts can get only `string` but according our code it can handle also boolean :)\n .filter(function (node) {\n return !ignore || !node.matches(ignore);\n }).filter(function (node) {\n return matcher(getNodeText(node), node, text, matchNormalizer);\n });\n};\n\nvar getMultipleError$5 = function getMultipleError(c, text) {\n return \"Found multiple elements with the text: \" + text;\n};\n\nvar getMissingError$5 = function getMissingError(c, text) {\n return \"Unable to find an element with the text: \" + text + \". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.\";\n};\n\nvar queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, 'queryAll');\n\nvar _buildQueries$5 = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5),\n queryByText = _buildQueries$5[0],\n getAllByText = _buildQueries$5[1],\n getByText = _buildQueries$5[2],\n findAllByText = _buildQueries$5[3],\n findByText = _buildQueries$5[4];\n\nvar queryAllByDisplayValue = function queryAllByDisplayValue(container, value, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll(\"input,textarea,select\")).filter(function (node) {\n if (node.tagName === 'SELECT') {\n var selectedOptions = Array.from(node.options).filter(function (option) {\n return option.selected;\n });\n return selectedOptions.some(function (optionNode) {\n return matcher(getNodeText(optionNode), optionNode, value, matchNormalizer);\n });\n } else {\n return matcher(node.value, node, value, matchNormalizer);\n }\n });\n};\n\nvar getMultipleError$4 = function getMultipleError(c, value) {\n return \"Found multiple elements with the display value: \" + value + \".\";\n};\n\nvar getMissingError$4 = function getMissingError(c, value) {\n return \"Unable to find an element with the display value: \" + value + \".\";\n};\n\nvar queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll');\n\nvar _buildQueries$4 = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4),\n queryByDisplayValue = _buildQueries$4[0],\n getAllByDisplayValue = _buildQueries$4[1],\n getByDisplayValue = _buildQueries$4[2],\n findAllByDisplayValue = _buildQueries$4[3],\n findByDisplayValue = _buildQueries$4[4];\n\nvar queryAllByAltText = function queryAllByAltText(container, alt, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll('img,input,area')).filter(function (node) {\n return matcher(node.getAttribute('alt'), node, alt, matchNormalizer);\n });\n};\n\nvar getMultipleError$3 = function getMultipleError(c, alt) {\n return \"Found multiple elements with the alt text: \" + alt;\n};\n\nvar getMissingError$3 = function getMissingError(c, alt) {\n return \"Unable to find an element with the alt text: \" + alt;\n};\n\nvar queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, 'queryAll');\n\nvar _buildQueries$3 = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3),\n queryByAltText = _buildQueries$3[0],\n getAllByAltText = _buildQueries$3[1],\n getByAltText = _buildQueries$3[2],\n findAllByAltText = _buildQueries$3[3],\n findByAltText = _buildQueries$3[4];\n\nvar isSvgTitle = function isSvgTitle(node) {\n var _node$parentElement;\n\n return node.tagName.toLowerCase() === 'title' && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === 'svg';\n};\n\nvar queryAllByTitle = function queryAllByTitle(container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll('[title], svg > title')).filter(function (node) {\n return matcher(node.getAttribute('title'), node, text, matchNormalizer) || isSvgTitle(node) && matcher(getNodeText(node), node, text, matchNormalizer);\n });\n};\n\nvar getMultipleError$2 = function getMultipleError(c, title) {\n return \"Found multiple elements with the title: \" + title + \".\";\n};\n\nvar getMissingError$2 = function getMissingError(c, title) {\n return \"Unable to find an element with the title: \" + title + \".\";\n};\n\nvar queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, 'queryAll');\n\nvar _buildQueries$2 = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2),\n queryByTitle = _buildQueries$2[0],\n getAllByTitle = _buildQueries$2[1],\n getByTitle = _buildQueries$2[2],\n findAllByTitle = _buildQueries$2[3],\n findByTitle = _buildQueries$2[4];\n\nfunction queryAllByRole(container, role, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n _ref$hidden = _ref.hidden,\n hidden = _ref$hidden === void 0 ? getConfig().defaultHidden : _ref$hidden,\n name = _ref.name,\n trim = _ref.trim,\n normalizer = _ref.normalizer,\n _ref$queryFallbacks = _ref.queryFallbacks,\n queryFallbacks = _ref$queryFallbacks === void 0 ? false : _ref$queryFallbacks,\n selected = _ref.selected,\n checked = _ref.checked,\n pressed = _ref.pressed,\n level = _ref.level,\n expanded = _ref.expanded;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n\n if (selected !== undefined) {\n var _allRoles$get; // guard against unknown roles\n\n\n if (((_allRoles$get = roles.get(role)) == null ? void 0 : _allRoles$get.props['aria-selected']) === undefined) {\n throw new Error(\"\\\"aria-selected\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (checked !== undefined) {\n var _allRoles$get2; // guard against unknown roles\n\n\n if (((_allRoles$get2 = roles.get(role)) == null ? void 0 : _allRoles$get2.props['aria-checked']) === undefined) {\n throw new Error(\"\\\"aria-checked\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (pressed !== undefined) {\n var _allRoles$get3; // guard against unknown roles\n\n\n if (((_allRoles$get3 = roles.get(role)) == null ? void 0 : _allRoles$get3.props['aria-pressed']) === undefined) {\n throw new Error(\"\\\"aria-pressed\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (level !== undefined) {\n // guard against using `level` option with any role other than `heading`\n if (role !== 'heading') {\n throw new Error(\"Role \\\"\" + role + \"\\\" cannot have \\\"level\\\" property.\");\n }\n }\n\n if (expanded !== undefined) {\n var _allRoles$get4; // guard against unknown roles\n\n\n if (((_allRoles$get4 = roles.get(role)) == null ? void 0 : _allRoles$get4.props['aria-expanded']) === undefined) {\n throw new Error(\"\\\"aria-expanded\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n var subtreeIsInaccessibleCache = new WeakMap();\n\n function cachedIsSubtreeInaccessible(element) {\n if (!subtreeIsInaccessibleCache.has(element)) {\n subtreeIsInaccessibleCache.set(element, isSubtreeInaccessible(element));\n }\n\n return subtreeIsInaccessibleCache.get(element);\n }\n\n return Array.from(container.querySelectorAll('*')).filter(function (node) {\n var isRoleSpecifiedExplicitly = node.hasAttribute('role');\n\n if (isRoleSpecifiedExplicitly) {\n var roleValue = node.getAttribute('role');\n\n if (queryFallbacks) {\n return roleValue.split(' ').filter(Boolean).some(function (text) {\n return matcher(text, node, role, matchNormalizer);\n });\n } // if a custom normalizer is passed then let normalizer handle the role value\n\n\n if (normalizer) {\n return matcher(roleValue, node, role, matchNormalizer);\n } // other wise only send the first word to match\n\n\n var _roleValue$split = roleValue.split(' '),\n firstWord = _roleValue$split[0];\n\n return matcher(firstWord, node, role, matchNormalizer);\n }\n\n var implicitRoles = getImplicitAriaRoles(node);\n return implicitRoles.some(function (implicitRole) {\n return matcher(implicitRole, node, role, matchNormalizer);\n });\n }).filter(function (element) {\n if (selected !== undefined) {\n return selected === computeAriaSelected(element);\n }\n\n if (checked !== undefined) {\n return checked === computeAriaChecked(element);\n }\n\n if (pressed !== undefined) {\n return pressed === computeAriaPressed(element);\n }\n\n if (expanded !== undefined) {\n return expanded === computeAriaExpanded(element);\n }\n\n if (level !== undefined) {\n return level === computeHeadingLevel(element);\n } // don't care if aria attributes are unspecified\n\n\n return true;\n }).filter(function (element) {\n return hidden === false ? isInaccessible(element, {\n isSubtreeInaccessible: cachedIsSubtreeInaccessible\n }) === false : true;\n }).filter(function (element) {\n if (name === undefined) {\n // Don't care\n return true;\n }\n\n return matches(computeAccessibleName(element, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n }), element, name, function (text) {\n return text;\n });\n });\n}\n\nvar getMultipleError$1 = function getMultipleError(c, role, _temp2) {\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n name = _ref2.name;\n\n var nameHint = '';\n\n if (name === undefined) {\n nameHint = '';\n } else if (typeof name === 'string') {\n nameHint = \" and name \\\"\" + name + \"\\\"\";\n } else {\n nameHint = \" and name `\" + name + \"`\";\n }\n\n return \"Found multiple elements with the role \\\"\" + role + \"\\\"\" + nameHint;\n};\n\nvar getMissingError$1 = function getMissingError(container, role, _temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$hidden = _ref3.hidden,\n hidden = _ref3$hidden === void 0 ? getConfig().defaultHidden : _ref3$hidden,\n name = _ref3.name;\n\n if (getConfig()._disableExpensiveErrorDiagnostics) {\n return \"Unable to find role=\\\"\" + role + \"\\\"\";\n }\n\n var roles = '';\n Array.from(container.children).forEach(function (childElement) {\n roles += prettyRoles(childElement, {\n hidden: hidden,\n includeName: name !== undefined\n });\n });\n var roleMessage;\n\n if (roles.length === 0) {\n if (hidden === false) {\n roleMessage = 'There are no accessible roles. But there might be some inaccessible roles. ' + 'If you wish to access them, then set the `hidden` option to `true`. ' + 'Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole';\n } else {\n roleMessage = 'There are no available roles.';\n }\n } else {\n roleMessage = (\"\\nHere are the \" + (hidden === false ? 'accessible' : 'available') + \" roles:\\n\\n \" + roles.replace(/\\n/g, '\\n ').replace(/\\n\\s\\s\\n/g, '\\n\\n') + \"\\n\").trim();\n }\n\n var nameHint = '';\n\n if (name === undefined) {\n nameHint = '';\n } else if (typeof name === 'string') {\n nameHint = \" and name \\\"\" + name + \"\\\"\";\n } else {\n nameHint = \" and name `\" + name + \"`\";\n }\n\n return (\"\\nUnable to find an \" + (hidden === false ? 'accessible ' : '') + \"element with the role \\\"\" + role + \"\\\"\" + nameHint + \"\\n\\n\" + roleMessage).trim();\n};\n\nvar queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, 'queryAll');\n\nvar _buildQueries$1 = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1),\n queryByRole = _buildQueries$1[0],\n getAllByRole = _buildQueries$1[1],\n getByRole = _buildQueries$1[2],\n findAllByRole = _buildQueries$1[3],\n findByRole = _buildQueries$1[4];\n\nvar getTestIdAttribute = function getTestIdAttribute() {\n return getConfig().testIdAttribute;\n};\n\nvar queryAllByTestId = function queryAllByTestId() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n checkContainerType(args[0]); // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n\n return queryAllByAttribute.apply(void 0, [getTestIdAttribute()].concat(args));\n};\n\nvar getMultipleError = function getMultipleError(c, id) {\n return \"Found multiple elements by: [\" + getTestIdAttribute() + \"=\\\"\" + id + \"\\\"]\";\n};\n\nvar getMissingError = function getMissingError(c, id) {\n return \"Unable to find an element by: [\" + getTestIdAttribute() + \"=\\\"\" + id + \"\\\"]\";\n};\n\nvar queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, 'queryAll');\n\nvar _buildQueries = buildQueries(queryAllByTestId, getMultipleError, getMissingError),\n queryByTestId = _buildQueries[0],\n getAllByTestId = _buildQueries[1],\n getByTestId = _buildQueries[2],\n findAllByTestId = _buildQueries[3],\n findByTestId = _buildQueries[4];\n\nvar queries = /*#__PURE__*/Object.freeze({\n __proto__: null,\n queryAllByLabelText: queryAllByLabelTextWithSuggestions,\n queryByLabelText: queryByLabelText,\n getAllByLabelText: getAllByLabelTextWithSuggestions,\n getByLabelText: getByLabelTextWithSuggestions,\n findAllByLabelText: findAllByLabelText,\n findByLabelText: findByLabelText,\n queryByPlaceholderText: queryByPlaceholderText,\n queryAllByPlaceholderText: queryAllByPlaceholderTextWithSuggestions,\n getByPlaceholderText: getByPlaceholderText,\n getAllByPlaceholderText: getAllByPlaceholderText,\n findAllByPlaceholderText: findAllByPlaceholderText,\n findByPlaceholderText: findByPlaceholderText,\n queryByText: queryByText,\n queryAllByText: queryAllByTextWithSuggestions,\n getByText: getByText,\n getAllByText: getAllByText,\n findAllByText: findAllByText,\n findByText: findByText,\n queryByDisplayValue: queryByDisplayValue,\n queryAllByDisplayValue: queryAllByDisplayValueWithSuggestions,\n getByDisplayValue: getByDisplayValue,\n getAllByDisplayValue: getAllByDisplayValue,\n findAllByDisplayValue: findAllByDisplayValue,\n findByDisplayValue: findByDisplayValue,\n queryByAltText: queryByAltText,\n queryAllByAltText: queryAllByAltTextWithSuggestions,\n getByAltText: getByAltText,\n getAllByAltText: getAllByAltText,\n findAllByAltText: findAllByAltText,\n findByAltText: findByAltText,\n queryByTitle: queryByTitle,\n queryAllByTitle: queryAllByTitleWithSuggestions,\n getByTitle: getByTitle,\n getAllByTitle: getAllByTitle,\n findAllByTitle: findAllByTitle,\n findByTitle: findByTitle,\n queryByRole: queryByRole,\n queryAllByRole: queryAllByRoleWithSuggestions,\n getAllByRole: getAllByRole,\n getByRole: getByRole,\n findAllByRole: findAllByRole,\n findByRole: findByRole,\n queryByTestId: queryByTestId,\n queryAllByTestId: queryAllByTestIdWithSuggestions,\n getByTestId: getByTestId,\n getAllByTestId: getAllByTestId,\n findAllByTestId: findAllByTestId,\n findByTestId: findByTestId\n});\n/**\n * @typedef {{[key: string]: Function}} FuncMap\n */\n\n/**\n * @param {HTMLElement} element container\n * @param {FuncMap} queries object of functions\n * @param {Object} initialValue for reducer\n * @returns {FuncMap} returns object of functions bound to container\n */\n\nfunction getQueriesForElement(element, queries$1, initialValue) {\n if (queries$1 === void 0) {\n queries$1 = queries;\n }\n\n if (initialValue === void 0) {\n initialValue = {};\n }\n\n return Object.keys(queries$1).reduce(function (helpers, key) {\n var fn = queries$1[key];\n helpers[key] = fn.bind(null, element);\n return helpers;\n }, initialValue);\n}\n\nvar hasWarned$1 = false; // deprecated... TODO: remove this method. People should use a find* query or\n// wait instead the reasoning is that this doesn't really do anything useful\n// that you can't get from using find* or wait.\n\nfunction waitForElement(_x, _x2) {\n return _waitForElement.apply(this, arguments);\n}\n\nfunction _waitForElement() {\n _waitForElement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(callback, options) {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!hasWarned$1) {\n hasWarned$1 = true;\n console.warn(\"`waitForElement` has been deprecated. Use a `find*` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor\");\n }\n\n if (callback) {\n _context.next = 3;\n break;\n }\n\n throw new Error('waitForElement requires a callback as the first parameter');\n\n case 3:\n return _context.abrupt(\"return\", waitForWrapper(function () {\n var result = callback();\n\n if (!result) {\n throw new Error('Timed out in waitForElement.');\n }\n\n return result;\n }, options));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _waitForElement.apply(this, arguments);\n}\n/*\neslint\n require-await: \"off\"\n*/\n\n\nvar isRemoved = function isRemoved(result) {\n return !result || Array.isArray(result) && !result.length;\n}; // Check if the element is not present.\n// As the name implies, waitForElementToBeRemoved should check `present` --> `removed`\n\n\nfunction initialCheck(elements) {\n if (isRemoved(elements)) {\n throw new Error('The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.');\n }\n}\n\nfunction waitForElementToBeRemoved(_x, _x2) {\n return _waitForElementToBeRemoved.apply(this, arguments);\n}\n\nfunction _waitForElementToBeRemoved() {\n _waitForElementToBeRemoved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(callback, options) {\n var timeoutError, elements, getRemainingElements;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // created here so we get a nice stacktrace\n timeoutError = new Error('Timed out in waitForElementToBeRemoved.');\n\n if (typeof callback !== 'function') {\n initialCheck(callback);\n elements = Array.isArray(callback) ? callback : [callback];\n getRemainingElements = elements.map(function (element) {\n var parent = element.parentElement;\n if (parent === null) return function () {\n return null;\n };\n\n while (parent.parentElement) {\n parent = parent.parentElement;\n }\n\n return function () {\n return parent.contains(element) ? element : null;\n };\n });\n\n callback = function callback() {\n return getRemainingElements.map(function (c) {\n return c();\n }).filter(Boolean);\n };\n }\n\n initialCheck(callback());\n return _context.abrupt(\"return\", waitForWrapper(function () {\n var result;\n\n try {\n result = callback();\n } catch (error) {\n if (error.name === 'TestingLibraryElementError') {\n return undefined;\n }\n\n throw error;\n }\n\n if (!isRemoved(result)) {\n throw timeoutError;\n }\n\n return undefined;\n }, options));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _waitForElementToBeRemoved.apply(this, arguments);\n}\n/*\neslint\n require-await: \"off\"\n*/\n\n\nvar hasWarned = false; // deprecated... TODO: remove this method. People should use wait instead\n// the reasoning is that waiting for just any DOM change is an implementation\n// detail. People should be waiting for a specific thing to change.\n\nfunction waitForDomChange(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$container = _ref.container,\n container = _ref$container === void 0 ? getDocument() : _ref$container,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? getConfig().asyncUtilTimeout : _ref$timeout,\n _ref$mutationObserver = _ref.mutationObserverOptions,\n mutationObserverOptions = _ref$mutationObserver === void 0 ? {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true\n } : _ref$mutationObserver;\n\n if (!hasWarned) {\n hasWarned = true;\n console.warn(\"`waitForDomChange` has been deprecated. Use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.\");\n }\n\n return new Promise(function (resolve, reject) {\n var timer = setTimeoutFn(onTimeout, timeout);\n\n var _getWindowFromNode = getWindowFromNode(container),\n MutationObserver = _getWindowFromNode.MutationObserver;\n\n var observer = new MutationObserver(onMutation);\n runWithRealTimers(function () {\n return observer.observe(container, mutationObserverOptions);\n });\n\n function onDone(error, result) {\n clearTimeoutFn(timer);\n setImmediateFn(function () {\n return observer.disconnect();\n });\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n }\n\n function onMutation(mutationsList) {\n onDone(null, mutationsList);\n }\n\n function onTimeout() {\n onDone(new Error('Timed out in waitForDomChange.'), null);\n }\n });\n}\n\nfunction waitForDomChangeWrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return getConfig().asyncWrapper(function () {\n return waitForDomChange.apply(void 0, args);\n });\n}\n\nvar eventMap = {\n // Clipboard Events\n copy: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n cut: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n paste: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Composition Events\n compositionEnd: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n compositionStart: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n compositionUpdate: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Keyboard Events\n keyDown: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n keyPress: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n keyUp: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n // Focus Events\n focus: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n blur: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n focusIn: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n focusOut: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n // Form Events\n change: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n input: {\n EventType: 'InputEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n invalid: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: true\n }\n },\n submit: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n reset: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n // Mouse Events\n click: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n button: 0,\n composed: true\n }\n },\n contextMenu: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dblClick: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n drag: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragEnd: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragEnter: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragExit: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragLeave: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragOver: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragStart: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n drop: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseDown: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseEnter: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mouseLeave: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mouseMove: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseOut: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseOver: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseUp: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Selection Events\n select: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n // Touch Events\n touchCancel: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n touchEnd: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n touchMove: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n touchStart: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // UI Events\n scroll: {\n EventType: 'UIEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Wheel Events\n wheel: {\n EventType: 'WheelEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Media Events\n abort: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n canPlay: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n canPlayThrough: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n durationChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n emptied: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n encrypted: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n ended: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadedData: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadedMetadata: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadStart: {\n EventType: 'ProgressEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n pause: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n play: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n playing: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n progress: {\n EventType: 'ProgressEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n rateChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n seeked: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n seeking: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n stalled: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n suspend: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n timeUpdate: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n volumeChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n waiting: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Image Events\n load: {\n EventType: 'UIEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n error: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Animation Events\n animationStart: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n animationEnd: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n animationIteration: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n // Transition Events\n transitionEnd: {\n EventType: 'TransitionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n // pointer events\n pointerOver: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerEnter: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n pointerDown: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerMove: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerUp: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerCancel: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n pointerOut: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerLeave: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n gotPointerCapture: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n lostPointerCapture: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n // history events\n popState: {\n EventType: 'PopStateEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n }\n};\nvar eventAliasMap = {\n doubleClick: 'dblClick'\n};\nvar _excluded = [\"value\", \"files\"],\n _excluded2 = [\"bubbles\", \"cancelable\", \"detail\"];\n\nfunction fireEvent(element, event) {\n return getConfig().eventWrapper(function () {\n if (!event) {\n throw new Error(\"Unable to fire an event - please provide an event object.\");\n }\n\n if (!element) {\n throw new Error(\"Unable to fire a \\\"\" + event.type + \"\\\" event - please provide a DOM element.\");\n }\n\n return element.dispatchEvent(event);\n });\n}\n\nfunction createEvent(eventName, node, init, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$EventType = _ref.EventType,\n EventType = _ref$EventType === void 0 ? 'Event' : _ref$EventType,\n _ref$defaultInit = _ref.defaultInit,\n defaultInit = _ref$defaultInit === void 0 ? {} : _ref$defaultInit;\n\n if (!node) {\n throw new Error(\"Unable to fire a \\\"\" + eventName + \"\\\" event - please provide a DOM element.\");\n }\n\n var eventInit = _extends({}, defaultInit, init);\n\n var _eventInit$target = eventInit.target;\n _eventInit$target = _eventInit$target === void 0 ? {} : _eventInit$target;\n\n var value = _eventInit$target.value,\n files = _eventInit$target.files,\n targetProperties = _objectWithoutPropertiesLoose(_eventInit$target, _excluded);\n\n if (value !== undefined) {\n setNativeValue(node, value);\n }\n\n if (files !== undefined) {\n // input.files is a read-only property so this is not allowed:\n // input.files = [file]\n // so we have to use this workaround to set the property\n Object.defineProperty(node, 'files', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: files\n });\n }\n\n Object.assign(node, targetProperties);\n var window = getWindowFromNode(node);\n var EventConstructor = window[EventType] || window.Event;\n var event;\n /* istanbul ignore else */\n\n if (typeof EventConstructor === 'function') {\n event = new EventConstructor(eventName, eventInit);\n } else {\n // IE11 polyfill from https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill\n event = window.document.createEvent(EventType);\n\n var bubbles = eventInit.bubbles,\n cancelable = eventInit.cancelable,\n detail = eventInit.detail,\n otherInit = _objectWithoutPropertiesLoose(eventInit, _excluded2);\n\n event.initEvent(eventName, bubbles, cancelable, detail);\n Object.keys(otherInit).forEach(function (eventKey) {\n event[eventKey] = otherInit[eventKey];\n });\n } // DataTransfer is not supported in jsdom: https://github.com/jsdom/jsdom/issues/1568\n\n\n var dataTransferProperties = ['dataTransfer', 'clipboardData'];\n dataTransferProperties.forEach(function (dataTransferKey) {\n var dataTransferValue = eventInit[dataTransferKey];\n\n if (typeof dataTransferValue === 'object') {\n /* istanbul ignore if */\n if (typeof window.DataTransfer === 'function') {\n Object.defineProperty(event, dataTransferKey, {\n value: Object.getOwnPropertyNames(dataTransferValue).reduce(function (acc, propName) {\n Object.defineProperty(acc, propName, {\n value: dataTransferValue[propName]\n });\n return acc;\n }, new window.DataTransfer())\n });\n } else {\n Object.defineProperty(event, dataTransferKey, {\n value: dataTransferValue\n });\n }\n }\n });\n return event;\n}\n\nObject.keys(eventMap).forEach(function (key) {\n var _eventMap$key = eventMap[key],\n EventType = _eventMap$key.EventType,\n defaultInit = _eventMap$key.defaultInit;\n var eventName = key.toLowerCase();\n\n createEvent[key] = function (node, init) {\n return createEvent(eventName, node, init, {\n EventType: EventType,\n defaultInit: defaultInit\n });\n };\n\n fireEvent[key] = function (node, init) {\n return fireEvent(node, createEvent[key](node, init));\n };\n}); // function written after some investigation here:\n// https://github.com/facebook/react/issues/10135#issuecomment-401496776\n\nfunction setNativeValue(element, value) {\n var _ref2 = Object.getOwnPropertyDescriptor(element, 'value') || {},\n valueSetter = _ref2.set;\n\n var prototype = Object.getPrototypeOf(element);\n\n var _ref3 = Object.getOwnPropertyDescriptor(prototype, 'value') || {},\n prototypeValueSetter = _ref3.set;\n\n if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n }\n /* istanbul ignore next (I don't want to bother) */\n else if (valueSetter) {\n valueSetter.call(element, value);\n } else {\n throw new Error('The given element does not have a value setter');\n }\n}\n\nObject.keys(eventAliasMap).forEach(function (aliasKey) {\n var key = eventAliasMap[aliasKey];\n\n fireEvent[aliasKey] = function () {\n return fireEvent[key].apply(fireEvent, arguments);\n };\n});\n/* eslint complexity:[\"error\", 9] */\n\nfunction unindent(string) {\n // remove white spaces first, to save a few bytes.\n // testing-playground will reformat on load any ways.\n return string.replace(/[ \\t]*[\\n][ \\t]*/g, '\\n');\n}\n\nfunction encode(value) {\n return compressToEncodedURIComponent(unindent(value));\n}\n\nfunction getPlaygroundUrl(markup) {\n return \"https://testing-playground.com/#markup=\" + encode(markup);\n}\n\nvar debug = function debug(element, maxLength, options) {\n return Array.isArray(element) ? element.forEach(function (el) {\n return logDOM(el, maxLength, options);\n }) : logDOM(element, maxLength, options);\n};\n\nvar logTestingPlaygroundURL = function logTestingPlaygroundURL(element) {\n if (element === void 0) {\n element = getDocument().body;\n }\n\n if (!element || !('innerHTML' in element)) {\n console.log(\"The element you're providing isn't a valid DOM element.\");\n return;\n }\n\n if (!element.innerHTML) {\n console.log(\"The provided element doesn't have any children.\");\n return;\n }\n\n console.log(\"Open this URL in your browser\\n\\n\" + getPlaygroundUrl(element.innerHTML));\n};\n\nvar initialValue = {\n debug: debug,\n logTestingPlaygroundURL: logTestingPlaygroundURL\n};\nvar screen = typeof document !== 'undefined' && document.body ? getQueriesForElement(document.body, queries, initialValue) : Object.keys(queries).reduce(function (helpers, key) {\n helpers[key] = function () {\n throw new TypeError('For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error');\n };\n\n return helpers;\n}, initialValue);\nexport { buildQueries, configure, createEvent, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, getAllByAltText, getAllByDisplayValue, getAllByLabelTextWithSuggestions as getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelTextWithSuggestions as getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getMultipleElementsFoundError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, makeFindQuery, makeGetAllQuery, makeSingleQuery, prettyDOM, queries, queryAllByAltTextWithSuggestions as queryAllByAltText, queryAllByAttribute, queryAllByDisplayValueWithSuggestions as queryAllByDisplayValue, queryAllByLabelTextWithSuggestions as queryAllByLabelText, queryAllByPlaceholderTextWithSuggestions as queryAllByPlaceholderText, queryAllByRoleWithSuggestions as queryAllByRole, queryAllByTestIdWithSuggestions as queryAllByTestId, queryAllByTextWithSuggestions as queryAllByText, queryAllByTitleWithSuggestions as queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, wait, waitForWrapper as waitFor, waitForDomChangeWrapper as waitForDomChange, waitForElement, waitForElementToBeRemoved, getQueriesForElement as within, wrapAllByQueryWithSuggestion, wrapSingleQueryWithSuggestion };","map":{"version":3,"sources":["/Users/jane/Documents/Курс Front-end/HW8/myproject/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js"],"names":["_extends","prettyFormat","default","computeAccessibleName","elementRoles","roles","_asyncToGenerator","_regeneratorRuntime","_objectWithoutPropertiesLoose","compressToEncodedURIComponent","chalk","readFileSync","codeFrameColumns","nodeRequire","module","require","call","_unused","getCodeFrame","frame","locationStart","indexOf","locationEnd","frameLocation","slice","frameLocationElements","split","_ref","parseInt","filename","line","column","rawFileContents","_unused2","codeFrame","start","highlightCode","linesBelow","dim","getUserCodeFrame","err","Error","firstClientCodeFrame","stack","find","includes","globalObj","window","global","TEXT_NODE","runWithRealTimers","callback","hasJestTimers","runWithJestRealTimers","callbackReturnValue","jest","useRealTimers","timerAPI","clearInterval","clearTimeout","setInterval","setTimeout","setImmediate","clearImmediate","usedFakeTimers","Object","entries","some","name","func","_timerAPI$setTimeout","useFakeTimers","clock","jestFakeTimersAreEnabled","setImmediatePolyfill","fn","getTimeFunctions","clearTimeoutFn","setImmediateFn","setTimeoutFn","_runWithRealTimers","getDocument","document","getWindowFromNode","node","defaultView","ownerDocument","then","Function","Array","isArray","debug","logTestingPlaygroundURL","checkContainerType","container","querySelector","querySelectorAll","TypeError","getTypeName","object","constructor","inCypress","dom","undefined","Cypress","inNode","process","versions","getMaxLength","env","DEBUG_PRINT_LIMIT","_prettyFormat$plugins","plugins","DOMElement","DOMCollection","prettyDOM","maxLength","options","body","documentElement","domTypeName","debugContent","printFunctionName","highlight","outerHTML","length","logDOM","userCodeFrame","console","log","apply","arguments","config","testIdAttribute","asyncUtilTimeout","asyncWrapper","cb","eventWrapper","defaultHidden","showOriginalStackTrace","throwSuggestions","getElementError","message","error","filter","Boolean","join","_disableExpensiveErrorDiagnostics","computedStyleSupportsPseudoElements","DEFAULT_IGNORE_TAGS","runWithExpensiveErrorDiagnosticsDisabled","configure","newConfig","getConfig","labelledNodeNames","getTextContent","nodeName","toLowerCase","nodeType","textContent","from","childNodes","map","childNode","getLabelContent","element","tagName","value","getRealLabels","labels","_labels","isLabelable","label","control","test","getAttribute","getLabels","_temp","_ref$selector","selector","ariaLabelledBy","labelsId","labelId","labellingElement","content","formControl","textToMatch","formControlSelector","labelledFormControl","formControlElement","matches","assertNotNullOrUndefined","matcher","fuzzyMatches","normalizer","normalizedText","toString","RegExp","String","getDefaultNormalizer","_ref$trim","trim","_ref$collapseWhitespa","collapseWhitespace","text","replace","makeNormalizer","_ref2","getNodeText","child","c","_createForOfIteratorHelperLoose","o","allowArrayLike","it","Symbol","iterator","next","bind","_unsupportedIterableToArray","i","done","minLen","_arrayLikeToArray","n","prototype","arr","len","arr2","elementRoleList","buildElementRoleList","isSubtreeInaccessible","hidden","getComputedStyle","display","isInaccessible","_options","_options$isSubtreeIna","isSubtreeInaccessibleImpl","visibility","currentElement","parentElement","getImplicitAriaRoles","currentNode","_iterator","_step","_step$value","match","concat","elementRolesMap","makeElementSelector","attributes","attributeName","_ref2$constraints","constraints","shouldNotExist","getSelectorSpecificity","_ref3","_ref3$attributes","bySelectorSpecificity","_ref4","_ref5","leftSpecificity","specificity","rightSpecificity","_element$attributes","typeTextIndex","findIndex","attribute","type","result","_iterator2","_step2","_step2$value","sort","getRoles","_ref6","_ref6$hidden","flattenDOM","children","reduce","acc","hasAttribute","rolesAcc","role","_extends2","_extends3","prettyRoles","_ref7","_ref8","_ref9","elements","delimiterBar","repeat","elementsString","el","nameString","domString","cloneNode","logRoles","_temp2","_ref10","_ref10$hidden","computeAriaSelected","selected","checkBooleanAttribute","computeAriaChecked","indeterminate","checked","computeAriaPressed","computeAriaExpanded","attributeValue","computeHeadingLevel","implicitHeadingLevels","H1","H2","H3","H4","H5","H6","ariaLevelAttribute","Number","normalize","escapeRegExp","string","getRegExpMatcher","makeSuggestion","queryName","variant","warning","queryOptions","queryArgs","keys","push","queryMethod","warn","k","v","canSuggest","currentMethod","requestedMethod","data","getSuggestedQuery","method","_element$getAttribute","_getImplicitAriaRoles","labelText","placeholderText","alt","title","testId","copyStackTrace","target","source","waitFor","_ref$container","_ref$timeout","timeout","_ref$showOriginalStac","stackTraceError","_ref$interval","interval","_ref$onTimeout","onTimeout","_ref$mutationObserver","mutationObserverOptions","subtree","childList","characterData","Promise","mark","_callee","resolve","reject","lastError","intervalId","observer","finished","promiseStatus","overallTimeoutTimer","usingJestFakeTimers","_getWindowFromNode","MutationObserver","onDone","checkRealTimersCallback","checkCallback","handleTimeout","wrap","_callee$","_context","prev","_handleTimeout","_checkCallback","resolvedValue","rejectedValue","_checkRealTimersCallb","_error","_onDone","disconnect","abrupt","advanceTimersByTime","r","t0","observe","stop","_x","_x2","waitForWrapper","hasWarned$2","wait","_len","args","_key","_args$","first","rest","getMultipleElementsFoundError","queryAllByAttribute","_ref$exact","exact","matchNormalizer","queryByAttribute","els","makeSingleQuery","allQuery","getMultipleError","_len2","_key2","elementStrings","getSuggestionError","suggestion","makeGetAllQuery","getMissingError","_len3","_key3","makeFindQuery","getter","waitForOptions","wrapSingleQueryWithSuggestion","query","queryAllByName","_len4","_key4","_args$slice","_args$slice$","_args$slice$$suggest","suggest","endsWith","wrapAllByQueryWithSuggestion","_len5","_key5","_args$slice2","_args$slice2$","_args$slice2$$suggest","uniqueSuggestionMessages","Set","_getSuggestedQuery","buildQueries","queryAllBy","queryBy","getAllBy","getBy","getByWithSuggestions","getAllWithSuggestions","findAllBy","findBy","queryHelpers","freeze","__proto__","queryAllLabels","queryAllLabelsByText","_ref2$exact","textToMatchByLabels","queryAllByLabelText","_ref5$selector","_ref5$exact","matchingLabelledElements","labelledElements","labelledElement","labelList","forEach","labelsValue","labelValue","index","labelsFiltered","splice","getAllByLabelText","tagNames","getTagNameOfElementAssociatedWithLabelViaFor","htmlFor","getMultipleError$7","queryByLabelText","getByLabelText","findAllByLabelText","findByLabelText","getAllByLabelTextWithSuggestions","getByLabelTextWithSuggestions","queryAllByLabelTextWithSuggestions","queryAllByPlaceholderText","getMultipleError$6","getMissingError$6","queryAllByPlaceholderTextWithSuggestions","_buildQueries$6","queryByPlaceholderText","getAllByPlaceholderText","getByPlaceholderText","findAllByPlaceholderText","findByPlaceholderText","queryAllByText","_ref$ignore","ignore","baseArray","getMultipleError$5","getMissingError$5","queryAllByTextWithSuggestions","_buildQueries$5","queryByText","getAllByText","getByText","findAllByText","findByText","queryAllByDisplayValue","selectedOptions","option","optionNode","getMultipleError$4","getMissingError$4","queryAllByDisplayValueWithSuggestions","_buildQueries$4","queryByDisplayValue","getAllByDisplayValue","getByDisplayValue","findAllByDisplayValue","findByDisplayValue","queryAllByAltText","getMultipleError$3","getMissingError$3","queryAllByAltTextWithSuggestions","_buildQueries$3","queryByAltText","getAllByAltText","getByAltText","findAllByAltText","findByAltText","isSvgTitle","_node$parentElement","queryAllByTitle","getMultipleError$2","getMissingError$2","queryAllByTitleWithSuggestions","_buildQueries$2","queryByTitle","getAllByTitle","getByTitle","findAllByTitle","findByTitle","queryAllByRole","_ref$hidden","_ref$queryFallbacks","queryFallbacks","pressed","level","expanded","_allRoles$get","get","props","_allRoles$get2","_allRoles$get3","_allRoles$get4","subtreeIsInaccessibleCache","WeakMap","cachedIsSubtreeInaccessible","has","set","isRoleSpecifiedExplicitly","roleValue","_roleValue$split","firstWord","implicitRoles","implicitRole","getMultipleError$1","nameHint","getMissingError$1","_temp3","_ref3$hidden","childElement","includeName","roleMessage","queryAllByRoleWithSuggestions","_buildQueries$1","queryByRole","getAllByRole","getByRole","findAllByRole","findByRole","getTestIdAttribute","queryAllByTestId","id","queryAllByTestIdWithSuggestions","_buildQueries","queryByTestId","getAllByTestId","getByTestId","findAllByTestId","findByTestId","queries","getQueriesForElement","queries$1","initialValue","helpers","key","hasWarned$1","waitForElement","_waitForElement","isRemoved","initialCheck","waitForElementToBeRemoved","_waitForElementToBeRemoved","timeoutError","getRemainingElements","parent","contains","hasWarned","waitForDomChange","timer","onMutation","mutationsList","waitForDomChangeWrapper","eventMap","copy","EventType","defaultInit","bubbles","cancelable","composed","cut","paste","compositionEnd","compositionStart","compositionUpdate","keyDown","charCode","keyPress","keyUp","focus","blur","focusIn","focusOut","change","input","invalid","submit","reset","click","button","contextMenu","dblClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","mouseDown","mouseEnter","mouseLeave","mouseMove","mouseOut","mouseOver","mouseUp","select","touchCancel","touchEnd","touchMove","touchStart","scroll","wheel","abort","canPlay","canPlayThrough","durationChange","emptied","encrypted","ended","loadedData","loadedMetadata","loadStart","pause","play","playing","progress","rateChange","seeked","seeking","stalled","suspend","timeUpdate","volumeChange","waiting","load","animationStart","animationEnd","animationIteration","transitionEnd","pointerOver","pointerEnter","pointerDown","pointerMove","pointerUp","pointerCancel","pointerOut","pointerLeave","gotPointerCapture","lostPointerCapture","popState","eventAliasMap","doubleClick","_excluded","_excluded2","fireEvent","event","dispatchEvent","createEvent","eventName","init","_ref$EventType","_ref$defaultInit","eventInit","_eventInit$target","files","targetProperties","setNativeValue","defineProperty","configurable","enumerable","writable","assign","EventConstructor","Event","detail","otherInit","initEvent","eventKey","dataTransferProperties","dataTransferKey","dataTransferValue","DataTransfer","getOwnPropertyNames","propName","_eventMap$key","getOwnPropertyDescriptor","valueSetter","getPrototypeOf","prototypeValueSetter","aliasKey","unindent","encode","getPlaygroundUrl","markup","innerHTML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F,SAAxmB,EAAmnBU,WAAnnB,EAAgoBpF,SAAhoB,EAA2oBmC,UAA3oB,EAAupBhZ,SAAvpB,EAAkqB8C,oBAAlqB,EAAwrB1D,eAAxrB,EAAysBmR,6BAAzsB,EAAwuBhN,WAAxuB,EAAqvB8Y,oBAArvB,EAA2wB3U,QAA3wB,EAAqxBmE,iBAArxB,EAAwyB3G,cAAxyB,EAAwzB7G,MAAxzB,EAAg0B6K,QAAh0B,EAA00BwI,aAA10B,EAAy1BJ,eAAz1B,EAA02BR,eAA12B,EAA23BpT,SAA33B,EAAs4B0e,OAAt4B,EAA+4BpE,gCAAgC,IAAIH,iBAAn7B,EAAs8BrH,mBAAt8B,EAA29B8G,qCAAqC,IAAIN,sBAApgC,EAA4hCxB,kCAAkC,IAAIxB,mBAAlkC,EAAulC4B,wCAAwC,IAAIH,yBAAnoC,EAA8pC0F,6BAA6B,IAAIhC,cAA/rC,EAA+sC0C,+BAA+B,IAAIF,gBAAlvC,EAAowClF,6BAA6B,IAAIN,cAAryC,EAAqzCyC,8BAA8B,IAAIH,eAAv1C,EAAw2CP,cAAx2C,EAAw3CtH,gBAAx3C,EAA04C4G,mBAA14C,EAA+5CtC,gBAA/5C,EAAi7CY,sBAAj7C,EAAy8CuF,WAAz8C,EAAs9CU,aAAt9C,EAAq+CpF,WAAr+C,EAAk/CmC,YAAl/C,EAAggDrF,YAAhgD,EAA8gDwS,MAA9gD,EAAshDjW,IAAthD,EAA4hDF,cAAc,IAAIrD,OAA9iD,EAAujDiR,uBAAuB,IAAIJ,gBAAllD,EAAomDX,cAApmD,EAAonDI,yBAApnD,EAA+oDV,oBAAoB,IAAI6J,MAAvqD,EAA+qD3T,4BAA/qD,EAA6sDV,6BAA7sD","sourcesContent":["import _extends from '@babel/runtime/helpers/esm/extends';\nimport prettyFormat from 'pretty-format';\nexport { default as prettyFormat } from 'pretty-format';\nimport { computeAccessibleName } from 'dom-accessibility-api';\nimport { elementRoles, roles } from 'aria-query';\nimport _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator';\nimport _regeneratorRuntime from '@babel/runtime/regenerator';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport { compressToEncodedURIComponent } from 'lz-string';\n\n// We try to load node dependencies\nvar chalk = null;\nvar readFileSync = null;\nvar codeFrameColumns = null;\n\ntry {\n var nodeRequire = module && module.require;\n readFileSync = nodeRequire.call(module, 'fs').readFileSync;\n codeFrameColumns = nodeRequire.call(module, '@babel/code-frame').codeFrameColumns;\n chalk = nodeRequire.call(module, 'chalk');\n} catch (_unused) {// We're in a browser environment\n} // frame has the form \"at myMethod (location/to/my/file.js:10:2)\"\n\n\nfunction getCodeFrame(frame) {\n var locationStart = frame.indexOf('(') + 1;\n var locationEnd = frame.indexOf(')');\n var frameLocation = frame.slice(locationStart, locationEnd);\n var frameLocationElements = frameLocation.split(':');\n var _ref = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)],\n filename = _ref[0],\n line = _ref[1],\n column = _ref[2];\n var rawFileContents = '';\n\n try {\n rawFileContents = readFileSync(filename, 'utf-8');\n } catch (_unused2) {\n return '';\n }\n\n var codeFrame = codeFrameColumns(rawFileContents, {\n start: {\n line: line,\n column: column\n }\n }, {\n highlightCode: true,\n linesBelow: 0\n });\n return chalk.dim(frameLocation) + \"\\n\" + codeFrame + \"\\n\";\n}\n\nfunction getUserCodeFrame() {\n // If we couldn't load dependencies, we can't generate the user trace\n\n /* istanbul ignore next */\n if (!readFileSync || !codeFrameColumns) {\n return '';\n }\n\n var err = new Error();\n var firstClientCodeFrame = err.stack.split('\\n').slice(1) // Remove first line which has the form \"Error: TypeError\"\n .find(function (frame) {\n return !frame.includes('node_modules/');\n }); // Ignore frames from 3rd party libraries\n\n return getCodeFrame(firstClientCodeFrame);\n}\n\nvar globalObj = typeof window === 'undefined' ? global : window; // Constant node.nodeType for text nodes, see:\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#Node_type_constants\n\nvar TEXT_NODE = 3; // Currently this fn only supports jest timers, but it could support other test runners in the future.\n\nfunction runWithRealTimers(callback) {\n return hasJestTimers() ? runWithJestRealTimers(callback).callbackReturnValue : // istanbul ignore next\n callback();\n}\n\nfunction hasJestTimers() {\n return typeof jest !== 'undefined' && jest !== null && typeof jest.useRealTimers === 'function';\n}\n\nfunction runWithJestRealTimers(callback) {\n var timerAPI = {\n clearInterval: clearInterval,\n clearTimeout: clearTimeout,\n setInterval: setInterval,\n setTimeout: setTimeout\n }; // For more on why we have the check here,\n // checkout https://github.com/testing-library/dom-testing-library/issues/914\n\n if (typeof setImmediate === 'function') {\n timerAPI.setImmediate = setImmediate;\n }\n\n if (typeof clearImmediate === 'function') {\n timerAPI.clearImmediate = clearImmediate;\n }\n\n jest.useRealTimers();\n var callbackReturnValue = callback();\n var usedFakeTimers = Object.entries(timerAPI).some(function (_ref) {\n var name = _ref[0],\n func = _ref[1];\n return func !== globalObj[name];\n });\n\n if (usedFakeTimers) {\n var _timerAPI$setTimeout;\n\n jest.useFakeTimers((_timerAPI$setTimeout = timerAPI.setTimeout) != null && _timerAPI$setTimeout.clock ? 'modern' : 'legacy');\n }\n\n return {\n callbackReturnValue: callbackReturnValue,\n usedFakeTimers: usedFakeTimers\n };\n}\n\nfunction jestFakeTimersAreEnabled() {\n return hasJestTimers() ? runWithJestRealTimers(function () {}).usedFakeTimers : // istanbul ignore next\n false;\n} // we only run our tests in node, and setImmediate is supported in node.\n// istanbul ignore next\n\n\nfunction setImmediatePolyfill(fn) {\n return globalObj.setTimeout(fn, 0);\n}\n\nfunction getTimeFunctions() {\n // istanbul ignore next\n return {\n clearTimeoutFn: globalObj.clearTimeout,\n setImmediateFn: globalObj.setImmediate || setImmediatePolyfill,\n setTimeoutFn: globalObj.setTimeout\n };\n}\n\nvar _runWithRealTimers = runWithRealTimers(getTimeFunctions),\n clearTimeoutFn = _runWithRealTimers.clearTimeoutFn,\n setImmediateFn = _runWithRealTimers.setImmediateFn,\n setTimeoutFn = _runWithRealTimers.setTimeoutFn;\n\nfunction getDocument() {\n /* istanbul ignore if */\n if (typeof window === 'undefined') {\n throw new Error('Could not find default container');\n }\n\n return window.document;\n}\n\nfunction getWindowFromNode(node) {\n if (node.defaultView) {\n // node is document\n return node.defaultView;\n } else if (node.ownerDocument && node.ownerDocument.defaultView) {\n // node is a DOM node\n return node.ownerDocument.defaultView;\n } else if (node.window) {\n // node is window\n return node.window;\n } else if (node.then instanceof Function) {\n throw new Error(\"It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?\");\n } else if (Array.isArray(node)) {\n throw new Error(\"It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?\");\n } else if (typeof node.debug === 'function' && typeof node.logTestingPlaygroundURL === 'function') {\n throw new Error(\"It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?\");\n } else {\n // The user passed something unusual to a calling function\n throw new Error(\"Unable to find the \\\"window\\\" object for the given node. Please file an issue with the code that's causing you to see this error: https://github.com/testing-library/dom-testing-library/issues/new\");\n }\n}\n\nfunction checkContainerType(container) {\n if (!container || !(typeof container.querySelector === 'function') || !(typeof container.querySelectorAll === 'function')) {\n throw new TypeError(\"Expected container to be an Element, a Document or a DocumentFragment but got \" + getTypeName(container) + \".\");\n }\n\n function getTypeName(object) {\n if (typeof object === 'object') {\n return object === null ? 'null' : object.constructor.name;\n }\n\n return typeof object;\n }\n}\n\nfunction inCypress(dom) {\n var window = dom.ownerDocument && dom.ownerDocument.defaultView || undefined;\n return typeof global !== 'undefined' && global.Cypress || typeof window !== 'undefined' && window.Cypress;\n}\n\nvar inNode = function inNode() {\n return typeof process !== 'undefined' && process.versions !== undefined && process.versions.node !== undefined;\n};\n\nvar getMaxLength = function getMaxLength(dom) {\n return inCypress(dom) ? 0 : typeof process !== 'undefined' && process.env.DEBUG_PRINT_LIMIT || 7000;\n};\n\nvar _prettyFormat$plugins = prettyFormat.plugins,\n DOMElement = _prettyFormat$plugins.DOMElement,\n DOMCollection = _prettyFormat$plugins.DOMCollection;\n\nfunction prettyDOM(dom, maxLength, options) {\n if (!dom) {\n dom = getDocument().body;\n }\n\n if (typeof maxLength !== 'number') {\n maxLength = getMaxLength(dom);\n }\n\n if (maxLength === 0) {\n return '';\n }\n\n if (dom.documentElement) {\n dom = dom.documentElement;\n }\n\n var domTypeName = typeof dom;\n\n if (domTypeName === 'object') {\n domTypeName = dom.constructor.name;\n } else {\n // To don't fall with `in` operator\n dom = {};\n }\n\n if (!('outerHTML' in dom)) {\n throw new TypeError(\"Expected an element or document but got \" + domTypeName);\n }\n\n var debugContent = prettyFormat(dom, _extends({\n plugins: [DOMElement, DOMCollection],\n printFunctionName: false,\n highlight: inNode()\n }, options));\n return maxLength !== undefined && dom.outerHTML.length > maxLength ? debugContent.slice(0, maxLength) + \"...\" : debugContent;\n}\n\nvar logDOM = function logDOM() {\n var userCodeFrame = getUserCodeFrame();\n\n if (userCodeFrame) {\n console.log(prettyDOM.apply(void 0, arguments) + \"\\n\\n\" + userCodeFrame);\n } else {\n console.log(prettyDOM.apply(void 0, arguments));\n }\n};\n\n// It would be cleaner for this to live inside './queries', but\n// other parts of the code assume that all exports from\n// './queries' are query functions.\nvar config = {\n testIdAttribute: 'data-testid',\n asyncUtilTimeout: 1000,\n // this is to support React's async `act` function.\n // forcing react-testing-library to wrap all async functions would've been\n // a total nightmare (consider wrapping every findBy* query and then also\n // updating `within` so those would be wrapped too. Total nightmare).\n // so we have this config option that's really only intended for\n // react-testing-library to use. For that reason, this feature will remain\n // undocumented.\n asyncWrapper: function asyncWrapper(cb) {\n return cb();\n },\n eventWrapper: function eventWrapper(cb) {\n return cb();\n },\n // default value for the `hidden` option in `ByRole` queries\n defaultHidden: false,\n // showOriginalStackTrace flag to show the full error stack traces for async errors\n showOriginalStackTrace: false,\n // throw errors w/ suggestions for better queries. Opt in so off by default.\n throwSuggestions: false,\n // called when getBy* queries fail. (message, container) => Error\n getElementError: function getElementError(message, container) {\n var error = new Error([message, prettyDOM(container)].filter(Boolean).join('\\n\\n'));\n error.name = 'TestingLibraryElementError';\n return error;\n },\n _disableExpensiveErrorDiagnostics: false,\n computedStyleSupportsPseudoElements: false\n};\nvar DEFAULT_IGNORE_TAGS = 'script, style';\nfunction runWithExpensiveErrorDiagnosticsDisabled(callback) {\n try {\n config._disableExpensiveErrorDiagnostics = true;\n return callback();\n } finally {\n config._disableExpensiveErrorDiagnostics = false;\n }\n}\nfunction configure(newConfig) {\n if (typeof newConfig === 'function') {\n // Pass the existing config out to the provided function\n // and accept a delta in return\n newConfig = newConfig(config);\n } // Merge the incoming config delta\n\n\n config = _extends({}, config, newConfig);\n}\nfunction getConfig() {\n return config;\n}\n\nvar labelledNodeNames = ['button', 'meter', 'output', 'progress', 'select', 'textarea', 'input'];\n\nfunction getTextContent(node) {\n if (labelledNodeNames.includes(node.nodeName.toLowerCase())) {\n return '';\n }\n\n if (node.nodeType === TEXT_NODE) return node.textContent;\n return Array.from(node.childNodes).map(function (childNode) {\n return getTextContent(childNode);\n }).join('');\n}\n\nfunction getLabelContent(element) {\n var textContent;\n\n if (element.tagName.toLowerCase() === 'label') {\n textContent = getTextContent(element);\n } else {\n textContent = element.value || element.textContent;\n }\n\n return textContent;\n} // Based on https://github.com/eps1lon/dom-accessibility-api/pull/352\n\n\nfunction getRealLabels(element) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- types are not aware of older browsers that don't implement `labels`\n if (element.labels !== undefined) {\n var _labels;\n\n return (_labels = element.labels) != null ? _labels : [];\n }\n\n if (!isLabelable(element)) return [];\n var labels = element.ownerDocument.querySelectorAll('label');\n return Array.from(labels).filter(function (label) {\n return label.control === element;\n });\n}\n\nfunction isLabelable(element) {\n return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === 'INPUT' && element.getAttribute('type') !== 'hidden';\n}\n\nfunction getLabels(container, element, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$selector = _ref.selector,\n selector = _ref$selector === void 0 ? '*' : _ref$selector;\n\n var ariaLabelledBy = element.getAttribute('aria-labelledby');\n var labelsId = ariaLabelledBy ? ariaLabelledBy.split(' ') : [];\n return labelsId.length ? labelsId.map(function (labelId) {\n var labellingElement = container.querySelector(\"[id=\\\"\" + labelId + \"\\\"]\");\n return labellingElement ? {\n content: getLabelContent(labellingElement),\n formControl: null\n } : {\n content: '',\n formControl: null\n };\n }) : Array.from(getRealLabels(element)).map(function (label) {\n var textToMatch = getLabelContent(label);\n var formControlSelector = 'button, input, meter, output, progress, select, textarea';\n var labelledFormControl = Array.from(label.querySelectorAll(formControlSelector)).filter(function (formControlElement) {\n return formControlElement.matches(selector);\n })[0];\n return {\n content: textToMatch,\n formControl: labelledFormControl\n };\n });\n}\n\nfunction assertNotNullOrUndefined(matcher) {\n if (matcher === null || matcher === undefined) {\n throw new Error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string`\n \"It looks like \" + matcher + \" was passed instead of a matcher. Did you do something like getByText(\" + matcher + \")?\");\n }\n}\n\nfunction fuzzyMatches(textToMatch, node, matcher, normalizer) {\n if (typeof textToMatch !== 'string') {\n return false;\n }\n\n assertNotNullOrUndefined(matcher);\n var normalizedText = normalizer(textToMatch);\n\n if (typeof matcher === 'string' || typeof matcher === 'number') {\n return normalizedText.toLowerCase().includes(matcher.toString().toLowerCase());\n } else if (typeof matcher === 'function') {\n return matcher(normalizedText, node);\n } else {\n return matcher.test(normalizedText);\n }\n}\n\nfunction matches(textToMatch, node, matcher, normalizer) {\n if (typeof textToMatch !== 'string') {\n return false;\n }\n\n assertNotNullOrUndefined(matcher);\n var normalizedText = normalizer(textToMatch);\n\n if (matcher instanceof Function) {\n return matcher(normalizedText, node);\n } else if (matcher instanceof RegExp) {\n return matcher.test(normalizedText);\n } else {\n return normalizedText === String(matcher);\n }\n}\n\nfunction getDefaultNormalizer(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$trim = _ref.trim,\n trim = _ref$trim === void 0 ? true : _ref$trim,\n _ref$collapseWhitespa = _ref.collapseWhitespace,\n collapseWhitespace = _ref$collapseWhitespa === void 0 ? true : _ref$collapseWhitespa;\n\n return function (text) {\n var normalizedText = text;\n normalizedText = trim ? normalizedText.trim() : normalizedText;\n normalizedText = collapseWhitespace ? normalizedText.replace(/\\s+/g, ' ') : normalizedText;\n return normalizedText;\n };\n}\n/**\n * Constructs a normalizer to pass to functions in matches.js\n * @param {boolean|undefined} trim The user-specified value for `trim`, without\n * any defaulting having been applied\n * @param {boolean|undefined} collapseWhitespace The user-specified value for\n * `collapseWhitespace`, without any defaulting having been applied\n * @param {Function|undefined} normalizer The user-specified normalizer\n * @returns {Function} A normalizer\n */\n\n\nfunction makeNormalizer(_ref2) {\n var trim = _ref2.trim,\n collapseWhitespace = _ref2.collapseWhitespace,\n normalizer = _ref2.normalizer;\n\n if (normalizer) {\n // User has specified a custom normalizer\n if (typeof trim !== 'undefined' || typeof collapseWhitespace !== 'undefined') {\n // They've also specified a value for trim or collapseWhitespace\n throw new Error('trim and collapseWhitespace are not supported with a normalizer. ' + 'If you want to use the default trim and collapseWhitespace logic in your normalizer, ' + 'use \"getDefaultNormalizer({trim, collapseWhitespace})\" and compose that into your normalizer');\n }\n\n return normalizer;\n } else {\n // No custom normalizer specified. Just use default.\n return getDefaultNormalizer({\n trim: trim,\n collapseWhitespace: collapseWhitespace\n });\n }\n}\n\nfunction getNodeText(node) {\n if (node.matches('input[type=submit], input[type=button]')) {\n return node.value;\n }\n\n return Array.from(node.childNodes).filter(function (child) {\n return child.nodeType === TEXT_NODE && Boolean(child.textContent);\n }).map(function (c) {\n return c.textContent;\n }).join('');\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nvar elementRoleList = buildElementRoleList(elementRoles);\n/**\n * @param {Element} element -\n * @returns {boolean} - `true` if `element` and its subtree are inaccessible\n */\n\nfunction isSubtreeInaccessible(element) {\n if (element.hidden === true) {\n return true;\n }\n\n if (element.getAttribute('aria-hidden') === 'true') {\n return true;\n }\n\n var window = element.ownerDocument.defaultView;\n\n if (window.getComputedStyle(element).display === 'none') {\n return true;\n }\n\n return false;\n}\n/**\n * Partial implementation https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion\n * which should only be used for elements with a non-presentational role i.e.\n * `role=\"none\"` and `role=\"presentation\"` will not be excluded.\n *\n * Implements aria-hidden semantics (i.e. parent overrides child)\n * Ignores \"Child Presentational: True\" characteristics\n *\n * @param {Element} element -\n * @param {object} [options] -\n * @param {function (element: Element): boolean} options.isSubtreeInaccessible -\n * can be used to return cached results from previous isSubtreeInaccessible calls\n * @returns {boolean} true if excluded, otherwise false\n */\n\n\nfunction isInaccessible(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$isSubtreeIna = _options.isSubtreeInaccessible,\n isSubtreeInaccessibleImpl = _options$isSubtreeIna === void 0 ? isSubtreeInaccessible : _options$isSubtreeIna;\n var window = element.ownerDocument.defaultView; // since visibility is inherited we can exit early\n\n if (window.getComputedStyle(element).visibility === 'hidden') {\n return true;\n }\n\n var currentElement = element;\n\n while (currentElement) {\n if (isSubtreeInaccessibleImpl(currentElement)) {\n return true;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return false;\n}\n\nfunction getImplicitAriaRoles(currentNode) {\n // eslint bug here:\n // eslint-disable-next-line no-unused-vars\n for (var _iterator = _createForOfIteratorHelperLoose(elementRoleList), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n match = _step$value.match,\n roles = _step$value.roles;\n\n if (match(currentNode)) {\n return [].concat(roles);\n }\n }\n\n return [];\n}\n\nfunction buildElementRoleList(elementRolesMap) {\n function makeElementSelector(_ref) {\n var name = _ref.name,\n attributes = _ref.attributes;\n return \"\" + name + attributes.map(function (_ref2) {\n var attributeName = _ref2.name,\n value = _ref2.value,\n _ref2$constraints = _ref2.constraints,\n constraints = _ref2$constraints === void 0 ? [] : _ref2$constraints;\n var shouldNotExist = constraints.indexOf('undefined') !== -1;\n\n if (shouldNotExist) {\n return \":not([\" + attributeName + \"])\";\n } else if (value) {\n return \"[\" + attributeName + \"=\\\"\" + value + \"\\\"]\";\n } else {\n return \"[\" + attributeName + \"]\";\n }\n }).join('');\n }\n\n function getSelectorSpecificity(_ref3) {\n var _ref3$attributes = _ref3.attributes,\n attributes = _ref3$attributes === void 0 ? [] : _ref3$attributes;\n return attributes.length;\n }\n\n function bySelectorSpecificity(_ref4, _ref5) {\n var leftSpecificity = _ref4.specificity;\n var rightSpecificity = _ref5.specificity;\n return rightSpecificity - leftSpecificity;\n }\n\n function match(element) {\n return function (node) {\n var _element$attributes = element.attributes,\n attributes = _element$attributes === void 0 ? [] : _element$attributes; // https://github.com/testing-library/dom-testing-library/issues/814\n\n var typeTextIndex = attributes.findIndex(function (attribute) {\n return attribute.value && attribute.name === 'type' && attribute.value === 'text';\n });\n\n if (typeTextIndex >= 0) {\n // not using splice to not mutate the attributes array\n attributes = [].concat(attributes.slice(0, typeTextIndex), attributes.slice(typeTextIndex + 1));\n\n if (node.type !== 'text') {\n return false;\n }\n }\n\n return node.matches(makeElementSelector(_extends({}, element, {\n attributes: attributes\n })));\n };\n }\n\n var result = []; // eslint bug here:\n // eslint-disable-next-line no-unused-vars\n\n for (var _iterator2 = _createForOfIteratorHelperLoose(elementRolesMap.entries()), _step2; !(_step2 = _iterator2()).done;) {\n var _step2$value = _step2.value,\n element = _step2$value[0],\n roles = _step2$value[1];\n result = [].concat(result, [{\n match: match(element),\n roles: Array.from(roles),\n specificity: getSelectorSpecificity(element)\n }]);\n }\n\n return result.sort(bySelectorSpecificity);\n}\n\nfunction getRoles(container, _temp) {\n var _ref6 = _temp === void 0 ? {} : _temp,\n _ref6$hidden = _ref6.hidden,\n hidden = _ref6$hidden === void 0 ? false : _ref6$hidden;\n\n function flattenDOM(node) {\n return [node].concat(Array.from(node.children).reduce(function (acc, child) {\n return [].concat(acc, flattenDOM(child));\n }, []));\n }\n\n return flattenDOM(container).filter(function (element) {\n return hidden === false ? isInaccessible(element) === false : true;\n }).reduce(function (acc, node) {\n var roles = []; // TODO: This violates html-aria which does not allow any role on every element\n\n if (node.hasAttribute('role')) {\n roles = node.getAttribute('role').split(' ').slice(0, 1);\n } else {\n roles = getImplicitAriaRoles(node);\n }\n\n return roles.reduce(function (rolesAcc, role) {\n var _extends2, _extends3;\n\n return Array.isArray(rolesAcc[role]) ? _extends({}, rolesAcc, (_extends2 = {}, _extends2[role] = [].concat(rolesAcc[role], [node]), _extends2)) : _extends({}, rolesAcc, (_extends3 = {}, _extends3[role] = [node], _extends3));\n }, acc);\n }, {});\n}\n\nfunction prettyRoles(dom, _ref7) {\n var hidden = _ref7.hidden;\n var roles = getRoles(dom, {\n hidden: hidden\n }); // We prefer to skip generic role, we don't recommend it\n\n return Object.entries(roles).filter(function (_ref8) {\n var role = _ref8[0];\n return role !== 'generic';\n }).map(function (_ref9) {\n var role = _ref9[0],\n elements = _ref9[1];\n var delimiterBar = '-'.repeat(50);\n var elementsString = elements.map(function (el) {\n var nameString = \"Name \\\"\" + computeAccessibleName(el, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n }) + \"\\\":\\n\";\n var domString = prettyDOM(el.cloneNode(false));\n return \"\" + nameString + domString;\n }).join('\\n\\n');\n return role + \":\\n\\n\" + elementsString + \"\\n\\n\" + delimiterBar;\n }).join('\\n');\n}\n\nvar logRoles = function logRoles(dom, _temp2) {\n var _ref10 = _temp2 === void 0 ? {} : _temp2,\n _ref10$hidden = _ref10.hidden,\n hidden = _ref10$hidden === void 0 ? false : _ref10$hidden;\n\n return console.log(prettyRoles(dom, {\n hidden: hidden\n }));\n};\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)selected, undefined if not selectable\n */\n\n\nfunction computeAriaSelected(element) {\n // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings\n // https://www.w3.org/TR/html-aam-1.0/#details-id-97\n if (element.tagName === 'OPTION') {\n return element.selected;\n } // explicit value\n\n\n return checkBooleanAttribute(element, 'aria-selected');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)checked, undefined if not checked-able\n */\n\n\nfunction computeAriaChecked(element) {\n // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings\n // https://www.w3.org/TR/html-aam-1.0/#details-id-56\n // https://www.w3.org/TR/html-aam-1.0/#details-id-67\n if ('indeterminate' in element && element.indeterminate) {\n return undefined;\n }\n\n if ('checked' in element) {\n return element.checked;\n } // explicit value\n\n\n return checkBooleanAttribute(element, 'aria-checked');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)pressed, undefined if not press-able\n */\n\n\nfunction computeAriaPressed(element) {\n // https://www.w3.org/TR/wai-aria-1.1/#aria-pressed\n return checkBooleanAttribute(element, 'aria-pressed');\n}\n/**\n * @param {Element} element -\n * @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able\n */\n\n\nfunction computeAriaExpanded(element) {\n // https://www.w3.org/TR/wai-aria-1.1/#aria-expanded\n return checkBooleanAttribute(element, 'aria-expanded');\n}\n\nfunction checkBooleanAttribute(element, attribute) {\n var attributeValue = element.getAttribute(attribute);\n\n if (attributeValue === 'true') {\n return true;\n }\n\n if (attributeValue === 'false') {\n return false;\n }\n\n return undefined;\n}\n/**\n * @param {Element} element -\n * @returns {number | undefined} - number if implicit heading or aria-level present, otherwise undefined\n */\n\n\nfunction computeHeadingLevel(element) {\n // https://w3c.github.io/html-aam/#el-h1-h6\n // https://w3c.github.io/html-aam/#el-h1-h6\n var implicitHeadingLevels = {\n H1: 1,\n H2: 2,\n H3: 3,\n H4: 4,\n H5: 5,\n H6: 6\n }; // explicit aria-level value\n // https://www.w3.org/TR/wai-aria-1.2/#aria-level\n\n var ariaLevelAttribute = element.getAttribute('aria-level') && Number(element.getAttribute('aria-level'));\n return ariaLevelAttribute || implicitHeadingLevels[element.tagName];\n}\n\nvar normalize = getDefaultNormalizer();\n\nfunction escapeRegExp(string) {\n return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nfunction getRegExpMatcher(string) {\n return new RegExp(escapeRegExp(string.toLowerCase()), 'i');\n}\n\nfunction makeSuggestion(queryName, element, content, _ref) {\n var variant = _ref.variant,\n name = _ref.name;\n var warning = '';\n var queryOptions = {};\n var queryArgs = [['Role', 'TestId'].includes(queryName) ? content : getRegExpMatcher(content)];\n\n if (name) {\n queryOptions.name = getRegExpMatcher(name);\n }\n\n if (queryName === 'Role' && isInaccessible(element)) {\n queryOptions.hidden = true;\n warning = \"Element is inaccessible. This means that the element and all its children are invisible to screen readers.\\n If you are using the aria-hidden prop, make sure this is the right choice for your case.\\n \";\n }\n\n if (Object.keys(queryOptions).length > 0) {\n queryArgs.push(queryOptions);\n }\n\n var queryMethod = variant + \"By\" + queryName;\n return {\n queryName: queryName,\n queryMethod: queryMethod,\n queryArgs: queryArgs,\n variant: variant,\n warning: warning,\n toString: function toString() {\n if (warning) {\n console.warn(warning);\n }\n\n var text = queryArgs[0],\n options = queryArgs[1];\n text = typeof text === 'string' ? \"'\" + text + \"'\" : text;\n options = options ? \", { \" + Object.entries(options).map(function (_ref2) {\n var k = _ref2[0],\n v = _ref2[1];\n return k + \": \" + v;\n }).join(', ') + \" }\" : '';\n return queryMethod + \"(\" + text + options + \")\";\n }\n };\n}\n\nfunction canSuggest(currentMethod, requestedMethod, data) {\n return data && (!requestedMethod || requestedMethod.toLowerCase() === currentMethod.toLowerCase());\n}\n\nfunction getSuggestedQuery(element, variant, method) {\n var _element$getAttribute, _getImplicitAriaRoles;\n\n if (variant === void 0) {\n variant = 'get';\n }\n\n // don't create suggestions for script and style elements\n if (element.matches(DEFAULT_IGNORE_TAGS)) {\n return undefined;\n } //We prefer to suggest something else if the role is generic\n\n\n var role = (_element$getAttribute = element.getAttribute('role')) != null ? _element$getAttribute : (_getImplicitAriaRoles = getImplicitAriaRoles(element)) == null ? void 0 : _getImplicitAriaRoles[0];\n\n if (role !== 'generic' && canSuggest('Role', method, role)) {\n return makeSuggestion('Role', element, role, {\n variant: variant,\n name: computeAccessibleName(element, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n })\n });\n }\n\n var labelText = getLabels(document, element).map(function (label) {\n return label.content;\n }).join(' ');\n\n if (canSuggest('LabelText', method, labelText)) {\n return makeSuggestion('LabelText', element, labelText, {\n variant: variant\n });\n }\n\n var placeholderText = element.getAttribute('placeholder');\n\n if (canSuggest('PlaceholderText', method, placeholderText)) {\n return makeSuggestion('PlaceholderText', element, placeholderText, {\n variant: variant\n });\n }\n\n var textContent = normalize(getNodeText(element));\n\n if (canSuggest('Text', method, textContent)) {\n return makeSuggestion('Text', element, textContent, {\n variant: variant\n });\n }\n\n if (canSuggest('DisplayValue', method, element.value)) {\n return makeSuggestion('DisplayValue', element, normalize(element.value), {\n variant: variant\n });\n }\n\n var alt = element.getAttribute('alt');\n\n if (canSuggest('AltText', method, alt)) {\n return makeSuggestion('AltText', element, alt, {\n variant: variant\n });\n }\n\n var title = element.getAttribute('title');\n\n if (canSuggest('Title', method, title)) {\n return makeSuggestion('Title', element, title, {\n variant: variant\n });\n }\n\n var testId = element.getAttribute(getConfig().testIdAttribute);\n\n if (canSuggest('TestId', method, testId)) {\n return makeSuggestion('TestId', element, testId, {\n variant: variant\n });\n }\n\n return undefined;\n}\n\n// closer to their code (because async stack traces are hard to follow).\n\nfunction copyStackTrace(target, source) {\n target.stack = source.stack.replace(source.message, target.message);\n}\n\nfunction waitFor(callback, _ref) {\n var _ref$container = _ref.container,\n container = _ref$container === void 0 ? getDocument() : _ref$container,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? getConfig().asyncUtilTimeout : _ref$timeout,\n _ref$showOriginalStac = _ref.showOriginalStackTrace,\n showOriginalStackTrace = _ref$showOriginalStac === void 0 ? getConfig().showOriginalStackTrace : _ref$showOriginalStac,\n stackTraceError = _ref.stackTraceError,\n _ref$interval = _ref.interval,\n interval = _ref$interval === void 0 ? 50 : _ref$interval,\n _ref$onTimeout = _ref.onTimeout,\n onTimeout = _ref$onTimeout === void 0 ? function (error) {\n error.message = getConfig().getElementError(error.message, container).message;\n return error;\n } : _ref$onTimeout,\n _ref$mutationObserver = _ref.mutationObserverOptions,\n mutationObserverOptions = _ref$mutationObserver === void 0 ? {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true\n } : _ref$mutationObserver;\n\n if (typeof callback !== 'function') {\n throw new TypeError('Received `callback` arg must be a function');\n }\n\n return new Promise( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) {\n var lastError, intervalId, observer, finished, promiseStatus, overallTimeoutTimer, usingJestFakeTimers, error, _getWindowFromNode, MutationObserver, onDone, checkRealTimersCallback, checkCallback, handleTimeout;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n handleTimeout = function _handleTimeout() {\n var error;\n\n if (lastError) {\n error = lastError;\n\n if (!showOriginalStackTrace && error.name === 'TestingLibraryElementError') {\n copyStackTrace(error, stackTraceError);\n }\n } else {\n error = new Error('Timed out in waitFor.');\n\n if (!showOriginalStackTrace) {\n copyStackTrace(error, stackTraceError);\n }\n }\n\n onDone(onTimeout(error), null);\n };\n\n checkCallback = function _checkCallback() {\n if (promiseStatus === 'pending') return;\n\n try {\n var result = runWithExpensiveErrorDiagnosticsDisabled(callback);\n\n if (typeof (result == null ? void 0 : result.then) === 'function') {\n promiseStatus = 'pending';\n result.then(function (resolvedValue) {\n promiseStatus = 'resolved';\n onDone(null, resolvedValue);\n }, function (rejectedValue) {\n promiseStatus = 'rejected';\n lastError = rejectedValue;\n });\n } else {\n onDone(null, result);\n } // If `callback` throws, wait for the next mutation, interval, or timeout.\n\n } catch (error) {\n // Save the most recent callback error to reject the promise with it in the event of a timeout\n lastError = error;\n }\n };\n\n checkRealTimersCallback = function _checkRealTimersCallb() {\n if (jestFakeTimersAreEnabled()) {\n var _error = new Error(\"Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830\");\n\n if (!showOriginalStackTrace) copyStackTrace(_error, stackTraceError);\n return reject(_error);\n } else {\n return checkCallback();\n }\n };\n\n onDone = function _onDone(error, result) {\n finished = true;\n clearTimeoutFn(overallTimeoutTimer);\n\n if (!usingJestFakeTimers) {\n clearInterval(intervalId);\n observer.disconnect();\n }\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n };\n\n finished = false;\n promiseStatus = 'idle';\n overallTimeoutTimer = setTimeoutFn(handleTimeout, timeout);\n usingJestFakeTimers = jestFakeTimersAreEnabled();\n\n if (!usingJestFakeTimers) {\n _context.next = 24;\n break;\n }\n\n checkCallback(); // this is a dangerous rule to disable because it could lead to an\n // infinite loop. However, eslint isn't smart enough to know that we're\n // setting finished inside `onDone` which will be called when we're done\n // waiting or when we've timed out.\n // eslint-disable-next-line no-unmodified-loop-condition\n\n case 10:\n if (finished) {\n _context.next = 22;\n break;\n }\n\n if (jestFakeTimersAreEnabled()) {\n _context.next = 16;\n break;\n }\n\n error = new Error(\"Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830\");\n if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);\n reject(error);\n return _context.abrupt(\"return\");\n\n case 16:\n // we *could* (maybe should?) use `advanceTimersToNextTimer` but it's\n // possible that could make this loop go on forever if someone is using\n // third party code that's setting up recursive timers so rapidly that\n // the user's timer's don't get a chance to resolve. So we'll advance\n // by an interval instead. (We have a test for this case).\n jest.advanceTimersByTime(interval); // It's really important that checkCallback is run *before* we flush\n // in-flight promises. To be honest, I'm not sure why, and I can't quite\n // think of a way to reproduce the problem in a test, but I spent\n // an entire day banging my head against a wall on this.\n\n checkCallback(); // In this rare case, we *need* to wait for in-flight promises\n // to resolve before continuing. We don't need to take advantage\n // of parallelization so we're fine.\n // https://stackoverflow.com/a/59243586/971592\n // eslint-disable-next-line no-await-in-loop\n\n _context.next = 20;\n return new Promise(function (r) {\n return setImmediateFn(r);\n });\n\n case 20:\n _context.next = 10;\n break;\n\n case 22:\n _context.next = 37;\n break;\n\n case 24:\n _context.prev = 24;\n checkContainerType(container);\n _context.next = 32;\n break;\n\n case 28:\n _context.prev = 28;\n _context.t0 = _context[\"catch\"](24);\n reject(_context.t0);\n return _context.abrupt(\"return\");\n\n case 32:\n intervalId = setInterval(checkRealTimersCallback, interval);\n _getWindowFromNode = getWindowFromNode(container), MutationObserver = _getWindowFromNode.MutationObserver;\n observer = new MutationObserver(checkRealTimersCallback);\n observer.observe(container, mutationObserverOptions);\n checkCallback();\n\n case 37:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[24, 28]]);\n }));\n\n return function (_x, _x2) {\n return _ref2.apply(this, arguments);\n };\n }());\n}\n\nfunction waitForWrapper(callback, options) {\n // create the error here so its stack trace is as close to the\n // calling code as possible\n var stackTraceError = new Error('STACK_TRACE_MESSAGE');\n return getConfig().asyncWrapper(function () {\n return waitFor(callback, _extends({\n stackTraceError: stackTraceError\n }, options));\n });\n}\n\nvar hasWarned$2 = false; // deprecated... TODO: remove this method. We renamed this to `waitFor` so the\n// code people write reads more clearly.\n\nfunction wait() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // istanbul ignore next\n var _args$ = args[0],\n first = _args$ === void 0 ? function () {} : _args$,\n rest = args.slice(1);\n\n if (!hasWarned$2) {\n hasWarned$2 = true;\n console.warn(\"`wait` has been deprecated and replaced by `waitFor` instead. In most cases you should be able to find/replace `wait` with `waitFor`. Learn more: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.\");\n }\n\n return waitForWrapper.apply(void 0, [first].concat(rest));\n}\n/*\neslint\n max-lines-per-function: [\"error\", {\"max\": 200}],\n*/\n\nfunction getElementError(message, container) {\n return getConfig().getElementError(message, container);\n}\n\nfunction getMultipleElementsFoundError(message, container) {\n return getElementError(message + \"\\n\\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).\", container);\n}\n\nfunction queryAllByAttribute(attribute, container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll(\"[\" + attribute + \"]\")).filter(function (node) {\n return matcher(node.getAttribute(attribute), node, text, matchNormalizer);\n });\n}\n\nfunction queryByAttribute(attribute, container, text) {\n for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n args[_key - 3] = arguments[_key];\n }\n\n var els = queryAllByAttribute.apply(void 0, [attribute, container, text].concat(args));\n\n if (els.length > 1) {\n throw getMultipleElementsFoundError(\"Found multiple elements by [\" + attribute + \"=\" + text + \"]\", container);\n }\n\n return els[0] || null;\n} // this accepts a query function and returns a function which throws an error\n// if more than one elements is returned, otherwise it returns the first\n// element or null\n\n\nfunction makeSingleQuery(allQuery, getMultipleError) {\n return function (container) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n var els = allQuery.apply(void 0, [container].concat(args));\n\n if (els.length > 1) {\n var elementStrings = els.map(function (element) {\n return getElementError(null, element).message;\n }).join('\\n\\n');\n throw getMultipleElementsFoundError(getMultipleError.apply(void 0, [container].concat(args)) + \"\\n\\nHere are the matching elements:\\n\\n\" + elementStrings, container);\n }\n\n return els[0] || null;\n };\n}\n\nfunction getSuggestionError(suggestion, container) {\n return getConfig().getElementError(\"A better query is available, try this:\\n\" + suggestion.toString() + \"\\n\", container);\n} // this accepts a query function and returns a function which throws an error\n// if an empty list of elements is returned\n\n\nfunction makeGetAllQuery(allQuery, getMissingError) {\n return function (container) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n var els = allQuery.apply(void 0, [container].concat(args));\n\n if (!els.length) {\n throw getConfig().getElementError(getMissingError.apply(void 0, [container].concat(args)), container);\n }\n\n return els;\n };\n} // this accepts a getter query function and returns a function which calls\n// waitFor and passing a function which invokes the getter.\n\n\nfunction makeFindQuery(getter) {\n return function (container, text, options, waitForOptions) {\n return waitForWrapper(function () {\n return getter(container, text, options);\n }, _extends({\n container: container\n }, waitForOptions));\n };\n}\n\nvar wrapSingleQueryWithSuggestion = function wrapSingleQueryWithSuggestion(query, queryAllByName, variant) {\n return function (container) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n var element = query.apply(void 0, [container].concat(args));\n\n var _args$slice = args.slice(-1),\n _args$slice$ = _args$slice[0];\n\n _args$slice$ = _args$slice$ === void 0 ? {} : _args$slice$;\n var _args$slice$$suggest = _args$slice$.suggest,\n suggest = _args$slice$$suggest === void 0 ? getConfig().throwSuggestions : _args$slice$$suggest;\n\n if (element && suggest) {\n var suggestion = getSuggestedQuery(element, variant);\n\n if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) {\n throw getSuggestionError(suggestion.toString(), container);\n }\n }\n\n return element;\n };\n};\n\nvar wrapAllByQueryWithSuggestion = function wrapAllByQueryWithSuggestion(query, queryAllByName, variant) {\n return function (container) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n\n var els = query.apply(void 0, [container].concat(args));\n\n var _args$slice2 = args.slice(-1),\n _args$slice2$ = _args$slice2[0];\n\n _args$slice2$ = _args$slice2$ === void 0 ? {} : _args$slice2$;\n var _args$slice2$$suggest = _args$slice2$.suggest,\n suggest = _args$slice2$$suggest === void 0 ? getConfig().throwSuggestions : _args$slice2$$suggest;\n\n if (els.length && suggest) {\n // get a unique list of all suggestion messages. We are only going to make a suggestion if\n // all the suggestions are the same\n var uniqueSuggestionMessages = [].concat(new Set(els.map(function (element) {\n var _getSuggestedQuery;\n\n return (_getSuggestedQuery = getSuggestedQuery(element, variant)) == null ? void 0 : _getSuggestedQuery.toString();\n })));\n\n if ( // only want to suggest if all the els have the same suggestion.\n uniqueSuggestionMessages.length === 1 && !queryAllByName.endsWith(getSuggestedQuery(els[0], variant).queryName)) {\n throw getSuggestionError(uniqueSuggestionMessages[0], container);\n }\n }\n\n return els;\n };\n};\n\nfunction buildQueries(queryAllBy, getMultipleError, getMissingError) {\n var queryBy = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllBy, getMultipleError), queryAllBy.name, 'query');\n var getAllBy = makeGetAllQuery(queryAllBy, getMissingError);\n var getBy = makeSingleQuery(getAllBy, getMultipleError);\n var getByWithSuggestions = wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'get');\n var getAllWithSuggestions = wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name.replace('query', 'get'), 'getAll');\n var findAllBy = makeFindQuery(wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name, 'findAll'));\n var findBy = makeFindQuery(wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'find'));\n return [queryBy, getAllWithSuggestions, getByWithSuggestions, findAllBy, findBy];\n}\n\nvar queryHelpers = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getElementError: getElementError,\n wrapAllByQueryWithSuggestion: wrapAllByQueryWithSuggestion,\n wrapSingleQueryWithSuggestion: wrapSingleQueryWithSuggestion,\n getMultipleElementsFoundError: getMultipleElementsFoundError,\n queryAllByAttribute: queryAllByAttribute,\n queryByAttribute: queryByAttribute,\n makeSingleQuery: makeSingleQuery,\n makeGetAllQuery: makeGetAllQuery,\n makeFindQuery: makeFindQuery,\n buildQueries: buildQueries\n});\n\nfunction queryAllLabels(container) {\n return Array.from(container.querySelectorAll('label,input')).map(function (node) {\n return {\n node: node,\n textToMatch: getLabelContent(node)\n };\n }).filter(function (_ref) {\n var textToMatch = _ref.textToMatch;\n return textToMatch !== null;\n });\n}\n\nvar queryAllLabelsByText = function queryAllLabelsByText(container, text, _temp) {\n var _ref2 = _temp === void 0 ? {} : _temp,\n _ref2$exact = _ref2.exact,\n exact = _ref2$exact === void 0 ? true : _ref2$exact,\n trim = _ref2.trim,\n collapseWhitespace = _ref2.collapseWhitespace,\n normalizer = _ref2.normalizer;\n\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var textToMatchByLabels = queryAllLabels(container);\n return textToMatchByLabels.filter(function (_ref3) {\n var node = _ref3.node,\n textToMatch = _ref3.textToMatch;\n return matcher(textToMatch, node, text, matchNormalizer);\n }).map(function (_ref4) {\n var node = _ref4.node;\n return node;\n });\n};\n\nvar queryAllByLabelText = function queryAllByLabelText(container, text, _temp2) {\n var _ref5 = _temp2 === void 0 ? {} : _temp2,\n _ref5$selector = _ref5.selector,\n selector = _ref5$selector === void 0 ? '*' : _ref5$selector,\n _ref5$exact = _ref5.exact,\n exact = _ref5$exact === void 0 ? true : _ref5$exact,\n collapseWhitespace = _ref5.collapseWhitespace,\n trim = _ref5.trim,\n normalizer = _ref5.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var matchingLabelledElements = Array.from(container.querySelectorAll('*')).filter(function (element) {\n return getRealLabels(element).length || element.hasAttribute('aria-labelledby');\n }).reduce(function (labelledElements, labelledElement) {\n var labelList = getLabels(container, labelledElement, {\n selector: selector\n });\n labelList.filter(function (label) {\n return Boolean(label.formControl);\n }).forEach(function (label) {\n if (matcher(label.content, label.formControl, text, matchNormalizer) && label.formControl) labelledElements.push(label.formControl);\n });\n var labelsValue = labelList.filter(function (label) {\n return Boolean(label.content);\n }).map(function (label) {\n return label.content;\n });\n if (matcher(labelsValue.join(' '), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n\n if (labelsValue.length > 1) {\n labelsValue.forEach(function (labelValue, index) {\n if (matcher(labelValue, labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n var labelsFiltered = [].concat(labelsValue);\n labelsFiltered.splice(index, 1);\n\n if (labelsFiltered.length > 1) {\n if (matcher(labelsFiltered.join(' '), labelledElement, text, matchNormalizer)) labelledElements.push(labelledElement);\n }\n });\n }\n\n return labelledElements;\n }, []).concat( // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n queryAllByAttribute('aria-label', container, text, {\n exact: exact,\n normalizer: matchNormalizer\n }));\n return Array.from(new Set(matchingLabelledElements)).filter(function (element) {\n return element.matches(selector);\n });\n}; // the getAll* query would normally look like this:\n// const getAllByLabelText = makeGetAllQuery(\n// queryAllByLabelText,\n// (c, text) => `Unable to find a label with the text of: ${text}`,\n// )\n// however, we can give a more helpful error message than the generic one,\n// so we're writing this one out by hand.\n\n\nvar getAllByLabelText = function getAllByLabelText(container, text) {\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n var els = queryAllByLabelText.apply(void 0, [container, text].concat(rest));\n\n if (!els.length) {\n var labels = queryAllLabelsByText.apply(void 0, [container, text].concat(rest));\n\n if (labels.length) {\n var tagNames = labels.map(function (label) {\n return getTagNameOfElementAssociatedWithLabelViaFor(container, label);\n }).filter(function (tagName) {\n return !!tagName;\n });\n\n if (tagNames.length) {\n throw getConfig().getElementError(tagNames.map(function (tagName) {\n return \"Found a label with the text of: \" + text + \", however the element associated with this label (<\" + tagName + \" />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <\" + tagName + \" />, you can use aria-label or aria-labelledby instead.\";\n }).join('\\n\\n'), container);\n } else {\n throw getConfig().getElementError(\"Found a label with the text of: \" + text + \", however no form control was found associated to that label. Make sure you're using the \\\"for\\\" attribute or \\\"aria-labelledby\\\" attribute correctly.\", container);\n }\n } else {\n throw getConfig().getElementError(\"Unable to find a label with the text of: \" + text, container);\n }\n }\n\n return els;\n};\n\nfunction getTagNameOfElementAssociatedWithLabelViaFor(container, label) {\n var htmlFor = label.getAttribute('for');\n\n if (!htmlFor) {\n return null;\n }\n\n var element = container.querySelector(\"[id=\\\"\" + htmlFor + \"\\\"]\");\n return element ? element.tagName.toLowerCase() : null;\n} // the reason mentioned above is the same reason we're not using buildQueries\n\n\nvar getMultipleError$7 = function getMultipleError(c, text) {\n return \"Found multiple elements with the text of: \" + text;\n};\n\nvar queryByLabelText = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText, getMultipleError$7), queryAllByLabelText.name, 'query');\nvar getByLabelText = makeSingleQuery(getAllByLabelText, getMultipleError$7);\nvar findAllByLabelText = makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'findAll'));\nvar findByLabelText = makeFindQuery(wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'find'));\nvar getAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'getAll');\nvar getByLabelTextWithSuggestions = wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'get');\nvar queryAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByLabelText, queryAllByLabelText.name, 'queryAll');\n\nvar queryAllByPlaceholderText = function queryAllByPlaceholderText() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n checkContainerType(args[0]); // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n\n return queryAllByAttribute.apply(void 0, ['placeholder'].concat(args));\n};\n\nvar getMultipleError$6 = function getMultipleError(c, text) {\n return \"Found multiple elements with the placeholder text of: \" + text;\n};\n\nvar getMissingError$6 = function getMissingError(c, text) {\n return \"Unable to find an element with the placeholder text of: \" + text;\n};\n\nvar queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll');\n\nvar _buildQueries$6 = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6),\n queryByPlaceholderText = _buildQueries$6[0],\n getAllByPlaceholderText = _buildQueries$6[1],\n getByPlaceholderText = _buildQueries$6[2],\n findAllByPlaceholderText = _buildQueries$6[3],\n findByPlaceholderText = _buildQueries$6[4];\n\nvar queryAllByText = function queryAllByText(container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$selector = _ref.selector,\n selector = _ref$selector === void 0 ? '*' : _ref$selector,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n _ref$ignore = _ref.ignore,\n ignore = _ref$ignore === void 0 ? DEFAULT_IGNORE_TAGS : _ref$ignore,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n var baseArray = [];\n\n if (typeof container.matches === 'function' && container.matches(selector)) {\n baseArray = [container];\n }\n\n return [].concat(baseArray, Array.from(container.querySelectorAll(selector))) // TODO: `matches` according lib.dom.d.ts can get only `string` but according our code it can handle also boolean :)\n .filter(function (node) {\n return !ignore || !node.matches(ignore);\n }).filter(function (node) {\n return matcher(getNodeText(node), node, text, matchNormalizer);\n });\n};\n\nvar getMultipleError$5 = function getMultipleError(c, text) {\n return \"Found multiple elements with the text: \" + text;\n};\n\nvar getMissingError$5 = function getMissingError(c, text) {\n return \"Unable to find an element with the text: \" + text + \". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.\";\n};\n\nvar queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, 'queryAll');\n\nvar _buildQueries$5 = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5),\n queryByText = _buildQueries$5[0],\n getAllByText = _buildQueries$5[1],\n getByText = _buildQueries$5[2],\n findAllByText = _buildQueries$5[3],\n findByText = _buildQueries$5[4];\n\nvar queryAllByDisplayValue = function queryAllByDisplayValue(container, value, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll(\"input,textarea,select\")).filter(function (node) {\n if (node.tagName === 'SELECT') {\n var selectedOptions = Array.from(node.options).filter(function (option) {\n return option.selected;\n });\n return selectedOptions.some(function (optionNode) {\n return matcher(getNodeText(optionNode), optionNode, value, matchNormalizer);\n });\n } else {\n return matcher(node.value, node, value, matchNormalizer);\n }\n });\n};\n\nvar getMultipleError$4 = function getMultipleError(c, value) {\n return \"Found multiple elements with the display value: \" + value + \".\";\n};\n\nvar getMissingError$4 = function getMissingError(c, value) {\n return \"Unable to find an element with the display value: \" + value + \".\";\n};\n\nvar queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll');\n\nvar _buildQueries$4 = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4),\n queryByDisplayValue = _buildQueries$4[0],\n getAllByDisplayValue = _buildQueries$4[1],\n getByDisplayValue = _buildQueries$4[2],\n findAllByDisplayValue = _buildQueries$4[3],\n findByDisplayValue = _buildQueries$4[4];\n\nvar queryAllByAltText = function queryAllByAltText(container, alt, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll('img,input,area')).filter(function (node) {\n return matcher(node.getAttribute('alt'), node, alt, matchNormalizer);\n });\n};\n\nvar getMultipleError$3 = function getMultipleError(c, alt) {\n return \"Found multiple elements with the alt text: \" + alt;\n};\n\nvar getMissingError$3 = function getMissingError(c, alt) {\n return \"Unable to find an element with the alt text: \" + alt;\n};\n\nvar queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, 'queryAll');\n\nvar _buildQueries$3 = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3),\n queryByAltText = _buildQueries$3[0],\n getAllByAltText = _buildQueries$3[1],\n getByAltText = _buildQueries$3[2],\n findAllByAltText = _buildQueries$3[3],\n findByAltText = _buildQueries$3[4];\n\nvar isSvgTitle = function isSvgTitle(node) {\n var _node$parentElement;\n\n return node.tagName.toLowerCase() === 'title' && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === 'svg';\n};\n\nvar queryAllByTitle = function queryAllByTitle(container, text, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n trim = _ref.trim,\n normalizer = _ref.normalizer;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n return Array.from(container.querySelectorAll('[title], svg > title')).filter(function (node) {\n return matcher(node.getAttribute('title'), node, text, matchNormalizer) || isSvgTitle(node) && matcher(getNodeText(node), node, text, matchNormalizer);\n });\n};\n\nvar getMultipleError$2 = function getMultipleError(c, title) {\n return \"Found multiple elements with the title: \" + title + \".\";\n};\n\nvar getMissingError$2 = function getMissingError(c, title) {\n return \"Unable to find an element with the title: \" + title + \".\";\n};\n\nvar queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, 'queryAll');\n\nvar _buildQueries$2 = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2),\n queryByTitle = _buildQueries$2[0],\n getAllByTitle = _buildQueries$2[1],\n getByTitle = _buildQueries$2[2],\n findAllByTitle = _buildQueries$2[3],\n findByTitle = _buildQueries$2[4];\n\nfunction queryAllByRole(container, role, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$exact = _ref.exact,\n exact = _ref$exact === void 0 ? true : _ref$exact,\n collapseWhitespace = _ref.collapseWhitespace,\n _ref$hidden = _ref.hidden,\n hidden = _ref$hidden === void 0 ? getConfig().defaultHidden : _ref$hidden,\n name = _ref.name,\n trim = _ref.trim,\n normalizer = _ref.normalizer,\n _ref$queryFallbacks = _ref.queryFallbacks,\n queryFallbacks = _ref$queryFallbacks === void 0 ? false : _ref$queryFallbacks,\n selected = _ref.selected,\n checked = _ref.checked,\n pressed = _ref.pressed,\n level = _ref.level,\n expanded = _ref.expanded;\n\n checkContainerType(container);\n var matcher = exact ? matches : fuzzyMatches;\n var matchNormalizer = makeNormalizer({\n collapseWhitespace: collapseWhitespace,\n trim: trim,\n normalizer: normalizer\n });\n\n if (selected !== undefined) {\n var _allRoles$get;\n\n // guard against unknown roles\n if (((_allRoles$get = roles.get(role)) == null ? void 0 : _allRoles$get.props['aria-selected']) === undefined) {\n throw new Error(\"\\\"aria-selected\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (checked !== undefined) {\n var _allRoles$get2;\n\n // guard against unknown roles\n if (((_allRoles$get2 = roles.get(role)) == null ? void 0 : _allRoles$get2.props['aria-checked']) === undefined) {\n throw new Error(\"\\\"aria-checked\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (pressed !== undefined) {\n var _allRoles$get3;\n\n // guard against unknown roles\n if (((_allRoles$get3 = roles.get(role)) == null ? void 0 : _allRoles$get3.props['aria-pressed']) === undefined) {\n throw new Error(\"\\\"aria-pressed\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n if (level !== undefined) {\n // guard against using `level` option with any role other than `heading`\n if (role !== 'heading') {\n throw new Error(\"Role \\\"\" + role + \"\\\" cannot have \\\"level\\\" property.\");\n }\n }\n\n if (expanded !== undefined) {\n var _allRoles$get4;\n\n // guard against unknown roles\n if (((_allRoles$get4 = roles.get(role)) == null ? void 0 : _allRoles$get4.props['aria-expanded']) === undefined) {\n throw new Error(\"\\\"aria-expanded\\\" is not supported on role \\\"\" + role + \"\\\".\");\n }\n }\n\n var subtreeIsInaccessibleCache = new WeakMap();\n\n function cachedIsSubtreeInaccessible(element) {\n if (!subtreeIsInaccessibleCache.has(element)) {\n subtreeIsInaccessibleCache.set(element, isSubtreeInaccessible(element));\n }\n\n return subtreeIsInaccessibleCache.get(element);\n }\n\n return Array.from(container.querySelectorAll('*')).filter(function (node) {\n var isRoleSpecifiedExplicitly = node.hasAttribute('role');\n\n if (isRoleSpecifiedExplicitly) {\n var roleValue = node.getAttribute('role');\n\n if (queryFallbacks) {\n return roleValue.split(' ').filter(Boolean).some(function (text) {\n return matcher(text, node, role, matchNormalizer);\n });\n } // if a custom normalizer is passed then let normalizer handle the role value\n\n\n if (normalizer) {\n return matcher(roleValue, node, role, matchNormalizer);\n } // other wise only send the first word to match\n\n\n var _roleValue$split = roleValue.split(' '),\n firstWord = _roleValue$split[0];\n\n return matcher(firstWord, node, role, matchNormalizer);\n }\n\n var implicitRoles = getImplicitAriaRoles(node);\n return implicitRoles.some(function (implicitRole) {\n return matcher(implicitRole, node, role, matchNormalizer);\n });\n }).filter(function (element) {\n if (selected !== undefined) {\n return selected === computeAriaSelected(element);\n }\n\n if (checked !== undefined) {\n return checked === computeAriaChecked(element);\n }\n\n if (pressed !== undefined) {\n return pressed === computeAriaPressed(element);\n }\n\n if (expanded !== undefined) {\n return expanded === computeAriaExpanded(element);\n }\n\n if (level !== undefined) {\n return level === computeHeadingLevel(element);\n } // don't care if aria attributes are unspecified\n\n\n return true;\n }).filter(function (element) {\n return hidden === false ? isInaccessible(element, {\n isSubtreeInaccessible: cachedIsSubtreeInaccessible\n }) === false : true;\n }).filter(function (element) {\n if (name === undefined) {\n // Don't care\n return true;\n }\n\n return matches(computeAccessibleName(element, {\n computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements\n }), element, name, function (text) {\n return text;\n });\n });\n}\n\nvar getMultipleError$1 = function getMultipleError(c, role, _temp2) {\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n name = _ref2.name;\n\n var nameHint = '';\n\n if (name === undefined) {\n nameHint = '';\n } else if (typeof name === 'string') {\n nameHint = \" and name \\\"\" + name + \"\\\"\";\n } else {\n nameHint = \" and name `\" + name + \"`\";\n }\n\n return \"Found multiple elements with the role \\\"\" + role + \"\\\"\" + nameHint;\n};\n\nvar getMissingError$1 = function getMissingError(container, role, _temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$hidden = _ref3.hidden,\n hidden = _ref3$hidden === void 0 ? getConfig().defaultHidden : _ref3$hidden,\n name = _ref3.name;\n\n if (getConfig()._disableExpensiveErrorDiagnostics) {\n return \"Unable to find role=\\\"\" + role + \"\\\"\";\n }\n\n var roles = '';\n Array.from(container.children).forEach(function (childElement) {\n roles += prettyRoles(childElement, {\n hidden: hidden,\n includeName: name !== undefined\n });\n });\n var roleMessage;\n\n if (roles.length === 0) {\n if (hidden === false) {\n roleMessage = 'There are no accessible roles. But there might be some inaccessible roles. ' + 'If you wish to access them, then set the `hidden` option to `true`. ' + 'Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole';\n } else {\n roleMessage = 'There are no available roles.';\n }\n } else {\n roleMessage = (\"\\nHere are the \" + (hidden === false ? 'accessible' : 'available') + \" roles:\\n\\n \" + roles.replace(/\\n/g, '\\n ').replace(/\\n\\s\\s\\n/g, '\\n\\n') + \"\\n\").trim();\n }\n\n var nameHint = '';\n\n if (name === undefined) {\n nameHint = '';\n } else if (typeof name === 'string') {\n nameHint = \" and name \\\"\" + name + \"\\\"\";\n } else {\n nameHint = \" and name `\" + name + \"`\";\n }\n\n return (\"\\nUnable to find an \" + (hidden === false ? 'accessible ' : '') + \"element with the role \\\"\" + role + \"\\\"\" + nameHint + \"\\n\\n\" + roleMessage).trim();\n};\n\nvar queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, 'queryAll');\n\nvar _buildQueries$1 = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1),\n queryByRole = _buildQueries$1[0],\n getAllByRole = _buildQueries$1[1],\n getByRole = _buildQueries$1[2],\n findAllByRole = _buildQueries$1[3],\n findByRole = _buildQueries$1[4];\n\nvar getTestIdAttribute = function getTestIdAttribute() {\n return getConfig().testIdAttribute;\n};\n\nvar queryAllByTestId = function queryAllByTestId() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n checkContainerType(args[0]); // TODO: Remove ignore after `queryAllByAttribute` will be moved to TS\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n\n return queryAllByAttribute.apply(void 0, [getTestIdAttribute()].concat(args));\n};\n\nvar getMultipleError = function getMultipleError(c, id) {\n return \"Found multiple elements by: [\" + getTestIdAttribute() + \"=\\\"\" + id + \"\\\"]\";\n};\n\nvar getMissingError = function getMissingError(c, id) {\n return \"Unable to find an element by: [\" + getTestIdAttribute() + \"=\\\"\" + id + \"\\\"]\";\n};\n\nvar queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, 'queryAll');\n\nvar _buildQueries = buildQueries(queryAllByTestId, getMultipleError, getMissingError),\n queryByTestId = _buildQueries[0],\n getAllByTestId = _buildQueries[1],\n getByTestId = _buildQueries[2],\n findAllByTestId = _buildQueries[3],\n findByTestId = _buildQueries[4];\n\nvar queries = /*#__PURE__*/Object.freeze({\n __proto__: null,\n queryAllByLabelText: queryAllByLabelTextWithSuggestions,\n queryByLabelText: queryByLabelText,\n getAllByLabelText: getAllByLabelTextWithSuggestions,\n getByLabelText: getByLabelTextWithSuggestions,\n findAllByLabelText: findAllByLabelText,\n findByLabelText: findByLabelText,\n queryByPlaceholderText: queryByPlaceholderText,\n queryAllByPlaceholderText: queryAllByPlaceholderTextWithSuggestions,\n getByPlaceholderText: getByPlaceholderText,\n getAllByPlaceholderText: getAllByPlaceholderText,\n findAllByPlaceholderText: findAllByPlaceholderText,\n findByPlaceholderText: findByPlaceholderText,\n queryByText: queryByText,\n queryAllByText: queryAllByTextWithSuggestions,\n getByText: getByText,\n getAllByText: getAllByText,\n findAllByText: findAllByText,\n findByText: findByText,\n queryByDisplayValue: queryByDisplayValue,\n queryAllByDisplayValue: queryAllByDisplayValueWithSuggestions,\n getByDisplayValue: getByDisplayValue,\n getAllByDisplayValue: getAllByDisplayValue,\n findAllByDisplayValue: findAllByDisplayValue,\n findByDisplayValue: findByDisplayValue,\n queryByAltText: queryByAltText,\n queryAllByAltText: queryAllByAltTextWithSuggestions,\n getByAltText: getByAltText,\n getAllByAltText: getAllByAltText,\n findAllByAltText: findAllByAltText,\n findByAltText: findByAltText,\n queryByTitle: queryByTitle,\n queryAllByTitle: queryAllByTitleWithSuggestions,\n getByTitle: getByTitle,\n getAllByTitle: getAllByTitle,\n findAllByTitle: findAllByTitle,\n findByTitle: findByTitle,\n queryByRole: queryByRole,\n queryAllByRole: queryAllByRoleWithSuggestions,\n getAllByRole: getAllByRole,\n getByRole: getByRole,\n findAllByRole: findAllByRole,\n findByRole: findByRole,\n queryByTestId: queryByTestId,\n queryAllByTestId: queryAllByTestIdWithSuggestions,\n getByTestId: getByTestId,\n getAllByTestId: getAllByTestId,\n findAllByTestId: findAllByTestId,\n findByTestId: findByTestId\n});\n\n/**\n * @typedef {{[key: string]: Function}} FuncMap\n */\n\n/**\n * @param {HTMLElement} element container\n * @param {FuncMap} queries object of functions\n * @param {Object} initialValue for reducer\n * @returns {FuncMap} returns object of functions bound to container\n */\n\nfunction getQueriesForElement(element, queries$1, initialValue) {\n if (queries$1 === void 0) {\n queries$1 = queries;\n }\n\n if (initialValue === void 0) {\n initialValue = {};\n }\n\n return Object.keys(queries$1).reduce(function (helpers, key) {\n var fn = queries$1[key];\n helpers[key] = fn.bind(null, element);\n return helpers;\n }, initialValue);\n}\n\nvar hasWarned$1 = false; // deprecated... TODO: remove this method. People should use a find* query or\n// wait instead the reasoning is that this doesn't really do anything useful\n// that you can't get from using find* or wait.\n\nfunction waitForElement(_x, _x2) {\n return _waitForElement.apply(this, arguments);\n}\n\nfunction _waitForElement() {\n _waitForElement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(callback, options) {\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!hasWarned$1) {\n hasWarned$1 = true;\n console.warn(\"`waitForElement` has been deprecated. Use a `find*` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor\");\n }\n\n if (callback) {\n _context.next = 3;\n break;\n }\n\n throw new Error('waitForElement requires a callback as the first parameter');\n\n case 3:\n return _context.abrupt(\"return\", waitForWrapper(function () {\n var result = callback();\n\n if (!result) {\n throw new Error('Timed out in waitForElement.');\n }\n\n return result;\n }, options));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _waitForElement.apply(this, arguments);\n}\n/*\neslint\n require-await: \"off\"\n*/\n\nvar isRemoved = function isRemoved(result) {\n return !result || Array.isArray(result) && !result.length;\n}; // Check if the element is not present.\n// As the name implies, waitForElementToBeRemoved should check `present` --> `removed`\n\n\nfunction initialCheck(elements) {\n if (isRemoved(elements)) {\n throw new Error('The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.');\n }\n}\n\nfunction waitForElementToBeRemoved(_x, _x2) {\n return _waitForElementToBeRemoved.apply(this, arguments);\n}\n\nfunction _waitForElementToBeRemoved() {\n _waitForElementToBeRemoved = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(callback, options) {\n var timeoutError, elements, getRemainingElements;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // created here so we get a nice stacktrace\n timeoutError = new Error('Timed out in waitForElementToBeRemoved.');\n\n if (typeof callback !== 'function') {\n initialCheck(callback);\n elements = Array.isArray(callback) ? callback : [callback];\n getRemainingElements = elements.map(function (element) {\n var parent = element.parentElement;\n if (parent === null) return function () {\n return null;\n };\n\n while (parent.parentElement) {\n parent = parent.parentElement;\n }\n\n return function () {\n return parent.contains(element) ? element : null;\n };\n });\n\n callback = function callback() {\n return getRemainingElements.map(function (c) {\n return c();\n }).filter(Boolean);\n };\n }\n\n initialCheck(callback());\n return _context.abrupt(\"return\", waitForWrapper(function () {\n var result;\n\n try {\n result = callback();\n } catch (error) {\n if (error.name === 'TestingLibraryElementError') {\n return undefined;\n }\n\n throw error;\n }\n\n if (!isRemoved(result)) {\n throw timeoutError;\n }\n\n return undefined;\n }, options));\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _waitForElementToBeRemoved.apply(this, arguments);\n}\n/*\neslint\n require-await: \"off\"\n*/\n\nvar hasWarned = false; // deprecated... TODO: remove this method. People should use wait instead\n// the reasoning is that waiting for just any DOM change is an implementation\n// detail. People should be waiting for a specific thing to change.\n\nfunction waitForDomChange(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$container = _ref.container,\n container = _ref$container === void 0 ? getDocument() : _ref$container,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? getConfig().asyncUtilTimeout : _ref$timeout,\n _ref$mutationObserver = _ref.mutationObserverOptions,\n mutationObserverOptions = _ref$mutationObserver === void 0 ? {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true\n } : _ref$mutationObserver;\n\n if (!hasWarned) {\n hasWarned = true;\n console.warn(\"`waitForDomChange` has been deprecated. Use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.\");\n }\n\n return new Promise(function (resolve, reject) {\n var timer = setTimeoutFn(onTimeout, timeout);\n\n var _getWindowFromNode = getWindowFromNode(container),\n MutationObserver = _getWindowFromNode.MutationObserver;\n\n var observer = new MutationObserver(onMutation);\n runWithRealTimers(function () {\n return observer.observe(container, mutationObserverOptions);\n });\n\n function onDone(error, result) {\n clearTimeoutFn(timer);\n setImmediateFn(function () {\n return observer.disconnect();\n });\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n }\n\n function onMutation(mutationsList) {\n onDone(null, mutationsList);\n }\n\n function onTimeout() {\n onDone(new Error('Timed out in waitForDomChange.'), null);\n }\n });\n}\n\nfunction waitForDomChangeWrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return getConfig().asyncWrapper(function () {\n return waitForDomChange.apply(void 0, args);\n });\n}\n\nvar eventMap = {\n // Clipboard Events\n copy: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n cut: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n paste: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Composition Events\n compositionEnd: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n compositionStart: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n compositionUpdate: {\n EventType: 'CompositionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Keyboard Events\n keyDown: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n keyPress: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n keyUp: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n charCode: 0,\n composed: true\n }\n },\n // Focus Events\n focus: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n blur: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n focusIn: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n focusOut: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n // Form Events\n change: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n input: {\n EventType: 'InputEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n invalid: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: true\n }\n },\n submit: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n reset: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n // Mouse Events\n click: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n button: 0,\n composed: true\n }\n },\n contextMenu: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dblClick: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n drag: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragEnd: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragEnter: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragExit: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragLeave: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n dragOver: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dragStart: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n drop: {\n EventType: 'DragEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseDown: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseEnter: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mouseLeave: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mouseMove: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseOut: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseOver: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseUp: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Selection Events\n select: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n // Touch Events\n touchCancel: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n touchEnd: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n touchMove: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n touchStart: {\n EventType: 'TouchEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // UI Events\n scroll: {\n EventType: 'UIEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Wheel Events\n wheel: {\n EventType: 'WheelEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n // Media Events\n abort: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n canPlay: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n canPlayThrough: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n durationChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n emptied: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n encrypted: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n ended: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadedData: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadedMetadata: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n loadStart: {\n EventType: 'ProgressEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n pause: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n play: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n playing: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n progress: {\n EventType: 'ProgressEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n rateChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n seeked: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n seeking: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n stalled: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n suspend: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n timeUpdate: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n volumeChange: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n waiting: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Image Events\n load: {\n EventType: 'UIEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n error: {\n EventType: 'Event',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n // Animation Events\n animationStart: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n animationEnd: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n animationIteration: {\n EventType: 'AnimationEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n // Transition Events\n transitionEnd: {\n EventType: 'TransitionEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n },\n // pointer events\n pointerOver: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerEnter: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n pointerDown: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerMove: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerUp: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerCancel: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n pointerOut: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerLeave: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n gotPointerCapture: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n lostPointerCapture: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n // history events\n popState: {\n EventType: 'PopStateEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n }\n};\nvar eventAliasMap = {\n doubleClick: 'dblClick'\n};\n\nvar _excluded = [\"value\", \"files\"],\n _excluded2 = [\"bubbles\", \"cancelable\", \"detail\"];\n\nfunction fireEvent(element, event) {\n return getConfig().eventWrapper(function () {\n if (!event) {\n throw new Error(\"Unable to fire an event - please provide an event object.\");\n }\n\n if (!element) {\n throw new Error(\"Unable to fire a \\\"\" + event.type + \"\\\" event - please provide a DOM element.\");\n }\n\n return element.dispatchEvent(event);\n });\n}\n\nfunction createEvent(eventName, node, init, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$EventType = _ref.EventType,\n EventType = _ref$EventType === void 0 ? 'Event' : _ref$EventType,\n _ref$defaultInit = _ref.defaultInit,\n defaultInit = _ref$defaultInit === void 0 ? {} : _ref$defaultInit;\n\n if (!node) {\n throw new Error(\"Unable to fire a \\\"\" + eventName + \"\\\" event - please provide a DOM element.\");\n }\n\n var eventInit = _extends({}, defaultInit, init);\n\n var _eventInit$target = eventInit.target;\n _eventInit$target = _eventInit$target === void 0 ? {} : _eventInit$target;\n\n var value = _eventInit$target.value,\n files = _eventInit$target.files,\n targetProperties = _objectWithoutPropertiesLoose(_eventInit$target, _excluded);\n\n if (value !== undefined) {\n setNativeValue(node, value);\n }\n\n if (files !== undefined) {\n // input.files is a read-only property so this is not allowed:\n // input.files = [file]\n // so we have to use this workaround to set the property\n Object.defineProperty(node, 'files', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: files\n });\n }\n\n Object.assign(node, targetProperties);\n var window = getWindowFromNode(node);\n var EventConstructor = window[EventType] || window.Event;\n var event;\n /* istanbul ignore else */\n\n if (typeof EventConstructor === 'function') {\n event = new EventConstructor(eventName, eventInit);\n } else {\n // IE11 polyfill from https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill\n event = window.document.createEvent(EventType);\n\n var bubbles = eventInit.bubbles,\n cancelable = eventInit.cancelable,\n detail = eventInit.detail,\n otherInit = _objectWithoutPropertiesLoose(eventInit, _excluded2);\n\n event.initEvent(eventName, bubbles, cancelable, detail);\n Object.keys(otherInit).forEach(function (eventKey) {\n event[eventKey] = otherInit[eventKey];\n });\n } // DataTransfer is not supported in jsdom: https://github.com/jsdom/jsdom/issues/1568\n\n\n var dataTransferProperties = ['dataTransfer', 'clipboardData'];\n dataTransferProperties.forEach(function (dataTransferKey) {\n var dataTransferValue = eventInit[dataTransferKey];\n\n if (typeof dataTransferValue === 'object') {\n /* istanbul ignore if */\n if (typeof window.DataTransfer === 'function') {\n Object.defineProperty(event, dataTransferKey, {\n value: Object.getOwnPropertyNames(dataTransferValue).reduce(function (acc, propName) {\n Object.defineProperty(acc, propName, {\n value: dataTransferValue[propName]\n });\n return acc;\n }, new window.DataTransfer())\n });\n } else {\n Object.defineProperty(event, dataTransferKey, {\n value: dataTransferValue\n });\n }\n }\n });\n return event;\n}\n\nObject.keys(eventMap).forEach(function (key) {\n var _eventMap$key = eventMap[key],\n EventType = _eventMap$key.EventType,\n defaultInit = _eventMap$key.defaultInit;\n var eventName = key.toLowerCase();\n\n createEvent[key] = function (node, init) {\n return createEvent(eventName, node, init, {\n EventType: EventType,\n defaultInit: defaultInit\n });\n };\n\n fireEvent[key] = function (node, init) {\n return fireEvent(node, createEvent[key](node, init));\n };\n}); // function written after some investigation here:\n// https://github.com/facebook/react/issues/10135#issuecomment-401496776\n\nfunction setNativeValue(element, value) {\n var _ref2 = Object.getOwnPropertyDescriptor(element, 'value') || {},\n valueSetter = _ref2.set;\n\n var prototype = Object.getPrototypeOf(element);\n\n var _ref3 = Object.getOwnPropertyDescriptor(prototype, 'value') || {},\n prototypeValueSetter = _ref3.set;\n\n if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n }\n /* istanbul ignore next (I don't want to bother) */\n else if (valueSetter) {\n valueSetter.call(element, value);\n } else {\n throw new Error('The given element does not have a value setter');\n }\n}\n\nObject.keys(eventAliasMap).forEach(function (aliasKey) {\n var key = eventAliasMap[aliasKey];\n\n fireEvent[aliasKey] = function () {\n return fireEvent[key].apply(fireEvent, arguments);\n };\n});\n/* eslint complexity:[\"error\", 9] */\n\nfunction unindent(string) {\n // remove white spaces first, to save a few bytes.\n // testing-playground will reformat on load any ways.\n return string.replace(/[ \\t]*[\\n][ \\t]*/g, '\\n');\n}\n\nfunction encode(value) {\n return compressToEncodedURIComponent(unindent(value));\n}\n\nfunction getPlaygroundUrl(markup) {\n return \"https://testing-playground.com/#markup=\" + encode(markup);\n}\n\nvar debug = function debug(element, maxLength, options) {\n return Array.isArray(element) ? element.forEach(function (el) {\n return logDOM(el, maxLength, options);\n }) : logDOM(element, maxLength, options);\n};\n\nvar logTestingPlaygroundURL = function logTestingPlaygroundURL(element) {\n if (element === void 0) {\n element = getDocument().body;\n }\n\n if (!element || !('innerHTML' in element)) {\n console.log(\"The element you're providing isn't a valid DOM element.\");\n return;\n }\n\n if (!element.innerHTML) {\n console.log(\"The provided element doesn't have any children.\");\n return;\n }\n\n console.log(\"Open this URL in your browser\\n\\n\" + getPlaygroundUrl(element.innerHTML));\n};\n\nvar initialValue = {\n debug: debug,\n logTestingPlaygroundURL: logTestingPlaygroundURL\n};\nvar screen = typeof document !== 'undefined' && document.body ? getQueriesForElement(document.body, queries, initialValue) : Object.keys(queries).reduce(function (helpers, key) {\n helpers[key] = function () {\n throw new TypeError('For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error');\n };\n\n return helpers;\n}, initialValue);\n\nexport { buildQueries, configure, createEvent, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, getAllByAltText, getAllByDisplayValue, getAllByLabelTextWithSuggestions as getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelTextWithSuggestions as getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getMultipleElementsFoundError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, makeFindQuery, makeGetAllQuery, makeSingleQuery, prettyDOM, queries, queryAllByAltTextWithSuggestions as queryAllByAltText, queryAllByAttribute, queryAllByDisplayValueWithSuggestions as queryAllByDisplayValue, queryAllByLabelTextWithSuggestions as queryAllByLabelText, queryAllByPlaceholderTextWithSuggestions as queryAllByPlaceholderText, queryAllByRoleWithSuggestions as queryAllByRole, queryAllByTestIdWithSuggestions as queryAllByTestId, queryAllByTextWithSuggestions as queryAllByText, queryAllByTitleWithSuggestions as queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, wait, waitForWrapper as waitFor, waitForDomChangeWrapper as waitForDomChange, waitForElement, waitForElementToBeRemoved, getQueriesForElement as within, wrapAllByQueryWithSuggestion, wrapSingleQueryWithSuggestion };\n"]},"metadata":{},"sourceType":"module"}
|