@clubmed/usg-chat-ui 1.0.1 → 1.2.5

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 (106) hide show
  1. package/chunks/_commonjsHelpers.js +9 -0
  2. package/chunks/_commonjsHelpers.js.map +1 -0
  3. package/chunks/browser.js +579 -0
  4. package/chunks/browser.js.map +1 -0
  5. package/chunks/client.js +27323 -0
  6. package/chunks/client.js.map +1 -0
  7. package/chunks/index.js +59 -32
  8. package/chunks/index.js.map +1 -1
  9. package/chunks/index2.js +32 -59
  10. package/chunks/index2.js.map +1 -1
  11. package/chunks/index3.js +22 -740
  12. package/chunks/index3.js.map +1 -1
  13. package/chunks/index4.js +740 -22
  14. package/chunks/index4.js.map +1 -1
  15. package/chunks/index5.js +1 -1
  16. package/chunks/index6.js +144 -150
  17. package/chunks/index6.js.map +1 -1
  18. package/chunks/index7.js +14 -13
  19. package/chunks/index7.js.map +1 -1
  20. package/chunks/magic-string.es.js +664 -0
  21. package/chunks/magic-string.es.js.map +1 -0
  22. package/chunks/react.esm.js +10007 -0
  23. package/chunks/react.esm.js.map +1 -0
  24. package/chunks/{collaboration.js → useCollaboration.js} +536 -523
  25. package/chunks/useCollaboration.js.map +1 -0
  26. package/chunks/vi.2VT5v0um.js +10573 -0
  27. package/chunks/vi.2VT5v0um.js.map +1 -0
  28. package/contexts/ChatContext.d.ts +2 -1
  29. package/contexts/ChatContext.js +32 -30
  30. package/contexts/ChatContext.js.map +1 -1
  31. package/core/interfaces/ChatConfig.d.ts +4 -0
  32. package/core/interfaces/StoryVersion.d.ts +7 -2
  33. package/index.d.ts +1 -0
  34. package/molecules/AiElements/Message.js +1 -1
  35. package/molecules/AiElements/Response.js +15 -13
  36. package/molecules/AiElements/Response.js.map +1 -1
  37. package/molecules/AiElements/Sources.d.ts +2 -2
  38. package/molecules/AiElements/Sources.js.map +1 -1
  39. package/molecules/Buttons/Button.d.ts +1 -1
  40. package/molecules/Buttons/Button.js +2 -2
  41. package/molecules/{AiElements → CodeBlock}/CodeBlock.d.ts +5 -2
  42. package/molecules/CodeBlock/CodeBlock.js +128 -0
  43. package/molecules/CodeBlock/CodeBlock.js.map +1 -0
  44. package/molecules/CodeBlock/CodeBlock.test.d.ts +1 -0
  45. package/molecules/CodeBlock/CodeBlock.test.js +3158 -0
  46. package/molecules/CodeBlock/CodeBlock.test.js.map +1 -0
  47. package/molecules/CodeBlock/highlightCode.d.ts +2 -0
  48. package/molecules/CodeBlock/highlightCode.js +5850 -0
  49. package/molecules/CodeBlock/highlightCode.js.map +1 -0
  50. package/molecules/CodeBlock/highlightCode.test.d.ts +1 -0
  51. package/molecules/CodeBlock/highlightCode.test.js +47 -0
  52. package/molecules/CodeBlock/highlightCode.test.js.map +1 -0
  53. package/molecules/Collapsibles/Collapsible.js +1 -1
  54. package/molecules/Forms/InputGroups/InputGroup.js +1 -1
  55. package/molecules/Labels/Label.js +2 -2
  56. package/molecules/Notifications/{Sonner.js → Toaster.js} +2 -2
  57. package/molecules/Notifications/Toaster.js.map +1 -0
  58. package/molecules/Notifications/{use-toast.js → useToast.js} +1 -1
  59. package/molecules/Notifications/useToast.js.map +1 -0
  60. package/{organisms → molecules}/RichText/DynamicEditor.js.map +1 -1
  61. package/molecules/RichText/EditorWithAI.js +55854 -0
  62. package/molecules/RichText/EditorWithAI.js.map +1 -0
  63. package/molecules/RichText/useCollaboration.d.ts +9 -0
  64. package/molecules/RichText/useCollaboration.js +8 -0
  65. package/molecules/RichText/useCollaboration.js.map +1 -0
  66. package/molecules/RichText/useCollaboration.test.d.ts +1 -0
  67. package/molecules/RichText/useCollaboration.test.js +70 -0
  68. package/molecules/RichText/useCollaboration.test.js.map +1 -0
  69. package/molecules/Tabs/Tabs.js +1 -1
  70. package/organisms/canvas/ApiDocsCanvas.js +15 -15
  71. package/organisms/canvas/ApiDocsCanvas.js.map +1 -1
  72. package/organisms/canvas/ReleaseNoteCanvas.js +2 -2
  73. package/organisms/canvas/ReleaseNoteCanvas.js.map +1 -1
  74. package/organisms/canvas/StoryCanvas.js +2 -2
  75. package/organisms/canvas/StoryCanvas.js.map +1 -1
  76. package/organisms/chat/MessageActions.js +1 -1
  77. package/organisms/chat/MessageActions.js.map +1 -1
  78. package/organisms/chat/hooks/useChat.js +1 -1
  79. package/organisms/chat/hooks/useChat.js.map +1 -1
  80. package/organisms/chat/hooks/useChatKeyboardsShortcuts.js +16 -33
  81. package/organisms/chat/hooks/useChatKeyboardsShortcuts.js.map +1 -1
  82. package/organisms/chat/hooks/useConversations.js +1 -1
  83. package/organisms/chat/hooks/useConversations.js.map +1 -1
  84. package/organisms/settings/SettingsModal.js +1 -1
  85. package/package.json +3 -4
  86. package/.npm/_logs/2026-01-19T16_54_30_380Z-debug-0.log +0 -19
  87. package/.npm/_logs/2026-01-19T16_54_30_467Z-debug-0.log +0 -19
  88. package/.npm/_logs/2026-01-19T16_54_30_553Z-debug-0.log +0 -14
  89. package/chunks/collaboration.js.map +0 -1
  90. package/core/collaboration.d.ts +0 -6
  91. package/core/collaboration.js +0 -5
  92. package/core/collaboration.js.map +0 -1
  93. package/molecules/AiElements/CodeBlock.js +0 -6525
  94. package/molecules/AiElements/CodeBlock.js.map +0 -1
  95. package/molecules/Notifications/Sonner.js.map +0 -1
  96. package/molecules/Notifications/use-toast.js.map +0 -1
  97. package/molecules/index.d.ts +0 -28
  98. package/molecules/index.js +0 -88
  99. package/molecules/index.js.map +0 -1
  100. package/organisms/RichText/EditorWithAI.js +0 -83167
  101. package/organisms/RichText/EditorWithAI.js.map +0 -1
  102. /package/molecules/Notifications/{Sonner.d.ts → Toaster.d.ts} +0 -0
  103. /package/molecules/Notifications/{use-toast.d.ts → useToast.d.ts} +0 -0
  104. /package/{organisms → molecules}/RichText/DynamicEditor.d.ts +0 -0
  105. /package/{organisms → molecules}/RichText/DynamicEditor.js +0 -0
  106. /package/{organisms → molecules}/RichText/EditorWithAI.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.test.js","sources":["../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/getWindow.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Blob.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/FileList.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/DataTransfer.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Clipboard.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/selector.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/isFocusable.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/cloneEvent.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/isDisabled.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/getActiveElement.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/findClosest.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/edit/isContentEditable.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/click/isClickableInput.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/edit/isEditable.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/selection.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/updateSelectionOnFocus.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/wrapEvent.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/focus.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/registry.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/click.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/UI.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/edit/timeValue.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/edit/maxLength.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/cursor.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/trackValue.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/getTargetTypeAndSelection.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/getInputRange.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/setSelection.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/input.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/cut.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/getValueOrTextContent.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/isVisible.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/focus/getTabDestination.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/moveSelection.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/selectAll.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionRange.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/radio.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/keydown.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/keypress.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/keyup.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/behavior/paste.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/eventMap.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/createEvent.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/patchFocus.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/interceptor.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/prepareDocument.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/getDocumentFromNode.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/level.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/wait.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/options.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/keyboard.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/keyboard/keyMap.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/pointer/keyMap.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/buttons.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/device.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/misc/getTreeDiff.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/resolveCaretPosition.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionPerMouse.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/event/selection/modifySelectionPerMouse.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/shared.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/mouse.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/pointer/cssPointerEvents.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/pointer.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/pointer/index.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/system/index.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/convenience/click.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/convenience/hover.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/convenience/tab.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/keyDef/readNextDescriptor.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/keyboard/index.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/document/copySelection.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/clipboard/copy.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/clipboard/cut.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/clipboard/paste.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/pointer/parseKeyDef.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/pointer/index.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utility/clear.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utility/selectOptions.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utility/type.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utils/edit/setFiles.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/utility/upload.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/setup/api.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/setup/wrapAsync.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/setup/setup.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/setup/directApi.js","../../../../../node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.1/node_modules/@testing-library/user-event/dist/esm/setup/index.js","../../../lib/molecules/CodeBlock/CodeBlock.test.tsx"],"sourcesContent":["function isElementType(element, tag, props) {\n if (element.namespaceURI && element.namespaceURI !== 'http://www.w3.org/1999/xhtml') {\n return false;\n }\n tag = Array.isArray(tag) ? tag : [\n tag\n ];\n // tagName is uppercase in HTMLDocument and lowercase in XMLDocument\n if (!tag.includes(element.tagName.toLowerCase())) {\n return false;\n }\n if (props) {\n return Object.entries(props).every(([k, v])=>element[k] === v);\n }\n return true;\n}\n\nexport { isElementType };\n","function getWindow(node) {\n var _node_ownerDocument;\n if (isDocument(node) && node.defaultView) {\n return node.defaultView;\n } else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === undefined ? undefined : _node_ownerDocument.defaultView) {\n return node.ownerDocument.defaultView;\n }\n throw new Error(`Could not determine window of node. Node was ${describe(node)}`);\n}\nfunction isDocument(node) {\n return node.nodeType === 9;\n}\nfunction describe(val) {\n return typeof val === 'function' ? `function ${val.name}` : val === null ? 'null' : String(val);\n}\n\nexport { getWindow };\n","// jsdom does not implement Blob.text()\nfunction readBlobText(blob, FileReader) {\n return new Promise((res, rej)=>{\n const fr = new FileReader();\n fr.onerror = rej;\n fr.onabort = rej;\n fr.onload = ()=>{\n res(String(fr.result));\n };\n fr.readAsText(blob);\n });\n}\n\nexport { readBlobText };\n","// FileList can not be created per constructor.\nfunction createFileList(window, files) {\n const list = {\n ...files,\n length: files.length,\n item: (index)=>list[index],\n [Symbol.iterator]: function* nextFile() {\n for(let i = 0; i < list.length; i++){\n yield list[i];\n }\n }\n };\n list.constructor = window.FileList;\n // guard for environments without FileList\n /* istanbul ignore else */ if (window.FileList) {\n Object.setPrototypeOf(list, window.FileList.prototype);\n }\n Object.freeze(list);\n return list;\n}\n\nexport { createFileList };\n","import { createFileList } from './FileList.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n// DataTransfer is not implemented in jsdom.\n// DataTransfer with FileList is being created by the browser on certain events.\nclass DataTransferItemStub {\n getAsFile() {\n return this.file;\n }\n getAsString(callback) {\n if (typeof this.data === 'string') {\n callback(this.data);\n }\n }\n /* istanbul ignore next */ webkitGetAsEntry() {\n throw new Error('not implemented');\n }\n constructor(dataOrFile, type){\n _define_property(this, \"kind\", undefined);\n _define_property(this, \"type\", undefined);\n _define_property(this, \"file\", null);\n _define_property(this, \"data\", undefined);\n if (typeof dataOrFile === 'string') {\n this.kind = 'string';\n this.type = String(type);\n this.data = dataOrFile;\n } else {\n this.kind = 'file';\n this.type = dataOrFile.type;\n this.file = dataOrFile;\n }\n }\n}\nclass DataTransferItemListStub extends Array {\n add(...args) {\n const item = new DataTransferItemStub(args[0], args[1]);\n this.push(item);\n return item;\n }\n clear() {\n this.splice(0, this.length);\n }\n remove(index) {\n this.splice(index, 1);\n }\n}\nfunction getTypeMatcher(type, exact) {\n const [group, sub] = type.split('/');\n const isGroup = !sub || sub === '*';\n return (item)=>{\n return exact ? item.type === (isGroup ? group : type) : isGroup ? item.type.startsWith(`${group}/`) : item.type === group;\n };\n}\nfunction createDataTransferStub(window) {\n return new class DataTransferStub {\n getData(format) {\n var _this_items_find;\n const match = (_this_items_find = this.items.find(getTypeMatcher(format, true))) !== null && _this_items_find !== undefined ? _this_items_find : this.items.find(getTypeMatcher(format, false));\n let text = '';\n match === null || match === undefined ? undefined : match.getAsString((t)=>{\n text = t;\n });\n return text;\n }\n setData(format, data) {\n const matchIndex = this.items.findIndex(getTypeMatcher(format, true));\n const item = new DataTransferItemStub(data, format);\n if (matchIndex >= 0) {\n this.items.splice(matchIndex, 1, item);\n } else {\n this.items.push(item);\n }\n }\n clearData(format) {\n if (format) {\n const matchIndex = this.items.findIndex(getTypeMatcher(format, true));\n if (matchIndex >= 0) {\n this.items.remove(matchIndex);\n }\n } else {\n this.items.clear();\n }\n }\n get types() {\n const t = [];\n if (this.files.length) {\n t.push('Files');\n }\n this.items.forEach((i)=>t.push(i.type));\n Object.freeze(t);\n return t;\n }\n /* istanbul ignore next */ setDragImage() {}\n constructor(){\n _define_property(this, \"dropEffect\", 'none');\n _define_property(this, \"effectAllowed\", 'uninitialized');\n _define_property(this, \"items\", new DataTransferItemListStub());\n _define_property(this, \"files\", createFileList(window, []));\n }\n }();\n}\nfunction createDataTransfer(window, files = []) {\n // Use real DataTransfer if available\n const dt = typeof window.DataTransfer === 'undefined' ? createDataTransferStub(window) : /* istanbul ignore next */ new window.DataTransfer();\n Object.defineProperty(dt, 'files', {\n get: ()=>createFileList(window, files)\n });\n return dt;\n}\nasync function getBlobFromDataTransferItem(window, item) {\n if (item.kind === 'file') {\n return item.getAsFile();\n }\n return new window.Blob([\n await new Promise((r)=>item.getAsString(r))\n ], {\n type: item.type\n });\n}\n\nexport { createDataTransfer, getBlobFromDataTransferItem };\n","import { getWindow } from '../misc/getWindow.js';\nimport { readBlobText } from './Blob.js';\nimport { createDataTransfer, getBlobFromDataTransferItem } from './DataTransfer.js';\n\n// Clipboard is not available in jsdom\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n// MDN lists string|Blob|Promise<Blob|string> as possible types in ClipboardItemData\n// lib.dom.d.ts lists only Promise<Blob|string>\n// https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem#syntax\nfunction createClipboardItem(window, ...blobs) {\n const dataMap = Object.fromEntries(blobs.map((b)=>[\n typeof b === 'string' ? 'text/plain' : b.type,\n Promise.resolve(b)\n ]));\n // use real ClipboardItem if available\n /* istanbul ignore if */ if (typeof window.ClipboardItem !== 'undefined') {\n return new window.ClipboardItem(dataMap);\n }\n return new class ClipboardItem {\n get types() {\n return Array.from(Object.keys(this.data));\n }\n async getType(type) {\n const value = await this.data[type];\n if (!value) {\n throw new Error(`${type} is not one of the available MIME types on this item.`);\n }\n return value instanceof window.Blob ? value : new window.Blob([\n value\n ], {\n type\n });\n }\n constructor(d){\n _define_property(this, \"data\", undefined);\n this.data = d;\n }\n }(dataMap);\n}\nconst ClipboardStubControl = Symbol('Manage ClipboardSub');\nfunction createClipboardStub(window, control) {\n return Object.assign(new class Clipboard extends window.EventTarget {\n async read() {\n return Array.from(this.items);\n }\n async readText() {\n let text = '';\n for (const item of this.items){\n const type = item.types.includes('text/plain') ? 'text/plain' : item.types.find((t)=>t.startsWith('text/'));\n if (type) {\n text += await item.getType(type).then((b)=>readBlobText(b, window.FileReader));\n }\n }\n return text;\n }\n async write(data) {\n this.items = data;\n }\n async writeText(text) {\n this.items = [\n createClipboardItem(window, text)\n ];\n }\n constructor(...args){\n super(...args), _define_property(this, \"items\", []);\n }\n }(), {\n [ClipboardStubControl]: control\n });\n}\nfunction isClipboardStub(clipboard) {\n return !!(clipboard === null || clipboard === undefined ? undefined : clipboard[ClipboardStubControl]);\n}\nfunction attachClipboardStubToView(window) {\n if (isClipboardStub(window.navigator.clipboard)) {\n return window.navigator.clipboard[ClipboardStubControl];\n }\n const realClipboard = Object.getOwnPropertyDescriptor(window.navigator, 'clipboard');\n let stub;\n const control = {\n resetClipboardStub: ()=>{\n stub = createClipboardStub(window, control);\n },\n detachClipboardStub: ()=>{\n /* istanbul ignore if */ if (realClipboard) {\n Object.defineProperty(window.navigator, 'clipboard', realClipboard);\n } else {\n Object.defineProperty(window.navigator, 'clipboard', {\n value: undefined,\n configurable: true\n });\n }\n }\n };\n stub = createClipboardStub(window, control);\n Object.defineProperty(window.navigator, 'clipboard', {\n get: ()=>stub,\n configurable: true\n });\n return stub[ClipboardStubControl];\n}\nfunction resetClipboardStubOnView(window) {\n if (isClipboardStub(window.navigator.clipboard)) {\n window.navigator.clipboard[ClipboardStubControl].resetClipboardStub();\n }\n}\nfunction detachClipboardStubFromView(window) {\n if (isClipboardStub(window.navigator.clipboard)) {\n window.navigator.clipboard[ClipboardStubControl].detachClipboardStub();\n }\n}\nasync function readDataTransferFromClipboard(document) {\n const window = document.defaultView;\n const clipboard = window === null || window === undefined ? undefined : window.navigator.clipboard;\n const items = clipboard && await clipboard.read();\n if (!items) {\n throw new Error('The Clipboard API is unavailable.');\n }\n const dt = createDataTransfer(window);\n for (const item of items){\n for (const type of item.types){\n dt.setData(type, await item.getType(type).then((b)=>readBlobText(b, window.FileReader)));\n }\n }\n return dt;\n}\nasync function writeDataTransferToClipboard(document, clipboardData) {\n const window = getWindow(document);\n const clipboard = window.navigator.clipboard;\n const items = [];\n for(let i = 0; i < clipboardData.items.length; i++){\n const dtItem = clipboardData.items[i];\n const blob = await getBlobFromDataTransferItem(window, dtItem);\n items.push(createClipboardItem(window, blob));\n }\n const written = clipboard && await clipboard.write(items).then(()=>true, // Can happen with other implementations that e.g. require permissions\n /* istanbul ignore next */ ()=>false);\n if (!written) {\n throw new Error('The Clipboard API is unavailable.');\n }\n}\nconst g = globalThis;\n/* istanbul ignore else */ if (typeof g.afterEach === 'function') {\n g.afterEach(()=>resetClipboardStubOnView(globalThis.window));\n}\n/* istanbul ignore else */ if (typeof g.afterAll === 'function') {\n g.afterAll(()=>detachClipboardStubFromView(globalThis.window));\n}\n\nexport { attachClipboardStubToView, createClipboardItem, detachClipboardStubFromView, readDataTransferFromClipboard, resetClipboardStubOnView, writeDataTransferToClipboard };\n","const FOCUSABLE_SELECTOR = [\n 'input:not([type=hidden]):not([disabled])',\n 'button:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n 'a[href]',\n '[tabindex]:not([disabled])'\n].join(', ');\n\nexport { FOCUSABLE_SELECTOR };\n","import { FOCUSABLE_SELECTOR } from './selector.js';\n\nfunction isFocusable(element) {\n return element.matches(FOCUSABLE_SELECTOR);\n}\n\nexport { isFocusable };\n","function cloneEvent(event) {\n return new event.constructor(event.type, event);\n}\n\nexport { cloneEvent };\n","import { isElementType } from './isElementType.js';\n\n// This should probably just rely on the :disabled pseudo-class, but JSDOM doesn't implement it properly.\nfunction isDisabled(element) {\n for(let el = element; el; el = el.parentElement){\n if (isElementType(el, [\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'optgroup',\n 'option'\n ])) {\n if (el.hasAttribute('disabled')) {\n return true;\n }\n } else if (isElementType(el, 'fieldset')) {\n var _el_querySelector;\n if (el.hasAttribute('disabled') && !((_el_querySelector = el.querySelector(':scope > legend')) === null || _el_querySelector === undefined ? undefined : _el_querySelector.contains(element))) {\n return true;\n }\n } else if (el.tagName.includes('-')) {\n if (el.constructor.formAssociated && el.hasAttribute('disabled')) {\n return true;\n }\n }\n }\n return false;\n}\n\nexport { isDisabled };\n","import { isDisabled } from '../misc/isDisabled.js';\n\nfunction getActiveElement(document) {\n const activeElement = document.activeElement;\n if (activeElement === null || activeElement === undefined ? undefined : activeElement.shadowRoot) {\n return getActiveElement(activeElement.shadowRoot);\n } else {\n // Browser does not yield disabled elements as document.activeElement - jsdom does\n if (isDisabled(activeElement)) {\n return document.ownerDocument ? /* istanbul ignore next */ document.ownerDocument.body : document.body;\n }\n return activeElement;\n }\n}\nfunction getActiveElementOrBody(document) {\n var _getActiveElement;\n return (_getActiveElement = getActiveElement(document)) !== null && _getActiveElement !== undefined ? _getActiveElement : /* istanbul ignore next */ document.body;\n}\n\nexport { getActiveElement, getActiveElementOrBody };\n","function findClosest(element, callback) {\n let el = element;\n do {\n if (callback(el)) {\n return el;\n }\n el = el.parentElement;\n }while (el && el !== element.ownerDocument.body)\n return undefined;\n}\n\nexport { findClosest };\n","//jsdom is not supporting isContentEditable\nfunction isContentEditable(element) {\n return element.hasAttribute('contenteditable') && (element.getAttribute('contenteditable') == 'true' || element.getAttribute('contenteditable') == '');\n}\n/**\n * If a node is a contenteditable or inside one, return that element.\n */ function getContentEditable(node) {\n const element = getElement(node);\n return element && (element.closest('[contenteditable=\"\"]') || element.closest('[contenteditable=\"true\"]'));\n}\nfunction getElement(node) {\n return node.nodeType === 1 ? node : node.parentElement;\n}\n\nexport { getContentEditable, isContentEditable };\n","import { isElementType } from '../misc/isElementType.js';\n\nvar clickableInputTypes = /*#__PURE__*/ function(clickableInputTypes) {\n clickableInputTypes[\"button\"] = \"button\";\n clickableInputTypes[\"color\"] = \"color\";\n clickableInputTypes[\"file\"] = \"file\";\n clickableInputTypes[\"image\"] = \"image\";\n clickableInputTypes[\"reset\"] = \"reset\";\n clickableInputTypes[\"submit\"] = \"submit\";\n clickableInputTypes[\"checkbox\"] = \"checkbox\";\n clickableInputTypes[\"radio\"] = \"radio\";\n return clickableInputTypes;\n}(clickableInputTypes || {});\nfunction isClickableInput(element) {\n return isElementType(element, 'button') || isElementType(element, 'input') && element.type in clickableInputTypes;\n}\n\nexport { isClickableInput };\n","import { isElementType } from '../misc/isElementType.js';\nimport { isContentEditable } from './isContentEditable.js';\n\nfunction isEditable(element) {\n return isEditableInputOrTextArea(element) && !element.readOnly || isContentEditable(element);\n}\nvar editableInputTypes = /*#__PURE__*/ function(editableInputTypes) {\n editableInputTypes[\"text\"] = \"text\";\n editableInputTypes[\"date\"] = \"date\";\n editableInputTypes[\"datetime-local\"] = \"datetime-local\";\n editableInputTypes[\"email\"] = \"email\";\n editableInputTypes[\"month\"] = \"month\";\n editableInputTypes[\"number\"] = \"number\";\n editableInputTypes[\"password\"] = \"password\";\n editableInputTypes[\"search\"] = \"search\";\n editableInputTypes[\"tel\"] = \"tel\";\n editableInputTypes[\"time\"] = \"time\";\n editableInputTypes[\"url\"] = \"url\";\n editableInputTypes[\"week\"] = \"week\";\n return editableInputTypes;\n}(editableInputTypes || {});\nfunction isEditableInputOrTextArea(element) {\n return isElementType(element, 'textarea') || isElementType(element, 'input') && element.type in editableInputTypes;\n}\n\nexport { isEditable, isEditableInputOrTextArea };\n","import { isClickableInput } from '../click/isClickableInput.js';\nimport { isEditableInputOrTextArea } from '../edit/isEditable.js';\n\n/**\n * Determine if the element has its own selection implementation\n * and does not interact with the Document Selection API.\n */ function hasOwnSelection(node) {\n return isElement(node) && isEditableInputOrTextArea(node);\n}\nfunction hasNoSelection(node) {\n return isElement(node) && isClickableInput(node);\n}\nfunction isElement(node) {\n return node.nodeType === 1;\n}\n\nexport { hasNoSelection, hasOwnSelection };\n","import '../../utils/dataTransfer/Clipboard.js';\nimport { getContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\n\n// The browser implementation seems to have changed.\n// When focus is inside <input type=\"text\"/>,\n// Chrome updates Selection to be collapsed at the position of the input element.\n// TODO: update implementation to match that of current browsers\n/**\n * Reset the Document Selection when moving focus into an element\n * with own selection implementation.\n */ function updateSelectionOnFocus(element) {\n const selection = element.ownerDocument.getSelection();\n /* istanbul ignore if */ if (!(selection === null || selection === undefined ? undefined : selection.focusNode)) {\n return;\n }\n // If the focus moves inside an element with own selection implementation,\n // the document selection will be this element.\n // But if the focused element is inside a contenteditable,\n // 1) a collapsed selection will be retained.\n // 2) other selections will be replaced by a cursor\n // 2.a) at the start of the first child if it is a text node\n // 2.b) at the start of the contenteditable.\n if (hasOwnSelection(element)) {\n const contenteditable = getContentEditable(selection.focusNode);\n if (contenteditable) {\n if (!selection.isCollapsed) {\n var _contenteditable_firstChild;\n const focusNode = ((_contenteditable_firstChild = contenteditable.firstChild) === null || _contenteditable_firstChild === undefined ? undefined : _contenteditable_firstChild.nodeType) === 3 ? contenteditable.firstChild : contenteditable;\n selection.setBaseAndExtent(focusNode, 0, focusNode, 0);\n }\n } else {\n selection.setBaseAndExtent(element, 0, element, 0);\n }\n }\n}\n\nexport { updateSelectionOnFocus };\n","import { getConfig } from '@testing-library/dom';\n\nfunction wrapEvent(cb, _element) {\n return getConfig().eventWrapper(cb);\n}\n\nexport { wrapEvent };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { getActiveElement } from '../utils/focus/getActiveElement.js';\nimport { isFocusable } from '../utils/focus/isFocusable.js';\nimport { findClosest } from '../utils/misc/findClosest.js';\nimport { updateSelectionOnFocus } from './selection/updateSelectionOnFocus.js';\nimport { wrapEvent } from './wrapEvent.js';\n\n// Browsers do not dispatch FocusEvent if the document does not have focus.\n// TODO: simulate FocusEvent in browsers\n/**\n * Focus closest focusable element.\n */ function focusElement(element) {\n const target = findClosest(element, isFocusable);\n const activeElement = getActiveElement(element.ownerDocument);\n if ((target !== null && target !== undefined ? target : element.ownerDocument.body) === activeElement) {\n return;\n } else if (target) {\n wrapEvent(()=>target.focus());\n } else {\n wrapEvent(()=>activeElement === null || activeElement === undefined ? undefined : activeElement.blur());\n }\n updateSelectionOnFocus(target !== null && target !== undefined ? target : element.ownerDocument.body);\n}\nfunction blurElement(element) {\n if (!isFocusable(element)) return;\n const wasActive = getActiveElement(element.ownerDocument) === element;\n if (!wasActive) return;\n wrapEvent(()=>element.blur());\n}\n\nexport { blurElement, focusElement };\n","const behavior = {};\n\nexport { behavior };\n","import { isElementType } from '../../utils/misc/isElementType.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../../utils/misc/getWindow.js';\nimport { isFocusable } from '../../utils/focus/isFocusable.js';\nimport { cloneEvent } from '../../utils/misc/cloneEvent.js';\nimport { focusElement, blurElement } from '../focus.js';\nimport { behavior } from './registry.js';\n\nbehavior.click = (event, target, instance)=>{\n const context = target.closest('button,input,label,select,textarea');\n const control = context && isElementType(context, 'label') && context.control;\n if (control && control !== target) {\n return ()=>{\n if (isFocusable(control)) {\n focusElement(control);\n instance.dispatchEvent(control, cloneEvent(event));\n }\n };\n } else if (isElementType(target, 'input', {\n type: 'file'\n })) {\n return ()=>{\n // blur fires when the file selector pops up\n blurElement(target);\n target.dispatchEvent(new (getWindow(target)).Event('fileDialog'));\n // focus fires after the file selector has been closed\n focusElement(target);\n };\n }\n};\n","const UIValue = Symbol('Displayed value in UI');\nconst UISelection = Symbol('Displayed selection in UI');\nconst InitialValue = Symbol('Initial value to compare on blur');\nfunction isUIValue(value) {\n return typeof value === 'object' && UIValue in value;\n}\nfunction isUISelectionStart(start) {\n return !!start && typeof start === 'object' && UISelection in start;\n}\nfunction setUIValue(element, value) {\n if (element[InitialValue] === undefined) {\n element[InitialValue] = element.value;\n }\n element[UIValue] = value;\n // eslint-disable-next-line no-new-wrappers\n element.value = Object.assign(new String(value), {\n [UIValue]: true\n });\n}\nfunction getUIValue(element) {\n return element[UIValue] === undefined ? element.value : String(element[UIValue]);\n}\n/** Flag the IDL value as clean. This does not change the value.*/ function setUIValueClean(element) {\n element[UIValue] = undefined;\n}\nfunction clearInitialValue(element) {\n element[InitialValue] = undefined;\n}\nfunction getInitialValue(element) {\n return element[InitialValue];\n}\nfunction setUISelectionRaw(element, selection) {\n element[UISelection] = selection;\n}\nfunction setUISelection(element, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = 'replace') {\n const valueLength = getUIValue(element).length;\n const sanitizeOffset = (o)=>Math.max(0, Math.min(valueLength, o));\n const anchorOffset = mode === 'replace' || element[UISelection] === undefined ? sanitizeOffset(anchorOffsetParam) : element[UISelection].anchorOffset;\n const focusOffset = sanitizeOffset(focusOffsetParam);\n const startOffset = Math.min(anchorOffset, focusOffset);\n const endOffset = Math.max(anchorOffset, focusOffset);\n element[UISelection] = {\n anchorOffset,\n focusOffset\n };\n if (element.selectionStart === startOffset && element.selectionEnd === endOffset) {\n return;\n }\n // eslint-disable-next-line no-new-wrappers\n const startObj = Object.assign(new Number(startOffset), {\n [UISelection]: true\n });\n try {\n element.setSelectionRange(startObj, endOffset);\n } catch {\n // DOMException for invalid state is expected when calling this\n // on an element without support for setSelectionRange\n }\n}\nfunction getUISelection(element) {\n var _element_selectionStart, _element_selectionEnd, _element_UISelection;\n const sel = (_element_UISelection = element[UISelection]) !== null && _element_UISelection !== undefined ? _element_UISelection : {\n anchorOffset: (_element_selectionStart = element.selectionStart) !== null && _element_selectionStart !== undefined ? _element_selectionStart : 0,\n focusOffset: (_element_selectionEnd = element.selectionEnd) !== null && _element_selectionEnd !== undefined ? _element_selectionEnd : 0\n };\n return {\n ...sel,\n startOffset: Math.min(sel.anchorOffset, sel.focusOffset),\n endOffset: Math.max(sel.anchorOffset, sel.focusOffset)\n };\n}\nfunction hasUISelection(element) {\n return !!element[UISelection];\n}\n/** Flag the IDL selection as clean. This does not change the selection. */ function setUISelectionClean(element) {\n element[UISelection] = undefined;\n}\n\nexport { clearInitialValue, getInitialValue, getUISelection, getUIValue, hasUISelection, isUISelectionStart, isUIValue, setUISelection, setUISelectionClean, setUISelectionRaw, setUIValue, setUIValueClean };\n","const parseInt = globalThis.parseInt;\nfunction buildTimeValue(value) {\n const onlyDigitsValue = value.replace(/\\D/g, '');\n if (onlyDigitsValue.length < 2) {\n return value;\n }\n const firstDigit = parseInt(onlyDigitsValue[0], 10);\n const secondDigit = parseInt(onlyDigitsValue[1], 10);\n if (firstDigit >= 3 || firstDigit === 2 && secondDigit >= 4) {\n let index;\n if (firstDigit >= 3) {\n index = 1;\n } else {\n index = 2;\n }\n return build(onlyDigitsValue, index);\n }\n if (value.length === 2) {\n return value;\n }\n return build(onlyDigitsValue, 2);\n}\nfunction build(onlyDigitsValue, index) {\n const hours = onlyDigitsValue.slice(0, index);\n const validHours = Math.min(parseInt(hours, 10), 23);\n const minuteCharacters = onlyDigitsValue.slice(index);\n const parsedMinutes = parseInt(minuteCharacters, 10);\n const validMinutes = Math.min(parsedMinutes, 59);\n return `${validHours.toString().padStart(2, '0')}:${validMinutes.toString().padStart(2, '0')}`;\n}\nfunction isValidDateOrTimeValue(element, value) {\n const clone = element.cloneNode();\n clone.value = value;\n return clone.value === value;\n}\n\nexport { buildTimeValue, isValidDateOrTimeValue };\n","import { isElementType } from '../misc/isElementType.js';\n\nvar maxLengthSupportedTypes = /*#__PURE__*/ function(maxLengthSupportedTypes) {\n maxLengthSupportedTypes[\"email\"] = \"email\";\n maxLengthSupportedTypes[\"password\"] = \"password\";\n maxLengthSupportedTypes[\"search\"] = \"search\";\n maxLengthSupportedTypes[\"telephone\"] = \"telephone\";\n maxLengthSupportedTypes[\"text\"] = \"text\";\n maxLengthSupportedTypes[\"url\"] = \"url\";\n return maxLengthSupportedTypes;\n}(maxLengthSupportedTypes || {});\n// can't use .maxLength property because of a jsdom bug:\n// https://github.com/jsdom/jsdom/issues/2927\nfunction getMaxLength(element) {\n var _element_getAttribute;\n const attr = (_element_getAttribute = element.getAttribute('maxlength')) !== null && _element_getAttribute !== undefined ? _element_getAttribute : '';\n return /^\\d+$/.test(attr) && Number(attr) >= 0 ? Number(attr) : undefined;\n}\nfunction supportsMaxLength(element) {\n return isElementType(element, 'textarea') || isElementType(element, 'input') && element.type in maxLengthSupportedTypes;\n}\n\nexport { getMaxLength, supportsMaxLength };\n","import { isContentEditable } from '../edit/isContentEditable.js';\nimport { isElementType } from '../misc/isElementType.js';\n\nfunction getNextCursorPosition(node, offset, direction, inputType) {\n // The behavior at text node zero offset is inconsistent.\n // When walking backwards:\n // Firefox always moves to zero offset and jumps over last offset.\n // Chrome jumps over zero offset per default but over last offset when Shift is pressed.\n // The cursor always moves to zero offset if the focus area (contenteditable or body) ends there.\n // When walking forward both ignore zero offset.\n // When walking over input elements the cursor moves before or after that element.\n // When walking over line breaks the cursor moves inside any following text node.\n if (isTextNode(node) && offset + direction >= 0 && offset + direction <= node.nodeValue.length) {\n return {\n node,\n offset: offset + direction\n };\n }\n const nextNode = getNextCharacterContentNode(node, offset, direction);\n if (nextNode) {\n if (isTextNode(nextNode)) {\n return {\n node: nextNode,\n offset: direction > 0 ? Math.min(1, nextNode.nodeValue.length) : Math.max(nextNode.nodeValue.length - 1, 0)\n };\n } else if (isElementType(nextNode, 'br')) {\n const nextPlusOne = getNextCharacterContentNode(nextNode, undefined, direction);\n if (!nextPlusOne) {\n // The behavior when there is no possible cursor position beyond the line break is inconsistent.\n // In Chrome outside of contenteditable moving before a leading line break is possible.\n // A leading line break can still be removed per deleteContentBackward.\n // A trailing line break on the other hand is not removed by deleteContentForward.\n if (direction < 0 && inputType === 'deleteContentBackward') {\n return {\n node: nextNode.parentNode,\n offset: getOffset(nextNode)\n };\n }\n return undefined;\n } else if (isTextNode(nextPlusOne)) {\n return {\n node: nextPlusOne,\n offset: direction > 0 ? 0 : nextPlusOne.nodeValue.length\n };\n } else if (direction < 0 && isElementType(nextPlusOne, 'br')) {\n return {\n node: nextNode.parentNode,\n offset: getOffset(nextNode)\n };\n } else {\n return {\n node: nextPlusOne.parentNode,\n offset: getOffset(nextPlusOne) + (direction > 0 ? 0 : 1)\n };\n }\n } else {\n return {\n node: nextNode.parentNode,\n offset: getOffset(nextNode) + (direction > 0 ? 1 : 0)\n };\n }\n }\n}\nfunction getNextCharacterContentNode(node, offset, direction) {\n const nextOffset = Number(offset) + (direction < 0 ? -1 : 0);\n if (offset !== undefined && isElement(node) && nextOffset >= 0 && nextOffset < node.children.length) {\n node = node.children[nextOffset];\n }\n return walkNodes(node, direction === 1 ? 'next' : 'previous', isTreatedAsCharacterContent);\n}\nfunction isTreatedAsCharacterContent(node) {\n if (isTextNode(node)) {\n return true;\n }\n if (isElement(node)) {\n if (isElementType(node, [\n 'input',\n 'textarea'\n ])) {\n return node.type !== 'hidden';\n } else if (isElementType(node, 'br')) {\n return true;\n }\n }\n return false;\n}\nfunction getOffset(node) {\n let i = 0;\n while(node.previousSibling){\n i++;\n node = node.previousSibling;\n }\n return i;\n}\nfunction isElement(node) {\n return node.nodeType === 1;\n}\nfunction isTextNode(node) {\n return node.nodeType === 3;\n}\nfunction walkNodes(node, direction, callback) {\n for(;;){\n var _node_ownerDocument;\n const sibling = node[`${direction}Sibling`];\n if (sibling) {\n node = getDescendant(sibling, direction === 'next' ? 'first' : 'last');\n if (callback(node)) {\n return node;\n }\n } else if (node.parentNode && (!isElement(node.parentNode) || !isContentEditable(node.parentNode) && node.parentNode !== ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === undefined ? undefined : _node_ownerDocument.body))) {\n node = node.parentNode;\n } else {\n break;\n }\n }\n}\nfunction getDescendant(node, direction) {\n while(node.hasChildNodes()){\n node = node[`${direction}Child`];\n }\n return node;\n}\n\nexport { getNextCursorPosition };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\nimport { setUIValueClean, setUISelection, hasUISelection } from './UI.js';\n\nconst TrackChanges = Symbol('Track programmatic changes for React workaround');\n// When the input event happens in the browser, React executes all event handlers\n// and if they change state of a controlled value, nothing happens.\n// But when we trigger the event handlers in test environment with React@17,\n// the changes are rolled back before the state update is applied.\n// This results in a reset cursor.\n// There might be a better way to work around if we figure out\n// why the batched update is executed differently in our test environment.\nfunction isReact17Element(element) {\n return Object.getOwnPropertyNames(element).some((k)=>k.startsWith('__react')) && getWindow(element).REACT_VERSION === 17;\n}\nfunction startTrackValue(element) {\n if (!isReact17Element(element)) {\n return;\n }\n element[TrackChanges] = {\n previousValue: String(element.value),\n tracked: []\n };\n}\nfunction trackOrSetValue(element, v) {\n var _element_TrackChanges_tracked, _element_TrackChanges;\n (_element_TrackChanges = element[TrackChanges]) === null || _element_TrackChanges === undefined ? undefined : (_element_TrackChanges_tracked = _element_TrackChanges.tracked) === null || _element_TrackChanges_tracked === undefined ? undefined : _element_TrackChanges_tracked.push(v);\n if (!element[TrackChanges]) {\n setUIValueClean(element);\n setUISelection(element, {\n focusOffset: v.length\n });\n }\n}\nfunction commitValueAfterInput(element, cursorOffset) {\n var _changes_tracked;\n const changes = element[TrackChanges];\n element[TrackChanges] = undefined;\n if (!(changes === null || changes === undefined ? undefined : (_changes_tracked = changes.tracked) === null || _changes_tracked === undefined ? undefined : _changes_tracked.length)) {\n return;\n }\n const isJustReactStateUpdate = changes.tracked.length === 2 && changes.tracked[0] === changes.previousValue && changes.tracked[1] === element.value;\n if (!isJustReactStateUpdate) {\n setUIValueClean(element);\n }\n if (hasUISelection(element)) {\n setUISelection(element, {\n focusOffset: isJustReactStateUpdate ? cursorOffset : element.value.length\n });\n }\n}\n\nexport { commitValueAfterInput, startTrackValue, trackOrSetValue };\n","import { getUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { getContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\n\n/**\n * Determine which selection logic and selection ranges to consider.\n */ function getTargetTypeAndSelection(node) {\n const element = getElement(node);\n if (element && hasOwnSelection(element)) {\n return {\n type: 'input',\n selection: getUISelection(element)\n };\n }\n const selection = element === null || element === undefined ? undefined : element.ownerDocument.getSelection();\n // It is possible to extend a single-range selection into a contenteditable.\n // This results in the range acting like a range outside of contenteditable.\n const isCE = getContentEditable(node) && (selection === null || selection === undefined ? undefined : selection.anchorNode) && getContentEditable(selection.anchorNode);\n return {\n type: isCE ? 'contenteditable' : 'default',\n selection\n };\n}\nfunction getElement(node) {\n return node.nodeType === 1 ? node : node.parentElement;\n}\n\nexport { getTargetTypeAndSelection };\n","import { getTargetTypeAndSelection } from './getTargetTypeAndSelection.js';\n\n/**\n * Get the range that would be overwritten by input.\n */ function getInputRange(focusNode) {\n const typeAndSelection = getTargetTypeAndSelection(focusNode);\n if (typeAndSelection.type === 'input') {\n return typeAndSelection.selection;\n } else if (typeAndSelection.type === 'contenteditable') {\n var _typeAndSelection_selection;\n // Multi-range on contenteditable edits the first selection instead of the last\n return (_typeAndSelection_selection = typeAndSelection.selection) === null || _typeAndSelection_selection === undefined ? undefined : _typeAndSelection_selection.getRangeAt(0);\n }\n}\n\nexport { getInputRange };\n","import { setUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { getTargetTypeAndSelection } from './getTargetTypeAndSelection.js';\n\n/**\n * Set the selection\n */ function setSelection({ focusNode, focusOffset, anchorNode = focusNode, anchorOffset = focusOffset }) {\n var _anchorNode_ownerDocument_getSelection, _anchorNode_ownerDocument;\n const typeAndSelection = getTargetTypeAndSelection(focusNode);\n if (typeAndSelection.type === 'input') {\n return setUISelection(focusNode, {\n anchorOffset,\n focusOffset\n });\n }\n (_anchorNode_ownerDocument = anchorNode.ownerDocument) === null || _anchorNode_ownerDocument === undefined ? undefined : (_anchorNode_ownerDocument_getSelection = _anchorNode_ownerDocument.getSelection()) === null || _anchorNode_ownerDocument_getSelection === undefined ? undefined : _anchorNode_ownerDocument_getSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n}\n\nexport { setSelection };\n","import { setUIValue, clearInitialValue, getUIValue } from '../document/UI.js';\nimport { isElementType } from '../utils/misc/isElementType.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { isValidDateOrTimeValue, buildTimeValue } from '../utils/edit/timeValue.js';\nimport { supportsMaxLength, getMaxLength } from '../utils/edit/maxLength.js';\nimport { getNextCursorPosition } from '../utils/focus/cursor.js';\nimport { commitValueAfterInput } from '../document/trackValue.js';\nimport { getInputRange } from './selection/getInputRange.js';\nimport { setSelection } from './selection/setSelection.js';\n\nfunction isDateOrTime(element) {\n return isElementType(element, 'input') && [\n 'date',\n 'time'\n ].includes(element.type);\n}\nfunction input(instance, element, data, inputType = 'insertText') {\n const inputRange = getInputRange(element);\n /* istanbul ignore if */ if (!inputRange) {\n return;\n }\n // There is no `beforeinput` event on `date` and `time` input\n if (!isDateOrTime(element)) {\n const unprevented = instance.dispatchUIEvent(element, 'beforeinput', {\n inputType,\n data\n });\n if (!unprevented) {\n return;\n }\n }\n if ('startContainer' in inputRange) {\n editContenteditable(instance, element, inputRange, data, inputType);\n } else {\n editInputElement(instance, element, inputRange, data, inputType);\n }\n}\nfunction editContenteditable(instance, element, inputRange, data, inputType) {\n let del = false;\n if (!inputRange.collapsed) {\n del = true;\n inputRange.deleteContents();\n } else if ([\n 'deleteContentBackward',\n 'deleteContentForward'\n ].includes(inputType)) {\n const nextPosition = getNextCursorPosition(inputRange.startContainer, inputRange.startOffset, inputType === 'deleteContentBackward' ? -1 : 1, inputType);\n if (nextPosition) {\n del = true;\n const delRange = inputRange.cloneRange();\n if (delRange.comparePoint(nextPosition.node, nextPosition.offset) < 0) {\n delRange.setStart(nextPosition.node, nextPosition.offset);\n } else {\n delRange.setEnd(nextPosition.node, nextPosition.offset);\n }\n delRange.deleteContents();\n }\n }\n if (data) {\n if (inputRange.endContainer.nodeType === 3) {\n const offset = inputRange.endOffset;\n inputRange.endContainer.insertData(offset, data);\n inputRange.setStart(inputRange.endContainer, offset + data.length);\n inputRange.setEnd(inputRange.endContainer, offset + data.length);\n } else {\n const text = element.ownerDocument.createTextNode(data);\n inputRange.insertNode(text);\n inputRange.setStart(text, data.length);\n inputRange.setEnd(text, data.length);\n }\n }\n if (del || data) {\n instance.dispatchUIEvent(element, 'input', {\n inputType\n });\n }\n}\nfunction editInputElement(instance, element, inputRange, data, inputType) {\n let dataToInsert = data;\n if (supportsMaxLength(element)) {\n const maxLength = getMaxLength(element);\n if (maxLength !== undefined && data.length > 0) {\n const spaceUntilMaxLength = maxLength - element.value.length;\n if (spaceUntilMaxLength > 0) {\n dataToInsert = data.substring(0, spaceUntilMaxLength);\n } else {\n return;\n }\n }\n }\n const { newValue, newOffset, oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);\n if (newValue === oldValue && newOffset === inputRange.startOffset && newOffset === inputRange.endOffset) {\n return;\n }\n if (isElementType(element, 'input', {\n type: 'number'\n }) && !isValidNumberInput(newValue)) {\n return;\n }\n setUIValue(element, newValue);\n setSelection({\n focusNode: element,\n anchorOffset: newOffset,\n focusOffset: newOffset\n });\n if (isDateOrTime(element)) {\n if (isValidDateOrTimeValue(element, newValue)) {\n commitInput(instance, element, newOffset, {});\n instance.dispatchUIEvent(element, 'change');\n clearInitialValue(element);\n }\n } else {\n commitInput(instance, element, newOffset, {\n data,\n inputType\n });\n }\n}\nfunction calculateNewValue(inputData, node, { startOffset, endOffset }, inputType) {\n const value = getUIValue(node);\n const prologEnd = Math.max(0, startOffset === endOffset && inputType === 'deleteContentBackward' ? startOffset - 1 : startOffset);\n const prolog = value.substring(0, prologEnd);\n const epilogStart = Math.min(value.length, startOffset === endOffset && inputType === 'deleteContentForward' ? startOffset + 1 : endOffset);\n const epilog = value.substring(epilogStart, value.length);\n let newValue = `${prolog}${inputData}${epilog}`;\n let newOffset = prologEnd + inputData.length;\n if (isElementType(node, 'input', {\n type: 'time'\n })) {\n const builtValue = buildTimeValue(newValue);\n if (builtValue !== '' && isValidDateOrTimeValue(node, builtValue)) {\n newValue = builtValue;\n newOffset = builtValue.length;\n }\n }\n return {\n oldValue: value,\n newValue,\n newOffset\n };\n}\nfunction commitInput(instance, element, newOffset, inputInit) {\n instance.dispatchUIEvent(element, 'input', inputInit);\n commitValueAfterInput(element, newOffset);\n}\nfunction isValidNumberInput(value) {\n var _value_match, _value_match1;\n // the browser allows some invalid input but not others\n // it allows up to two '-' at any place before any 'e' or one directly following 'e'\n // it allows one '.' at any place before e\n const valueParts = value.split('e', 2);\n return !(/[^\\d.\\-e]/.test(value) || Number((_value_match = value.match(/-/g)) === null || _value_match === undefined ? undefined : _value_match.length) > 2 || Number((_value_match1 = value.match(/\\./g)) === null || _value_match1 === undefined ? undefined : _value_match1.length) > 1 || valueParts[1] && !/^-?\\d*$/.test(valueParts[1]));\n}\n\nexport { input };\n","import '../../utils/dataTransfer/Clipboard.js';\nimport { isEditable } from '../../utils/edit/isEditable.js';\nimport { input } from '../input.js';\nimport { behavior } from './registry.js';\n\nbehavior.cut = (event, target, instance)=>{\n return ()=>{\n if (isEditable(target)) {\n input(instance, target, '', 'deleteByCut');\n }\n };\n};\n","import '../utils/dataTransfer/Clipboard.js';\nimport { isContentEditable } from '../utils/edit/isContentEditable.js';\nimport { getUIValue } from './UI.js';\n\nfunction getValueOrTextContent(element) {\n // istanbul ignore if\n if (!element) {\n return null;\n }\n if (isContentEditable(element)) {\n return element.textContent;\n }\n return getUIValue(element);\n}\n\nexport { getValueOrTextContent };\n","import { getWindow } from './getWindow.js';\n\nfunction isVisible(element) {\n const window = getWindow(element);\n for(let el = element; el === null || el === undefined ? undefined : el.ownerDocument; el = el.parentElement){\n const { display, visibility } = window.getComputedStyle(el);\n if (display === 'none') {\n return false;\n }\n if (visibility === 'hidden') {\n return false;\n }\n }\n return true;\n}\n\nexport { isVisible };\n","import { isDisabled } from '../misc/isDisabled.js';\nimport { isElementType } from '../misc/isElementType.js';\nimport { isVisible } from '../misc/isVisible.js';\nimport { FOCUSABLE_SELECTOR } from './selector.js';\n\nfunction getTabDestination(activeElement, shift) {\n const document = activeElement.ownerDocument;\n const focusableElements = document.querySelectorAll(FOCUSABLE_SELECTOR);\n const enabledElements = Array.from(focusableElements).filter((el)=>el === activeElement || !(Number(el.getAttribute('tabindex')) < 0 || isDisabled(el)));\n // tabindex has no effect if the active element has negative tabindex\n if (Number(activeElement.getAttribute('tabindex')) >= 0) {\n enabledElements.sort((a, b)=>{\n const i = Number(a.getAttribute('tabindex'));\n const j = Number(b.getAttribute('tabindex'));\n if (i === j) {\n return 0;\n } else if (i === 0) {\n return 1;\n } else if (j === 0) {\n return -1;\n }\n return i - j;\n });\n }\n const checkedRadio = {};\n let prunedElements = [\n document.body\n ];\n const activeRadioGroup = isElementType(activeElement, 'input', {\n type: 'radio'\n }) ? activeElement.name : undefined;\n enabledElements.forEach((currentElement)=>{\n const el = currentElement;\n // For radio groups keep only the active radio\n // If there is no active radio, keep only the checked radio\n // If there is no checked radio, treat like everything else\n if (isElementType(el, 'input', {\n type: 'radio'\n }) && el.name) {\n // If the active element is part of the group, add only that\n if (el === activeElement) {\n prunedElements.push(el);\n return;\n } else if (el.name === activeRadioGroup) {\n return;\n }\n // If we stumble upon a checked radio, remove the others\n if (el.checked) {\n prunedElements = prunedElements.filter((e)=>!isElementType(e, 'input', {\n type: 'radio',\n name: el.name\n }));\n prunedElements.push(el);\n checkedRadio[el.name] = el;\n return;\n }\n // If we already found the checked one, skip\n if (typeof checkedRadio[el.name] !== 'undefined') {\n return;\n }\n }\n prunedElements.push(el);\n });\n for(let index = prunedElements.findIndex((el)=>el === activeElement);;){\n index += shift ? -1 : 1;\n // loop at overflow\n if (index === prunedElements.length) {\n index = 0;\n } else if (index === -1) {\n index = prunedElements.length - 1;\n }\n if (prunedElements[index] === activeElement || prunedElements[index] === document.body || isVisible(prunedElements[index])) {\n return prunedElements[index];\n }\n }\n}\n\nexport { getTabDestination };\n","import { getUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { getNextCursorPosition } from '../../utils/focus/cursor.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\nimport { setSelection } from './setSelection.js';\n\n/**\n * Move the selection\n */ function moveSelection(node, direction) {\n // TODO: implement shift\n if (hasOwnSelection(node)) {\n const selection = getUISelection(node);\n setSelection({\n focusNode: node,\n focusOffset: selection.startOffset === selection.endOffset ? selection.focusOffset + direction : direction < 0 ? selection.startOffset : selection.endOffset\n });\n } else {\n const selection = node.ownerDocument.getSelection();\n if (!(selection === null || selection === undefined ? undefined : selection.focusNode)) {\n return;\n }\n if (selection.isCollapsed) {\n const nextPosition = getNextCursorPosition(selection.focusNode, selection.focusOffset, direction);\n if (nextPosition) {\n setSelection({\n focusNode: nextPosition.node,\n focusOffset: nextPosition.offset\n });\n }\n } else {\n selection[direction < 0 ? 'collapseToStart' : 'collapseToEnd']();\n }\n }\n}\n\nexport { moveSelection };\n","import { getUIValue, getUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { getContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\nimport { setSelection } from './setSelection.js';\n\n/**\n * Expand a selection like the browser does when pressing Ctrl+A.\n */ function selectAll(target) {\n if (hasOwnSelection(target)) {\n return setSelection({\n focusNode: target,\n anchorOffset: 0,\n focusOffset: getUIValue(target).length\n });\n }\n var _getContentEditable;\n const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== undefined ? _getContentEditable : target.ownerDocument.body;\n setSelection({\n focusNode,\n anchorOffset: 0,\n focusOffset: focusNode.childNodes.length\n });\n}\nfunction isAllSelected(target) {\n if (hasOwnSelection(target)) {\n return getUISelection(target).startOffset === 0 && getUISelection(target).endOffset === getUIValue(target).length;\n }\n var _getContentEditable;\n const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== undefined ? _getContentEditable : target.ownerDocument.body;\n const selection = target.ownerDocument.getSelection();\n return (selection === null || selection === undefined ? undefined : selection.anchorNode) === focusNode && selection.focusNode === focusNode && selection.anchorOffset === 0 && selection.focusOffset === focusNode.childNodes.length;\n}\n\nexport { isAllSelected, selectAll };\n","import '../../utils/dataTransfer/Clipboard.js';\nimport { isContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\nimport { setSelection } from './setSelection.js';\n\n/**\n * Backward-compatible selection.\n *\n * Handles input elements and contenteditable if it only contains a single text node.\n */ function setSelectionRange(element, anchorOffset, focusOffset) {\n var _element_firstChild;\n if (hasOwnSelection(element)) {\n return setSelection({\n focusNode: element,\n anchorOffset,\n focusOffset\n });\n }\n /* istanbul ignore else */ if (isContentEditable(element) && ((_element_firstChild = element.firstChild) === null || _element_firstChild === undefined ? undefined : _element_firstChild.nodeType) === 3) {\n return setSelection({\n focusNode: element.firstChild,\n anchorOffset,\n focusOffset\n });\n }\n /* istanbul ignore next */ throw new Error('Not implemented. The result of this interaction is unreliable.');\n}\n\nexport { setSelectionRange };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { isDisabled } from '../utils/misc/isDisabled.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\nimport { focusElement } from './focus.js';\n\nfunction walkRadio(instance, el, direction) {\n const window = getWindow(el);\n const group = Array.from(el.ownerDocument.querySelectorAll(el.name ? `input[type=\"radio\"][name=\"${window.CSS.escape(el.name)}\"]` : `input[type=\"radio\"][name=\"\"], input[type=\"radio\"]:not([name])`));\n for(let i = group.findIndex((e)=>e === el) + direction;; i += direction){\n if (!group[i]) {\n i = direction > 0 ? 0 : group.length - 1;\n }\n if (group[i] === el) {\n return;\n }\n if (isDisabled(group[i])) {\n continue;\n }\n focusElement(group[i]);\n instance.dispatchUIEvent(group[i], 'click');\n return;\n }\n}\n\nexport { walkRadio };\n","import { getUIValue, setUISelection } from '../../document/UI.js';\nimport { getValueOrTextContent } from '../../document/getValueOrTextContent.js';\nimport { isElementType } from '../../utils/misc/isElementType.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { isContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { isEditable } from '../../utils/edit/isEditable.js';\nimport { getTabDestination } from '../../utils/focus/getTabDestination.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\nimport { focusElement } from '../focus.js';\nimport { input } from '../input.js';\nimport { moveSelection } from '../selection/moveSelection.js';\nimport { selectAll } from '../selection/selectAll.js';\nimport { setSelectionRange } from '../selection/setSelectionRange.js';\nimport { walkRadio } from '../radio.js';\nimport { behavior } from './registry.js';\n\nbehavior.keydown = (event, target, instance)=>{\n var _keydownBehavior_event_key;\n var _keydownBehavior_event_key1;\n return (_keydownBehavior_event_key1 = (_keydownBehavior_event_key = keydownBehavior[event.key]) === null || _keydownBehavior_event_key === undefined ? undefined : _keydownBehavior_event_key.call(keydownBehavior, event, target, instance)) !== null && _keydownBehavior_event_key1 !== undefined ? _keydownBehavior_event_key1 : combinationBehavior(event, target, instance);\n};\nconst keydownBehavior = {\n ArrowDown: (event, target, instance)=>{\n /* istanbul ignore else */ if (isElementType(target, 'input', {\n type: 'radio'\n })) {\n return ()=>walkRadio(instance, target, 1);\n }\n },\n ArrowLeft: (event, target, instance)=>{\n if (isElementType(target, 'input', {\n type: 'radio'\n })) {\n return ()=>walkRadio(instance, target, -1);\n }\n return ()=>moveSelection(target, -1);\n },\n ArrowRight: (event, target, instance)=>{\n if (isElementType(target, 'input', {\n type: 'radio'\n })) {\n return ()=>walkRadio(instance, target, 1);\n }\n return ()=>moveSelection(target, 1);\n },\n ArrowUp: (event, target, instance)=>{\n /* istanbul ignore else */ if (isElementType(target, 'input', {\n type: 'radio'\n })) {\n return ()=>walkRadio(instance, target, -1);\n }\n },\n Backspace: (event, target, instance)=>{\n if (isEditable(target)) {\n return ()=>{\n input(instance, target, '', 'deleteContentBackward');\n };\n }\n },\n Delete: (event, target, instance)=>{\n if (isEditable(target)) {\n return ()=>{\n input(instance, target, '', 'deleteContentForward');\n };\n }\n },\n End: (event, target)=>{\n if (isElementType(target, [\n 'input',\n 'textarea'\n ]) || isContentEditable(target)) {\n return ()=>{\n var _getValueOrTextContent;\n var _getValueOrTextContent_length;\n const newPos = (_getValueOrTextContent_length = (_getValueOrTextContent = getValueOrTextContent(target)) === null || _getValueOrTextContent === undefined ? undefined : _getValueOrTextContent.length) !== null && _getValueOrTextContent_length !== undefined ? _getValueOrTextContent_length : /* istanbul ignore next */ 0;\n setSelectionRange(target, newPos, newPos);\n };\n }\n },\n Home: (event, target)=>{\n if (isElementType(target, [\n 'input',\n 'textarea'\n ]) || isContentEditable(target)) {\n return ()=>{\n setSelectionRange(target, 0, 0);\n };\n }\n },\n PageDown: (event, target)=>{\n if (isElementType(target, [\n 'input'\n ])) {\n return ()=>{\n const newPos = getUIValue(target).length;\n setSelectionRange(target, newPos, newPos);\n };\n }\n },\n PageUp: (event, target)=>{\n if (isElementType(target, [\n 'input'\n ])) {\n return ()=>{\n setSelectionRange(target, 0, 0);\n };\n }\n },\n Tab: (event, target, instance)=>{\n return ()=>{\n const dest = getTabDestination(target, instance.system.keyboard.modifiers.Shift);\n focusElement(dest);\n if (hasOwnSelection(dest)) {\n setUISelection(dest, {\n anchorOffset: 0,\n focusOffset: dest.value.length\n });\n }\n };\n }\n};\nconst combinationBehavior = (event, target, instance)=>{\n if (event.code === 'KeyA' && instance.system.keyboard.modifiers.Control) {\n return ()=>selectAll(target);\n }\n};\n","import { isElementType } from '../../utils/misc/isElementType.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { isContentEditable } from '../../utils/edit/isContentEditable.js';\nimport { isEditable } from '../../utils/edit/isEditable.js';\nimport { input } from '../input.js';\nimport { behavior } from './registry.js';\n\nbehavior.keypress = (event, target, instance)=>{\n if (event.key === 'Enter') {\n if (isElementType(target, 'button') || isElementType(target, 'input') && ClickInputOnEnter.includes(target.type) || isElementType(target, 'a') && Boolean(target.href)) {\n return ()=>{\n instance.dispatchUIEvent(target, 'click');\n };\n } else if (isElementType(target, 'input')) {\n const form = target.form;\n const submit = form === null || form === undefined ? undefined : form.querySelector('input[type=\"submit\"], button:not([type]), button[type=\"submit\"]');\n if (submit) {\n return ()=>instance.dispatchUIEvent(submit, 'click');\n } else if (form && SubmitSingleInputOnEnter.includes(target.type) && form.querySelectorAll('input').length === 1) {\n return ()=>instance.dispatchUIEvent(form, 'submit');\n } else {\n return;\n }\n }\n }\n if (isEditable(target)) {\n const inputType = event.key === 'Enter' ? isContentEditable(target) && !instance.system.keyboard.modifiers.Shift ? 'insertParagraph' : 'insertLineBreak' : 'insertText';\n const inputData = event.key === 'Enter' ? '\\n' : event.key;\n return ()=>input(instance, target, inputData, inputType);\n }\n};\nconst ClickInputOnEnter = [\n 'button',\n 'color',\n 'file',\n 'image',\n 'reset',\n 'submit'\n];\nconst SubmitSingleInputOnEnter = [\n 'email',\n 'month',\n 'password',\n 'search',\n 'tel',\n 'text',\n 'url',\n 'week'\n];\n","import { isClickableInput } from '../../utils/click/isClickableInput.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { behavior } from './registry.js';\n\nbehavior.keyup = (event, target, instance)=>{\n var _keyupBehavior_event_key;\n return (_keyupBehavior_event_key = keyupBehavior[event.key]) === null || _keyupBehavior_event_key === undefined ? undefined : _keyupBehavior_event_key.call(keyupBehavior, event, target, instance);\n};\nconst keyupBehavior = {\n ' ': (event, target, instance)=>{\n if (isClickableInput(target)) {\n return ()=>instance.dispatchUIEvent(target, 'click');\n }\n }\n};\n","import '../../utils/dataTransfer/Clipboard.js';\nimport { isEditable } from '../../utils/edit/isEditable.js';\nimport { input } from '../input.js';\nimport { behavior } from './registry.js';\n\nbehavior.paste = (event, target, instance)=>{\n if (isEditable(target)) {\n return ()=>{\n var _event_clipboardData;\n const insertData = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === undefined ? undefined : _event_clipboardData.getData('text');\n if (insertData) {\n input(instance, target, insertData, 'insertFromPaste');\n }\n };\n }\n};\n","const eventMap = {\n auxclick: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n beforeinput: {\n EventType: 'InputEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n blur: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n click: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n contextmenu: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n copy: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n change: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: false\n }\n },\n cut: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n dblclick: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n focus: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n focusin: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n focusout: {\n EventType: 'FocusEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n keydown: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n keypress: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n keyup: {\n EventType: 'KeyboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n paste: {\n EventType: 'ClipboardEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n input: {\n EventType: 'InputEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n mousedown: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseenter: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mouseleave: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false,\n composed: true\n }\n },\n mousemove: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseout: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseover: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n mouseup: {\n EventType: 'MouseEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerover: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerenter: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n pointerdown: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointermove: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerup: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointercancel: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: false,\n composed: true\n }\n },\n pointerout: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: true,\n cancelable: true,\n composed: true\n }\n },\n pointerleave: {\n EventType: 'PointerEvent',\n defaultInit: {\n bubbles: false,\n cancelable: false\n }\n },\n submit: {\n EventType: 'Event',\n defaultInit: {\n bubbles: true,\n cancelable: true\n }\n }\n};\nfunction getEventClass(type) {\n return eventMap[type].EventType;\n}\nconst mouseEvents = [\n 'MouseEvent',\n 'PointerEvent'\n];\nfunction isMouseEvent(type) {\n return mouseEvents.includes(getEventClass(type));\n}\nfunction isKeyboardEvent(type) {\n return getEventClass(type) === 'KeyboardEvent';\n}\n\nexport { eventMap, isKeyboardEvent, isMouseEvent };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\nimport { eventMap } from './eventMap.js';\n\nconst eventInitializer = {\n ClipboardEvent: [\n initClipboardEvent\n ],\n Event: [],\n FocusEvent: [\n initUIEvent,\n initFocusEvent\n ],\n InputEvent: [\n initUIEvent,\n initInputEvent\n ],\n MouseEvent: [\n initUIEvent,\n initUIEventModifiers,\n initMouseEvent\n ],\n PointerEvent: [\n initUIEvent,\n initUIEventModifiers,\n initMouseEvent,\n initPointerEvent\n ],\n KeyboardEvent: [\n initUIEvent,\n initUIEventModifiers,\n initKeyboardEvent\n ]\n};\nfunction createEvent(type, target, init) {\n const window = getWindow(target);\n const { EventType, defaultInit } = eventMap[type];\n const event = new (getEventConstructors(window))[EventType](type, defaultInit);\n eventInitializer[EventType].forEach((f)=>f(event, init !== null && init !== undefined ? init : {}));\n return event;\n}\n/* istanbul ignore next */ function getEventConstructors(window) {\n var _window_Event;\n /* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ const Event = (_window_Event = window.Event) !== null && _window_Event !== undefined ? _window_Event : class Event {\n };\n var _window_AnimationEvent;\n const AnimationEvent = (_window_AnimationEvent = window.AnimationEvent) !== null && _window_AnimationEvent !== undefined ? _window_AnimationEvent : class AnimationEvent extends Event {\n };\n var _window_ClipboardEvent;\n const ClipboardEvent = (_window_ClipboardEvent = window.ClipboardEvent) !== null && _window_ClipboardEvent !== undefined ? _window_ClipboardEvent : class ClipboardEvent extends Event {\n };\n var _window_PopStateEvent;\n const PopStateEvent = (_window_PopStateEvent = window.PopStateEvent) !== null && _window_PopStateEvent !== undefined ? _window_PopStateEvent : class PopStateEvent extends Event {\n };\n var _window_ProgressEvent;\n const ProgressEvent = (_window_ProgressEvent = window.ProgressEvent) !== null && _window_ProgressEvent !== undefined ? _window_ProgressEvent : class ProgressEvent extends Event {\n };\n var _window_TransitionEvent;\n const TransitionEvent = (_window_TransitionEvent = window.TransitionEvent) !== null && _window_TransitionEvent !== undefined ? _window_TransitionEvent : class TransitionEvent extends Event {\n };\n var _window_UIEvent;\n const UIEvent = (_window_UIEvent = window.UIEvent) !== null && _window_UIEvent !== undefined ? _window_UIEvent : class UIEvent extends Event {\n };\n var _window_CompositionEvent;\n const CompositionEvent = (_window_CompositionEvent = window.CompositionEvent) !== null && _window_CompositionEvent !== undefined ? _window_CompositionEvent : class CompositionEvent extends UIEvent {\n };\n var _window_FocusEvent;\n const FocusEvent = (_window_FocusEvent = window.FocusEvent) !== null && _window_FocusEvent !== undefined ? _window_FocusEvent : class FocusEvent extends UIEvent {\n };\n var _window_InputEvent;\n const InputEvent = (_window_InputEvent = window.InputEvent) !== null && _window_InputEvent !== undefined ? _window_InputEvent : class InputEvent extends UIEvent {\n };\n var _window_KeyboardEvent;\n const KeyboardEvent = (_window_KeyboardEvent = window.KeyboardEvent) !== null && _window_KeyboardEvent !== undefined ? _window_KeyboardEvent : class KeyboardEvent extends UIEvent {\n };\n var _window_MouseEvent;\n const MouseEvent = (_window_MouseEvent = window.MouseEvent) !== null && _window_MouseEvent !== undefined ? _window_MouseEvent : class MouseEvent extends UIEvent {\n };\n var _window_DragEvent;\n const DragEvent = (_window_DragEvent = window.DragEvent) !== null && _window_DragEvent !== undefined ? _window_DragEvent : class DragEvent extends MouseEvent {\n };\n var _window_PointerEvent;\n const PointerEvent = (_window_PointerEvent = window.PointerEvent) !== null && _window_PointerEvent !== undefined ? _window_PointerEvent : class PointerEvent extends MouseEvent {\n };\n var _window_TouchEvent;\n const TouchEvent = (_window_TouchEvent = window.TouchEvent) !== null && _window_TouchEvent !== undefined ? _window_TouchEvent : class TouchEvent extends UIEvent {\n };\n /* eslint-enable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ return {\n Event,\n AnimationEvent,\n ClipboardEvent,\n PopStateEvent,\n ProgressEvent,\n TransitionEvent,\n UIEvent,\n CompositionEvent,\n FocusEvent,\n InputEvent,\n KeyboardEvent,\n MouseEvent,\n DragEvent,\n PointerEvent,\n TouchEvent\n };\n}\nfunction assignProps(obj, props) {\n for (const [key, value] of Object.entries(props)){\n Object.defineProperty(obj, key, {\n get: ()=>value !== null && value !== undefined ? value : null\n });\n }\n}\nfunction sanitizeNumber(n) {\n return Number(n !== null && n !== undefined ? n : 0);\n}\nfunction initClipboardEvent(event, { clipboardData }) {\n assignProps(event, {\n clipboardData\n });\n}\nfunction initFocusEvent(event, { relatedTarget }) {\n assignProps(event, {\n relatedTarget\n });\n}\nfunction initInputEvent(event, { data, inputType, isComposing }) {\n assignProps(event, {\n data,\n isComposing: Boolean(isComposing),\n inputType: String(inputType)\n });\n}\nfunction initUIEvent(event, { view, detail }) {\n assignProps(event, {\n view,\n detail: sanitizeNumber(detail !== null && detail !== undefined ? detail : 0)\n });\n}\nfunction initUIEventModifiers(event, { altKey, ctrlKey, metaKey, shiftKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierNumLock, modifierScrollLock, modifierSymbol, modifierSymbolLock }) {\n assignProps(event, {\n altKey: Boolean(altKey),\n ctrlKey: Boolean(ctrlKey),\n metaKey: Boolean(metaKey),\n shiftKey: Boolean(shiftKey),\n getModifierState (k) {\n return Boolean({\n Alt: altKey,\n AltGraph: modifierAltGraph,\n CapsLock: modifierCapsLock,\n Control: ctrlKey,\n Fn: modifierFn,\n FnLock: modifierFnLock,\n Meta: metaKey,\n NumLock: modifierNumLock,\n ScrollLock: modifierScrollLock,\n Shift: shiftKey,\n Symbol: modifierSymbol,\n SymbolLock: modifierSymbolLock\n }[k]);\n }\n });\n}\nfunction initKeyboardEvent(event, { key, code, location, repeat, isComposing, charCode }) {\n assignProps(event, {\n key: String(key),\n code: String(code),\n location: sanitizeNumber(location),\n repeat: Boolean(repeat),\n isComposing: Boolean(isComposing),\n charCode\n });\n}\nfunction initMouseEvent(event, { x, y, screenX, screenY, clientX = x, clientY = y, button, buttons, relatedTarget, offsetX, offsetY, pageX, pageY }) {\n assignProps(event, {\n screenX: sanitizeNumber(screenX),\n screenY: sanitizeNumber(screenY),\n clientX: sanitizeNumber(clientX),\n x: sanitizeNumber(clientX),\n clientY: sanitizeNumber(clientY),\n y: sanitizeNumber(clientY),\n button: sanitizeNumber(button),\n buttons: sanitizeNumber(buttons),\n relatedTarget,\n offsetX: sanitizeNumber(offsetX),\n offsetY: sanitizeNumber(offsetY),\n pageX: sanitizeNumber(pageX),\n pageY: sanitizeNumber(pageY)\n });\n}\nfunction initPointerEvent(event, { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary }) {\n assignProps(event, {\n pointerId: sanitizeNumber(pointerId),\n width: sanitizeNumber(width !== null && width !== undefined ? width : 1),\n height: sanitizeNumber(height !== null && height !== undefined ? height : 1),\n pressure: sanitizeNumber(pressure),\n tangentialPressure: sanitizeNumber(tangentialPressure),\n tiltX: sanitizeNumber(tiltX),\n tiltY: sanitizeNumber(tiltY),\n twist: sanitizeNumber(twist),\n pointerType: String(pointerType),\n isPrimary: Boolean(isPrimary)\n });\n}\n\nexport { createEvent };\n","import './behavior/click.js';\nimport './behavior/cut.js';\nimport './behavior/keydown.js';\nimport './behavior/keypress.js';\nimport './behavior/keyup.js';\nimport './behavior/paste.js';\nimport { behavior } from './behavior/registry.js';\nimport { wrapEvent } from './wrapEvent.js';\nimport { isMouseEvent, isKeyboardEvent } from './eventMap.js';\nimport { createEvent } from './createEvent.js';\n\nfunction dispatchUIEvent(target, type, init, preventDefault = false) {\n if (isMouseEvent(type) || isKeyboardEvent(type)) {\n init = {\n ...init,\n ...this.system.getUIEventModifiers()\n };\n }\n const event = createEvent(type, target, init);\n return dispatchEvent.call(this, target, event, preventDefault);\n}\nfunction dispatchEvent(target, event, preventDefault = false) {\n var _behavior_type;\n const type = event.type;\n const behaviorImplementation = preventDefault ? ()=>{} : (_behavior_type = behavior[type]) === null || _behavior_type === undefined ? undefined : _behavior_type.call(behavior, event, target, this);\n if (behaviorImplementation) {\n event.preventDefault();\n let defaultPrevented = false;\n Object.defineProperty(event, 'defaultPrevented', {\n get: ()=>defaultPrevented\n });\n Object.defineProperty(event, 'preventDefault', {\n value: ()=>{\n defaultPrevented = event.cancelable;\n }\n });\n wrapEvent(()=>target.dispatchEvent(event));\n if (!defaultPrevented) {\n behaviorImplementation();\n }\n return !defaultPrevented;\n }\n return wrapEvent(()=>target.dispatchEvent(event));\n}\nfunction dispatchDOMEvent(target, type, init) {\n const event = createEvent(type, target, init);\n wrapEvent(()=>target.dispatchEvent(event));\n}\n\nexport { dispatchDOMEvent, dispatchEvent, dispatchUIEvent };\n","import { dispatchDOMEvent } from '../event/dispatchEvent.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { getActiveElement } from '../utils/focus/getActiveElement.js';\nimport '@testing-library/dom';\n\nconst patched = Symbol('patched focus/blur methods');\nfunction patchFocus(HTMLElement) {\n if (HTMLElement.prototype[patched]) {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { focus, blur } = HTMLElement.prototype;\n Object.defineProperties(HTMLElement.prototype, {\n focus: {\n configurable: true,\n get: ()=>patchedFocus\n },\n blur: {\n configurable: true,\n get: ()=>patchedBlur\n },\n [patched]: {\n configurable: true,\n get: ()=>({\n focus,\n blur\n })\n }\n });\n let activeCall;\n function patchedFocus(options) {\n if (this.ownerDocument.visibilityState !== 'hidden') {\n return focus.call(this, options);\n }\n const blurred = getActiveTarget(this.ownerDocument);\n if (blurred === this) {\n return;\n }\n const thisCall = Symbol('focus call');\n activeCall = thisCall;\n if (blurred) {\n blur.call(blurred);\n dispatchDOMEvent(blurred, 'blur', {\n relatedTarget: this\n });\n dispatchDOMEvent(blurred, 'focusout', {\n relatedTarget: activeCall === thisCall ? this : null\n });\n }\n if (activeCall === thisCall) {\n focus.call(this, options);\n dispatchDOMEvent(this, 'focus', {\n relatedTarget: blurred\n });\n }\n if (activeCall === thisCall) {\n dispatchDOMEvent(this, 'focusin', {\n relatedTarget: blurred\n });\n }\n }\n function patchedBlur() {\n if (this.ownerDocument.visibilityState !== 'hidden') {\n return blur.call(this);\n }\n const blurred = getActiveTarget(this.ownerDocument);\n if (blurred !== this) {\n return;\n }\n const thisCall = Symbol('blur call');\n activeCall = thisCall;\n blur.call(this);\n dispatchDOMEvent(blurred, 'blur', {\n relatedTarget: null\n });\n dispatchDOMEvent(blurred, 'focusout', {\n relatedTarget: null\n });\n }\n}\nfunction getActiveTarget(document) {\n const active = getActiveElement(document);\n return (active === null || active === undefined ? undefined : active.tagName) === 'BODY' ? null : active;\n}\nfunction restoreFocus(HTMLElement) {\n if (HTMLElement.prototype[patched]) {\n const { focus, blur } = HTMLElement.prototype[patched];\n Object.defineProperties(HTMLElement.prototype, {\n focus: {\n configurable: true,\n get: ()=>focus\n },\n blur: {\n configurable: true,\n get: ()=>blur\n }\n });\n }\n}\n\nexport { patchFocus, restoreFocus };\n","import { isElementType } from '../utils/misc/isElementType.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { startTrackValue, trackOrSetValue } from './trackValue.js';\nimport { setUISelectionClean, setUISelectionRaw, getUIValue, setUIValueClean, isUIValue, isUISelectionStart } from './UI.js';\n\nconst Interceptor = Symbol('Interceptor for programmatical calls');\nfunction prepareInterceptor(element, propName, interceptorImpl) {\n const prototypeDescriptor = Object.getOwnPropertyDescriptor(element.constructor.prototype, propName);\n const objectDescriptor = Object.getOwnPropertyDescriptor(element, propName);\n const target = (prototypeDescriptor === null || prototypeDescriptor === undefined ? undefined : prototypeDescriptor.set) ? 'set' : 'value';\n /* istanbul ignore if */ if (typeof (prototypeDescriptor === null || prototypeDescriptor === undefined ? undefined : prototypeDescriptor[target]) !== 'function' || prototypeDescriptor[target][Interceptor]) {\n throw new Error(`Element ${element.tagName} does not implement \"${String(propName)}\".`);\n }\n function intercept(...args) {\n const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);\n const realFunc = (!applyNative && objectDescriptor || prototypeDescriptor)[target];\n if (target === 'set') {\n realFunc.call(this, realArgs);\n } else {\n realFunc.call(this, ...realArgs);\n }\n then === null || then === undefined ? undefined : then();\n }\n intercept[Interceptor] = Interceptor;\n Object.defineProperty(element, propName, {\n ...objectDescriptor !== null && objectDescriptor !== undefined ? objectDescriptor : prototypeDescriptor,\n [target]: intercept\n });\n}\nfunction prepareValueInterceptor(element) {\n prepareInterceptor(element, 'value', function interceptorImpl(v) {\n const isUI = isUIValue(v);\n if (isUI) {\n startTrackValue(this);\n }\n return {\n applyNative: !!isUI,\n realArgs: sanitizeValue(this, v),\n then: isUI ? undefined : ()=>trackOrSetValue(this, String(v))\n };\n });\n}\nfunction sanitizeValue(element, v) {\n // Workaround for JSDOM\n if (isElementType(element, 'input', {\n type: 'number'\n }) && String(v) !== '' && !Number.isNaN(Number(v))) {\n // Setting value to \"1.\" results in `null` in JSDOM\n return String(Number(v));\n }\n return String(v);\n}\nfunction prepareSelectionInterceptor(element) {\n prepareInterceptor(element, 'setSelectionRange', function interceptorImpl(start, ...others) {\n const isUI = isUISelectionStart(start);\n return {\n applyNative: !!isUI,\n realArgs: [\n Number(start),\n ...others\n ],\n then: ()=>isUI ? undefined : setUISelectionClean(element)\n };\n });\n prepareInterceptor(element, 'selectionStart', function interceptorImpl(v) {\n return {\n realArgs: v,\n then: ()=>setUISelectionClean(element)\n };\n });\n prepareInterceptor(element, 'selectionEnd', function interceptorImpl(v) {\n return {\n realArgs: v,\n then: ()=>setUISelectionClean(element)\n };\n });\n prepareInterceptor(element, 'select', function interceptorImpl() {\n return {\n realArgs: [],\n then: ()=>setUISelectionRaw(element, {\n anchorOffset: 0,\n focusOffset: getUIValue(element).length\n })\n };\n });\n}\nfunction prepareRangeTextInterceptor(element) {\n prepareInterceptor(element, 'setRangeText', function interceptorImpl(...realArgs) {\n return {\n realArgs,\n then: ()=>{\n setUIValueClean(element);\n setUISelectionClean(element);\n }\n };\n });\n}\n\nexport { prepareInterceptor, prepareRangeTextInterceptor, prepareSelectionInterceptor, prepareValueInterceptor };\n","import { dispatchDOMEvent } from '../event/dispatchEvent.js';\nimport { isElementType } from '../utils/misc/isElementType.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { getInitialValue, clearInitialValue } from './UI.js';\nimport '@testing-library/dom';\nimport { prepareValueInterceptor, prepareSelectionInterceptor, prepareRangeTextInterceptor } from './interceptor.js';\n\nconst isPrepared = Symbol('Node prepared with document state workarounds');\nfunction prepareDocument(document) {\n if (document[isPrepared]) {\n return;\n }\n document.addEventListener('focus', (e)=>{\n const el = e.target;\n prepareElement(el);\n }, {\n capture: true,\n passive: true\n });\n // Our test environment defaults to `document.body` as `activeElement`.\n // In other environments this might be `null` when preparing.\n // istanbul ignore else\n if (document.activeElement) {\n prepareElement(document.activeElement);\n }\n document.addEventListener('blur', (e)=>{\n const el = e.target;\n const initialValue = getInitialValue(el);\n if (initialValue !== undefined) {\n if (el.value !== initialValue) {\n dispatchDOMEvent(el, 'change');\n }\n clearInitialValue(el);\n }\n }, {\n capture: true,\n passive: true\n });\n document[isPrepared] = isPrepared;\n}\nfunction prepareElement(el) {\n if (el[isPrepared]) {\n return;\n }\n if (isElementType(el, [\n 'input',\n 'textarea'\n ])) {\n prepareValueInterceptor(el);\n prepareSelectionInterceptor(el);\n prepareRangeTextInterceptor(el);\n }\n el[isPrepared] = isPrepared;\n}\n\nexport { prepareDocument };\n","function getDocumentFromNode(el) {\n return isDocument(el) ? el : el.ownerDocument;\n}\nfunction isDocument(node) {\n return node.nodeType === 9;\n}\n\nexport { getDocumentFromNode };\n","var ApiLevel = /*#__PURE__*/ function(ApiLevel) {\n ApiLevel[ApiLevel[\"Trigger\"] = 2] = \"Trigger\";\n ApiLevel[ApiLevel[\"Call\"] = 1] = \"Call\";\n return ApiLevel;\n}({});\nfunction setLevelRef(instance, level) {\n instance.levelRefs[level] = {};\n}\nfunction getLevelRef(instance, level) {\n return instance.levelRefs[level];\n}\n\nexport { ApiLevel, getLevelRef, setLevelRef };\n","function wait(config) {\n const delay = config.delay;\n if (typeof delay !== 'number') {\n return;\n }\n return Promise.all([\n new Promise((resolve)=>globalThis.setTimeout(()=>resolve(), delay)),\n config.advanceTimers(delay)\n ]);\n}\n\nexport { wait };\n","var PointerEventsCheckLevel = /*#__PURE__*/ function(PointerEventsCheckLevel) {\n /**\n * Check pointer events on every user interaction that triggers a bunch of events.\n * E.g. once for releasing a mouse button even though this triggers `pointerup`, `mouseup`, `click`, etc...\n */ PointerEventsCheckLevel[PointerEventsCheckLevel[\"EachTrigger\"] = 4] = \"EachTrigger\";\n /** Check each target once per call to pointer (related) API */ PointerEventsCheckLevel[PointerEventsCheckLevel[\"EachApiCall\"] = 2] = \"EachApiCall\";\n /** Check each event target once */ PointerEventsCheckLevel[PointerEventsCheckLevel[\"EachTarget\"] = 1] = \"EachTarget\";\n /** No pointer events check */ PointerEventsCheckLevel[PointerEventsCheckLevel[\"Never\"] = 0] = \"Never\";\n return PointerEventsCheckLevel;\n}({});\n\nexport { PointerEventsCheckLevel };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { getActiveElementOrBody } from '../utils/focus/getActiveElement.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nvar DOM_KEY_LOCATION = /*#__PURE__*/ function(DOM_KEY_LOCATION) {\n DOM_KEY_LOCATION[DOM_KEY_LOCATION[\"STANDARD\"] = 0] = \"STANDARD\";\n DOM_KEY_LOCATION[DOM_KEY_LOCATION[\"LEFT\"] = 1] = \"LEFT\";\n DOM_KEY_LOCATION[DOM_KEY_LOCATION[\"RIGHT\"] = 2] = \"RIGHT\";\n DOM_KEY_LOCATION[DOM_KEY_LOCATION[\"NUMPAD\"] = 3] = \"NUMPAD\";\n return DOM_KEY_LOCATION;\n}({});\nconst modifierKeys = [\n 'Alt',\n 'AltGraph',\n 'Control',\n 'Fn',\n 'Meta',\n 'Shift',\n 'Symbol'\n];\nfunction isModifierKey(key) {\n return modifierKeys.includes(key);\n}\nconst modifierLocks = [\n 'CapsLock',\n 'FnLock',\n 'NumLock',\n 'ScrollLock',\n 'SymbolLock'\n];\nfunction isModifierLock(key) {\n return modifierLocks.includes(key);\n}\nclass KeyboardHost {\n isKeyPressed(keyDef) {\n return this.pressed.has(String(keyDef.code));\n }\n getPressedKeys() {\n return this.pressed.values().map((p)=>p.keyDef);\n }\n /** Press a key */ async keydown(instance, keyDef) {\n const key = String(keyDef.key);\n const code = String(keyDef.code);\n const target = getActiveElementOrBody(instance.config.document);\n this.setKeydownTarget(target);\n this.pressed.add(code, keyDef);\n if (isModifierKey(key)) {\n this.modifiers[key] = true;\n }\n const unprevented = instance.dispatchUIEvent(target, 'keydown', {\n key,\n code\n });\n if (isModifierLock(key) && !this.modifiers[key]) {\n this.modifiers[key] = true;\n this.modifierLockStart[key] = true;\n }\n if (unprevented) {\n this.pressed.setUnprevented(code);\n }\n if (unprevented && this.hasKeyPress(key)) {\n instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), 'keypress', {\n key,\n code,\n charCode: keyDef.key === 'Enter' ? 13 : String(keyDef.key).charCodeAt(0)\n });\n }\n }\n /** Release a key */ async keyup(instance, keyDef) {\n const key = String(keyDef.key);\n const code = String(keyDef.code);\n const unprevented = this.pressed.isUnprevented(code);\n this.pressed.delete(code);\n if (isModifierKey(key) && !this.pressed.values().find((p)=>p.keyDef.key === key)) {\n this.modifiers[key] = false;\n }\n instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), 'keyup', {\n key,\n code\n }, !unprevented);\n if (isModifierLock(key) && this.modifiers[key]) {\n if (this.modifierLockStart[key]) {\n this.modifierLockStart[key] = false;\n } else {\n this.modifiers[key] = false;\n }\n }\n }\n setKeydownTarget(target) {\n if (target !== this.lastKeydownTarget) {\n this.carryChar = '';\n }\n this.lastKeydownTarget = target;\n }\n hasKeyPress(key) {\n return (key.length === 1 || key === 'Enter') && !this.modifiers.Control && !this.modifiers.Alt;\n }\n constructor(system){\n _define_property(this, \"system\", undefined);\n _define_property(this, \"modifiers\", {\n Alt: false,\n AltGraph: false,\n CapsLock: false,\n Control: false,\n Fn: false,\n FnLock: false,\n Meta: false,\n NumLock: false,\n ScrollLock: false,\n Shift: false,\n Symbol: false,\n SymbolLock: false\n });\n _define_property(this, \"pressed\", new class {\n add(code, keyDef) {\n var _this_registry, _code;\n var _;\n (_ = (_this_registry = this.registry)[_code = code]) !== null && _ !== undefined ? _ : _this_registry[_code] = {\n keyDef,\n unpreventedDefault: false\n };\n }\n has(code) {\n return !!this.registry[code];\n }\n setUnprevented(code) {\n const o = this.registry[code];\n if (o) {\n o.unpreventedDefault = true;\n }\n }\n isUnprevented(code) {\n var _this_registry_code;\n return !!((_this_registry_code = this.registry[code]) === null || _this_registry_code === undefined ? undefined : _this_registry_code.unpreventedDefault);\n }\n delete(code) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.registry[code];\n }\n values() {\n return Object.values(this.registry);\n }\n constructor(){\n _define_property(this, \"registry\", {});\n }\n }());\n _define_property(this, \"carryChar\", '');\n _define_property(this, \"lastKeydownTarget\", undefined);\n _define_property(this, \"modifierLockStart\", {});\n this.system = system;\n }\n}\n\nexport { DOM_KEY_LOCATION, KeyboardHost };\n","import { DOM_KEY_LOCATION } from '../system/keyboard.js';\n\n/**\n * Mapping for a default US-104-QWERTY keyboard\n */ const defaultKeyMap = [\n // alphanumeric block - writing system\n ...'0123456789'.split('').map((c)=>({\n code: `Digit${c}`,\n key: c\n })),\n ...')!@#$%^&*('.split('').map((c, i)=>({\n code: `Digit${i}`,\n key: c,\n shiftKey: true\n })),\n ...'abcdefghijklmnopqrstuvwxyz'.split('').map((c)=>({\n code: `Key${c.toUpperCase()}`,\n key: c\n })),\n ...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').map((c)=>({\n code: `Key${c}`,\n key: c,\n shiftKey: true\n })),\n {\n code: 'BracketLeft',\n key: '['\n },\n {\n code: 'BracketLeft',\n key: '{',\n shiftKey: true\n },\n {\n code: 'BracketRight',\n key: ']'\n },\n {\n code: 'BracketRight',\n key: '}',\n shiftKey: true\n },\n // alphanumeric block - functional\n {\n code: 'Space',\n key: ' '\n },\n {\n code: 'AltLeft',\n key: 'Alt',\n location: DOM_KEY_LOCATION.LEFT\n },\n {\n code: 'AltRight',\n key: 'Alt',\n location: DOM_KEY_LOCATION.RIGHT\n },\n {\n code: 'ShiftLeft',\n key: 'Shift',\n location: DOM_KEY_LOCATION.LEFT\n },\n {\n code: 'ShiftRight',\n key: 'Shift',\n location: DOM_KEY_LOCATION.RIGHT\n },\n {\n code: 'ControlLeft',\n key: 'Control',\n location: DOM_KEY_LOCATION.LEFT\n },\n {\n code: 'ControlRight',\n key: 'Control',\n location: DOM_KEY_LOCATION.RIGHT\n },\n {\n code: 'MetaLeft',\n key: 'Meta',\n location: DOM_KEY_LOCATION.LEFT\n },\n {\n code: 'MetaRight',\n key: 'Meta',\n location: DOM_KEY_LOCATION.RIGHT\n },\n {\n code: 'OSLeft',\n key: 'OS',\n location: DOM_KEY_LOCATION.LEFT\n },\n {\n code: 'OSRight',\n key: 'OS',\n location: DOM_KEY_LOCATION.RIGHT\n },\n {\n code: 'ContextMenu',\n key: 'ContextMenu'\n },\n {\n code: 'Tab',\n key: 'Tab'\n },\n {\n code: 'CapsLock',\n key: 'CapsLock'\n },\n {\n code: 'Backspace',\n key: 'Backspace'\n },\n {\n code: 'Enter',\n key: 'Enter'\n },\n // function\n {\n code: 'Escape',\n key: 'Escape'\n },\n // arrows\n {\n code: 'ArrowUp',\n key: 'ArrowUp'\n },\n {\n code: 'ArrowDown',\n key: 'ArrowDown'\n },\n {\n code: 'ArrowLeft',\n key: 'ArrowLeft'\n },\n {\n code: 'ArrowRight',\n key: 'ArrowRight'\n },\n // control pad\n {\n code: 'Home',\n key: 'Home'\n },\n {\n code: 'End',\n key: 'End'\n },\n {\n code: 'Delete',\n key: 'Delete'\n },\n {\n code: 'PageUp',\n key: 'PageUp'\n },\n {\n code: 'PageDown',\n key: 'PageDown'\n },\n // Special keys that are not part of a default US-layout but included for specific behavior\n {\n code: 'Fn',\n key: 'Fn'\n },\n {\n code: 'Symbol',\n key: 'Symbol'\n },\n {\n code: 'AltRight',\n key: 'AltGraph'\n }\n];\n\nexport { defaultKeyMap };\n","const defaultKeyMap = [\n {\n name: 'MouseLeft',\n pointerType: 'mouse',\n button: 'primary'\n },\n {\n name: 'MouseRight',\n pointerType: 'mouse',\n button: 'secondary'\n },\n {\n name: 'MouseMiddle',\n pointerType: 'mouse',\n button: 'auxiliary'\n },\n {\n name: 'TouchA',\n pointerType: 'touch'\n },\n {\n name: 'TouchB',\n pointerType: 'touch'\n },\n {\n name: 'TouchC',\n pointerType: 'touch'\n }\n];\n\nexport { defaultKeyMap };\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nclass Buttons {\n getButtons() {\n let v = 0;\n for (const button of Object.keys(this.pressed)){\n // eslint-disable-next-line no-bitwise\n v |= 2 ** Number(button);\n }\n return v;\n }\n down(keyDef) {\n const button = getMouseButtonId(keyDef.button);\n if (button in this.pressed) {\n this.pressed[button].push(keyDef);\n return undefined;\n }\n this.pressed[button] = [\n keyDef\n ];\n return button;\n }\n up(keyDef) {\n const button = getMouseButtonId(keyDef.button);\n if (button in this.pressed) {\n this.pressed[button] = this.pressed[button].filter((k)=>k.name !== keyDef.name);\n if (this.pressed[button].length === 0) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.pressed[button];\n return button;\n }\n }\n return undefined;\n }\n constructor(){\n _define_property(this, \"pressed\", {});\n }\n}\nconst MouseButton = {\n primary: 0,\n secondary: 1,\n auxiliary: 2,\n back: 3,\n X1: 3,\n forward: 4,\n X2: 4\n};\nfunction getMouseButtonId(button = 0) {\n if (button in MouseButton) {\n return MouseButton[button];\n }\n return Number(button);\n}\n// On the `MouseEvent.button` property auxiliary and secondary button are flipped compared to `MouseEvent.buttons`.\nconst MouseButtonFlip = {\n 1: 2,\n 2: 1\n};\nfunction getMouseEventButton(button) {\n button = getMouseButtonId(button);\n if (button in MouseButtonFlip) {\n return MouseButtonFlip[button];\n }\n return button;\n}\n\nexport { Buttons, MouseButton, MouseButtonFlip, getMouseButtonId, getMouseEventButton };\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nclass Device {\n get countPressed() {\n return this.pressedKeys.size;\n }\n isPressed(keyDef) {\n return this.pressedKeys.has(keyDef.name);\n }\n addPressed(keyDef) {\n return this.pressedKeys.add(keyDef.name);\n }\n removePressed(keyDef) {\n return this.pressedKeys.delete(keyDef.name);\n }\n constructor(){\n _define_property(this, \"pressedKeys\", new Set());\n }\n}\n\nexport { Device };\n","function getTreeDiff(a, b) {\n const treeA = [];\n for(let el = a; el; el = el.parentElement){\n treeA.push(el);\n }\n const treeB = [];\n for(let el = b; el; el = el.parentElement){\n treeB.push(el);\n }\n let i = 0;\n for(;; i++){\n if (i >= treeA.length || i >= treeB.length || treeA[treeA.length - 1 - i] !== treeB[treeB.length - 1 - i]) {\n break;\n }\n }\n return [\n treeA.slice(0, treeA.length - i),\n treeB.slice(0, treeB.length - i),\n treeB.slice(treeB.length - i)\n ];\n}\n\nexport { getTreeDiff };\n","import { getUIValue } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { hasOwnSelection } from '../../utils/focus/selection.js';\n\nfunction resolveCaretPosition({ target, node, offset }) {\n if (hasOwnSelection(target)) {\n return {\n node: target,\n offset: offset !== null && offset !== undefined ? offset : getUIValue(target).length\n };\n } else if (node) {\n return {\n node,\n offset: offset !== null && offset !== undefined ? offset : node.nodeType === 3 ? node.nodeValue.length : node.childNodes.length\n };\n }\n return findNodeAtTextOffset(target, offset);\n}\nfunction findNodeAtTextOffset(node, offset, isRoot = true) {\n // When clicking after the content the browser behavior can be complicated:\n // 1. If there is textContent after the last element child,\n // the cursor is moved there.\n // 2. If there is textContent in the last element child,\n // the browser moves the cursor to the last non-empty text node inside this element.\n // 3. Otherwise the cursor is moved to the end of the target.\n let i = offset === undefined ? node.childNodes.length - 1 : 0;\n const step = offset === undefined ? -1 : 1;\n while(offset === undefined ? i >= (isRoot ? Math.max(node.childNodes.length - 1, 0) : 0) : i <= node.childNodes.length){\n if (offset && i === node.childNodes.length) {\n throw new Error('The given offset is out of bounds.');\n }\n const c = node.childNodes.item(i);\n const text = String(c.textContent);\n if (text.length) {\n if (offset !== undefined && text.length < offset) {\n offset -= text.length;\n } else if (c.nodeType === 1) {\n return findNodeAtTextOffset(c, offset, false);\n } else {\n // The pre-commit hooks keeps changing this\n // See https://github.com/kentcdodds/kcd-scripts/issues/218\n /* istanbul ignore else */ // eslint-disable-next-line no-lonely-if\n if (c.nodeType === 3) {\n return {\n node: c,\n offset: offset !== null && offset !== undefined ? offset : c.nodeValue.length\n };\n }\n }\n }\n i += step;\n }\n return {\n node,\n offset: node.childNodes.length\n };\n}\n\nexport { resolveCaretPosition };\n","import { getUIValue, setUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { hasNoSelection, hasOwnSelection } from '../../utils/focus/selection.js';\nimport { resolveCaretPosition } from './resolveCaretPosition.js';\n\nfunction setSelectionPerMouseDown({ document, target, clickCount, node, offset }) {\n if (hasNoSelection(target)) {\n return;\n }\n const targetHasOwnSelection = hasOwnSelection(target);\n // On non-input elements the text selection per multiple click\n // can extend beyond the target boundaries.\n // The exact mechanism what is considered in the same line is unclear.\n // Looks it might be every inline element.\n // TODO: Check what might be considered part of the same line of text.\n const text = String(targetHasOwnSelection ? getUIValue(target) : target.textContent);\n const [start, end] = node ? // which elements might be considered in the same line of text.\n // TODO: support expanding initial range on multiple clicks if node is given\n [\n offset,\n offset\n ] : getTextRange(text, offset, clickCount);\n // TODO: implement modifying selection per shift/ctrl+mouse\n if (targetHasOwnSelection) {\n setUISelection(target, {\n anchorOffset: start !== null && start !== undefined ? start : text.length,\n focusOffset: end !== null && end !== undefined ? end : text.length\n });\n return {\n node: target,\n start: start !== null && start !== undefined ? start : 0,\n end: end !== null && end !== undefined ? end : text.length\n };\n } else {\n const { node: startNode, offset: startOffset } = resolveCaretPosition({\n target,\n node,\n offset: start\n });\n const { node: endNode, offset: endOffset } = resolveCaretPosition({\n target,\n node,\n offset: end\n });\n const range = target.ownerDocument.createRange();\n try {\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n } catch (e) {\n throw new Error('The given offset is out of bounds.');\n }\n const selection = document.getSelection();\n selection === null || selection === undefined ? undefined : selection.removeAllRanges();\n selection === null || selection === undefined ? undefined : selection.addRange(range.cloneRange());\n return range;\n }\n}\nfunction getTextRange(text, pos, clickCount) {\n if (clickCount % 3 === 1 || text.length === 0) {\n return [\n pos,\n pos\n ];\n }\n const textPos = pos !== null && pos !== undefined ? pos : text.length;\n if (clickCount % 3 === 2) {\n return [\n textPos - text.substr(0, pos).match(/(\\w+|\\s+|\\W)?$/)[0].length,\n pos === undefined ? pos : pos + text.substr(pos).match(/^(\\w+|\\s+|\\W)?/)[0].length\n ];\n }\n // triple click\n return [\n textPos - text.substr(0, pos).match(/[^\\r\\n]*$/)[0].length,\n pos === undefined ? pos : pos + text.substr(pos).match(/^[^\\r\\n]*/)[0].length\n ];\n}\n\nexport { setSelectionPerMouseDown };\n","import { setUISelection } from '../../document/UI.js';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { resolveCaretPosition } from './resolveCaretPosition.js';\n\nfunction modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {\n const selectionFocus = resolveCaretPosition({\n target,\n node,\n offset\n });\n if ('node' in selectionRange) {\n // When the mouse is dragged outside of an input/textarea,\n // the selection is extended to the beginning or end of the input\n // depending on pointer position.\n // TODO: extend selection according to pointer position\n /* istanbul ignore else */ if (selectionFocus.node === selectionRange.node) {\n const anchorOffset = selectionFocus.offset < selectionRange.start ? selectionRange.end : selectionRange.start;\n const focusOffset = selectionFocus.offset > selectionRange.end || selectionFocus.offset < selectionRange.start ? selectionFocus.offset : selectionRange.end;\n setUISelection(selectionRange.node, {\n anchorOffset,\n focusOffset\n });\n }\n } else {\n const range = selectionRange.cloneRange();\n const cmp = range.comparePoint(selectionFocus.node, selectionFocus.offset);\n if (cmp < 0) {\n range.setStart(selectionFocus.node, selectionFocus.offset);\n } else if (cmp > 0) {\n range.setEnd(selectionFocus.node, selectionFocus.offset);\n }\n const selection = document.getSelection();\n selection === null || selection === undefined ? undefined : selection.removeAllRanges();\n selection === null || selection === undefined ? undefined : selection.addRange(range.cloneRange());\n }\n}\n\nexport { modifySelectionPerMouseMove };\n","function isDifferentPointerPosition(positionA, positionB) {\n var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_coords2, _positionB_coords2, _positionA_coords3, _positionB_coords3, _positionA_coords4, _positionB_coords4, _positionA_coords5, _positionB_coords5, _positionA_coords6, _positionB_coords6, _positionA_coords7, _positionB_coords7, _positionA_coords8, _positionB_coords8, _positionA_coords9, _positionB_coords9, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;\n return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === undefined ? undefined : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === undefined ? undefined : _positionB_coords.x) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === undefined ? undefined : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === undefined ? undefined : _positionB_coords1.y) || ((_positionA_coords2 = positionA.coords) === null || _positionA_coords2 === undefined ? undefined : _positionA_coords2.clientX) !== ((_positionB_coords2 = positionB.coords) === null || _positionB_coords2 === undefined ? undefined : _positionB_coords2.clientX) || ((_positionA_coords3 = positionA.coords) === null || _positionA_coords3 === undefined ? undefined : _positionA_coords3.clientY) !== ((_positionB_coords3 = positionB.coords) === null || _positionB_coords3 === undefined ? undefined : _positionB_coords3.clientY) || ((_positionA_coords4 = positionA.coords) === null || _positionA_coords4 === undefined ? undefined : _positionA_coords4.offsetX) !== ((_positionB_coords4 = positionB.coords) === null || _positionB_coords4 === undefined ? undefined : _positionB_coords4.offsetX) || ((_positionA_coords5 = positionA.coords) === null || _positionA_coords5 === undefined ? undefined : _positionA_coords5.offsetY) !== ((_positionB_coords5 = positionB.coords) === null || _positionB_coords5 === undefined ? undefined : _positionB_coords5.offsetY) || ((_positionA_coords6 = positionA.coords) === null || _positionA_coords6 === undefined ? undefined : _positionA_coords6.pageX) !== ((_positionB_coords6 = positionB.coords) === null || _positionB_coords6 === undefined ? undefined : _positionB_coords6.pageX) || ((_positionA_coords7 = positionA.coords) === null || _positionA_coords7 === undefined ? undefined : _positionA_coords7.pageY) !== ((_positionB_coords7 = positionB.coords) === null || _positionB_coords7 === undefined ? undefined : _positionB_coords7.pageY) || ((_positionA_coords8 = positionA.coords) === null || _positionA_coords8 === undefined ? undefined : _positionA_coords8.screenX) !== ((_positionB_coords8 = positionB.coords) === null || _positionB_coords8 === undefined ? undefined : _positionB_coords8.screenX) || ((_positionA_coords9 = positionA.coords) === null || _positionA_coords9 === undefined ? undefined : _positionA_coords9.screenY) !== ((_positionB_coords9 = positionB.coords) === null || _positionB_coords9 === undefined ? undefined : _positionB_coords9.screenY) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === undefined ? undefined : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === undefined ? undefined : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === undefined ? undefined : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === undefined ? undefined : _positionB_caret1.offset);\n}\n\nexport { isDifferentPointerPosition };\n","import '../../event/behavior/click.js';\nimport '../../event/behavior/cut.js';\nimport '../../event/behavior/keydown.js';\nimport '../../event/behavior/keypress.js';\nimport '../../event/behavior/keyup.js';\nimport '../../event/behavior/paste.js';\nimport '@testing-library/dom';\nimport '../../utils/dataTransfer/Clipboard.js';\nimport { isDisabled } from '../../utils/misc/isDisabled.js';\nimport { getTreeDiff } from '../../utils/misc/getTreeDiff.js';\nimport { focusElement } from '../../event/focus.js';\nimport { setSelectionPerMouseDown } from '../../event/selection/setSelectionPerMouse.js';\nimport { modifySelectionPerMouseMove } from '../../event/selection/modifySelectionPerMouse.js';\nimport { getMouseEventButton, Buttons } from './buttons.js';\nimport { isDifferentPointerPosition } from './shared.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n/**\n * This object is the single \"virtual\" mouse that might be controlled by multiple different pointer devices.\n */ class Mouse {\n move(instance, position, /** Whether `preventDefault()` has been called on the `pointerdown` event */ isPrevented) {\n const prevPosition = this.position;\n const prevTarget = this.getTarget(instance);\n this.position = position;\n if (!isDifferentPointerPosition(prevPosition, position)) {\n return;\n }\n const nextTarget = this.getTarget(instance);\n const init = this.getEventInit('mousemove');\n const [leave, enter] = getTreeDiff(prevTarget, nextTarget);\n return {\n leave: ()=>{\n if (prevTarget !== nextTarget) {\n instance.dispatchUIEvent(prevTarget, 'mouseout', init);\n leave.forEach((el)=>instance.dispatchUIEvent(el, 'mouseleave', init));\n }\n },\n enter: ()=>{\n if (prevTarget !== nextTarget) {\n instance.dispatchUIEvent(nextTarget, 'mouseover', init);\n enter.forEach((el)=>instance.dispatchUIEvent(el, 'mouseenter', init));\n }\n },\n move: ()=>{\n if (isPrevented) {\n return;\n }\n instance.dispatchUIEvent(nextTarget, 'mousemove', init);\n this.modifySelecting(instance);\n }\n };\n }\n down(instance, keyDef, /** Whether `preventDefault()` has been called on the `pointerdown` event */ isPrevented) {\n const button = this.buttons.down(keyDef);\n if (button === undefined) {\n return;\n }\n const target = this.getTarget(instance);\n this.buttonDownTarget[button] = target;\n const init = this.getEventInit('mousedown', keyDef.button);\n const disabled = isDisabled(target);\n if (!isPrevented && (disabled || instance.dispatchUIEvent(target, 'mousedown', init))) {\n this.startSelecting(instance, init.detail);\n focusElement(target);\n }\n if (!disabled && getMouseEventButton(keyDef.button) === 2) {\n instance.dispatchUIEvent(target, 'contextmenu', this.getEventInit('contextmenu', keyDef.button));\n }\n }\n up(instance, keyDef, /** Whether `preventDefault()` has been called on the `pointerdown` event */ isPrevented) {\n const button = this.buttons.up(keyDef);\n if (button === undefined) {\n return;\n }\n const target = this.getTarget(instance);\n if (!isDisabled(target)) {\n if (!isPrevented) {\n const mouseUpInit = this.getEventInit('mouseup', keyDef.button);\n instance.dispatchUIEvent(target, 'mouseup', mouseUpInit);\n this.endSelecting();\n }\n const clickTarget = getTreeDiff(this.buttonDownTarget[button], target)[2][0];\n if (clickTarget) {\n const init = this.getEventInit('click', keyDef.button);\n if (init.detail) {\n instance.dispatchUIEvent(clickTarget, init.button === 0 ? 'click' : 'auxclick', init);\n if (init.button === 0 && init.detail === 2) {\n instance.dispatchUIEvent(clickTarget, 'dblclick', {\n ...this.getEventInit('dblclick', keyDef.button),\n detail: init.detail\n });\n }\n }\n }\n }\n }\n resetClickCount() {\n this.clickCount.reset();\n }\n getEventInit(type, button) {\n const init = {\n ...this.position.coords\n };\n init.button = getMouseEventButton(button);\n init.buttons = this.buttons.getButtons();\n if (type === 'mousedown') {\n init.detail = this.clickCount.getOnDown(init.button);\n } else if (type === 'mouseup') {\n init.detail = this.clickCount.getOnUp(init.button);\n } else if (type === 'click' || type === 'auxclick') {\n init.detail = this.clickCount.incOnClick(init.button);\n }\n return init;\n }\n getTarget(instance) {\n var _this_position_target;\n return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;\n }\n startSelecting(instance, clickCount) {\n var _this_position_caret, _this_position_caret1;\n // TODO: support extending range (shift)\n this.selecting = setSelectionPerMouseDown({\n document: instance.config.document,\n target: this.getTarget(instance),\n node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,\n offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset,\n clickCount\n });\n }\n modifySelecting(instance) {\n var _this_position_caret, _this_position_caret1;\n if (!this.selecting) {\n return;\n }\n modifySelectionPerMouseMove(this.selecting, {\n document: instance.config.document,\n target: this.getTarget(instance),\n node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,\n offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset\n });\n }\n endSelecting() {\n this.selecting = undefined;\n }\n constructor(){\n _define_property(this, \"position\", {});\n _define_property(this, \"buttons\", new Buttons());\n _define_property(this, \"selecting\", undefined);\n _define_property(this, \"buttonDownTarget\", {});\n // According to spec the `detail` on click events should be the number\n // of *consecutive* clicks with a specific button.\n // On `mousedown` and `mouseup` it should be this number increased by one.\n // But the browsers don't implement it this way.\n // If another button is pressed,\n // in Webkit: the `mouseup` on the previously pressed button has `detail: 0` and no `click`/`auxclick`.\n // in Gecko: the `mouseup` and click events have the same detail as the `mousedown`.\n // If there is a delay while a button is pressed,\n // the `mouseup` and `click` are normal, but a following `mousedown` starts a new click count.\n // We'll follow the minimal implementation of Webkit.\n _define_property(this, \"clickCount\", new class {\n incOnClick(button) {\n const current = this.down[button] === undefined ? undefined : Number(this.down[button]) + 1;\n this.count = this.count[button] === undefined ? {} : {\n [button]: Number(this.count[button]) + 1\n };\n return current;\n }\n getOnDown(button) {\n var _this_count_button;\n this.down = {\n [button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== undefined ? _this_count_button : 0\n };\n var _this_count_button1;\n this.count = {\n [button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== undefined ? _this_count_button1 : 0\n };\n return Number(this.count[button]) + 1;\n }\n getOnUp(button) {\n return this.down[button] === undefined ? undefined : Number(this.down[button]) + 1;\n }\n reset() {\n this.count = {};\n }\n constructor(){\n _define_property(this, \"down\", {});\n _define_property(this, \"count\", {});\n }\n }());\n }\n}\n\nexport { Mouse };\n","import { PointerEventsCheckLevel } from '../../options.js';\nimport { getWindow } from '../misc/getWindow.js';\nimport { isElementType } from '../misc/isElementType.js';\nimport { ApiLevel, getLevelRef } from '../misc/level.js';\n\nfunction hasPointerEvents(instance, element) {\n var _checkPointerEvents;\n return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === undefined ? undefined : _checkPointerEvents.pointerEvents) !== 'none';\n}\nfunction closestPointerEventsDeclaration(element) {\n const window = getWindow(element);\n for(let el = element, tree = []; el === null || el === undefined ? undefined : el.ownerDocument; el = el.parentElement){\n tree.push(el);\n const pointerEvents = window.getComputedStyle(el).pointerEvents;\n if (pointerEvents && ![\n 'inherit',\n 'unset'\n ].includes(pointerEvents)) {\n return {\n pointerEvents,\n tree\n };\n }\n }\n return undefined;\n}\nconst PointerEventsCheck = Symbol('Last check for pointer-events');\nfunction checkPointerEvents(instance, element) {\n const lastCheck = element[PointerEventsCheck];\n const needsCheck = instance.config.pointerEventsCheck !== PointerEventsCheckLevel.Never && (!lastCheck || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachApiCall) && lastCheck[ApiLevel.Call] !== getLevelRef(instance, ApiLevel.Call) || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachTrigger) && lastCheck[ApiLevel.Trigger] !== getLevelRef(instance, ApiLevel.Trigger));\n if (!needsCheck) {\n return lastCheck === null || lastCheck === undefined ? undefined : lastCheck.result;\n }\n const declaration = closestPointerEventsDeclaration(element);\n element[PointerEventsCheck] = {\n [ApiLevel.Call]: getLevelRef(instance, ApiLevel.Call),\n [ApiLevel.Trigger]: getLevelRef(instance, ApiLevel.Trigger),\n result: declaration\n };\n return declaration;\n}\nfunction assertPointerEvents(instance, element) {\n const declaration = checkPointerEvents(instance, element);\n if ((declaration === null || declaration === undefined ? undefined : declaration.pointerEvents) === 'none') {\n throw new Error([\n `Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? 'inherits' : 'has'} \\`pointer-events: none\\`:`,\n '',\n printTree(declaration.tree)\n ].join('\\n'));\n }\n}\nfunction printTree(tree) {\n return tree.reverse().map((el, i)=>[\n ''.padEnd(i),\n el.tagName,\n el.id && `#${el.id}`,\n el.hasAttribute('data-testid') && `(testId=${el.getAttribute('data-testid')})`,\n getLabelDescr(el),\n tree.length > 1 && i === 0 && ' <-- This element declared `pointer-events: none`',\n tree.length > 1 && i === tree.length - 1 && ' <-- Asserted pointer events here'\n ].filter(Boolean).join('')).join('\\n');\n}\nfunction getLabelDescr(element) {\n var _element_labels;\n let label;\n if (element.hasAttribute('aria-label')) {\n label = element.getAttribute('aria-label');\n } else if (element.hasAttribute('aria-labelledby')) {\n var _element_ownerDocument_getElementById_textContent, _element_ownerDocument_getElementById;\n label = (_element_ownerDocument_getElementById = element.ownerDocument.getElementById(element.getAttribute('aria-labelledby'))) === null || _element_ownerDocument_getElementById === undefined ? undefined : (_element_ownerDocument_getElementById_textContent = _element_ownerDocument_getElementById.textContent) === null || _element_ownerDocument_getElementById_textContent === undefined ? undefined : _element_ownerDocument_getElementById_textContent.trim();\n } else if (isElementType(element, [\n 'button',\n 'input',\n 'meter',\n 'output',\n 'progress',\n 'select',\n 'textarea'\n ]) && ((_element_labels = element.labels) === null || _element_labels === undefined ? undefined : _element_labels.length)) {\n label = Array.from(element.labels).map((el)=>{\n var _el_textContent;\n return (_el_textContent = el.textContent) === null || _el_textContent === undefined ? undefined : _el_textContent.trim();\n }).join('|');\n } else if (isElementType(element, 'button')) {\n var _element_textContent;\n label = (_element_textContent = element.textContent) === null || _element_textContent === undefined ? undefined : _element_textContent.trim();\n }\n label = label === null || label === undefined ? undefined : label.replace(/\\n/g, ' ');\n if (Number(label === null || label === undefined ? undefined : label.length) > 30) {\n label = `${label === null || label === undefined ? undefined : label.substring(0, 29)}…`;\n }\n return label ? `(label=${label})` : '';\n}\n// With the eslint rule and prettier the bitwise operation isn't nice to read\nfunction hasBitFlag(conf, flag) {\n // eslint-disable-next-line no-bitwise\n return (conf & flag) > 0;\n}\n\nexport { assertPointerEvents, hasPointerEvents };\n","import '../../utils/dataTransfer/Clipboard.js';\nimport { getTreeDiff } from '../../utils/misc/getTreeDiff.js';\nimport { assertPointerEvents, hasPointerEvents } from '../../utils/pointer/cssPointerEvents.js';\nimport { isDifferentPointerPosition } from './shared.js';\nimport { getMouseEventButton } from './buttons.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nclass Pointer {\n init(instance) {\n const target = this.getTarget(instance);\n const [, enter] = getTreeDiff(null, target);\n const init = this.getEventInit();\n assertPointerEvents(instance, target);\n instance.dispatchUIEvent(target, 'pointerover', init);\n enter.forEach((el)=>instance.dispatchUIEvent(el, 'pointerenter', init));\n return this;\n }\n move(instance, position) {\n const prevPosition = this.position;\n const prevTarget = this.getTarget(instance);\n this.position = position;\n if (!isDifferentPointerPosition(prevPosition, position)) {\n return;\n }\n const nextTarget = this.getTarget(instance);\n const init = this.getEventInit(-1);\n const [leave, enter] = getTreeDiff(prevTarget, nextTarget);\n return {\n leave: ()=>{\n if (hasPointerEvents(instance, prevTarget)) {\n if (prevTarget !== nextTarget) {\n instance.dispatchUIEvent(prevTarget, 'pointerout', init);\n leave.forEach((el)=>instance.dispatchUIEvent(el, 'pointerleave', init));\n }\n }\n },\n enter: ()=>{\n assertPointerEvents(instance, nextTarget);\n if (prevTarget !== nextTarget) {\n instance.dispatchUIEvent(nextTarget, 'pointerover', init);\n enter.forEach((el)=>instance.dispatchUIEvent(el, 'pointerenter', init));\n }\n },\n move: ()=>{\n instance.dispatchUIEvent(nextTarget, 'pointermove', init);\n }\n };\n }\n down(instance, button = 0) {\n if (this.isDown) {\n return;\n }\n const target = this.getTarget(instance);\n assertPointerEvents(instance, target);\n this.isDown = true;\n this.isPrevented = !instance.dispatchUIEvent(target, 'pointerdown', this.getEventInit(button));\n }\n up(instance, button = 0) {\n if (!this.isDown) {\n return;\n }\n const target = this.getTarget(instance);\n assertPointerEvents(instance, target);\n this.isPrevented = false;\n this.isDown = false;\n instance.dispatchUIEvent(target, 'pointerup', this.getEventInit(button));\n }\n release(instance) {\n const target = this.getTarget(instance);\n const [leave] = getTreeDiff(target, null);\n const init = this.getEventInit();\n // Currently there is no PointerEventsCheckLevel that would\n // make this check not use the *asserted* cached value from `up`.\n /* istanbul ignore else */ if (hasPointerEvents(instance, target)) {\n instance.dispatchUIEvent(target, 'pointerout', init);\n leave.forEach((el)=>instance.dispatchUIEvent(el, 'pointerleave', init));\n }\n this.isCancelled = true;\n }\n getTarget(instance) {\n var _this_position_target;\n return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;\n }\n getEventInit(/**\n * The `button` that caused the event.\n *\n * This should be `-1` if the event is not caused by a button or touch/pen contact,\n * e.g. a moving pointer.\n */ button) {\n return {\n ...this.position.coords,\n pointerId: this.pointerId,\n pointerType: this.pointerType,\n isPrimary: this.isPrimary,\n button: getMouseEventButton(button),\n buttons: this.buttons.getButtons()\n };\n }\n constructor({ pointerId, pointerType, isPrimary }, buttons){\n _define_property(this, \"pointerId\", undefined);\n _define_property(this, \"pointerType\", undefined);\n _define_property(this, \"isPrimary\", undefined);\n _define_property(this, \"buttons\", undefined);\n _define_property(this, \"isMultitouch\", false);\n _define_property(this, \"isCancelled\", false);\n _define_property(this, \"isDown\", false);\n _define_property(this, \"isPrevented\", false);\n _define_property(this, \"position\", {});\n this.pointerId = pointerId;\n this.pointerType = pointerType;\n this.isPrimary = isPrimary;\n this.isMultitouch = !isPrimary;\n this.buttons = buttons;\n }\n}\n\nexport { Pointer };\n","import { Buttons } from './buttons.js';\nimport { Device } from './device.js';\nimport { Mouse } from './mouse.js';\nimport { Pointer } from './pointer.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nclass PointerHost {\n isKeyPressed(keyDef) {\n return this.devices.get(keyDef.pointerType).isPressed(keyDef);\n }\n async press(instance, keyDef, position) {\n this.devices.get(keyDef.pointerType).addPressed(keyDef);\n this.buttons.down(keyDef);\n const pointerName = this.getPointerName(keyDef);\n const pointer = keyDef.pointerType === 'touch' ? this.pointers.new(pointerName, keyDef.pointerType, this.buttons) : this.pointers.get(pointerName);\n // TODO: deprecate the following implicit setting of position\n pointer.position = position;\n if (pointer.pointerType !== 'touch') {\n this.mouse.position = position;\n }\n if (pointer.pointerType === 'touch') {\n pointer.init(instance);\n }\n pointer.down(instance, keyDef.button);\n if (pointer.pointerType !== 'touch') {\n this.mouse.down(instance, keyDef, pointer.isPrevented);\n }\n }\n async move(instance, pointerName, position) {\n const pointer = this.pointers.get(pointerName);\n // In (some?) browsers this order of events can be observed.\n // This interweaving of events is probably unnecessary.\n // While the order of mouse (or pointer) events is defined per spec,\n // the order in which they interweave/follow on a user interaction depends on the implementation.\n const pointermove = pointer.move(instance, position);\n const mousemove = pointer.pointerType === 'touch' ? undefined : this.mouse.move(instance, position, pointer.isPrevented);\n pointermove === null || pointermove === undefined ? undefined : pointermove.leave();\n mousemove === null || mousemove === undefined ? undefined : mousemove.leave();\n pointermove === null || pointermove === undefined ? undefined : pointermove.enter();\n mousemove === null || mousemove === undefined ? undefined : mousemove.enter();\n pointermove === null || pointermove === undefined ? undefined : pointermove.move();\n mousemove === null || mousemove === undefined ? undefined : mousemove.move();\n }\n async release(instance, keyDef, position) {\n const device = this.devices.get(keyDef.pointerType);\n device.removePressed(keyDef);\n this.buttons.up(keyDef);\n const pointer = this.pointers.get(this.getPointerName(keyDef));\n const isPrevented = pointer.isPrevented;\n // TODO: deprecate the following implicit setting of position\n pointer.position = position;\n if (pointer.pointerType !== 'touch') {\n this.mouse.position = position;\n }\n if (device.countPressed === 0) {\n pointer.up(instance, keyDef.button);\n }\n if (pointer.pointerType === 'touch') {\n pointer.release(instance);\n }\n if (pointer.pointerType === 'touch' && !pointer.isMultitouch) {\n const mousemove = this.mouse.move(instance, position, isPrevented);\n mousemove === null || mousemove === undefined ? undefined : mousemove.leave();\n mousemove === null || mousemove === undefined ? undefined : mousemove.enter();\n mousemove === null || mousemove === undefined ? undefined : mousemove.move();\n this.mouse.down(instance, keyDef, isPrevented);\n }\n if (!pointer.isMultitouch) {\n const mousemove = this.mouse.move(instance, position, isPrevented);\n mousemove === null || mousemove === undefined ? undefined : mousemove.leave();\n mousemove === null || mousemove === undefined ? undefined : mousemove.enter();\n mousemove === null || mousemove === undefined ? undefined : mousemove.move();\n this.mouse.up(instance, keyDef, isPrevented);\n }\n }\n getPointerName(keyDef) {\n return keyDef.pointerType === 'touch' ? keyDef.name : keyDef.pointerType;\n }\n getPreviousPosition(pointerName) {\n return this.pointers.has(pointerName) ? this.pointers.get(pointerName).position : undefined;\n }\n resetClickCount() {\n this.mouse.resetClickCount();\n }\n getMouseTarget(instance) {\n var _this_mouse_position_target;\n return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== undefined ? _this_mouse_position_target : instance.config.document.body;\n }\n setMousePosition(position) {\n this.mouse.position = position;\n this.pointers.get('mouse').position = position;\n }\n constructor(system){\n _define_property(this, \"system\", undefined);\n _define_property(this, \"mouse\", undefined);\n _define_property(this, \"buttons\", undefined);\n _define_property(this, \"devices\", new class {\n get(k) {\n var _this_registry, _k;\n var _;\n return (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== undefined ? _ : _this_registry[_k] = new Device();\n }\n constructor(){\n _define_property(this, \"registry\", {});\n }\n }());\n _define_property(this, \"pointers\", new class {\n new(pointerName, pointerType, buttons) {\n const isPrimary = pointerType !== 'touch' || !Object.values(this.registry).some((p)=>p.pointerType === 'touch' && !p.isCancelled);\n if (!isPrimary) {\n Object.values(this.registry).forEach((p)=>{\n if (p.pointerType === pointerType && !p.isCancelled) {\n p.isMultitouch = true;\n }\n });\n }\n this.registry[pointerName] = new Pointer({\n pointerId: this.nextId++,\n pointerType,\n isPrimary\n }, buttons);\n return this.registry[pointerName];\n }\n get(pointerName) {\n if (!this.has(pointerName)) {\n throw new Error(`Trying to access pointer \"${pointerName}\" which does not exist.`);\n }\n return this.registry[pointerName];\n }\n has(pointerName) {\n return pointerName in this.registry;\n }\n constructor(){\n _define_property(this, \"registry\", {});\n _define_property(this, \"nextId\", 1);\n }\n }());\n this.system = system;\n this.buttons = new Buttons();\n this.mouse = new Mouse();\n this.pointers.new('mouse', 'mouse', this.buttons);\n }\n}\n\nexport { PointerHost };\n","import { KeyboardHost } from './keyboard.js';\nimport { PointerHost } from './pointer/index.js';\n\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n/**\n * @internal Do not create/alter this by yourself as this type might be subject to changes.\n */ class System {\n getUIEventModifiers() {\n return {\n altKey: this.keyboard.modifiers.Alt,\n ctrlKey: this.keyboard.modifiers.Control,\n metaKey: this.keyboard.modifiers.Meta,\n shiftKey: this.keyboard.modifiers.Shift,\n modifierAltGraph: this.keyboard.modifiers.AltGraph,\n modifierCapsLock: this.keyboard.modifiers.CapsLock,\n modifierFn: this.keyboard.modifiers.Fn,\n modifierFnLock: this.keyboard.modifiers.FnLock,\n modifierNumLock: this.keyboard.modifiers.NumLock,\n modifierScrollLock: this.keyboard.modifiers.ScrollLock,\n modifierSymbol: this.keyboard.modifiers.Symbol,\n modifierSymbolLock: this.keyboard.modifiers.SymbolLock\n };\n }\n constructor(){\n _define_property(this, \"keyboard\", new KeyboardHost(this));\n _define_property(this, \"pointer\", new PointerHost(this));\n }\n}\n\nexport { System };\n","async function click(element) {\n const pointerIn = [];\n if (!this.config.skipHover) {\n pointerIn.push({\n target: element\n });\n }\n pointerIn.push({\n keys: '[MouseLeft]',\n target: element\n });\n return this.pointer(pointerIn);\n}\nasync function dblClick(element) {\n return this.pointer([\n {\n target: element\n },\n '[MouseLeft][MouseLeft]'\n ]);\n}\nasync function tripleClick(element) {\n return this.pointer([\n {\n target: element\n },\n '[MouseLeft][MouseLeft][MouseLeft]'\n ]);\n}\n\nexport { click, dblClick, tripleClick };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { assertPointerEvents } from '../utils/pointer/cssPointerEvents.js';\n\nasync function hover(element) {\n return this.pointer({\n target: element\n });\n}\nasync function unhover(element) {\n assertPointerEvents(this, this.system.pointer.getMouseTarget(this));\n return this.pointer({\n target: element.ownerDocument.body\n });\n}\n\nexport { hover, unhover };\n","async function tab({ shift } = {}) {\n return this.keyboard(shift === true ? '{Shift>}{Tab}{/Shift}' : shift === false ? '[/ShiftLeft][/ShiftRight]{Tab}' : '{Tab}');\n}\n\nexport { tab };\n","var bracketDict = /*#__PURE__*/ function(bracketDict) {\n bracketDict[\"{\"] = \"}\";\n bracketDict[\"[\"] = \"]\";\n return bracketDict;\n}(bracketDict || {});\n/**\n * Read the next key definition from user input\n *\n * Describe key per `{descriptor}` or `[descriptor]`.\n * Everything else will be interpreted as a single character as descriptor - e.g. `a`.\n * Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`.\n * A previously pressed key can be released per `{/descriptor}`.\n * Keeping the key pressed can be written as `{descriptor>}`.\n * When keeping the key pressed you can choose how long the key is pressed `{descriptor>3}`.\n * You can then release the key per `{descriptor>3/}` or keep it pressed and continue with the next key.\n */ function readNextDescriptor(text, context) {\n let pos = 0;\n const startBracket = text[pos] in bracketDict ? text[pos] : '';\n pos += startBracket.length;\n const isEscapedChar = new RegExp(`^\\\\${startBracket}{2}`).test(text);\n const type = isEscapedChar ? '' : startBracket;\n return {\n type,\n ...type === '' ? readPrintableChar(text, pos, context) : readTag(text, pos, type, context)\n };\n}\nfunction readPrintableChar(text, pos, context) {\n const descriptor = text[pos];\n assertDescriptor(descriptor, text, pos, context);\n pos += descriptor.length;\n return {\n consumedLength: pos,\n descriptor,\n releasePrevious: false,\n releaseSelf: true,\n repeat: 1\n };\n}\nfunction readTag(text, pos, startBracket, context) {\n var _text_slice_match, _text_slice_match1;\n const releasePreviousModifier = text[pos] === '/' ? '/' : '';\n pos += releasePreviousModifier.length;\n const escapedDescriptor = startBracket === '{' && text[pos] === '\\\\';\n pos += Number(escapedDescriptor);\n const descriptor = escapedDescriptor ? text[pos] : (_text_slice_match = text.slice(pos).match(startBracket === '{' ? /^\\w+|^[^}>/]/ : /^\\w+/)) === null || _text_slice_match === undefined ? undefined : _text_slice_match[0];\n assertDescriptor(descriptor, text, pos, context);\n pos += descriptor.length;\n var _text_slice_match_;\n const repeatModifier = (_text_slice_match_ = (_text_slice_match1 = text.slice(pos).match(/^>\\d+/)) === null || _text_slice_match1 === undefined ? undefined : _text_slice_match1[0]) !== null && _text_slice_match_ !== undefined ? _text_slice_match_ : '';\n pos += repeatModifier.length;\n const releaseSelfModifier = text[pos] === '/' || !repeatModifier && text[pos] === '>' ? text[pos] : '';\n pos += releaseSelfModifier.length;\n const expectedEndBracket = bracketDict[startBracket];\n const endBracket = text[pos] === expectedEndBracket ? expectedEndBracket : '';\n if (!endBracket) {\n throw new Error(getErrorMessage([\n !repeatModifier && 'repeat modifier',\n !releaseSelfModifier && 'release modifier',\n `\"${expectedEndBracket}\"`\n ].filter(Boolean).join(' or '), text[pos], text, context));\n }\n pos += endBracket.length;\n return {\n consumedLength: pos,\n descriptor,\n releasePrevious: !!releasePreviousModifier,\n repeat: repeatModifier ? Math.max(Number(repeatModifier.substr(1)), 1) : 1,\n releaseSelf: hasReleaseSelf(releaseSelfModifier, repeatModifier)\n };\n}\nfunction assertDescriptor(descriptor, text, pos, context) {\n if (!descriptor) {\n throw new Error(getErrorMessage('key descriptor', text[pos], text, context));\n }\n}\nfunction hasReleaseSelf(releaseSelfModifier, repeatModifier) {\n if (releaseSelfModifier) {\n return releaseSelfModifier === '/';\n }\n if (repeatModifier) {\n return false;\n }\n}\nfunction getErrorMessage(expected, found, text, context) {\n return `Expected ${expected} but found \"${found !== null && found !== undefined ? found : ''}\" in \"${text}\"\n See ${context === 'pointer' ? `https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen` : `https://testing-library.com/docs/user-event/keyboard`}\n for more information about how userEvent parses your input.`;\n}\n\nexport { readNextDescriptor };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';\n\n/**\n * Parse key definitions per `keyboardMap`\n *\n * Keys can be referenced by `{key}` or `{special}` as well as physical locations per `[code]`.\n * Everything else will be interpreted as a typed character - e.g. `a`.\n * Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`.\n * Keeping the key pressed can be written as `{key>}`.\n * When keeping the key pressed you can choose how long (how many keydown and keypress) the key is pressed `{key>3}`.\n * You can then release the key per `{key>3/}` or keep it pressed and continue with the next key.\n */ function parseKeyDef(keyboardMap, text) {\n const defs = [];\n do {\n const { type, descriptor, consumedLength, releasePrevious, releaseSelf = true, repeat } = readNextDescriptor(text, 'keyboard');\n var _keyboardMap_find;\n const keyDef = (_keyboardMap_find = keyboardMap.find((def)=>{\n if (type === '[') {\n var _def_code;\n return ((_def_code = def.code) === null || _def_code === undefined ? undefined : _def_code.toLowerCase()) === descriptor.toLowerCase();\n } else if (type === '{') {\n var _def_key;\n return ((_def_key = def.key) === null || _def_key === undefined ? undefined : _def_key.toLowerCase()) === descriptor.toLowerCase();\n }\n return def.key === descriptor;\n })) !== null && _keyboardMap_find !== undefined ? _keyboardMap_find : {\n key: 'Unknown',\n code: 'Unknown',\n [type === '[' ? 'code' : 'key']: descriptor\n };\n defs.push({\n keyDef,\n releasePrevious,\n releaseSelf,\n repeat\n });\n text = text.slice(consumedLength);\n }while (text)\n return defs;\n}\n\nexport { parseKeyDef };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { wait } from '../utils/misc/wait.js';\nimport { parseKeyDef } from './parseKeyDef.js';\n\nasync function keyboard(text) {\n const actions = parseKeyDef(this.config.keyboardMap, text);\n for(let i = 0; i < actions.length; i++){\n await wait(this.config);\n await keyboardAction(this, actions[i]);\n }\n}\nasync function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf, repeat }) {\n const { system } = instance;\n // Release the key automatically if it was pressed before.\n if (system.keyboard.isKeyPressed(keyDef)) {\n await system.keyboard.keyup(instance, keyDef);\n }\n if (!releasePrevious) {\n for(let i = 1; i <= repeat; i++){\n await system.keyboard.keydown(instance, keyDef);\n if (i < repeat) {\n await wait(instance.config);\n }\n }\n // Release the key only on the last iteration on `state.repeatKey`.\n if (releaseSelf) {\n await system.keyboard.keyup(instance, keyDef);\n }\n }\n}\nasync function releaseAllKeys(instance) {\n for (const k of instance.system.keyboard.getPressedKeys()){\n await instance.system.keyboard.keyup(instance, k);\n }\n}\n\nexport { keyboard, releaseAllKeys };\n","import { createDataTransfer } from '../utils/dataTransfer/DataTransfer.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\nimport { hasOwnSelection } from '../utils/focus/selection.js';\nimport { getUISelection, getUIValue } from './UI.js';\n\nfunction copySelection(target) {\n const data = hasOwnSelection(target) ? {\n 'text/plain': readSelectedValueFromInput(target)\n } : {\n 'text/plain': String(target.ownerDocument.getSelection())\n };\n const dt = createDataTransfer(getWindow(target));\n for(const type in data){\n if (data[type]) {\n dt.setData(type, data[type]);\n }\n }\n return dt;\n}\nfunction readSelectedValueFromInput(target) {\n const sel = getUISelection(target);\n const val = getUIValue(target);\n return val.substring(sel.startOffset, sel.endOffset);\n}\n\nexport { copySelection };\n","import { writeDataTransferToClipboard } from '../utils/dataTransfer/Clipboard.js';\nimport { copySelection } from '../document/copySelection.js';\n\nasync function copy() {\n const doc = this.config.document;\n var _doc_activeElement;\n const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== undefined ? _doc_activeElement : /* istanbul ignore next */ doc.body;\n const clipboardData = copySelection(target);\n if (clipboardData.items.length === 0) {\n return;\n }\n if (this.dispatchUIEvent(target, 'copy', {\n clipboardData\n }) && this.config.writeToClipboard) {\n await writeDataTransferToClipboard(doc, clipboardData);\n }\n return clipboardData;\n}\n\nexport { copy };\n","import { writeDataTransferToClipboard } from '../utils/dataTransfer/Clipboard.js';\nimport { copySelection } from '../document/copySelection.js';\n\nasync function cut() {\n const doc = this.config.document;\n var _doc_activeElement;\n const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== undefined ? _doc_activeElement : /* istanbul ignore next */ doc.body;\n const clipboardData = copySelection(target);\n if (clipboardData.items.length === 0) {\n return;\n }\n if (this.dispatchUIEvent(target, 'cut', {\n clipboardData\n }) && this.config.writeToClipboard) {\n await writeDataTransferToClipboard(target.ownerDocument, clipboardData);\n }\n return clipboardData;\n}\n\nexport { cut };\n","import { createDataTransfer } from '../utils/dataTransfer/DataTransfer.js';\nimport { readDataTransferFromClipboard } from '../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\n\nasync function paste(clipboardData) {\n const doc = this.config.document;\n var _doc_activeElement;\n const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== undefined ? _doc_activeElement : /* istanbul ignore next */ doc.body;\n var _ref;\n const dataTransfer = (_ref = typeof clipboardData === 'string' ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && _ref !== undefined ? _ref : await readDataTransferFromClipboard(doc).catch(()=>{\n throw new Error('`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.');\n });\n this.dispatchUIEvent(target, 'paste', {\n clipboardData: dataTransfer\n });\n}\nfunction getClipboardDataFromString(doc, text) {\n const dt = createDataTransfer(getWindow(doc));\n dt.setData('text', text);\n return dt;\n}\n\nexport { paste };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';\n\nfunction parseKeyDef(pointerMap, keys) {\n const defs = [];\n do {\n const { descriptor, consumedLength, releasePrevious, releaseSelf = true } = readNextDescriptor(keys, 'pointer');\n const keyDef = pointerMap.find((p)=>p.name === descriptor);\n if (keyDef) {\n defs.push({\n keyDef,\n releasePrevious,\n releaseSelf\n });\n }\n keys = keys.slice(consumedLength);\n }while (keys)\n return defs;\n}\n\nexport { parseKeyDef };\n","import '../utils/dataTransfer/Clipboard.js';\nimport { setLevelRef, ApiLevel } from '../utils/misc/level.js';\nimport { wait } from '../utils/misc/wait.js';\nimport { parseKeyDef } from './parseKeyDef.js';\n\nasync function pointer(input) {\n const { pointerMap } = this.config;\n const actions = [];\n (Array.isArray(input) ? input : [\n input\n ]).forEach((actionInput)=>{\n if (typeof actionInput === 'string') {\n actions.push(...parseKeyDef(pointerMap, actionInput));\n } else if ('keys' in actionInput) {\n actions.push(...parseKeyDef(pointerMap, actionInput.keys).map((i)=>({\n ...actionInput,\n ...i\n })));\n } else {\n actions.push(actionInput);\n }\n });\n for(let i = 0; i < actions.length; i++){\n await wait(this.config);\n await pointerAction(this, actions[i]);\n }\n this.system.pointer.resetClickCount();\n}\nasync function pointerAction(instance, action) {\n var _previousPosition_caret, _previousPosition_caret1;\n const pointerName = 'pointerName' in action && action.pointerName ? action.pointerName : 'keyDef' in action ? instance.system.pointer.getPointerName(action.keyDef) : 'mouse';\n const previousPosition = instance.system.pointer.getPreviousPosition(pointerName);\n var _action_target, _action_coords, _action_node, _action_offset;\n const position = {\n target: (_action_target = action.target) !== null && _action_target !== undefined ? _action_target : getPrevTarget(instance, previousPosition),\n coords: (_action_coords = action.coords) !== null && _action_coords !== undefined ? _action_coords : previousPosition === null || previousPosition === undefined ? undefined : previousPosition.coords,\n caret: {\n node: (_action_node = action.node) !== null && _action_node !== undefined ? _action_node : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === undefined ? undefined : (_previousPosition_caret = previousPosition.caret) === null || _previousPosition_caret === undefined ? undefined : _previousPosition_caret.node,\n offset: (_action_offset = action.offset) !== null && _action_offset !== undefined ? _action_offset : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === undefined ? undefined : (_previousPosition_caret1 = previousPosition.caret) === null || _previousPosition_caret1 === undefined ? undefined : _previousPosition_caret1.offset\n }\n };\n if ('keyDef' in action) {\n if (instance.system.pointer.isKeyPressed(action.keyDef)) {\n setLevelRef(instance, ApiLevel.Trigger);\n await instance.system.pointer.release(instance, action.keyDef, position);\n }\n if (!action.releasePrevious) {\n setLevelRef(instance, ApiLevel.Trigger);\n await instance.system.pointer.press(instance, action.keyDef, position);\n if (action.releaseSelf) {\n setLevelRef(instance, ApiLevel.Trigger);\n await instance.system.pointer.release(instance, action.keyDef, position);\n }\n }\n } else {\n setLevelRef(instance, ApiLevel.Trigger);\n await instance.system.pointer.move(instance, pointerName, position);\n }\n}\nfunction hasCaretPosition(action) {\n var _action_target, _ref;\n return !!((_ref = (_action_target = action.target) !== null && _action_target !== undefined ? _action_target : action.node) !== null && _ref !== undefined ? _ref : action.offset !== undefined);\n}\nfunction getPrevTarget(instance, position) {\n if (!position) {\n throw new Error('This pointer has no previous position. Provide a target property!');\n }\n var _position_target;\n return (_position_target = position.target) !== null && _position_target !== undefined ? _position_target : instance.config.document.body;\n}\n\nexport { pointer };\n","import '../event/behavior/click.js';\nimport '../event/behavior/cut.js';\nimport '../event/behavior/keydown.js';\nimport '../event/behavior/keypress.js';\nimport '../event/behavior/keyup.js';\nimport '../event/behavior/paste.js';\nimport '@testing-library/dom';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { isEditable } from '../utils/edit/isEditable.js';\nimport { isDisabled } from '../utils/misc/isDisabled.js';\nimport { focusElement } from '../event/focus.js';\nimport { input } from '../event/input.js';\nimport { selectAll, isAllSelected } from '../event/selection/selectAll.js';\n\nasync function clear(element) {\n if (!isEditable(element) || isDisabled(element)) {\n throw new Error('clear()` is only supported on editable elements.');\n }\n focusElement(element);\n if (element.ownerDocument.activeElement !== element) {\n throw new Error('The element to be cleared could not be focused.');\n }\n selectAll(element);\n if (!isAllSelected(element)) {\n throw new Error('The element content to be cleared could not be selected.');\n }\n input(this, element, '', 'deleteContentBackward');\n}\n\nexport { clear };\n","import { getConfig } from '@testing-library/dom';\nimport { isElementType } from '../utils/misc/isElementType.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { isDisabled } from '../utils/misc/isDisabled.js';\nimport { wait } from '../utils/misc/wait.js';\nimport { hasPointerEvents } from '../utils/pointer/cssPointerEvents.js';\nimport '../event/behavior/click.js';\nimport '../event/behavior/cut.js';\nimport '../event/behavior/keydown.js';\nimport '../event/behavior/keypress.js';\nimport '../event/behavior/keyup.js';\nimport '../event/behavior/paste.js';\nimport { focusElement } from '../event/focus.js';\n\nasync function selectOptions(select, values) {\n return selectOptionsBase.call(this, true, select, values);\n}\nasync function deselectOptions(select, values) {\n return selectOptionsBase.call(this, false, select, values);\n}\nasync function selectOptionsBase(newValue, select, values) {\n if (!newValue && !select.multiple) {\n throw getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);\n }\n const valArray = Array.isArray(values) ? values : [\n values\n ];\n const allOptions = Array.from(select.querySelectorAll('option, [role=\"option\"]'));\n const selectedOptions = valArray.map((val)=>{\n if (typeof val !== 'string' && allOptions.includes(val)) {\n return val;\n } else {\n const matchingOption = allOptions.find((o)=>o.value === val || o.innerHTML === val);\n if (matchingOption) {\n return matchingOption;\n } else {\n throw getConfig().getElementError(`Value \"${String(val)}\" not found in options`, select);\n }\n }\n }).filter((option)=>!isDisabled(option));\n if (isDisabled(select) || !selectedOptions.length) return;\n const selectOption = (option)=>{\n option.selected = newValue;\n this.dispatchUIEvent(select, 'input', {\n bubbles: true,\n cancelable: false,\n composed: true\n });\n this.dispatchUIEvent(select, 'change');\n };\n if (isElementType(select, 'select')) {\n if (select.multiple) {\n for (const option of selectedOptions){\n const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, option);\n // events fired for multiple select are weird. Can't use hover...\n if (withPointerEvents) {\n this.dispatchUIEvent(option, 'pointerover');\n this.dispatchUIEvent(select, 'pointerenter');\n this.dispatchUIEvent(option, 'mouseover');\n this.dispatchUIEvent(select, 'mouseenter');\n this.dispatchUIEvent(option, 'pointermove');\n this.dispatchUIEvent(option, 'mousemove');\n this.dispatchUIEvent(option, 'pointerdown');\n this.dispatchUIEvent(option, 'mousedown');\n }\n focusElement(select);\n if (withPointerEvents) {\n this.dispatchUIEvent(option, 'pointerup');\n this.dispatchUIEvent(option, 'mouseup');\n }\n selectOption(option);\n if (withPointerEvents) {\n this.dispatchUIEvent(option, 'click');\n }\n await wait(this.config);\n }\n } else if (selectedOptions.length === 1) {\n const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, select);\n // the click to open the select options\n if (withPointerEvents) {\n await this.click(select);\n } else {\n focusElement(select);\n }\n selectOption(selectedOptions[0]);\n if (withPointerEvents) {\n // the browser triggers another click event on the select for the click on the option\n // this second click has no 'down' phase\n this.dispatchUIEvent(select, 'pointerover');\n this.dispatchUIEvent(select, 'pointerenter');\n this.dispatchUIEvent(select, 'mouseover');\n this.dispatchUIEvent(select, 'mouseenter');\n this.dispatchUIEvent(select, 'pointerup');\n this.dispatchUIEvent(select, 'mouseup');\n this.dispatchUIEvent(select, 'click');\n }\n await wait(this.config);\n } else {\n throw getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);\n }\n } else if (select.getAttribute('role') === 'listbox') {\n for (const option of selectedOptions){\n await this.click(option);\n await this.unhover(option);\n }\n } else {\n throw getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);\n }\n}\n\nexport { deselectOptions, selectOptions };\n","import { releaseAllKeys } from '../keyboard/index.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { setSelectionRange } from '../event/selection/setSelectionRange.js';\n\nasync function type(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {\n // TODO: properly type guard\n // we use this workaround for now to prevent changing behavior\n if (element.disabled) return;\n if (!skipClick) {\n await this.click(element);\n }\n if (initialSelectionStart !== undefined) {\n setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== undefined ? initialSelectionEnd : initialSelectionStart);\n }\n await this.keyboard(text);\n if (!skipAutoClose) {\n await releaseAllKeys(this);\n }\n}\n\nexport { type };\n","// It is not possible to create a real FileList programmatically.\n// Therefore assigning `files` property with a programmatically created FileList results in an error.\n// Just assigning the property (as per fireEvent) breaks the interweaving with the `value` property.\nconst fakeFiles = Symbol('files and value properties are mocked');\nfunction restoreProperty(obj, prop, descriptor) {\n if (descriptor) {\n Object.defineProperty(obj, prop, descriptor);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete obj[prop];\n }\n}\nfunction setFiles(el, files) {\n var _el_fakeFiles;\n (_el_fakeFiles = el[fakeFiles]) === null || _el_fakeFiles === undefined ? undefined : _el_fakeFiles.restore();\n const typeDescr = Object.getOwnPropertyDescriptor(el, 'type');\n const valueDescr = Object.getOwnPropertyDescriptor(el, 'value');\n const filesDescr = Object.getOwnPropertyDescriptor(el, 'files');\n function restore() {\n restoreProperty(el, 'type', typeDescr);\n restoreProperty(el, 'value', valueDescr);\n restoreProperty(el, 'files', filesDescr);\n }\n el[fakeFiles] = {\n restore\n };\n Object.defineProperties(el, {\n files: {\n configurable: true,\n get: ()=>files\n },\n value: {\n configurable: true,\n get: ()=>files.length ? `C:\\\\fakepath\\\\${files[0].name}` : '',\n set (v) {\n if (v === '') {\n restore();\n } else {\n var _valueDescr_set;\n valueDescr === null || valueDescr === undefined ? undefined : (_valueDescr_set = valueDescr.set) === null || _valueDescr_set === undefined ? undefined : _valueDescr_set.call(el, v);\n }\n }\n },\n type: {\n configurable: true,\n get: ()=>'file',\n set (v) {\n if (v !== 'file') {\n restore();\n el.type = v;\n }\n }\n }\n });\n}\n\nexport { setFiles };\n","import { isElementType } from '../utils/misc/isElementType.js';\nimport { createFileList } from '../utils/dataTransfer/FileList.js';\nimport '../utils/dataTransfer/Clipboard.js';\nimport { setFiles } from '../utils/edit/setFiles.js';\nimport { isDisabled } from '../utils/misc/isDisabled.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\n\nasync function upload(element, fileOrFiles) {\n const input = isElementType(element, 'label') ? element.control : element;\n if (!input || !isElementType(input, 'input', {\n type: 'file'\n })) {\n throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${input === null || input === undefined ? undefined : input.tagName} element does not accept file uploads`);\n }\n if (isDisabled(element)) return;\n const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [\n fileOrFiles\n ]).filter((file)=>!this.config.applyAccept || isAcceptableFile(file, input.accept)).slice(0, input.multiple ? undefined : 1);\n const fileDialog = ()=>{\n var _input_files;\n // do not fire an input event if the file selection does not change\n if (files.length === ((_input_files = input.files) === null || _input_files === undefined ? undefined : _input_files.length) && files.every((f, i)=>{\n var _input_files;\n return f === ((_input_files = input.files) === null || _input_files === undefined ? undefined : _input_files.item(i));\n })) {\n return;\n }\n setFiles(input, createFileList(getWindow(element), files));\n this.dispatchUIEvent(input, 'input');\n this.dispatchUIEvent(input, 'change');\n };\n input.addEventListener('fileDialog', fileDialog);\n await this.click(element);\n input.removeEventListener('fileDialog', fileDialog);\n}\n// When matching files, browsers ignore case and consider jpeg/jpg interchangeable.\nfunction normalize(nameOrType) {\n return nameOrType.toLowerCase().replace(/(\\.|\\/)jpg\\b/g, '$1jpeg');\n}\nfunction isAcceptableFile(file, accept) {\n if (!accept) {\n return true;\n }\n const wildcards = [\n 'audio/*',\n 'image/*',\n 'video/*'\n ];\n return normalize(accept).trim().split(/\\s*,\\s*/).some((acceptToken)=>{\n // tokens starting with a dot represent a file extension\n if (acceptToken.startsWith('.')) {\n return normalize(file.name).endsWith(acceptToken);\n } else if (wildcards.includes(acceptToken)) {\n return normalize(file.type).startsWith(acceptToken.replace('*', ''));\n }\n return normalize(file.type) === acceptToken;\n });\n}\n\nexport { upload };\n","import { click, dblClick, tripleClick } from '../convenience/click.js';\nimport { hover, unhover } from '../convenience/hover.js';\nimport { tab } from '../convenience/tab.js';\nimport { keyboard } from '../keyboard/index.js';\nimport { copy } from '../clipboard/copy.js';\nimport { cut } from '../clipboard/cut.js';\nimport { paste } from '../clipboard/paste.js';\nimport { pointer } from '../pointer/index.js';\nimport { clear } from '../utility/clear.js';\nimport { deselectOptions, selectOptions } from '../utility/selectOptions.js';\nimport { type } from '../utility/type.js';\nimport { upload } from '../utility/upload.js';\n\nconst userEventApi = {\n click,\n dblClick,\n tripleClick,\n hover,\n unhover,\n tab,\n keyboard,\n copy,\n cut,\n paste,\n pointer,\n clear,\n deselectOptions,\n selectOptions,\n type,\n upload\n};\n\nexport { userEventApi };\n","import { getConfig } from '@testing-library/dom';\n\n/**\n * Wrap an internal Promise\n */ function wrapAsync(implementation) {\n return getConfig().asyncWrapper(implementation);\n}\n\nexport { wrapAsync };\n","import { patchFocus } from '../document/patchFocus.js';\nimport { prepareDocument } from '../document/prepareDocument.js';\nimport { dispatchEvent, dispatchUIEvent } from '../event/dispatchEvent.js';\nimport { attachClipboardStubToView } from '../utils/dataTransfer/Clipboard.js';\nimport { getWindow } from '../utils/misc/getWindow.js';\nimport { getDocumentFromNode } from '../utils/misc/getDocumentFromNode.js';\nimport { setLevelRef, ApiLevel } from '../utils/misc/level.js';\nimport { wait } from '../utils/misc/wait.js';\nimport { PointerEventsCheckLevel } from '../options.js';\nimport '@testing-library/dom';\nimport { defaultKeyMap } from '../keyboard/keyMap.js';\nimport { defaultKeyMap as defaultKeyMap$1 } from '../pointer/keyMap.js';\nimport { System } from '../system/index.js';\nimport { userEventApi } from './api.js';\nimport { wrapAsync } from './wrapAsync.js';\n\n/**\n * Default options applied when API is called per `userEvent.anyApi()`\n */ const defaultOptionsDirect = {\n applyAccept: true,\n autoModify: true,\n delay: 0,\n document: globalThis.document,\n keyboardMap: defaultKeyMap,\n pointerMap: defaultKeyMap$1,\n pointerEventsCheck: PointerEventsCheckLevel.EachApiCall,\n skipAutoClose: false,\n skipClick: false,\n skipHover: false,\n writeToClipboard: false,\n advanceTimers: ()=>Promise.resolve()\n};\n/**\n * Default options applied when API is called per `userEvent().anyApi()`\n */ const defaultOptionsSetup = {\n ...defaultOptionsDirect,\n writeToClipboard: true\n};\nfunction createConfig(options = {}, defaults = defaultOptionsSetup, node) {\n const document = getDocument(options, node, defaults);\n return {\n ...defaults,\n ...options,\n document\n };\n}\n/**\n * Start a \"session\" with userEvent.\n * All APIs returned by this function share an input device state and a default configuration.\n */ function setupMain(options = {}) {\n const config = createConfig(options);\n prepareDocument(config.document);\n patchFocus(getWindow(config.document).HTMLElement);\n var _config_document_defaultView;\n const view = (_config_document_defaultView = config.document.defaultView) !== null && _config_document_defaultView !== undefined ? _config_document_defaultView : /* istanbul ignore next */ globalThis.window;\n attachClipboardStubToView(view);\n return createInstance(config).api;\n}\n/**\n * Setup in direct call per `userEvent.anyApi()`\n */ function setupDirect({ keyboardState, pointerState, ...options } = {}, node) {\n const config = createConfig(options, defaultOptionsDirect, node);\n prepareDocument(config.document);\n patchFocus(getWindow(config.document).HTMLElement);\n var _ref;\n const system = (_ref = pointerState !== null && pointerState !== undefined ? pointerState : keyboardState) !== null && _ref !== undefined ? _ref : new System();\n return {\n api: createInstance(config, system).api,\n system\n };\n}\n/**\n * Create a set of callbacks with different default settings but the same state.\n */ function setupSub(options) {\n return createInstance({\n ...this.config,\n ...options\n }, this.system).api;\n}\nfunction wrapAndBindImpl(instance, impl) {\n function method(...args) {\n setLevelRef(instance, ApiLevel.Call);\n return wrapAsync(()=>impl.apply(instance, args).then(async (ret)=>{\n await wait(instance.config);\n return ret;\n }));\n }\n Object.defineProperty(method, 'name', {\n get: ()=>impl.name\n });\n return method;\n}\nfunction createInstance(config, system = new System()) {\n const instance = {};\n Object.assign(instance, {\n config,\n dispatchEvent: dispatchEvent.bind(instance),\n dispatchUIEvent: dispatchUIEvent.bind(instance),\n system,\n levelRefs: {},\n ...userEventApi\n });\n return {\n instance,\n api: {\n ...Object.fromEntries(Object.entries(userEventApi).map(([name, api])=>[\n name,\n wrapAndBindImpl(instance, api)\n ])),\n setup: setupSub.bind(instance)\n }\n };\n}\nfunction getDocument(options, node, defaults) {\n var _options_document, _ref;\n return (_ref = (_options_document = options.document) !== null && _options_document !== undefined ? _options_document : node && getDocumentFromNode(node)) !== null && _ref !== undefined ? _ref : defaults.document;\n}\n\nexport { createConfig, createInstance, setupDirect, setupMain, setupSub };\n","import { setupDirect } from './setup.js';\n\nfunction clear(element) {\n return setupDirect().api.clear(element);\n}\nfunction click(element, options = {}) {\n return setupDirect(options, element).api.click(element);\n}\nfunction copy(options = {}) {\n return setupDirect(options).api.copy();\n}\nfunction cut(options = {}) {\n return setupDirect(options).api.cut();\n}\nfunction dblClick(element, options = {}) {\n return setupDirect(options).api.dblClick(element);\n}\nfunction deselectOptions(select, values, options = {}) {\n return setupDirect(options).api.deselectOptions(select, values);\n}\nfunction hover(element, options = {}) {\n return setupDirect(options).api.hover(element);\n}\nasync function keyboard(text, options = {}) {\n const { api, system } = setupDirect(options);\n return api.keyboard(text).then(()=>system);\n}\nasync function pointer(input, options = {}) {\n const { api, system } = setupDirect(options);\n return api.pointer(input).then(()=>system);\n}\nfunction paste(clipboardData, options) {\n return setupDirect(options).api.paste(clipboardData);\n}\nfunction selectOptions(select, values, options = {}) {\n return setupDirect(options).api.selectOptions(select, values);\n}\nfunction tripleClick(element, options = {}) {\n return setupDirect(options).api.tripleClick(element);\n}\nfunction type(element, text, options = {}) {\n return setupDirect(options, element).api.type(element, text, options);\n}\nfunction unhover(element, options = {}) {\n const { api, system } = setupDirect(options);\n system.pointer.setMousePosition({\n target: element\n });\n return api.unhover(element);\n}\nfunction upload(element, fileOrFiles, options = {}) {\n return setupDirect(options).api.upload(element, fileOrFiles);\n}\nfunction tab(options = {}) {\n return setupDirect().api.tab(options);\n}\n\nexport { clear, click, copy, cut, dblClick, deselectOptions, hover, keyboard, paste, pointer, selectOptions, tab, tripleClick, type, unhover, upload };\n","import { setupMain } from './setup.js';\nimport * as directApi from './directApi.js';\n\nconst userEvent = {\n ...directApi,\n setup: setupMain\n};\n\nexport { userEvent };\n","import {render, screen, waitFor} from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport {beforeEach, describe, expect, it, vi} from \"vitest\";\nimport {CodeBlock, CodeBlockCopyButton} from \"./CodeBlock\";\nimport {highlightCode} from \"./highlightCode\";\n\nvi.mock(\"./highlightCode\", () => ({\n highlightCode: vi.fn(),\n}));\n\nconst highlightCodeMock = vi.mocked(highlightCode);\n\nconst createDeferred = <T,>() => {\n let resolve!: (value: T) => void;\n const promise = new Promise<T>((res) => {\n resolve = res;\n });\n return {promise, resolve};\n};\n\nconst SAMPLE_CODE = \"const answer = 42;\";\nconst SAMPLE_LANGUAGE = \"tsx\";\n\nbeforeEach(() => {\n highlightCodeMock.mockReset();\n});\n\ndescribe(\"<CodeBlock />\", () => {\n it(\"shows fallback text until highlightCode resolves, then renders highlighted HTML\", async () => {\n const deferred = createDeferred<[string, string]>();\n highlightCodeMock.mockReturnValueOnce(deferred.promise);\n\n const {container} = render(\n <CodeBlock code={SAMPLE_CODE} language={SAMPLE_LANGUAGE}/>\n );\n\n expect(container.querySelector(\"pre\")?.textContent).toContain(SAMPLE_CODE);\n\n deferred.resolve([\"<span>light</span>\", \"<span>dark</span>\"]);\n\n await waitFor(() => {\n const highlightedBlocks = container.querySelectorAll('[data-code-block=\"true\"] pre');\n expect(highlightedBlocks[0]?.innerHTML).toContain(\"light\");\n expect(highlightedBlocks[1]?.innerHTML).toContain(\"dark\");\n });\n });\n\n it(\"passes the showLineNumbers flag to highlightCode\", async () => {\n highlightCodeMock.mockResolvedValueOnce([\"\", \"\"]);\n\n render(\n <CodeBlock code={SAMPLE_CODE} language={SAMPLE_LANGUAGE} showLineNumbers/>\n );\n\n await waitFor(() =>\n expect(highlightCodeMock).toHaveBeenCalledWith(\n SAMPLE_CODE,\n SAMPLE_LANGUAGE,\n true\n )\n );\n });\n});\n\ndescribe(\"<CodeBlockCopyButton />\", () => {\n it(\"copies the current code to the clipboard and calls onCopy\", async () => {\n highlightCodeMock.mockResolvedValue([\"\", \"\"]);\n const writeText = vi.fn().mockResolvedValue(undefined);\n const onCopy = vi.fn();\n const user = userEvent.setup();\n\n render(\n <CodeBlock code={SAMPLE_CODE} language={SAMPLE_LANGUAGE}>\n <CodeBlockCopyButton onCopy={onCopy} clipboard={{writeText}}/>\n </CodeBlock>\n );\n\n const copyButton = screen.getByTitle(\"Copy code\");\n await user.click(copyButton);\n\n await waitFor(() =>\n expect(writeText).toHaveBeenCalledWith(SAMPLE_CODE)\n );\n await waitFor(() => expect(onCopy).toHaveBeenCalledTimes(1));\n });\n\n it(\"surfaces an error when the clipboard API is unavailable\", async () => {\n highlightCodeMock.mockResolvedValue([\"\", \"\"]);\n const onError = vi.fn();\n const user = userEvent.setup();\n\n render(\n <CodeBlock code={SAMPLE_CODE} language={SAMPLE_LANGUAGE}>\n <CodeBlockCopyButton onError={onError} clipboard={{}}/>\n </CodeBlock>\n );\n\n const copyButton = screen.getByTitle(\"Copy code\");\n await user.click(copyButton);\n\n await waitFor(() => expect(onError).toHaveBeenCalledTimes(1));\n expect(onError.mock.calls[0][0]).toBeInstanceOf(Error);\n });\n});\n"],"names":["isElementType","element","tag","props","k","v","getWindow","node","_node_ownerDocument","isDocument","describe","val","readBlobText","blob","FileReader","res","rej","fr","createFileList","window","files","list","index","i","_define_property","obj","key","value","DataTransferItemStub","callback","dataOrFile","type","DataTransferItemListStub","args","item","getTypeMatcher","exact","group","sub","isGroup","createDataTransferStub","format","_this_items_find","match","text","t","data","matchIndex","createDataTransfer","dt","getBlobFromDataTransferItem","r","createClipboardItem","blobs","dataMap","b","d","ClipboardStubControl","createClipboardStub","control","isClipboardStub","clipboard","attachClipboardStubToView","realClipboard","stub","resetClipboardStubOnView","detachClipboardStubFromView","readDataTransferFromClipboard","document","items","writeDataTransferToClipboard","clipboardData","dtItem","g","FOCUSABLE_SELECTOR","isFocusable","cloneEvent","event","isDisabled","el","_el_querySelector","getActiveElement","activeElement","getActiveElementOrBody","_getActiveElement","findClosest","isContentEditable","getContentEditable","getElement","clickableInputTypes","isClickableInput","isEditable","isEditableInputOrTextArea","editableInputTypes","hasOwnSelection","isElement","hasNoSelection","updateSelectionOnFocus","selection","contenteditable","_contenteditable_firstChild","focusNode","wrapEvent","cb","_element","getConfig","focusElement","target","blurElement","behavior","instance","context","UIValue","UISelection","InitialValue","isUIValue","isUISelectionStart","start","setUIValue","getUIValue","setUIValueClean","clearInitialValue","getInitialValue","setUISelectionRaw","setUISelection","focusOffsetParam","anchorOffsetParam","mode","valueLength","sanitizeOffset","o","anchorOffset","focusOffset","startOffset","endOffset","startObj","getUISelection","_element_selectionStart","_element_selectionEnd","_element_UISelection","sel","hasUISelection","setUISelectionClean","parseInt","buildTimeValue","onlyDigitsValue","firstDigit","secondDigit","build","hours","validHours","minuteCharacters","parsedMinutes","validMinutes","isValidDateOrTimeValue","clone","maxLengthSupportedTypes","getMaxLength","_element_getAttribute","attr","supportsMaxLength","getNextCursorPosition","offset","direction","inputType","isTextNode","nextNode","getNextCharacterContentNode","nextPlusOne","getOffset","nextOffset","walkNodes","isTreatedAsCharacterContent","sibling","getDescendant","TrackChanges","isReact17Element","startTrackValue","trackOrSetValue","_element_TrackChanges_tracked","_element_TrackChanges","commitValueAfterInput","cursorOffset","_changes_tracked","changes","isJustReactStateUpdate","getTargetTypeAndSelection","getInputRange","typeAndSelection","_typeAndSelection_selection","setSelection","anchorNode","_anchorNode_ownerDocument_getSelection","_anchorNode_ownerDocument","isDateOrTime","input","inputRange","editContenteditable","editInputElement","del","nextPosition","delRange","dataToInsert","maxLength","spaceUntilMaxLength","newValue","newOffset","oldValue","calculateNewValue","isValidNumberInput","commitInput","inputData","prologEnd","prolog","epilogStart","epilog","builtValue","inputInit","_value_match","_value_match1","valueParts","getValueOrTextContent","isVisible","display","visibility","getTabDestination","shift","focusableElements","enabledElements","a","j","checkedRadio","prunedElements","activeRadioGroup","currentElement","e","moveSelection","selectAll","_getContentEditable","isAllSelected","setSelectionRange","_element_firstChild","walkRadio","_keydownBehavior_event_key","_keydownBehavior_event_key1","keydownBehavior","combinationBehavior","_getValueOrTextContent","_getValueOrTextContent_length","newPos","dest","ClickInputOnEnter","form","submit","SubmitSingleInputOnEnter","_keyupBehavior_event_key","keyupBehavior","_event_clipboardData","insertData","eventMap","getEventClass","mouseEvents","isMouseEvent","isKeyboardEvent","eventInitializer","initClipboardEvent","initUIEvent","initFocusEvent","initInputEvent","initUIEventModifiers","initMouseEvent","initPointerEvent","initKeyboardEvent","createEvent","init","EventType","defaultInit","getEventConstructors","f","_window_Event","Event","_window_AnimationEvent","AnimationEvent","_window_ClipboardEvent","ClipboardEvent","_window_PopStateEvent","PopStateEvent","_window_ProgressEvent","ProgressEvent","_window_TransitionEvent","TransitionEvent","_window_UIEvent","UIEvent","_window_CompositionEvent","CompositionEvent","_window_FocusEvent","FocusEvent","_window_InputEvent","InputEvent","_window_KeyboardEvent","KeyboardEvent","_window_MouseEvent","MouseEvent","_window_DragEvent","DragEvent","_window_PointerEvent","PointerEvent","_window_TouchEvent","TouchEvent","assignProps","sanitizeNumber","n","relatedTarget","isComposing","view","detail","altKey","ctrlKey","metaKey","shiftKey","modifierAltGraph","modifierCapsLock","modifierFn","modifierFnLock","modifierNumLock","modifierScrollLock","modifierSymbol","modifierSymbolLock","code","location","repeat","charCode","x","y","screenX","screenY","clientX","clientY","button","buttons","offsetX","offsetY","pageX","pageY","pointerId","width","height","pressure","tangentialPressure","tiltX","tiltY","twist","pointerType","isPrimary","dispatchUIEvent","preventDefault","dispatchEvent","_behavior_type","behaviorImplementation","defaultPrevented","dispatchDOMEvent","patched","patchFocus","HTMLElement","focus","blur","patchedFocus","patchedBlur","activeCall","options","blurred","getActiveTarget","thisCall","active","Interceptor","prepareInterceptor","propName","interceptorImpl","prototypeDescriptor","objectDescriptor","intercept","applyNative","realArgs","then","realFunc","prepareValueInterceptor","isUI","sanitizeValue","prepareSelectionInterceptor","others","prepareRangeTextInterceptor","isPrepared","prepareDocument","prepareElement","initialValue","getDocumentFromNode","ApiLevel","setLevelRef","level","getLevelRef","wait","config","delay","resolve","PointerEventsCheckLevel","DOM_KEY_LOCATION","modifierKeys","isModifierKey","modifierLocks","isModifierLock","KeyboardHost","keyDef","p","unprevented","system","_this_registry","_code","_","_this_registry_code","defaultKeyMap","c","Buttons","getMouseButtonId","MouseButton","MouseButtonFlip","getMouseEventButton","Device","getTreeDiff","treeA","treeB","resolveCaretPosition","findNodeAtTextOffset","isRoot","step","setSelectionPerMouseDown","clickCount","targetHasOwnSelection","end","getTextRange","startNode","endNode","range","pos","textPos","modifySelectionPerMouseMove","selectionRange","selectionFocus","cmp","isDifferentPointerPosition","positionA","positionB","_positionA_coords","_positionB_coords","_positionA_coords1","_positionB_coords1","_positionA_coords2","_positionB_coords2","_positionA_coords3","_positionB_coords3","_positionA_coords4","_positionB_coords4","_positionA_coords5","_positionB_coords5","_positionA_coords6","_positionB_coords6","_positionA_coords7","_positionB_coords7","_positionA_coords8","_positionB_coords8","_positionA_coords9","_positionB_coords9","_positionA_caret","_positionB_caret","_positionA_caret1","_positionB_caret1","Mouse","position","isPrevented","prevPosition","prevTarget","nextTarget","leave","enter","disabled","mouseUpInit","clickTarget","_this_position_target","_this_position_caret","_this_position_caret1","current","_this_count_button","_this_count_button1","hasPointerEvents","_checkPointerEvents","checkPointerEvents","closestPointerEventsDeclaration","tree","pointerEvents","PointerEventsCheck","lastCheck","hasBitFlag","declaration","assertPointerEvents","printTree","getLabelDescr","_element_labels","label","_element_ownerDocument_getElementById_textContent","_element_ownerDocument_getElementById","_el_textContent","_element_textContent","conf","flag","Pointer","PointerHost","pointerName","pointer","pointermove","mousemove","device","_this_mouse_position_target","_k","System","click","pointerIn","dblClick","tripleClick","hover","unhover","tab","bracketDict","readNextDescriptor","startBracket","readPrintableChar","readTag","descriptor","assertDescriptor","_text_slice_match","_text_slice_match1","releasePreviousModifier","escapedDescriptor","_text_slice_match_","repeatModifier","releaseSelfModifier","expectedEndBracket","endBracket","getErrorMessage","hasReleaseSelf","expected","found","parseKeyDef","keyboardMap","defs","consumedLength","releasePrevious","releaseSelf","_keyboardMap_find","def","_def_code","_def_key","keyboard","actions","keyboardAction","releaseAllKeys","copySelection","readSelectedValueFromInput","copy","doc","_doc_activeElement","cut","paste","_ref","dataTransfer","getClipboardDataFromString","pointerMap","keys","actionInput","pointerAction","action","_previousPosition_caret","_previousPosition_caret1","previousPosition","_action_target","_action_coords","_action_node","_action_offset","getPrevTarget","hasCaretPosition","_position_target","clear","selectOptions","select","values","selectOptionsBase","deselectOptions","valArray","allOptions","selectedOptions","matchingOption","option","selectOption","withPointerEvents","skipClick","skipAutoClose","initialSelectionStart","initialSelectionEnd","fakeFiles","restoreProperty","prop","setFiles","_el_fakeFiles","typeDescr","valueDescr","filesDescr","restore","_valueDescr_set","upload","fileOrFiles","file","isAcceptableFile","fileDialog","_input_files","normalize","nameOrType","accept","wildcards","acceptToken","userEventApi","wrapAsync","implementation","defaultOptionsDirect","defaultKeyMap$1","defaultOptionsSetup","createConfig","defaults","getDocument","setupMain","_config_document_defaultView","createInstance","setupDirect","keyboardState","pointerState","setupSub","wrapAndBindImpl","impl","method","ret","name","api","_options_document","userEvent","directApi","vi","highlightCodeMock","highlightCode","createDeferred","SAMPLE_CODE","SAMPLE_LANGUAGE","beforeEach","it","deferred","container","render","jsx","CodeBlock","expect","_a","waitFor","highlightedBl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CAAC;AAC5C,UAAMuB,IAAUxB,EAAG,GAAA,GACboB,IAAOtB,GAAU,MAAA;AAEvB,IAAAY;AAAA,MACE,gBAAAC,EAACC,IAAA,EAAU,MAAMR,GAAa,UAAUC,IACtC,UAAA,gBAAAM,EAACU,IAAA,EAAoB,SAAAG,GAAkB,WAAW,CAAA,EAAC,CAAE,EAAA,CACvD;AAAA,IAAA;AAGF,UAAMF,IAAaC,GAAO,WAAW,WAAW;AAChD,UAAMH,EAAK,MAAME,CAAU,GAE3B,MAAMP,GAAQ,MAAMF,EAAOW,CAAO,EAAE,sBAAsB,CAAC,CAAC,GAC5DX,EAAOW,EAAQ,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK;AAAA,EACvD,CAAC;AACH,CAAC;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88]}