@ctrl/dom 0.3.12 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/aria/_chunks/aria-query.generated-B6BAyxT7.js +4 -0
  2. package/dist/aria/_chunks/aria-query.generated-DK1XMP7F.cjs +4 -0
  3. package/dist/aria/index.cjs +1 -1
  4. package/dist/aria/index.js +1 -1
  5. package/dist/aria/internal.cjs +1 -1
  6. package/dist/aria/internal.js +1 -1
  7. package/dist/aria/types/data/aria-query.generated.d.ts +1 -1
  8. package/dist/bridge/internal.js +1 -1
  9. package/dist/dom/_chunks/src-BISULkzm.js +50 -0
  10. package/dist/dom/index.js +1 -1
  11. package/dist/dom/internal.js +1 -1
  12. package/dist/dom/types/collections/iterator.d.ts +9 -0
  13. package/dist/dom/types/css/cascade.d.ts +2 -0
  14. package/dist/dom/types/css/data/properties.d.ts +1 -1
  15. package/dist/dom/types/css/declarations.d.ts +2 -0
  16. package/dist/dom/types/css/tokenizer.d.ts +8 -1
  17. package/dist/dom/types/css/values.d.ts +3 -3
  18. package/dist/dom/types/css/view.d.ts +0 -8
  19. package/dist/dom/types/events/Event.d.ts +13 -1
  20. package/dist/dom/types/events/handlers.d.ts +2 -0
  21. package/dist/dom/types/html/HTMLElement.d.ts +7 -5
  22. package/dist/dom/types/html/aria-reflection.d.ts +5 -0
  23. package/dist/dom/types/html/custom-elements.d.ts +0 -1
  24. package/dist/dom/types/html/elements.d.ts +0 -4
  25. package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +2 -9
  26. package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +0 -4
  27. package/dist/dom/types/html/forms/HTMLInputElement.d.ts +11 -30
  28. package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +4 -13
  29. package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +2 -3
  30. package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +11 -11
  31. package/dist/dom/types/html/forms/collections.d.ts +5 -0
  32. package/dist/dom/types/html/forms/common.d.ts +7 -0
  33. package/dist/dom/types/html/forms/selection.d.ts +43 -0
  34. package/dist/dom/types/html/forms/validation.d.ts +7 -2
  35. package/dist/dom/types/html/shared.d.ts +4 -0
  36. package/dist/dom/types/html/svg-types.d.ts +1 -1
  37. package/dist/dom/types/internal.d.ts +2 -1
  38. package/dist/dom/types/nodes/Document.d.ts +1 -1
  39. package/dist/dom/types/nodes/Element.d.ts +16 -20
  40. package/dist/dom/types/nodes/Node.d.ts +1 -1
  41. package/dist/dom/types/nodes/attributes.d.ts +7 -0
  42. package/dist/dom/types/nodes/tags.d.ts +2 -0
  43. package/dist/dom/types/nodes/tree.d.ts +1 -1
  44. package/dist/dom/types/parser/entities-data.d.ts +3 -3
  45. package/dist/dom/types/parser/tokenizer.d.ts +1 -0
  46. package/dist/dom/types/parser/treebuilder.d.ts +7 -2
  47. package/dist/dom/types/selectors/compile.d.ts +7 -4
  48. package/dist/dom/types/selectors/parser.d.ts +0 -63
  49. package/dist/dom/types/serializer/index.d.ts +4 -1
  50. package/dist/dom/types/traversal/Range.d.ts +3 -0
  51. package/dist/dom/types/window/Window.d.ts +2 -2
  52. package/dist/dom/types/window/clock.d.ts +6 -2
  53. package/dist/dom/types/window/fallbacks.d.ts +0 -8
  54. package/dist/dom/types/window/hooks.d.ts +1 -2
  55. package/dist/dom/types/window/interfaces.d.ts +0 -2
  56. package/dist/dom/types/window/media.d.ts +1 -6
  57. package/dist/dom/types/window/xhr.d.ts +4 -0
  58. package/dist/jest-dom/_chunks/{matchers-DGsBvtWC.js → matchers-D7d49HIF.js} +7 -7
  59. package/dist/jest-dom/_chunks/{matchers-DJmRgUYG.cjs → matchers-lhGtjS66.cjs} +7 -7
  60. package/dist/jest-dom/index.cjs +1 -1
  61. package/dist/jest-dom/index.js +1 -1
  62. package/dist/jest-dom/jest-globals.cjs +1 -1
  63. package/dist/jest-dom/jest-globals.js +1 -1
  64. package/dist/jest-dom/matchers.cjs +1 -1
  65. package/dist/jest-dom/matchers.js +1 -1
  66. package/dist/jest-dom/vitest.cjs +1 -1
  67. package/dist/jest-dom/vitest.js +1 -1
  68. package/dist/testing-library/_chunks/aria-snapshot-diff-DKpjI9CA.cjs +16 -0
  69. package/dist/testing-library/_chunks/{aria-snapshot-diff-BSXxnyqJ.js → aria-snapshot-diff-DdhypD1z.js} +6 -6
  70. package/dist/testing-library/agent.cjs +2 -2
  71. package/dist/testing-library/agent.js +7 -7
  72. package/dist/testing-library/index.cjs +8 -8
  73. package/dist/testing-library/index.js +10 -10
  74. package/dist/user-event/index.cjs +15 -15
  75. package/dist/user-event/index.js +16 -16
  76. package/dist/user-event/types/clipboard/copy.d.ts +6 -0
  77. package/dist/user-event/types/ctrl-dom.d.ts +17 -16
  78. package/dist/user-event/types/event/eventMap.d.ts +99 -99
  79. package/dist/user-event/types/setup/dtl.d.ts +0 -6
  80. package/dist/user-event/types/system/index.d.ts +1 -0
  81. package/package.json +1 -1
  82. package/dist/aria/_chunks/aria-query.generated-BG-n1PE9.js +0 -4
  83. package/dist/aria/_chunks/aria-query.generated-BqD80bJk.cjs +0 -4
  84. package/dist/dom/_chunks/src-B3vkUXY6.js +0 -50
  85. package/dist/testing-library/_chunks/aria-snapshot-diff-B95LLutl.cjs +0 -16
@@ -1,10 +1,10 @@
1
- import{createRequire as e}from"node:module";import{$impl as t,COMMENT_NODE as n,DOCUMENT_FRAGMENT_NODE as r,DOCUMENT_NODE as i,ELEMENT_NODE as a,HTML_NS as o,SVG_NS as s,T as c,TEXT_NODE as l,ariaAttr as u,attr as d,matches as f,serializeNode as p,setFailureSnapshot as m}from"../../bridge/internal.js";import{ariaCheckedState as h,ariaPressedState as g,computeAccessibleNameImpl as _,computeAriaBusy as v,computeAriaCurrent as y,computeAriaExpanded as b,computeAriaSelected as x,computeHeadingLevel as ee,isDisabledImpl as te,isDisplayInline as ne,isDisplayNone as S,isInaccessibleImpl as C,isSubtreeInaccessibleImpl as w,isVisibilityHidden as T,tlRole as E}from"../../aria/internal.js";import{readFileSync as D}from"node:fs";import{roleSupportsProp as O}from"../../aria/index.js";var k=Object.defineProperty,__name=(e,t)=>k(e,`name`,{value:t,configurable:!0});const A=new URL(`./`,import.meta.url).pathname;let j=null;const M=process.env,N=process.argv,P=!(M.NO_COLOR||N.includes(`--no-color`))&&(!!M.FORCE_COLOR||N.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&M.TERM!==`dumb`||!!M.CI);function dim(e){return P?`\x1b[2m${e}\x1b[22m`:e}function getCodeFrame(t){j??=e(import.meta.url)(`@babel/code-frame`).codeFrameColumns;let n=t.indexOf(`(`)+1,r=t.indexOf(`)`),i=t.slice(n,r),a=i.split(`:`),[o,s,c]=[a[0],parseInt(a[1],10),parseInt(a[2],10)],l=``;try{l=D(o,`utf-8`)}catch{return``}let u=j(l,{start:{line:s,column:c-1}},{highlightCode:!0,linesBelow:0});return`${dim(i)}\n${u}\n`}function getUserCodeFrame(){return getCodeFrame((/* @__PURE__ */ Error()).stack.split(`
2
- `).slice(1).find(e=>!e.includes(`node_modules/`)&&!e.includes(A)))}function jestFakeTimersAreEnabled(){if(typeof jest<`u`&&jest!==null)return setTimeout._isMockFunction===!0||Object.hasOwn(setTimeout,`clock`);let e=setTimeout.clock;return e!=null&&typeof e.tick==`function`}function advanceFakeTimersByTime(e){if(typeof jest<`u`&&jest!==null){jest.advanceTimersByTime(e);return}let t=globalThis.vi;t!=null&&typeof t.advanceTimersByTime==`function`&&typeof t.isFakeTimers==`function`&&t.isFakeTimers()?t.advanceTimersByTime(e):setTimeout.clock.tick(e)}function getDocument(){if(typeof window>`u`)throw Error(`Could not find default container`);return window.document}function getWindowFromNode(e){if(e.defaultView)return e.defaultView;if(e.ownerDocument&&e.ownerDocument.defaultView)return e.ownerDocument.defaultView;if(e.window)return e.window;throw e.ownerDocument&&e.ownerDocument.defaultView===null?Error(`It looks like the window object is not available for the provided node.`):e.then instanceof Function?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...`?"):Array.isArray(e)?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...`?"):typeof e.debug==`function`&&typeof e.logTestingPlaygroundURL==`function`?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..., `?"):Error(`The given node is not an Element, the node type is: ${typeof e}.`)}function checkContainerType(e){if(!e||typeof e.querySelector!=`function`||typeof e.querySelectorAll!=`function`)throw TypeError(`Expected container to be an Element, a Document or a DocumentFragment but got ${getTypeName(e)}.`)}function getTypeName(e){return typeof e==`object`?e===null?`null`:e.constructor.name:typeof e}function implOf(e){let n=e[t];if(n===void 0)throw TypeError(`@ctrl/dom/testing-library requires nodes created by @ctrl/dom.`);return n}function matchesSelector(e,t){return e.type===a&&f(e,t)}function envDebugFormat(){let e=typeof process<`u`?process.env?.CTRL_DOM_DEBUG:void 0;if(e===void 0||e===``)return null;let t=String(e).trim().toLowerCase();return t===`aria`?`aria`:t===`compact`||t===`html`?`compact`:null}function containerLabel(e){let n=e?.[t];return n===void 0?`the container`:n.type===9?`the document`:describeElement(n)}function agentErrorContext(e,t,n){return t===`aria`?`Accessibility snapshot of ${containerLabel(e)} (CTRL_DOM_DEBUG=aria):\n${ariaSnapshot(e,{maxLines:envMaxLines()??100})}`:`DOM of ${containerLabel(e)} without class/style/SVG internals (CTRL_DOM_DEBUG=compact):\n${n(e,void 0,{format:`compact`})}`}function agentElementSummary(e){return ariaSnapshot(e,{maxLines:12})}function envMaxLines(){let e=typeof process<`u`?process.env?.CTRL_DOM_DEBUG_LINES:void 0,t=e?Number(e):NaN;return t>0?t:void 0}function ariaSnapshot(e,t={}){let{header:n,lines:r,empty:i}=ariaSnapshotLines(e,t);return i===null?n+budgetLines(r,t.maxLines??envMaxLines()??200).join(`
1
+ import{createRequire as e}from"node:module";import{$impl as t,COMMENT_NODE as n,DOCUMENT_FRAGMENT_NODE as r,DOCUMENT_NODE as i,ELEMENT_NODE as a,HTML_NS as o,SVG_NS as s,T as c,TEXT_NODE as l,ariaAttr as u,attr as d,matches as f,serializeNode as p,setFailureSnapshot as m}from"../../bridge/internal.js";import{ariaCheckedState as h,ariaPressedState as g,computeAccessibleNameImpl as _,computeAriaBusy as v,computeAriaCurrent as y,computeAriaExpanded as b,computeAriaSelected as x,computeHeadingLevel as S,isDisabledImpl as ee,isDisplayInline as te,isDisplayNone as ne,isInaccessibleImpl as C,isSubtreeInaccessibleImpl as w,isVisibilityHidden as T,tlRole as E}from"../../aria/internal.js";import{readFileSync as re}from"node:fs";import{roleSupportsProp as D}from"../../aria/index.js";var O=Object.defineProperty,__name=(e,t)=>O(e,`name`,{value:t,configurable:!0});const k=new URL(`./`,import.meta.url).pathname;let A=null;const j=process.env,M=process.argv,N=!(j.NO_COLOR||M.includes(`--no-color`))&&(!!j.FORCE_COLOR||M.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&j.TERM!==`dumb`||!!j.CI);function dim(e){return N?`\x1b[2m${e}\x1b[22m`:e}function getCodeFrame(t){A??=e(import.meta.url)(`@babel/code-frame`).codeFrameColumns;let n=t.indexOf(`(`)+1,r=t.indexOf(`)`),i=t.slice(n,r),a=i.split(`:`),[o,s,c]=[a[0],parseInt(a[1],10),parseInt(a[2],10)],l=``;try{l=re(o,`utf-8`)}catch{return``}let u=A(l,{start:{line:s,column:c-1}},{highlightCode:!0,linesBelow:0});return`${dim(i)}\n${u}\n`}function getUserCodeFrame(){return getCodeFrame((/* @__PURE__ */ Error()).stack.split(`
2
+ `).slice(1).find(e=>!e.includes(`node_modules/`)&&!e.includes(k)))}const P=Object.freeze({});function jestFakeTimersAreEnabled(){if(typeof jest<`u`&&jest!==null)return setTimeout._isMockFunction===!0||Object.hasOwn(setTimeout,`clock`);let e=setTimeout.clock;return e!=null&&typeof e.tick==`function`}function advanceFakeTimersByTime(e){if(typeof jest<`u`&&jest!==null){jest.advanceTimersByTime(e);return}let t=globalThis.vi;t!=null&&typeof t.advanceTimersByTime==`function`&&typeof t.isFakeTimers==`function`&&t.isFakeTimers()?t.advanceTimersByTime(e):setTimeout.clock.tick(e)}function getDocument(){if(typeof window>`u`)throw Error(`Could not find default container`);return window.document}function getWindowFromNode(e){if(e.defaultView)return e.defaultView;if(e.ownerDocument&&e.ownerDocument.defaultView)return e.ownerDocument.defaultView;if(e.window)return e.window;throw e.ownerDocument&&e.ownerDocument.defaultView===null?Error(`It looks like the window object is not available for the provided node.`):e.then instanceof Function?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...`?"):Array.isArray(e)?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...`?"):typeof e.debug==`function`&&typeof e.logTestingPlaygroundURL==`function`?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..., `?"):Error(`The given node is not an Element, the node type is: ${typeof e}.`)}function checkContainerType(e){if(!e||typeof e.querySelector!=`function`||typeof e.querySelectorAll!=`function`)throw TypeError(`Expected container to be an Element, a Document or a DocumentFragment but got ${getTypeName(e)}.`)}function getTypeName(e){return typeof e==`object`?e===null?`null`:e.constructor.name:typeof e}function implOf(e){let n=e[t];if(n===void 0)throw TypeError(`@ctrl/dom/testing-library requires nodes created by @ctrl/dom.`);return n}function matchesSelector(e,t){return e.type===a&&f(e,t)}function envDebugFormat(){let e=typeof process<`u`?process.env?.CTRL_DOM_DEBUG:void 0;if(e===void 0||e===``)return null;let t=String(e).trim().toLowerCase();return t===`aria`?`aria`:t===`compact`||t===`html`?`compact`:null}function containerLabel(e){let n=e?.[t];return n===void 0?`the container`:n.type===9?`the document`:describeElement(n)}function agentErrorContext(e,t,n){return t===`aria`?`Accessibility snapshot of ${containerLabel(e)} (CTRL_DOM_DEBUG=aria):\n${ariaSnapshot(e,{maxLines:envMaxLines()??100})}`:`DOM of ${containerLabel(e)} without class/style/SVG internals (CTRL_DOM_DEBUG=compact):\n${n(e,void 0,{format:`compact`})}`}function agentElementSummary(e){return ariaSnapshot(e,{maxLines:12})}function envMaxLines(){let e=typeof process<`u`?process.env?.CTRL_DOM_DEBUG_LINES:void 0,t=e?Number(e):NaN;return t>0?t:void 0}function ariaSnapshot(e,t={}){let{header:n,lines:r,empty:i}=ariaSnapshotLines(e,t);return i===null?n+budgetLines(r,t.maxLines??envMaxLines()??200).join(`
3
3
  `):n+i}m(e=>ariaSnapshot(e,{maxLines:2e3}));function buildTree(e,t){let n=rootImpl(e),r=new SnapshotContext(n,t),i=[],o=``;return!r.includeHidden&&n.type===a&&C(n)&&(o=`# hidden from the accessibility tree: ${hiddenReason(n)}\n`,r.includeHidden=!0,r.forceHidden=!0),n.type===a&&n!==bodyOf(n)?r.visitElement(n,i,r.forceHidden):r.visitChildren(n,i,!1,!1),finishChildren(i,null),{root:n,ctx:r,children:i,header:o}}function ariaSnapshotTree(e,t={}){return buildTree(e,t).children}function ariaSnapshotLines(e,t={}){let{root:n,ctx:r,children:i,header:a}=buildTree(e,t),o=[];r.renderList(i,``,o);let s=o.length>0?null:r.sawHidden?`# no accessible content (hidden elements exist: pass { hidden: true })`:`# no accessible content`;return n===bodyOf(n)&&envDebugFormat()!==null&&recordBodySnapshot(n.doc,s??o.join(`
4
- `)),{header:a,lines:o,empty:s}}function budgetLines(e,t){if(e.length<=t)return e;let n=e.length-t,r=e.slice(0,t);return r.push(`# … ${n} more line${n===1?``:`s`} (raise maxLines or CTRL_DOM_DEBUG_LINES)`),r}const F=Symbol.for(`ctrl-dom.agent.lastBodySnapshot`);function recordBodySnapshot(e,t){e!=null&&Object.defineProperty(e,F,{value:t,configurable:!0,writable:!0,enumerable:!1})}function lastBodySnapshot(e){return e?.[F]}function resetBodySnapshot(e){e!=null&&Object.hasOwn(e,F)&&delete e[F]}function rootImpl(e){let n=e??getDocument().body,r=n?.[t];if(r===void 0)throw TypeError(`Expected an element, document or fragment but got ${n===null?`null`:typeof n}`);if(r.type===i||r.tag===c.html&&r.ns===o){let e=r.doc?.body;return e?e[t]:r}return r}function bodyOf(e){let n=e.doc?.body;return n?n[t]:null}function normalizeSpace(e){return e.replace(/[\t\n\f\r ]+/g,` `)}function truncate(e,t){return e.length>t?e.slice(0,Math.max(1,t-1))+`…`:e}function quote(e){return JSON.stringify(e)}const I=/^$|^[\s\-?:,[\]{}#&*!|>'"%@`]|[\s]$|:$|: | #|^(true|false|null|yes|no|on|off|~)$|^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i;function yamlValue(e){return I.test(e)?quote(e):e}function nodeKey(e,t){let n=e.role;e.name!==``&&(n+=` `+quote(truncate(e.name,t)));for(let t=0;t<e.props.length;t++)n+=` `+e.props[t];return n}function describeElement(e){let t=e.name;if(e.id!==``)return`<${t} id="${e.id}">`;let n=d(e,`data-testid`);return n===null?`<${t}>`:`<${t} data-testid="${n}">`}function hiddenReason(e){let t=hiddenChainReason(e);return t===``?T(e)?`visibility: hidden on ${describeElement(e)}`:``:t}function hiddenChainReason(e){for(let t=e;t!==null&&t.type===a;t=t.parent){if(t.ns===o&&d(t,`hidden`)!==null)return`hidden attribute on ${describeElement(t)}`;if(u(t,`aria-hidden`)===`true`)return`aria-hidden="true" on ${describeElement(t)}`;if(S(t))return`display: none on ${describeElement(t)}`}return``}const L=/* @__PURE__ */ new Set([``,`generic`,`none`,`presentation`]);function isSkippedTag(e){if(e.ns!==o)return!1;switch(e.tag){case c.script:case c.style:case c.template:case c.noscript:case c.head:return!0}return!1}function nodeProps(e,t,n,r){let i=[];if(O(t,`aria-checked`)){let t=h(e);t===!0?i.push(`[checked]`):t===`mixed`&&i.push(`[checked=mixed]`)}te(e)&&i.push(`[disabled]`);let a=b(e);a===!0?i.push(`[expanded]`):a===!1&&i.push(`[expanded=false]`),n&&i.push(`[active]`);let o=t===`heading`?ee(e):levelAttr(e);o!==void 0&&i.push(`[level=${o}]`);let s=g(e);s===!0?i.push(`[pressed]`):s===`mixed`?i.push(`[pressed=mixed]`):s===!1&&i.push(`[pressed=false]`),x(e)===!0&&i.push(`[selected]`);let c=y(e);return c===!0?i.push(`[current]`):typeof c==`string`&&c!==``&&i.push(`[current=${c}]`),v(e)&&i.push(`[busy]`),r&&i.push(`[hidden]`),i}function levelAttr(e){let t=u(e,`aria-level`),n=t===null?NaN:Number(t);return n>0?n:void 0}const R=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`spinbutton`,`slider`,`progressbar`,`meter`,`scrollbar`,`separator`]);function nodeValue(e,t){if(!R.has(t))return null;let n=u(e,`aria-valuetext`);if(n!==null)return n;let r=u(e,`aria-valuenow`);if(r!==null)return r;if(e.ns!==o)return null;if(e.tag===c.input||e.tag===c.textarea){let t=String(e.node.value??``);return t===``?null:t}return null}var SnapshotContext=class{includeHidden;forceHidden=!1;sawHidden=!1;maxText;collapseAfter;urls;active;constructor(e,n){this.includeHidden=n.hidden===!0,this.maxText=n.maxTextLength??100,this.collapseAfter=n.collapseAfter??5,this.urls=n.urls===!0;let r=e.doc?.activeElement,i=r?r[t]??null:null;this.active=i!==null&&i===bodyOf(e)?null:i}visitChildren(e,t,n,i){for(let o=e.first;o!==null;o=o.next)o.type===l?i||appendText(t,o.data):o.type===a?this.visitElement(o,t,n):o.type===r&&this.visitChildren(o,t,n,i)}visitElement(e,t,n){if(isSkippedTag(e))return;let r=n;if(!r&&w(e)){if(this.sawHidden=!0,!this.includeHidden)return;r=!0}let i=r;if(!r&&T(e)){if(this.sawHidden=!0,!this.includeHidden){this.visitChildren(e,t,!1,!0);return}i=!0}let a=E(e);if(L.has(a)){let n=!ne(e);n&&appendBreak(t),this.visitChildren(e,t,r,!1),n&&appendBreak(t);return}let s={role:a,name:normalizeSpace(_(e,void 0,5)).trim(),props:nodeProps(e,a,e===this.active,i&&this.includeHidden),value:nodeValue(e,a),url:null,children:[],element:e};this.urls&&a===`link`&&(s.url=d(e,`href`)),(e.ns!==o||e.tag!==c.textarea)&&this.visitChildren(e,s.children,r,!1),finishChildren(s.children,s.name),t.push(s)}renderList(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(typeof i==`string`){n.push(`${t}- text: ${yamlValue(truncate(i,this.maxText))}`);continue}let a=1;for(;r+a<e.length&&typeof e[r+a]!=`string`&&e[r+a].role===i.role;)a++;if(a>this.collapseAfter+1){for(let i=0;i<this.collapseAfter;i++)this.renderNode(e[r+i],t,n);n.push(`${t}- ${i.role} … (+${a-this.collapseAfter} more)`),r+=a-1}else this.renderNode(i,t,n)}}renderNode(e,t,n){let r=nodeKey(e,this.maxText),i=e.children;if(e.url===null&&(i.length===0||i.length===1&&typeof i[0]==`string`&&e.value===null)){let a=e.value??(i.length===1?i[0]:null);n.push(a===null?`${t}- ${r}`:`${t}- ${r}: ${yamlValue(truncate(a,this.maxText))}`);return}n.push(e.value===null?`${t}- ${r}:`:`${t}- ${r}: ${yamlValue(truncate(e.value,this.maxText))}`);let a=t+` `;e.url!==null&&n.push(`${a}- /url: ${yamlValue(e.url)}`),this.renderList(i,a,n)}};function appendText(e,t){if(t===``)return;let n=e.length-1;n>=0&&typeof e[n]==`string`&&e[n]!==`\0`?e[n]=e[n]+t:e.push(t)}function appendBreak(e){let t=e.length-1;t>=0&&typeof e[t]==`string`&&e[t]!==`\0`&&e.push(`\0`)}function finishChildren(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e[t];typeof r==`string`&&(r===`\0`||(r=normalizeSpace(r).trim(),r===``))||(e[n++]=r)}e.length=n,e.length>0&&typeof e[0]==`string`&&e[0]===t&&e.splice(0,1),n=0;for(let t=0;t<e.length;t++){let r=e[t];(typeof r!=`string`||!labels(e[t-1],r)&&!labels(e[t+1],r))&&(e[n++]=r)}e.length=n}const z=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`,`meter`,`progressbar`]);function labels(e,t){return e!==void 0&&typeof e!=`string`&&e.name===t&&z.has(e.role)}let B=null;function loadPrettyFormat(t){if(B!==null)return B;try{return B=e(import.meta.url)(`pretty-format`)}catch(e){throw Error(`${t} needs pretty-format, which @ctrl/dom does not install: add pretty-format@27 to the project's devDependencies.`,{cause:e})}}const V=`The prettyFormat export`,H=Object.defineProperties({},{format:{enumerable:!0,get:()=>loadPrettyFormat(V).format},default:{enumerable:!0,get:()=>loadPrettyFormat(V).default},plugins:{enumerable:!0,get:()=>loadPrettyFormat(V).plugins},DEFAULT_OPTIONS:{enumerable:!0,get:()=>loadPrettyFormat(V).DEFAULT_OPTIONS}}),shouldHighlight=()=>{if(typeof process>`u`)return!1;let e;try{let t=process.env?.COLORS;t&&(e=JSON.parse(t))}catch{}return typeof e==`boolean`?e:process.versions!==void 0&&process.versions.node!==void 0};function filterCommentsAndDefaultIgnoreTagsTags(e){return e.nodeType!==n&&(e.nodeType!==a||!e.matches(getConfig().defaultIgnore))}const U={open:``,close:``},W={comment:U,content:U,prop:U,tag:U,value:U},G={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49],bgGray:[100,49],bgGrey:[100,49]},K={comment:`gray`,content:`reset`,prop:`yellow`,tag:`cyan`,value:`green`};function highlightColors(e){let t={};for(let n of Object.keys(K)){let r=e!==void 0&&e[n]!==void 0?e[n]:K[n],i=typeof r==`string`&&Object.hasOwn(G,r)?G[r]:void 0;if(i===void 0)throw Error(`pretty-format: Option "theme" has a key "${n}" whose value "${r}" is undefined in ansi-styles.`);t[n]={open:`\u001b[${i[0]}m`,close:`\u001b[${i[1]}m`}}return t}const q=highlightColors(void 0),J=/* @__PURE__ */ new Set([`callToJSON`,`compareKeys`,`escapeRegex`,`escapeString`,`highlight`,`indent`,`maxDepth`,`min`,`plugins`,`printBasicPrototype`,`printFunctionName`,`theme`]),Y=Symbol(`delegate`),X=/^((HTML|SVG)\w*)?Element$/,Z=/* @__PURE__ */ new WeakMap;function isCustomElement(e){let{tagName:t}=e;return!!(typeof t==`string`&&t.includes(`-`)||typeof e.hasAttribute==`function`&&e.hasAttribute(`is`))}function pluginHandles(e){let t=e.node,i=t.constructor,o=i?.name;switch(e.type){case a:{if(!o&&!isCustomElement(t))return!1;if(typeof i!=`function`)return X.test(o)||isCustomElement(t);let e=Z.get(i);return e===void 0&&Z.set(i,e=X.test(o)),e||isCustomElement(t)}case l:return o===`Text`;case n:return o===`Comment`;case r:return o===`DocumentFragment`}return!1}function escapeHTML(e){return e.indexOf(`<`)===-1&&e.indexOf(`>`)===-1?e:e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function printString(e,t){return t.escapeString?`"`+e.replace(/"|\\/g,`\\$&`)+`"`:`"`+e+`"`}function keepChild(e,t){return t.filterNode===null?e.type===n?!1:e.type===a?t.scriptStyleIgnore?e.name!==`script`&&e.name!==`style`:!matchesSelector(e,t.defaultIgnore):!0:!!t.filterNode(e.node)}function tagNameLower(e){return e.node.tagName.toLowerCase()}function printProps(e,t,n){let r=e.attrs;if(r===null||r.length===0)return``;let i=[],a=/* @__PURE__ */ new Map;for(let n=0;n<r.length;n++)t.compact&&isNoiseAttribute(e,r[n].name)||(i.push(r[n].name),a.set(r[n].name,r[n].value));i.sort();let o=t.colors,s=``;for(let e=0;e<i.length;e++){let r=i[e];s+=t.spacingInner+n+o.prop.open+r+o.prop.close+`=`+o.value.open+printString(a.get(r),t)+o.value.close}return s}function isNoiseAttribute(e,t){return t===`class`||t===`style`||e.ns===s&&t!==`role`&&t!==`id`&&!t.startsWith(`aria-`)&&!t.startsWith(`data-`)}function printChildren(e,t,n,r){if(t.compact&&e.ns===s&&e.name===`svg`)return``;let i=``;for(let a=e.first;a!==null;a=a.next)keepChild(a,t)&&(t.compact&&a.type===l&&a.data.trim()===``||(i+=t.spacingOuter+n+printNode(a,t,n,r)));return i}function printElement(e,t,n,r,i){let a=r.colors.tag;return a.open+`<`+e+(t&&a.close+t+r.spacingOuter+i+a.open)+(n?`>`+a.close+n+r.spacingOuter+i+a.open+`</`+e:(t&&!r.min?``:` `)+`/`)+`>`+a.close}function printNode(e,t,i,a){if(!pluginHandles(e))throw Y;if(e.type===l){let n=t.compact&&e.data.length>200?e.data.slice(0,199)+`…`:e.data;return t.colors.content.open+escapeHTML(n)+t.colors.content.close}if(e.type===n){let n=t.colors.comment;return n.open+`<!--`+escapeHTML(e.data)+`-->`+n.close}let o=e.type===r?`DocumentFragment`:tagNameLower(e),s=t.colors.tag;if(++a>t.maxDepth)return s.open+`<`+o+s.close+` …`+s.open+` />`+s.close;let c=i+t.indent;return printElement(o,e.type===r?``:printProps(e,t,c),printChildren(e,t,c,a),t,i)}function printForeignNode(e,t,i,a,o){if(!foreignHandles(e))throw Y;if(e.nodeType===l)return t.colors.content.open+escapeHTML(e.data)+t.colors.content.close;if(e.nodeType===n)return t.colors.comment.open+`<!--`+escapeHTML(e.data)+`-->`+t.colors.comment.close;let s=e.nodeType===r,c=s?`DocumentFragment`:e.tagName.toLowerCase(),u=t.colors.tag;if(++o>t.maxDepth)return u.open+`<`+c+u.close+` …`+u.open+` />`+u.close;let d=a+t.indent,f=``;if(!s){let n=Array.from(e.attributes);n.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name));for(let{name:e,value:r}of n)f+=t.spacingInner+d+t.colors.prop.open+e+t.colors.prop.close+`=`+t.colors.value.open+printString(r,t)+t.colors.value.close}let p=``,m=e.childNodes||e.children;for(let e=0;e<m.length;e++)i(m[e])&&(p+=t.spacingOuter+d+printForeignNode(m[e],t,i,d,o));return printElement(c,f,p,t,a)}function foreignHandles(e){let t=e?.constructor?.name;if(!t&&!isCustomElement(e))return!1;switch(e.nodeType){case a:return X.test(t)||isCustomElement(e);case l:return t===`Text`;case n:return t===`Comment`;case r:return t===`DocumentFragment`}return!1}function makePrintConfig(e,t){for(let t of Object.keys(e))if(!J.has(t))throw Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw Error(`pretty-format: Options "min" and "indent" cannot be used together.`);if(e.theme!==void 0){if(e.theme===null)throw Error(`pretty-format: Option "theme" must not be null.`);if(typeof e.theme!=`object`)throw Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof e.theme}".`)}if(e.plugins!==void 0)return null;let n=!!e.min,r=e.indent===void 0?2:e.indent,i=getConfig().defaultIgnore;return{colors:e.highlight?e.theme===void 0?q:highlightColors(e.theme):W,escapeString:e.escapeString===void 0||e.escapeString,indent:n?``:Array(r+1).join(` `),maxDepth:e.maxDepth===void 0?1/0:e.maxDepth,min:n,spacingInner:n?` `:`
4
+ `)),{header:a,lines:o,empty:s}}function budgetLines(e,t){if(e.length<=t)return e;let n=e.length-t,r=e.slice(0,t);return r.push(`# … ${n} more line${n===1?``:`s`} (raise maxLines or CTRL_DOM_DEBUG_LINES)`),r}const F=Symbol.for(`ctrl-dom.agent.lastBodySnapshot`);function recordBodySnapshot(e,t){e!=null&&Object.defineProperty(e,F,{value:t,configurable:!0,writable:!0,enumerable:!1})}function lastBodySnapshot(e){return e?.[F]}function resetBodySnapshot(e){e!=null&&Object.hasOwn(e,F)&&delete e[F]}function rootImpl(e){let n=e??getDocument().body,r=n?.[t];if(r===void 0)throw TypeError(`Expected an element, document or fragment but got ${n===null?`null`:typeof n}`);if(r.type===i||r.tag===c.html&&r.ns===o){let e=r.doc?.body;return e?e[t]:r}return r}function bodyOf(e){let n=e.doc?.body;return n?n[t]:null}function normalizeSpace(e){return e.replace(/[\t\n\f\r ]+/g,` `)}function truncate(e,t){return e.length>t?e.slice(0,Math.max(1,t-1))+`…`:e}function quote(e){return JSON.stringify(e)}const I=/^$|^[\s\-?:,[\]{}#&*!|>'"%@`]|[\s]$|:$|: | #|^(true|false|null|yes|no|on|off|~)$|^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i;function yamlValue(e){return I.test(e)?quote(e):e}function nodeKey(e,t){let n=e.role;e.name!==``&&(n+=` `+quote(truncate(e.name,t)));for(let t=0;t<e.props.length;t++)n+=` `+e.props[t];return n}function describeElement(e){let t=e.name;if(e.id!==``)return`<${t} id="${e.id}">`;let n=d(e,`data-testid`);return n===null?`<${t}>`:`<${t} data-testid="${n}">`}function hiddenReason(e){let t=hiddenChainReason(e);return t===``?T(e)?`visibility: hidden on ${describeElement(e)}`:``:t}function hiddenChainReason(e){for(let t=e;t!==null&&t.type===a;t=t.parent){if(t.ns===o&&d(t,`hidden`)!==null)return`hidden attribute on ${describeElement(t)}`;if(u(t,`aria-hidden`)===`true`)return`aria-hidden="true" on ${describeElement(t)}`;if(ne(t))return`display: none on ${describeElement(t)}`}return``}const L=/* @__PURE__ */ new Set([``,`generic`,`none`,`presentation`]);function isSkippedTag(e){if(e.ns!==o)return!1;switch(e.tag){case c.script:case c.style:case c.template:case c.noscript:case c.head:return!0}return!1}function nodeProps(e,t,n,r){let i=[];if(D(t,`aria-checked`)){let t=h(e);t===!0?i.push(`[checked]`):t===`mixed`&&i.push(`[checked=mixed]`)}ee(e)&&i.push(`[disabled]`);let a=b(e);a===!0?i.push(`[expanded]`):a===!1&&i.push(`[expanded=false]`),n&&i.push(`[active]`);let o=t===`heading`?S(e):levelAttr(e);o!==void 0&&i.push(`[level=${o}]`);let s=g(e);s===!0?i.push(`[pressed]`):s===`mixed`?i.push(`[pressed=mixed]`):s===!1&&i.push(`[pressed=false]`),x(e)===!0&&i.push(`[selected]`);let c=y(e);return c===!0?i.push(`[current]`):typeof c==`string`&&c!==``&&i.push(`[current=${c}]`),v(e)&&i.push(`[busy]`),r&&i.push(`[hidden]`),i}function levelAttr(e){let t=u(e,`aria-level`),n=t===null?NaN:Number(t);return n>0?n:void 0}const R=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`spinbutton`,`slider`,`progressbar`,`meter`,`scrollbar`,`separator`]);function nodeValue(e,t){if(!R.has(t))return null;let n=u(e,`aria-valuetext`);if(n!==null)return n;let r=u(e,`aria-valuenow`);if(r!==null)return r;if(e.ns!==o)return null;if(e.tag===c.input||e.tag===c.textarea){let t=String(e.node.value??``);return t===``?null:t}return null}var SnapshotContext=class{includeHidden;forceHidden=!1;sawHidden=!1;maxText;collapseAfter;urls;active;constructor(e,n){this.includeHidden=n.hidden===!0,this.maxText=n.maxTextLength??100,this.collapseAfter=n.collapseAfter??5,this.urls=n.urls===!0;let r=e.doc?.activeElement,i=r?r[t]??null:null;this.active=i!==null&&i===bodyOf(e)?null:i}visitChildren(e,t,n,i){for(let o=e.first;o!==null;o=o.next)o.type===l?i||appendText(t,o.data):o.type===a?this.visitElement(o,t,n):o.type===r&&this.visitChildren(o,t,n,i)}visitElement(e,t,n){if(isSkippedTag(e))return;let r=n;if(!r&&w(e)){if(this.sawHidden=!0,!this.includeHidden)return;r=!0}let i=r;if(!r&&T(e)){if(this.sawHidden=!0,!this.includeHidden){this.visitChildren(e,t,!1,!0);return}i=!0}let a=E(e);if(L.has(a)){let n=!te(e);n&&appendBreak(t),this.visitChildren(e,t,r,!1),n&&appendBreak(t);return}let s={role:a,name:normalizeSpace(_(e,void 0,5)).trim(),props:nodeProps(e,a,e===this.active,i&&this.includeHidden),value:nodeValue(e,a),url:null,children:[],element:e};this.urls&&a===`link`&&(s.url=d(e,`href`)),(e.ns!==o||e.tag!==c.textarea)&&this.visitChildren(e,s.children,r,!1),finishChildren(s.children,s.name),t.push(s)}renderList(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(typeof i==`string`){n.push(`${t}- text: ${yamlValue(truncate(i,this.maxText))}`);continue}let a=1;for(;r+a<e.length&&typeof e[r+a]!=`string`&&e[r+a].role===i.role;)a++;if(a>this.collapseAfter+1){for(let i=0;i<this.collapseAfter;i++)this.renderNode(e[r+i],t,n);n.push(`${t}- ${i.role} … (+${a-this.collapseAfter} more)`),r+=a-1}else this.renderNode(i,t,n)}}renderNode(e,t,n){let r=nodeKey(e,this.maxText),i=e.children;if(e.url===null&&(i.length===0||i.length===1&&typeof i[0]==`string`&&e.value===null)){let a=e.value??(i.length===1?i[0]:null);n.push(a===null?`${t}- ${r}`:`${t}- ${r}: ${yamlValue(truncate(a,this.maxText))}`);return}n.push(e.value===null?`${t}- ${r}:`:`${t}- ${r}: ${yamlValue(truncate(e.value,this.maxText))}`);let a=t+` `;e.url!==null&&n.push(`${a}- /url: ${yamlValue(e.url)}`),this.renderList(i,a,n)}};function appendText(e,t){if(t===``)return;let n=e.length-1;n>=0&&typeof e[n]==`string`&&e[n]!==`\0`?e[n]=e[n]+t:e.push(t)}function appendBreak(e){let t=e.length-1;t>=0&&typeof e[t]==`string`&&e[t]!==`\0`&&e.push(`\0`)}function finishChildren(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e[t];typeof r==`string`&&(r===`\0`||(r=normalizeSpace(r).trim(),r===``))||(e[n++]=r)}e.length=n,e.length>0&&typeof e[0]==`string`&&e[0]===t&&e.splice(0,1),n=0;for(let t=0;t<e.length;t++){let r=e[t];(typeof r!=`string`||!labels(e[t-1],r)&&!labels(e[t+1],r))&&(e[n++]=r)}e.length=n}const z=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`,`meter`,`progressbar`]);function labels(e,t){return e!==void 0&&typeof e!=`string`&&e.name===t&&z.has(e.role)}let B=null;function loadPrettyFormat(t){if(B!==null)return B;try{return B=e(import.meta.url)(`pretty-format`)}catch(e){throw Error(`${t} needs pretty-format, which @ctrl/dom does not install: add pretty-format@27 to the project's devDependencies.`,{cause:e})}}const V=`The prettyFormat export`,H=Object.defineProperties({},{format:{enumerable:!0,get:()=>loadPrettyFormat(V).format},default:{enumerable:!0,get:()=>loadPrettyFormat(V).default},plugins:{enumerable:!0,get:()=>loadPrettyFormat(V).plugins},DEFAULT_OPTIONS:{enumerable:!0,get:()=>loadPrettyFormat(V).DEFAULT_OPTIONS}}),shouldHighlight=()=>{if(typeof process>`u`)return!1;let e;try{let t=process.env?.COLORS;t&&(e=JSON.parse(t))}catch{}return typeof e==`boolean`?e:process.versions!==void 0&&process.versions.node!==void 0};function filterCommentsAndDefaultIgnoreTagsTags(e){return e.nodeType!==n&&(e.nodeType!==a||!e.matches(getConfig().defaultIgnore))}const U={open:``,close:``},W={comment:U,content:U,prop:U,tag:U,value:U},G={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],gray:[90,39],grey:[90,39],bgGray:[100,49],bgGrey:[100,49]};for(let[e,t]of[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`].entries()){let n=`bg${t[0].toUpperCase()}${t.slice(1)}`;G[t]=[30+e,39],G[`${t}Bright`]=[90+e,39],G[n]=[40+e,49],G[`${n}Bright`]=[100+e,49]}const K={comment:`gray`,content:`reset`,prop:`yellow`,tag:`cyan`,value:`green`};function highlightColors(e){let t={};for(let n of Object.keys(K)){let r=e!==void 0&&e[n]!==void 0?e[n]:K[n],i=typeof r==`string`&&Object.hasOwn(G,r)?G[r]:void 0;if(i===void 0)throw Error(`pretty-format: Option "theme" has a key "${n}" whose value "${r}" is undefined in ansi-styles.`);t[n]={open:`\u001b[${i[0]}m`,close:`\u001b[${i[1]}m`}}return t}const q=highlightColors(void 0),J=/* @__PURE__ */ new Set([`callToJSON`,`compareKeys`,`escapeRegex`,`escapeString`,`highlight`,`indent`,`maxDepth`,`min`,`plugins`,`printBasicPrototype`,`printFunctionName`,`theme`]),Y=Symbol(`delegate`),X=/^((HTML|SVG)\w*)?Element$/,Z=/* @__PURE__ */ new WeakMap;function isCustomElement(e){let{tagName:t}=e;return!!(typeof t==`string`&&t.includes(`-`)||typeof e.hasAttribute==`function`&&e.hasAttribute(`is`))}function pluginHandles(e){let t=e.node,i=t.constructor,o=i?.name;switch(e.type){case a:{if(!o&&!isCustomElement(t))return!1;if(typeof i!=`function`)return X.test(o)||isCustomElement(t);let e=Z.get(i);return e===void 0&&Z.set(i,e=X.test(o)),e||isCustomElement(t)}case l:return o===`Text`;case n:return o===`Comment`;case r:return o===`DocumentFragment`}return!1}function escapeHTML(e){return e.indexOf(`<`)===-1&&e.indexOf(`>`)===-1?e:e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function printString(e,t){return t.escapeString?`"`+e.replace(/"|\\/g,`\\$&`)+`"`:`"`+e+`"`}function keepChild(e,t){return t.filterNode===null?e.type===n?!1:e.type===a?t.scriptStyleIgnore?e.name!==`script`&&e.name!==`style`:!matchesSelector(e,t.defaultIgnore):!0:!!t.filterNode(e.node)}function tagNameLower(e){return e.node.tagName.toLowerCase()}function printProps(e,t,n){let r=e.attrs;if(r===null||r.length===0)return``;let i=[],a=/* @__PURE__ */ new Map;for(let n=0;n<r.length;n++)t.compact&&isNoiseAttribute(e,r[n].name)||(i.push(r[n].name),a.set(r[n].name,r[n].value));i.sort();let o=``;for(let e=0;e<i.length;e++)o+=printProp(i[e],printString(a.get(i[e]),t),t,n);return o}function printProp(e,t,n,r){let i=n.colors;return n.spacingInner+r+i.prop.open+e+i.prop.close+`=`+i.value.open+t+i.value.close}function printText(e,t){return t.colors.content.open+escapeHTML(e)+t.colors.content.close}function printComment(e,t){return t.colors.comment.open+`<!--`+escapeHTML(e)+`-->`+t.colors.comment.close}function printElementAsLeaf(e,t){let n=t.colors.tag;return n.open+`<`+e+n.close+` …`+n.open+` />`+n.close}function isNoiseAttribute(e,t){return t===`class`||t===`style`||e.ns===s&&t!==`role`&&t!==`id`&&!t.startsWith(`aria-`)&&!t.startsWith(`data-`)}function printChildren(e,t,n,r){if(t.compact&&e.ns===s&&e.name===`svg`)return``;let i=``;for(let a=e.first;a!==null;a=a.next)keepChild(a,t)&&(t.compact&&a.type===l&&a.data.trim()===``||(i+=t.spacingOuter+n+printNode(a,t,n,r)));return i}function printElement(e,t,n,r,i){let a=r.colors.tag;return a.open+`<`+e+(t&&a.close+t+r.spacingOuter+i+a.open)+(n?`>`+a.close+n+r.spacingOuter+i+a.open+`</`+e:(t&&!r.min?``:` `)+`/`)+`>`+a.close}function printNode(e,t,i,a){if(!pluginHandles(e))throw Y;if(e.type===l)return printText(t.compact&&e.data.length>200?e.data.slice(0,199)+`…`:e.data,t);if(e.type===n)return printComment(e.data,t);let o=e.type===r?`DocumentFragment`:tagNameLower(e);if(++a>t.maxDepth)return printElementAsLeaf(o,t);let s=i+t.indent;return printElement(o,e.type===r?``:printProps(e,t,s),printChildren(e,t,s,a),t,i)}function printForeignNode(e,t,i,a,o){if(!foreignHandles(e))throw Y;if(e.nodeType===l)return printText(e.data,t);if(e.nodeType===n)return printComment(e.data,t);let s=e.nodeType===r,c=s?`DocumentFragment`:e.tagName.toLowerCase();if(++o>t.maxDepth)return printElementAsLeaf(c,t);let u=a+t.indent,d=``;if(!s){let n=Array.from(e.attributes);n.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name));for(let{name:e,value:r}of n)d+=printProp(e,printString(r,t),t,u)}let f=``,p=e.childNodes||e.children;for(let e=0;e<p.length;e++)i(p[e])&&(f+=t.spacingOuter+u+printForeignNode(p[e],t,i,u,o));return printElement(c,d,f,t,a)}function foreignHandles(e){let t=e?.constructor?.name;if(!t&&!isCustomElement(e))return!1;switch(e.nodeType){case a:return X.test(t)||isCustomElement(e);case l:return t===`Text`;case n:return t===`Comment`;case r:return t===`DocumentFragment`}return!1}function makePrintConfig(e,t){for(let t of Object.keys(e))if(!J.has(t))throw Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw Error(`pretty-format: Options "min" and "indent" cannot be used together.`);if(e.theme!==void 0){if(e.theme===null)throw Error(`pretty-format: Option "theme" must not be null.`);if(typeof e.theme!=`object`)throw Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof e.theme}".`)}if(e.plugins!==void 0)return null;let n=!!e.min,r=e.indent===void 0?2:e.indent,i=getConfig().defaultIgnore;return{colors:e.highlight?e.theme===void 0?q:highlightColors(e.theme):W,escapeString:e.escapeString===void 0||e.escapeString,indent:n?``:Array(r+1).join(` `),maxDepth:e.maxDepth===void 0?1/0:e.maxDepth,min:n,spacingInner:n?` `:`
5
5
  `,spacingOuter:n?``:`
6
- `,filterNode:t,scriptStyleIgnore:i===`script, style`,defaultIgnore:i,compact:!1}}function formatDOM(e,n,r,i=!1){let a={printFunctionName:!1,highlight:shouldHighlight(),...r},o=n??filterCommentsAndDefaultIgnoreTagsTags,s=makePrintConfig(a,n===void 0?null:n);if(s===null)return formatWithPrettyFormat(e,o,a,`The "plugins" option of prettyDOM`);s.compact=i;let c=e[t];try{return c===void 0?printForeignNode(e,s,o,``,0):printNode(c,s,``,0)}catch(e){if(e!==Y)throw e}return formatWithPrettyFormat(e,o,a,`Printing a node other than an element, text, comment or fragment`)}function formatWithPrettyFormat(e,t,n,r=`pretty-format's own printing`){let i=loadPrettyFormat(r);return i.format(e,{plugins:[createDOMElementFilter(t),i.plugins.DOMCollection],...n})}function prettyDOM(e,t,n={}){e||=getDocument().body;let r=typeof t==`number`?t:void 0;if(typeof t!=`number`&&(t=typeof process<`u`&&process.env!==void 0&&process.env.DEBUG_PRINT_LIMIT||7e3),t===0)return``;e.documentElement&&(e=e.documentElement);let i=typeof e;if(i===`object`?i=e.constructor.name:e={},!(`outerHTML`in e))throw TypeError(`Expected an element or document but got ${i}`);let a=n.format??envDebugFormat();if(a!==null||`format`in n){let{format:i,hidden:o,maxLines:s,maxTextLength:c,collapseAfter:l,urls:u,...d}=n;if(a===`aria`){let t=ariaSnapshot(e,{hidden:o,maxLines:s,maxTextLength:c,collapseAfter:l,urls:u});return r!==void 0&&t.length>r?`${t.slice(0,r)}...`:t}if(n=d,a===`compact`){let{filterNode:r,...i}={highlight:!1,...n},a=formatDOM(e,r,i,!0);return a.length>t?`${a.slice(0,t)}...`:a}}let{filterNode:o,...s}=n,c=formatDOM(e,o,s);return t!==void 0&&outerHTMLLength(e)>t?`${c.slice(0,t)}...`:c}function outerHTMLLength(e){let n=e[t];return n!==void 0&&n.type===a?p(n).length:e.outerHTML.length}const logDOM=(...e)=>{let t=getUserCodeFrame();console.log(t?`${prettyDOM(...e)}\n\n${t}`:prettyDOM(...e))};function createDOMElementFilter(e){let printPropsPF=(e,t,n,r,i,a,o)=>{let s=r+n.indent,c=n.colors;return e.map(e=>{let l=t[e],u=o(l,n,s,i,a);return typeof l!=`string`&&(u.indexOf(`
7
- `)!==-1&&(u=n.spacingOuter+s+u+n.spacingOuter+r),u=`{`+u+`}`),n.spacingInner+r+c.prop.open+e+c.prop.close+`=`+c.value.open+u+c.value.close}).join(``)},printText=(e,t)=>t.colors.content.open+escapeHTML(e)+t.colors.content.close,printChildrenPF=(e,t,n,r,i,a)=>e.map(e=>{let o=typeof e==`string`?printText(e,t):a(e,t,n,r,i);return o===``&&typeof e==`object`&&e&&e.nodeType!==l?``:t.spacingOuter+n+o}).join(``),testNode=e=>{let t=e.constructor.name,{nodeType:i}=e;return i===a&&(X.test(t)||isCustomElement(e))||i===l&&t===`Text`||i===n&&t===`Comment`||i===r&&t===`DocumentFragment`};return{test:e=>(e?.constructor?.name||isCustomElement(e))&&testNode(e),serialize:(t,i,a,o,s,c)=>{if(t.nodeType===l)return printText(t.data,i);if(t.nodeType===n){let e=i.colors.comment;return e.open+`<!--`+escapeHTML(t.data)+`-->`+e.close}let u=t.nodeType===r,d=u?`DocumentFragment`:t.tagName.toLowerCase();if(++o>i.maxDepth){let e=i.colors.tag;return e.open+`<`+d+e.close+` …`+e.open+` />`+e.close}return printElement(d,printPropsPF(u?[]:Array.from(t.attributes).map(e=>e.name).sort(),u?{}:Array.from(t.attributes).reduce((e,t)=>(e[t.name]=t.value,e),{}),i,a+i.indent,o,s,c),printChildrenPF(Array.prototype.slice.call(t.childNodes||t.children).filter(e),i,a+i.indent,o,s,c),i,a)}}}let Q={testIdAttribute:`data-testid`,asyncUtilTimeout:1e3,asyncWrapper:e=>e(),unstable_advanceTimersWrapper:e=>e(),eventWrapper:e=>e(),defaultHidden:!1,defaultIgnore:`script, style`,showOriginalStackTrace:!1,throwSuggestions:!1,getElementError(e,t){let n=envDebugFormat();if(n!==null){let r=Error([e,agentErrorContext(t,n,prettyDOM)].filter(Boolean).join(`
6
+ `,filterNode:t,scriptStyleIgnore:i===`script, style`,defaultIgnore:i,compact:!1}}function formatDOM(e,n,r,i=!1){let a={printFunctionName:!1,highlight:shouldHighlight(),...r},o=n??filterCommentsAndDefaultIgnoreTagsTags,s=makePrintConfig(a,n===void 0?null:n);if(s===null)return formatWithPrettyFormat(e,o,a,`The "plugins" option of prettyDOM`);s.compact=i;let c=e[t];try{return c===void 0?printForeignNode(e,s,o,``,0):printNode(c,s,``,0)}catch(e){if(e!==Y)throw e}return formatWithPrettyFormat(e,o,a,`Printing a node other than an element, text, comment or fragment`)}function formatWithPrettyFormat(e,t,n,r=`pretty-format's own printing`){let i=loadPrettyFormat(r);return i.format(e,{plugins:[createDOMElementFilter(t),i.plugins.DOMCollection],...n})}function prettyDOM(e,t,n={}){e||=getDocument().body;let r=typeof t==`number`?t:void 0;if(typeof t!=`number`&&(t=typeof process<`u`&&process.env!==void 0&&process.env.DEBUG_PRINT_LIMIT||7e3),t===0)return``;e.documentElement&&(e=e.documentElement);let i=typeof e;if(i===`object`?i=e.constructor.name:e={},!(`outerHTML`in e))throw TypeError(`Expected an element or document but got ${i}`);let a=n.format??envDebugFormat();if(a!==null||`format`in n){let{format:i,hidden:o,maxLines:s,maxTextLength:c,collapseAfter:l,urls:u,...d}=n;if(a===`aria`){let t=ariaSnapshot(e,{hidden:o,maxLines:s,maxTextLength:c,collapseAfter:l,urls:u});return r!==void 0&&t.length>r?`${t.slice(0,r)}...`:t}if(n=d,a===`compact`){let{filterNode:r,...i}={highlight:!1,...n},a=formatDOM(e,r,i,!0);return a.length>t?`${a.slice(0,t)}...`:a}}let{filterNode:o,...s}=n,c=formatDOM(e,o,s);return t!==void 0&&outerHTMLLength(e)>t?`${c.slice(0,t)}...`:c}function outerHTMLLength(e){let n=e[t];return n!==void 0&&n.type===a?p(n).length:e.outerHTML.length}const logDOM=(...e)=>{let t=getUserCodeFrame();console.log(t?`${prettyDOM(...e)}\n\n${t}`:prettyDOM(...e))};function createDOMElementFilter(e){let printPropsPF=(e,t,n,r,i,a,o)=>{let s=r+n.indent;return e.map(e=>{let c=t[e],l=o(c,n,s,i,a);return typeof c!=`string`&&(l.indexOf(`
7
+ `)!==-1&&(l=n.spacingOuter+s+l+n.spacingOuter+r),l=`{`+l+`}`),printProp(e,l,n,r)}).join(``)},printChildrenPF=(e,t,n,r,i,a)=>e.map(e=>{let o=typeof e==`string`?printText(e,t):a(e,t,n,r,i);return o===``&&typeof e==`object`&&e&&e.nodeType!==l?``:t.spacingOuter+n+o}).join(``),testNode=e=>{let t=e.constructor.name,{nodeType:i}=e;return i===a&&(X.test(t)||isCustomElement(e))||i===l&&t===`Text`||i===n&&t===`Comment`||i===r&&t===`DocumentFragment`};return{test:e=>(e?.constructor?.name||isCustomElement(e))&&testNode(e),serialize:(t,i,a,o,s,c)=>{if(t.nodeType===l)return printText(t.data,i);if(t.nodeType===n)return printComment(t.data,i);let u=t.nodeType===r,d=u?`DocumentFragment`:t.tagName.toLowerCase();return++o>i.maxDepth?printElementAsLeaf(d,i):printElement(d,printPropsPF(u?[]:Array.from(t.attributes).map(e=>e.name).sort(),u?{}:Array.from(t.attributes).reduce((e,t)=>(e[t.name]=t.value,e),{}),i,a+i.indent,o,s,c),printChildrenPF(Array.prototype.slice.call(t.childNodes||t.children).filter(e),i,a+i.indent,o,s,c),i,a)}}}let Q={testIdAttribute:`data-testid`,asyncUtilTimeout:1e3,asyncWrapper:e=>e(),unstable_advanceTimersWrapper:e=>e(),eventWrapper:e=>e(),defaultHidden:!1,defaultIgnore:`script, style`,showOriginalStackTrace:!1,throwSuggestions:!1,getElementError(e,t){let n=envDebugFormat();if(n!==null){let r=Error([e,agentErrorContext(t,n,prettyDOM)].filter(Boolean).join(`
8
8
 
9
9
  `));return r.name=`TestingLibraryElementError`,r}if($)return lazyElementError(e,t,Q.defaultIgnore);let r=prettyDOM(t),i=Error([e,`Ignored nodes: comments, ${Q.defaultIgnore}\n${r}`].filter(Boolean).join(`
10
10
 
@@ -13,4 +13,4 @@ import{createRequire as e}from"node:module";import{$impl as t,COMMENT_NODE as n,
13
13
  `)),set:settle,enumerable:!1,configurable:!0}),r}function runWithExpensiveErrorDiagnosticsDisabled(e,t=!1){let n=$;try{return Q._disableExpensiveErrorDiagnostics=!0,$=t,e()}finally{Q._disableExpensiveErrorDiagnostics=!1,$=n}}function configure(e){typeof e==`function`&&(e=e(Q)),Q={...Q,...e}}function getConfig(){return Q}function diffAriaSnapshots(e,t){let n=diffLines(e.split(`
14
14
  `),t.split(`
15
15
  `)),r=new Uint8Array(n.length),i=!1;for(let e=0;e<n.length;e++){if(n[e].kind===`=`)continue;i=!0,r[e]=1;let t=indentOf(n[e].text);for(let i=e-1;i>=0&&t>0;i--){if(n[i].kind!==`=`)continue;let e=indentOf(n[i].text);e<t&&(r[i]=1,t=e)}}if(!i)return`(no changes)`;let a=[],o=-1;for(let e=0;e<n.length;e++)r[e]!==0&&(o!==-1&&e!==o+1&&a.push(` …`),a.push(`${n[e].kind===`=`?` `:n[e].kind} ${n[e].text}`),o=e);return a.join(`
16
- `)}function indentOf(e){let t=0;for(;t<e.length&&e.charCodeAt(t)===32;)t++;return t}function diffLines(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;let r=e.length,i=t.length;for(;r>n&&i>n&&e[r-1]===t[i-1];)r--,i--;let a=[];for(let t=0;t<n;t++)a.push({kind:`=`,text:e[t]});let o=r-n,s=i-n;if(o*s>4e6){for(let t=n;t<r;t++)a.push({kind:`-`,text:e[t]});for(let e=n;e<i;e++)a.push({kind:`+`,text:t[e]})}else{let r=s+1,i=new Uint32Array((o+1)*r);for(let a=o-1;a>=0;a--)for(let o=s-1;o>=0;o--)i[a*r+o]=e[n+a]===t[n+o]?i[(a+1)*r+o+1]+1:Math.max(i[(a+1)*r+o],i[a*r+o+1]);let c=0,l=0;for(;c<o||l<s;)c<o&&l<s&&e[n+c]===t[n+l]?(a.push({kind:`=`,text:e[n+c]}),c++,l++):c<o&&(l===s||i[(c+1)*r+l]>=i[c*r+l+1])?(a.push({kind:`-`,text:e[n+c]}),c++):(a.push({kind:`+`,text:t[n+l]}),l++)}for(let t=r;t<e.length;t++)a.push({kind:`=`,text:e[t]});return a}export{implOf as A,agentElementSummary as C,checkContainerType as D,advanceFakeTimersByTime as E,__name as M,getDocument as O,yamlValue as S,matchesSelector as T,nodeKey as _,runWithExpensiveErrorDiagnosticsDisabled as a,resetBodySnapshot as b,H as c,ariaSnapshotTree as d,budgetLines as f,lastBodySnapshot as g,hiddenReason as h,getConfig as i,jestFakeTimersAreEnabled as j,getWindowFromNode as k,ariaSnapshot as l,envMaxLines as m,diffLines as n,logDOM as o,describeElement as p,configure as r,prettyDOM as s,diffAriaSnapshots as t,ariaSnapshotLines as u,nodeProps as v,envDebugFormat as w,truncate as x,quote as y};
16
+ `)}function indentOf(e){let t=0;for(;t<e.length&&e.charCodeAt(t)===32;)t++;return t}function diffLines(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;let r=e.length,i=t.length;for(;r>n&&i>n&&e[r-1]===t[i-1];)r--,i--;let a=[];for(let t=0;t<n;t++)a.push({kind:`=`,text:e[t]});let o=r-n,s=i-n;if(o*s>4e6){for(let t=n;t<r;t++)a.push({kind:`-`,text:e[t]});for(let e=n;e<i;e++)a.push({kind:`+`,text:t[e]})}else{let r=s+1,i=new Uint32Array((o+1)*r);for(let a=o-1;a>=0;a--)for(let o=s-1;o>=0;o--)i[a*r+o]=e[n+a]===t[n+o]?i[(a+1)*r+o+1]+1:Math.max(i[(a+1)*r+o],i[a*r+o+1]);let c=0,l=0;for(;c<o||l<s;)c<o&&l<s&&e[n+c]===t[n+l]?(a.push({kind:`=`,text:e[n+c]}),c++,l++):c<o&&(l===s||i[(c+1)*r+l]>=i[c*r+l+1])?(a.push({kind:`-`,text:e[n+c]}),c++):(a.push({kind:`+`,text:t[n+l]}),l++)}for(let t=r;t<e.length;t++)a.push({kind:`=`,text:e[t]});return a}export{getWindowFromNode as A,agentElementSummary as C,advanceFakeTimersByTime as D,P as E,jestFakeTimersAreEnabled as M,__name as N,checkContainerType as O,yamlValue as S,matchesSelector as T,nodeKey as _,runWithExpensiveErrorDiagnosticsDisabled as a,resetBodySnapshot as b,H as c,ariaSnapshotTree as d,budgetLines as f,lastBodySnapshot as g,hiddenReason as h,getConfig as i,implOf as j,getDocument as k,ariaSnapshot as l,envMaxLines as m,diffLines as n,logDOM as o,describeElement as p,configure as r,prettyDOM as s,diffAriaSnapshots as t,ariaSnapshotLines as u,nodeProps as v,envDebugFormat as w,truncate as x,quote as y};
@@ -1,6 +1,6 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-B95LLutl.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria");var AriaTemplateError=class extends Error{constructor(e,t,n,r=-1){super(`${e} (template line ${t+1}):\n\n${n}${r>=0?`\n${` `.repeat(r)}^`:``}`),this.name=`AriaTemplateError`}};function normalizeWhitespace(e){return e.replace(/[​­]/g,``).replace(/[\r\n\s\t]+/g,` `).trim()}function textValue(e){let t=null;if(e.length>1&&e.startsWith(`/`)&&e.endsWith(`/`))try{t=new RegExp(e.slice(1,-1))}catch{t=null}return{raw:e,normalized:normalizeWhitespace(e),regex:t}}const r=/* @__PURE__ */ new Set([`disabled`,`expanded`,`active`,`selected`,`busy`,`hidden`]);function parseAriaTemplate(e){let t=e.split(/\r?\n/),n=1/0;for(let e=0;e<t.length;e++){let r=t[e],i=r.trim();if(i===``||i.startsWith(`#`))continue;let a=r.length-r.trimStart().length;if(r.slice(0,a).includes(` `))throw new AriaTemplateError(`Tabs cannot be used for indentation`,e,r);a<n&&(n=a)}let r={kind:`role`,role:`fragment`,name:null,attrs:[],url:null,mode:null,children:[]};if(n===1/0)throw new AriaTemplateError(`The aria snapshot template is empty`,0,e);let i=[{indent:-1,node:r,line:-1}];for(let e=0;e<t.length;e++){let r=t[e],a=r.trim();if(a===``||a.startsWith(`#`))continue;let o=r.length-r.trimStart().length-n;if(a!==`-`&&!a.startsWith(`- `))throw new AriaTemplateError(`Aria snapshot must be a YAML sequence, elements starting with "-"`,e,r,o+n);for(;i[i.length-1].indent>=o;)i.pop();let s=i[i.length-1];if(s.node===null)throw new AriaTemplateError(`"- text:" on line ${s.line+1} cannot have children`,e,r,o+n);let c=a.slice(2).trimStart(),l=r.length-c.length,u=parseItem(c,s.node,e,r,l);u!==void 0&&i.push({indent:o,node:u,line:e})}return r.children.length===1&&(r.mode===null||r.mode===`contain`)&&r.url===null?r.children[0]:r}function parseItem(e,t,n,r,i){let fail=(e,t)=>{throw new AriaTemplateError(e,n,r,i+t)};if(e===``&&fail(`Empty sequence item`,0),e.startsWith(`/`)){let n=e.indexOf(`:`);n<0&&fail("Property should be written `/name: value`",e.length);let r=e.slice(1,n).trim(),i=parseScalar(e.slice(n+1),fail,n+1);r===`children`?(i!==`contain`&&i!==`equal`&&i!==`deep-equal`&&fail(`Value of "/children" should be "contain", "equal" or "deep-equal"`,n+1),t.mode=i):r===`url`&&(t.url=textValue(i));return}let a,o=null;try{if(e[0]===`"`||e[0]===`'`){let[n,r]=readQuoted(e,0,fail),i=e.slice(r).trimStart();if(i!==``&&i[0]!==`:`&&fail(`Unexpected input after the quoted key`,r),i!==``&&(o=i.slice(1)),n===`text`&&o!==null)return textItem(t,o,fail,e.length-o.length);a=new KeyParser(n).parse(!1)}else{if(/^text:(\s|$)/.test(e))return textItem(t,e.slice(5),fail,5);let n=new KeyParser(e);a=n.parse(!0),n.pos<e.length&&(o=e.slice(n.pos+1))}}catch(t){throw t instanceof KeyError&&fail(t.message,e[0]===`"`||e[0]===`'`?0:t.pos),t}return o!==null&&o.trim()!==``&&a.children.push({kind:`text`,text:textValue(parseScalar(o,fail,e.length-o.length))}),t.children.push(a),a}function textItem(e,t,n,r){return e.children.push({kind:`text`,text:textValue(parseScalar(t,n,r))}),null}function parseScalar(e,t,n){let r=e.length-e.trimStart().length,i=e.trim();if(i[0]===`"`||i[0]===`'`){let[e,a]=readQuoted(i,0,(e,i)=>t(e,n+r+i)),o=i.slice(a).trim();return o!==``&&!o.startsWith(`#`)&&t(`Unexpected input after the quoted value`,n+r+a),e}(i===`|`||i===`>`||i.startsWith(`|`)||i.startsWith(`>`))&&t(`Block scalars are not supported in aria snapshot templates`,n+r);let a=i.search(/\s#/);return a>=0?i.slice(0,a).trim():i}function readQuoted(e,t,n){let r=e[t],i=``;for(let n=t+1;n<e.length;n++){let t=e[n];if(r===`'`){if(t===`'`){if(e[n+1]===`'`){i+=`'`,n++;continue}return[i,n+1]}i+=t}else{if(t===`"`)return[i,n+1];if(t===`\\`){let t=e[++n];t===`n`?i+=`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-DKpjI9CA.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria");var AriaTemplateError=class extends Error{constructor(e,t,n,r=-1){super(`${e} (template line ${t+1}):\n\n${n}${r>=0?`\n${` `.repeat(r)}^`:``}`),this.name=`AriaTemplateError`}};function normalizeWhitespace(e){return e.replace(/[​­]/g,``).replace(/[\r\n\s\t]+/g,` `).trim()}function textValue(e){let t=null;if(e.length>1&&e.startsWith(`/`)&&e.endsWith(`/`))try{t=new RegExp(e.slice(1,-1))}catch{t=null}return{raw:e,normalized:normalizeWhitespace(e),regex:t}}const r=/* @__PURE__ */ new Set([`disabled`,`expanded`,`active`,`selected`,`busy`,`hidden`]);function parseAriaTemplate(e){let t=e.split(/\r?\n/),n=1/0;for(let e=0;e<t.length;e++){let r=t[e],i=r.trim();if(i===``||i.startsWith(`#`))continue;let a=r.length-r.trimStart().length;if(r.slice(0,a).includes(` `))throw new AriaTemplateError(`Tabs cannot be used for indentation`,e,r);a<n&&(n=a)}let r={kind:`role`,role:`fragment`,name:null,attrs:[],url:null,mode:null,children:[]};if(n===1/0)throw new AriaTemplateError(`The aria snapshot template is empty`,0,e);let i=[{indent:-1,node:r,line:-1}];for(let e=0;e<t.length;e++){let r=t[e],a=r.trim();if(a===``||a.startsWith(`#`))continue;let o=r.length-r.trimStart().length-n;if(a!==`-`&&!a.startsWith(`- `))throw new AriaTemplateError(`Aria snapshot must be a YAML sequence, elements starting with "-"`,e,r,o+n);for(;i[i.length-1].indent>=o;)i.pop();let s=i[i.length-1];if(s.node===null)throw new AriaTemplateError(`"- text:" on line ${s.line+1} cannot have children`,e,r,o+n);let c=a.slice(2).trimStart(),l=r.length-c.length,u=parseItem(c,s.node,e,r,l);u!==void 0&&i.push({indent:o,node:u,line:e})}return r.children.length===1&&(r.mode===null||r.mode===`contain`)&&r.url===null?r.children[0]:r}function parseItem(e,t,n,r,i){let fail=(e,t)=>{throw new AriaTemplateError(e,n,r,i+t)};if(e===``&&fail(`Empty sequence item`,0),e.startsWith(`/`)){let n=e.indexOf(`:`);n<0&&fail("Property should be written `/name: value`",e.length);let r=e.slice(1,n).trim(),i=parseScalar(e.slice(n+1),fail,n+1);r===`children`?(i!==`contain`&&i!==`equal`&&i!==`deep-equal`&&fail(`Value of "/children" should be "contain", "equal" or "deep-equal"`,n+1),t.mode=i):r===`url`&&(t.url=textValue(i));return}let a,o=null;try{if(e[0]===`"`||e[0]===`'`){let[n,r]=readQuoted(e,0,fail),i=e.slice(r).trimStart();if(i!==``&&i[0]!==`:`&&fail(`Unexpected input after the quoted key`,r),i!==``&&(o=i.slice(1)),n===`text`&&o!==null)return textItem(t,o,fail,e.length-o.length);a=new KeyParser(n).parse(!1)}else{if(/^text:(\s|$)/.test(e))return textItem(t,e.slice(5),fail,5);let n=new KeyParser(e);a=n.parse(!0),n.pos<e.length&&(o=e.slice(n.pos+1))}}catch(t){throw t instanceof KeyError&&fail(t.message,e[0]===`"`||e[0]===`'`?0:t.pos),t}return o!==null&&o.trim()!==``&&a.children.push({kind:`text`,text:textValue(parseScalar(o,fail,e.length-o.length))}),t.children.push(a),a}function textItem(e,t,n,r){return e.children.push({kind:`text`,text:textValue(parseScalar(t,n,r))}),null}function parseScalar(e,t,n){let r=e.length-e.trimStart().length,i=e.trim();if(i[0]===`"`||i[0]===`'`){let[e,a]=readQuoted(i,0,(e,i)=>t(e,n+r+i)),o=i.slice(a).trim();return o!==``&&!o.startsWith(`#`)&&t(`Unexpected input after the quoted value`,n+r+a),e}(i===`|`||i===`>`||i.startsWith(`|`)||i.startsWith(`>`))&&t(`Block scalars are not supported in aria snapshot templates`,n+r);let a=i.search(/\s#/);return a>=0?i.slice(0,a).trim():i}function readQuoted(e,t,n){let r=e[t],i=``;for(let n=t+1;n<e.length;n++){let t=e[n];if(r===`'`){if(t===`'`){if(e[n+1]===`'`){i+=`'`,n++;continue}return[i,n+1]}i+=t}else{if(t===`"`)return[i,n+1];if(t===`\\`){let t=e[++n];t===`n`?i+=`
2
2
  `:t===`t`?i+=` `:t===`u`?(i+=String.fromCharCode(parseInt(e.slice(n+1,n+5),16)),n+=4):i+=t??``}else i+=t}}return n(`Unterminated string`,e.length)}var KeyError=class extends Error{pos;constructor(e,t){super(e),this.pos=t}},KeyParser=class{pos=0;input;constructor(e){this.input=e}peek(){return this.input[this.pos]??``}eof(){return this.pos>=this.input.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}atColon(){return this.peek()===`:`&&(this.pos+1>=this.input.length||/\s/.test(this.input[this.pos+1]))}readIdentifier(e){if(this.eof())throw new KeyError(`Unexpected end of input when expecting ${e}`,this.pos);let t=this.pos;for(;!this.eof()&&/[a-zA-Z]/.test(this.peek());)this.pos++;if(this.pos===t)throw new KeyError(`Expected ${e}`,this.pos);return this.input.slice(t,this.pos)}readString(){let e=``;for(;!this.eof();){let t=this.input[this.pos++];if(t===`\\`){let t=this.input[this.pos++]??``;t===`n`?e+=`
3
- `:t===`t`?e+=` `:t===`u`?(e+=String.fromCharCode(parseInt(this.input.slice(this.pos,this.pos+4),16)),this.pos+=4):e+=t}else if(t===`"`)return e;else e+=t}throw new KeyError(`Unterminated string`,this.pos)}readRegex(){let e=this.pos,t=``,n=!1,r=!1;for(;!this.eof();){let i=this.input[this.pos++];if(n)t+=i,n=!1;else if(i===`\\`)n=!0,t+=i;else if(i===`/`&&!r)try{return new RegExp(t)}catch(t){throw new KeyError(`Invalid regular expression: ${t.message}`,e)}else i===`[`?(r=!0,t+=i):i===`]`&&r?(t+=i,r=!1):t+=i}throw new KeyError(`Unterminated regex`,this.pos)}parse(e){this.skipWhitespace();let t=this.readIdentifier(`role`);this.skipWhitespace();let n=null;this.peek()===`"`?(this.pos++,n=normalizeWhitespace(this.readString())):this.peek()===`/`&&(this.pos++,n=this.readRegex());let r={kind:`role`,role:t,name:n===``?null:n,attrs:[],url:null,mode:null,children:[]};for(;this.skipWhitespace(),this.peek()===`[`;){this.pos++,this.skipWhitespace();let e=this.pos,t=this.readIdentifier(`attribute`);this.skipWhitespace();let n=``;if(this.peek()===`=`)for(this.pos++,this.skipWhitespace();this.peek()!==`]`&&!/\s/.test(this.peek())&&!this.eof();)n+=this.input[this.pos++];if(this.skipWhitespace(),this.peek()!==`]`)throw new KeyError(`Expected ]`,this.pos);this.pos++,r.attrs.push([t,checkAttribute(t,n||`true`,e)])}if(this.skipWhitespace(),e&&this.atColon())return r;if(!this.eof())throw new KeyError(e?`Unexpected input (a key ends with ":" and a space)`:`Unexpected input`,this.pos);return r}};function checkAttribute(e,t,n){if(e===`checked`||e===`pressed`){if(t!==`true`&&t!==`false`&&t!==`mixed`)throw new KeyError(`Value of "${e}" attribute must be a boolean or "mixed"`,n);return t}if(r.has(e)){if(t!==`true`&&t!==`false`)throw new KeyError(`Value of "${e}" attribute must be a boolean`,n);return t}if(e===`level`){if(Number.isNaN(Number(t)))throw new KeyError(`Value of "level" attribute must be a number`,n);return String(Number(t))}if(e===`current`)return t;throw new KeyError(`Unsupported attribute [${e}]`,n)}function toMatchNode(e){let t=[];e.value!==null&&e.value!==``&&t.push(normalizeWhitespace(e.value));for(let n=0;n<e.children.length;n++){let r=e.children[n];t.push(typeof r==`string`?normalizeWhitespace(r):toMatchNode(r))}let n=/* @__PURE__ */ new Map;for(let t=0;t<e.props.length;t++){let r=e.props[t].slice(1,-1),i=r.indexOf(`=`);i<0?n.set(r,`true`):n.set(r.slice(0,i),r.slice(i+1))}return{role:e.role,name:normalizeWhitespace(e.name),states:n,url:e.url,children:t,props:e.props}}function stateOf(e,t){let r=e.states.get(t);if(r!==void 0)return r;switch(t){case`checked`:return(0,n.roleSupportsProp)(e.role,`aria-checked`)?`false`:void 0;case`disabled`:case`selected`:case`active`:case`busy`:case`hidden`:case`current`:return`false`}}function attrsMatch(e,t){for(let n=0;n<t.attrs.length;n++){let[r,i]=t.attrs[n],a=stateOf(e,r);if(r===`current`&&i===`true`){if(a===void 0||a===`false`)return!1}else if(a!==i)return!1}return!0}function matchesName(e,t){return t===null?!0:e===``?!1:typeof t==`string`?e===t:t.test(e)}function matchesText(e,t){return t===null||t.normalized===``?!0:e?e===t.normalized||e===t.raw||t.regex!==null&&t.regex.test(e):!1}function headerMatches(e,t){return(t.role===`fragment`||t.role===e.role)&&attrsMatch(e,t)&&matchesName(e.name,t.name)&&matchesText(e.url,t.url)}function matchesNode(e,t,n){return typeof e==`string`?t.kind===`text`&&matchesText(e,t.text):t.kind!==`role`||!headerMatches(e,t)?!1:t.mode===`contain`?containsList(e.children,t.children):t.mode===`equal`?listEqual(e.children,t.children,!1):t.mode===`deep-equal`||n?listEqual(e.children,t.children,!0):containsList(e.children,t.children)}function listEqual(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!matchesNode(e[r],t[r],n))return!1;return!0}function containsList(e,t){if(t.length>e.length)return!1;let n=0;for(let r=0;r<t.length;r++){for(;n<e.length&&!matchesNode(e[n],t[r],!1);)n++;if(n===e.length)return!1;n++}return!0}function matchesDeep(e,t){if(matchesNode(e,t,!1))return!0;if(typeof e==`string`)return!1;for(let n=0;n<e.children.length;n++)if(matchesDeep(e.children[n],t))return!0;return!1}function textRepr(t){return t.regex===null?e.S(t.normalized):t.raw}function templateKey(t){let n=t.role;typeof t.name==`string`?n+=` `+e.y(t.name):t.name!==null&&(n+=` /${t.name.source}/`);for(let e=0;e<t.attrs.length;e++)n+=t.attrs[e][1]===`true`?` [${t.attrs[e][0]}]`:` [${t.attrs[e][0]}=${t.attrs[e][1]}]`;return n}function receivedKey(t){let n=t.role;t.name!==``&&(n+=` `+e.y(e.x(t.name,100)));for(let e=0;e<t.props.length;e++)n+=` `+t.props[e];return n}function isInline(e){return e.url===null&&e.mode===null&&e.children.length===1&&e.children[0].kind===`text`}function renderTemplate(e,t,n){if(e.kind===`text`){n.push(`${t}- text: ${textRepr(e.text)}`);return}let r=templateKey(e);if(isInline(e)){n.push(`${t}- ${r}: ${textRepr(e.children[0].text)}`);return}if(e.children.length===0&&e.url===null&&e.mode===null){n.push(`${t}- ${r}`);return}n.push(`${t}- ${r}:`);let i=t+` `;e.url!==null&&n.push(`${i}- /url: ${textRepr(e.url)}`),e.mode!==null&&n.push(`${i}- /children: ${e.mode}`);for(let t=0;t<e.children.length;t++)renderTemplate(e.children[t],i,n)}var Scorer=class{memo=/* @__PURE__ */ new Map;score(e,t){if(e.kind===`text`)return typeof t==`string`?matchesText(t,e.text)?3:1:0;if(typeof t==`string`||e.role!==`fragment`&&e.role!==t.role)return 0;let n=this.memo.get(e);n===void 0&&this.memo.set(e,n=/* @__PURE__ */ new Map);let r=n.get(t);if(r!==void 0)return r;let i=2;return i+=e.name===null?1:matchesName(t.name,e.name)?2:0,attrsMatch(t,e)&&(i+=1),e.url!==null&&matchesText(t.url,e.url)&&(i+=1),i+=this.scoreList(e.children,t.children),n.set(t,i),i}scoreList(e,t){let n=this.align(e,t),r=0;for(let t=0;t<e.length;t++)n[t]!==null&&(r+=this.score(e[t],n[t]));return r}align(e,t){let n=[],r=0;for(let i=0;i<e.length;i++){let a=-1,o=0;for(let n=r;n<t.length;n++){let r=this.score(e[i],t[n]);r>o&&(a=n,o=r)}a<0?n.push(null):(n.push(t[a]),r=a+1)}return n}project(t,n,r,i){if(t.kind===`text`){let a=n;i.push(`${r}- text: ${matchesText(a,t.text)?textRepr(t.text):e.S(e.x(a,100))}`);return}let a=n,o=headerMatches(a,t)?templateKey(t):receivedKey(a),s=this.align(t.children,a.children);if(isInline(t)){let n=s[0],a=t.children[0].text;i.push(n===null?`${r}- ${o}`:`${r}- ${o}: ${matchesText(n,a)?textRepr(a):e.S(e.x(n,100))}`);return}if(t.children.length===0&&t.url===null&&t.mode===null){i.push(`${r}- ${o}`);return}i.push(`${r}- ${o}:`);let c=r+` `;t.url!==null&&i.push(`${c}- /url: ${matchesText(a.url,t.url)?textRepr(t.url):e.S(a.url??``)}`),t.mode!==null&&i.push(`${c}- /children: ${t.mode}`);for(let e=0;e<t.children.length;e++)s[e]!==null&&this.project(t.children[e],s[e],c,i)}};function forEachNode(e,t){t(e);for(let n=0;n<e.children.length;n++){let r=e.children[n];typeof r==`string`?t(r):forEachNode(r,t)}}function closestLines(e,t){let n=new Scorer,r=[];if(t.kind===`role`&&t.role===`fragment`){let i=null,a=0;if(forEachNode(e,e=>{if(typeof e==`string`)return;let r=n.scoreList(t.children,e.children);r>a&&(i=e,a=r)}),i!==null){let e=n.align(t.children,i.children);for(let i=0;i<t.children.length;i++)e[i]!==null&&n.project(t.children[i],e[i],``,r)}return r}let i=null,a=0;return forEachNode(e,e=>{let r=n.score(t,e);r>a&&(i=e,a=r)}),i!==null&&n.project(t,i,``,r),r}function pairChanges(e){let t=[];for(let n=0;n<e.length;){if(e[n].kind===`=`){t.push(e[n++]);continue}let r=n;for(;r<e.length&&e[r].kind===`-`;)r++;let i=r;for(;i<e.length&&e[i].kind===`+`;)i++;if(r-n===i-r)for(let i=0;i<r-n;i++)t.push(e[n+i],e[r+i]);else for(let r=n;r<i;r++)t.push(e[r]);n=i}return t}function matchAriaSnapshot(t,n){let r=parseAriaTemplate(n),i=e.d(t,{urls:!0}),a=[];for(let e=0;e<i.length;e++){let t=i[e];a.push(typeof t==`string`?normalizeWhitespace(t):toMatchNode(t))}let o={role:`fragment`,name:``,states:/* @__PURE__ */ new Map,url:null,children:a,props:[]},s=matchesDeep(o,r),expectedLines=()=>{let e=[];if(r.kind===`role`&&r.role===`fragment`){r.mode!==null&&e.push(`- /children: ${r.mode}`);for(let t=0;t<r.children.length;t++)renderTemplate(r.children[t],``,e)}else renderTemplate(r,``,e);return e};return{pass:s,expected:()=>expectedLines().join(`
3
+ `:t===`t`?e+=` `:t===`u`?(e+=String.fromCharCode(parseInt(this.input.slice(this.pos,this.pos+4),16)),this.pos+=4):e+=t}else if(t===`"`)return e;else e+=t}throw new KeyError(`Unterminated string`,this.pos)}readRegex(){let e=this.pos,t=``,n=!1,r=!1;for(;!this.eof();){let i=this.input[this.pos++];if(n)t+=i,n=!1;else if(i===`\\`)n=!0,t+=i;else if(i===`/`&&!r)try{return new RegExp(t)}catch(t){throw new KeyError(`Invalid regular expression: ${t.message}`,e)}else i===`[`?(r=!0,t+=i):i===`]`&&r?(t+=i,r=!1):t+=i}throw new KeyError(`Unterminated regex`,this.pos)}parse(e){this.skipWhitespace();let t=this.readIdentifier(`role`);this.skipWhitespace();let n=null;this.peek()===`"`?(this.pos++,n=normalizeWhitespace(this.readString())):this.peek()===`/`&&(this.pos++,n=this.readRegex());let r={kind:`role`,role:t,name:n===``?null:n,attrs:[],url:null,mode:null,children:[]};for(;this.skipWhitespace(),this.peek()===`[`;){this.pos++,this.skipWhitespace();let e=this.pos,t=this.readIdentifier(`attribute`);this.skipWhitespace();let n=``;if(this.peek()===`=`)for(this.pos++,this.skipWhitespace();this.peek()!==`]`&&!/\s/.test(this.peek())&&!this.eof();)n+=this.input[this.pos++];if(this.skipWhitespace(),this.peek()!==`]`)throw new KeyError(`Expected ]`,this.pos);this.pos++,r.attrs.push([t,checkAttribute(t,n||`true`,e)])}if(this.skipWhitespace(),e&&this.atColon())return r;if(!this.eof())throw new KeyError(e?`Unexpected input (a key ends with ":" and a space)`:`Unexpected input`,this.pos);return r}};function checkAttribute(e,t,n){if(e===`checked`||e===`pressed`){if(t!==`true`&&t!==`false`&&t!==`mixed`)throw new KeyError(`Value of "${e}" attribute must be a boolean or "mixed"`,n);return t}if(r.has(e)){if(t!==`true`&&t!==`false`)throw new KeyError(`Value of "${e}" attribute must be a boolean`,n);return t}if(e===`level`){if(Number.isNaN(Number(t)))throw new KeyError(`Value of "level" attribute must be a number`,n);return String(Number(t))}if(e===`current`)return t;throw new KeyError(`Unsupported attribute [${e}]`,n)}function toMatchNode(e){let t=[];e.value!==null&&e.value!==``&&t.push(normalizeWhitespace(e.value));for(let n=0;n<e.children.length;n++){let r=e.children[n];t.push(typeof r==`string`?normalizeWhitespace(r):toMatchNode(r))}let n=/* @__PURE__ */ new Map;for(let t=0;t<e.props.length;t++){let r=e.props[t].slice(1,-1),i=r.indexOf(`=`);i<0?n.set(r,`true`):n.set(r.slice(0,i),r.slice(i+1))}return{role:e.role,name:normalizeWhitespace(e.name),states:n,url:e.url,children:t,props:e.props}}function stateOf(e,t){let r=e.states.get(t);if(r!==void 0)return r;switch(t){case`checked`:return(0,n.roleSupportsProp)(e.role,`aria-checked`)?`false`:void 0;case`disabled`:case`selected`:case`active`:case`busy`:case`hidden`:case`current`:return`false`}}function attrsMatch(e,t){for(let n=0;n<t.attrs.length;n++){let[r,i]=t.attrs[n],a=stateOf(e,r);if(r===`current`&&i===`true`){if(a===void 0||a===`false`)return!1}else if(a!==i)return!1}return!0}function matchesName(e,t){return t===null?!0:e===``?!1:typeof t==`string`?e===t:t.test(e)}function matchesText(e,t){return t===null||t.normalized===``?!0:e?e===t.normalized||e===t.raw||t.regex!==null&&t.regex.test(e):!1}function headerMatches(e,t){return(t.role===`fragment`||t.role===e.role)&&attrsMatch(e,t)&&matchesName(e.name,t.name)&&matchesText(e.url,t.url)}function matchesNode(e,t,n){return typeof e==`string`?t.kind===`text`&&matchesText(e,t.text):t.kind!==`role`||!headerMatches(e,t)?!1:t.mode===`contain`?containsList(e.children,t.children):t.mode===`equal`?listEqual(e.children,t.children,!1):t.mode===`deep-equal`||n?listEqual(e.children,t.children,!0):containsList(e.children,t.children)}function listEqual(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!matchesNode(e[r],t[r],n))return!1;return!0}function containsList(e,t){if(t.length>e.length)return!1;let n=0;for(let r=0;r<t.length;r++){for(;n<e.length&&!matchesNode(e[n],t[r],!1);)n++;if(n===e.length)return!1;n++}return!0}function matchesDeep(e,t){if(matchesNode(e,t,!1))return!0;if(typeof e==`string`)return!1;for(let n=0;n<e.children.length;n++)if(matchesDeep(e.children[n],t))return!0;return!1}function textRepr(t){return t.regex===null?e.S(t.normalized):t.raw}function templateKey(t){let n=t.role;typeof t.name==`string`?n+=` `+e.y(t.name):t.name!==null&&(n+=` /${t.name.source}/`);for(let e=0;e<t.attrs.length;e++)n+=t.attrs[e][1]===`true`?` [${t.attrs[e][0]}]`:` [${t.attrs[e][0]}=${t.attrs[e][1]}]`;return n}function isInline(e){return e.url===null&&e.mode===null&&e.children.length===1&&e.children[0].kind===`text`}function renderTemplate(e,t,n){if(e.kind===`text`){n.push(`${t}- text: ${textRepr(e.text)}`);return}let r=templateKey(e);if(isInline(e)){n.push(`${t}- ${r}: ${textRepr(e.children[0].text)}`);return}if(e.children.length===0&&e.url===null&&e.mode===null){n.push(`${t}- ${r}`);return}n.push(`${t}- ${r}:`);let i=t+` `;e.url!==null&&n.push(`${i}- /url: ${textRepr(e.url)}`),e.mode!==null&&n.push(`${i}- /children: ${e.mode}`);for(let t=0;t<e.children.length;t++)renderTemplate(e.children[t],i,n)}var Scorer=class{memo=/* @__PURE__ */ new Map;score(e,t){if(e.kind===`text`)return typeof t==`string`?matchesText(t,e.text)?3:1:0;if(typeof t==`string`||e.role!==`fragment`&&e.role!==t.role)return 0;let n=this.memo.get(e);n===void 0&&this.memo.set(e,n=/* @__PURE__ */ new Map);let r=n.get(t);if(r!==void 0)return r;let i=2;return i+=e.name===null?1:matchesName(t.name,e.name)?2:0,attrsMatch(t,e)&&(i+=1),e.url!==null&&matchesText(t.url,e.url)&&(i+=1),i+=this.scoreList(e.children,t.children),n.set(t,i),i}scoreList(e,t){let n=this.align(e,t),r=0;for(let t=0;t<e.length;t++)n[t]!==null&&(r+=this.score(e[t],n[t]));return r}align(e,t){let n=[],r=0;for(let i=0;i<e.length;i++){let a=-1,o=0;for(let n=r;n<t.length;n++){let r=this.score(e[i],t[n]);r>o&&(a=n,o=r)}a<0?n.push(null):(n.push(t[a]),r=a+1)}return n}project(t,n,r,i){if(t.kind===`text`){let a=n;i.push(`${r}- text: ${matchesText(a,t.text)?textRepr(t.text):e.S(e.x(a,100))}`);return}let a=n,o=headerMatches(a,t)?templateKey(t):e._(a,100),s=this.align(t.children,a.children);if(isInline(t)){let n=s[0],a=t.children[0].text;i.push(n===null?`${r}- ${o}`:`${r}- ${o}: ${matchesText(n,a)?textRepr(a):e.S(e.x(n,100))}`);return}if(t.children.length===0&&t.url===null&&t.mode===null){i.push(`${r}- ${o}`);return}i.push(`${r}- ${o}:`);let c=r+` `;t.url!==null&&i.push(`${c}- /url: ${matchesText(a.url,t.url)?textRepr(t.url):e.S(a.url??``)}`),t.mode!==null&&i.push(`${c}- /children: ${t.mode}`);for(let e=0;e<t.children.length;e++)s[e]!==null&&this.project(t.children[e],s[e],c,i)}};function forEachNode(e,t){t(e);for(let n=0;n<e.children.length;n++){let r=e.children[n];typeof r==`string`?t(r):forEachNode(r,t)}}function closestLines(e,t){let n=new Scorer,r=[];if(t.kind===`role`&&t.role===`fragment`){let i=null,a=0;if(forEachNode(e,e=>{if(typeof e==`string`)return;let r=n.scoreList(t.children,e.children);r>a&&(i=e,a=r)}),i!==null){let e=n.align(t.children,i.children);for(let i=0;i<t.children.length;i++)e[i]!==null&&n.project(t.children[i],e[i],``,r)}return r}let i=null,a=0;return forEachNode(e,e=>{let r=n.score(t,e);r>a&&(i=e,a=r)}),i!==null&&n.project(t,i,``,r),r}function pairChanges(e){let t=[];for(let n=0;n<e.length;){if(e[n].kind===`=`){t.push(e[n++]);continue}let r=n;for(;r<e.length&&e[r].kind===`-`;)r++;let i=r;for(;i<e.length&&e[i].kind===`+`;)i++;if(r-n===i-r)for(let i=0;i<r-n;i++)t.push(e[n+i],e[r+i]);else for(let r=n;r<i;r++)t.push(e[r]);n=i}return t}function matchAriaSnapshot(t,n){let r=parseAriaTemplate(n),i=e.d(t,{urls:!0}),a=[];for(let e=0;e<i.length;e++){let t=i[e];a.push(typeof t==`string`?normalizeWhitespace(t):toMatchNode(t))}let o={role:`fragment`,name:``,states:/* @__PURE__ */ new Map,url:null,children:a,props:[]},s=matchesDeep(o,r),expectedLines=()=>{let e=[];if(r.kind===`role`&&r.role===`fragment`){r.mode!==null&&e.push(`- /children: ${r.mode}`);for(let t=0;t<r.children.length;t++)renderTemplate(r.children[t],``,e)}else renderTemplate(r,``,e);return e};return{pass:s,expected:()=>expectedLines().join(`
4
4
  `),diff:()=>pairChanges(e.n(expectedLines(),closestLines(o,r))),received:()=>e.l(t,{collapseAfter:1/0,maxLines:e.m()??100})}}function resetFailureSnapshot(t){e.b(t)}function captureFailureSnapshot(n){let r=e.w(),i=n?.body;if(r===null||i==null||i[t.$impl]===void 0)return null;if(r===`compact`){let t=e.s(i,void 0,{format:`compact`});return{format:r,text:String(t),full:``,previous:void 0}}let a=e.g(n),{lines:o,empty:s}=e.u(i),c=s??o.join(`
5
5
  `);return{format:r,text:s??e.f(o,e.m()??100).join(`
6
6
  `),full:c,previous:a}}function formatFailureSnapshot(t,n){if(t.format===`compact`)return`DOM of <body> when the test failed (CTRL_DOM_DEBUG=compact):\n${t.text}`;if(n.includes(t.text))return`Accessibility snapshot of <body> when the test failed: the same as above.`;let r=`Accessibility snapshot of <body> when the test failed (CTRL_DOM_DEBUG=aria):\n${t.text}`;return t.previous!==void 0&&(t.previous===t.full?r+=`
@@ -1,11 +1,11 @@
1
- import{S as e,b as t,d as n,f as r,g as i,l as a,m as o,n as s,s as c,t as l,u,w as d,x as f,y as p}from"./_chunks/aria-snapshot-diff-BSXxnyqJ.js";import{$impl as m}from"../bridge/internal.js";import{roleSupportsProp as h}from"../aria/index.js";var AriaTemplateError=class extends Error{constructor(e,t,n,r=-1){super(`${e} (template line ${t+1}):\n\n${n}${r>=0?`\n${` `.repeat(r)}^`:``}`),this.name=`AriaTemplateError`}};function normalizeWhitespace(e){return e.replace(/[​­]/g,``).replace(/[\r\n\s\t]+/g,` `).trim()}function textValue(e){let t=null;if(e.length>1&&e.startsWith(`/`)&&e.endsWith(`/`))try{t=new RegExp(e.slice(1,-1))}catch{t=null}return{raw:e,normalized:normalizeWhitespace(e),regex:t}}const g=/* @__PURE__ */ new Set([`disabled`,`expanded`,`active`,`selected`,`busy`,`hidden`]);function parseAriaTemplate(e){let t=e.split(/\r?\n/),n=1/0;for(let e=0;e<t.length;e++){let r=t[e],i=r.trim();if(i===``||i.startsWith(`#`))continue;let a=r.length-r.trimStart().length;if(r.slice(0,a).includes(` `))throw new AriaTemplateError(`Tabs cannot be used for indentation`,e,r);a<n&&(n=a)}let r={kind:`role`,role:`fragment`,name:null,attrs:[],url:null,mode:null,children:[]};if(n===1/0)throw new AriaTemplateError(`The aria snapshot template is empty`,0,e);let i=[{indent:-1,node:r,line:-1}];for(let e=0;e<t.length;e++){let r=t[e],a=r.trim();if(a===``||a.startsWith(`#`))continue;let o=r.length-r.trimStart().length-n;if(a!==`-`&&!a.startsWith(`- `))throw new AriaTemplateError(`Aria snapshot must be a YAML sequence, elements starting with "-"`,e,r,o+n);for(;i[i.length-1].indent>=o;)i.pop();let s=i[i.length-1];if(s.node===null)throw new AriaTemplateError(`"- text:" on line ${s.line+1} cannot have children`,e,r,o+n);let c=a.slice(2).trimStart(),l=r.length-c.length,u=parseItem(c,s.node,e,r,l);u!==void 0&&i.push({indent:o,node:u,line:e})}return r.children.length===1&&(r.mode===null||r.mode===`contain`)&&r.url===null?r.children[0]:r}function parseItem(e,t,n,r,i){let fail=(e,t)=>{throw new AriaTemplateError(e,n,r,i+t)};if(e===``&&fail(`Empty sequence item`,0),e.startsWith(`/`)){let n=e.indexOf(`:`);n<0&&fail("Property should be written `/name: value`",e.length);let r=e.slice(1,n).trim(),i=parseScalar(e.slice(n+1),fail,n+1);r===`children`?(i!==`contain`&&i!==`equal`&&i!==`deep-equal`&&fail(`Value of "/children" should be "contain", "equal" or "deep-equal"`,n+1),t.mode=i):r===`url`&&(t.url=textValue(i));return}let a,o=null;try{if(e[0]===`"`||e[0]===`'`){let[n,r]=readQuoted(e,0,fail),i=e.slice(r).trimStart();if(i!==``&&i[0]!==`:`&&fail(`Unexpected input after the quoted key`,r),i!==``&&(o=i.slice(1)),n===`text`&&o!==null)return textItem(t,o,fail,e.length-o.length);a=new KeyParser(n).parse(!1)}else{if(/^text:(\s|$)/.test(e))return textItem(t,e.slice(5),fail,5);let n=new KeyParser(e);a=n.parse(!0),n.pos<e.length&&(o=e.slice(n.pos+1))}}catch(t){throw t instanceof KeyError&&fail(t.message,e[0]===`"`||e[0]===`'`?0:t.pos),t}return o!==null&&o.trim()!==``&&a.children.push({kind:`text`,text:textValue(parseScalar(o,fail,e.length-o.length))}),t.children.push(a),a}function textItem(e,t,n,r){return e.children.push({kind:`text`,text:textValue(parseScalar(t,n,r))}),null}function parseScalar(e,t,n){let r=e.length-e.trimStart().length,i=e.trim();if(i[0]===`"`||i[0]===`'`){let[e,a]=readQuoted(i,0,(e,i)=>t(e,n+r+i)),o=i.slice(a).trim();return o!==``&&!o.startsWith(`#`)&&t(`Unexpected input after the quoted value`,n+r+a),e}(i===`|`||i===`>`||i.startsWith(`|`)||i.startsWith(`>`))&&t(`Block scalars are not supported in aria snapshot templates`,n+r);let a=i.search(/\s#/);return a>=0?i.slice(0,a).trim():i}function readQuoted(e,t,n){let r=e[t],i=``;for(let n=t+1;n<e.length;n++){let t=e[n];if(r===`'`){if(t===`'`){if(e[n+1]===`'`){i+=`'`,n++;continue}return[i,n+1]}i+=t}else{if(t===`"`)return[i,n+1];if(t===`\\`){let t=e[++n];t===`n`?i+=`
1
+ import{S as e,_ as t,b as n,d as r,f as i,g as a,l as o,m as s,n as c,s as l,t as u,u as d,w as f,x as p,y as m}from"./_chunks/aria-snapshot-diff-DdhypD1z.js";import{$impl as h}from"../bridge/internal.js";import{roleSupportsProp as g}from"../aria/index.js";var AriaTemplateError=class extends Error{constructor(e,t,n,r=-1){super(`${e} (template line ${t+1}):\n\n${n}${r>=0?`\n${` `.repeat(r)}^`:``}`),this.name=`AriaTemplateError`}};function normalizeWhitespace(e){return e.replace(/[​­]/g,``).replace(/[\r\n\s\t]+/g,` `).trim()}function textValue(e){let t=null;if(e.length>1&&e.startsWith(`/`)&&e.endsWith(`/`))try{t=new RegExp(e.slice(1,-1))}catch{t=null}return{raw:e,normalized:normalizeWhitespace(e),regex:t}}const _=/* @__PURE__ */ new Set([`disabled`,`expanded`,`active`,`selected`,`busy`,`hidden`]);function parseAriaTemplate(e){let t=e.split(/\r?\n/),n=1/0;for(let e=0;e<t.length;e++){let r=t[e],i=r.trim();if(i===``||i.startsWith(`#`))continue;let a=r.length-r.trimStart().length;if(r.slice(0,a).includes(` `))throw new AriaTemplateError(`Tabs cannot be used for indentation`,e,r);a<n&&(n=a)}let r={kind:`role`,role:`fragment`,name:null,attrs:[],url:null,mode:null,children:[]};if(n===1/0)throw new AriaTemplateError(`The aria snapshot template is empty`,0,e);let i=[{indent:-1,node:r,line:-1}];for(let e=0;e<t.length;e++){let r=t[e],a=r.trim();if(a===``||a.startsWith(`#`))continue;let o=r.length-r.trimStart().length-n;if(a!==`-`&&!a.startsWith(`- `))throw new AriaTemplateError(`Aria snapshot must be a YAML sequence, elements starting with "-"`,e,r,o+n);for(;i[i.length-1].indent>=o;)i.pop();let s=i[i.length-1];if(s.node===null)throw new AriaTemplateError(`"- text:" on line ${s.line+1} cannot have children`,e,r,o+n);let c=a.slice(2).trimStart(),l=r.length-c.length,u=parseItem(c,s.node,e,r,l);u!==void 0&&i.push({indent:o,node:u,line:e})}return r.children.length===1&&(r.mode===null||r.mode===`contain`)&&r.url===null?r.children[0]:r}function parseItem(e,t,n,r,i){let fail=(e,t)=>{throw new AriaTemplateError(e,n,r,i+t)};if(e===``&&fail(`Empty sequence item`,0),e.startsWith(`/`)){let n=e.indexOf(`:`);n<0&&fail("Property should be written `/name: value`",e.length);let r=e.slice(1,n).trim(),i=parseScalar(e.slice(n+1),fail,n+1);r===`children`?(i!==`contain`&&i!==`equal`&&i!==`deep-equal`&&fail(`Value of "/children" should be "contain", "equal" or "deep-equal"`,n+1),t.mode=i):r===`url`&&(t.url=textValue(i));return}let a,o=null;try{if(e[0]===`"`||e[0]===`'`){let[n,r]=readQuoted(e,0,fail),i=e.slice(r).trimStart();if(i!==``&&i[0]!==`:`&&fail(`Unexpected input after the quoted key`,r),i!==``&&(o=i.slice(1)),n===`text`&&o!==null)return textItem(t,o,fail,e.length-o.length);a=new KeyParser(n).parse(!1)}else{if(/^text:(\s|$)/.test(e))return textItem(t,e.slice(5),fail,5);let n=new KeyParser(e);a=n.parse(!0),n.pos<e.length&&(o=e.slice(n.pos+1))}}catch(t){throw t instanceof KeyError&&fail(t.message,e[0]===`"`||e[0]===`'`?0:t.pos),t}return o!==null&&o.trim()!==``&&a.children.push({kind:`text`,text:textValue(parseScalar(o,fail,e.length-o.length))}),t.children.push(a),a}function textItem(e,t,n,r){return e.children.push({kind:`text`,text:textValue(parseScalar(t,n,r))}),null}function parseScalar(e,t,n){let r=e.length-e.trimStart().length,i=e.trim();if(i[0]===`"`||i[0]===`'`){let[e,a]=readQuoted(i,0,(e,i)=>t(e,n+r+i)),o=i.slice(a).trim();return o!==``&&!o.startsWith(`#`)&&t(`Unexpected input after the quoted value`,n+r+a),e}(i===`|`||i===`>`||i.startsWith(`|`)||i.startsWith(`>`))&&t(`Block scalars are not supported in aria snapshot templates`,n+r);let a=i.search(/\s#/);return a>=0?i.slice(0,a).trim():i}function readQuoted(e,t,n){let r=e[t],i=``;for(let n=t+1;n<e.length;n++){let t=e[n];if(r===`'`){if(t===`'`){if(e[n+1]===`'`){i+=`'`,n++;continue}return[i,n+1]}i+=t}else{if(t===`"`)return[i,n+1];if(t===`\\`){let t=e[++n];t===`n`?i+=`
2
2
  `:t===`t`?i+=` `:t===`u`?(i+=String.fromCharCode(parseInt(e.slice(n+1,n+5),16)),n+=4):i+=t??``}else i+=t}}return n(`Unterminated string`,e.length)}var KeyError=class extends Error{pos;constructor(e,t){super(e),this.pos=t}},KeyParser=class{pos=0;input;constructor(e){this.input=e}peek(){return this.input[this.pos]??``}eof(){return this.pos>=this.input.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}atColon(){return this.peek()===`:`&&(this.pos+1>=this.input.length||/\s/.test(this.input[this.pos+1]))}readIdentifier(e){if(this.eof())throw new KeyError(`Unexpected end of input when expecting ${e}`,this.pos);let t=this.pos;for(;!this.eof()&&/[a-zA-Z]/.test(this.peek());)this.pos++;if(this.pos===t)throw new KeyError(`Expected ${e}`,this.pos);return this.input.slice(t,this.pos)}readString(){let e=``;for(;!this.eof();){let t=this.input[this.pos++];if(t===`\\`){let t=this.input[this.pos++]??``;t===`n`?e+=`
3
- `:t===`t`?e+=` `:t===`u`?(e+=String.fromCharCode(parseInt(this.input.slice(this.pos,this.pos+4),16)),this.pos+=4):e+=t}else if(t===`"`)return e;else e+=t}throw new KeyError(`Unterminated string`,this.pos)}readRegex(){let e=this.pos,t=``,n=!1,r=!1;for(;!this.eof();){let i=this.input[this.pos++];if(n)t+=i,n=!1;else if(i===`\\`)n=!0,t+=i;else if(i===`/`&&!r)try{return new RegExp(t)}catch(t){throw new KeyError(`Invalid regular expression: ${t.message}`,e)}else i===`[`?(r=!0,t+=i):i===`]`&&r?(t+=i,r=!1):t+=i}throw new KeyError(`Unterminated regex`,this.pos)}parse(e){this.skipWhitespace();let t=this.readIdentifier(`role`);this.skipWhitespace();let n=null;this.peek()===`"`?(this.pos++,n=normalizeWhitespace(this.readString())):this.peek()===`/`&&(this.pos++,n=this.readRegex());let r={kind:`role`,role:t,name:n===``?null:n,attrs:[],url:null,mode:null,children:[]};for(;this.skipWhitespace(),this.peek()===`[`;){this.pos++,this.skipWhitespace();let e=this.pos,t=this.readIdentifier(`attribute`);this.skipWhitespace();let n=``;if(this.peek()===`=`)for(this.pos++,this.skipWhitespace();this.peek()!==`]`&&!/\s/.test(this.peek())&&!this.eof();)n+=this.input[this.pos++];if(this.skipWhitespace(),this.peek()!==`]`)throw new KeyError(`Expected ]`,this.pos);this.pos++,r.attrs.push([t,checkAttribute(t,n||`true`,e)])}if(this.skipWhitespace(),e&&this.atColon())return r;if(!this.eof())throw new KeyError(e?`Unexpected input (a key ends with ":" and a space)`:`Unexpected input`,this.pos);return r}};function checkAttribute(e,t,n){if(e===`checked`||e===`pressed`){if(t!==`true`&&t!==`false`&&t!==`mixed`)throw new KeyError(`Value of "${e}" attribute must be a boolean or "mixed"`,n);return t}if(g.has(e)){if(t!==`true`&&t!==`false`)throw new KeyError(`Value of "${e}" attribute must be a boolean`,n);return t}if(e===`level`){if(Number.isNaN(Number(t)))throw new KeyError(`Value of "level" attribute must be a number`,n);return String(Number(t))}if(e===`current`)return t;throw new KeyError(`Unsupported attribute [${e}]`,n)}function toMatchNode(e){let t=[];e.value!==null&&e.value!==``&&t.push(normalizeWhitespace(e.value));for(let n=0;n<e.children.length;n++){let r=e.children[n];t.push(typeof r==`string`?normalizeWhitespace(r):toMatchNode(r))}let n=/* @__PURE__ */ new Map;for(let t=0;t<e.props.length;t++){let r=e.props[t].slice(1,-1),i=r.indexOf(`=`);i<0?n.set(r,`true`):n.set(r.slice(0,i),r.slice(i+1))}return{role:e.role,name:normalizeWhitespace(e.name),states:n,url:e.url,children:t,props:e.props}}function stateOf(e,t){let n=e.states.get(t);if(n!==void 0)return n;switch(t){case`checked`:return h(e.role,`aria-checked`)?`false`:void 0;case`disabled`:case`selected`:case`active`:case`busy`:case`hidden`:case`current`:return`false`}}function attrsMatch(e,t){for(let n=0;n<t.attrs.length;n++){let[r,i]=t.attrs[n],a=stateOf(e,r);if(r===`current`&&i===`true`){if(a===void 0||a===`false`)return!1}else if(a!==i)return!1}return!0}function matchesName(e,t){return t===null?!0:e===``?!1:typeof t==`string`?e===t:t.test(e)}function matchesText(e,t){return t===null||t.normalized===``?!0:e?e===t.normalized||e===t.raw||t.regex!==null&&t.regex.test(e):!1}function headerMatches(e,t){return(t.role===`fragment`||t.role===e.role)&&attrsMatch(e,t)&&matchesName(e.name,t.name)&&matchesText(e.url,t.url)}function matchesNode(e,t,n){return typeof e==`string`?t.kind===`text`&&matchesText(e,t.text):t.kind!==`role`||!headerMatches(e,t)?!1:t.mode===`contain`?containsList(e.children,t.children):t.mode===`equal`?listEqual(e.children,t.children,!1):t.mode===`deep-equal`||n?listEqual(e.children,t.children,!0):containsList(e.children,t.children)}function listEqual(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!matchesNode(e[r],t[r],n))return!1;return!0}function containsList(e,t){if(t.length>e.length)return!1;let n=0;for(let r=0;r<t.length;r++){for(;n<e.length&&!matchesNode(e[n],t[r],!1);)n++;if(n===e.length)return!1;n++}return!0}function matchesDeep(e,t){if(matchesNode(e,t,!1))return!0;if(typeof e==`string`)return!1;for(let n=0;n<e.children.length;n++)if(matchesDeep(e.children[n],t))return!0;return!1}function textRepr(t){return t.regex===null?e(t.normalized):t.raw}function templateKey(e){let t=e.role;typeof e.name==`string`?t+=` `+p(e.name):e.name!==null&&(t+=` /${e.name.source}/`);for(let n=0;n<e.attrs.length;n++)t+=e.attrs[n][1]===`true`?` [${e.attrs[n][0]}]`:` [${e.attrs[n][0]}=${e.attrs[n][1]}]`;return t}function receivedKey(e){let t=e.role;e.name!==``&&(t+=` `+p(f(e.name,100)));for(let n=0;n<e.props.length;n++)t+=` `+e.props[n];return t}function isInline(e){return e.url===null&&e.mode===null&&e.children.length===1&&e.children[0].kind===`text`}function renderTemplate(e,t,n){if(e.kind===`text`){n.push(`${t}- text: ${textRepr(e.text)}`);return}let r=templateKey(e);if(isInline(e)){n.push(`${t}- ${r}: ${textRepr(e.children[0].text)}`);return}if(e.children.length===0&&e.url===null&&e.mode===null){n.push(`${t}- ${r}`);return}n.push(`${t}- ${r}:`);let i=t+` `;e.url!==null&&n.push(`${i}- /url: ${textRepr(e.url)}`),e.mode!==null&&n.push(`${i}- /children: ${e.mode}`);for(let t=0;t<e.children.length;t++)renderTemplate(e.children[t],i,n)}var Scorer=class{memo=/* @__PURE__ */ new Map;score(e,t){if(e.kind===`text`)return typeof t==`string`?matchesText(t,e.text)?3:1:0;if(typeof t==`string`||e.role!==`fragment`&&e.role!==t.role)return 0;let n=this.memo.get(e);n===void 0&&this.memo.set(e,n=/* @__PURE__ */ new Map);let r=n.get(t);if(r!==void 0)return r;let i=2;return i+=e.name===null?1:matchesName(t.name,e.name)?2:0,attrsMatch(t,e)&&(i+=1),e.url!==null&&matchesText(t.url,e.url)&&(i+=1),i+=this.scoreList(e.children,t.children),n.set(t,i),i}scoreList(e,t){let n=this.align(e,t),r=0;for(let t=0;t<e.length;t++)n[t]!==null&&(r+=this.score(e[t],n[t]));return r}align(e,t){let n=[],r=0;for(let i=0;i<e.length;i++){let a=-1,o=0;for(let n=r;n<t.length;n++){let r=this.score(e[i],t[n]);r>o&&(a=n,o=r)}a<0?n.push(null):(n.push(t[a]),r=a+1)}return n}project(t,n,r,i){if(t.kind===`text`){let a=n;i.push(`${r}- text: ${matchesText(a,t.text)?textRepr(t.text):e(f(a,100))}`);return}let a=n,o=headerMatches(a,t)?templateKey(t):receivedKey(a),s=this.align(t.children,a.children);if(isInline(t)){let n=s[0],a=t.children[0].text;i.push(n===null?`${r}- ${o}`:`${r}- ${o}: ${matchesText(n,a)?textRepr(a):e(f(n,100))}`);return}if(t.children.length===0&&t.url===null&&t.mode===null){i.push(`${r}- ${o}`);return}i.push(`${r}- ${o}:`);let c=r+` `;t.url!==null&&i.push(`${c}- /url: ${matchesText(a.url,t.url)?textRepr(t.url):e(a.url??``)}`),t.mode!==null&&i.push(`${c}- /children: ${t.mode}`);for(let e=0;e<t.children.length;e++)s[e]!==null&&this.project(t.children[e],s[e],c,i)}};function forEachNode(e,t){t(e);for(let n=0;n<e.children.length;n++){let r=e.children[n];typeof r==`string`?t(r):forEachNode(r,t)}}function closestLines(e,t){let n=new Scorer,r=[];if(t.kind===`role`&&t.role===`fragment`){let i=null,a=0;if(forEachNode(e,e=>{if(typeof e==`string`)return;let r=n.scoreList(t.children,e.children);r>a&&(i=e,a=r)}),i!==null){let e=n.align(t.children,i.children);for(let i=0;i<t.children.length;i++)e[i]!==null&&n.project(t.children[i],e[i],``,r)}return r}let i=null,a=0;return forEachNode(e,e=>{let r=n.score(t,e);r>a&&(i=e,a=r)}),i!==null&&n.project(t,i,``,r),r}function pairChanges(e){let t=[];for(let n=0;n<e.length;){if(e[n].kind===`=`){t.push(e[n++]);continue}let r=n;for(;r<e.length&&e[r].kind===`-`;)r++;let i=r;for(;i<e.length&&e[i].kind===`+`;)i++;if(r-n===i-r)for(let i=0;i<r-n;i++)t.push(e[n+i],e[r+i]);else for(let r=n;r<i;r++)t.push(e[r]);n=i}return t}function matchAriaSnapshot(e,t){let r=parseAriaTemplate(t),i=n(e,{urls:!0}),c=[];for(let e=0;e<i.length;e++){let t=i[e];c.push(typeof t==`string`?normalizeWhitespace(t):toMatchNode(t))}let l={role:`fragment`,name:``,states:/* @__PURE__ */ new Map,url:null,children:c,props:[]},u=matchesDeep(l,r),expectedLines=()=>{let e=[];if(r.kind===`role`&&r.role===`fragment`){r.mode!==null&&e.push(`- /children: ${r.mode}`);for(let t=0;t<r.children.length;t++)renderTemplate(r.children[t],``,e)}else renderTemplate(r,``,e);return e};return{pass:u,expected:()=>expectedLines().join(`
4
- `),diff:()=>pairChanges(s(expectedLines(),closestLines(l,r))),received:()=>a(e,{collapseAfter:1/0,maxLines:o()??100})}}function resetFailureSnapshot(e){t(e)}function captureFailureSnapshot(e){let t=d(),n=e?.body;if(t===null||n==null||n[m]===void 0)return null;if(t===`compact`){let e=c(n,void 0,{format:`compact`});return{format:t,text:String(e),full:``,previous:void 0}}let a=i(e),{lines:s,empty:l}=u(n),f=l??s.join(`
5
- `);return{format:t,text:l??r(s,o()??100).join(`
6
- `),full:f,previous:a}}function formatFailureSnapshot(e,t){if(e.format===`compact`)return`DOM of <body> when the test failed (CTRL_DOM_DEBUG=compact):\n${e.text}`;if(t.includes(e.text))return`Accessibility snapshot of <body> when the test failed: the same as above.`;let n=`Accessibility snapshot of <body> when the test failed (CTRL_DOM_DEBUG=aria):\n${e.text}`;return e.previous!==void 0&&(e.previous===e.full?n+=`
3
+ `:t===`t`?e+=` `:t===`u`?(e+=String.fromCharCode(parseInt(this.input.slice(this.pos,this.pos+4),16)),this.pos+=4):e+=t}else if(t===`"`)return e;else e+=t}throw new KeyError(`Unterminated string`,this.pos)}readRegex(){let e=this.pos,t=``,n=!1,r=!1;for(;!this.eof();){let i=this.input[this.pos++];if(n)t+=i,n=!1;else if(i===`\\`)n=!0,t+=i;else if(i===`/`&&!r)try{return new RegExp(t)}catch(t){throw new KeyError(`Invalid regular expression: ${t.message}`,e)}else i===`[`?(r=!0,t+=i):i===`]`&&r?(t+=i,r=!1):t+=i}throw new KeyError(`Unterminated regex`,this.pos)}parse(e){this.skipWhitespace();let t=this.readIdentifier(`role`);this.skipWhitespace();let n=null;this.peek()===`"`?(this.pos++,n=normalizeWhitespace(this.readString())):this.peek()===`/`&&(this.pos++,n=this.readRegex());let r={kind:`role`,role:t,name:n===``?null:n,attrs:[],url:null,mode:null,children:[]};for(;this.skipWhitespace(),this.peek()===`[`;){this.pos++,this.skipWhitespace();let e=this.pos,t=this.readIdentifier(`attribute`);this.skipWhitespace();let n=``;if(this.peek()===`=`)for(this.pos++,this.skipWhitespace();this.peek()!==`]`&&!/\s/.test(this.peek())&&!this.eof();)n+=this.input[this.pos++];if(this.skipWhitespace(),this.peek()!==`]`)throw new KeyError(`Expected ]`,this.pos);this.pos++,r.attrs.push([t,checkAttribute(t,n||`true`,e)])}if(this.skipWhitespace(),e&&this.atColon())return r;if(!this.eof())throw new KeyError(e?`Unexpected input (a key ends with ":" and a space)`:`Unexpected input`,this.pos);return r}};function checkAttribute(e,t,n){if(e===`checked`||e===`pressed`){if(t!==`true`&&t!==`false`&&t!==`mixed`)throw new KeyError(`Value of "${e}" attribute must be a boolean or "mixed"`,n);return t}if(_.has(e)){if(t!==`true`&&t!==`false`)throw new KeyError(`Value of "${e}" attribute must be a boolean`,n);return t}if(e===`level`){if(Number.isNaN(Number(t)))throw new KeyError(`Value of "level" attribute must be a number`,n);return String(Number(t))}if(e===`current`)return t;throw new KeyError(`Unsupported attribute [${e}]`,n)}function toMatchNode(e){let t=[];e.value!==null&&e.value!==``&&t.push(normalizeWhitespace(e.value));for(let n=0;n<e.children.length;n++){let r=e.children[n];t.push(typeof r==`string`?normalizeWhitespace(r):toMatchNode(r))}let n=/* @__PURE__ */ new Map;for(let t=0;t<e.props.length;t++){let r=e.props[t].slice(1,-1),i=r.indexOf(`=`);i<0?n.set(r,`true`):n.set(r.slice(0,i),r.slice(i+1))}return{role:e.role,name:normalizeWhitespace(e.name),states:n,url:e.url,children:t,props:e.props}}function stateOf(e,t){let n=e.states.get(t);if(n!==void 0)return n;switch(t){case`checked`:return g(e.role,`aria-checked`)?`false`:void 0;case`disabled`:case`selected`:case`active`:case`busy`:case`hidden`:case`current`:return`false`}}function attrsMatch(e,t){for(let n=0;n<t.attrs.length;n++){let[r,i]=t.attrs[n],a=stateOf(e,r);if(r===`current`&&i===`true`){if(a===void 0||a===`false`)return!1}else if(a!==i)return!1}return!0}function matchesName(e,t){return t===null?!0:e===``?!1:typeof t==`string`?e===t:t.test(e)}function matchesText(e,t){return t===null||t.normalized===``?!0:e?e===t.normalized||e===t.raw||t.regex!==null&&t.regex.test(e):!1}function headerMatches(e,t){return(t.role===`fragment`||t.role===e.role)&&attrsMatch(e,t)&&matchesName(e.name,t.name)&&matchesText(e.url,t.url)}function matchesNode(e,t,n){return typeof e==`string`?t.kind===`text`&&matchesText(e,t.text):t.kind!==`role`||!headerMatches(e,t)?!1:t.mode===`contain`?containsList(e.children,t.children):t.mode===`equal`?listEqual(e.children,t.children,!1):t.mode===`deep-equal`||n?listEqual(e.children,t.children,!0):containsList(e.children,t.children)}function listEqual(e,t,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!matchesNode(e[r],t[r],n))return!1;return!0}function containsList(e,t){if(t.length>e.length)return!1;let n=0;for(let r=0;r<t.length;r++){for(;n<e.length&&!matchesNode(e[n],t[r],!1);)n++;if(n===e.length)return!1;n++}return!0}function matchesDeep(e,t){if(matchesNode(e,t,!1))return!0;if(typeof e==`string`)return!1;for(let n=0;n<e.children.length;n++)if(matchesDeep(e.children[n],t))return!0;return!1}function textRepr(t){return t.regex===null?e(t.normalized):t.raw}function templateKey(e){let t=e.role;typeof e.name==`string`?t+=` `+m(e.name):e.name!==null&&(t+=` /${e.name.source}/`);for(let n=0;n<e.attrs.length;n++)t+=e.attrs[n][1]===`true`?` [${e.attrs[n][0]}]`:` [${e.attrs[n][0]}=${e.attrs[n][1]}]`;return t}function isInline(e){return e.url===null&&e.mode===null&&e.children.length===1&&e.children[0].kind===`text`}function renderTemplate(e,t,n){if(e.kind===`text`){n.push(`${t}- text: ${textRepr(e.text)}`);return}let r=templateKey(e);if(isInline(e)){n.push(`${t}- ${r}: ${textRepr(e.children[0].text)}`);return}if(e.children.length===0&&e.url===null&&e.mode===null){n.push(`${t}- ${r}`);return}n.push(`${t}- ${r}:`);let i=t+` `;e.url!==null&&n.push(`${i}- /url: ${textRepr(e.url)}`),e.mode!==null&&n.push(`${i}- /children: ${e.mode}`);for(let t=0;t<e.children.length;t++)renderTemplate(e.children[t],i,n)}var Scorer=class{memo=/* @__PURE__ */ new Map;score(e,t){if(e.kind===`text`)return typeof t==`string`?matchesText(t,e.text)?3:1:0;if(typeof t==`string`||e.role!==`fragment`&&e.role!==t.role)return 0;let n=this.memo.get(e);n===void 0&&this.memo.set(e,n=/* @__PURE__ */ new Map);let r=n.get(t);if(r!==void 0)return r;let i=2;return i+=e.name===null?1:matchesName(t.name,e.name)?2:0,attrsMatch(t,e)&&(i+=1),e.url!==null&&matchesText(t.url,e.url)&&(i+=1),i+=this.scoreList(e.children,t.children),n.set(t,i),i}scoreList(e,t){let n=this.align(e,t),r=0;for(let t=0;t<e.length;t++)n[t]!==null&&(r+=this.score(e[t],n[t]));return r}align(e,t){let n=[],r=0;for(let i=0;i<e.length;i++){let a=-1,o=0;for(let n=r;n<t.length;n++){let r=this.score(e[i],t[n]);r>o&&(a=n,o=r)}a<0?n.push(null):(n.push(t[a]),r=a+1)}return n}project(n,r,i,a){if(n.kind===`text`){let t=r;a.push(`${i}- text: ${matchesText(t,n.text)?textRepr(n.text):e(p(t,100))}`);return}let o=r,s=headerMatches(o,n)?templateKey(n):t(o,100),c=this.align(n.children,o.children);if(isInline(n)){let t=c[0],r=n.children[0].text;a.push(t===null?`${i}- ${s}`:`${i}- ${s}: ${matchesText(t,r)?textRepr(r):e(p(t,100))}`);return}if(n.children.length===0&&n.url===null&&n.mode===null){a.push(`${i}- ${s}`);return}a.push(`${i}- ${s}:`);let l=i+` `;n.url!==null&&a.push(`${l}- /url: ${matchesText(o.url,n.url)?textRepr(n.url):e(o.url??``)}`),n.mode!==null&&a.push(`${l}- /children: ${n.mode}`);for(let e=0;e<n.children.length;e++)c[e]!==null&&this.project(n.children[e],c[e],l,a)}};function forEachNode(e,t){t(e);for(let n=0;n<e.children.length;n++){let r=e.children[n];typeof r==`string`?t(r):forEachNode(r,t)}}function closestLines(e,t){let n=new Scorer,r=[];if(t.kind===`role`&&t.role===`fragment`){let i=null,a=0;if(forEachNode(e,e=>{if(typeof e==`string`)return;let r=n.scoreList(t.children,e.children);r>a&&(i=e,a=r)}),i!==null){let e=n.align(t.children,i.children);for(let i=0;i<t.children.length;i++)e[i]!==null&&n.project(t.children[i],e[i],``,r)}return r}let i=null,a=0;return forEachNode(e,e=>{let r=n.score(t,e);r>a&&(i=e,a=r)}),i!==null&&n.project(t,i,``,r),r}function pairChanges(e){let t=[];for(let n=0;n<e.length;){if(e[n].kind===`=`){t.push(e[n++]);continue}let r=n;for(;r<e.length&&e[r].kind===`-`;)r++;let i=r;for(;i<e.length&&e[i].kind===`+`;)i++;if(r-n===i-r)for(let i=0;i<r-n;i++)t.push(e[n+i],e[r+i]);else for(let r=n;r<i;r++)t.push(e[r]);n=i}return t}function matchAriaSnapshot(e,t){let n=parseAriaTemplate(t),i=r(e,{urls:!0}),a=[];for(let e=0;e<i.length;e++){let t=i[e];a.push(typeof t==`string`?normalizeWhitespace(t):toMatchNode(t))}let l={role:`fragment`,name:``,states:/* @__PURE__ */ new Map,url:null,children:a,props:[]},u=matchesDeep(l,n),expectedLines=()=>{let e=[];if(n.kind===`role`&&n.role===`fragment`){n.mode!==null&&e.push(`- /children: ${n.mode}`);for(let t=0;t<n.children.length;t++)renderTemplate(n.children[t],``,e)}else renderTemplate(n,``,e);return e};return{pass:u,expected:()=>expectedLines().join(`
4
+ `),diff:()=>pairChanges(c(expectedLines(),closestLines(l,n))),received:()=>o(e,{collapseAfter:1/0,maxLines:s()??100})}}function resetFailureSnapshot(e){n(e)}function captureFailureSnapshot(e){let t=f(),n=e?.body;if(t===null||n==null||n[h]===void 0)return null;if(t===`compact`){let e=l(n,void 0,{format:`compact`});return{format:t,text:String(e),full:``,previous:void 0}}let r=a(e),{lines:o,empty:c}=d(n),u=c??o.join(`
5
+ `);return{format:t,text:c??i(o,s()??100).join(`
6
+ `),full:u,previous:r}}function formatFailureSnapshot(e,t){if(e.format===`compact`)return`DOM of <body> when the test failed (CTRL_DOM_DEBUG=compact):\n${e.text}`;if(t.includes(e.text))return`Accessibility snapshot of <body> when the test failed: the same as above.`;let n=`Accessibility snapshot of <body> when the test failed (CTRL_DOM_DEBUG=aria):\n${e.text}`;return e.previous!==void 0&&(e.previous===e.full?n+=`
7
7
 
8
- Unchanged since the previous snapshot in this test.`:n+=`\n\nChanges since the previous snapshot in this test:\n${r(l(e.previous,e.full).split(`
8
+ Unchanged since the previous snapshot in this test.`:n+=`\n\nChanges since the previous snapshot in this test:\n${i(u(e.previous,e.full).split(`
9
9
  `),40).join(`
10
10
  `)}`),n}function appendToErrorMessage(e,t){if(typeof e!=`object`||!e)return!1;let n=e,r=typeof n.message==`string`?n.message:``,i;try{i=n.stack}catch{i=void 0}let a=r===``?t:`${r}\n\n${t}`;try{if(n.message=a,typeof i==`string`){let e=r===``?-1:i.indexOf(r);if(e>=0)n.stack=i.slice(0,e)+a+i.slice(e+r.length);else{let e=i.indexOf(`
11
- `);n.stack=e<0?`${i}\n\n${t}`:`${i.slice(0,e)}\n\n${t}${i.slice(e)}`}}}catch{return!1}return!0}export{AriaTemplateError,appendToErrorMessage,captureFailureSnapshot,d as envDebugFormat,formatFailureSnapshot,matchAriaSnapshot,parseAriaTemplate,resetFailureSnapshot};
11
+ `);n.stack=e<0?`${i}\n\n${t}`:`${i.slice(0,e)}\n\n${t}${i.slice(e)}`}}}catch{return!1}return!0}export{AriaTemplateError,appendToErrorMessage,captureFailureSnapshot,f as envDebugFormat,formatFailureSnapshot,matchAriaSnapshot,parseAriaTemplate,resetFailureSnapshot};
@@ -1,9 +1,9 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-B95LLutl.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria/internal"),r=require("@ctrl/dom/aria"),i=require("node:async_hooks");const a=/* @__PURE__ */ new Set([`button`,`input`,`meter`,`output`,`progress`,`select`,`textarea`]);function isLabelledNodeName(e){return e.prefix===null&&a.has(e.tag===0?(0,t.asciiLowercase)(e.name):e.name)}function buildIdMap(e){let n=/* @__PURE__ */ new Map;for(let r=e.first;r!==null;r=(0,t.nextInTree)(r,e))r.type===t.ELEMENT_NODE&&r.id!==``&&!n.has(r.id)&&n.set(r.id,r);return n}var LabelContext=class{container;containerIds;sameTree;labelMap;constructor(e,t=!1){this.container=e,this.containerIds=null,this.sameTree=t,this.labelMap=null}labelsOf(e){return this.sameTree?(this.labelMap??=(0,n.labelMapForTree)(this.container)).get(e)??o:(0,n.labelsOf)(e)??o}byIdInContainer(e){if(e===``)return null;if(this.containerIds===null){let n=(0,t.indexedDescendantById)(this.container,e);if(n!==void 0)return n;this.containerIds=buildIdMap(this.container)}return this.containerIds.get(e)??null}};const o=[];function getTextContent(e){let n=``;for(let r=e.first;r!==null;r=r.next)r.type===t.TEXT_NODE?n+=r.data:r.first===null||r.type===t.ELEMENT_NODE&&isLabelledNodeName(r)||(n+=getTextContent(r));return n}function getLabelContentImpl(e){if(e.tag===t.T.label&&e.ns===t.HTML_NS)return getTextContent(e);let n=e.node;return n.value||n.textContent}function labelledFormControl(n,r){for(let i=n.first;i!==null;i=(0,t.nextInTree)(i,n))if(i.type===t.ELEMENT_NODE&&a.has(i.name)&&(r===`*`||e.T(i,r)))return i}function getLabelsImpl(e,n,r=`*`){let i=(0,t.ariaAttr)(n,`aria-labelledby`);return i?i.split(` `).map(t=>{let n=e.byIdInContainer(t);return n?{content:getLabelContentImpl(n),formControl:null}:{content:``,formControl:null}}):e.labelsOf(n).map(e=>({content:getLabelContentImpl(e),formControl:labelledFormControl(e,r)}))}function assertNotNullOrUndefined(e){if(e==null)throw Error(`It looks like ${e} was passed instead of a matcher. Did you do something like getByText(${e})?`)}function fuzzyMatches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return typeof n==`string`||typeof n==`number`?i.toLowerCase().includes(n.toString().toLowerCase()):typeof n==`function`?n(i,t):matchRegExp(n,i)}function matches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return n instanceof Function?n(i,t):n instanceof RegExp?matchRegExp(n,i):i===String(n)}function isRegExpWhitespace(e){return e<=32?e===32||e>=9&&e<=13:e<160?!1:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function changedByNormalizing(e,t,n){let r=e.length-1,i=!1;for(let a=0;a<=r;a++){let o=e.charCodeAt(a),s=isRegExpWhitespace(o);if(s&&(t&&(a===0||a===r)||n&&(i||o!==32)))return!0;i=s}return!1}const s=/\s+/g;function getDefaultNormalizer({trim:e=!0,collapseWhitespace:t=!0}={}){return n=>{if(!changedByNormalizing(n,e,t))return n;let r=n;return r=e?r.trim():r,r=t?r.replace(s,` `):r,r}}const c=getDefaultNormalizer();function textMatcher(e,t,n){if(!e)return(e,r)=>fuzzyMatches(e,r,t,n);if(n===c&&isPlainRegExp(t)){let e;return n=>typeof n==`string`?n.length===0?e??=t.test(``):t.test(c(n)):!1}if(n!==c||typeof t!=`string`&&typeof t!=`number`)return(e,r)=>matches(e,r,t,n);let r=String(t);if(changedByNormalizing(r,!0,!0))return()=>!1;let i=r.length,a=r.charCodeAt(0),o=r.charCodeAt(i-1);return e=>{if(typeof e!=`string`||e.length<i)return!1;if(i!==0){let t=e.charCodeAt(0);if(t!==a&&!isRegExpWhitespace(t))return!1;let n=e.charCodeAt(e.length-1);if(n!==o&&!isRegExpWhitespace(n))return!1}return c(e)===r}}function makeNormalizer({trim:e,collapseWhitespace:t,normalizer:n}){if(!n)return e===void 0&&t===void 0?c:getDefaultNormalizer({trim:e,collapseWhitespace:t});if(e!==void 0||t!==void 0)throw 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`);return n}const l=RegExp.prototype.exec;function isPlainRegExp(e){return e instanceof RegExp&&!e.global&&!e.sticky&&Object.getPrototypeOf(e)===RegExp.prototype&&!Object.hasOwn(e,`exec`)&&!Object.hasOwn(e,`test`)&&RegExp.prototype.exec===l&&RegExp.prototype.test===u}const u=RegExp.prototype.test;function matchRegExp(e,t){let n=e.test(t);return e.global&&e.lastIndex!==0&&(console.warn(`To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp.`),e.lastIndex=0),n}function isButtonLikeInput(e){if(e.tag!==t.T.input||e.ns!==t.HTML_NS)return!1;let n=(0,t.attr)(e,`type`);if(n===null)return!1;let r=(0,t.asciiLowercase)(n);return r===`submit`||r===`button`||r===`reset`}function getNodeTextImpl(e){if(isButtonLikeInput(e))return e.node.value;let n=``;for(let r=e.first;r!==null;r=r.next)r.type===t.TEXT_NODE&&(n+=r.data);return n}function getNodeText(n){let r=e.A(n);return r.type===t.ELEMENT_NODE?getNodeTextImpl(r):n.matches(`input[type=submit], input[type=button], input[type=reset]`)}const d={computedStyleSupportsPseudoElements:!0};function styleOverride(e){return(0,t.getComputedStyleOverride)(e)}function nameOptions(e,t){return t===null?e?d:void 0:{computedStyleSupportsPseudoElements:e,getComputedStyle:t}}const f={implicitRole(e){let t=(0,n.implicitRole)(e);return t===``?null:t},roleMatcher:n.tlRoleMatcher,roleSupportsProp(e,t){return typeof e==`string`&&(0,r.roleSupportsProp)(e,t)},computeAccessibleName(e,t,r){return(0,n.computeAccessibleNameImpl)(e,nameOptions(t,r),5)},computeAccessibleDescription(e,t,r){return(0,n.computeAccessibleDescriptionImpl)(e,nameOptions(t,r),5)},isInaccessible:n.isInaccessibleImpl,isInaccessibleWithStyle:n.isInaccessibleWithStyle,isSubtreeInaccessible:n.isSubtreeInaccessibleImpl};function parentElement(e){let n=e.parent;return n!==null&&n.type===t.ELEMENT_NODE?n:null}function isInaccessibleImpl$1(e){return f.isInaccessible(e)}e.M(isInaccessibleImpl$1,`isInaccessibleImpl`);function isInaccessibleChecked(e){let t=styleOverride(e);return t===null?f.isInaccessible(e):f.isInaccessibleWithStyle(e,t,null)}function isInaccessible(t,r={}){let i=e.A(t),a=r.isSubtreeInaccessible,o=styleOverride(i);if(a===void 0)return o===null?isInaccessibleImpl$1(i):f.isInaccessibleWithStyle(i,o,null);if(o===null?(0,n.isVisibilityHidden)(i):o(t).visibility===`hidden`)return!0;for(let e=i;e!==null;e=parentElement(e))if(a(e.node))return!0;return!1}function getImplicitAriaRolesImpl(e){let t=f.implicitRole(e);return t===null?[]:[t]}function getRoles(n,{hidden:r=!1}={}){let i=e.A(n),a={},o=r===!1?styleOverride(i):null,s=o===null?null:/* @__PURE__ */ new Map,visit=e=>{if(r!==!1||(o===null?isInaccessibleImpl$1(e):f.isInaccessibleWithStyle(e,o,s))===!1){let n=(0,t.attr)(e,`role`),r=n===null?getImplicitAriaRolesImpl(e):n.split(` `).slice(0,1);for(let t of r){let n=a[t];Array.isArray(n)?n.push(e.node):a[t]=[e.node]}}for(let n=e.first;n!==null;n=n.next)n.type===t.ELEMENT_NODE&&visit(n)};return visit(i),a}const p={format:`pretty`};function prettyRoles(t,{hidden:n,includeDescription:r}){let i=getRoles(t,{hidden:n}),a=e.i().computedStyleSupportsPseudoElements,o=styleOverride(e.A(t));return Object.entries(i).filter(([e])=>e!==`generic`).map(([t,n])=>{let i=`-`.repeat(50);return`${t}:\n\n${n.map(t=>{let n=e.A(t),i=`Name "${f.computeAccessibleName(n,a,o)}":\n`,s=e.s(t.cloneNode(!1),void 0,p);return r?`${i}${`Description "${f.computeAccessibleDescription(n,a,o)}":\n`}${s}`:`${i}${s}`}).join(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/aria-snapshot-diff-DKpjI9CA.cjs");let t=require("@ctrl/dom/internal"),n=require("@ctrl/dom/aria/internal"),r=require("@ctrl/dom/aria"),i=require("node:async_hooks");const a=/* @__PURE__ */ new Set([`button`,`input`,`meter`,`output`,`progress`,`select`,`textarea`]);function isLabelledNodeName(e){return e.prefix===null&&a.has(e.tag===0?(0,t.asciiLowercase)(e.name):e.name)}function buildIdMap(e){let n=/* @__PURE__ */ new Map;for(let r=e.first;r!==null;r=(0,t.nextInTree)(r,e))r.type===t.ELEMENT_NODE&&r.id!==``&&!n.has(r.id)&&n.set(r.id,r);return n}var LabelContext=class{container;containerIds;sameTree;labelMap;constructor(e,t=!1){this.container=e,this.containerIds=null,this.sameTree=t,this.labelMap=null}labelsOf(e){return this.sameTree?(this.labelMap??=(0,n.labelMapForTree)(this.container)).get(e)??o:(0,n.labelsOf)(e)??o}byIdInContainer(e){if(e===``)return null;if(this.containerIds===null){let n=(0,t.indexedDescendantById)(this.container,e);if(n!==void 0)return n;this.containerIds=buildIdMap(this.container)}return this.containerIds.get(e)??null}};const o=[];function getTextContent(e){let n=``;for(let r=e.first;r!==null;r=r.next)r.type===t.TEXT_NODE?n+=r.data:r.first===null||r.type===t.ELEMENT_NODE&&isLabelledNodeName(r)||(n+=getTextContent(r));return n}function getLabelContentImpl(e){if(e.tag===t.T.label&&e.ns===t.HTML_NS)return getTextContent(e);let n=e.node;return n.value||n.textContent}function labelledFormControl(n,r){for(let i=n.first;i!==null;i=(0,t.nextInTree)(i,n))if(i.type===t.ELEMENT_NODE&&a.has(i.name)&&(r===`*`||e.T(i,r)))return i}function getLabelsImpl(e,n,r=`*`){let i=(0,t.ariaAttr)(n,`aria-labelledby`);return i?i.split(` `).map(t=>{let n=e.byIdInContainer(t);return n?{content:getLabelContentImpl(n),formControl:null}:{content:``,formControl:null}}):e.labelsOf(n).map(e=>({content:getLabelContentImpl(e),formControl:labelledFormControl(e,r)}))}function assertNotNullOrUndefined(e){if(e==null)throw Error(`It looks like ${e} was passed instead of a matcher. Did you do something like getByText(${e})?`)}function fuzzyMatches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return typeof n==`string`||typeof n==`number`?i.toLowerCase().includes(n.toString().toLowerCase()):typeof n==`function`?n(i,t):matchRegExp(n,i)}function matches(e,t,n,r){if(typeof e!=`string`)return!1;assertNotNullOrUndefined(n);let i=r(e);return n instanceof Function?n(i,t):n instanceof RegExp?matchRegExp(n,i):i===String(n)}function isRegExpWhitespace(e){return e<=32?e===32||e>=9&&e<=13:e<160?!1:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function changedByNormalizing(e,t,n){let r=e.length-1,i=!1;for(let a=0;a<=r;a++){let o=e.charCodeAt(a),s=isRegExpWhitespace(o);if(s&&(t&&(a===0||a===r)||n&&(i||o!==32)))return!0;i=s}return!1}const s=/\s+/g;function getDefaultNormalizer({trim:e=!0,collapseWhitespace:t=!0}={}){return n=>{if(!changedByNormalizing(n,e,t))return n;let r=n;return r=e?r.trim():r,r=t?r.replace(s,` `):r,r}}const c=getDefaultNormalizer();function textMatcher(e,t,n){if(!e)return(e,r)=>fuzzyMatches(e,r,t,n);if(n===c&&isPlainRegExp(t)){let e;return n=>typeof n==`string`?n.length===0?e??=t.test(``):t.test(c(n)):!1}if(n!==c||typeof t!=`string`&&typeof t!=`number`)return(e,r)=>matches(e,r,t,n);let r=String(t);if(changedByNormalizing(r,!0,!0))return()=>!1;let i=r.length,a=r.charCodeAt(0),o=r.charCodeAt(i-1);return e=>{if(typeof e!=`string`||e.length<i)return!1;if(i!==0){let t=e.charCodeAt(0);if(t!==a&&!isRegExpWhitespace(t))return!1;let n=e.charCodeAt(e.length-1);if(n!==o&&!isRegExpWhitespace(n))return!1}return c(e)===r}}function resolveNormalizer(e,t,n){if(!n)return e===void 0&&t===void 0?c:getDefaultNormalizer({trim:e,collapseWhitespace:t});if(e!==void 0||t!==void 0)throw 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`);return n}function makeNormalizer({trim:e,collapseWhitespace:t,normalizer:n}){return resolveNormalizer(e,t,n)}const l=RegExp.prototype.exec;function isPlainRegExp(e){return e instanceof RegExp&&!e.global&&!e.sticky&&Object.getPrototypeOf(e)===RegExp.prototype&&!Object.hasOwn(e,`exec`)&&!Object.hasOwn(e,`test`)&&RegExp.prototype.exec===l&&RegExp.prototype.test===u}const u=RegExp.prototype.test;function matchRegExp(e,t){let n=e.test(t);return e.global&&e.lastIndex!==0&&(console.warn(`To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp.`),e.lastIndex=0),n}function isButtonLikeInput(e){if(e.tag!==t.T.input||e.ns!==t.HTML_NS)return!1;let n=(0,t.attr)(e,`type`);if(n===null)return!1;let r=(0,t.asciiLowercase)(n);return r===`submit`||r===`button`||r===`reset`}function getNodeTextImpl(e){if(isButtonLikeInput(e))return e.node.value;let n=e.first;if(n===null)return``;if(n===e.last)return n.type===t.TEXT_NODE?n.data:``;let r=``;for(let e=n;e!==null;e=e.next)e.type===t.TEXT_NODE&&(r+=e.data);return r}function getNodeText(n){let r=e.j(n);return r.type===t.ELEMENT_NODE?getNodeTextImpl(r):n.matches(`input[type=submit], input[type=button], input[type=reset]`)}const d={computedStyleSupportsPseudoElements:!0};function styleOverride(e){return(0,t.getComputedStyleOverride)(e)}function nameOptions(e,t){return t===null?e?d:void 0:{computedStyleSupportsPseudoElements:e,getComputedStyle:t}}const f={implicitRole(e){let t=(0,n.implicitRole)(e);return t===``?null:t},roleMatcher:n.tlRoleMatcher,roleSupportsProp(e,t){return typeof e==`string`&&(0,r.roleSupportsProp)(e,t)},computeAccessibleName(e,t,r){return(0,n.computeAccessibleNameImpl)(e,nameOptions(t,r),5)},computeAccessibleDescription(e,t,r){return(0,n.computeAccessibleDescriptionImpl)(e,nameOptions(t,r),5)},isInaccessible:n.isInaccessibleImpl,isInaccessibleWithStyle:n.isInaccessibleWithStyle,isSubtreeInaccessible:n.isSubtreeInaccessibleImpl};function parentElement(e){let n=e.parent;return n!==null&&n.type===t.ELEMENT_NODE?n:null}function isInaccessibleImpl$1(e){return f.isInaccessible(e)}e.N(isInaccessibleImpl$1,`isInaccessibleImpl`);function isInaccessibleChecked(e){let t=styleOverride(e);return t===null?f.isInaccessible(e):f.isInaccessibleWithStyle(e,t,null)}function isInaccessible(t,r={}){let i=e.j(t),a=r.isSubtreeInaccessible,o=styleOverride(i);if(a===void 0)return o===null?isInaccessibleImpl$1(i):f.isInaccessibleWithStyle(i,o,null);if(o===null?(0,n.isVisibilityHidden)(i):o(t).visibility===`hidden`)return!0;for(let e=i;e!==null;e=parentElement(e))if(a(e.node))return!0;return!1}function getImplicitAriaRolesImpl(e){let t=f.implicitRole(e);return t===null?[]:[t]}function getRoles(n,{hidden:r=!1}={}){let i=e.j(n),a={},o=r===!1?styleOverride(i):null,s=o===null?null:/* @__PURE__ */ new Map,visit=e=>{if(r!==!1||(o===null?isInaccessibleImpl$1(e):f.isInaccessibleWithStyle(e,o,s))===!1){let n=(0,t.attr)(e,`role`),r=n===null?getImplicitAriaRolesImpl(e):n.split(` `).slice(0,1);for(let t of r){let n=a[t];Array.isArray(n)?n.push(e.node):a[t]=[e.node]}}for(let n=e.first;n!==null;n=n.next)n.type===t.ELEMENT_NODE&&visit(n)};return visit(i),a}const p={format:`pretty`};function prettyRoles(t,{hidden:n,includeDescription:r}){let i=getRoles(t,{hidden:n}),a=e.i().computedStyleSupportsPseudoElements,o=styleOverride(e.j(t));return Object.entries(i).filter(([e])=>e!==`generic`).map(([t,n])=>{let i=`-`.repeat(50);return`${t}:\n\n${n.map(t=>{let n=e.j(t),i=`Name "${f.computeAccessibleName(n,a,o)}":\n`,s=e.s(t.cloneNode(!1),void 0,p);return r?`${i}${`Description "${f.computeAccessibleDescription(n,a,o)}":\n`}${s}`:`${i}${s}`}).join(`
2
2
 
3
3
  `)}\n\n${i}`}).join(`
4
- `)}const logRoles=(e,{hidden:t=!1}={})=>console.log(prettyRoles(e,{hidden:t}));function checkBooleanAttribute(e,n){let r=(0,t.attr)(e,n);if(r===`true`)return!0;if(r===`false`)return!1}function computeAriaSelected(e){return e.tag===t.T.option&&e.ns===t.HTML_NS?e.node.selected:checkBooleanAttribute(e,`aria-selected`)}function computeAriaBusy(e){return(0,t.ariaAttr)(e,`aria-busy`)===`true`}function computeAriaChecked(e){let t=e.node;if(!(`indeterminate`in t&&t.indeterminate))return`checked`in t?t.checked:checkBooleanAttribute(e,`aria-checked`)}function computeAriaPressed(e){return checkBooleanAttribute(e,`aria-pressed`)}function computeAriaCurrent(e){return checkBooleanAttribute(e,`aria-current`)??(0,t.ariaAttr)(e,`aria-current`)??!1}function computeAriaExpanded(e){return checkBooleanAttribute(e,`aria-expanded`)}function computeHeadingLevelImpl(e){let n=(0,t.ariaAttr)(e,`aria-level`),r=n&&Number(n);if(r)return r;if(e.ns===t.HTML_NS)switch(e.tag){case t.T.h1:return 1;case t.T.h2:return 2;case t.T.h3:return 3;case t.T.h4:return 4;case t.T.h5:return 5;case t.T.h6:return 6}}function computeAriaValueNow(e){let n=(0,t.ariaAttr)(e,`aria-valuenow`);return n===null?void 0:+n}function computeAriaValueMax(e){let n=(0,t.ariaAttr)(e,`aria-valuemax`);return n===null?void 0:+n}function computeAriaValueMin(e){let n=(0,t.ariaAttr)(e,`aria-valuemin`);return n===null?void 0:+n}function computeAriaValueText(e){let n=(0,t.ariaAttr)(e,`aria-valuetext`);return n===null?void 0:n}const m=getDefaultNormalizer();function escapeRegExp(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}function getRegExpMatcher(e){return new RegExp(escapeRegExp(e.toLowerCase()),`i`)}function makeSuggestion(t,n,r,{variant:i,name:a}){let o=``,s={},c=[[`Role`,`TestId`].includes(t)?r:getRegExpMatcher(r)];a&&(s.name=getRegExpMatcher(a)),t===`Role`&&isInaccessibleChecked(e.A(n))&&(s.hidden=!0,o=`Element is inaccessible. This means that the element and all its children are invisible to screen readers.
4
+ `)}const logRoles=(e,{hidden:t=!1}={})=>console.log(prettyRoles(e,{hidden:t}));function checkBooleanAttribute(e,n){let r=(0,t.attr)(e,n);if(r===`true`)return!0;if(r===`false`)return!1}function computeAriaSelected(e){return e.tag===t.T.option&&e.ns===t.HTML_NS?e.node.selected:checkBooleanAttribute(e,`aria-selected`)}function computeAriaBusy(e){return(0,t.ariaAttr)(e,`aria-busy`)===`true`}function computeAriaChecked(e){let t=e.node;if(!(`indeterminate`in t&&t.indeterminate))return`checked`in t?t.checked:checkBooleanAttribute(e,`aria-checked`)}function computeAriaPressed(e){return checkBooleanAttribute(e,`aria-pressed`)}function computeAriaCurrent(e){return checkBooleanAttribute(e,`aria-current`)??(0,t.ariaAttr)(e,`aria-current`)??!1}function computeAriaExpanded(e){return checkBooleanAttribute(e,`aria-expanded`)}function computeHeadingLevelImpl(e){let n=(0,t.ariaAttr)(e,`aria-level`),r=n&&Number(n);if(r)return r;if(e.ns===t.HTML_NS)switch(e.tag){case t.T.h1:return 1;case t.T.h2:return 2;case t.T.h3:return 3;case t.T.h4:return 4;case t.T.h5:return 5;case t.T.h6:return 6}}function computeAriaValueNow(e){let n=(0,t.ariaAttr)(e,`aria-valuenow`);return n===null?void 0:+n}function computeAriaValueMax(e){let n=(0,t.ariaAttr)(e,`aria-valuemax`);return n===null?void 0:+n}function computeAriaValueMin(e){let n=(0,t.ariaAttr)(e,`aria-valuemin`);return n===null?void 0:+n}function computeAriaValueText(e){let n=(0,t.ariaAttr)(e,`aria-valuetext`);return n===null?void 0:n}const m=getDefaultNormalizer();function escapeRegExp(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}function getRegExpMatcher(e){return new RegExp(escapeRegExp(e.toLowerCase()),`i`)}function makeSuggestion(t,n,r,{variant:i,name:a}){let o=``,s={},c=[[`Role`,`TestId`].includes(t)?r:getRegExpMatcher(r)];a&&(s.name=getRegExpMatcher(a)),t===`Role`&&isInaccessibleChecked(e.j(n))&&(s.hidden=!0,o=`Element is inaccessible. This means that the element and all its children are invisible to screen readers.
5
5
  If you are using the aria-hidden prop, make sure this is the right choice for your case.
6
- `),Object.keys(s).length>0&&c.push(s);let l=`${i}By${t}`;return{queryName:t,queryMethod:l,queryArgs:c,variant:i,warning:o,toString(){o&&console.warn(o);let[e,t]=c;return e=typeof e==`string`?`'${e}'`:e,t=t?`, { ${Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`, `)} }`:``,`${l}(${e}${t})`}}}function canSuggest(e,t,n){return!(!n||t&&t.toLowerCase()!==e.toLowerCase())}function getSuggestedQuery(n,r=`get`,i){let a=e.A(n);if(e.T(a,e.i().defaultIgnore))return;let o=(0,t.attr)(a,`role`)??getImplicitAriaRolesImpl(a)?.[0];if(o!==`generic`&&canSuggest(`Role`,i,o))return makeSuggestion(`Role`,n,o,{variant:r,name:f.computeAccessibleName(a,e.i().computedStyleSupportsPseudoElements,styleOverride(a))});let s=getLabelsImpl(new LabelContext(e.A(e.O())),a).map(e=>e.content).join(` `);if(canSuggest(`LabelText`,i,s))return makeSuggestion(`LabelText`,n,s,{variant:r});let c=(0,t.attr)(a,`placeholder`);if(canSuggest(`PlaceholderText`,i,c))return makeSuggestion(`PlaceholderText`,n,c,{variant:r});let l=m(getNodeTextImpl(a));if(canSuggest(`Text`,i,l))return makeSuggestion(`Text`,n,l,{variant:r});if(canSuggest(`DisplayValue`,i,n.value))return makeSuggestion(`DisplayValue`,n,m(n.value),{variant:r});let u=(0,t.attr)(a,`alt`);if(canSuggest(`AltText`,i,u))return makeSuggestion(`AltText`,n,u,{variant:r});let d=(0,t.attr)(a,`title`);if(canSuggest(`Title`,i,d))return makeSuggestion(`Title`,n,d,{variant:r});let p=n.getAttribute(e.i().testIdAttribute);if(canSuggest(`TestId`,i,p))return makeSuggestion(`TestId`,n,p,{variant:r})}function copyStackTrace(e,t){e.stack=t.stack.replace(t.message,e.message)}function waitForImpl(t,{container:n=e.O(),timeout:r=e.i().asyncUtilTimeout,showOriginalStackTrace:a=e.i().showOriginalStackTrace,stackTraceError:o,interval:s=50,onTimeout:c=t=>(t.name===`TestingLibraryElementError`&&e.w()!==null||Object.defineProperty(t,"message",{value:e.i().getElementError(t.message,n).message}),t),mutationObserverOptions:l={subtree:!0,childList:!0,attributes:!0,characterData:!0}},u=null){if(typeof t!=`function`)throw TypeError("Received `callback` arg must be a function");return new Promise(async(d,f)=>{let p,m,h,g=!1,_=`idle`,v=setTimeout(handleTimeout,r),y=e.j();if(y){let{unstable_advanceTimersWrapper:t}=e.i();for(checkCallback();!g;){if(!e.j()){let e=/* @__PURE__ */ 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`);a||copyStackTrace(e,o),f(e);return}if(await t(async()=>{e.E(s)}),g)break;checkCallback()}}else{try{e.D(n)}catch(e){g=!0,clearTimeout(v),f(e);return}let t=u===null?null:i.AsyncLocalStorage.snapshot(),r=t===null?checkRealTimersCallback:()=>t(checkRealTimersCallback);m=setInterval(r,s);let{MutationObserver:a}=e.k(n);h=new a(r),h.observe(n,l),checkCallback()}function onDone(e,t){g=!0,clearTimeout(v),y||(clearInterval(m),h.disconnect()),e?f(e):d(t)}function checkRealTimersCallback(){if(e.j()){let e=/* @__PURE__ */ 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`);return a||copyStackTrace(e,o),f(e)}return checkCallback()}function checkCallback(){if(_!==`pending`){u!==null&&(u.data.checks=(u.data.checks??0)+1);try{let n=e.a(t,!y);typeof n?.then==`function`?(_=`pending`,n.then(e=>{_=`resolved`,onDone(null,e)},e=>{_=`rejected`,p=e})):onDone(null,n)}catch(e){p=e}}}function handleTimeout(){let e;p?(e=p,!a&&e.name===`TestingLibraryElementError`&&copyStackTrace(e,o)):(e=/* @__PURE__ */ Error(`Timed out in waitFor.`),a||copyStackTrace(e,o)),onDone(c(e),null)}})}function waitFor(e,n){return(0,t.tracing)()?(0,t.tracePromise)(`testing-library.wait_for`,`waitFor(${describeCallback(e)})`,t=>waitForInSpan(e,n,t)):waitForInSpan(e,n,null)}function waitForInSpan(t,n,r){let i=/* @__PURE__ */ Error(`STACK_TRACE_MESSAGE`);return e.i().asyncWrapper(()=>waitForImpl(t,{stackTraceError:i,...n},r))}function describeCallback(e){if(typeof e!=`function`)return String(e);let t=Function.prototype.toString.call(e).replace(/\s+/g,` `).replace(/__vite_ssr_import_\d+__\./g,``).replace(/\(0, ?([\w$.]+)\)/g,`$1`).replace(/(?<![\w$.])_[a-z][\w$]*\.(?=[\w$])/g,``),n=/^(async )?\(\) ?=> ?\{ ?(?:return )?(.*?);? ?\}$/.exec(t);return n!==null&&!n[2].includes(`;`)&&(t=`${n[1]??``}() => ${n[2]}`),t.length>120?`${t.slice(0,119)}…`:t}function getElementError(t,n){return e.i().getElementError(t,n)}function getMultipleElementsFoundError(e,t){return getElementError(`${e}\n\n(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).`,t)}function queryAllByAttribute(n,r,i,{exact:a=!0,collapseWhitespace:o,trim:s,normalizer:c}={}){let l=textMatcher(a,i,makeNormalizer({collapseWhitespace:o,trim:s,normalizer:c})),u=e.A(r),d=(0,t.asciiLowercase)(n),f=(0,t.prefixFlag)(d),p=(0,t.prefixFlag)(n),m=[];for(let e=u.first;e!==null;e=(0,t.nextInTree)(e,u)){if(e.type!==t.ELEMENT_NODE||e.attrs===null)continue;let r=(e.flags&t.F_HTML)!==0,i=r?f:p;if(i!==0&&(e.flags&i)===0)continue;let a=(0,t.attr)(e,r?d:n);a!==null&&l(a,e.node)&&m.push(e.node)}return m}function queryByAttribute(e,t,n,r){let i=queryAllByAttribute(e,t,n,r);if(i.length>1)throw getMultipleElementsFoundError(`Found multiple elements by [${e}=${n}]`,t);return i[0]||null}function makeSingleQuery(t,n){return(r,...i)=>{let a=t(r,...i);if(a.length>1){let t=e.w()===null?a.map(e=>getElementError(null,e).message).join(`
6
+ `),Object.keys(s).length>0&&c.push(s);let l=`${i}By${t}`;return{queryName:t,queryMethod:l,queryArgs:c,variant:i,warning:o,toString(){o&&console.warn(o);let[e,t]=c;return e=typeof e==`string`?`'${e}'`:e,t=t?`, { ${Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`, `)} }`:``,`${l}(${e}${t})`}}}function canSuggest(e,t,n){return!(!n||t&&t.toLowerCase()!==e.toLowerCase())}function getSuggestedQuery(n,r=`get`,i){let a=e.j(n);if(e.T(a,e.i().defaultIgnore))return;let o=(0,t.attr)(a,`role`)??getImplicitAriaRolesImpl(a)?.[0];if(o!==`generic`&&canSuggest(`Role`,i,o))return makeSuggestion(`Role`,n,o,{variant:r,name:f.computeAccessibleName(a,e.i().computedStyleSupportsPseudoElements,styleOverride(a))});let s=getLabelsImpl(new LabelContext(e.j(e.k())),a).map(e=>e.content).join(` `);if(canSuggest(`LabelText`,i,s))return makeSuggestion(`LabelText`,n,s,{variant:r});let c=(0,t.attr)(a,`placeholder`);if(canSuggest(`PlaceholderText`,i,c))return makeSuggestion(`PlaceholderText`,n,c,{variant:r});let l=m(getNodeTextImpl(a));if(canSuggest(`Text`,i,l))return makeSuggestion(`Text`,n,l,{variant:r});if(canSuggest(`DisplayValue`,i,n.value))return makeSuggestion(`DisplayValue`,n,m(n.value),{variant:r});let u=(0,t.attr)(a,`alt`);if(canSuggest(`AltText`,i,u))return makeSuggestion(`AltText`,n,u,{variant:r});let d=(0,t.attr)(a,`title`);if(canSuggest(`Title`,i,d))return makeSuggestion(`Title`,n,d,{variant:r});let p=n.getAttribute(e.i().testIdAttribute);if(canSuggest(`TestId`,i,p))return makeSuggestion(`TestId`,n,p,{variant:r})}function copyStackTrace(e,t){e.stack=t.stack.replace(t.message,e.message)}const h={subtree:!0,childList:!0,attributes:!0,characterData:!0};function defaultOnTimeout(t,n){return t.name===`TestingLibraryElementError`&&e.w()!==null||Object.defineProperty(t,"message",{value:e.i().getElementError(t.message,n).message}),t}function waitForImpl(t,n,r,{container:a=e.k(),timeout:o=e.i().asyncUtilTimeout,showOriginalStackTrace:s=e.i().showOriginalStackTrace,stackTraceError:c=n,interval:l=50,onTimeout:u,mutationObserverOptions:d=h}){if(typeof t!=`function`)throw TypeError("Received `callback` arg must be a function");return new Promise((n,f)=>{let p,m,h,g=!1,_=`idle`,v=setTimeout(handleTimeout,o),y=e.M();if(y){let{unstable_advanceTimersWrapper:t}=e.i();checkCallback(),g||(async()=>{for(;!g;){if(!e.M()){let e=/* @__PURE__ */ 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`);s||copyStackTrace(e,c),f(e);return}if(await t(async()=>{e.D(l)}),g)break;checkCallback()}})()}else{try{e.O(a)}catch(e){g=!0,clearTimeout(v),f(e);return}let t=r===null?null:i.AsyncLocalStorage.snapshot(),n=t===null?checkRealTimersCallback:()=>t(checkRealTimersCallback);m=setInterval(n,l);let{MutationObserver:o}=e.A(a);h=new o(n),h.observe(a,d),checkCallback()}function onDone(e,t){g=!0,clearTimeout(v),y||(clearInterval(m),h.disconnect()),e?f(e):n(t)}function checkRealTimersCallback(){if(e.M()){let e=/* @__PURE__ */ 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`);return s||copyStackTrace(e,c),f(e)}return checkCallback()}function checkCallback(){if(_!==`pending`){r!==null&&(r.data.checks=(r.data.checks??0)+1);try{let n=e.a(t,!y);typeof n?.then==`function`?(_=`pending`,n.then(e=>{_=`resolved`,onDone(null,e)},e=>{_=`rejected`,p=e})):onDone(null,n)}catch(e){p=e}}}function handleTimeout(){let e;p?(e=p,!s&&e.name===`TestingLibraryElementError`&&copyStackTrace(e,c)):(e=/* @__PURE__ */ Error(`Timed out in waitFor.`),s||copyStackTrace(e,c)),onDone(u===void 0?defaultOnTimeout(e,a):u(e),null)}})}function waitFor(e,n){return(0,t.tracing)()?(0,t.tracePromise)(`testing-library.wait_for`,`waitFor(${describeCallback(e)})`,t=>waitForInSpan(e,n,t)):waitForInSpan(e,n,null)}function waitForInSpan(t,n,r){let i=/* @__PURE__ */ Error(`STACK_TRACE_MESSAGE`);return e.i().asyncWrapper(()=>waitForImpl(t,i,r,n??e.E))}function describeCallback(e){if(typeof e!=`function`)return String(e);let t=Function.prototype.toString.call(e).replace(/\s+/g,` `).replace(/__vite_ssr_import_\d+__\./g,``).replace(/\(0, ?([\w$.]+)\)/g,`$1`).replace(/(?<![\w$.])_[a-z][\w$]*\.(?=[\w$])/g,``),n=/^(async )?\(\) ?=> ?\{ ?(?:return )?(.*?);? ?\}$/.exec(t);return n!==null&&!n[2].includes(`;`)&&(t=`${n[1]??``}() => ${n[2]}`),t.length>120?`${t.slice(0,119)}…`:t}function getElementError(t,n){return e.i().getElementError(t,n)}function getMultipleElementsFoundError(e,t){return getElementError(`${e}\n\n(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).`,t)}function queryAllByAttribute(n,r,i,{exact:a=!0,collapseWhitespace:o,trim:s,normalizer:c}=e.E){let l=textMatcher(a,i,resolveNormalizer(s,o,c)),u=e.j(r),d=(0,t.asciiLowercase)(n),f=(0,t.prefixFlag)(d),p=(0,t.prefixFlag)(n),m=[];for(let e=u.first;e!==null;e=(0,t.nextInTree)(e,u)){if(e.type!==t.ELEMENT_NODE||e.attrs===null)continue;let r=(e.flags&t.F_HTML)!==0,i=r?f:p;if(i!==0&&(e.flags&i)===0)continue;let a=(0,t.attr)(e,r?d:n);a!==null&&l(a,e.node)&&m.push(e.node)}return m}function queryByAttribute(e,t,n,r){let i=queryAllByAttribute(e,t,n,r);if(i.length>1)throw getMultipleElementsFoundError(`Found multiple elements by [${e}=${n}]`,t);return i[0]||null}function shouldSuggest(t){let n=t.at(-1)?.suggest;return n===void 0?e.i().throwSuggestions:n}function makeSingleQuery(t,n){return(r,...i)=>{let a=t(r,...i);if(a.length>1){let t=e.w()===null?a.map(e=>getElementError(null,e).message).join(`
7
7
 
8
8
  `):a.map(t=>e.C(t)).join(`
9
9
  `);throw getMultipleElementsFoundError(`${n(r,...i)}
@@ -12,10 +12,10 @@ Here are the matching elements:
12
12
 
13
13
  ${t}`,r)}return a[0]||null}}function getSuggestionError(t,n){return e.i().getElementError(`A better query is available, try this:
14
14
  ${t.toString()}
15
- `,n)}function makeGetAllQuery(t,n){return(r,...i)=>{let a=t(r,...i);if(!a.length)throw e.i().getElementError(n(r,...i),r);return a}}function makeFindQuery(e,n=`find`){return(r,i,a,o)=>{let find=t=>waitForInSpan(()=>e(r,i,a),{container:r,...o},t);return(0,t.tracing)()?(0,t.tracePromise)(h,(0,t.describeCall)(n,[i,a]),async e=>{let t=await find(e);return e.data.matches=matchCount(t),t}):find(null)}}const h=`testing-library.query`,matchCount=e=>Array.isArray(e)?e.length:+!!e;function traceQuery(e,n){return(r,...i)=>(0,t.tracing)()?(0,t.traceSync)(h,(0,t.describeCall)(e,i),e=>{let t=n(r,...i);return e.data.matches=matchCount(t),t}):n(r,...i)}const wrapSingleQueryWithSuggestion=(t,n,r)=>(i,...a)=>{let o=t(i,...a),[{suggest:s=e.i().throwSuggestions}={}]=a.slice(-1);if(o&&s){let e=getSuggestedQuery(o,r);if(e&&!n.endsWith(e.queryName))throw getSuggestionError(e.toString(),i)}return o},wrapAllByQueryWithSuggestion=(t,n,r)=>(i,...a)=>{let o=t(i,...a),[{suggest:s=e.i().throwSuggestions}={}]=a.slice(-1);if(o.length&&s){let e=[...new Set(o.map(e=>getSuggestedQuery(e,r)?.toString()))];if(e.length===1&&!n.endsWith(getSuggestedQuery(o[0],r).queryName))throw getSuggestionError(e[0],i)}return o};function buildQueries(e,t,n){let r=wrapSingleQueryWithSuggestion(makeSingleQuery(e,t),e.name,`query`),i=makeGetAllQuery(e,n),a=makeSingleQuery(i,t),o=wrapSingleQueryWithSuggestion(a,e.name,`get`),s=wrapAllByQueryWithSuggestion(i,e.name.replace(`query`,`get`),`getAll`),c=e.name.startsWith(`queryAll`)?e.name.slice(8):``,l=makeFindQuery(wrapAllByQueryWithSuggestion(i,e.name,`findAll`),`findAll${c}`),u=makeFindQuery(wrapSingleQueryWithSuggestion(a,e.name,`find`),`find${c}`);return[traceQuery(`query${c}`,r),traceQuery(`getAll${c}`,s),traceQuery(`get${c}`,o),l,u]}const g=/* @__PURE__ */ new Set([``,`generic`,`none`,`presentation`]),_=/* @__PURE__ */ e.M(e=>e,`identity`);function normalize(e){return e.replace(/\s+/g,` `).trim()}function similarity(e,t){let n=normalize(e).toLowerCase(),r=normalize(t).toLowerCase();if(n===``||r===``)return-1;if(n===r)return 0;if(n.includes(r)||r.includes(n))return 1;let i=r.split(` `);for(let e=0;e<i.length;e++)if(i[e].length>2&&n.includes(i[e]))return 2;return-1}function closeness(e,t,n,r,i=!0){if((i?matches:fuzzyMatches)(e,t,n,r))return 0;if(typeof n==`string`||typeof n==`number`){let t=similarity(r(e),String(n));return t===-1?-1:t+1}return-1}function line(t,n,r,i,a){let o={role:n,name:r,props:e.v(t,n,!1,i),value:null,url:null,children:[],element:t};return`- ${e._(o,80)} # ${a}`}function format(e,t){if(t.length===0)return``;t.sort((e,t)=>e.rank-t.rank);let n=t.slice(0,10).map(e=>e.line);return t.length>10&&n.push(`# … ${t.length-10} more`),`${e}:\n${n.join(`
16
- `)}`}function nameOf(e){return normalize((0,n.computeAccessibleNameImpl)(e,void 0,5))}function roleCandidates(r,i){let a=e.A(r),o=[],s=i.name;for(let r=a.first;r!==null;r=(0,t.nextInTree)(r,a)){if(r.type!==t.ELEMENT_NODE)continue;let a=(0,n.isInaccessibleImpl)(r),c=(0,n.tlRole)(r);if((0,n.tlRoleMatches)(r,i.role,i.queryFallbacks)){let t=nameOf(r),n=s===void 0?0:closeness(t,r.node,s,_),l=i.matchesState(r);n===0&&l?a&&!i.hidden&&o.push({line:line(r,c,t,!0,`hidden: ${e.h(r)} (or pass { hidden: true })`),rank:0}):n===0?o.push({line:line(r,c,t,a&&!i.hidden,`role and name match, state is not ${i.stateHint}`),rank:1}):(!a||i.hidden)&&o.push({line:line(r,c,t,!1,n>0?`similar name`:`same role, other name`),rank:n>0?2+n:10});continue}if(s===void 0)continue;if(!g.has(c)){let e=nameOf(r);if(e===``)continue;let t=closeness(e,r.node,s,_);t>=0&&o.push({line:line(r,c,e,a&&!i.hidden,`same name, role "${c}"`),rank:2+t});continue}let l=normalize(getNodeTextImpl(r));l!==``&&closeness(l,r.node,s,_)===0&&o.push({line:`- text: ${e.y(e.x(l,80))} # in ${e.p(r)}, which has no role: give it role="${i.role}" or use getByText`,rank:2})}return format(`Closest matches`,o)}function roleOrTag(t){let r=(0,n.tlRole)(t);return g.has(r)?e.p(t):r}function textCandidates(n,r,i,a,o,s){if(typeof r==`function`)return``;let c=e.A(n),l=[],u=[];for(let n=c.first;n!==null;n=(0,t.nextInTree)(n,c)){if(n.type!==t.ELEMENT_NODE||o&&typeof o==`string`&&e.T(n,o))continue;let c=getNodeTextImpl(n),d=c.trim()===``?-1:closeness(c,n.node,r,i,s);d===0?l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # matches, but not selector "${a}"`,rank:0}):d>0&&l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # similar text in ${e.p(n)}`,rank:1+d}),d!==0&&n.first!==null&&n.first!==n.last&&(s?matches:fuzzyMatches)(n.node.textContent,n.node,r,i)&&u.push(n)}for(let t=0;t<u.length;t++){let n=u[t],r=!1;for(let e=t+1;e<u.length&&!r;e++)isAncestor(n,u[e])&&(r=!0);r||l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(n.node.textContent),80))} # text split across child elements of ${e.p(n)}: use a function matcher or getByRole`,rank:0})}return format(`Closest matches`,l)}function isAncestor(e,t){for(let n=t.parent;n!==null;n=n.parent)if(n===e)return!0;return!1}const v=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`]);function labelCandidates(r,i,a,o){if(typeof i==`function`)return``;let s=e.A(r),c=[];for(let r=s.first;r!==null;r=(0,t.nextInTree)(r,s)){if(r.type!==t.ELEMENT_NODE)continue;let s=(0,n.tlRole)(r);if(!v.has(s))continue;let l=nameOf(r),u=(0,n.isInaccessibleImpl)(r);if(l===``){let n=(0,t.attr)(r,`placeholder`),o=n?`no label, placeholder ${e.y(n)}: use getByPlaceholderText or add a <label>`:`no label: add a <label>, aria-label or aria-labelledby`;c.push({line:line(r,s,``,u,o),rank:n&&closeness(n,r.node,i,a)>=0?1:5});continue}let d=closeness(l,r.node,i,a,o);c.push({line:line(r,s,l,u,d>=0?`similar label`:`labelled control`),rank:d>=0?2+d:10})}return format(`Labelled form controls`,c)}function queryAllLabels(n){let r=e.A(n),i=[];for(let e=r.first;e!==null;e=(0,t.nextInTree)(e,r)){if(e.type!==t.ELEMENT_NODE||e.name!==`label`&&e.name!==`input`)continue;let n=getLabelContentImpl(e);n!==null&&i.push({node:e.node,textToMatch:n})}return i}function queryAllLabelsByText(e,t,{exact:n=!0,trim:r,collapseWhitespace:i,normalizer:a}={}){let o=textMatcher(n,t,makeNormalizer({collapseWhitespace:i,trim:r,normalizer:a}));return queryAllLabels(e).filter(({node:e,textToMatch:t})=>o(t,e)).map(({node:e})=>e)}function queryAllByLabelText(r,i,{selector:a=`*`,exact:o=!0,collapseWhitespace:s,trim:c,normalizer:l}={}){e.D(r);let u=textMatcher(o,i,makeNormalizer({collapseWhitespace:s,trim:c,normalizer:l})),d=e.A(r),f=new LabelContext(d,!0),p=[],m=[];for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d)){if(e.type!==t.ELEMENT_NODE)continue;(0,t.ariaAttr)(e,`aria-label`)!==null&&m.push(e);let r=(0,t.ariaAttr)(e,`aria-labelledby`);(r!==null||(0,n.isLabelable)(e))&&collectLabelled(f,e,r,a,u,p)}for(let e=0;e<m.length;e++){let n=m[e];u((0,t.ariaAttr)(n,`aria-label`),n.node)&&p.push(n.node)}let h=p.length>1?Array.from(new Set(p)):p;return a===`*`?h:h.filter(n=>e.T(n[t.$impl],a))}function collectLabelled(e,t,n,r,i,a){if(!n){let o=e.labelsOf(t);if(o.length===0&&n===null)return;if(o.length===1){let e=o[0],n=getLabelContentImpl(e),s=labelledFormControl(e,r);s&&i(n,s.node)&&a.push(s.node),i(n,t.node)&&a.push(t.node);return}}else if(!n.includes(` `)){let r=e.byIdInContainer(n);i(`${(r===null?``:getLabelContentImpl(r))||``}`,t.node)&&a.push(t.node);return}let o=getLabelsImpl(e,t,r);for(let e of o){if(!e.formControl)continue;let t=e.formControl.node;i(e.content,t)&&a.push(t)}let s=o.filter(e=>!!e.content).map(e=>e.content),c=t.node;i(s.join(` `),c)&&a.push(c),s.length>1&&s.forEach((e,t)=>{i(e,c)&&a.push(c);let n=[...s];n.splice(t,1),n.length>1&&i(n.join(` `),c)&&a.push(c)})}function getAllByLabelText(t,n,...r){let i=queryAllByLabelText(t,n,...r);if(!i.length){let i=queryAllLabelsByText(t,n,...r);if(i.length){let r=i.map(e=>getTagNameOfElementAssociatedWithLabelViaFor(t,e)).filter(e=>!!e);throw r.length?e.i().getElementError(r.map(e=>`Found a label with the text of: ${n}, however the element associated with this label (<${e} />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <${e} />, you can use aria-label or aria-labelledby instead.`).join(`
15
+ `,n)}function makeGetAllQuery(t,n){return(r,...i)=>{let a=t(r,...i);if(!a.length)throw e.i().getElementError(n(r,...i),r);return a}}function makeFindQuery(e,n=`find`){return(r,i,a,o)=>{let find=t=>waitForInSpan(()=>e(r,i,a),{container:r,...o},t);return(0,t.tracing)()?(0,t.tracePromise)(g,(0,t.describeCall)(n,[i,a]),async e=>{let t=await find(e);return e.data.matches=matchCount(t),t}):find(null)}}const g=`testing-library.query`,matchCount=e=>Array.isArray(e)?e.length:+!!e;function traceQuery(e,n){return(r,...i)=>(0,t.tracing)()?(0,t.traceSync)(g,(0,t.describeCall)(e,i),e=>{let t=n(r,...i);return e.data.matches=matchCount(t),t}):n(r,...i)}const wrapSingleQueryWithSuggestion=(e,t,n)=>(r,...i)=>{let a=e(r,...i);if(a&&shouldSuggest(i)){let e=getSuggestedQuery(a,n);if(e&&!t.endsWith(e.queryName))throw getSuggestionError(e.toString(),r)}return a},wrapAllByQueryWithSuggestion=(e,t,n)=>(r,...i)=>{let a=e(r,...i);if(a.length&&shouldSuggest(i)){let e=[...new Set(a.map(e=>getSuggestedQuery(e,n)?.toString()))];if(e.length===1&&!t.endsWith(getSuggestedQuery(a[0],n).queryName))throw getSuggestionError(e[0],r)}return a};function buildQueries(e,t,n){let r=wrapSingleQueryWithSuggestion(makeSingleQuery(e,t),e.name,`query`),i=makeGetAllQuery(e,n),a=makeSingleQuery(i,t),o=wrapSingleQueryWithSuggestion(a,e.name,`get`),s=wrapAllByQueryWithSuggestion(i,e.name.replace(`query`,`get`),`getAll`),c=e.name.startsWith(`queryAll`)?e.name.slice(8):``,l=makeFindQuery(wrapAllByQueryWithSuggestion(i,e.name,`findAll`),`findAll${c}`),u=makeFindQuery(wrapSingleQueryWithSuggestion(a,e.name,`find`),`find${c}`);return[traceQuery(`query${c}`,r),traceQuery(`getAll${c}`,s),traceQuery(`get${c}`,o),l,u]}const _=/* @__PURE__ */ new Set([``,`generic`,`none`,`presentation`]),v=/* @__PURE__ */ e.N(e=>e,`identity`);function normalize(e){return e.replace(/\s+/g,` `).trim()}function similarity(e,t){let n=normalize(e).toLowerCase(),r=normalize(t).toLowerCase();if(n===``||r===``)return-1;if(n===r)return 0;if(n.includes(r)||r.includes(n))return 1;let i=r.split(` `);for(let e=0;e<i.length;e++)if(i[e].length>2&&n.includes(i[e]))return 2;return-1}function closeness(e,t,n,r,i=!0){if((i?matches:fuzzyMatches)(e,t,n,r))return 0;if(typeof n==`string`||typeof n==`number`){let t=similarity(r(e),String(n));return t===-1?-1:t+1}return-1}function line(t,n,r,i,a){let o={role:n,name:r,props:e.v(t,n,!1,i),value:null,url:null,children:[],element:t};return`- ${e._(o,80)} # ${a}`}function format(e,t){if(t.length===0)return``;t.sort((e,t)=>e.rank-t.rank);let n=t.slice(0,10).map(e=>e.line);return t.length>10&&n.push(`# … ${t.length-10} more`),`${e}:\n${n.join(`
16
+ `)}`}function nameOf(e){return normalize((0,n.computeAccessibleNameImpl)(e,void 0,5))}function roleCandidates(r,i){let a=e.j(r),o=[],s=i.name;for(let r=a.first;r!==null;r=(0,t.nextInTree)(r,a)){if(r.type!==t.ELEMENT_NODE)continue;let a=(0,n.isInaccessibleImpl)(r),c=(0,n.tlRole)(r);if((0,n.tlRoleMatches)(r,i.role,i.queryFallbacks)){let t=nameOf(r),n=s===void 0?0:closeness(t,r.node,s,v),l=i.matchesState(r);n===0&&l?a&&!i.hidden&&o.push({line:line(r,c,t,!0,`hidden: ${e.h(r)} (or pass { hidden: true })`),rank:0}):n===0?o.push({line:line(r,c,t,a&&!i.hidden,`role and name match, state is not ${i.stateHint}`),rank:1}):(!a||i.hidden)&&o.push({line:line(r,c,t,!1,n>0?`similar name`:`same role, other name`),rank:n>0?2+n:10});continue}if(s===void 0)continue;if(!_.has(c)){let e=nameOf(r);if(e===``)continue;let t=closeness(e,r.node,s,v);t>=0&&o.push({line:line(r,c,e,a&&!i.hidden,`same name, role "${c}"`),rank:2+t});continue}let l=normalize(getNodeTextImpl(r));l!==``&&closeness(l,r.node,s,v)===0&&o.push({line:`- text: ${e.y(e.x(l,80))} # in ${e.p(r)}, which has no role: give it role="${i.role}" or use getByText`,rank:2})}return format(`Closest matches`,o)}function roleOrTag(t){let r=(0,n.tlRole)(t);return _.has(r)?e.p(t):r}function textCandidates(n,r,i,a,o,s){if(typeof r==`function`)return``;let c=e.j(n),l=[],u=[];for(let n=c.first;n!==null;n=(0,t.nextInTree)(n,c)){if(n.type!==t.ELEMENT_NODE||o&&typeof o==`string`&&e.T(n,o))continue;let c=getNodeTextImpl(n),d=c.trim()===``?-1:closeness(c,n.node,r,i,s);d===0?l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # matches, but not selector "${a}"`,rank:0}):d>0&&l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(c),80))} # similar text in ${e.p(n)}`,rank:1+d}),d!==0&&n.first!==null&&n.first!==n.last&&(s?matches:fuzzyMatches)(n.node.textContent,n.node,r,i)&&u.push(n)}for(let t=0;t<u.length;t++){let n=u[t],r=!1;for(let e=t+1;e<u.length&&!r;e++)isAncestor(n,u[e])&&(r=!0);r||l.push({line:`- ${roleOrTag(n)}: ${e.y(e.x(i(n.node.textContent),80))} # text split across child elements of ${e.p(n)}: use a function matcher or getByRole`,rank:0})}return format(`Closest matches`,l)}function isAncestor(e,t){for(let n=t.parent;n!==null;n=n.parent)if(n===e)return!0;return!1}const y=/* @__PURE__ */ new Set([`textbox`,`searchbox`,`combobox`,`listbox`,`checkbox`,`radio`,`switch`,`slider`,`spinbutton`]);function labelCandidates(r,i,a,o){if(typeof i==`function`)return``;let s=e.j(r),c=[];for(let r=s.first;r!==null;r=(0,t.nextInTree)(r,s)){if(r.type!==t.ELEMENT_NODE)continue;let s=(0,n.tlRole)(r);if(!y.has(s))continue;let l=nameOf(r),u=(0,n.isInaccessibleImpl)(r);if(l===``){let n=(0,t.attr)(r,`placeholder`),o=n?`no label, placeholder ${e.y(n)}: use getByPlaceholderText or add a <label>`:`no label: add a <label>, aria-label or aria-labelledby`;c.push({line:line(r,s,``,u,o),rank:n&&closeness(n,r.node,i,a)>=0?1:5});continue}let d=closeness(l,r.node,i,a,o);c.push({line:line(r,s,l,u,d>=0?`similar label`:`labelled control`),rank:d>=0?2+d:10})}return format(`Labelled form controls`,c)}function queryAllLabels(n){let r=e.j(n),i=[];for(let e=r.first;e!==null;e=(0,t.nextInTree)(e,r)){if(e.type!==t.ELEMENT_NODE||e.name!==`label`&&e.name!==`input`)continue;let n=getLabelContentImpl(e);n!==null&&i.push({node:e.node,textToMatch:n})}return i}function queryAllLabelsByText(e,t,{exact:n=!0,trim:r,collapseWhitespace:i,normalizer:a}={}){let o=textMatcher(n,t,makeNormalizer({collapseWhitespace:i,trim:r,normalizer:a}));return queryAllLabels(e).filter(({node:e,textToMatch:t})=>o(t,e)).map(({node:e})=>e)}function queryAllByLabelText(r,i,{selector:a=`*`,exact:o=!0,collapseWhitespace:s,trim:c,normalizer:l}=e.E){e.O(r);let u=textMatcher(o,i,resolveNormalizer(c,s,l)),d=e.j(r),f=new LabelContext(d,!0),p=[],m=null;for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d)){if(e.type!==t.ELEMENT_NODE)continue;(0,t.ariaAttr)(e,`aria-label`)!==null&&(m??=[]).push(e);let r=(0,t.ariaAttr)(e,`aria-labelledby`);(r!==null||(0,n.isLabelable)(e))&&collectLabelled(f,e,r,a,u,p)}if(m!==null)for(let e=0;e<m.length;e++){let n=m[e];u((0,t.ariaAttr)(n,`aria-label`),n.node)&&p.push(n.node)}let h=p.length>1?Array.from(new Set(p)):p;return a===`*`?h:h.filter(n=>e.T(n[t.$impl],a))}function collectLabelled(e,t,n,r,i,a){if(!n){let o=e.labelsOf(t);if(o.length===0&&n===null)return;if(o.length===1){let e=o[0],n=getLabelContentImpl(e),s=labelledFormControl(e,r);s&&i(n,s.node)&&a.push(s.node),i(n,t.node)&&a.push(t.node);return}}else if(!n.includes(` `)){let r=e.byIdInContainer(n);i(`${(r===null?``:getLabelContentImpl(r))||``}`,t.node)&&a.push(t.node);return}let o=getLabelsImpl(e,t,r);for(let e of o){if(!e.formControl)continue;let t=e.formControl.node;i(e.content,t)&&a.push(t)}let s=o.filter(e=>!!e.content).map(e=>e.content),c=t.node;i(s.join(` `),c)&&a.push(c),s.length>1&&s.forEach((e,t)=>{i(e,c)&&a.push(c);let n=[...s];n.splice(t,1),n.length>1&&i(n.join(` `),c)&&a.push(c)})}function getAllByLabelText(t,n,r){let i=queryAllByLabelText(t,n,r);if(!i.length){let i=queryAllLabelsByText(t,n,r);if(i.length){let r=i.map(e=>getTagNameOfElementAssociatedWithLabelViaFor(t,e)).filter(e=>!!e);throw r.length?e.i().getElementError(r.map(e=>`Found a label with the text of: ${n}, however the element associated with this label (<${e} />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <${e} />, you can use aria-label or aria-labelledby instead.`).join(`
17
17
 
18
- `),t):e.i().getElementError(`Found a label with the text of: ${n}, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.`,t)}throw e.i().getElementError(withLabelCandidates(`Unable to find a label with the text of: ${n}`,t,n,r[0]),t)}return i}function withLabelCandidates(t,n,r,i={}){if(e.w()===null)return t;let{exact:a=!0,trim:o,collapseWhitespace:s,normalizer:c}=i,l=labelCandidates(n,r,makeNormalizer({trim:o,collapseWhitespace:s,normalizer:c}),a);return l===``?t:`${t}\n\n${l}`}function getTagNameOfElementAssociatedWithLabelViaFor(t,n){let r=n.getAttribute(`for`);if(!r)return null;let i=new LabelContext(e.A(t)).byIdInContainer(r);return i?i.node.tagName.toLowerCase():null}const y=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the text of: ${t}`,`getMultipleError`),b=wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText,y),queryAllByLabelText.name,`query`),x=makeSingleQuery(getAllByLabelText,y),S=makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`findAll`)),C=makeFindQuery(wrapSingleQueryWithSuggestion(x,getAllByLabelText.name,`find`)),w=wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`getAll`),T=wrapSingleQueryWithSuggestion(x,getAllByLabelText.name,`get`),E=wrapAllByQueryWithSuggestion(queryAllByLabelText,queryAllByLabelText.name,`queryAll`);function queryAllByPlaceholderText(...t){return e.D(t[0]),queryAllByAttribute(`placeholder`,...t)}const ee=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the placeholder text of: ${t}`,`getMultipleError`),te=/* @__PURE__ */ e.M((e,t)=>`Unable to find an element with the placeholder text of: ${t}`,`getMissingError`),ne=wrapAllByQueryWithSuggestion(queryAllByPlaceholderText,queryAllByPlaceholderText.name,`queryAll`),[re,D,O,k,A]=buildQueries(queryAllByPlaceholderText,ee,te);function isScriptStyleIgnore(e){return e===`script, style`||e===`script,style`}function isScriptOrStyle(e){let t=e.name;return t===`script`||t===`style`}function queryAllByText(n,r,{selector:i=`*`,exact:a=!0,collapseWhitespace:o,trim:s,ignore:c=e.i().defaultIgnore,normalizer:l}={}){e.D(n);let u=textMatcher(a,r,makeNormalizer({collapseWhitespace:o,trim:s,normalizer:l})),d=e.A(n),f=i===`*`,p=isScriptStyleIgnore(c),m=[],visit=t=>{(f||e.T(t,i))&&(c&&(p?isScriptOrStyle(t):e.T(t,c))||u(getNodeTextImpl(t),t.node)&&m.push(t.node))};d.type===t.ELEMENT_NODE&&visit(d);for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d))e.type===t.ELEMENT_NODE&&visit(e);return m}const ie=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the text: ${t}`,`getMultipleError`),ae=/* @__PURE__ */ e.M((t,n,r={})=>{let{collapseWhitespace:i,trim:a,normalizer:o,selector:s}=r,c=makeNormalizer({collapseWhitespace:i,trim:a,normalizer:o}),l=c(n.toString()),u=l!==n.toString(),d=(s??`*`)!==`*`,f=`Unable to find an element with the text: ${u?`${l} (normalized from '${n}')`:n}${d?`, which matches selector '${s}'`:``}. 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.`;if(e.w()===null)return f;let{exact:p=!0,ignore:m=e.i().defaultIgnore}=r,h=textCandidates(t,n,c,s??`*`,m,p);return h===``?f:`${f}\n\n${h}`},`getMissingError`),j=wrapAllByQueryWithSuggestion(queryAllByText,queryAllByText.name,`queryAll`),[M,N,P,F,I]=buildQueries(queryAllByText,ie,ae);function queryAllByDisplayValue(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.D(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.A(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.name;if(n!==`input`&&n!==`textarea`&&n!==`select`)continue;let r=e.node;if(e.tag===t.T.select&&e.ns===t.HTML_NS){let e=r.options,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.selected&&c(getNodeTextImpl(i[t.$impl]),i)){n=!0;break}}n&&u.push(r)}else c(r.value,r)&&u.push(r)}return u}const oe=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the display value: ${t}.`,`getMultipleError`),se=/* @__PURE__ */ e.M((e,t)=>`Unable to find an element with the display value: ${t}.`,`getMissingError`),L=wrapAllByQueryWithSuggestion(queryAllByDisplayValue,queryAllByDisplayValue.name,`queryAll`),[R,z,B,V,H]=buildQueries(queryAllByDisplayValue,oe,se),ce=/^(img|input|area|.+-.+)$/i;function queryAllByAltText(t,n,r={}){return e.D(t),queryAllByAttribute(`alt`,t,n,r).filter(e=>ce.test(e.tagName))}const le=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the alt text: ${t}`,`getMultipleError`),ue=/* @__PURE__ */ e.M((e,t)=>`Unable to find an element with the alt text: ${t}`,`getMissingError`),U=wrapAllByQueryWithSuggestion(queryAllByAltText,queryAllByAltText.name,`queryAll`),[W,G,K,q,de]=buildQueries(queryAllByAltText,le,ue);function isSvgTitle(e){let n=e.parent;return(0,t.asciiLowercase)(e.prefix===null?e.name:e.prefix+`:`+e.name)===`title`&&n!==null&&n.type===t.ELEMENT_NODE&&(0,t.asciiLowercase)(n.prefix===null?n.name:n.prefix+`:`+n.name)===`svg`}function queryAllByTitle(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.D(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.A(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.attrs===null?null:(0,t.attr)(e,`title`),r=e.name===`title`&&e.parent!==null&&e.parent.type===t.ELEMENT_NODE&&e.parent.name===`svg`;(n!==null||r)&&(c(n,e.node)||isSvgTitle(e)&&c(getNodeTextImpl(e),e.node))&&u.push(e.node)}return u}const fe=/* @__PURE__ */ e.M((e,t)=>`Found multiple elements with the title: ${t}.`,`getMultipleError`),pe=/* @__PURE__ */ e.M((e,t)=>`Unable to find an element with the title: ${t}.`,`getMissingError`),J=wrapAllByQueryWithSuggestion(queryAllByTitle,queryAllByTitle.name,`queryAll`),[Y,me,he,ge,_e]=buildQueries(queryAllByTitle,fe,pe),identity=e=>e;function assertSupported(e,t){if(!f.roleSupportsProp(e,t))throw Error(`"${t}" is not supported on role "${e}".`)}function queryAllByRole(n,r,{hidden:i=e.i().defaultHidden,name:a,description:o,queryFallbacks:s=!1,selected:c,busy:l,checked:u,pressed:d,current:p,level:m,expanded:h,value:{now:g,min:_,max:v,text:y}={}}={}){if(e.D(n),c!==void 0&&assertSupported(r,`aria-selected`),l!==void 0&&assertSupported(r,`aria-busy`),u!==void 0&&assertSupported(r,`aria-checked`),d!==void 0&&assertSupported(r,`aria-pressed`),p!==void 0&&assertSupported(r,`aria-current`),m!==void 0&&r!==`heading`)throw Error(`Role "${r}" cannot have "level" property.`);g!==void 0&&assertSupported(r,`aria-valuenow`),v!==void 0&&assertSupported(r,`aria-valuemax`),_!==void 0&&assertSupported(r,`aria-valuemin`),y!==void 0&&assertSupported(r,`aria-valuetext`),h!==void 0&&assertSupported(r,`aria-expanded`);let b={selected:c,busy:l,checked:u,pressed:d,current:p,level:m,expanded:h,valueNow:g,valueMin:_,valueMax:v,valueText:y},x=e.i().computedStyleSupportsPseudoElements,S=e.A(n),C=[],w=styleOverride(S),T=w!==null&&i===!1?/* @__PURE__ */ new Map:null,E=f.roleMatcher(r,s);for(let e=S.first;e!==null;e=(0,t.nextInTree)(e,S))e.type===t.ELEMENT_NODE&&E(e)&&matchesState(e,b)&&(i===!1&&(w===null?isInaccessibleImpl$1(e):f.isInaccessibleWithStyle(e,w,T))||(a===void 0||matches(f.computeAccessibleName(e,x,w),e.node,a,identity))&&(o===void 0||matches(f.computeAccessibleDescription(e,x,w),e.node,o,identity))&&C.push(e.node));return C}function matchesState(e,t){if(t.selected!==void 0)return t.selected===computeAriaSelected(e);if(t.busy!==void 0)return t.busy===computeAriaBusy(e);if(t.checked!==void 0)return t.checked===computeAriaChecked(e);if(t.pressed!==void 0)return t.pressed===computeAriaPressed(e);if(t.current!==void 0)return t.current===computeAriaCurrent(e);if(t.expanded!==void 0)return t.expanded===computeAriaExpanded(e);if(t.level!==void 0)return t.level===computeHeadingLevelImpl(e);if(t.valueNow!==void 0||t.valueMax!==void 0||t.valueMin!==void 0||t.valueText!==void 0){let n=!0;return t.valueNow!==void 0&&(n&&=t.valueNow===computeAriaValueNow(e)),t.valueMax!==void 0&&(n&&=t.valueMax===computeAriaValueMax(e)),t.valueMin!==void 0&&(n&&=t.valueMin===computeAriaValueMin(e)),t.valueText!==void 0&&(n&&=matches(computeAriaValueText(e)??null,e.node,t.valueText,identity)),n}return!0}const getNameHint=e=>{let t=``;return t=e===void 0?``:typeof e==`string`?` and name "${e}"`:` and name \`${e}\``,t},ve=/* @__PURE__ */ e.M((e,t,{name:n}={})=>`Found multiple elements with the role "${t}"${getNameHint(n)}`,`getMultipleError`),ye=/* @__PURE__ */ e.M((t,n,r={})=>{let{hidden:i=e.i().defaultHidden,name:a,description:o}=r;if(e.w()!==null)return agentMissingError(t,n,r,i);if(e.i()._disableExpensiveErrorDiagnostics)return`Unable to find role="${n}"${getNameHint(a)}`;let s=``;Array.from(t.children).forEach(e=>{s+=prettyRoles(e,{hidden:i,includeDescription:o!==void 0})});let c;c=s.length===0?i===!1?"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":`There are no available roles.`:`
18
+ `),t):e.i().getElementError(`Found a label with the text of: ${n}, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.`,t)}throw e.i().getElementError(withLabelCandidates(`Unable to find a label with the text of: ${n}`,t,n,r),t)}return i}function withLabelCandidates(t,n,r,i={}){if(e.w()===null)return t;let{exact:a=!0,trim:o,collapseWhitespace:s,normalizer:c}=i,l=labelCandidates(n,r,makeNormalizer({trim:o,collapseWhitespace:s,normalizer:c}),a);return l===``?t:`${t}\n\n${l}`}function getTagNameOfElementAssociatedWithLabelViaFor(t,n){let r=n.getAttribute(`for`);if(!r)return null;let i=new LabelContext(e.j(t)).byIdInContainer(r);return i?i.node.tagName.toLowerCase():null}const b=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the text of: ${t}`,`getMultipleError`),x=wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText,b),queryAllByLabelText.name,`query`),S=makeSingleQuery(getAllByLabelText,b),C=makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`findAll`)),w=makeFindQuery(wrapSingleQueryWithSuggestion(S,getAllByLabelText.name,`find`)),T=wrapAllByQueryWithSuggestion(getAllByLabelText,getAllByLabelText.name,`getAll`),E=wrapSingleQueryWithSuggestion(S,getAllByLabelText.name,`get`),ee=wrapAllByQueryWithSuggestion(queryAllByLabelText,queryAllByLabelText.name,`queryAll`);function queryAllByPlaceholderText(...t){return e.O(t[0]),queryAllByAttribute(`placeholder`,...t)}const te=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the placeholder text of: ${t}`,`getMultipleError`),ne=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the placeholder text of: ${t}`,`getMissingError`),re=wrapAllByQueryWithSuggestion(queryAllByPlaceholderText,queryAllByPlaceholderText.name,`queryAll`),[ie,D,O,k,A]=buildQueries(queryAllByPlaceholderText,te,ne);function isScriptStyleIgnore(e){return e===`script, style`||e===`script,style`}function isScriptOrStyle(e){if((e.flags&t.F_HTML)!==0)return e.tag===t.T.script||e.tag===t.T.style;let n=e.name;return n===`script`||n===`style`}function isCandidate(t,n,r){return n!==`*`&&!e.T(t,n)?!1:r?isScriptStyleIgnore(r)?!isScriptOrStyle(t):!e.T(t,r):!0}function queryAllByText(n,r,{selector:i=`*`,exact:a=!0,collapseWhitespace:o,trim:s,ignore:c=e.i().defaultIgnore,normalizer:l}=e.E){e.O(n);let u=textMatcher(a,r,resolveNormalizer(s,o,l)),d=e.j(n),f=[];d.type===t.ELEMENT_NODE&&isCandidate(d,i,c)&&u(getNodeTextImpl(d),d.node)&&f.push(d.node);for(let e=d.first;e!==null;e=(0,t.nextInTree)(e,d))e.type===t.ELEMENT_NODE&&isCandidate(e,i,c)&&u(getNodeTextImpl(e),e.node)&&f.push(e.node);return f}const ae=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the text: ${t}`,`getMultipleError`),oe=/* @__PURE__ */ e.N((t,n,r={})=>{let{collapseWhitespace:i,trim:a,normalizer:o,selector:s}=r,c=makeNormalizer({collapseWhitespace:i,trim:a,normalizer:o}),l=c(n.toString()),u=l!==n.toString(),d=(s??`*`)!==`*`,f=`Unable to find an element with the text: ${u?`${l} (normalized from '${n}')`:n}${d?`, which matches selector '${s}'`:``}. 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.`;if(e.w()===null)return f;let{exact:p=!0,ignore:m=e.i().defaultIgnore}=r,h=textCandidates(t,n,c,s??`*`,m,p);return h===``?f:`${f}\n\n${h}`},`getMissingError`),j=wrapAllByQueryWithSuggestion(queryAllByText,queryAllByText.name,`queryAll`),[M,N,P,F,I]=buildQueries(queryAllByText,ae,oe);function queryAllByDisplayValue(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.O(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.j(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.name;if(n!==`input`&&n!==`textarea`&&n!==`select`)continue;let r=e.node;if(e.tag===t.T.select&&e.ns===t.HTML_NS){let e=r.options,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.selected&&c(getNodeTextImpl(i[t.$impl]),i)){n=!0;break}}n&&u.push(r)}else c(r.value,r)&&u.push(r)}return u}const se=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the display value: ${t}.`,`getMultipleError`),ce=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the display value: ${t}.`,`getMissingError`),L=wrapAllByQueryWithSuggestion(queryAllByDisplayValue,queryAllByDisplayValue.name,`queryAll`),[R,z,B,V,H]=buildQueries(queryAllByDisplayValue,se,ce),le=/^(img|input|area|.+-.+)$/i;function queryAllByAltText(t,n,r={}){return e.O(t),queryAllByAttribute(`alt`,t,n,r).filter(e=>le.test(e.tagName))}const ue=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the alt text: ${t}`,`getMultipleError`),de=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the alt text: ${t}`,`getMissingError`),U=wrapAllByQueryWithSuggestion(queryAllByAltText,queryAllByAltText.name,`queryAll`),[W,G,K,q,fe]=buildQueries(queryAllByAltText,ue,de);function isSvgTitle(e){let n=e.parent;return(0,t.asciiLowercase)(e.prefix===null?e.name:e.prefix+`:`+e.name)===`title`&&n!==null&&n.type===t.ELEMENT_NODE&&(0,t.asciiLowercase)(n.prefix===null?n.name:n.prefix+`:`+n.name)===`svg`}function queryAllByTitle(n,r,{exact:i=!0,collapseWhitespace:a,trim:o,normalizer:s}={}){e.O(n);let c=textMatcher(i,r,makeNormalizer({collapseWhitespace:a,trim:o,normalizer:s})),l=e.j(n),u=[];for(let e=l.first;e!==null;e=(0,t.nextInTree)(e,l)){if(e.type!==t.ELEMENT_NODE)continue;let n=e.attrs===null?null:(0,t.attr)(e,`title`),r=e.name===`title`&&e.parent!==null&&e.parent.type===t.ELEMENT_NODE&&e.parent.name===`svg`;(n!==null||r)&&(c(n,e.node)||isSvgTitle(e)&&c(getNodeTextImpl(e),e.node))&&u.push(e.node)}return u}const pe=/* @__PURE__ */ e.N((e,t)=>`Found multiple elements with the title: ${t}.`,`getMultipleError`),me=/* @__PURE__ */ e.N((e,t)=>`Unable to find an element with the title: ${t}.`,`getMissingError`),J=wrapAllByQueryWithSuggestion(queryAllByTitle,queryAllByTitle.name,`queryAll`),[he,ge,_e,ve,ye]=buildQueries(queryAllByTitle,pe,me),identity=e=>e;function assertSupported(e,t){if(!f.roleSupportsProp(e,t))throw Error(`"${t}" is not supported on role "${e}".`)}function queryAllByRole(n,r,{hidden:i=e.i().defaultHidden,name:a,description:o,queryFallbacks:s=!1,selected:c,busy:l,checked:u,pressed:d,current:p,level:m,expanded:h,value:{now:g,min:_,max:v,text:y}=e.E}=e.E){if(e.O(n),c!==void 0&&assertSupported(r,`aria-selected`),l!==void 0&&assertSupported(r,`aria-busy`),u!==void 0&&assertSupported(r,`aria-checked`),d!==void 0&&assertSupported(r,`aria-pressed`),p!==void 0&&assertSupported(r,`aria-current`),m!==void 0&&r!==`heading`)throw Error(`Role "${r}" cannot have "level" property.`);g!==void 0&&assertSupported(r,`aria-valuenow`),v!==void 0&&assertSupported(r,`aria-valuemax`),_!==void 0&&assertSupported(r,`aria-valuemin`),y!==void 0&&assertSupported(r,`aria-valuetext`),h!==void 0&&assertSupported(r,`aria-expanded`);let b={selected:c,busy:l,checked:u,pressed:d,current:p,level:m,expanded:h,valueNow:g,valueMin:_,valueMax:v,valueText:y},x=e.i().computedStyleSupportsPseudoElements,S=e.j(n),C=[],w=styleOverride(S),T=w!==null&&i===!1?/* @__PURE__ */ new Map:null,E=f.roleMatcher(r,s);for(let e=S.first;e!==null;e=(0,t.nextInTree)(e,S))e.type===t.ELEMENT_NODE&&E(e)&&matchesState(e,b)&&(i===!1&&(w===null?isInaccessibleImpl$1(e):f.isInaccessibleWithStyle(e,w,T))||(a===void 0||matches(f.computeAccessibleName(e,x,w),e.node,a,identity))&&(o===void 0||matches(f.computeAccessibleDescription(e,x,w),e.node,o,identity))&&C.push(e.node));return C}function matchesState(e,t){if(t.selected!==void 0)return t.selected===computeAriaSelected(e);if(t.busy!==void 0)return t.busy===computeAriaBusy(e);if(t.checked!==void 0)return t.checked===computeAriaChecked(e);if(t.pressed!==void 0)return t.pressed===computeAriaPressed(e);if(t.current!==void 0)return t.current===computeAriaCurrent(e);if(t.expanded!==void 0)return t.expanded===computeAriaExpanded(e);if(t.level!==void 0)return t.level===computeHeadingLevelImpl(e);if(t.valueNow!==void 0||t.valueMax!==void 0||t.valueMin!==void 0||t.valueText!==void 0){let n=!0;return t.valueNow!==void 0&&(n&&=t.valueNow===computeAriaValueNow(e)),t.valueMax!==void 0&&(n&&=t.valueMax===computeAriaValueMax(e)),t.valueMin!==void 0&&(n&&=t.valueMin===computeAriaValueMin(e)),t.valueText!==void 0&&(n&&=matches(computeAriaValueText(e)??null,e.node,t.valueText,identity)),n}return!0}const getNameHint=e=>{let t=``;return t=e===void 0?``:typeof e==`string`?` and name "${e}"`:` and name \`${e}\``,t},be=/* @__PURE__ */ e.N((e,t,{name:n}={})=>`Found multiple elements with the role "${t}"${getNameHint(n)}`,`getMultipleError`),xe=/* @__PURE__ */ e.N((t,n,r={})=>{let{hidden:i=e.i().defaultHidden,name:a,description:o}=r;if(e.w()!==null)return agentMissingError(t,n,r,i);if(e.i()._disableExpensiveErrorDiagnostics)return`Unable to find role="${n}"${getNameHint(a)}`;let s=``;Array.from(t.children).forEach(e=>{s+=prettyRoles(e,{hidden:i,includeDescription:o!==void 0})});let c;c=s.length===0?i===!1?"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":`There are no available roles.`:`
19
19
  Here are the ${i===!1?`accessible`:`available`} roles:
20
20
 
21
21
  ${s.replace(/\n/g,`
@@ -25,5 +25,5 @@ Here are the ${i===!1?`accessible`:`available`} roles:
25
25
  `.trim();let l=``;l=a===void 0?``:typeof a==`string`?` and name "${a}"`:` and name \`${a}\``;let u=``;return u=o===void 0?``:typeof o==`string`?` and description "${o}"`:` and description \`${o}\``,`
26
26
  Unable to find an ${i===!1?`accessible `:``}element with the role "${n}"${l}${u}
27
27
 
28
- ${c}`.trim()},`getMissingError`);function agentMissingError(e,t,n,r){let{name:i,description:a,queryFallbacks:o=!1,value:{now:s,min:c,max:l,text:u}={}}=n,{selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_}=n,v={selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_,valueNow:s,valueMin:c,valueMax:l,valueText:u},y=Object.entries({selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_,value:n.value}).filter(([,e])=>e!==void 0).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(`, `),b=a===void 0?``:typeof a==`string`?` and description "${a}"`:` and description \`${a}\``,x=`Unable to find an ${r===!1?`accessible `:``}element with the role "${t}"${getNameHint(i)}${b}`,S=roleCandidates(e,{role:String(t),name:i,hidden:r,queryFallbacks:o,matchesState:e=>matchesState(e,v),stateHint:`{ ${y} }`});return S===``?x:`${x}\n\n${S}`}const be=wrapAllByQueryWithSuggestion(queryAllByRole,queryAllByRole.name,`queryAll`),[xe,Se,Ce,we,Te]=buildQueries(queryAllByRole,ve,ye),getTestIdAttribute=()=>e.i().testIdAttribute;function queryAllByTestId(...t){return e.D(t[0]),queryAllByAttribute(getTestIdAttribute(),...t)}const getMultipleError=(e,t)=>`Found multiple elements by: [${getTestIdAttribute()}="${t}"]`,getMissingError=(e,t)=>`Unable to find an element by: [${getTestIdAttribute()}="${t}"]`,Ee=wrapAllByQueryWithSuggestion(queryAllByTestId,queryAllByTestId.name,`queryAll`),[De,Oe,ke,Ae,X]=buildQueries(queryAllByTestId,getMultipleError,getMissingError),Z={findAllByLabelText:S,findByLabelText:C,getAllByLabelText:w,getByLabelText:T,queryAllByLabelText:E,queryByLabelText:b,findAllByPlaceholderText:k,findByPlaceholderText:A,getAllByPlaceholderText:D,getByPlaceholderText:O,queryAllByPlaceholderText:ne,queryByPlaceholderText:re,findAllByText:F,findByText:I,getAllByText:N,getByText:P,queryAllByText:j,queryByText:M,findAllByDisplayValue:V,findByDisplayValue:H,getAllByDisplayValue:z,getByDisplayValue:B,queryAllByDisplayValue:L,queryByDisplayValue:R,findAllByAltText:q,findByAltText:de,getAllByAltText:G,getByAltText:K,queryAllByAltText:U,queryByAltText:W,findAllByTitle:ge,findByTitle:_e,getAllByTitle:me,getByTitle:he,queryAllByTitle:J,queryByTitle:Y,findAllByRole:we,findByRole:Te,getAllByRole:Se,getByRole:Ce,queryAllByRole:be,queryByRole:xe,findAllByTestId:Ae,findByTestId:X,getAllByTestId:Oe,getByTestId:ke,queryAllByTestId:Ee,queryByTestId:De};function getQueriesForElement(e,t=Z,n){if(n===void 0){if(t===Z&&hasDefaultKeys(t))return bindDefaultQueries(t,e);n={}}return Object.keys(t).reduce((n,r)=>(n[r]=t[r].bind(null,e),n),n)}const je=/* @__PURE__ */ `findAllByLabelText.findByLabelText.getAllByLabelText.getByLabelText.queryAllByLabelText.queryByLabelText.findAllByPlaceholderText.findByPlaceholderText.getAllByPlaceholderText.getByPlaceholderText.queryAllByPlaceholderText.queryByPlaceholderText.findAllByText.findByText.getAllByText.getByText.queryAllByText.queryByText.findAllByDisplayValue.findByDisplayValue.getAllByDisplayValue.getByDisplayValue.queryAllByDisplayValue.queryByDisplayValue.findAllByAltText.findByAltText.getAllByAltText.getByAltText.queryAllByAltText.queryByAltText.findAllByTitle.findByTitle.getAllByTitle.getByTitle.queryAllByTitle.queryByTitle.findAllByRole.findByRole.getAllByRole.getByRole.queryAllByRole.queryByRole.findAllByTestId.findByTestId.getAllByTestId.getByTestId.queryAllByTestId.queryByTestId`.split(`.`);function hasDefaultKeys(e){let t=Object.keys(e);if(t.length!==je.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==je[e])return!1;return!0}function bindDefaultQueries(e,t){return{findAllByLabelText:e.findAllByLabelText.bind(null,t),findByLabelText:e.findByLabelText.bind(null,t),getAllByLabelText:e.getAllByLabelText.bind(null,t),getByLabelText:e.getByLabelText.bind(null,t),queryAllByLabelText:e.queryAllByLabelText.bind(null,t),queryByLabelText:e.queryByLabelText.bind(null,t),findAllByPlaceholderText:e.findAllByPlaceholderText.bind(null,t),findByPlaceholderText:e.findByPlaceholderText.bind(null,t),getAllByPlaceholderText:e.getAllByPlaceholderText.bind(null,t),getByPlaceholderText:e.getByPlaceholderText.bind(null,t),queryAllByPlaceholderText:e.queryAllByPlaceholderText.bind(null,t),queryByPlaceholderText:e.queryByPlaceholderText.bind(null,t),findAllByText:e.findAllByText.bind(null,t),findByText:e.findByText.bind(null,t),getAllByText:e.getAllByText.bind(null,t),getByText:e.getByText.bind(null,t),queryAllByText:e.queryAllByText.bind(null,t),queryByText:e.queryByText.bind(null,t),findAllByDisplayValue:e.findAllByDisplayValue.bind(null,t),findByDisplayValue:e.findByDisplayValue.bind(null,t),getAllByDisplayValue:e.getAllByDisplayValue.bind(null,t),getByDisplayValue:e.getByDisplayValue.bind(null,t),queryAllByDisplayValue:e.queryAllByDisplayValue.bind(null,t),queryByDisplayValue:e.queryByDisplayValue.bind(null,t),findAllByAltText:e.findAllByAltText.bind(null,t),findByAltText:e.findByAltText.bind(null,t),getAllByAltText:e.getAllByAltText.bind(null,t),getByAltText:e.getByAltText.bind(null,t),queryAllByAltText:e.queryAllByAltText.bind(null,t),queryByAltText:e.queryByAltText.bind(null,t),findAllByTitle:e.findAllByTitle.bind(null,t),findByTitle:e.findByTitle.bind(null,t),getAllByTitle:e.getAllByTitle.bind(null,t),getByTitle:e.getByTitle.bind(null,t),queryAllByTitle:e.queryAllByTitle.bind(null,t),queryByTitle:e.queryByTitle.bind(null,t),findAllByRole:e.findAllByRole.bind(null,t),findByRole:e.findByRole.bind(null,t),getAllByRole:e.getAllByRole.bind(null,t),getByRole:e.getByRole.bind(null,t),queryAllByRole:e.queryAllByRole.bind(null,t),queryByRole:e.queryByRole.bind(null,t),findAllByTestId:e.findAllByTestId.bind(null,t),findByTestId:e.findByTestId.bind(null,t),getAllByTestId:e.getAllByTestId.bind(null,t),getByTestId:e.getByTestId.bind(null,t),queryAllByTestId:e.queryAllByTestId.bind(null,t),queryByTestId:e.queryByTestId.bind(null,t)}}const isRemoved=e=>!e||Array.isArray(e)&&!e.length;function initialCheck(e){if(isRemoved(e))throw Error(`The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.`)}async function waitForElementToBeRemoved(callback,e){let t=/* @__PURE__ */ Error(`Timed out in waitForElementToBeRemoved.`);if(typeof callback!=`function`){initialCheck(callback);let e=(Array.isArray(callback)?callback:[callback]).map(e=>{let t=e.parentElement;if(t===null)return()=>null;for(;t.parentElement;)t=t.parentElement;return()=>t.contains(e)?e:null});callback=()=>e.map(e=>e()).filter(Boolean)}let n=callback;return initialCheck(n()),waitFor(()=>{let e;try{e=n()}catch(e){if(e.name===`TestingLibraryElementError`)return;throw e}if(!isRemoved(e))throw t},e)}const Me={copy:{EventType:`ClipboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},cut:{EventType:`ClipboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},paste:{EventType:`ClipboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionEnd:{EventType:`CompositionEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionStart:{EventType:`CompositionEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},compositionUpdate:{EventType:`CompositionEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},keyDown:{EventType:`KeyboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},keyPress:{EventType:`KeyboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},keyUp:{EventType:`KeyboardEvent`,defaultInit:{bubbles:!0,cancelable:!0,charCode:0,composed:!0}},focus:{EventType:`FocusEvent`,defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},blur:{EventType:`FocusEvent`,defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},focusIn:{EventType:`FocusEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},focusOut:{EventType:`FocusEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},change:{EventType:`Event`,defaultInit:{bubbles:!0,cancelable:!1}},input:{EventType:`InputEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},invalid:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!0}},submit:{EventType:`Event`,defaultInit:{bubbles:!0,cancelable:!0}},reset:{EventType:`Event`,defaultInit:{bubbles:!0,cancelable:!0}},click:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,button:0,composed:!0}},contextMenu:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dblClick:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},drag:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragEnd:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragEnter:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragExit:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragLeave:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},dragOver:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},dragStart:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},drop:{EventType:`DragEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseDown:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseEnter:{EventType:`MouseEvent`,defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},mouseLeave:{EventType:`MouseEvent`,defaultInit:{bubbles:!1,cancelable:!1,composed:!0}},mouseMove:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseOut:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseOver:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},mouseUp:{EventType:`MouseEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},select:{EventType:`Event`,defaultInit:{bubbles:!0,cancelable:!1}},touchCancel:{EventType:`TouchEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},touchEnd:{EventType:`TouchEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},touchMove:{EventType:`TouchEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},touchStart:{EventType:`TouchEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},resize:{EventType:`UIEvent`,defaultInit:{bubbles:!1,cancelable:!1}},scroll:{EventType:`UIEvent`,defaultInit:{bubbles:!1,cancelable:!1}},wheel:{EventType:`WheelEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},abort:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},canPlay:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},canPlayThrough:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},durationChange:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},emptied:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},encrypted:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},ended:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},loadedData:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},loadedMetadata:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},loadStart:{EventType:`ProgressEvent`,defaultInit:{bubbles:!1,cancelable:!1}},pause:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},play:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},playing:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},progress:{EventType:`ProgressEvent`,defaultInit:{bubbles:!1,cancelable:!1}},rateChange:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},seeked:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},seeking:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},stalled:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},suspend:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},timeUpdate:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},volumeChange:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},waiting:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},load:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},error:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},animationStart:{EventType:`AnimationEvent`,defaultInit:{bubbles:!0,cancelable:!1}},animationEnd:{EventType:`AnimationEvent`,defaultInit:{bubbles:!0,cancelable:!1}},animationIteration:{EventType:`AnimationEvent`,defaultInit:{bubbles:!0,cancelable:!1}},transitionCancel:{EventType:`TransitionEvent`,defaultInit:{bubbles:!0,cancelable:!1}},transitionEnd:{EventType:`TransitionEvent`,defaultInit:{bubbles:!0,cancelable:!0}},transitionRun:{EventType:`TransitionEvent`,defaultInit:{bubbles:!0,cancelable:!1}},transitionStart:{EventType:`TransitionEvent`,defaultInit:{bubbles:!0,cancelable:!1}},pointerOver:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerEnter:{EventType:`PointerEvent`,defaultInit:{bubbles:!1,cancelable:!1}},pointerDown:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerMove:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerUp:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerCancel:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},pointerOut:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!0,composed:!0}},pointerLeave:{EventType:`PointerEvent`,defaultInit:{bubbles:!1,cancelable:!1}},gotPointerCapture:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},lostPointerCapture:{EventType:`PointerEvent`,defaultInit:{bubbles:!0,cancelable:!1,composed:!0}},popState:{EventType:`PopStateEvent`,defaultInit:{bubbles:!0,cancelable:!1}},offline:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},online:{EventType:`Event`,defaultInit:{bubbles:!1,cancelable:!1}},pageHide:{EventType:`PageTransitionEvent`,defaultInit:{bubbles:!0,cancelable:!0}},pageShow:{EventType:`PageTransitionEvent`,defaultInit:{bubbles:!0,cancelable:!0}}},Ne={doubleClick:`dblClick`};function fireEvent_(e,n){return(0,t.tracing)()&&n&&e?(0,t.traceSync)(`testing-library.fire_event`,`fireEvent.${n.type}(${(0,t.describeNode)(e)})`,()=>fireEventUntraced(e,n)):fireEventUntraced(e,n)}function fireEventUntraced(t,n){return e.i().eventWrapper(()=>{if(!n)throw Error(`Unable to fire an event - please provide an event object.`);if(!t)throw Error(`Unable to fire a "${n.type}" event - please provide a DOM element.`);return t.dispatchEvent(n)})}function createEvent_(t,n,r,{EventType:i=`Event`,defaultInit:a={}}={}){if(!n)throw Error(`Unable to fire a "${t}" event - please provide a DOM element.`);let o={...a,...r},{target:{value:s,files:c,...l}={}}=o;s!==void 0&&setNativeValue(n,s),c!==void 0&&Object.defineProperty(n,"files",{configurable:!0,enumerable:!0,writable:!0,value:c}),Object.assign(n,l);let u=e.k(n),d=u[i]||u.Event,f;if(typeof d==`function`)f=new d(t,o);else{f=u.document.createEvent(i);let{bubbles:e,cancelable:n,detail:r,...a}=o;f.initEvent(t,e,n,r),Object.keys(a).forEach(e=>{f[e]=a[e]})}return[`dataTransfer`,`clipboardData`].forEach(e=>{let t=o[e];typeof t==`object`&&(typeof u.DataTransfer==`function`?Object.defineProperty(f,e,{value:Object.getOwnPropertyNames(t).reduce((e,n)=>(Object.defineProperty(e,n,{value:t[n]}),e),new u.DataTransfer)}):Object.defineProperty(f,e,{value:t}))}),f}function setNativeValue(e,t){let{set:n}=Object.getOwnPropertyDescriptor(e,`value`)||{},r=Object.getPrototypeOf(e),{set:i}=Object.getOwnPropertyDescriptor(r,`value`)||{};if(i&&n!==i)i.call(e,t);else if(n)n.call(e,t);else throw Error(`The given element does not have a value setter`)}Object.defineProperty(fireEvent_,"name",{value:`fireEvent`}),Object.defineProperty(createEvent_,"name",{value:`createEvent`});const Q=fireEvent_,$=createEvent_;Object.keys(Me).forEach(e=>{let{EventType:t,defaultInit:n}=Me[e],r=e.toLowerCase();$[e]=(e,i)=>$(r,e,i,{EventType:t,defaultInit:n}),Q[e]=(t,n)=>Q(t,$[e](t,n))}),Object.keys(Ne).forEach(e=>{let t=Ne[e];Q[e]=(...e)=>Q[t](...e)});const Pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$`;var BitWriter=class{out=[];val=0;pos=0;write(e,t){for(let n=0;n<t;n++)this.val=this.val<<1|e&1,this.pos===5?(this.pos=0,this.out.push(Pe.charAt(this.val)),this.val=0):this.pos++,e>>=1}flush(){for(;;){if(this.val<<=1,this.pos===5){this.out.push(Pe.charAt(this.val));break}this.pos++}return this.out.join(``)}};function compressToEncodedURIComponent(e){if(e==null)return``;let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set,r=new BitWriter,i=``,a=2,o=3,s=2,emit=e=>{if(n.has(e)){let t=e.charCodeAt(0);t<256?(r.write(0,s),r.write(t,8)):(r.write(1,s),r.write(t,16)),a--,a===0&&(a=2**s,s++),n.delete(e)}else r.write(t.get(e),s);a--,a===0&&(a=2**s,s++)};for(let r=0;r<e.length;r++){let a=e.charAt(r);t.has(a)||(t.set(a,o++),n.add(a));let s=i+a;t.has(s)?i=s:(emit(i),t.set(s,o++),i=a)}return i!==``&&emit(i),r.write(2,s),r.flush()}function unindent(e){return e.replace(/[ \t]*[\n][ \t]*/g,`
29
- `)}function encode(e){return compressToEncodedURIComponent(unindent(e))}function getPlaygroundUrl(e){return`https://testing-playground.com/#markup=${encode(e)}`}const debug=(t,n,r)=>Array.isArray(t)?t.forEach(t=>e.o(t,n,r)):e.o(t,n,r),logTestingPlaygroundURL=(t=e.O().body)=>{if(!t||!(`innerHTML`in t)){console.log(`The element you're providing isn't a valid DOM element.`);return}if(!t.innerHTML){console.log(`The provided element doesn't have any children.`);return}let n=getPlaygroundUrl(t.innerHTML);return console.log(`Open this URL in your browser\n\n${n}`),n},Fe={debug,logTestingPlaygroundURL,ariaSnapshot:e.l},Ie=typeof document<`u`&&document.body?getQueriesForElement(document.body,Z,Fe):Object.keys(Z).reduce((e,t)=>(e[t]=()=>{throw TypeError(`For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error`)},e),Fe),Le={getElementError,wrapAllByQueryWithSuggestion,wrapSingleQueryWithSuggestion,getMultipleElementsFoundError,queryAllByAttribute,queryByAttribute,makeSingleQuery,makeGetAllQuery,makeFindQuery,buildQueries};exports.ariaSnapshot=e.l,exports.buildQueries=buildQueries,exports.configure=e.r,exports.createEvent=$,exports.diffAriaSnapshots=e.t,exports.findAllByAltText=q,exports.findAllByDisplayValue=V,exports.findAllByLabelText=S,exports.findAllByPlaceholderText=k,exports.findAllByRole=we,exports.findAllByTestId=Ae,exports.findAllByText=F,exports.findAllByTitle=ge,exports.findByAltText=de,exports.findByDisplayValue=H,exports.findByLabelText=C,exports.findByPlaceholderText=A,exports.findByRole=Te,exports.findByTestId=X,exports.findByText=I,exports.findByTitle=_e,exports.fireEvent=Q,exports.getAllByAltText=G,exports.getAllByDisplayValue=z,exports.getAllByLabelText=w,exports.getAllByPlaceholderText=D,exports.getAllByRole=Se,exports.getAllByTestId=Oe,exports.getAllByText=N,exports.getAllByTitle=me,exports.getByAltText=K,exports.getByDisplayValue=B,exports.getByLabelText=T,exports.getByPlaceholderText=O,exports.getByRole=Ce,exports.getByTestId=ke,exports.getByText=P,exports.getByTitle=he,exports.getConfig=e.i,exports.getDefaultNormalizer=getDefaultNormalizer,exports.getElementError=getElementError,exports.getMultipleElementsFoundError=getMultipleElementsFoundError,exports.getNodeText=getNodeText,exports.getQueriesForElement=getQueriesForElement,exports.within=getQueriesForElement,exports.getRoles=getRoles,exports.getSuggestedQuery=getSuggestedQuery,exports.isInaccessible=isInaccessible,exports.logDOM=e.o,exports.logRoles=logRoles,exports.makeFindQuery=makeFindQuery,exports.makeGetAllQuery=makeGetAllQuery,exports.makeSingleQuery=makeSingleQuery,exports.prettyDOM=e.s,exports.prettyFormat=e.c,exports.queries=Z,exports.queryAllByAltText=U,exports.queryAllByAttribute=queryAllByAttribute,exports.queryAllByDisplayValue=L,exports.queryAllByLabelText=E,exports.queryAllByPlaceholderText=ne,exports.queryAllByRole=be,exports.queryAllByTestId=Ee,exports.queryAllByText=j,exports.queryAllByTitle=J,exports.queryByAltText=W,exports.queryByAttribute=queryByAttribute,exports.queryByDisplayValue=R,exports.queryByLabelText=b,exports.queryByPlaceholderText=re,exports.queryByRole=xe,exports.queryByTestId=De,exports.queryByText=M,exports.queryByTitle=Y,exports.queryHelpers=Le,exports.screen=Ie,exports.waitFor=waitFor,exports.waitForElementToBeRemoved=waitForElementToBeRemoved,exports.wrapAllByQueryWithSuggestion=wrapAllByQueryWithSuggestion,exports.wrapSingleQueryWithSuggestion=wrapSingleQueryWithSuggestion;
28
+ ${c}`.trim()},`getMissingError`);function agentMissingError(e,t,n,r){let{name:i,description:a,queryFallbacks:o=!1,value:{now:s,min:c,max:l,text:u}={}}=n,{selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_}=n,v={selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_,valueNow:s,valueMin:c,valueMax:l,valueText:u},y=Object.entries({selected:d,busy:f,checked:p,pressed:m,current:h,level:g,expanded:_,value:n.value}).filter(([,e])=>e!==void 0).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(`, `),b=a===void 0?``:typeof a==`string`?` and description "${a}"`:` and description \`${a}\``,x=`Unable to find an ${r===!1?`accessible `:``}element with the role "${t}"${getNameHint(i)}${b}`,S=roleCandidates(e,{role:String(t),name:i,hidden:r,queryFallbacks:o,matchesState:e=>matchesState(e,v),stateHint:`{ ${y} }`});return S===``?x:`${x}\n\n${S}`}const Se=wrapAllByQueryWithSuggestion(queryAllByRole,queryAllByRole.name,`queryAll`),[Ce,we,Te,Ee,De]=buildQueries(queryAllByRole,be,xe),getTestIdAttribute=()=>e.i().testIdAttribute;function queryAllByTestId(...t){return e.O(t[0]),queryAllByAttribute(getTestIdAttribute(),...t)}const getMultipleError=(e,t)=>`Found multiple elements by: [${getTestIdAttribute()}="${t}"]`,getMissingError=(e,t)=>`Unable to find an element by: [${getTestIdAttribute()}="${t}"]`,Oe=wrapAllByQueryWithSuggestion(queryAllByTestId,queryAllByTestId.name,`queryAll`),[ke,Ae,je,Y,Me]=buildQueries(queryAllByTestId,getMultipleError,getMissingError),X={findAllByLabelText:C,findByLabelText:w,getAllByLabelText:T,getByLabelText:E,queryAllByLabelText:ee,queryByLabelText:x,findAllByPlaceholderText:k,findByPlaceholderText:A,getAllByPlaceholderText:D,getByPlaceholderText:O,queryAllByPlaceholderText:re,queryByPlaceholderText:ie,findAllByText:F,findByText:I,getAllByText:N,getByText:P,queryAllByText:j,queryByText:M,findAllByDisplayValue:V,findByDisplayValue:H,getAllByDisplayValue:z,getByDisplayValue:B,queryAllByDisplayValue:L,queryByDisplayValue:R,findAllByAltText:q,findByAltText:fe,getAllByAltText:G,getByAltText:K,queryAllByAltText:U,queryByAltText:W,findAllByTitle:ve,findByTitle:ye,getAllByTitle:ge,getByTitle:_e,queryAllByTitle:J,queryByTitle:he,findAllByRole:Ee,findByRole:De,getAllByRole:we,getByRole:Te,queryAllByRole:Se,queryByRole:Ce,findAllByTestId:Y,findByTestId:Me,getAllByTestId:Ae,getByTestId:je,queryAllByTestId:Oe,queryByTestId:ke};function getQueriesForElement(e,t=X,n){if(n===void 0){if(t===X&&hasDefaultKeys(t))return bindDefaultQueries(t,e);n={}}return Object.keys(t).reduce((n,r)=>(n[r]=t[r].bind(null,e),n),n)}const Ne=/* @__PURE__ */ `findAllByLabelText.findByLabelText.getAllByLabelText.getByLabelText.queryAllByLabelText.queryByLabelText.findAllByPlaceholderText.findByPlaceholderText.getAllByPlaceholderText.getByPlaceholderText.queryAllByPlaceholderText.queryByPlaceholderText.findAllByText.findByText.getAllByText.getByText.queryAllByText.queryByText.findAllByDisplayValue.findByDisplayValue.getAllByDisplayValue.getByDisplayValue.queryAllByDisplayValue.queryByDisplayValue.findAllByAltText.findByAltText.getAllByAltText.getByAltText.queryAllByAltText.queryByAltText.findAllByTitle.findByTitle.getAllByTitle.getByTitle.queryAllByTitle.queryByTitle.findAllByRole.findByRole.getAllByRole.getByRole.queryAllByRole.queryByRole.findAllByTestId.findByTestId.getAllByTestId.getByTestId.queryAllByTestId.queryByTestId`.split(`.`);function hasDefaultKeys(e){let t=Object.keys(e);if(t.length!==Ne.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==Ne[e])return!1;return!0}function bindDefaultQueries(e,t){return{findAllByLabelText:e.findAllByLabelText.bind(null,t),findByLabelText:e.findByLabelText.bind(null,t),getAllByLabelText:e.getAllByLabelText.bind(null,t),getByLabelText:e.getByLabelText.bind(null,t),queryAllByLabelText:e.queryAllByLabelText.bind(null,t),queryByLabelText:e.queryByLabelText.bind(null,t),findAllByPlaceholderText:e.findAllByPlaceholderText.bind(null,t),findByPlaceholderText:e.findByPlaceholderText.bind(null,t),getAllByPlaceholderText:e.getAllByPlaceholderText.bind(null,t),getByPlaceholderText:e.getByPlaceholderText.bind(null,t),queryAllByPlaceholderText:e.queryAllByPlaceholderText.bind(null,t),queryByPlaceholderText:e.queryByPlaceholderText.bind(null,t),findAllByText:e.findAllByText.bind(null,t),findByText:e.findByText.bind(null,t),getAllByText:e.getAllByText.bind(null,t),getByText:e.getByText.bind(null,t),queryAllByText:e.queryAllByText.bind(null,t),queryByText:e.queryByText.bind(null,t),findAllByDisplayValue:e.findAllByDisplayValue.bind(null,t),findByDisplayValue:e.findByDisplayValue.bind(null,t),getAllByDisplayValue:e.getAllByDisplayValue.bind(null,t),getByDisplayValue:e.getByDisplayValue.bind(null,t),queryAllByDisplayValue:e.queryAllByDisplayValue.bind(null,t),queryByDisplayValue:e.queryByDisplayValue.bind(null,t),findAllByAltText:e.findAllByAltText.bind(null,t),findByAltText:e.findByAltText.bind(null,t),getAllByAltText:e.getAllByAltText.bind(null,t),getByAltText:e.getByAltText.bind(null,t),queryAllByAltText:e.queryAllByAltText.bind(null,t),queryByAltText:e.queryByAltText.bind(null,t),findAllByTitle:e.findAllByTitle.bind(null,t),findByTitle:e.findByTitle.bind(null,t),getAllByTitle:e.getAllByTitle.bind(null,t),getByTitle:e.getByTitle.bind(null,t),queryAllByTitle:e.queryAllByTitle.bind(null,t),queryByTitle:e.queryByTitle.bind(null,t),findAllByRole:e.findAllByRole.bind(null,t),findByRole:e.findByRole.bind(null,t),getAllByRole:e.getAllByRole.bind(null,t),getByRole:e.getByRole.bind(null,t),queryAllByRole:e.queryAllByRole.bind(null,t),queryByRole:e.queryByRole.bind(null,t),findAllByTestId:e.findAllByTestId.bind(null,t),findByTestId:e.findByTestId.bind(null,t),getAllByTestId:e.getAllByTestId.bind(null,t),getByTestId:e.getByTestId.bind(null,t),queryAllByTestId:e.queryAllByTestId.bind(null,t),queryByTestId:e.queryByTestId.bind(null,t)}}const isRemoved=e=>!e||Array.isArray(e)&&!e.length;function initialCheck(e){if(isRemoved(e))throw Error(`The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.`)}async function waitForElementToBeRemoved(callback,e){let t=/* @__PURE__ */ Error(`Timed out in waitForElementToBeRemoved.`);if(typeof callback!=`function`){initialCheck(callback);let e=(Array.isArray(callback)?callback:[callback]).map(e=>{let t=e.parentElement;if(t===null)return()=>null;for(;t.parentElement;)t=t.parentElement;return()=>t.contains(e)?e:null});callback=()=>e.map(e=>e()).filter(Boolean)}let n=callback;return initialCheck(n()),waitFor(()=>{let e;try{e=n()}catch(e){if(e.name===`TestingLibraryElementError`)return;throw e}if(!isRemoved(e))throw t},e)}const Pe=[[`ClipboardEvent`,7,`copy cut paste`],[`CompositionEvent`,7,`compositionEnd compositionStart compositionUpdate`],[`KeyboardEvent`,15,`keyDown keyPress keyUp`],[`FocusEvent`,4,`focus blur`],[`FocusEvent`,5,`focusIn focusOut`],[`Event`,1,`change`],[`InputEvent`,5,`input`],[`Event`,2,`invalid`],[`Event`,3,`submit reset`],[`MouseEvent`,23,`click`],[`MouseEvent`,7,`contextMenu dblClick`],[`DragEvent`,7,`drag`],[`DragEvent`,5,`dragEnd`],[`DragEvent`,7,`dragEnter`],[`DragEvent`,5,`dragExit dragLeave`],[`DragEvent`,7,`dragOver dragStart drop`],[`MouseEvent`,7,`mouseDown`],[`MouseEvent`,4,`mouseEnter mouseLeave`],[`MouseEvent`,7,`mouseMove mouseOut mouseOver mouseUp`],[`Event`,1,`select`],[`TouchEvent`,5,`touchCancel`],[`TouchEvent`,7,`touchEnd touchMove touchStart`],[`UIEvent`,0,`resize scroll`],[`WheelEvent`,7,`wheel`],[`Event`,0,`abort canPlay canPlayThrough durationChange emptied encrypted ended loadedData loadedMetadata`],[`ProgressEvent`,0,`loadStart`],[`Event`,0,`pause play playing`],[`ProgressEvent`,0,`progress`],[`Event`,0,`rateChange seeked seeking stalled suspend timeUpdate volumeChange waiting`],[`Event`,0,`load error`],[`AnimationEvent`,1,`animationStart animationEnd animationIteration`],[`TransitionEvent`,1,`transitionCancel`],[`TransitionEvent`,3,`transitionEnd`],[`TransitionEvent`,1,`transitionRun transitionStart`],[`PointerEvent`,7,`pointerOver`],[`PointerEvent`,0,`pointerEnter`],[`PointerEvent`,7,`pointerDown pointerMove pointerUp`],[`PointerEvent`,5,`pointerCancel`],[`PointerEvent`,7,`pointerOut`],[`PointerEvent`,0,`pointerLeave`],[`PointerEvent`,5,`gotPointerCapture lostPointerCapture`],[`PopStateEvent`,1,`popState`],[`Event`,0,`offline online`],[`PageTransitionEvent`,3,`pageHide pageShow`]],Z={};for(let[e,t,n]of Pe)for(let r of n.split(` `)){let n={bubbles:!!(t&1),cancelable:!!(t&2)};t&8&&(n.charCode=0),t&16&&(n.button=0),t&4&&(n.composed=!0),Z[r]={EventType:e,defaultInit:n}}const Fe={doubleClick:`dblClick`};function fireEvent_(e,n){return(0,t.tracing)()&&n&&e?(0,t.traceSync)(`testing-library.fire_event`,`fireEvent.${n.type}(${(0,t.describeNode)(e)})`,()=>fireEventUntraced(e,n)):fireEventUntraced(e,n)}function fireEventUntraced(t,n){return e.i().eventWrapper(()=>{if(!n)throw Error(`Unable to fire an event - please provide an event object.`);if(!t)throw Error(`Unable to fire a "${n.type}" event - please provide a DOM element.`);return t.dispatchEvent(n)})}function createEvent_(t,n,r,{EventType:i=`Event`,defaultInit:a={}}={}){if(!n)throw Error(`Unable to fire a "${t}" event - please provide a DOM element.`);let o={...a,...r},{target:{value:s,files:c,...l}={}}=o;s!==void 0&&setNativeValue(n,s),c!==void 0&&Object.defineProperty(n,"files",{configurable:!0,enumerable:!0,writable:!0,value:c}),Object.assign(n,l);let u=e.A(n),d=u[i]||u.Event,f;if(typeof d==`function`)f=new d(t,o);else{f=u.document.createEvent(i);let{bubbles:e,cancelable:n,detail:r,...a}=o;f.initEvent(t,e,n,r),Object.keys(a).forEach(e=>{f[e]=a[e]})}return[`dataTransfer`,`clipboardData`].forEach(e=>{let t=o[e];typeof t==`object`&&(typeof u.DataTransfer==`function`?Object.defineProperty(f,e,{value:Object.getOwnPropertyNames(t).reduce((e,n)=>(Object.defineProperty(e,n,{value:t[n]}),e),new u.DataTransfer)}):Object.defineProperty(f,e,{value:t}))}),f}function setNativeValue(e,t){let{set:n}=Object.getOwnPropertyDescriptor(e,`value`)||{},r=Object.getPrototypeOf(e),{set:i}=Object.getOwnPropertyDescriptor(r,`value`)||{};if(i&&n!==i)i.call(e,t);else if(n)n.call(e,t);else throw Error(`The given element does not have a value setter`)}Object.defineProperty(fireEvent_,"name",{value:`fireEvent`}),Object.defineProperty(createEvent_,"name",{value:`createEvent`});const Q=fireEvent_,$=createEvent_;Object.keys(Z).forEach(e=>{let{EventType:t,defaultInit:n}=Z[e],r=e.toLowerCase();$[e]=(e,i)=>$(r,e,i,{EventType:t,defaultInit:n}),Q[e]=(t,n)=>Q(t,$[e](t,n))}),Object.keys(Fe).forEach(e=>{let t=Fe[e];Q[e]=(...e)=>Q[t](...e)});const Ie=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$`;var BitWriter=class{out=[];val=0;pos=0;write(e,t){for(let n=0;n<t;n++)this.val=this.val<<1|e&1,this.pos===5?(this.pos=0,this.out.push(Ie.charAt(this.val)),this.val=0):this.pos++,e>>=1}flush(){for(;;){if(this.val<<=1,this.pos===5){this.out.push(Ie.charAt(this.val));break}this.pos++}return this.out.join(``)}};function compressToEncodedURIComponent(e){if(e==null)return``;let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set,r=new BitWriter,i=``,a=2,o=3,s=2,emit=e=>{if(n.has(e)){let t=e.charCodeAt(0);t<256?(r.write(0,s),r.write(t,8)):(r.write(1,s),r.write(t,16)),a--,a===0&&(a=2**s,s++),n.delete(e)}else r.write(t.get(e),s);a--,a===0&&(a=2**s,s++)};for(let r=0;r<e.length;r++){let a=e.charAt(r);t.has(a)||(t.set(a,o++),n.add(a));let s=i+a;t.has(s)?i=s:(emit(i),t.set(s,o++),i=a)}return i!==``&&emit(i),r.write(2,s),r.flush()}function unindent(e){return e.replace(/[ \t]*[\n][ \t]*/g,`
29
+ `)}function encode(e){return compressToEncodedURIComponent(unindent(e))}function getPlaygroundUrl(e){return`https://testing-playground.com/#markup=${encode(e)}`}const debug=(t,n,r)=>Array.isArray(t)?t.forEach(t=>e.o(t,n,r)):e.o(t,n,r),logTestingPlaygroundURL=(t=e.k().body)=>{if(!t||!(`innerHTML`in t)){console.log(`The element you're providing isn't a valid DOM element.`);return}if(!t.innerHTML){console.log(`The provided element doesn't have any children.`);return}let n=getPlaygroundUrl(t.innerHTML);return console.log(`Open this URL in your browser\n\n${n}`),n},Le={debug,logTestingPlaygroundURL,ariaSnapshot:e.l},Re=typeof document<`u`&&document.body?getQueriesForElement(document.body,X,Le):Object.keys(X).reduce((e,t)=>(e[t]=()=>{throw TypeError(`For queries bound to document.body a global document has to be available... Learn more: https://testing-library.com/s/screen-global-error`)},e),Le),ze={getElementError,wrapAllByQueryWithSuggestion,wrapSingleQueryWithSuggestion,getMultipleElementsFoundError,queryAllByAttribute,queryByAttribute,makeSingleQuery,makeGetAllQuery,makeFindQuery,buildQueries};exports.ariaSnapshot=e.l,exports.buildQueries=buildQueries,exports.configure=e.r,exports.createEvent=$,exports.diffAriaSnapshots=e.t,exports.findAllByAltText=q,exports.findAllByDisplayValue=V,exports.findAllByLabelText=C,exports.findAllByPlaceholderText=k,exports.findAllByRole=Ee,exports.findAllByTestId=Y,exports.findAllByText=F,exports.findAllByTitle=ve,exports.findByAltText=fe,exports.findByDisplayValue=H,exports.findByLabelText=w,exports.findByPlaceholderText=A,exports.findByRole=De,exports.findByTestId=Me,exports.findByText=I,exports.findByTitle=ye,exports.fireEvent=Q,exports.getAllByAltText=G,exports.getAllByDisplayValue=z,exports.getAllByLabelText=T,exports.getAllByPlaceholderText=D,exports.getAllByRole=we,exports.getAllByTestId=Ae,exports.getAllByText=N,exports.getAllByTitle=ge,exports.getByAltText=K,exports.getByDisplayValue=B,exports.getByLabelText=E,exports.getByPlaceholderText=O,exports.getByRole=Te,exports.getByTestId=je,exports.getByText=P,exports.getByTitle=_e,exports.getConfig=e.i,exports.getDefaultNormalizer=getDefaultNormalizer,exports.getElementError=getElementError,exports.getMultipleElementsFoundError=getMultipleElementsFoundError,exports.getNodeText=getNodeText,exports.getQueriesForElement=getQueriesForElement,exports.within=getQueriesForElement,exports.getRoles=getRoles,exports.getSuggestedQuery=getSuggestedQuery,exports.isInaccessible=isInaccessible,exports.logDOM=e.o,exports.logRoles=logRoles,exports.makeFindQuery=makeFindQuery,exports.makeGetAllQuery=makeGetAllQuery,exports.makeSingleQuery=makeSingleQuery,exports.prettyDOM=e.s,exports.prettyFormat=e.c,exports.queries=X,exports.queryAllByAltText=U,exports.queryAllByAttribute=queryAllByAttribute,exports.queryAllByDisplayValue=L,exports.queryAllByLabelText=ee,exports.queryAllByPlaceholderText=re,exports.queryAllByRole=Se,exports.queryAllByTestId=Oe,exports.queryAllByText=j,exports.queryAllByTitle=J,exports.queryByAltText=W,exports.queryByAttribute=queryByAttribute,exports.queryByDisplayValue=R,exports.queryByLabelText=x,exports.queryByPlaceholderText=ie,exports.queryByRole=Ce,exports.queryByTestId=ke,exports.queryByText=M,exports.queryByTitle=he,exports.queryHelpers=ze,exports.screen=Re,exports.waitFor=waitFor,exports.waitForElementToBeRemoved=waitForElementToBeRemoved,exports.wrapAllByQueryWithSuggestion=wrapAllByQueryWithSuggestion,exports.wrapSingleQueryWithSuggestion=wrapSingleQueryWithSuggestion;