pseudo-dom 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +903 -43
  2. package/browser/pseudo-dom.js +1489 -376
  3. package/browser/pseudo-dom.min.js +1 -1
  4. package/dist/classes/PseudoEventListener.d.ts +25 -25
  5. package/dist/classes/PseudoEventListener.js +37 -34
  6. package/dist/classes/PseudoEventListener.min.js +1 -1
  7. package/dist/factories/createEvent.d.ts +28 -0
  8. package/dist/factories/createEvent.js +56 -0
  9. package/dist/factories/createEvent.min.js +1 -0
  10. package/dist/factories/eventDefaults.d.ts +31 -0
  11. package/dist/factories/eventDefaults.js +105 -0
  12. package/dist/factories/eventDefaults.min.js +1 -0
  13. package/dist/factories.d.ts +6 -0
  14. package/dist/factories.js +5 -1
  15. package/dist/factories.min.js +1 -1
  16. package/dist/functions/activeElement.d.ts +14 -0
  17. package/dist/functions/activeElement.js +33 -0
  18. package/dist/functions/activeElement.min.js +1 -0
  19. package/dist/functions/modifierState.d.ts +29 -0
  20. package/dist/functions/modifierState.js +41 -0
  21. package/dist/functions/modifierState.min.js +1 -0
  22. package/dist/interfaces/PseudoEventTarget.d.ts +2 -2
  23. package/dist/main.d.ts +32 -1
  24. package/dist/main.js +66 -1
  25. package/dist/main.min.js +1 -1
  26. package/dist/services/CustomEventService.d.ts +37 -0
  27. package/dist/services/CustomEventService.js +35 -0
  28. package/dist/services/CustomEventService.min.js +1 -0
  29. package/dist/services/ElementService.d.ts +1 -0
  30. package/dist/services/ElementService.js +17 -10
  31. package/dist/services/ElementService.min.js +1 -1
  32. package/dist/services/EventService.d.ts +18 -4
  33. package/dist/services/EventService.js +65 -31
  34. package/dist/services/EventService.min.js +1 -1
  35. package/dist/services/EventTargetService.d.ts +41 -9
  36. package/dist/services/EventTargetService.js +121 -52
  37. package/dist/services/EventTargetService.min.js +1 -1
  38. package/dist/services/FocusEventService.d.ts +32 -0
  39. package/dist/services/FocusEventService.js +35 -0
  40. package/dist/services/FocusEventService.min.js +1 -0
  41. package/dist/services/HTMLElementService.d.ts +20 -0
  42. package/dist/services/HTMLElementService.js +95 -0
  43. package/dist/services/HTMLElementService.min.js +1 -1
  44. package/dist/services/InputEventService.d.ts +41 -0
  45. package/dist/services/InputEventService.js +47 -0
  46. package/dist/services/InputEventService.min.js +1 -0
  47. package/dist/services/KeyboardEventService.d.ts +70 -0
  48. package/dist/services/KeyboardEventService.js +86 -0
  49. package/dist/services/KeyboardEventService.min.js +1 -0
  50. package/dist/services/MouseEventService.d.ts +80 -0
  51. package/dist/services/MouseEventService.js +108 -0
  52. package/dist/services/MouseEventService.min.js +1 -0
  53. package/dist/services/PointerEventService.d.ts +51 -0
  54. package/dist/services/PointerEventService.js +67 -0
  55. package/dist/services/PointerEventService.min.js +1 -0
  56. package/dist/services/UIEventService.d.ts +43 -0
  57. package/dist/services/UIEventService.js +42 -0
  58. package/dist/services/UIEventService.min.js +1 -0
  59. package/dist/simulate.d.ts +32 -0
  60. package/dist/simulate.js +115 -0
  61. package/dist/simulate.min.js +1 -0
  62. package/package.json +1 -1
@@ -20,6 +20,13 @@
20
20
  * @property {boolean} isDefault
21
21
  */
22
22
  class PseudoEventListener {
23
+ /**
24
+ * @param {string} eventType The type of event this listens for
25
+ * @param {Object} [options] The capture, once and passive options
26
+ * @param {Function} handleEvent The function which is called with the event, already bound to what it should run as
27
+ * @param {Function} [originalCallback=handleEvent] The function (or object) which was given when registering, used to find this listener again
28
+ * @constructor
29
+ */
23
30
  constructor (eventType, {
24
31
  capture = false,
25
32
  once = false,
@@ -32,6 +39,7 @@
32
39
  }
33
40
  this.eventType = ''
34
41
  this.defaultListener = false
42
+ this.isRemoved = false
35
43
  this.eventOptions = {
36
44
  capture,
37
45
  once,
@@ -49,6 +57,11 @@
49
57
  return this.originalCallback
50
58
  }
51
59
 
60
+ /** Whether this listener listens in the capture phase (and at the target) rather than in the bubble phase. */
61
+ get capture () {
62
+ return this.eventOptions.capture
63
+ }
64
+
52
65
  get isDefault () {
53
66
  return this.defaultListener
54
67
  }
@@ -57,6 +70,20 @@
57
70
  return this.eventOptions.once
58
71
  }
59
72
 
73
+ /** Whether the listener promises not to prevent the default (preventDefault does nothing while it runs). */
74
+ get passive () {
75
+ return this.eventOptions.passive
76
+ }
77
+
78
+ /** Whether this listener has been removed, a removed listener does not run even if the event already started. */
79
+ get removed () {
80
+ return this.isRemoved
81
+ }
82
+
83
+ set removed (removed) {
84
+ this.isRemoved = removed
85
+ }
86
+
60
87
  /**
61
88
  * @method
62
89
  * @name PseudoEventListener#handleEvent
@@ -68,6 +95,7 @@
68
95
  }
69
96
 
70
97
  /**
98
+ * A capture listener runs while the event travels down to the target.
71
99
  * @method
72
100
  * @name PseudoEventListener#doCapturePhase
73
101
  * @param {PseudoEvent} event
@@ -78,6 +106,7 @@
78
106
  }
79
107
 
80
108
  /**
109
+ * Every listener of the target itself runs, capture listeners first.
81
110
  * @method
82
111
  * @name PseudoEventListener#doTargetPhase
83
112
  * @param {PseudoEvent} event
@@ -88,13 +117,14 @@
88
117
  }
89
118
 
90
119
  /**
120
+ * A listener which is not a capture listener runs while the event travels back up (when it bubbles).
91
121
  * @method
92
122
  * @name PseudoEventListener#doBubblePhase
93
123
  * @param {PseudoEvent} event
94
- * @returns {boolean|*}
124
+ * @returns {boolean}
95
125
  */
96
126
  doBubblePhase (event) {
97
- return event.eventPhase === EventService_1.EventService.BUBBLING_PHASE && (event.bubbles || !this.eventOptions.capture)
127
+ return event.eventPhase === EventService_1.EventService.BUBBLING_PHASE && !this.eventOptions.capture
98
128
  }
99
129
 
100
130
  /**
@@ -108,47 +138,20 @@
108
138
  }
109
139
 
110
140
  /**
111
- * @method
112
- * @name PseudoEventListener#skipDefault
113
- * @param {PseudoEvent} event
114
- * @returns {boolean|*}
115
- */
116
- skipDefault (event) {
117
- return this.isDefault && event.defaultPrevented
118
- }
119
-
120
- /**
121
- * @method
122
- * @name PseudoEventListener#stopPropagation
123
- * @param {PseudoEvent} event
124
- * @returns {boolean}
125
- */
126
- stopPropagation (event) {
127
- return !this.doTargetPhase(event) && event.inner.propagationStopped
128
- }
129
-
130
- /**
131
- * @method
132
- * @name PseudoEventListener#nonPassiveHalt
133
- * @param {PseudoEvent} event
134
- * @returns {boolean|*}
135
- */
136
- nonPassiveHalt (event) {
137
- return !this.eventOptions.passive && (this.skipDefault(event) || event.inner.immediatePropagationStopped || this.stopPropagation(event))
138
- }
139
-
140
- /**
141
+ * Whether this listener should not run for the event as it is now (it was removed, or it is for another phase).
142
+ * Stopping propagation is handled by the dispatching, since it stops other targets and not the listeners of the
143
+ * current one.
141
144
  * @method
142
145
  * @name PseudoEventListener#rejectEvent
143
146
  * @param {PseudoEvent} event
144
- * @returns {*|boolean}
147
+ * @returns {boolean}
145
148
  */
146
149
  rejectEvent (event) {
147
- return this.nonPassiveHalt(event) || this.skipPhase(event)
150
+ return this.isRemoved || this.skipPhase(event)
148
151
  }
149
152
  }
150
153
  exports.default = PseudoEventListener
151
- }, { '../services/EventService': 12 }],
154
+ }, { '../services/EventService': 17 }],
152
155
  2: [function (require, module, exports) {
153
156
  'use strict'
154
157
 
@@ -216,7 +219,7 @@
216
219
  }
217
220
  }
218
221
  exports.default = PseudoHTMLDocument
219
- }, { '../services/HTMLElementService': 14 }],
222
+ }, { '../services/HTMLElementService': 20 }],
220
223
  3: [function (require, module, exports) {
221
224
  'use strict'
222
225
 
@@ -289,10 +292,175 @@
289
292
  }
290
293
  }
291
294
  exports.PseudoNodeList = PseudoNodeList
292
- }, { 'collect-your-stuff/dist/collections/linked-tree-list/LinkedTreeList': 23, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.map.js': 134 }],
295
+ }, { 'collect-your-stuff/dist/collections/linked-tree-list/LinkedTreeList': 35, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.map.js': 148 }],
293
296
  4: [function (require, module, exports) {
294
297
  'use strict'
295
298
 
299
+ Object.defineProperty(exports, '__esModule', {
300
+ value: true
301
+ })
302
+ exports.createEvent = void 0
303
+ const EventService_1 = require('../services/EventService')
304
+ const UIEventService_1 = require('../services/UIEventService')
305
+ const MouseEventService_1 = require('../services/MouseEventService')
306
+ const PointerEventService_1 = require('../services/PointerEventService')
307
+ const KeyboardEventService_1 = require('../services/KeyboardEventService')
308
+ const FocusEventService_1 = require('../services/FocusEventService')
309
+ const InputEventService_1 = require('../services/InputEventService')
310
+ const CustomEventService_1 = require('../services/CustomEventService')
311
+ const eventDefaults_1 = require('./eventDefaults')
312
+ const eventClasses = {
313
+ Event: EventService_1.EventService,
314
+ UIEvent: UIEventService_1.UIEventService,
315
+ MouseEvent: MouseEventService_1.MouseEventService,
316
+ PointerEvent: PointerEventService_1.PointerEventService,
317
+ KeyboardEvent: KeyboardEventService_1.KeyboardEventService,
318
+ FocusEvent: FocusEventService_1.FocusEventService,
319
+ InputEvent: InputEventService_1.InputEventService,
320
+ CustomEvent: CustomEventService_1.CustomEventService
321
+ }
322
+ /**
323
+ * Create an event of the kind which suits its type (a click is a MouseEvent, a keydown a KeyboardEvent, ...).
324
+ * By default this is like using the constructor of the event in a script: nothing bubbles or can be cancelled unless
325
+ * the init says so, and the event is not trusted. With browser: true the event is created the way the browser creates
326
+ * it, using the standard options for its type (see eventDefaults), and trusted: true makes it look like it came from a
327
+ * real user action (isTrusted).
328
+ * @function createEvent
329
+ * @param {string} type The type of the event, such as click
330
+ * @param {Object} [init={}] The options for the event (bubbles, cancelable, composed and those of its kind of event)
331
+ * @param {CreateEventOptions} [options={}] Whether the browser is creating the event, and whether it is trusted
332
+ * @returns {EventService}
333
+ */
334
+ const createEvent = (type, init = {}, {
335
+ browser = false,
336
+ trusted = false
337
+ } = {}) => {
338
+ const definition = eventDefaults_1.eventDefaults[type]
339
+ const options = browser && definition
340
+ ? Object.assign({
341
+ bubbles: definition.bubbles,
342
+ cancelable: definition.cancelable,
343
+ composed: definition.composed
344
+ }, init)
345
+ : init
346
+ const EventClass = eventClasses[definition ? definition.interface : 'Event']
347
+ const event = new EventClass(type, options)
348
+ event.inner.trusted = trusted
349
+ return event
350
+ }
351
+ exports.createEvent = createEvent
352
+ exports.default = exports.createEvent
353
+ }, { '../services/CustomEventService': 14, '../services/EventService': 17, '../services/FocusEventService': 19, '../services/InputEventService': 21, '../services/KeyboardEventService': 22, '../services/MouseEventService': 23, '../services/PointerEventService': 26, '../services/UIEventService': 27, './eventDefaults': 5 }],
354
+ 5: [function (require, module, exports) {
355
+ 'use strict'
356
+
357
+ /**
358
+ * @file The standard event types of the browser, and how the browser creates them.
359
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
360
+ * @version 1.0.0
361
+ */
362
+ Object.defineProperty(exports, '__esModule', {
363
+ value: true
364
+ })
365
+ exports.eventDefaults = void 0
366
+ const define = (bubbles, cancelable, composed, eventInterface = 'Event') => ({
367
+ bubbles,
368
+ cancelable,
369
+ composed,
370
+ interface: eventInterface
371
+ })
372
+ /**
373
+ * The events which the browser itself creates (for a user action, or for something like element.click()) have these
374
+ * options. A script which creates an event with the constructor gets none of them (everything is false) unless it asks
375
+ * for them, which is why createEvent only uses this table when it is told the browser is creating the event.
376
+ * The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop, Touch and CSS specifications.
377
+ * @type {Object.<string, EventDefinition>}
378
+ */
379
+ exports.eventDefaults = {
380
+ // Mouse (UI Events)
381
+ click: define(true, true, true, 'MouseEvent'),
382
+ auxclick: define(true, true, true, 'MouseEvent'),
383
+ dblclick: define(true, true, true, 'MouseEvent'),
384
+ contextmenu: define(true, true, true, 'MouseEvent'),
385
+ mousedown: define(true, true, true, 'MouseEvent'),
386
+ mouseup: define(true, true, true, 'MouseEvent'),
387
+ mousemove: define(true, true, true, 'MouseEvent'),
388
+ mouseover: define(true, true, true, 'MouseEvent'),
389
+ mouseout: define(true, true, true, 'MouseEvent'),
390
+ mouseenter: define(false, false, true, 'MouseEvent'),
391
+ mouseleave: define(false, false, true, 'MouseEvent'),
392
+ wheel: define(true, true, true, 'MouseEvent'),
393
+ // Pointer (Pointer Events)
394
+ pointerdown: define(true, true, true, 'PointerEvent'),
395
+ pointerup: define(true, true, true, 'PointerEvent'),
396
+ pointermove: define(true, true, true, 'PointerEvent'),
397
+ pointerover: define(true, true, true, 'PointerEvent'),
398
+ pointerout: define(true, true, true, 'PointerEvent'),
399
+ pointerenter: define(false, false, true, 'PointerEvent'),
400
+ pointerleave: define(false, false, true, 'PointerEvent'),
401
+ pointercancel: define(true, false, true, 'PointerEvent'),
402
+ gotpointercapture: define(true, false, true, 'PointerEvent'),
403
+ lostpointercapture: define(true, false, true, 'PointerEvent'),
404
+ // Keyboard (UI Events)
405
+ keydown: define(true, true, true, 'KeyboardEvent'),
406
+ keypress: define(true, true, true, 'KeyboardEvent'),
407
+ keyup: define(true, true, true, 'KeyboardEvent'),
408
+ // Focus (UI Events): focus and blur do not bubble, focusin and focusout do
409
+ focus: define(false, false, true, 'FocusEvent'),
410
+ blur: define(false, false, true, 'FocusEvent'),
411
+ focusin: define(true, false, true, 'FocusEvent'),
412
+ focusout: define(true, false, true, 'FocusEvent'),
413
+ // Forms (HTML, Input Events)
414
+ beforeinput: define(true, true, true, 'InputEvent'),
415
+ input: define(true, false, true, 'InputEvent'),
416
+ change: define(true, false, false),
417
+ select: define(true, false, false),
418
+ submit: define(true, true, false),
419
+ reset: define(true, true, false),
420
+ invalid: define(false, true, false),
421
+ toggle: define(false, false, false),
422
+ // Loading and the page (HTML)
423
+ load: define(false, false, false),
424
+ error: define(false, false, false),
425
+ abort: define(false, false, false),
426
+ scroll: define(false, false, false),
427
+ scrollend: define(false, false, false),
428
+ resize: define(false, false, false),
429
+ DOMContentLoaded: define(true, false, false),
430
+ readystatechange: define(false, false, false),
431
+ visibilitychange: define(true, false, false),
432
+ // Clipboard
433
+ copy: define(true, true, true),
434
+ cut: define(true, true, true),
435
+ paste: define(true, true, true),
436
+ // Drag and drop
437
+ drag: define(true, true, true, 'MouseEvent'),
438
+ dragstart: define(true, true, true, 'MouseEvent'),
439
+ dragend: define(true, false, true, 'MouseEvent'),
440
+ dragenter: define(true, true, true, 'MouseEvent'),
441
+ dragover: define(true, true, true, 'MouseEvent'),
442
+ dragleave: define(true, false, true, 'MouseEvent'),
443
+ drop: define(true, true, true, 'MouseEvent'),
444
+ // Touch
445
+ touchstart: define(true, true, true, 'UIEvent'),
446
+ touchmove: define(true, true, true, 'UIEvent'),
447
+ touchend: define(true, true, true, 'UIEvent'),
448
+ touchcancel: define(true, false, true, 'UIEvent'),
449
+ // Animations and transitions (CSS)
450
+ animationstart: define(true, false, false),
451
+ animationiteration: define(true, false, false),
452
+ animationend: define(true, false, false),
453
+ animationcancel: define(true, false, false),
454
+ transitionrun: define(true, false, false),
455
+ transitionstart: define(true, false, false),
456
+ transitionend: define(true, false, false),
457
+ transitioncancel: define(true, false, false)
458
+ }
459
+ exports.default = exports.eventDefaults
460
+ }, {}],
461
+ 6: [function (require, module, exports) {
462
+ 'use strict'
463
+
296
464
  const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
297
465
  return mod && mod.__esModule
298
466
  ? mod
@@ -356,8 +524,8 @@
356
524
  return context ? Object.assign(context, newWindow) : Object.assign(root, newWindow)
357
525
  }
358
526
  exports.default = generateDocument
359
- }, { '../classes/PseudoHTMLDocument': 2, '../services/ElementService': 11, '../services/EventTargetService': 13, '../services/HTMLElementService': 14, '../services/NodeService': 16 }],
360
- 5: [function (require, module, exports) {
527
+ }, { '../classes/PseudoHTMLDocument': 2, '../services/ElementService': 16, '../services/EventTargetService': 18, '../services/HTMLElementService': 20, '../services/NodeService': 25 }],
528
+ 7: [function (require, module, exports) {
361
529
  'use strict'
362
530
 
363
531
  Object.defineProperty(exports, '__esModule', {
@@ -372,7 +540,42 @@
372
540
  const generateNodeList = (innerList = null) => new PseudoNodeList_1.PseudoNodeList().initialize(innerList)
373
541
  exports.default = generateNodeList
374
542
  }, { '../classes/PseudoNodeList': 3 }],
375
- 6: [function (require, module, exports) {
543
+ 8: [function (require, module, exports) {
544
+ 'use strict'
545
+
546
+ require('core-js/modules/esnext.weak-map.delete-all.js')
547
+ Object.defineProperty(exports, '__esModule', {
548
+ value: true
549
+ })
550
+ exports.setActiveElement = exports.getActiveElement = void 0
551
+ /**
552
+ * The element which has the focus, kept for each tree (the root node of the tree it is in), like document.activeElement.
553
+ */
554
+ const focused = new WeakMap()
555
+ /**
556
+ * Find the element which has the focus in a tree.
557
+ * @function getActiveElement
558
+ * @param {Object} root The root node of the tree
559
+ * @returns {Object|null}
560
+ */
561
+ const getActiveElement = root => focused.get(root) || null
562
+ exports.getActiveElement = getActiveElement
563
+ /**
564
+ * Remember the element which has the focus in a tree.
565
+ * @function setActiveElement
566
+ * @param {Object} root The root node of the tree
567
+ * @param {Object|null} element The element which now has the focus, or null when nothing has it
568
+ */
569
+ const setActiveElement = (root, element) => {
570
+ if (element === null) {
571
+ focused.delete(root)
572
+ } else {
573
+ focused.set(root, element)
574
+ }
575
+ }
576
+ exports.setActiveElement = setActiveElement
577
+ }, { 'core-js/modules/esnext.weak-map.delete-all.js': 151 }],
578
+ 9: [function (require, module, exports) {
376
579
  'use strict'
377
580
 
378
581
  Object.defineProperty(exports, '__esModule', {
@@ -396,7 +599,7 @@
396
599
  }
397
600
  exports.default = getParentNodes
398
601
  }, {}],
399
- 7: [function (require, module, exports) {
602
+ 10: [function (require, module, exports) {
400
603
  'use strict'
401
604
 
402
605
  require('core-js/modules/esnext.iterator.constructor.js')
@@ -426,8 +629,51 @@
426
629
  return (0, getParentNodes_1.default)(node).filter(parent => (parent[attr] || false) === value)
427
630
  }
428
631
  exports.default = getParentNodesFromAttribute
429
- }, { './getParentNodes': 6, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.filter.js': 131 }],
430
- 8: [function (require, module, exports) {
632
+ }, { './getParentNodes': 9, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.filter.js': 145 }],
633
+ 11: [function (require, module, exports) {
634
+ 'use strict'
635
+
636
+ Object.defineProperty(exports, '__esModule', {
637
+ value: true
638
+ })
639
+ exports.modifierState = exports.modifierKeys = void 0
640
+ /**
641
+ * Pick the modifier keys out of the init object of an event.
642
+ * @function modifierKeys
643
+ * @param {Object} [init={}] The init of an event
644
+ * @returns {ModifierKeys}
645
+ */
646
+ const modifierKeys = (init = {}) => ({
647
+ ctrlKey: !!init.ctrlKey,
648
+ shiftKey: !!init.shiftKey,
649
+ altKey: !!init.altKey,
650
+ metaKey: !!init.metaKey
651
+ })
652
+ exports.modifierKeys = modifierKeys
653
+ /**
654
+ * Answer getModifierState for a set of held modifier keys.
655
+ * @function modifierState
656
+ * @param {ModifierKeys} keys The modifier keys which were held down
657
+ * @param {string} key The name of the modifier (Control, Shift, Alt or Meta)
658
+ * @returns {boolean}
659
+ */
660
+ const modifierState = (keys, key) => {
661
+ switch (key) {
662
+ case 'Control':
663
+ return keys.ctrlKey
664
+ case 'Shift':
665
+ return keys.shiftKey
666
+ case 'Alt':
667
+ return keys.altKey
668
+ case 'Meta':
669
+ return keys.metaKey
670
+ default:
671
+ return false
672
+ }
673
+ }
674
+ exports.modifierState = modifierState
675
+ }, {}],
676
+ 12: [function (require, module, exports) {
431
677
  'use strict'
432
678
 
433
679
  /**
@@ -445,7 +691,7 @@
445
691
  Object.defineProperty(exports, '__esModule', {
446
692
  value: true
447
693
  })
448
- exports.PseudoHTMLDocument = exports.PseudoHTMLElement = exports.PseudoElement = exports.PseudoNode = exports.PseudoEventTarget = exports.PseudoEvent = exports.generateDocument = void 0
694
+ exports.PseudoHTMLDocument = exports.PseudoHTMLElement = exports.PseudoElement = exports.PseudoNode = exports.PseudoEventTarget = exports.PseudoCustomEvent = exports.PseudoInputEvent = exports.PseudoFocusEvent = exports.PseudoKeyboardEvent = exports.PseudoPointerEvent = exports.PseudoMouseEvent = exports.PseudoUIEvent = exports.PseudoEvent = exports.simulate = exports.eventDefaults = exports.createEvent = exports.generateDocument = void 0
449
695
  const EventService_1 = require('./services/EventService')
450
696
  Object.defineProperty(exports, 'PseudoEvent', {
451
697
  enumerable: true,
@@ -480,6 +726,61 @@
480
726
  exports.PseudoHTMLDocument = PseudoHTMLDocument_1.default
481
727
  const generateDocument_1 = __importDefault(require('./factories/generateDocument'))
482
728
  exports.generateDocument = generateDocument_1.default
729
+ const createEvent_1 = __importDefault(require('./factories/createEvent'))
730
+ exports.createEvent = createEvent_1.default
731
+ const eventDefaults_1 = __importDefault(require('./factories/eventDefaults'))
732
+ exports.eventDefaults = eventDefaults_1.default
733
+ const UIEventService_1 = require('./services/UIEventService')
734
+ Object.defineProperty(exports, 'PseudoUIEvent', {
735
+ enumerable: true,
736
+ get: function () {
737
+ return UIEventService_1.UIEventService
738
+ }
739
+ })
740
+ const MouseEventService_1 = require('./services/MouseEventService')
741
+ Object.defineProperty(exports, 'PseudoMouseEvent', {
742
+ enumerable: true,
743
+ get: function () {
744
+ return MouseEventService_1.MouseEventService
745
+ }
746
+ })
747
+ const PointerEventService_1 = require('./services/PointerEventService')
748
+ Object.defineProperty(exports, 'PseudoPointerEvent', {
749
+ enumerable: true,
750
+ get: function () {
751
+ return PointerEventService_1.PointerEventService
752
+ }
753
+ })
754
+ const KeyboardEventService_1 = require('./services/KeyboardEventService')
755
+ Object.defineProperty(exports, 'PseudoKeyboardEvent', {
756
+ enumerable: true,
757
+ get: function () {
758
+ return KeyboardEventService_1.KeyboardEventService
759
+ }
760
+ })
761
+ const FocusEventService_1 = require('./services/FocusEventService')
762
+ Object.defineProperty(exports, 'PseudoFocusEvent', {
763
+ enumerable: true,
764
+ get: function () {
765
+ return FocusEventService_1.FocusEventService
766
+ }
767
+ })
768
+ const InputEventService_1 = require('./services/InputEventService')
769
+ Object.defineProperty(exports, 'PseudoInputEvent', {
770
+ enumerable: true,
771
+ get: function () {
772
+ return InputEventService_1.InputEventService
773
+ }
774
+ })
775
+ const CustomEventService_1 = require('./services/CustomEventService')
776
+ Object.defineProperty(exports, 'PseudoCustomEvent', {
777
+ enumerable: true,
778
+ get: function () {
779
+ return CustomEventService_1.CustomEventService
780
+ }
781
+ })
782
+ const simulate_1 = __importDefault(require('./simulate'))
783
+ exports.simulate = simulate_1.default
483
784
  /**
484
785
  * All methods exported from this module are encapsulated within pseudoDom.
485
786
  * @author Joshua Heagle <joshuaheagle@gmail.com>
@@ -488,7 +789,17 @@
488
789
  */
489
790
  const pseudoDom = {
490
791
  generateDocument: generateDocument_1.default,
792
+ createEvent: createEvent_1.default,
793
+ eventDefaults: eventDefaults_1.default,
794
+ simulate: simulate_1.default,
491
795
  PseudoEvent: EventService_1.EventService,
796
+ PseudoUIEvent: UIEventService_1.UIEventService,
797
+ PseudoMouseEvent: MouseEventService_1.MouseEventService,
798
+ PseudoPointerEvent: PointerEventService_1.PointerEventService,
799
+ PseudoKeyboardEvent: KeyboardEventService_1.KeyboardEventService,
800
+ PseudoFocusEvent: FocusEventService_1.FocusEventService,
801
+ PseudoInputEvent: InputEventService_1.InputEventService,
802
+ PseudoCustomEvent: CustomEventService_1.CustomEventService,
492
803
  PseudoEventTarget: EventTargetService_1.default,
493
804
  PseudoNode: NodeService_1.NodeService,
494
805
  PseudoElement: ElementService_1.ElementService,
@@ -503,8 +814,8 @@
503
814
  // @ts-ignore
504
815
  window.pseudoDom = pseudoDom
505
816
  }
506
- }, { './classes/PseudoHTMLDocument': 2, './factories/generateDocument': 4, './services/ElementService': 11, './services/EventService': 12, './services/EventTargetService': 13, './services/HTMLElementService': 14, './services/NodeService': 16 }],
507
- 9: [function (require, module, exports) {
817
+ }, { './classes/PseudoHTMLDocument': 2, './factories/createEvent': 4, './factories/eventDefaults': 5, './factories/generateDocument': 6, './services/CustomEventService': 14, './services/ElementService': 16, './services/EventService': 17, './services/EventTargetService': 18, './services/FocusEventService': 19, './services/HTMLElementService': 20, './services/InputEventService': 21, './services/KeyboardEventService': 22, './services/MouseEventService': 23, './services/NodeService': 25, './services/PointerEventService': 26, './services/UIEventService': 27, './simulate': 28 }],
818
+ 13: [function (require, module, exports) {
508
819
  'use strict'
509
820
 
510
821
  Object.defineProperty(exports, '__esModule', {
@@ -562,8 +873,45 @@
562
873
  }
563
874
  }
564
875
  exports.AttrService = AttrService
565
- }, { './NodeService': 16 }],
566
- 10: [function (require, module, exports) {
876
+ }, { './NodeService': 25 }],
877
+ 14: [function (require, module, exports) {
878
+ 'use strict'
879
+
880
+ Object.defineProperty(exports, '__esModule', {
881
+ value: true
882
+ })
883
+ exports.CustomEventService = void 0
884
+ /**
885
+ * @file Substitute for the DOM CustomEvent Class.
886
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
887
+ * @version 1.0.0
888
+ */
889
+ const EventService_1 = require('./EventService')
890
+ /**
891
+ * Simulate the behaviour of the CustomEvent Class when there is no DOM available: an event which carries data.
892
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
893
+ * @class
894
+ * @augments EventService
895
+ * @property {*} detail
896
+ */
897
+ class CustomEventService extends EventService_1.EventService {
898
+ /**
899
+ * @param {string} [typeArg=''] The type of the event
900
+ * @param {CustomEventInit} [init={}] The options for the event
901
+ * @constructor
902
+ */
903
+ constructor (typeArg = '', init = {}) {
904
+ super(typeArg, init)
905
+ this.eventDetail = typeof init.detail === 'undefined' ? null : init.detail
906
+ }
907
+
908
+ get detail () {
909
+ return this.eventDetail
910
+ }
911
+ }
912
+ exports.CustomEventService = CustomEventService
913
+ }, { './EventService': 17 }],
914
+ 15: [function (require, module, exports) {
567
915
  'use strict'
568
916
 
569
917
  require('core-js/modules/esnext.iterator.constructor.js')
@@ -681,8 +1029,8 @@
681
1029
  }
682
1030
  }
683
1031
  exports.DOMTokenListService = DOMTokenListService
684
- }, { 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.filter.js': 131, 'core-js/modules/esnext.iterator.for-each.js': 133, 'core-js/modules/esnext.iterator.map.js': 134 }],
685
- 11: [function (require, module, exports) {
1032
+ }, { 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.filter.js': 145, 'core-js/modules/esnext.iterator.for-each.js': 147, 'core-js/modules/esnext.iterator.map.js': 148 }],
1033
+ 16: [function (require, module, exports) {
686
1034
  'use strict'
687
1035
 
688
1036
  require('core-js/modules/esnext.iterator.constructor.js')
@@ -701,6 +1049,7 @@
701
1049
  value: true
702
1050
  })
703
1051
  exports.ElementService = void 0
1052
+ const createEvent_1 = __importDefault(require('../factories/createEvent'))
704
1053
  const NodeService_1 = require('./NodeService')
705
1054
  const AttrService_1 = require('./AttrService')
706
1055
  const DOMTokenListService_1 = require('./DOMTokenListService')
@@ -737,6 +1086,7 @@
737
1086
  children = []
738
1087
  } = {}) {
739
1088
  super()
1089
+ this.defaultEventApplied = false
740
1090
  this.tokenList = new DOMTokenListService_1.DOMTokenListService()
741
1091
  this.tag = tagName
742
1092
  this.attributeList = attributes.concat([{
@@ -802,21 +1152,26 @@
802
1152
  */
803
1153
  applyDefaultEvent () {
804
1154
  let callback = event => undefined
1155
+ if (this.defaultEventApplied) {
1156
+ return callback
1157
+ }
805
1158
  switch (this.tagName) {
806
- case 'form':
807
- this.addEventListener('submit', callback)
808
- break
809
1159
  case 'button':
810
1160
  case 'input':
811
- if (/^(submit|image)$/i.test(this.type || '')) {
812
- callback = event => {
813
- const forms = (0, getParentNodesFromAttribute_1.default)('tagName', 'form', this)
814
- if (forms.length) {
815
- forms[0].submit()
816
- }
1161
+ // Clicking a submit button submits the form it is in: the form gets a submit event, which can be cancelled
1162
+ callback = event => {
1163
+ const type = String(this.getAttribute('type') || this.type || '').toLowerCase()
1164
+ const submits = this.tagName === 'button' ? type !== 'button' && type !== 'reset' : /^(submit|image)$/.test(type)
1165
+ const forms = (0, getParentNodesFromAttribute_1.default)('tagName', 'form', this)
1166
+ if (submits && forms.length && !this.hasAttribute('disabled')) {
1167
+ forms[forms.length - 1].dispatchEvent((0, createEvent_1.default)('submit', {}, {
1168
+ browser: true,
1169
+ trusted: event.isTrusted
1170
+ }))
817
1171
  }
818
- super.setDefaultEvent('click', callback)
819
1172
  }
1173
+ super.setDefaultEvent('click', callback)
1174
+ this.defaultEventApplied = true
820
1175
  }
821
1176
  return callback
822
1177
  }
@@ -892,8 +1247,8 @@
892
1247
  }
893
1248
  }
894
1249
  exports.ElementService = ElementService
895
- }, { '../functions/getParentNodesFromAttribute': 7, './AttrService': 9, './DOMTokenListService': 10, './NamedNodeMapService': 15, './NodeService': 16, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.find.js': 132, 'core-js/modules/esnext.iterator.for-each.js': 133, 'core-js/modules/esnext.iterator.map.js': 134, 'core-js/modules/esnext.iterator.some.js': 136 }],
896
- 12: [function (require, module, exports) {
1250
+ }, { '../factories/createEvent': 4, '../functions/getParentNodesFromAttribute': 10, './AttrService': 13, './DOMTokenListService': 15, './NamedNodeMapService': 24, './NodeService': 25, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.find.js': 146, 'core-js/modules/esnext.iterator.for-each.js': 147, 'core-js/modules/esnext.iterator.map.js': 148, 'core-js/modules/esnext.iterator.some.js': 150 }],
1251
+ 17: [function (require, module, exports) {
897
1252
  'use strict'
898
1253
 
899
1254
  /**
@@ -901,18 +1256,10 @@
901
1256
  * @author Joshua Heagle <joshuaheagle@gmail.com>
902
1257
  * @version 1.0.0
903
1258
  */
904
- const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
905
- return mod && mod.__esModule
906
- ? mod
907
- : {
908
- default: mod
909
- }
910
- }
911
1259
  Object.defineProperty(exports, '__esModule', {
912
1260
  value: true
913
1261
  })
914
1262
  exports.EventService = void 0
915
- const getParentNodes_1 = __importDefault(require('../functions/getParentNodes'))
916
1263
  /**
917
1264
  * Simulate the behaviour of the Event Class when there is no DOM available.
918
1265
  * @author Joshua Heagle <joshuaheagle@gmail.com>
@@ -947,20 +1294,20 @@
947
1294
  *
948
1295
  * @param {string} typeArg
949
1296
  * @param {Object} [eventOptions={}]
950
- * @param {boolean} [eventOptions.bubbles=true]
951
- * @param {boolean} [eventOptions.cancelable=true]
952
- * @param {boolean} [eventOptions.composed=true]
1297
+ * @param {boolean} [eventOptions.bubbles=false]
1298
+ * @param {boolean} [eventOptions.cancelable=false]
1299
+ * @param {boolean} [eventOptions.composed=false]
953
1300
  * @constructor
954
1301
  */
955
1302
  constructor (typeArg = '', {
956
- bubbles = true,
957
- cancelable = true,
958
- composed = true
1303
+ bubbles = false,
1304
+ cancelable = false,
1305
+ composed = false
959
1306
  } = {}) {
960
1307
  this.properties = {
961
- bubbles: true,
962
- cancelable: true,
963
- composed: true,
1308
+ bubbles: false,
1309
+ cancelable: false,
1310
+ composed: false,
964
1311
  currentTarget: null,
965
1312
  defaultPrevented: false,
966
1313
  immediatePropagationStopped: false,
@@ -969,7 +1316,10 @@
969
1316
  target: null,
970
1317
  timeStamp: Math.floor(Date.now() / 1000),
971
1318
  type: '',
972
- isTrusted: true
1319
+ isTrusted: false,
1320
+ dispatching: false,
1321
+ inPassiveListener: false,
1322
+ path: []
973
1323
  }
974
1324
  this.setReadOnlyProperties({
975
1325
  type: typeArg,
@@ -1026,12 +1376,21 @@
1026
1376
  get inner () {
1027
1377
  const self = this
1028
1378
  return {
1379
+ get currentTarget () {
1380
+ return self.properties.currentTarget
1381
+ },
1029
1382
  set currentTarget (target) {
1030
1383
  self.properties.currentTarget = target
1031
1384
  },
1385
+ get eventPhase () {
1386
+ return self.properties.eventPhase
1387
+ },
1032
1388
  set eventPhase (phase) {
1033
1389
  self.properties.eventPhase = phase
1034
1390
  },
1391
+ get target () {
1392
+ return self.properties.target
1393
+ },
1035
1394
  set target (target) {
1036
1395
  self.properties.target = target
1037
1396
  },
@@ -1040,6 +1399,41 @@
1040
1399
  },
1041
1400
  get propagationStopped () {
1042
1401
  return self.properties.propagationStopped
1402
+ },
1403
+ get trusted () {
1404
+ return self.properties.isTrusted
1405
+ },
1406
+ set trusted (trusted) {
1407
+ self.properties.isTrusted = trusted
1408
+ },
1409
+ get dispatching () {
1410
+ return self.properties.dispatching
1411
+ },
1412
+ set dispatching (dispatching) {
1413
+ self.properties.dispatching = dispatching
1414
+ },
1415
+ get inPassiveListener () {
1416
+ return self.properties.inPassiveListener
1417
+ },
1418
+ set inPassiveListener (passive) {
1419
+ self.properties.inPassiveListener = passive
1420
+ },
1421
+ get path () {
1422
+ return self.properties.path
1423
+ },
1424
+ set path (path) {
1425
+ self.properties.path = path
1426
+ },
1427
+ finishDispatch () {
1428
+ self.setReadOnlyProperties({
1429
+ currentTarget: null,
1430
+ eventPhase: EventService.NONE,
1431
+ path: [],
1432
+ dispatching: false,
1433
+ inPassiveListener: false,
1434
+ propagationStopped: false,
1435
+ immediatePropagationStopped: false
1436
+ })
1043
1437
  }
1044
1438
  }
1045
1439
  }
@@ -1050,16 +1444,8 @@
1050
1444
  * @returns {Array.<PseudoEventTarget>}
1051
1445
  */
1052
1446
  composedPath () {
1053
- switch (this.eventPhase) {
1054
- case EventService.CAPTURING_PHASE:
1055
- return (0, getParentNodes_1.default)(this.target)
1056
- case EventService.BUBBLING_PHASE:
1057
- return (0, getParentNodes_1.default)(this.target).slice().reverse()
1058
- case EventService.AT_TARGET:
1059
- return [this.target]
1060
- default:
1061
- return []
1062
- }
1447
+ // While the event is being dispatched this is every target it travels through, the target first and the root last
1448
+ return this.properties.dispatching ? this.properties.path.slice() : []
1063
1449
  }
1064
1450
 
1065
1451
  /**
@@ -1068,9 +1454,12 @@
1068
1454
  * @returns {null}
1069
1455
  */
1070
1456
  preventDefault () {
1071
- this.setReadOnlyProperties({
1072
- defaultPrevented: true
1073
- })
1457
+ // Only an event which can be cancelled can be prevented, and a passive listener cannot prevent the default
1458
+ if (this.cancelable && !this.properties.inPassiveListener) {
1459
+ this.setReadOnlyProperties({
1460
+ defaultPrevented: true
1461
+ })
1462
+ }
1074
1463
  return null
1075
1464
  }
1076
1465
 
@@ -1110,14 +1499,16 @@
1110
1499
  EventService.CAPTURING_PHASE = 1
1111
1500
  EventService.AT_TARGET = 2
1112
1501
  EventService.BUBBLING_PHASE = 3
1113
- }, { '../functions/getParentNodes': 6 }],
1114
- 13: [function (require, module, exports) {
1502
+ }, {}],
1503
+ 18: [function (require, module, exports) {
1115
1504
  'use strict'
1116
1505
 
1117
1506
  require('core-js/modules/esnext.iterator.constructor.js')
1118
1507
  require('core-js/modules/esnext.iterator.filter.js')
1119
1508
  require('core-js/modules/esnext.iterator.find.js')
1120
1509
  require('core-js/modules/esnext.iterator.for-each.js')
1510
+ require('core-js/modules/esnext.iterator.map.js')
1511
+ require('core-js/modules/esnext.iterator.some.js')
1121
1512
  const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
1122
1513
  return mod && mod.__esModule
1123
1514
  ? mod
@@ -1135,9 +1526,13 @@
1135
1526
  */
1136
1527
  const EventService_1 = require('./EventService')
1137
1528
  const PseudoEventListener_1 = __importDefault(require('../classes/PseudoEventListener'))
1529
+ const getParentNodes_1 = __importDefault(require('../functions/getParentNodes'))
1138
1530
  const LinkedList_1 = require('collect-your-stuff/dist/collections/linked-list/LinkedList')
1139
1531
  /**
1140
1532
  * Simulate the behaviour of the EventTarget Class when there is no DOM available.
1533
+ * Dispatching an event sends it through the tree the way the DOM does: down from the root to the target (capture
1534
+ * listeners), to the target itself, then back up to the root (the listeners which are not capture listeners, when the
1535
+ * event bubbles).
1141
1536
  * @author Joshua Heagle <joshuaheagle@gmail.com>
1142
1537
  * @class
1143
1538
  * @property {Object.<string, Array.<PseudoEventListener>>} listeners
@@ -1167,33 +1562,51 @@
1167
1562
  }
1168
1563
 
1169
1564
  /**
1170
- * Run each of the listeners registered on this target for the type of the event.
1171
- * Listeners which do not apply to the event's phase are skipped, running stops once immediate propagation is stopped,
1172
- * and listeners added or removed while running do not change which ones run for this event.
1173
- * @param {EventService} event
1174
- * @returns {*} true when there was nothing registered, otherwise the last value returned from a handler (null when none ran)
1565
+ * Run the listeners registered on this target for the type of the event which apply to the phase the event is in
1566
+ * (at the target, the capture listeners run before the others). Listeners which are added while this runs do not run
1567
+ * for this event, and listeners which are removed while it runs no longer do. Running stops as soon as immediate
1568
+ * propagation is stopped. A listener which throws does not stop the others.
1569
+ * @param {EventService} event The event, which is at a phase and has a current target
1570
+ * @returns {Array<*>} The errors which the listeners threw
1175
1571
  */
1176
1572
  runEvents (event) {
1573
+ const errors = []
1177
1574
  if (!(event.type in this.listeners)) {
1178
- return true
1575
+ return errors
1179
1576
  }
1180
- const listeners = this.listeners[event.type]
1181
- let eventReturn = null
1182
- // Work from a copy of the linkers so that removing a listener (for example a once listener) does not disturb the walk
1183
- for (const linker of Array.from(listeners)) {
1184
- const listener = linker.data
1577
+ const listeners = Array.from(this.listeners[event.type]).map(linker => linker.data)
1578
+ // At the target the capture listeners come first, otherwise the order is the order they were added
1579
+ const ordered = event.eventPhase === EventService_1.EventService.AT_TARGET ? listeners.filter(listener => listener.capture).concat(listeners.filter(listener => !listener.capture)) : listeners
1580
+ for (const listener of ordered) {
1185
1581
  if (event.inner.immediatePropagationStopped) {
1186
1582
  break
1187
1583
  }
1188
1584
  if (listener.rejectEvent(event)) {
1189
1585
  continue
1190
1586
  }
1191
- eventReturn = listener.handleEvent(event)
1192
1587
  if (listener.once) {
1193
- listeners.remove(linker)
1588
+ this.removeListener(event.type, listener)
1589
+ }
1590
+ event.inner.inPassiveListener = listener.passive
1591
+ try {
1592
+ listener.handleEvent(event)
1593
+ } catch (error) {
1594
+ errors.push(error)
1194
1595
  }
1596
+ event.inner.inPassiveListener = false
1195
1597
  }
1196
- return eventReturn
1598
+ return errors
1599
+ }
1600
+
1601
+ /**
1602
+ * Take a listener out of the registered listeners, so that it does not run again.
1603
+ * @param {string} type
1604
+ * @param {PseudoEventListener} listener
1605
+ */
1606
+ removeListener (type, listener) {
1607
+ listener.removed = true
1608
+ const registered = this.listeners[type]
1609
+ Array.from(registered).filter(linker => linker.data === listener).forEach(linker => registered.remove(linker))
1197
1610
  }
1198
1611
 
1199
1612
  /**
@@ -1206,48 +1619,34 @@
1206
1619
  this.defaultEvent[type] = callback
1207
1620
  }
1208
1621
 
1209
- runDefaultEvent (event) {
1210
- if (event.defaultPrevented) {
1211
- return false
1212
- }
1213
- this.defaultEvent[event.type](event)
1214
- return true
1215
- }
1216
-
1217
- startEvents (eventType) {
1218
- const event = new EventService_1.EventService(eventType)
1219
- event.inner.target = this;
1220
- [EventService_1.EventService.CAPTURING_PHASE, EventService_1.EventService.AT_TARGET, EventService_1.EventService.BUBBLING_PHASE].forEach(phase => {
1221
- let continueEvents = null
1222
- if (phase === EventService_1.EventService.AT_TARGET || !event.inner.propagationStopped) {
1223
- event.inner.eventPhase = phase
1224
- event.composedPath().forEach(target => {
1225
- event.inner.currentTarget = target
1226
- continueEvents = event.currentTarget.runEvents(event)
1227
- })
1228
- }
1229
- if (event.eventPhase === EventService_1.EventService.AT_TARGET && typeof continueEvents !== 'boolean' && this.defaultEvent[eventType]) {
1230
- this.runDefaultEvent(event)
1231
- }
1232
- })
1233
- return true
1234
- }
1235
-
1622
+ /**
1623
+ * Registers an event handler of a specific event type. Adding the same handler again for the same type and phase does
1624
+ * nothing, like the DOM.
1625
+ * @param {string} type The type of event to listen for
1626
+ * @param {Function|Object} callback The function to call (or an object with a handleEvent function)
1627
+ * @param {Object|boolean} [useCapture=false] Listen while the event travels down to the target (true), or an object with capture, once and passive
1628
+ */
1236
1629
  addEventListener (type, callback, useCapture = false) {
1237
1630
  let options = {
1238
1631
  capture: false,
1239
1632
  once: false,
1240
1633
  passive: false
1241
1634
  }
1242
- if (typeof useCapture === 'object') {
1635
+ if (typeof useCapture === 'object' && useCapture !== null) {
1243
1636
  // Originally useCapture was a single boolean flag, later optional other flags can be used
1244
1637
  // Here we take all the given flags from the object and assign them as the options
1245
1638
  options = Object.assign(options, useCapture)
1246
1639
  } else {
1247
- options.capture = useCapture
1640
+ options.capture = !!useCapture
1248
1641
  }
1249
- const listener = new PseudoEventListener_1.default(type, options, (callback.handleEvent || callback).bind(this), callback)
1250
1642
  const listeners = this.listenersFor(type)
1643
+ const alreadyAdded = Array.from(listeners).some(linker => linker.data.callback === callback && linker.data.capture === options.capture)
1644
+ if (alreadyAdded) {
1645
+ return
1646
+ }
1647
+ // A function runs with this target as this, an object runs its handleEvent as itself
1648
+ const handler = typeof callback === 'function' ? callback.bind(this) : callback.handleEvent.bind(callback)
1649
+ const listener = new PseudoEventListener_1.default(type, options, handler, callback)
1251
1650
  // Listeners run in the order they were added, except that listeners which are not defaults always come before the defaults
1252
1651
  const firstDefault = Array.from(listeners).find(linker => linker.data.isDefault)
1253
1652
  if (firstDefault && !listener.isDefault) {
@@ -1257,33 +1656,138 @@
1257
1656
  }
1258
1657
  }
1259
1658
 
1260
- removeEventListener (type, callback) {
1659
+ /**
1660
+ * Removes an event listener, the one which was added with the same type, handler and phase.
1661
+ * @param {string} type The type of event
1662
+ * @param {Function|Object} callback The handler which was added
1663
+ * @param {Object|boolean} [options=false] Whether the listener was a capture listener (true), or an object with capture
1664
+ */
1665
+ removeEventListener (type, callback, options = false) {
1261
1666
  if (!(type in this.listeners)) {
1262
1667
  return
1263
1668
  }
1264
- const listeners = this.listeners[type]
1265
- Array.from(listeners).filter(linker => !linker.data.isDefault && linker.data.callback === callback).forEach(linker => listeners.remove(linker))
1266
- }
1267
-
1268
- dispatchEvent (event, target = this) {
1269
- event.inner.target = target
1270
- if (!(event.type in this.listeners)) {
1271
- return true
1669
+ const capture = typeof options === 'object' && options !== null ? !!options.capture : !!options
1670
+ Array.from(this.listeners[type]).map(linker => linker.data).filter(listener => !listener.isDefault && listener.callback === callback && listener.capture === capture).forEach(listener => this.removeListener(type, listener))
1671
+ }
1672
+
1673
+ /**
1674
+ * Dispatches an event to this target and through the tree: capture listeners of the ancestors from the root down,
1675
+ * then the listeners of this target, then (when the event bubbles) the other listeners of the ancestors from the
1676
+ * parent up to the root. stopPropagation() stops it reaching further targets, stopImmediatePropagation() also stops
1677
+ * the remaining listeners of the current target. Afterwards, unless the default was prevented, the default action
1678
+ * of this target (see setDefaultEvent) runs. The event can be dispatched again afterwards.
1679
+ * @param {EventService} event The event to dispatch
1680
+ * @returns {boolean} False when the event was cancelable and a listener prevented the default, otherwise true
1681
+ * @throws {Error} When the event is already being dispatched, or (after the whole dispatch has finished) the error
1682
+ * which a listener threw (an error with all of them in its errors property when several did)
1683
+ */
1684
+ dispatchEvent (event) {
1685
+ if (event.inner.dispatching) {
1686
+ throw new Error('The event is already being dispatched.')
1687
+ }
1688
+ event.inner.dispatching = true
1689
+ event.inner.target = this
1690
+ // The ancestors, the root first, which can have listeners
1691
+ const ancestors = (0, getParentNodes_1.default)(this).filter(node => node instanceof EventTargetService)
1692
+ event.inner.path = [this].concat(ancestors.slice().reverse())
1693
+ const errors = []
1694
+ const visit = (target, phase) => {
1695
+ event.inner.eventPhase = phase
1696
+ event.inner.currentTarget = target
1697
+ errors.push(...target.runEvents(event))
1698
+ }
1699
+ for (const ancestor of ancestors) {
1700
+ if (event.inner.propagationStopped) {
1701
+ break
1702
+ }
1703
+ visit(ancestor, EventService_1.EventService.CAPTURING_PHASE)
1704
+ }
1705
+ if (!event.inner.propagationStopped) {
1706
+ visit(this, EventService_1.EventService.AT_TARGET)
1707
+ }
1708
+ if (event.bubbles) {
1709
+ for (const ancestor of ancestors.slice().reverse()) {
1710
+ if (event.inner.propagationStopped) {
1711
+ break
1712
+ }
1713
+ visit(ancestor, EventService_1.EventService.BUBBLING_PHASE)
1714
+ }
1715
+ }
1716
+ event.inner.finishDispatch()
1717
+ if (!event.defaultPrevented && typeof this.defaultEvent[event.type] === 'function') {
1718
+ try {
1719
+ this.defaultEvent[event.type](event)
1720
+ } catch (error) {
1721
+ errors.push(error)
1722
+ }
1723
+ }
1724
+ if (errors.length === 1) {
1725
+ throw errors[0]
1726
+ }
1727
+ if (errors.length > 1) {
1728
+ throw Object.assign(new Error(`${errors.length} listeners threw an error while dispatching the ${event.type} event.`), {
1729
+ errors
1730
+ })
1272
1731
  }
1273
- this.runEvents(event)
1274
1732
  return !event.defaultPrevented
1275
1733
  }
1276
1734
  }
1277
1735
  exports.default = EventTargetService
1278
- }, { '../classes/PseudoEventListener': 1, './EventService': 12, 'collect-your-stuff/dist/collections/linked-list/LinkedList': 21, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.filter.js': 131, 'core-js/modules/esnext.iterator.find.js': 132, 'core-js/modules/esnext.iterator.for-each.js': 133 }],
1279
- 14: [function (require, module, exports) {
1736
+ }, { '../classes/PseudoEventListener': 1, '../functions/getParentNodes': 9, './EventService': 17, 'collect-your-stuff/dist/collections/linked-list/LinkedList': 33, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.filter.js': 145, 'core-js/modules/esnext.iterator.find.js': 146, 'core-js/modules/esnext.iterator.for-each.js': 147, 'core-js/modules/esnext.iterator.map.js': 148, 'core-js/modules/esnext.iterator.some.js': 150 }],
1737
+ 19: [function (require, module, exports) {
1738
+ 'use strict'
1739
+
1740
+ Object.defineProperty(exports, '__esModule', {
1741
+ value: true
1742
+ })
1743
+ exports.FocusEventService = void 0
1744
+ /**
1745
+ * @file Substitute for the DOM FocusEvent Class.
1746
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
1747
+ * @version 1.0.0
1748
+ */
1749
+ const UIEventService_1 = require('./UIEventService')
1750
+ /**
1751
+ * Simulate the behaviour of the FocusEvent Class when there is no DOM available.
1752
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
1753
+ * @class
1754
+ * @augments UIEventService
1755
+ * @property {PseudoEventTarget|null} relatedTarget
1756
+ */
1757
+ class FocusEventService extends UIEventService_1.UIEventService {
1758
+ /**
1759
+ * @param {string} [typeArg=''] The type of the event
1760
+ * @param {FocusEventInit} [init={}] The options for the event
1761
+ * @constructor
1762
+ */
1763
+ constructor (typeArg = '', init = {}) {
1764
+ super(typeArg, init)
1765
+ this.related = init.relatedTarget || null
1766
+ }
1767
+
1768
+ get relatedTarget () {
1769
+ return this.related
1770
+ }
1771
+ }
1772
+ exports.FocusEventService = FocusEventService
1773
+ }, { './UIEventService': 27 }],
1774
+ 20: [function (require, module, exports) {
1280
1775
  'use strict'
1281
1776
 
1777
+ const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
1778
+ return mod && mod.__esModule
1779
+ ? mod
1780
+ : {
1781
+ default: mod
1782
+ }
1783
+ }
1282
1784
  Object.defineProperty(exports, '__esModule', {
1283
1785
  value: true
1284
1786
  })
1285
1787
  exports.HTMLElementService = void 0
1286
1788
  const ElementService_1 = require('./ElementService')
1789
+ const createEvent_1 = __importDefault(require('../factories/createEvent'))
1790
+ const activeElement_1 = require('../functions/activeElement')
1287
1791
  /**
1288
1792
  * Simulate the behaviour of the HTMLElement Class when there is no DOM available.
1289
1793
  * @author Joshua Heagle <joshuaheagle@gmail.com>
@@ -1343,10 +1847,343 @@
1343
1847
  children
1344
1848
  })
1345
1849
  }
1850
+
1851
+ /**
1852
+ * Whether this element can have the focus: form controls and links which are not disabled, and anything with a tabindex.
1853
+ * @returns {boolean}
1854
+ */
1855
+ get canFocus () {
1856
+ if (this.hasAttribute('disabled')) {
1857
+ return false
1858
+ }
1859
+ switch (this.tagName) {
1860
+ case 'button':
1861
+ case 'select':
1862
+ case 'textarea':
1863
+ return true
1864
+ case 'input':
1865
+ return String(this.getAttribute('type') || '').toLowerCase() !== 'hidden'
1866
+ case 'a':
1867
+ return this.hasAttribute('href') || this.hasAttribute('tabindex')
1868
+ default:
1869
+ return this.hasAttribute('tabindex')
1870
+ }
1871
+ }
1872
+
1873
+ /**
1874
+ * Click the element: a click event is sent to it, which bubbles and can be cancelled, like one from a user but a
1875
+ * script made it (so it is not trusted). A disabled element does nothing.
1876
+ */
1877
+ click () {
1878
+ if (this.hasAttribute('disabled')) {
1879
+ return
1880
+ }
1881
+ this.dispatchEvent((0, createEvent_1.default)('click', {}, {
1882
+ browser: true
1883
+ }))
1884
+ }
1885
+
1886
+ /**
1887
+ * Give the element the focus. The element which had it gets blur then focusout, and this one gets focus then
1888
+ * focusin (blur and focus do not bubble, focusin and focusout do). Nothing happens when the element cannot have the
1889
+ * focus or already has it.
1890
+ */
1891
+ focus () {
1892
+ const root = this.getRootNode()
1893
+ const previous = (0, activeElement_1.getActiveElement)(root)
1894
+ if (!this.canFocus || previous === this) {
1895
+ return
1896
+ }
1897
+ const send = (target, type, relatedTarget) => {
1898
+ target.dispatchEvent((0, createEvent_1.default)(type, {
1899
+ relatedTarget
1900
+ }, {
1901
+ browser: true,
1902
+ trusted: true
1903
+ }))
1904
+ }
1905
+ if (previous) {
1906
+ send(previous, 'blur', this)
1907
+ send(previous, 'focusout', this)
1908
+ }
1909
+ (0, activeElement_1.setActiveElement)(root, this)
1910
+ send(this, 'focus', previous)
1911
+ send(this, 'focusin', previous)
1912
+ }
1913
+
1914
+ /**
1915
+ * Take the focus away from the element, when it has it: it gets blur then focusout.
1916
+ */
1917
+ blur () {
1918
+ const root = this.getRootNode()
1919
+ if ((0, activeElement_1.getActiveElement)(root) !== this) {
1920
+ return
1921
+ }
1922
+ (0, activeElement_1.setActiveElement)(root, null)
1923
+ this.dispatchEvent((0, createEvent_1.default)('blur', {
1924
+ relatedTarget: null
1925
+ }, {
1926
+ browser: true,
1927
+ trusted: true
1928
+ }))
1929
+ this.dispatchEvent((0, createEvent_1.default)('focusout', {
1930
+ relatedTarget: null
1931
+ }, {
1932
+ browser: true,
1933
+ trusted: true
1934
+ }))
1935
+ }
1346
1936
  }
1347
1937
  exports.HTMLElementService = HTMLElementService
1348
- }, { './ElementService': 11 }],
1349
- 15: [function (require, module, exports) {
1938
+ }, { '../factories/createEvent': 4, '../functions/activeElement': 8, './ElementService': 16 }],
1939
+ 21: [function (require, module, exports) {
1940
+ 'use strict'
1941
+
1942
+ Object.defineProperty(exports, '__esModule', {
1943
+ value: true
1944
+ })
1945
+ exports.InputEventService = void 0
1946
+ /**
1947
+ * @file Substitute for the DOM InputEvent Class.
1948
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
1949
+ * @version 1.0.0
1950
+ */
1951
+ const UIEventService_1 = require('./UIEventService')
1952
+ /**
1953
+ * Simulate the behaviour of the InputEvent Class when there is no DOM available.
1954
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
1955
+ * @class
1956
+ * @augments UIEventService
1957
+ * @property {string|null} data
1958
+ * @property {string} inputType
1959
+ * @property {boolean} isComposing
1960
+ */
1961
+ class InputEventService extends UIEventService_1.UIEventService {
1962
+ /**
1963
+ * @param {string} [typeArg=''] The type of the event
1964
+ * @param {InputEventInit} [init={}] The options for the event
1965
+ * @constructor
1966
+ */
1967
+ constructor (typeArg = '', init = {}) {
1968
+ super(typeArg, init)
1969
+ this.inputData = typeof init.data === 'string' ? init.data : null
1970
+ this.kind = init.inputType || ''
1971
+ this.composing = !!init.isComposing
1972
+ }
1973
+
1974
+ get data () {
1975
+ return this.inputData
1976
+ }
1977
+
1978
+ get inputType () {
1979
+ return this.kind
1980
+ }
1981
+
1982
+ get isComposing () {
1983
+ return this.composing
1984
+ }
1985
+ }
1986
+ exports.InputEventService = InputEventService
1987
+ }, { './UIEventService': 27 }],
1988
+ 22: [function (require, module, exports) {
1989
+ 'use strict'
1990
+
1991
+ Object.defineProperty(exports, '__esModule', {
1992
+ value: true
1993
+ })
1994
+ exports.KeyboardEventService = void 0
1995
+ /**
1996
+ * @file Substitute for the DOM KeyboardEvent Class.
1997
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
1998
+ * @version 1.0.0
1999
+ */
2000
+ const UIEventService_1 = require('./UIEventService')
2001
+ const modifierState_1 = require('../functions/modifierState')
2002
+ /**
2003
+ * Simulate the behaviour of the KeyboardEvent Class when there is no DOM available.
2004
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2005
+ * @class
2006
+ * @augments UIEventService
2007
+ * @property {string} key
2008
+ * @property {string} code
2009
+ * @property {number} location
2010
+ * @property {boolean} repeat
2011
+ * @property {boolean} isComposing
2012
+ */
2013
+ class KeyboardEventService extends UIEventService_1.UIEventService {
2014
+ /**
2015
+ * @param {string} [typeArg=''] The type of the event
2016
+ * @param {KeyboardEventInit} [init={}] The options for the event
2017
+ * @constructor
2018
+ */
2019
+ constructor (typeArg = '', init = {}) {
2020
+ super(typeArg, init)
2021
+ this.keyValue = init.key || ''
2022
+ this.keyCode = init.code || ''
2023
+ this.keyLocation = init.location || 0
2024
+ this.held = !!init.repeat
2025
+ this.composing = !!init.isComposing
2026
+ this.modifiers = (0, modifierState_1.modifierKeys)(init)
2027
+ }
2028
+
2029
+ get key () {
2030
+ return this.keyValue
2031
+ }
2032
+
2033
+ get code () {
2034
+ return this.keyCode
2035
+ }
2036
+
2037
+ get location () {
2038
+ return this.keyLocation
2039
+ }
2040
+
2041
+ get repeat () {
2042
+ return this.held
2043
+ }
2044
+
2045
+ get isComposing () {
2046
+ return this.composing
2047
+ }
2048
+
2049
+ get ctrlKey () {
2050
+ return this.modifiers.ctrlKey
2051
+ }
2052
+
2053
+ get shiftKey () {
2054
+ return this.modifiers.shiftKey
2055
+ }
2056
+
2057
+ get altKey () {
2058
+ return this.modifiers.altKey
2059
+ }
2060
+
2061
+ get metaKey () {
2062
+ return this.modifiers.metaKey
2063
+ }
2064
+
2065
+ /**
2066
+ * Whether a modifier key was held down when the event happened.
2067
+ * @param {string} key Control, Shift, Alt or Meta
2068
+ * @returns {boolean}
2069
+ */
2070
+ getModifierState (key) {
2071
+ return (0, modifierState_1.modifierState)(this.modifiers, key)
2072
+ }
2073
+ }
2074
+ exports.KeyboardEventService = KeyboardEventService
2075
+ }, { '../functions/modifierState': 11, './UIEventService': 27 }],
2076
+ 23: [function (require, module, exports) {
2077
+ 'use strict'
2078
+
2079
+ Object.defineProperty(exports, '__esModule', {
2080
+ value: true
2081
+ })
2082
+ exports.MouseEventService = void 0
2083
+ /**
2084
+ * @file Substitute for the DOM MouseEvent Class.
2085
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2086
+ * @version 1.0.0
2087
+ */
2088
+ const UIEventService_1 = require('./UIEventService')
2089
+ const modifierState_1 = require('../functions/modifierState')
2090
+ /**
2091
+ * Simulate the behaviour of the MouseEvent Class when there is no DOM available.
2092
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2093
+ * @class
2094
+ * @augments UIEventService
2095
+ * @property {number} screenX
2096
+ * @property {number} screenY
2097
+ * @property {number} clientX
2098
+ * @property {number} clientY
2099
+ * @property {number} button
2100
+ * @property {number} buttons
2101
+ * @property {PseudoEventTarget|null} relatedTarget
2102
+ */
2103
+ class MouseEventService extends UIEventService_1.UIEventService {
2104
+ /**
2105
+ * @param {string} [typeArg=''] The type of the event
2106
+ * @param {MouseEventInit} [init={}] The options for the event
2107
+ * @constructor
2108
+ */
2109
+ constructor (typeArg = '', init = {}) {
2110
+ super(typeArg, init)
2111
+ this.position = {
2112
+ screenX: init.screenX || 0,
2113
+ screenY: init.screenY || 0,
2114
+ clientX: init.clientX || 0,
2115
+ clientY: init.clientY || 0
2116
+ }
2117
+ this.modifiers = (0, modifierState_1.modifierKeys)(init)
2118
+ this.buttonPressed = init.button || 0
2119
+ this.buttonsDown = init.buttons || 0
2120
+ this.related = init.relatedTarget || null
2121
+ }
2122
+
2123
+ get screenX () {
2124
+ return this.position.screenX
2125
+ }
2126
+
2127
+ get screenY () {
2128
+ return this.position.screenY
2129
+ }
2130
+
2131
+ get clientX () {
2132
+ return this.position.clientX
2133
+ }
2134
+
2135
+ get clientY () {
2136
+ return this.position.clientY
2137
+ }
2138
+
2139
+ get x () {
2140
+ return this.position.clientX
2141
+ }
2142
+
2143
+ get y () {
2144
+ return this.position.clientY
2145
+ }
2146
+
2147
+ get ctrlKey () {
2148
+ return this.modifiers.ctrlKey
2149
+ }
2150
+
2151
+ get shiftKey () {
2152
+ return this.modifiers.shiftKey
2153
+ }
2154
+
2155
+ get altKey () {
2156
+ return this.modifiers.altKey
2157
+ }
2158
+
2159
+ get metaKey () {
2160
+ return this.modifiers.metaKey
2161
+ }
2162
+
2163
+ get button () {
2164
+ return this.buttonPressed
2165
+ }
2166
+
2167
+ get buttons () {
2168
+ return this.buttonsDown
2169
+ }
2170
+
2171
+ get relatedTarget () {
2172
+ return this.related
2173
+ }
2174
+
2175
+ /**
2176
+ * Whether a modifier key was held down when the event happened.
2177
+ * @param {string} key Control, Shift, Alt or Meta
2178
+ * @returns {boolean}
2179
+ */
2180
+ getModifierState (key) {
2181
+ return (0, modifierState_1.modifierState)(this.modifiers, key)
2182
+ }
2183
+ }
2184
+ exports.MouseEventService = MouseEventService
2185
+ }, { '../functions/modifierState': 11, './UIEventService': 27 }],
2186
+ 24: [function (require, module, exports) {
1350
2187
  'use strict'
1351
2188
 
1352
2189
  require('core-js/modules/esnext.iterator.constructor.js')
@@ -1424,8 +2261,8 @@
1424
2261
  }
1425
2262
  }
1426
2263
  exports.NamedNodeMapService = NamedNodeMapService
1427
- }, { 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.find.js': 132 }],
1428
- 16: [function (require, module, exports) {
2264
+ }, { 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.find.js': 146 }],
2265
+ 25: [function (require, module, exports) {
1429
2266
  'use strict'
1430
2267
 
1431
2268
  const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
@@ -1713,8 +2550,238 @@
1713
2550
  NodeService.DOCUMENT_TYPE_NODE = 10
1714
2551
  NodeService.DOCUMENT_FRAGMENT_NODE = 11
1715
2552
  NodeService.NOTATION_NODE = 12
1716
- }, { '../factories/generateNodeList': 5, './EventTargetService': 13, 'collect-your-stuff/dist/collections/linked-tree-list/TreeLinker': 24 }],
1717
- 17: [function (require, module, exports) {
2553
+ }, { '../factories/generateNodeList': 7, './EventTargetService': 18, 'collect-your-stuff/dist/collections/linked-tree-list/TreeLinker': 36 }],
2554
+ 26: [function (require, module, exports) {
2555
+ 'use strict'
2556
+
2557
+ Object.defineProperty(exports, '__esModule', {
2558
+ value: true
2559
+ })
2560
+ exports.PointerEventService = void 0
2561
+ /**
2562
+ * @file Substitute for the DOM PointerEvent Class.
2563
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2564
+ * @version 1.0.0
2565
+ */
2566
+ const MouseEventService_1 = require('./MouseEventService')
2567
+ /**
2568
+ * Simulate the behaviour of the PointerEvent Class when there is no DOM available.
2569
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2570
+ * @class
2571
+ * @augments MouseEventService
2572
+ * @property {number} pointerId
2573
+ * @property {number} width
2574
+ * @property {number} height
2575
+ * @property {number} pressure
2576
+ * @property {string} pointerType
2577
+ * @property {boolean} isPrimary
2578
+ */
2579
+ class PointerEventService extends MouseEventService_1.MouseEventService {
2580
+ /**
2581
+ * @param {string} [typeArg=''] The type of the event
2582
+ * @param {PointerEventInit} [init={}] The options for the event
2583
+ * @constructor
2584
+ */
2585
+ constructor (typeArg = '', init = {}) {
2586
+ super(typeArg, init)
2587
+ this.pointer = {
2588
+ pointerId: init.pointerId || 0,
2589
+ width: typeof init.width === 'number' ? init.width : 1,
2590
+ height: typeof init.height === 'number' ? init.height : 1,
2591
+ pressure: init.pressure || 0,
2592
+ pointerType: init.pointerType || '',
2593
+ isPrimary: !!init.isPrimary
2594
+ }
2595
+ }
2596
+
2597
+ get pointerId () {
2598
+ return this.pointer.pointerId
2599
+ }
2600
+
2601
+ get width () {
2602
+ return this.pointer.width
2603
+ }
2604
+
2605
+ get height () {
2606
+ return this.pointer.height
2607
+ }
2608
+
2609
+ get pressure () {
2610
+ return this.pointer.pressure
2611
+ }
2612
+
2613
+ get pointerType () {
2614
+ return this.pointer.pointerType
2615
+ }
2616
+
2617
+ get isPrimary () {
2618
+ return this.pointer.isPrimary
2619
+ }
2620
+ }
2621
+ exports.PointerEventService = PointerEventService
2622
+ }, { './MouseEventService': 23 }],
2623
+ 27: [function (require, module, exports) {
2624
+ 'use strict'
2625
+
2626
+ Object.defineProperty(exports, '__esModule', {
2627
+ value: true
2628
+ })
2629
+ exports.UIEventService = void 0
2630
+ /**
2631
+ * @file Substitute for the DOM UIEvent Class.
2632
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2633
+ * @version 1.0.0
2634
+ */
2635
+ const EventService_1 = require('./EventService')
2636
+ /**
2637
+ * Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
2638
+ * interface (the mouse, the keyboard, focus and input).
2639
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2640
+ * @class
2641
+ * @augments EventService
2642
+ * @property {number} detail
2643
+ * @property {*} view
2644
+ */
2645
+ class UIEventService extends EventService_1.EventService {
2646
+ /**
2647
+ * @param {string} [typeArg=''] The type of the event
2648
+ * @param {UIEventInit} [init={}] The options for the event
2649
+ * @constructor
2650
+ */
2651
+ constructor (typeArg = '', init = {}) {
2652
+ super(typeArg, init)
2653
+ this.uiDetail = init.detail || 0
2654
+ this.uiView = init.view || null
2655
+ }
2656
+
2657
+ get detail () {
2658
+ return this.uiDetail
2659
+ }
2660
+
2661
+ get view () {
2662
+ return this.uiView
2663
+ }
2664
+ }
2665
+ exports.UIEventService = UIEventService
2666
+ }, { './EventService': 17 }],
2667
+ 28: [function (require, module, exports) {
2668
+ 'use strict'
2669
+
2670
+ const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
2671
+ return mod && mod.__esModule
2672
+ ? mod
2673
+ : {
2674
+ default: mod
2675
+ }
2676
+ }
2677
+ Object.defineProperty(exports, '__esModule', {
2678
+ value: true
2679
+ })
2680
+ exports.keyPress = exports.click = void 0
2681
+ /**
2682
+ * @file Simulate what a user does, with the events the browser sends for it.
2683
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
2684
+ * @version 1.0.0
2685
+ * @module pseudoDom/simulate
2686
+ */
2687
+ const createEvent_1 = __importDefault(require('./factories/createEvent'))
2688
+ const activeElement_1 = require('./functions/activeElement')
2689
+ const send = (target, type, init) => target.dispatchEvent((0, createEvent_1.default)(type, init, {
2690
+ browser: true,
2691
+ trusted: true
2692
+ }))
2693
+ /**
2694
+ * The nearest element (starting with the element itself) which can have the focus.
2695
+ * @param {*} element Where to start
2696
+ * @returns {*|null}
2697
+ */
2698
+ const focusableFrom = element => {
2699
+ let current = element
2700
+ while (current) {
2701
+ if (current.canFocus) {
2702
+ return current
2703
+ }
2704
+ current = current.parentNode
2705
+ }
2706
+ return null
2707
+ }
2708
+ /**
2709
+ * Click an element the way a user does: pointerdown and mousedown, then the focus moves to the nearest element which
2710
+ * can have it (or is taken away from the one which had it) unless mousedown was cancelled, then pointerup, mouseup
2711
+ * and finally click. Every event is trusted and has the options the browser gives it. A disabled element gets nothing.
2712
+ * @function click
2713
+ * @param {*} element The element to click
2714
+ * @param {Object} [init={}] Options for the events (for example clientX, clientY, shiftKey)
2715
+ * @returns {boolean} False when the click was cancelled (or the element is disabled), so its default action did not happen
2716
+ */
2717
+ const click = (element, init = {}) => {
2718
+ if (element.hasAttribute && element.hasAttribute('disabled')) {
2719
+ return false
2720
+ }
2721
+ const pointer = Object.assign({
2722
+ pointerId: 1,
2723
+ pointerType: 'mouse',
2724
+ isPrimary: true,
2725
+ button: 0
2726
+ }, init)
2727
+ send(element, 'pointerdown', Object.assign({
2728
+ buttons: 1
2729
+ }, pointer))
2730
+ if (send(element, 'mousedown', Object.assign({
2731
+ buttons: 1,
2732
+ detail: 1
2733
+ }, init, {
2734
+ button: 0
2735
+ }))) {
2736
+ const focusable = focusableFrom(element)
2737
+ if (focusable) {
2738
+ focusable.focus()
2739
+ } else {
2740
+ const active = (0, activeElement_1.getActiveElement)(element.getRootNode())
2741
+ if (active) {
2742
+ active.blur()
2743
+ }
2744
+ }
2745
+ }
2746
+ send(element, 'pointerup', Object.assign({
2747
+ buttons: 0
2748
+ }, pointer))
2749
+ send(element, 'mouseup', Object.assign({
2750
+ buttons: 0,
2751
+ detail: 1
2752
+ }, init, {
2753
+ button: 0
2754
+ }))
2755
+ return send(element, 'click', Object.assign({
2756
+ detail: 1
2757
+ }, init, {
2758
+ button: 0
2759
+ }))
2760
+ }
2761
+ exports.click = click
2762
+ /**
2763
+ * Press and release a key on an element (the element which has the focus, or one given): keydown and then keyup.
2764
+ * @function keyPress
2765
+ * @param {*} element The element which gets the key
2766
+ * @param {string} key The value of the key, such as a or Enter
2767
+ * @param {Object} [init={}] Options for the events (for example code, shiftKey)
2768
+ * @returns {boolean} False when keydown was cancelled, so its default action did not happen
2769
+ */
2770
+ const keyPress = (element, key, init = {}) => {
2771
+ const options = Object.assign({
2772
+ key
2773
+ }, init)
2774
+ const proceeded = send(element, 'keydown', options)
2775
+ send(element, 'keyup', options)
2776
+ return proceeded
2777
+ }
2778
+ exports.keyPress = keyPress
2779
+ exports.default = {
2780
+ click: exports.click,
2781
+ keyPress: exports.keyPress
2782
+ }
2783
+ }, { './factories/createEvent': 4, './functions/activeElement': 8 }],
2784
+ 29: [function (require, module, exports) {
1718
2785
  'use strict'
1719
2786
 
1720
2787
  Object.defineProperty(exports, '__esModule', {
@@ -1781,8 +2848,8 @@
1781
2848
  head: [],
1782
2849
  tail: null
1783
2850
  })
1784
- }, { 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.reduce.js': 135 }],
1785
- 18: [function (require, module, exports) {
2851
+ }, { 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.reduce.js': 149 }],
2852
+ 30: [function (require, module, exports) {
1786
2853
  'use strict'
1787
2854
 
1788
2855
  Object.defineProperty(exports, '__esModule', {
@@ -2006,8 +3073,8 @@
2006
3073
  const list = new classType(elementClass)
2007
3074
  return list.initialize(elementClass.fromArray(values).head)
2008
3075
  }
2009
- }, { '../../recipes/ArrayIterator': 25, './ArrayElement': 17 }],
2010
- 19: [function (require, module, exports) {
3076
+ }, { '../../recipes/ArrayIterator': 37, './ArrayElement': 29 }],
3077
+ 31: [function (require, module, exports) {
2011
3078
  'use strict'
2012
3079
 
2013
3080
  Object.defineProperty(exports, '__esModule', {
@@ -2081,8 +3148,8 @@
2081
3148
  head: null,
2082
3149
  tail: null
2083
3150
  })
2084
- }, { '../linked-list/Linker': 22, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.reduce.js': 135 }],
2085
- 20: [function (require, module, exports) {
3151
+ }, { '../linked-list/Linker': 34, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.reduce.js': 149 }],
3152
+ 32: [function (require, module, exports) {
2086
3153
  'use strict'
2087
3154
 
2088
3155
  Object.defineProperty(exports, '__esModule', {
@@ -2410,8 +3477,8 @@
2410
3477
  DoublyLinkedList.fromArray = (values = [], linkerClass = _DoubleLinker.DoubleLinker, classType = DoublyLinkedList) => {
2411
3478
  return _LinkedList.LinkedList.fromArray(values, linkerClass, classType)
2412
3479
  }
2413
- }, { '../../recipes/DoubleLinkerIterator': 26, '../linked-list/LinkedList': 21, './DoubleLinker': 19, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.for-each.js': 133 }],
2414
- 21: [function (require, module, exports) {
3480
+ }, { '../../recipes/DoubleLinkerIterator': 38, '../linked-list/LinkedList': 33, './DoubleLinker': 31, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.for-each.js': 147 }],
3481
+ 33: [function (require, module, exports) {
2415
3482
  'use strict'
2416
3483
 
2417
3484
  Object.defineProperty(exports, '__esModule', {
@@ -2708,8 +3775,8 @@
2708
3775
  const list = new classType(linkerClass)
2709
3776
  return list.initialize(linkerClass.fromArray(values).head)
2710
3777
  }
2711
- }, { '../../recipes/LinkerIterator': 27, '../arrayable/Arrayable': 18, './Linker': 22 }],
2712
- 22: [function (require, module, exports) {
3778
+ }, { '../../recipes/LinkerIterator': 39, '../arrayable/Arrayable': 30, './Linker': 34 }],
3779
+ 34: [function (require, module, exports) {
2713
3780
  'use strict'
2714
3781
 
2715
3782
  Object.defineProperty(exports, '__esModule', {
@@ -2794,8 +3861,8 @@
2794
3861
  head: null,
2795
3862
  tail: null
2796
3863
  })
2797
- }, { '../arrayable/ArrayElement': 17, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.reduce.js': 135 }],
2798
- 23: [function (require, module, exports) {
3864
+ }, { '../arrayable/ArrayElement': 29, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.reduce.js': 149 }],
3865
+ 35: [function (require, module, exports) {
2799
3866
  'use strict'
2800
3867
 
2801
3868
  Object.defineProperty(exports, '__esModule', {
@@ -3090,8 +4157,8 @@
3090
4157
  const list = new classType(linkerClass)
3091
4158
  return list.initialize(linkerClass.fromArray(values).head)
3092
4159
  }
3093
- }, { '../../recipes/TreeLinkerIterator': 28, '../doubly-linked-list/DoublyLinkedList': 20, './TreeLinker': 24, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.for-each.js': 133 }],
3094
- 24: [function (require, module, exports) {
4160
+ }, { '../../recipes/TreeLinkerIterator': 40, '../doubly-linked-list/DoublyLinkedList': 32, './TreeLinker': 36, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.for-each.js': 147 }],
4161
+ 36: [function (require, module, exports) {
3095
4162
  'use strict'
3096
4163
 
3097
4164
  Object.defineProperty(exports, '__esModule', {
@@ -3186,8 +4253,8 @@
3186
4253
  * @returns {{head: TreeLinker, tail: TreeLinker}}
3187
4254
  */
3188
4255
  TreeLinker.fromArray = (values = [], classType = TreeLinker) => _DoubleLinker.DoubleLinker.fromArray(values, classType)
3189
- }, { '../doubly-linked-list/DoubleLinker': 19, './LinkedTreeList': 23, 'core-js/modules/esnext.iterator.constructor.js': 130, 'core-js/modules/esnext.iterator.map.js': 134 }],
3190
- 25: [function (require, module, exports) {
4256
+ }, { '../doubly-linked-list/DoubleLinker': 31, './LinkedTreeList': 35, 'core-js/modules/esnext.iterator.constructor.js': 144, 'core-js/modules/esnext.iterator.map.js': 148 }],
4257
+ 37: [function (require, module, exports) {
3191
4258
  'use strict'
3192
4259
 
3193
4260
  Object.defineProperty(exports, '__esModule', {
@@ -3228,7 +4295,7 @@
3228
4295
  }
3229
4296
  exports.ArrayIterator = ArrayIterator
3230
4297
  }, {}],
3231
- 26: [function (require, module, exports) {
4298
+ 38: [function (require, module, exports) {
3232
4299
  'use strict'
3233
4300
 
3234
4301
  Object.defineProperty(exports, '__esModule', {
@@ -3263,7 +4330,7 @@
3263
4330
  }
3264
4331
  exports.DoubleLinkerIterator = DoubleLinkerIterator
3265
4332
  }, {}],
3266
- 27: [function (require, module, exports) {
4333
+ 39: [function (require, module, exports) {
3267
4334
  'use strict'
3268
4335
 
3269
4336
  Object.defineProperty(exports, '__esModule', {
@@ -3298,7 +4365,7 @@
3298
4365
  }
3299
4366
  exports.LinkerIterator = LinkerIterator
3300
4367
  }, {}],
3301
- 28: [function (require, module, exports) {
4368
+ 40: [function (require, module, exports) {
3302
4369
  'use strict'
3303
4370
 
3304
4371
  Object.defineProperty(exports, '__esModule', {
@@ -3335,8 +4402,8 @@
3335
4402
  }
3336
4403
  }
3337
4404
  exports.TreeLinkerIterator = TreeLinkerIterator
3338
- }, { '../services/parseTreeNext': 29 }],
3339
- 29: [function (require, module, exports) {
4405
+ }, { '../services/parseTreeNext': 41 }],
4406
+ 41: [function (require, module, exports) {
3340
4407
  'use strict'
3341
4408
 
3342
4409
  Object.defineProperty(exports, '__esModule', {
@@ -3380,7 +4447,7 @@
3380
4447
  }
3381
4448
  exports.parseTreeNext = parseTreeNext
3382
4449
  }, {}],
3383
- 30: [function (require, module, exports) {
4450
+ 42: [function (require, module, exports) {
3384
4451
  'use strict'
3385
4452
  const isCallable = require('../internals/is-callable')
3386
4453
  const tryToString = require('../internals/try-to-string')
@@ -3392,8 +4459,18 @@
3392
4459
  if (isCallable(argument)) return argument
3393
4460
  throw new $TypeError(tryToString(argument) + ' is not a function')
3394
4461
  }
3395
- }, { '../internals/is-callable': 74, '../internals/try-to-string': 117 }],
3396
- 31: [function (require, module, exports) {
4462
+ }, { '../internals/is-callable': 87, '../internals/try-to-string': 130 }],
4463
+ 43: [function (require, module, exports) {
4464
+ 'use strict'
4465
+ const has = require('../internals/weak-map-helpers').has
4466
+
4467
+ // Perform ? RequireInternalSlot(M, [[WeakMapData]])
4468
+ module.exports = function (it) {
4469
+ has(it)
4470
+ return it
4471
+ }
4472
+ }, { '../internals/weak-map-helpers': 135 }],
4473
+ 44: [function (require, module, exports) {
3397
4474
  'use strict'
3398
4475
  const isPrototypeOf = require('../internals/object-is-prototype-of')
3399
4476
 
@@ -3403,8 +4480,8 @@
3403
4480
  if (isPrototypeOf(Prototype, it)) return it
3404
4481
  throw new $TypeError('Incorrect invocation')
3405
4482
  }
3406
- }, { '../internals/object-is-prototype-of': 99 }],
3407
- 32: [function (require, module, exports) {
4483
+ }, { '../internals/object-is-prototype-of': 112 }],
4484
+ 45: [function (require, module, exports) {
3408
4485
  'use strict'
3409
4486
  const isObject = require('../internals/is-object')
3410
4487
 
@@ -3416,8 +4493,8 @@
3416
4493
  if (isObject(argument)) return argument
3417
4494
  throw new $TypeError($String(argument) + ' is not an object')
3418
4495
  }
3419
- }, { '../internals/is-object': 77 }],
3420
- 33: [function (require, module, exports) {
4496
+ }, { '../internals/is-object': 90 }],
4497
+ 46: [function (require, module, exports) {
3421
4498
  'use strict'
3422
4499
  const toIndexedObject = require('../internals/to-indexed-object')
3423
4500
  const toAbsoluteIndex = require('../internals/to-absolute-index')
@@ -3456,8 +4533,8 @@
3456
4533
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
3457
4534
  indexOf: createMethod(false)
3458
4535
  }
3459
- }, { '../internals/length-of-array-like': 89, '../internals/to-absolute-index': 110, '../internals/to-indexed-object': 111 }],
3460
- 34: [function (require, module, exports) {
4536
+ }, { '../internals/length-of-array-like': 102, '../internals/to-absolute-index': 123, '../internals/to-indexed-object': 124 }],
4537
+ 47: [function (require, module, exports) {
3461
4538
  'use strict'
3462
4539
  const anObject = require('../internals/an-object')
3463
4540
  const iteratorClose = require('../internals/iterator-close')
@@ -3470,8 +4547,8 @@
3470
4547
  iteratorClose(iterator, 'throw', error)
3471
4548
  }
3472
4549
  }
3473
- }, { '../internals/an-object': 32, '../internals/iterator-close': 83 }],
3474
- 35: [function (require, module, exports) {
4550
+ }, { '../internals/an-object': 45, '../internals/iterator-close': 96 }],
4551
+ 48: [function (require, module, exports) {
3475
4552
  'use strict'
3476
4553
  const uncurryThis = require('../internals/function-uncurry-this')
3477
4554
 
@@ -3481,8 +4558,8 @@
3481
4558
  module.exports = function (it) {
3482
4559
  return stringSlice(toString(it), 8, -1)
3483
4560
  }
3484
- }, { '../internals/function-uncurry-this': 59 }],
3485
- 36: [function (require, module, exports) {
4561
+ }, { '../internals/function-uncurry-this': 72 }],
4562
+ 49: [function (require, module, exports) {
3486
4563
  'use strict'
3487
4564
  const hasOwn = require('../internals/has-own-property')
3488
4565
  const ownKeys = require('../internals/own-keys')
@@ -3500,8 +4577,8 @@
3500
4577
  }
3501
4578
  }
3502
4579
  }
3503
- }, { '../internals/has-own-property': 66, '../internals/object-define-property': 94, '../internals/object-get-own-property-descriptor': 95, '../internals/own-keys': 104 }],
3504
- 37: [function (require, module, exports) {
4580
+ }, { '../internals/has-own-property': 79, '../internals/object-define-property': 107, '../internals/object-get-own-property-descriptor': 108, '../internals/own-keys': 117 }],
4581
+ 50: [function (require, module, exports) {
3505
4582
  'use strict'
3506
4583
  const fails = require('../internals/fails')
3507
4584
 
@@ -3511,8 +4588,8 @@
3511
4588
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
3512
4589
  return Object.getPrototypeOf(new F()) !== F.prototype
3513
4590
  })
3514
- }, { '../internals/fails': 52 }],
3515
- 38: [function (require, module, exports) {
4591
+ }, { '../internals/fails': 65 }],
4592
+ 51: [function (require, module, exports) {
3516
4593
  'use strict'
3517
4594
  // `CreateIterResultObject` abstract operation
3518
4595
  // https://tc39.es/ecma262/#sec-createiterresultobject
@@ -3520,7 +4597,7 @@
3520
4597
  return { value, done }
3521
4598
  }
3522
4599
  }, {}],
3523
- 39: [function (require, module, exports) {
4600
+ 52: [function (require, module, exports) {
3524
4601
  'use strict'
3525
4602
  const DESCRIPTORS = require('../internals/descriptors')
3526
4603
  const definePropertyModule = require('../internals/object-define-property')
@@ -3534,8 +4611,8 @@
3534
4611
  object[key] = value
3535
4612
  return object
3536
4613
  }
3537
- }, { '../internals/create-property-descriptor': 40, '../internals/descriptors': 46, '../internals/object-define-property': 94 }],
3538
- 40: [function (require, module, exports) {
4614
+ }, { '../internals/create-property-descriptor': 53, '../internals/descriptors': 59, '../internals/object-define-property': 107 }],
4615
+ 53: [function (require, module, exports) {
3539
4616
  'use strict'
3540
4617
  module.exports = function (bitmap, value) {
3541
4618
  return {
@@ -3546,7 +4623,7 @@
3546
4623
  }
3547
4624
  }
3548
4625
  }, {}],
3549
- 41: [function (require, module, exports) {
4626
+ 54: [function (require, module, exports) {
3550
4627
  'use strict'
3551
4628
  const DESCRIPTORS = require('../internals/descriptors')
3552
4629
  const definePropertyModule = require('../internals/object-define-property')
@@ -3556,8 +4633,8 @@
3556
4633
  if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value))
3557
4634
  else object[key] = value
3558
4635
  }
3559
- }, { '../internals/create-property-descriptor': 40, '../internals/descriptors': 46, '../internals/object-define-property': 94 }],
3560
- 42: [function (require, module, exports) {
4636
+ }, { '../internals/create-property-descriptor': 53, '../internals/descriptors': 59, '../internals/object-define-property': 107 }],
4637
+ 55: [function (require, module, exports) {
3561
4638
  'use strict'
3562
4639
  const makeBuiltIn = require('../internals/make-built-in')
3563
4640
  const defineProperty = require('../internals/object-define-property')
@@ -3567,8 +4644,8 @@
3567
4644
  if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true })
3568
4645
  return defineProperty.f(target, name, descriptor)
3569
4646
  }
3570
- }, { '../internals/make-built-in': 90, '../internals/object-define-property': 94 }],
3571
- 43: [function (require, module, exports) {
4647
+ }, { '../internals/make-built-in': 103, '../internals/object-define-property': 107 }],
4648
+ 56: [function (require, module, exports) {
3572
4649
  'use strict'
3573
4650
  const isCallable = require('../internals/is-callable')
3574
4651
  const definePropertyModule = require('../internals/object-define-property')
@@ -3599,8 +4676,8 @@
3599
4676
  }
3600
4677
  } return O
3601
4678
  }
3602
- }, { '../internals/define-global-property': 45, '../internals/is-callable': 74, '../internals/make-built-in': 90, '../internals/object-define-property': 94 }],
3603
- 44: [function (require, module, exports) {
4679
+ }, { '../internals/define-global-property': 58, '../internals/is-callable': 87, '../internals/make-built-in': 103, '../internals/object-define-property': 107 }],
4680
+ 57: [function (require, module, exports) {
3604
4681
  'use strict'
3605
4682
  const defineBuiltIn = require('../internals/define-built-in')
3606
4683
 
@@ -3608,8 +4685,8 @@
3608
4685
  for (const key in src) defineBuiltIn(target, key, src[key], options)
3609
4686
  return target
3610
4687
  }
3611
- }, { '../internals/define-built-in': 43 }],
3612
- 45: [function (require, module, exports) {
4688
+ }, { '../internals/define-built-in': 56 }],
4689
+ 58: [function (require, module, exports) {
3613
4690
  'use strict'
3614
4691
  const globalThis = require('../internals/global-this')
3615
4692
 
@@ -3623,8 +4700,8 @@
3623
4700
  globalThis[key] = value
3624
4701
  } return value
3625
4702
  }
3626
- }, { '../internals/global-this': 65 }],
3627
- 46: [function (require, module, exports) {
4703
+ }, { '../internals/global-this': 78 }],
4704
+ 59: [function (require, module, exports) {
3628
4705
  'use strict'
3629
4706
  const fails = require('../internals/fails')
3630
4707
 
@@ -3633,8 +4710,8 @@
3633
4710
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3634
4711
  return Object.defineProperty({}, 1, { get: function () { return 7 } })[1] !== 7
3635
4712
  })
3636
- }, { '../internals/fails': 52 }],
3637
- 47: [function (require, module, exports) {
4713
+ }, { '../internals/fails': 65 }],
4714
+ 60: [function (require, module, exports) {
3638
4715
  'use strict'
3639
4716
  const globalThis = require('../internals/global-this')
3640
4717
  const isObject = require('../internals/is-object')
@@ -3646,8 +4723,8 @@
3646
4723
  module.exports = function (it) {
3647
4724
  return EXISTS ? document.createElement(it) : {}
3648
4725
  }
3649
- }, { '../internals/global-this': 65, '../internals/is-object': 77 }],
3650
- 48: [function (require, module, exports) {
4726
+ }, { '../internals/global-this': 78, '../internals/is-object': 90 }],
4727
+ 61: [function (require, module, exports) {
3651
4728
  'use strict'
3652
4729
  // IE8- don't enum bug keys
3653
4730
  module.exports = [
@@ -3660,7 +4737,7 @@
3660
4737
  'valueOf'
3661
4738
  ]
3662
4739
  }, {}],
3663
- 49: [function (require, module, exports) {
4740
+ 62: [function (require, module, exports) {
3664
4741
  'use strict'
3665
4742
  const globalThis = require('../internals/global-this')
3666
4743
 
@@ -3668,8 +4745,8 @@
3668
4745
  const userAgent = navigator && navigator.userAgent
3669
4746
 
3670
4747
  module.exports = userAgent ? String(userAgent) : ''
3671
- }, { '../internals/global-this': 65 }],
3672
- 50: [function (require, module, exports) {
4748
+ }, { '../internals/global-this': 78 }],
4749
+ 63: [function (require, module, exports) {
3673
4750
  'use strict'
3674
4751
  const globalThis = require('../internals/global-this')
3675
4752
  const userAgent = require('../internals/environment-user-agent')
@@ -3698,8 +4775,8 @@
3698
4775
  }
3699
4776
 
3700
4777
  module.exports = version
3701
- }, { '../internals/environment-user-agent': 49, '../internals/global-this': 65 }],
3702
- 51: [function (require, module, exports) {
4778
+ }, { '../internals/environment-user-agent': 62, '../internals/global-this': 78 }],
4779
+ 64: [function (require, module, exports) {
3703
4780
  'use strict'
3704
4781
  const globalThis = require('../internals/global-this')
3705
4782
  const getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f
@@ -3757,8 +4834,8 @@
3757
4834
  }
3758
4835
  }
3759
4836
  }
3760
- }, { '../internals/copy-constructor-properties': 36, '../internals/create-non-enumerable-property': 39, '../internals/define-built-in': 43, '../internals/define-global-property': 45, '../internals/global-this': 65, '../internals/is-forced': 75, '../internals/object-get-own-property-descriptor': 95 }],
3761
- 52: [function (require, module, exports) {
4837
+ }, { '../internals/copy-constructor-properties': 49, '../internals/create-non-enumerable-property': 52, '../internals/define-built-in': 56, '../internals/define-global-property': 58, '../internals/global-this': 78, '../internals/is-forced': 88, '../internals/object-get-own-property-descriptor': 108 }],
4838
+ 65: [function (require, module, exports) {
3762
4839
  'use strict'
3763
4840
  module.exports = function (exec) {
3764
4841
  try {
@@ -3768,7 +4845,7 @@
3768
4845
  }
3769
4846
  }
3770
4847
  }, {}],
3771
- 53: [function (require, module, exports) {
4848
+ 66: [function (require, module, exports) {
3772
4849
  'use strict'
3773
4850
  const NATIVE_BIND = require('../internals/function-bind-native')
3774
4851
 
@@ -3782,8 +4859,8 @@
3782
4859
  : function () {
3783
4860
  return call.apply(apply, arguments)
3784
4861
  })
3785
- }, { '../internals/function-bind-native': 55 }],
3786
- 54: [function (require, module, exports) {
4862
+ }, { '../internals/function-bind-native': 68 }],
4863
+ 67: [function (require, module, exports) {
3787
4864
  'use strict'
3788
4865
  const uncurryThis = require('../internals/function-uncurry-this-clause')
3789
4866
  const aCallable = require('../internals/a-callable')
@@ -3798,8 +4875,8 @@
3798
4875
  return fn.apply(that, arguments)
3799
4876
  }
3800
4877
  }
3801
- }, { '../internals/a-callable': 30, '../internals/function-bind-native': 55, '../internals/function-uncurry-this-clause': 58 }],
3802
- 55: [function (require, module, exports) {
4878
+ }, { '../internals/a-callable': 42, '../internals/function-bind-native': 68, '../internals/function-uncurry-this-clause': 71 }],
4879
+ 68: [function (require, module, exports) {
3803
4880
  'use strict'
3804
4881
  const fails = require('../internals/fails')
3805
4882
 
@@ -3809,8 +4886,8 @@
3809
4886
  // eslint-disable-next-line no-prototype-builtins -- safe
3810
4887
  return typeof test !== 'function' || test.hasOwnProperty('prototype')
3811
4888
  })
3812
- }, { '../internals/fails': 52 }],
3813
- 56: [function (require, module, exports) {
4889
+ }, { '../internals/fails': 65 }],
4890
+ 69: [function (require, module, exports) {
3814
4891
  'use strict'
3815
4892
  const NATIVE_BIND = require('../internals/function-bind-native')
3816
4893
 
@@ -3821,8 +4898,8 @@
3821
4898
  : function () {
3822
4899
  return call.apply(call, arguments)
3823
4900
  }
3824
- }, { '../internals/function-bind-native': 55 }],
3825
- 57: [function (require, module, exports) {
4901
+ }, { '../internals/function-bind-native': 68 }],
4902
+ 70: [function (require, module, exports) {
3826
4903
  'use strict'
3827
4904
  const DESCRIPTORS = require('../internals/descriptors')
3828
4905
  const hasOwn = require('../internals/has-own-property')
@@ -3841,8 +4918,8 @@
3841
4918
  PROPER,
3842
4919
  CONFIGURABLE
3843
4920
  }
3844
- }, { '../internals/descriptors': 46, '../internals/has-own-property': 66 }],
3845
- 58: [function (require, module, exports) {
4921
+ }, { '../internals/descriptors': 59, '../internals/has-own-property': 79 }],
4922
+ 71: [function (require, module, exports) {
3846
4923
  'use strict'
3847
4924
  const classofRaw = require('../internals/classof-raw')
3848
4925
  const uncurryThis = require('../internals/function-uncurry-this')
@@ -3853,8 +4930,8 @@
3853
4930
  // https://github.com/zloirock/core-js/issues/1130
3854
4931
  if (classofRaw(fn) === 'Function') return uncurryThis(fn)
3855
4932
  }
3856
- }, { '../internals/classof-raw': 35, '../internals/function-uncurry-this': 59 }],
3857
- 59: [function (require, module, exports) {
4933
+ }, { '../internals/classof-raw': 48, '../internals/function-uncurry-this': 72 }],
4934
+ 72: [function (require, module, exports) {
3858
4935
  'use strict'
3859
4936
  const NATIVE_BIND = require('../internals/function-bind-native')
3860
4937
 
@@ -3870,8 +4947,8 @@
3870
4947
  return call.apply(fn, arguments)
3871
4948
  }
3872
4949
  }
3873
- }, { '../internals/function-bind-native': 55 }],
3874
- 60: [function (require, module, exports) {
4950
+ }, { '../internals/function-bind-native': 68 }],
4951
+ 73: [function (require, module, exports) {
3875
4952
  'use strict'
3876
4953
  const globalThis = require('../internals/global-this')
3877
4954
  const isCallable = require('../internals/is-callable')
@@ -3883,8 +4960,8 @@
3883
4960
  module.exports = function (namespace, method) {
3884
4961
  return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]
3885
4962
  }
3886
- }, { '../internals/global-this': 65, '../internals/is-callable': 74 }],
3887
- 61: [function (require, module, exports) {
4963
+ }, { '../internals/global-this': 78, '../internals/is-callable': 87 }],
4964
+ 74: [function (require, module, exports) {
3888
4965
  'use strict'
3889
4966
  // `GetIteratorDirect(obj)` abstract operation
3890
4967
  // https://tc39.es/ecma262/#sec-getiteratordirect
@@ -3896,7 +4973,7 @@
3896
4973
  }
3897
4974
  }
3898
4975
  }, {}],
3899
- 62: [function (require, module, exports) {
4976
+ 75: [function (require, module, exports) {
3900
4977
  'use strict'
3901
4978
  const call = require('../internals/function-call')
3902
4979
  const isCallable = require('../internals/is-callable')
@@ -3911,8 +4988,8 @@
3911
4988
  if (isCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument))
3912
4989
  throw new $TypeError(tryToString(argument) + ' is not iterable')
3913
4990
  }
3914
- }, { '../internals/an-object': 32, '../internals/function-call': 56, '../internals/get-iterator-method-internal': 63, '../internals/is-callable': 74, '../internals/try-to-string': 117 }],
3915
- 63: [function (require, module, exports) {
4991
+ }, { '../internals/an-object': 45, '../internals/function-call': 69, '../internals/get-iterator-method-internal': 76, '../internals/is-callable': 87, '../internals/try-to-string': 130 }],
4992
+ 76: [function (require, module, exports) {
3916
4993
  'use strict'
3917
4994
  const classof = require('../internals/classof-raw')
3918
4995
  const isNullOrUndefined = require('../internals/is-null-or-undefined')
@@ -3929,8 +5006,8 @@
3929
5006
  (classof(it) === 'Arguments' ? ArrayPrototype[ITERATOR] : undefined)
3930
5007
  }
3931
5008
  }
3932
- }, { '../internals/classof-raw': 35, '../internals/get-method': 64, '../internals/is-null-or-undefined': 76, '../internals/well-known-symbol': 122 }],
3933
- 64: [function (require, module, exports) {
5009
+ }, { '../internals/classof-raw': 48, '../internals/get-method': 77, '../internals/is-null-or-undefined': 89, '../internals/well-known-symbol': 136 }],
5010
+ 77: [function (require, module, exports) {
3934
5011
  'use strict'
3935
5012
  const aCallable = require('../internals/a-callable')
3936
5013
  const isNullOrUndefined = require('../internals/is-null-or-undefined')
@@ -3941,8 +5018,8 @@
3941
5018
  const func = V[P]
3942
5019
  return isNullOrUndefined(func) ? undefined : aCallable(func)
3943
5020
  }
3944
- }, { '../internals/a-callable': 30, '../internals/is-null-or-undefined': 76 }],
3945
- 65: [function (require, module, exports) {
5021
+ }, { '../internals/a-callable': 42, '../internals/is-null-or-undefined': 89 }],
5022
+ 78: [function (require, module, exports) {
3946
5023
  (function (global) {
3947
5024
  (function () {
3948
5025
  'use strict'
@@ -3964,7 +5041,7 @@
3964
5041
  }).call(this)
3965
5042
  }).call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {})
3966
5043
  }, {}],
3967
- 66: [function (require, module, exports) {
5044
+ 79: [function (require, module, exports) {
3968
5045
  'use strict'
3969
5046
  const uncurryThis = require('../internals/function-uncurry-this')
3970
5047
  const toObject = require('../internals/to-object')
@@ -3977,18 +5054,18 @@
3977
5054
  module.exports = Object.hasOwn || function hasOwn (it, key) {
3978
5055
  return hasOwnProperty(toObject(it), key)
3979
5056
  }
3980
- }, { '../internals/function-uncurry-this': 59, '../internals/to-object': 114 }],
3981
- 67: [function (require, module, exports) {
5057
+ }, { '../internals/function-uncurry-this': 72, '../internals/to-object': 127 }],
5058
+ 80: [function (require, module, exports) {
3982
5059
  'use strict'
3983
5060
  module.exports = {}
3984
5061
  }, {}],
3985
- 68: [function (require, module, exports) {
5062
+ 81: [function (require, module, exports) {
3986
5063
  'use strict'
3987
5064
  const getBuiltIn = require('../internals/get-built-in')
3988
5065
 
3989
5066
  module.exports = getBuiltIn('document', 'documentElement')
3990
- }, { '../internals/get-built-in': 60 }],
3991
- 69: [function (require, module, exports) {
5067
+ }, { '../internals/get-built-in': 73 }],
5068
+ 82: [function (require, module, exports) {
3992
5069
  'use strict'
3993
5070
  const DESCRIPTORS = require('../internals/descriptors')
3994
5071
  const fails = require('../internals/fails')
@@ -4001,8 +5078,8 @@
4001
5078
  get: function () { return 7 }
4002
5079
  }).a !== 7
4003
5080
  })
4004
- }, { '../internals/descriptors': 46, '../internals/document-create-element': 47, '../internals/fails': 52 }],
4005
- 70: [function (require, module, exports) {
5081
+ }, { '../internals/descriptors': 59, '../internals/document-create-element': 60, '../internals/fails': 65 }],
5082
+ 83: [function (require, module, exports) {
4006
5083
  'use strict'
4007
5084
  const uncurryThis = require('../internals/function-uncurry-this')
4008
5085
  const fails = require('../internals/fails')
@@ -4019,8 +5096,8 @@
4019
5096
  }) ? function (it) {
4020
5097
  return classof(it) === 'String' ? split(it, '') : $Object(it)
4021
5098
  } : $Object
4022
- }, { '../internals/classof-raw': 35, '../internals/fails': 52, '../internals/function-uncurry-this': 59 }],
4023
- 71: [function (require, module, exports) {
5099
+ }, { '../internals/classof-raw': 48, '../internals/fails': 65, '../internals/function-uncurry-this': 72 }],
5100
+ 84: [function (require, module, exports) {
4024
5101
  'use strict'
4025
5102
  const uncurryThis = require('../internals/function-uncurry-this')
4026
5103
  const isCallable = require('../internals/is-callable')
@@ -4036,8 +5113,8 @@
4036
5113
  }
4037
5114
 
4038
5115
  module.exports = store.inspectSource
4039
- }, { '../internals/function-uncurry-this': 59, '../internals/is-callable': 74, '../internals/shared-store': 107 }],
4040
- 72: [function (require, module, exports) {
5116
+ }, { '../internals/function-uncurry-this': 72, '../internals/is-callable': 87, '../internals/shared-store': 120 }],
5117
+ 85: [function (require, module, exports) {
4041
5118
  'use strict'
4042
5119
  const NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection')
4043
5120
  const globalThis = require('../internals/global-this')
@@ -4109,8 +5186,8 @@
4109
5186
  enforce,
4110
5187
  getterFor
4111
5188
  }
4112
- }, { '../internals/create-non-enumerable-property': 39, '../internals/global-this': 65, '../internals/has-own-property': 66, '../internals/hidden-keys': 67, '../internals/is-object': 77, '../internals/shared-key': 106, '../internals/shared-store': 107, '../internals/weak-map-basic-detection': 121 }],
4113
- 73: [function (require, module, exports) {
5189
+ }, { '../internals/create-non-enumerable-property': 52, '../internals/global-this': 78, '../internals/has-own-property': 79, '../internals/hidden-keys': 80, '../internals/is-object': 90, '../internals/shared-key': 119, '../internals/shared-store': 120, '../internals/weak-map-basic-detection': 134 }],
5190
+ 86: [function (require, module, exports) {
4114
5191
  'use strict'
4115
5192
  const wellKnownSymbol = require('../internals/well-known-symbol')
4116
5193
  const Iterators = require('../internals/iterators')
@@ -4122,8 +5199,8 @@
4122
5199
  module.exports = function (it) {
4123
5200
  return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it)
4124
5201
  }
4125
- }, { '../internals/iterators': 88, '../internals/well-known-symbol': 122 }],
4126
- 74: [function (require, module, exports) {
5202
+ }, { '../internals/iterators': 101, '../internals/well-known-symbol': 136 }],
5203
+ 87: [function (require, module, exports) {
4127
5204
  'use strict'
4128
5205
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
4129
5206
  const documentAll = typeof document === 'object' && document.all
@@ -4139,7 +5216,7 @@
4139
5216
  return typeof argument === 'function'
4140
5217
  }
4141
5218
  }, {}],
4142
- 75: [function (require, module, exports) {
5219
+ 88: [function (require, module, exports) {
4143
5220
  'use strict'
4144
5221
  const fails = require('../internals/fails')
4145
5222
  const isCallable = require('../internals/is-callable')
@@ -4166,8 +5243,8 @@
4166
5243
  var POLYFILL = isForced.POLYFILL = 'P'
4167
5244
 
4168
5245
  module.exports = isForced
4169
- }, { '../internals/fails': 52, '../internals/is-callable': 74 }],
4170
- 76: [function (require, module, exports) {
5246
+ }, { '../internals/fails': 65, '../internals/is-callable': 87 }],
5247
+ 89: [function (require, module, exports) {
4171
5248
  'use strict'
4172
5249
  // we can't use just `it == null` since of `document.all` special case
4173
5250
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
@@ -4175,19 +5252,19 @@
4175
5252
  return it === null || it === undefined
4176
5253
  }
4177
5254
  }, {}],
4178
- 77: [function (require, module, exports) {
5255
+ 90: [function (require, module, exports) {
4179
5256
  'use strict'
4180
5257
  const isCallable = require('../internals/is-callable')
4181
5258
 
4182
5259
  module.exports = function (it) {
4183
5260
  return typeof it === 'object' ? it !== null : isCallable(it)
4184
5261
  }
4185
- }, { '../internals/is-callable': 74 }],
4186
- 78: [function (require, module, exports) {
5262
+ }, { '../internals/is-callable': 87 }],
5263
+ 91: [function (require, module, exports) {
4187
5264
  'use strict'
4188
5265
  module.exports = false
4189
5266
  }, {}],
4190
- 79: [function (require, module, exports) {
5267
+ 92: [function (require, module, exports) {
4191
5268
  'use strict'
4192
5269
  const getBuiltIn = require('../internals/get-built-in')
4193
5270
  const isCallable = require('../internals/is-callable')
@@ -4204,8 +5281,8 @@
4204
5281
  const $Symbol = getBuiltIn('Symbol')
4205
5282
  return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it))
4206
5283
  }
4207
- }, { '../internals/get-built-in': 60, '../internals/is-callable': 74, '../internals/object-is-prototype-of': 99, '../internals/use-symbol-as-uid': 119 }],
4208
- 80: [function (require, module, exports) {
5284
+ }, { '../internals/get-built-in': 73, '../internals/is-callable': 87, '../internals/object-is-prototype-of': 112, '../internals/use-symbol-as-uid': 132 }],
5285
+ 93: [function (require, module, exports) {
4209
5286
  'use strict'
4210
5287
  const bind = require('../internals/function-bind-context')
4211
5288
  const call = require('../internals/function-call')
@@ -4280,8 +5357,8 @@
4280
5357
  if (typeof result === 'object' && result && isPrototypeOf(ResultPrototype, result)) return result
4281
5358
  } return new Result(false)
4282
5359
  }
4283
- }, { '../internals/an-object': 32, '../internals/function-bind-context': 54, '../internals/function-call': 56, '../internals/get-iterator-internal': 62, '../internals/get-iterator-method-internal': 63, '../internals/is-array-iterator-method': 73, '../internals/iterator-close': 83, '../internals/length-of-array-like': 89, '../internals/object-is-prototype-of': 99, '../internals/try-to-string': 117 }],
4284
- 81: [function (require, module, exports) {
5360
+ }, { '../internals/an-object': 45, '../internals/function-bind-context': 67, '../internals/function-call': 69, '../internals/get-iterator-internal': 75, '../internals/get-iterator-method-internal': 76, '../internals/is-array-iterator-method': 86, '../internals/iterator-close': 96, '../internals/length-of-array-like': 102, '../internals/object-is-prototype-of': 112, '../internals/try-to-string': 130 }],
5361
+ 94: [function (require, module, exports) {
4285
5362
  'use strict'
4286
5363
  // release references held by exhausted / closed iterator helpers to allow GC of the source chain
4287
5364
  module.exports = function (state) {
@@ -4289,7 +5366,7 @@
4289
5366
  state.iterables = state.iters = state.openIters = state.padding = state.finishResults = state.buffer = null
4290
5367
  }
4291
5368
  }, {}],
4292
- 82: [function (require, module, exports) {
5369
+ 95: [function (require, module, exports) {
4293
5370
  'use strict'
4294
5371
  const iteratorClose = require('../internals/iterator-close')
4295
5372
 
@@ -4306,8 +5383,8 @@
4306
5383
  if (kind === 'throw') throw value
4307
5384
  return value
4308
5385
  }
4309
- }, { '../internals/iterator-close': 83 }],
4310
- 83: [function (require, module, exports) {
5386
+ }, { '../internals/iterator-close': 96 }],
5387
+ 96: [function (require, module, exports) {
4311
5388
  'use strict'
4312
5389
  const call = require('../internals/function-call')
4313
5390
  const anObject = require('../internals/an-object')
@@ -4332,8 +5409,8 @@
4332
5409
  anObject(innerResult)
4333
5410
  return value
4334
5411
  }
4335
- }, { '../internals/an-object': 32, '../internals/function-call': 56, '../internals/get-method': 64 }],
4336
- 84: [function (require, module, exports) {
5412
+ }, { '../internals/an-object': 45, '../internals/function-call': 69, '../internals/get-method': 77 }],
5413
+ 97: [function (require, module, exports) {
4337
5414
  'use strict'
4338
5415
  const call = require('../internals/function-call')
4339
5416
  const create = require('../internals/object-create')
@@ -4433,8 +5510,8 @@
4433
5510
 
4434
5511
  return IteratorProxy
4435
5512
  }
4436
- }, { '../internals/create-iter-result-object': 38, '../internals/create-non-enumerable-property': 39, '../internals/define-built-ins': 44, '../internals/function-call': 56, '../internals/get-method': 64, '../internals/internal-state': 72, '../internals/iterator-cleanup-state': 81, '../internals/iterator-close': 83, '../internals/iterator-close-all': 82, '../internals/iterators-core': 87, '../internals/object-create': 92, '../internals/well-known-symbol': 122 }],
4437
- 85: [function (require, module, exports) {
5513
+ }, { '../internals/create-iter-result-object': 51, '../internals/create-non-enumerable-property': 52, '../internals/define-built-ins': 57, '../internals/function-call': 69, '../internals/get-method': 77, '../internals/internal-state': 85, '../internals/iterator-cleanup-state': 94, '../internals/iterator-close': 96, '../internals/iterator-close-all': 95, '../internals/iterators-core': 100, '../internals/object-create': 105, '../internals/well-known-symbol': 136 }],
5514
+ 98: [function (require, module, exports) {
4438
5515
  'use strict'
4439
5516
  // Should throw an error on invalid iterator
4440
5517
  // https://issues.chromium.org/issues/336839115
@@ -4450,7 +5527,7 @@
4450
5527
  }
4451
5528
  }
4452
5529
  }, {}],
4453
- 86: [function (require, module, exports) {
5530
+ 99: [function (require, module, exports) {
4454
5531
  'use strict'
4455
5532
  const globalThis = require('../internals/global-this')
4456
5533
 
@@ -4476,8 +5553,8 @@
4476
5553
 
4477
5554
  if (!CLOSED) return method
4478
5555
  }
4479
- }, { '../internals/global-this': 65 }],
4480
- 87: [function (require, module, exports) {
5556
+ }, { '../internals/global-this': 78 }],
5557
+ 100: [function (require, module, exports) {
4481
5558
  'use strict'
4482
5559
  const fails = require('../internals/fails')
4483
5560
  const isCallable = require('../internals/is-callable')
@@ -4527,12 +5604,12 @@
4527
5604
  IteratorPrototype,
4528
5605
  BUGGY_SAFARI_ITERATORS
4529
5606
  }
4530
- }, { '../internals/define-built-in': 43, '../internals/fails': 52, '../internals/is-callable': 74, '../internals/is-object': 77, '../internals/is-pure': 78, '../internals/object-create': 92, '../internals/object-get-prototype-of': 98, '../internals/well-known-symbol': 122 }],
4531
- 88: [function (require, module, exports) {
5607
+ }, { '../internals/define-built-in': 56, '../internals/fails': 65, '../internals/is-callable': 87, '../internals/is-object': 90, '../internals/is-pure': 91, '../internals/object-create': 105, '../internals/object-get-prototype-of': 111, '../internals/well-known-symbol': 136 }],
5608
+ 101: [function (require, module, exports) {
4532
5609
  'use strict'
4533
5610
  module.exports = Object.create ? Object.create(null) : {}
4534
5611
  }, {}],
4535
- 89: [function (require, module, exports) {
5612
+ 102: [function (require, module, exports) {
4536
5613
  'use strict'
4537
5614
  const toLength = require('../internals/to-length')
4538
5615
 
@@ -4541,8 +5618,8 @@
4541
5618
  module.exports = function (obj) {
4542
5619
  return toLength(obj.length)
4543
5620
  }
4544
- }, { '../internals/to-length': 113 }],
4545
- 90: [function (require, module, exports) {
5621
+ }, { '../internals/to-length': 126 }],
5622
+ 103: [function (require, module, exports) {
4546
5623
  'use strict'
4547
5624
  const uncurryThis = require('../internals/function-uncurry-this')
4548
5625
  const fails = require('../internals/fails')
@@ -4598,8 +5675,8 @@
4598
5675
  Function.prototype.toString = makeBuiltIn(function toString () {
4599
5676
  return isCallable(this) && getInternalState(this).source || inspectSource(this)
4600
5677
  }, 'toString')
4601
- }, { '../internals/descriptors': 46, '../internals/fails': 52, '../internals/function-name': 57, '../internals/function-uncurry-this': 59, '../internals/has-own-property': 66, '../internals/inspect-source': 71, '../internals/internal-state': 72, '../internals/is-callable': 74 }],
4602
- 91: [function (require, module, exports) {
5678
+ }, { '../internals/descriptors': 59, '../internals/fails': 65, '../internals/function-name': 70, '../internals/function-uncurry-this': 72, '../internals/has-own-property': 79, '../internals/inspect-source': 84, '../internals/internal-state': 85, '../internals/is-callable': 87 }],
5679
+ 104: [function (require, module, exports) {
4603
5680
  'use strict'
4604
5681
  const ceil = Math.ceil
4605
5682
  const floor = Math.floor
@@ -4612,7 +5689,7 @@
4612
5689
  return (n > 0 ? floor : ceil)(n)
4613
5690
  }
4614
5691
  }, {}],
4615
- 92: [function (require, module, exports) {
5692
+ 105: [function (require, module, exports) {
4616
5693
  'use strict'
4617
5694
  /* global ActiveXObject -- old IE, WSH */
4618
5695
  const anObject = require('../internals/an-object')
@@ -4698,8 +5775,8 @@
4698
5775
  } else result = NullProtoObject()
4699
5776
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties)
4700
5777
  }
4701
- }, { '../internals/an-object': 32, '../internals/document-create-element': 47, '../internals/enum-bug-keys': 48, '../internals/hidden-keys': 67, '../internals/html': 68, '../internals/object-define-properties': 93, '../internals/shared-key': 106 }],
4702
- 93: [function (require, module, exports) {
5778
+ }, { '../internals/an-object': 45, '../internals/document-create-element': 60, '../internals/enum-bug-keys': 61, '../internals/hidden-keys': 80, '../internals/html': 81, '../internals/object-define-properties': 106, '../internals/shared-key': 119 }],
5779
+ 106: [function (require, module, exports) {
4703
5780
  'use strict'
4704
5781
  const DESCRIPTORS = require('../internals/descriptors')
4705
5782
  const V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug')
@@ -4723,8 +5800,8 @@
4723
5800
  while (length > index) definePropertyModule.f(O, key = keys[index++], props[key])
4724
5801
  return O
4725
5802
  }
4726
- }, { '../internals/an-object': 32, '../internals/descriptors': 46, '../internals/object-define-property': 94, '../internals/object-keys': 101, '../internals/to-indexed-object': 111, '../internals/v8-prototype-define-bug': 120 }],
4727
- 94: [function (require, module, exports) {
5803
+ }, { '../internals/an-object': 45, '../internals/descriptors': 59, '../internals/object-define-property': 107, '../internals/object-keys': 114, '../internals/to-indexed-object': 124, '../internals/v8-prototype-define-bug': 133 }],
5804
+ 107: [function (require, module, exports) {
4728
5805
  'use strict'
4729
5806
  const DESCRIPTORS = require('../internals/descriptors')
4730
5807
  const IE8_DOM_DEFINE = require('../internals/ie8-dom-define')
@@ -4773,8 +5850,8 @@
4773
5850
  if ('value' in Attributes) O[P] = Attributes.value
4774
5851
  return O
4775
5852
  }
4776
- }, { '../internals/an-object': 32, '../internals/descriptors': 46, '../internals/ie8-dom-define': 69, '../internals/to-property-key': 116, '../internals/v8-prototype-define-bug': 120 }],
4777
- 95: [function (require, module, exports) {
5853
+ }, { '../internals/an-object': 45, '../internals/descriptors': 59, '../internals/ie8-dom-define': 82, '../internals/to-property-key': 129, '../internals/v8-prototype-define-bug': 133 }],
5854
+ 108: [function (require, module, exports) {
4778
5855
  'use strict'
4779
5856
  const DESCRIPTORS = require('../internals/descriptors')
4780
5857
  const call = require('../internals/function-call')
@@ -4800,8 +5877,8 @@
4800
5877
  }
4801
5878
  if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P])
4802
5879
  }
4803
- }, { '../internals/create-property-descriptor': 40, '../internals/descriptors': 46, '../internals/function-call': 56, '../internals/has-own-property': 66, '../internals/ie8-dom-define': 69, '../internals/object-property-is-enumerable': 102, '../internals/to-indexed-object': 111, '../internals/to-property-key': 116 }],
4804
- 96: [function (require, module, exports) {
5880
+ }, { '../internals/create-property-descriptor': 53, '../internals/descriptors': 59, '../internals/function-call': 69, '../internals/has-own-property': 79, '../internals/ie8-dom-define': 82, '../internals/object-property-is-enumerable': 115, '../internals/to-indexed-object': 124, '../internals/to-property-key': 129 }],
5881
+ 109: [function (require, module, exports) {
4805
5882
  'use strict'
4806
5883
  const internalObjectKeys = require('../internals/object-keys-internal')
4807
5884
  const enumBugKeys = require('../internals/enum-bug-keys')
@@ -4814,13 +5891,13 @@
4814
5891
  exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames (O) {
4815
5892
  return internalObjectKeys(O, hiddenKeys)
4816
5893
  }
4817
- }, { '../internals/enum-bug-keys': 48, '../internals/object-keys-internal': 100 }],
4818
- 97: [function (require, module, exports) {
5894
+ }, { '../internals/enum-bug-keys': 61, '../internals/object-keys-internal': 113 }],
5895
+ 110: [function (require, module, exports) {
4819
5896
  'use strict'
4820
5897
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
4821
5898
  exports.f = Object.getOwnPropertySymbols
4822
5899
  }, {}],
4823
- 98: [function (require, module, exports) {
5900
+ 111: [function (require, module, exports) {
4824
5901
  'use strict'
4825
5902
  const hasOwn = require('../internals/has-own-property')
4826
5903
  const isCallable = require('../internals/is-callable')
@@ -4845,14 +5922,14 @@
4845
5922
  return constructor.prototype
4846
5923
  } return object instanceof $Object ? ObjectPrototype : null
4847
5924
  }
4848
- }, { '../internals/correct-prototype-getter': 37, '../internals/has-own-property': 66, '../internals/is-callable': 74, '../internals/shared-key': 106, '../internals/to-object': 114 }],
4849
- 99: [function (require, module, exports) {
5925
+ }, { '../internals/correct-prototype-getter': 50, '../internals/has-own-property': 79, '../internals/is-callable': 87, '../internals/shared-key': 119, '../internals/to-object': 127 }],
5926
+ 112: [function (require, module, exports) {
4850
5927
  'use strict'
4851
5928
  const uncurryThis = require('../internals/function-uncurry-this')
4852
5929
 
4853
5930
  module.exports = uncurryThis({}.isPrototypeOf)
4854
- }, { '../internals/function-uncurry-this': 59 }],
4855
- 100: [function (require, module, exports) {
5931
+ }, { '../internals/function-uncurry-this': 72 }],
5932
+ 113: [function (require, module, exports) {
4856
5933
  'use strict'
4857
5934
  const uncurryThis = require('../internals/function-uncurry-this')
4858
5935
  const hasOwn = require('../internals/has-own-property')
@@ -4876,8 +5953,8 @@
4876
5953
  }
4877
5954
  return result
4878
5955
  }
4879
- }, { '../internals/array-includes': 33, '../internals/function-uncurry-this': 59, '../internals/has-own-property': 66, '../internals/hidden-keys': 67, '../internals/to-indexed-object': 111 }],
4880
- 101: [function (require, module, exports) {
5956
+ }, { '../internals/array-includes': 46, '../internals/function-uncurry-this': 72, '../internals/has-own-property': 79, '../internals/hidden-keys': 80, '../internals/to-indexed-object': 124 }],
5957
+ 114: [function (require, module, exports) {
4881
5958
  'use strict'
4882
5959
  const internalObjectKeys = require('../internals/object-keys-internal')
4883
5960
  const enumBugKeys = require('../internals/enum-bug-keys')
@@ -4888,8 +5965,8 @@
4888
5965
  module.exports = Object.keys || function keys (O) {
4889
5966
  return internalObjectKeys(O, enumBugKeys)
4890
5967
  }
4891
- }, { '../internals/enum-bug-keys': 48, '../internals/object-keys-internal': 100 }],
4892
- 102: [function (require, module, exports) {
5968
+ }, { '../internals/enum-bug-keys': 61, '../internals/object-keys-internal': 113 }],
5969
+ 115: [function (require, module, exports) {
4893
5970
  'use strict'
4894
5971
  const $propertyIsEnumerable = {}.propertyIsEnumerable
4895
5972
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -4907,7 +5984,7 @@
4907
5984
  }
4908
5985
  : $propertyIsEnumerable
4909
5986
  }, {}],
4910
- 103: [function (require, module, exports) {
5987
+ 116: [function (require, module, exports) {
4911
5988
  'use strict'
4912
5989
  const call = require('../internals/function-call')
4913
5990
  const isCallable = require('../internals/is-callable')
@@ -4924,8 +6001,8 @@
4924
6001
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val
4925
6002
  throw new $TypeError("Can't convert object to primitive value")
4926
6003
  }
4927
- }, { '../internals/function-call': 56, '../internals/is-callable': 74, '../internals/is-object': 77 }],
4928
- 104: [function (require, module, exports) {
6004
+ }, { '../internals/function-call': 69, '../internals/is-callable': 87, '../internals/is-object': 90 }],
6005
+ 117: [function (require, module, exports) {
4929
6006
  'use strict'
4930
6007
  const getBuiltIn = require('../internals/get-built-in')
4931
6008
  const uncurryThis = require('../internals/function-uncurry-this')
@@ -4941,8 +6018,8 @@
4941
6018
  const getOwnPropertySymbols = getOwnPropertySymbolsModule.f
4942
6019
  return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys
4943
6020
  }
4944
- }, { '../internals/an-object': 32, '../internals/function-uncurry-this': 59, '../internals/get-built-in': 60, '../internals/object-get-own-property-names': 96, '../internals/object-get-own-property-symbols': 97 }],
4945
- 105: [function (require, module, exports) {
6021
+ }, { '../internals/an-object': 45, '../internals/function-uncurry-this': 72, '../internals/get-built-in': 73, '../internals/object-get-own-property-names': 109, '../internals/object-get-own-property-symbols': 110 }],
6022
+ 118: [function (require, module, exports) {
4946
6023
  'use strict'
4947
6024
  const isNullOrUndefined = require('../internals/is-null-or-undefined')
4948
6025
 
@@ -4954,8 +6031,8 @@
4954
6031
  if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it)
4955
6032
  return it
4956
6033
  }
4957
- }, { '../internals/is-null-or-undefined': 76 }],
4958
- 106: [function (require, module, exports) {
6034
+ }, { '../internals/is-null-or-undefined': 89 }],
6035
+ 119: [function (require, module, exports) {
4959
6036
  'use strict'
4960
6037
  const shared = require('../internals/shared')
4961
6038
  const uid = require('../internals/uid')
@@ -4965,8 +6042,8 @@
4965
6042
  module.exports = function (key) {
4966
6043
  return keys[key] || (keys[key] = uid(key))
4967
6044
  }
4968
- }, { '../internals/shared': 108, '../internals/uid': 118 }],
4969
- 107: [function (require, module, exports) {
6045
+ }, { '../internals/shared': 121, '../internals/uid': 131 }],
6046
+ 120: [function (require, module, exports) {
4970
6047
  'use strict'
4971
6048
  const IS_PURE = require('../internals/is-pure')
4972
6049
  const globalThis = require('../internals/global-this')
@@ -4982,8 +6059,8 @@
4982
6059
  license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
4983
6060
  source: 'https://github.com/zloirock/core-js'
4984
6061
  })
4985
- }, { '../internals/define-global-property': 45, '../internals/global-this': 65, '../internals/is-pure': 78 }],
4986
- 108: [function (require, module, exports) {
6062
+ }, { '../internals/define-global-property': 58, '../internals/global-this': 78, '../internals/is-pure': 91 }],
6063
+ 121: [function (require, module, exports) {
4987
6064
  'use strict'
4988
6065
  const store = require('../internals/shared-store')
4989
6066
  // eslint-disable-next-line es/no-object-create -- safe
@@ -4992,8 +6069,8 @@
4992
6069
  module.exports = function (key, value) {
4993
6070
  return store[key] || (store[key] = value || create(null))
4994
6071
  }
4995
- }, { '../internals/shared-store': 107 }],
4996
- 109: [function (require, module, exports) {
6072
+ }, { '../internals/shared-store': 120 }],
6073
+ 122: [function (require, module, exports) {
4997
6074
  'use strict'
4998
6075
  /* eslint-disable es/no-symbol -- required for testing */
4999
6076
  const V8_VERSION = require('../internals/environment-v8-version')
@@ -5013,8 +6090,8 @@
5013
6090
  // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
5014
6091
  !Symbol.sham && V8_VERSION && V8_VERSION < 41
5015
6092
  })
5016
- }, { '../internals/environment-v8-version': 50, '../internals/fails': 52, '../internals/global-this': 65 }],
5017
- 110: [function (require, module, exports) {
6093
+ }, { '../internals/environment-v8-version': 63, '../internals/fails': 65, '../internals/global-this': 78 }],
6094
+ 123: [function (require, module, exports) {
5018
6095
  'use strict'
5019
6096
  const toIntegerOrInfinity = require('../internals/to-integer-or-infinity')
5020
6097
 
@@ -5028,8 +6105,8 @@
5028
6105
  const integer = toIntegerOrInfinity(index)
5029
6106
  return integer < 0 ? max(integer + length, 0) : min(integer, length)
5030
6107
  }
5031
- }, { '../internals/to-integer-or-infinity': 112 }],
5032
- 111: [function (require, module, exports) {
6108
+ }, { '../internals/to-integer-or-infinity': 125 }],
6109
+ 124: [function (require, module, exports) {
5033
6110
  'use strict'
5034
6111
  // toObject with fallback for non-array-like ES3 strings
5035
6112
  const IndexedObject = require('../internals/indexed-object')
@@ -5038,8 +6115,8 @@
5038
6115
  module.exports = function (it) {
5039
6116
  return IndexedObject(requireObjectCoercible(it))
5040
6117
  }
5041
- }, { '../internals/indexed-object': 70, '../internals/require-object-coercible': 105 }],
5042
- 112: [function (require, module, exports) {
6118
+ }, { '../internals/indexed-object': 83, '../internals/require-object-coercible': 118 }],
6119
+ 125: [function (require, module, exports) {
5043
6120
  'use strict'
5044
6121
  const trunc = require('../internals/math-trunc')
5045
6122
 
@@ -5050,8 +6127,8 @@
5050
6127
  // eslint-disable-next-line no-self-compare -- NaN check
5051
6128
  return number !== number || number === 0 ? 0 : trunc(number)
5052
6129
  }
5053
- }, { '../internals/math-trunc': 91 }],
5054
- 113: [function (require, module, exports) {
6130
+ }, { '../internals/math-trunc': 104 }],
6131
+ 126: [function (require, module, exports) {
5055
6132
  'use strict'
5056
6133
  const toIntegerOrInfinity = require('../internals/to-integer-or-infinity')
5057
6134
 
@@ -5063,8 +6140,8 @@
5063
6140
  const len = toIntegerOrInfinity(argument)
5064
6141
  return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0 // 2 ** 53 - 1 == 9007199254740991
5065
6142
  }
5066
- }, { '../internals/to-integer-or-infinity': 112 }],
5067
- 114: [function (require, module, exports) {
6143
+ }, { '../internals/to-integer-or-infinity': 125 }],
6144
+ 127: [function (require, module, exports) {
5068
6145
  'use strict'
5069
6146
  const requireObjectCoercible = require('../internals/require-object-coercible')
5070
6147
 
@@ -5075,8 +6152,8 @@
5075
6152
  module.exports = function (argument) {
5076
6153
  return $Object(requireObjectCoercible(argument))
5077
6154
  }
5078
- }, { '../internals/require-object-coercible': 105 }],
5079
- 115: [function (require, module, exports) {
6155
+ }, { '../internals/require-object-coercible': 118 }],
6156
+ 128: [function (require, module, exports) {
5080
6157
  'use strict'
5081
6158
  const call = require('../internals/function-call')
5082
6159
  const isObject = require('../internals/is-object')
@@ -5103,8 +6180,8 @@
5103
6180
  if (pref === undefined) pref = 'number'
5104
6181
  return ordinaryToPrimitive(input, pref)
5105
6182
  }
5106
- }, { '../internals/function-call': 56, '../internals/get-method': 64, '../internals/is-object': 77, '../internals/is-symbol': 79, '../internals/ordinary-to-primitive': 103, '../internals/well-known-symbol': 122 }],
5107
- 116: [function (require, module, exports) {
6183
+ }, { '../internals/function-call': 69, '../internals/get-method': 77, '../internals/is-object': 90, '../internals/is-symbol': 92, '../internals/ordinary-to-primitive': 116, '../internals/well-known-symbol': 136 }],
6184
+ 129: [function (require, module, exports) {
5108
6185
  'use strict'
5109
6186
  const toPrimitive = require('../internals/to-primitive')
5110
6187
  const isSymbol = require('../internals/is-symbol')
@@ -5115,8 +6192,8 @@
5115
6192
  const key = toPrimitive(argument, 'string')
5116
6193
  return isSymbol(key) ? key : key + ''
5117
6194
  }
5118
- }, { '../internals/is-symbol': 79, '../internals/to-primitive': 115 }],
5119
- 117: [function (require, module, exports) {
6195
+ }, { '../internals/is-symbol': 92, '../internals/to-primitive': 128 }],
6196
+ 130: [function (require, module, exports) {
5120
6197
  'use strict'
5121
6198
  const $String = String
5122
6199
 
@@ -5128,7 +6205,7 @@
5128
6205
  }
5129
6206
  }
5130
6207
  }, {}],
5131
- 118: [function (require, module, exports) {
6208
+ 131: [function (require, module, exports) {
5132
6209
  'use strict'
5133
6210
  const uncurryThis = require('../internals/function-uncurry-this')
5134
6211
 
@@ -5139,8 +6216,8 @@
5139
6216
  module.exports = function (key) {
5140
6217
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36)
5141
6218
  }
5142
- }, { '../internals/function-uncurry-this': 59 }],
5143
- 119: [function (require, module, exports) {
6219
+ }, { '../internals/function-uncurry-this': 72 }],
6220
+ 132: [function (require, module, exports) {
5144
6221
  'use strict'
5145
6222
  /* eslint-disable es/no-symbol -- required for testing */
5146
6223
  const NATIVE_SYMBOL = require('../internals/symbol-constructor-detection')
@@ -5148,8 +6225,8 @@
5148
6225
  module.exports = NATIVE_SYMBOL &&
5149
6226
  !Symbol.sham &&
5150
6227
  typeof Symbol.iterator === 'symbol'
5151
- }, { '../internals/symbol-constructor-detection': 109 }],
5152
- 120: [function (require, module, exports) {
6228
+ }, { '../internals/symbol-constructor-detection': 122 }],
6229
+ 133: [function (require, module, exports) {
5153
6230
  'use strict'
5154
6231
  const DESCRIPTORS = require('../internals/descriptors')
5155
6232
  const fails = require('../internals/fails')
@@ -5163,8 +6240,8 @@
5163
6240
  writable: false
5164
6241
  }).prototype !== 42
5165
6242
  })
5166
- }, { '../internals/descriptors': 46, '../internals/fails': 52 }],
5167
- 121: [function (require, module, exports) {
6243
+ }, { '../internals/descriptors': 59, '../internals/fails': 65 }],
6244
+ 134: [function (require, module, exports) {
5168
6245
  'use strict'
5169
6246
  const globalThis = require('../internals/global-this')
5170
6247
  const isCallable = require('../internals/is-callable')
@@ -5172,8 +6249,24 @@
5172
6249
  const WeakMap = globalThis.WeakMap
5173
6250
 
5174
6251
  module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap))
5175
- }, { '../internals/global-this': 65, '../internals/is-callable': 74 }],
5176
- 122: [function (require, module, exports) {
6252
+ }, { '../internals/global-this': 78, '../internals/is-callable': 87 }],
6253
+ 135: [function (require, module, exports) {
6254
+ 'use strict'
6255
+ const uncurryThis = require('../internals/function-uncurry-this')
6256
+
6257
+ // eslint-disable-next-line es/no-weak-map -- safe
6258
+ const WeakMapPrototype = WeakMap.prototype
6259
+
6260
+ module.exports = {
6261
+ // eslint-disable-next-line es/no-weak-map -- safe
6262
+ WeakMap,
6263
+ set: uncurryThis(WeakMapPrototype.set),
6264
+ get: uncurryThis(WeakMapPrototype.get),
6265
+ has: uncurryThis(WeakMapPrototype.has),
6266
+ remove: uncurryThis(WeakMapPrototype.delete)
6267
+ }
6268
+ }, { '../internals/function-uncurry-this': 72 }],
6269
+ 136: [function (require, module, exports) {
5177
6270
  'use strict'
5178
6271
  const globalThis = require('../internals/global-this')
5179
6272
  const shared = require('../internals/shared')
@@ -5193,8 +6286,8 @@
5193
6286
  : createWellKnownSymbol('Symbol.' + name)
5194
6287
  } return WellKnownSymbolsStore[name]
5195
6288
  }
5196
- }, { '../internals/global-this': 65, '../internals/has-own-property': 66, '../internals/shared': 108, '../internals/symbol-constructor-detection': 109, '../internals/uid': 118, '../internals/use-symbol-as-uid': 119 }],
5197
- 123: [function (require, module, exports) {
6289
+ }, { '../internals/global-this': 78, '../internals/has-own-property': 79, '../internals/shared': 121, '../internals/symbol-constructor-detection': 122, '../internals/uid': 131, '../internals/use-symbol-as-uid': 132 }],
6290
+ 137: [function (require, module, exports) {
5198
6291
  'use strict'
5199
6292
  const $ = require('../internals/export')
5200
6293
  const globalThis = require('../internals/global-this')
@@ -5260,8 +6353,8 @@
5260
6353
  $({ global: true, constructor: true, forced: FORCED }, {
5261
6354
  Iterator: IteratorConstructor
5262
6355
  })
5263
- }, { '../internals/an-instance': 31, '../internals/an-object': 32, '../internals/create-property': 41, '../internals/define-built-in-accessor': 42, '../internals/descriptors': 46, '../internals/export': 51, '../internals/fails': 52, '../internals/global-this': 65, '../internals/has-own-property': 66, '../internals/is-callable': 74, '../internals/is-pure': 78, '../internals/iterators-core': 87, '../internals/object-get-prototype-of': 98, '../internals/well-known-symbol': 122 }],
5264
- 124: [function (require, module, exports) {
6356
+ }, { '../internals/an-instance': 44, '../internals/an-object': 45, '../internals/create-property': 54, '../internals/define-built-in-accessor': 55, '../internals/descriptors': 59, '../internals/export': 64, '../internals/fails': 65, '../internals/global-this': 78, '../internals/has-own-property': 79, '../internals/is-callable': 87, '../internals/is-pure': 91, '../internals/iterators-core': 100, '../internals/object-get-prototype-of': 111, '../internals/well-known-symbol': 136 }],
6357
+ 138: [function (require, module, exports) {
5265
6358
  'use strict'
5266
6359
  const $ = require('../internals/export')
5267
6360
  const call = require('../internals/function-call')
@@ -5313,8 +6406,8 @@
5313
6406
  })
5314
6407
  }
5315
6408
  })
5316
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/call-with-safe-iteration-closing': 34, '../internals/export': 51, '../internals/function-call': 56, '../internals/get-iterator-direct': 61, '../internals/is-pure': 78, '../internals/iterator-close': 83, '../internals/iterator-create-proxy': 84, '../internals/iterator-helper-throws-on-invalid-iterator': 85, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5317
- 125: [function (require, module, exports) {
6409
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/call-with-safe-iteration-closing': 47, '../internals/export': 64, '../internals/function-call': 69, '../internals/get-iterator-direct': 74, '../internals/is-pure': 91, '../internals/iterator-close': 96, '../internals/iterator-create-proxy': 97, '../internals/iterator-helper-throws-on-invalid-iterator': 98, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6410
+ 139: [function (require, module, exports) {
5318
6411
  'use strict'
5319
6412
  const $ = require('../internals/export')
5320
6413
  const call = require('../internals/function-call')
@@ -5347,8 +6440,8 @@
5347
6440
  }, { IS_RECORD: true, INTERRUPTED: true }).result
5348
6441
  }
5349
6442
  })
5350
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/export': 51, '../internals/function-call': 56, '../internals/get-iterator-direct': 61, '../internals/iterate': 80, '../internals/iterator-close': 83, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5351
- 126: [function (require, module, exports) {
6443
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/export': 64, '../internals/function-call': 69, '../internals/get-iterator-direct': 74, '../internals/iterate': 93, '../internals/iterator-close': 96, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6444
+ 140: [function (require, module, exports) {
5352
6445
  'use strict'
5353
6446
  const $ = require('../internals/export')
5354
6447
  const call = require('../internals/function-call')
@@ -5381,8 +6474,8 @@
5381
6474
  }, { IS_RECORD: true })
5382
6475
  }
5383
6476
  })
5384
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/export': 51, '../internals/function-call': 56, '../internals/get-iterator-direct': 61, '../internals/iterate': 80, '../internals/iterator-close': 83, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5385
- 127: [function (require, module, exports) {
6477
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/export': 64, '../internals/function-call': 69, '../internals/get-iterator-direct': 74, '../internals/iterate': 93, '../internals/iterator-close': 96, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6478
+ 141: [function (require, module, exports) {
5386
6479
  'use strict'
5387
6480
  const $ = require('../internals/export')
5388
6481
  const call = require('../internals/function-call')
@@ -5427,8 +6520,8 @@
5427
6520
  })
5428
6521
  }
5429
6522
  })
5430
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/call-with-safe-iteration-closing': 34, '../internals/export': 51, '../internals/function-call': 56, '../internals/get-iterator-direct': 61, '../internals/is-pure': 78, '../internals/iterator-close': 83, '../internals/iterator-create-proxy': 84, '../internals/iterator-helper-throws-on-invalid-iterator': 85, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5431
- 128: [function (require, module, exports) {
6523
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/call-with-safe-iteration-closing': 47, '../internals/export': 64, '../internals/function-call': 69, '../internals/get-iterator-direct': 74, '../internals/is-pure': 91, '../internals/iterator-close': 96, '../internals/iterator-create-proxy': 97, '../internals/iterator-helper-throws-on-invalid-iterator': 98, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6524
+ 142: [function (require, module, exports) {
5432
6525
  'use strict'
5433
6526
  const $ = require('../internals/export')
5434
6527
  const iterate = require('../internals/iterate')
@@ -5481,8 +6574,8 @@
5481
6574
  return accumulator
5482
6575
  }
5483
6576
  })
5484
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/export': 51, '../internals/fails': 52, '../internals/function-apply': 53, '../internals/get-iterator-direct': 61, '../internals/iterate': 80, '../internals/iterator-close': 83, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5485
- 129: [function (require, module, exports) {
6577
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/export': 64, '../internals/fails': 65, '../internals/function-apply': 66, '../internals/get-iterator-direct': 74, '../internals/iterate': 93, '../internals/iterator-close': 96, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6578
+ 143: [function (require, module, exports) {
5486
6579
  'use strict'
5487
6580
  const $ = require('../internals/export')
5488
6581
  const call = require('../internals/function-call')
@@ -5515,40 +6608,60 @@
5515
6608
  }, { IS_RECORD: true, INTERRUPTED: true }).stopped
5516
6609
  }
5517
6610
  })
5518
- }, { '../internals/a-callable': 30, '../internals/an-object': 32, '../internals/export': 51, '../internals/function-call': 56, '../internals/get-iterator-direct': 61, '../internals/iterate': 80, '../internals/iterator-close': 83, '../internals/iterator-helper-without-closing-on-early-error': 86 }],
5519
- 130: [function (require, module, exports) {
6611
+ }, { '../internals/a-callable': 42, '../internals/an-object': 45, '../internals/export': 64, '../internals/function-call': 69, '../internals/get-iterator-direct': 74, '../internals/iterate': 93, '../internals/iterator-close': 96, '../internals/iterator-helper-without-closing-on-early-error': 99 }],
6612
+ 144: [function (require, module, exports) {
5520
6613
  'use strict'
5521
6614
  // TODO: Remove from `core-js@4`
5522
6615
  require('../modules/es.iterator.constructor')
5523
- }, { '../modules/es.iterator.constructor': 123 }],
5524
- 131: [function (require, module, exports) {
6616
+ }, { '../modules/es.iterator.constructor': 137 }],
6617
+ 145: [function (require, module, exports) {
5525
6618
  'use strict'
5526
6619
  // TODO: Remove from `core-js@4`
5527
6620
  require('../modules/es.iterator.filter')
5528
- }, { '../modules/es.iterator.filter': 124 }],
5529
- 132: [function (require, module, exports) {
6621
+ }, { '../modules/es.iterator.filter': 138 }],
6622
+ 146: [function (require, module, exports) {
5530
6623
  'use strict'
5531
6624
  // TODO: Remove from `core-js@4`
5532
6625
  require('../modules/es.iterator.find')
5533
- }, { '../modules/es.iterator.find': 125 }],
5534
- 133: [function (require, module, exports) {
6626
+ }, { '../modules/es.iterator.find': 139 }],
6627
+ 147: [function (require, module, exports) {
5535
6628
  'use strict'
5536
6629
  // TODO: Remove from `core-js@4`
5537
6630
  require('../modules/es.iterator.for-each')
5538
- }, { '../modules/es.iterator.for-each': 126 }],
5539
- 134: [function (require, module, exports) {
6631
+ }, { '../modules/es.iterator.for-each': 140 }],
6632
+ 148: [function (require, module, exports) {
5540
6633
  'use strict'
5541
6634
  // TODO: Remove from `core-js@4`
5542
6635
  require('../modules/es.iterator.map')
5543
- }, { '../modules/es.iterator.map': 127 }],
5544
- 135: [function (require, module, exports) {
6636
+ }, { '../modules/es.iterator.map': 141 }],
6637
+ 149: [function (require, module, exports) {
5545
6638
  'use strict'
5546
6639
  // TODO: Remove from `core-js@4`
5547
6640
  require('../modules/es.iterator.reduce')
5548
- }, { '../modules/es.iterator.reduce': 128 }],
5549
- 136: [function (require, module, exports) {
6641
+ }, { '../modules/es.iterator.reduce': 142 }],
6642
+ 150: [function (require, module, exports) {
5550
6643
  'use strict'
5551
6644
  // TODO: Remove from `core-js@4`
5552
6645
  require('../modules/es.iterator.some')
5553
- }, { '../modules/es.iterator.some': 129 }]
5554
- }, {}, [8])
6646
+ }, { '../modules/es.iterator.some': 143 }],
6647
+ 151: [function (require, module, exports) {
6648
+ 'use strict'
6649
+ const $ = require('../internals/export')
6650
+ const aWeakMap = require('../internals/a-weak-map')
6651
+ const remove = require('../internals/weak-map-helpers').remove
6652
+
6653
+ // `WeakMap.prototype.deleteAll` method
6654
+ // https://github.com/tc39/proposal-collection-methods
6655
+ $({ target: 'WeakMap', proto: true, real: true, forced: true }, {
6656
+ deleteAll: function deleteAll (/* ...elements */) {
6657
+ const collection = aWeakMap(this)
6658
+ let allDeleted = true
6659
+ let wasDeleted
6660
+ for (let k = 0, len = arguments.length; k < len; k++) {
6661
+ wasDeleted = remove(collection, arguments[k])
6662
+ allDeleted = allDeleted && wasDeleted
6663
+ } return !!allDeleted
6664
+ }
6665
+ })
6666
+ }, { '../internals/a-weak-map': 43, '../internals/export': 64, '../internals/weak-map-helpers': 135 }]
6667
+ }, {}, [12])