wcs-core 2.5.4 → 2.9.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 (297) hide show
  1. package/CHANGELOG.md +132 -5
  2. package/README.md +19 -1
  3. package/dist/cjs/component-fc28ed16.js +1074 -0
  4. package/dist/cjs/helpers-6abce594.js +86 -0
  5. package/dist/cjs/{index-e05c3e1f.js → index-3cb9d725.js} +165 -87
  6. package/dist/cjs/loader.cjs.js +3 -3
  7. package/dist/{esm/wcs-action-bar_47.entry.js → cjs/lodash-776d6f03.js} +12499 -22628
  8. package/dist/cjs/popper-5777994b.js +1732 -0
  9. package/dist/cjs/select-arrow-76ccf86d.js +36 -0
  10. package/dist/cjs/wcs-action-bar.cjs.entry.js +24 -0
  11. package/dist/cjs/wcs-app.cjs.entry.js +2 -2
  12. package/dist/cjs/wcs-badge.cjs.entry.js +27 -0
  13. package/dist/cjs/wcs-button.cjs.entry.js +86 -0
  14. package/dist/cjs/wcs-card-body.cjs.entry.js +19 -0
  15. package/dist/cjs/wcs-card.cjs.entry.js +20 -0
  16. package/dist/cjs/wcs-checkbox.cjs.entry.js +47 -0
  17. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +63 -0
  18. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +69 -0
  19. package/dist/cjs/wcs-com-nav.cjs.entry.js +19 -0
  20. package/dist/cjs/wcs-divider.cjs.entry.js +19 -0
  21. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  22. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  23. package/dist/cjs/wcs-dropdown-item.cjs.entry.js +23 -0
  24. package/dist/cjs/wcs-dropdown.cjs.entry.js +90 -0
  25. package/dist/cjs/wcs-editable-field.cjs.entry.js +225 -0
  26. package/dist/cjs/wcs-error_2.cjs.entry.js +137 -0
  27. package/dist/cjs/wcs-field-content.cjs.entry.js +16 -0
  28. package/dist/cjs/wcs-field-label.cjs.entry.js +16 -0
  29. package/dist/cjs/wcs-field.cjs.entry.js +19 -0
  30. package/dist/cjs/wcs-footer.cjs.entry.js +19 -0
  31. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +58 -0
  32. package/dist/cjs/wcs-galactic.cjs.entry.js +41 -0
  33. package/dist/cjs/wcs-grid-column.cjs.entry.js +77 -0
  34. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js +16 -0
  35. package/dist/cjs/wcs-grid-pagination.cjs.entry.js +4 -4
  36. package/dist/cjs/wcs-grid.cjs.entry.js +332 -0
  37. package/dist/cjs/wcs-header.cjs.entry.js +25 -0
  38. package/dist/cjs/wcs-hint.cjs.entry.js +20 -0
  39. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +114 -0
  40. package/dist/cjs/wcs-icon.cjs.entry.js +2 -2
  41. package/dist/cjs/wcs-input.cjs.entry.js +228 -0
  42. package/dist/cjs/wcs-label.cjs.entry.js +20 -0
  43. package/dist/cjs/wcs-list-item-properties.cjs.entry.js +19 -0
  44. package/dist/cjs/wcs-list-item-property.cjs.entry.js +19 -0
  45. package/dist/cjs/wcs-list-item.cjs.entry.js +23 -0
  46. package/dist/cjs/wcs-mat-icon.cjs.entry.js +73 -0
  47. package/dist/cjs/wcs-modal.cjs.entry.js +50 -0
  48. package/dist/cjs/wcs-nav-item.cjs.entry.js +23 -0
  49. package/dist/cjs/wcs-nav.cjs.entry.js +19 -0
  50. package/dist/cjs/wcs-progress-bar.cjs.entry.js +47 -0
  51. package/dist/cjs/wcs-progress-radial.cjs.entry.js +30 -0
  52. package/dist/cjs/wcs-radio-group.cjs.entry.js +65 -0
  53. package/dist/cjs/wcs-radio.cjs.entry.js +49 -0
  54. package/dist/cjs/wcs-select_2.cjs.entry.js +4916 -0
  55. package/dist/cjs/wcs-spinner.cjs.entry.js +21 -0
  56. package/dist/cjs/wcs-switch.cjs.entry.js +42 -0
  57. package/dist/cjs/wcs-tab.cjs.entry.js +20 -0
  58. package/dist/cjs/wcs-tabs.cjs.entry.js +159 -0
  59. package/dist/cjs/wcs-textarea.cjs.entry.js +224 -0
  60. package/dist/cjs/wcs-tooltip.cjs.entry.js +1635 -0
  61. package/dist/cjs/wcs.cjs.js +3 -3
  62. package/dist/collection/collection-manifest.json +5 -2
  63. package/dist/collection/components/badge/badge-interface.js +1 -0
  64. package/dist/collection/components/badge/badge.js +14 -4
  65. package/dist/collection/components/button/button.css +79 -75
  66. package/dist/collection/components/button/button.js +23 -11
  67. package/dist/collection/components/card/card-interface.js +1 -0
  68. package/dist/collection/components/card/card.js +7 -2
  69. package/dist/collection/components/checkbox/checkbox.css +18 -7
  70. package/dist/collection/components/checkbox/checkbox.js +24 -2
  71. package/dist/collection/components/com-nav/com-nav.css +1 -2
  72. package/dist/collection/components/com-nav-category/com-nav-category.css +5 -6
  73. package/dist/collection/components/com-nav-category/com-nav-category.js +31 -1
  74. package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +1 -2
  75. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +21 -1
  76. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  77. package/dist/collection/components/dropdown/dropdown.css +46 -38
  78. package/dist/collection/components/dropdown/dropdown.js +90 -29
  79. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  80. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  81. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  82. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  83. package/dist/collection/components/editable-field/editable-field.js +7 -2
  84. package/dist/collection/components/footer/footer.css +1 -1
  85. package/dist/collection/components/form-field/form-field.css +1 -2
  86. package/dist/collection/components/form-field/form-field.js +0 -17
  87. package/dist/collection/components/grid/grid.js +75 -13
  88. package/dist/collection/components/grid-column/grid-column.css +5 -0
  89. package/dist/collection/components/grid-column/grid-column.js +70 -4
  90. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +45 -0
  91. package/dist/collection/components/grid-pagination/grid-pagination.js +4 -4
  92. package/dist/collection/components/header/header.css +1 -1
  93. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +7 -2
  94. package/dist/collection/components/input/input.css +48 -0
  95. package/dist/collection/components/input/input.js +40 -4
  96. package/dist/collection/components/mat-icon/mat-icon.css +1 -1
  97. package/dist/collection/components/mat-icon/mat-icon.js +7 -2
  98. package/dist/collection/components/modal/modal-interface.js +1 -0
  99. package/dist/collection/components/modal/modal.css +26 -7
  100. package/dist/collection/components/modal/modal.js +35 -7
  101. package/dist/collection/components/nav-item/nav-item.js +1 -1
  102. package/dist/collection/components/progress-bar/progress-bar.js +4 -4
  103. package/dist/collection/components/radio/radio.component.js +9 -4
  104. package/dist/collection/components/radio/radio.css +44 -19
  105. package/dist/collection/components/radio-group/radio-group.css +5 -1
  106. package/dist/collection/components/radio-group/radio-group.js +10 -5
  107. package/dist/collection/components/select/select.css +81 -77
  108. package/dist/collection/components/select/select.js +2 -2
  109. package/dist/collection/components/select-option/select-option.css +79 -75
  110. package/dist/collection/components/select-option/select-option.js +6 -7
  111. package/dist/collection/components/spinner/spinner-interface.js +1 -0
  112. package/dist/collection/components/spinner/spinner.js +8 -3
  113. package/dist/collection/components/switch/switch.css +53 -16
  114. package/dist/collection/components/switch/switch.js +55 -6
  115. package/dist/collection/components/tab/tab.js +5 -5
  116. package/dist/collection/components/tabs/tabs.js +2 -2
  117. package/dist/collection/components/textarea/textarea.css +4 -0
  118. package/dist/collection/components/textarea/textarea.js +2 -2
  119. package/dist/collection/components/tooltip/tooltip.css +3 -0
  120. package/dist/collection/components/tooltip/tooltip.js +310 -92
  121. package/dist/collection/utils/helpers.js +4 -0
  122. package/dist/esm/component-6b4d470f.js +1072 -0
  123. package/dist/esm/helpers-e2993152.js +77 -0
  124. package/dist/esm/{index-c619b1fa.js → index-b982604a.js} +165 -88
  125. package/dist/esm/loader.js +3 -3
  126. package/dist/{cjs/wcs-action-bar_47.cjs.entry.js → esm/lodash-d6d9d079.js} +12610 -22791
  127. package/dist/esm/popper-5f42e560.js +1729 -0
  128. package/dist/esm/select-arrow-73ac4016.js +34 -0
  129. package/dist/esm/wcs-action-bar.entry.js +20 -0
  130. package/dist/esm/wcs-app.entry.js +2 -2
  131. package/dist/esm/wcs-badge.entry.js +23 -0
  132. package/dist/esm/wcs-button.entry.js +82 -0
  133. package/dist/esm/wcs-card-body.entry.js +15 -0
  134. package/dist/esm/wcs-card.entry.js +16 -0
  135. package/dist/esm/wcs-checkbox.entry.js +43 -0
  136. package/dist/esm/wcs-com-nav-category.entry.js +59 -0
  137. package/dist/esm/wcs-com-nav-submenu.entry.js +65 -0
  138. package/dist/esm/wcs-com-nav.entry.js +15 -0
  139. package/dist/esm/wcs-divider.entry.js +15 -0
  140. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  141. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  142. package/dist/esm/wcs-dropdown-item.entry.js +19 -0
  143. package/dist/esm/wcs-dropdown.entry.js +86 -0
  144. package/dist/esm/wcs-editable-field.entry.js +221 -0
  145. package/dist/esm/wcs-error_2.entry.js +132 -0
  146. package/dist/esm/wcs-field-content.entry.js +12 -0
  147. package/dist/esm/wcs-field-label.entry.js +12 -0
  148. package/dist/esm/wcs-field.entry.js +15 -0
  149. package/dist/esm/wcs-footer.entry.js +15 -0
  150. package/dist/esm/wcs-galactic-menu.entry.js +54 -0
  151. package/dist/esm/wcs-galactic.entry.js +37 -0
  152. package/dist/esm/wcs-grid-column.entry.js +73 -0
  153. package/dist/esm/wcs-grid-custom-cell.entry.js +12 -0
  154. package/dist/esm/wcs-grid-pagination.entry.js +4 -4
  155. package/dist/esm/wcs-grid.entry.js +328 -0
  156. package/dist/esm/wcs-header.entry.js +21 -0
  157. package/dist/esm/wcs-hint.entry.js +16 -0
  158. package/dist/esm/wcs-horizontal-stepper.entry.js +110 -0
  159. package/dist/esm/wcs-icon.entry.js +2 -2
  160. package/dist/esm/wcs-input.entry.js +224 -0
  161. package/dist/esm/wcs-label.entry.js +16 -0
  162. package/dist/esm/wcs-list-item-properties.entry.js +15 -0
  163. package/dist/esm/wcs-list-item-property.entry.js +15 -0
  164. package/dist/esm/wcs-list-item.entry.js +19 -0
  165. package/dist/esm/wcs-mat-icon.entry.js +69 -0
  166. package/dist/esm/wcs-modal.entry.js +46 -0
  167. package/dist/esm/wcs-nav-item.entry.js +19 -0
  168. package/dist/esm/wcs-nav.entry.js +15 -0
  169. package/dist/esm/wcs-progress-bar.entry.js +43 -0
  170. package/dist/esm/wcs-progress-radial.entry.js +26 -0
  171. package/dist/esm/wcs-radio-group.entry.js +61 -0
  172. package/dist/esm/wcs-radio.entry.js +45 -0
  173. package/dist/esm/wcs-select_2.entry.js +4911 -0
  174. package/dist/esm/wcs-spinner.entry.js +17 -0
  175. package/dist/esm/wcs-switch.entry.js +38 -0
  176. package/dist/esm/wcs-tab.entry.js +16 -0
  177. package/dist/esm/wcs-tabs.entry.js +155 -0
  178. package/dist/esm/wcs-textarea.entry.js +220 -0
  179. package/dist/esm/wcs-tooltip.entry.js +1631 -0
  180. package/dist/esm/wcs.js +3 -3
  181. package/dist/types/components/badge/badge-interface.d.ts +2 -0
  182. package/dist/types/components/badge/badge.d.ts +3 -2
  183. package/dist/types/components/button/button.d.ts +7 -3
  184. package/dist/types/components/card/card-interface.d.ts +1 -0
  185. package/dist/types/components/card/card.d.ts +2 -1
  186. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  187. package/dist/types/components/com-nav-category/com-nav-category.d.ts +7 -0
  188. package/dist/types/components/com-nav-submenu/com-nav-submenu.d.ts +7 -0
  189. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  190. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  191. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  192. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  193. package/dist/types/components/editable-field/editable-field-interface.d.ts +1 -0
  194. package/dist/types/components/editable-field/editable-field.d.ts +2 -2
  195. package/dist/types/components/form-field/form-field.d.ts +0 -4
  196. package/dist/types/components/grid/grid.d.ts +18 -0
  197. package/dist/types/components/grid-column/grid-column.d.ts +6 -1
  198. package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +12 -0
  199. package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +1 -0
  200. package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +2 -2
  201. package/dist/types/components/input/input.d.ts +8 -0
  202. package/dist/types/components/mat-icon/mat-icon-interface.d.ts +1 -0
  203. package/dist/types/components/mat-icon/mat-icon.d.ts +2 -2
  204. package/dist/types/components/modal/modal-interface.d.ts +1 -0
  205. package/dist/types/components/modal/modal.d.ts +7 -1
  206. package/dist/types/components/radio/radio.component.d.ts +2 -1
  207. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  208. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  209. package/dist/types/components/select-option/select-option.d.ts +2 -0
  210. package/dist/types/components/spinner/spinner-interface.d.ts +1 -0
  211. package/dist/types/components/spinner/spinner.d.ts +2 -1
  212. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  213. package/dist/types/components/switch/switch.d.ts +10 -2
  214. package/dist/types/components/tooltip/tooltip.d.ts +70 -6
  215. package/dist/types/components.d.ts +253 -41
  216. package/dist/types/interfaces.d.ts +22 -0
  217. package/dist/types/stencil-public-runtime.d.ts +189 -186
  218. package/dist/types/utils/helpers.d.ts +1 -0
  219. package/dist/wcs/p-03b2e238.entry.js +1 -0
  220. package/dist/wcs/p-08a7e84d.entry.js +1 -0
  221. package/dist/wcs/p-16dfbae8.js +127 -0
  222. package/dist/wcs/p-1dce7e63.entry.js +1 -0
  223. package/dist/wcs/p-1f5aed36.entry.js +1 -0
  224. package/dist/wcs/p-214236db.entry.js +1 -0
  225. package/dist/wcs/p-22813c8e.entry.js +1 -0
  226. package/dist/wcs/p-26b5c0a3.entry.js +1 -0
  227. package/dist/wcs/p-2e6265dc.entry.js +1 -0
  228. package/dist/wcs/p-384068f7.entry.js +1 -0
  229. package/dist/wcs/p-41037455.entry.js +1 -0
  230. package/dist/wcs/p-474d6601.entry.js +1 -0
  231. package/dist/wcs/p-4e9e226d.entry.js +1 -0
  232. package/dist/wcs/p-55fdc284.entry.js +1 -0
  233. package/dist/wcs/p-5b35b232.entry.js +1 -0
  234. package/dist/wcs/p-600a9cc0.entry.js +1 -0
  235. package/dist/wcs/p-60b51967.entry.js +1 -0
  236. package/dist/wcs/p-65c5ccc5.entry.js +1 -0
  237. package/dist/wcs/p-688fea65.entry.js +1 -0
  238. package/dist/wcs/p-716d5921.entry.js +1 -0
  239. package/dist/wcs/p-7206e492.entry.js +1 -0
  240. package/dist/wcs/p-7219c04b.js +1 -0
  241. package/dist/wcs/p-7c26f650.entry.js +1 -0
  242. package/dist/wcs/p-8137f075.entry.js +1 -0
  243. package/dist/wcs/p-8864a491.entry.js +1 -0
  244. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  245. package/dist/wcs/p-91a2de07.entry.js +1 -0
  246. package/dist/wcs/p-94a31f64.entry.js +1 -0
  247. package/dist/wcs/p-9619f77a.entry.js +1 -0
  248. package/dist/wcs/p-979dfd78.entry.js +1 -0
  249. package/dist/wcs/p-9ba52bc4.entry.js +1 -0
  250. package/dist/wcs/p-a1ee1551.entry.js +1 -0
  251. package/dist/wcs/p-a92d369e.entry.js +1 -0
  252. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  253. package/dist/wcs/p-adef7aaf.js +1 -0
  254. package/dist/wcs/p-b5ffbea8.entry.js +1 -0
  255. package/dist/wcs/p-b7184d59.entry.js +1 -0
  256. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  257. package/dist/wcs/p-c7d6d3e1.entry.js +15 -0
  258. package/dist/wcs/p-cf4d7a83.js +1 -0
  259. package/dist/wcs/p-d3c9a644.js +1 -0
  260. package/dist/wcs/p-db68379f.entry.js +1 -0
  261. package/dist/wcs/p-dbbc3f58.entry.js +1 -0
  262. package/dist/wcs/p-dc817204.entry.js +1 -0
  263. package/dist/wcs/p-e0163de8.entry.js +1 -0
  264. package/dist/wcs/p-e4236d32.entry.js +1 -0
  265. package/dist/wcs/p-e43358e4.entry.js +1 -0
  266. package/dist/wcs/p-e9ce507c.entry.js +1 -0
  267. package/dist/wcs/p-ecbe5165.entry.js +6 -0
  268. package/dist/wcs/p-f430a227.entry.js +1 -0
  269. package/dist/wcs/p-f46e6c3c.js +1 -0
  270. package/dist/wcs/p-f96bb0bf.entry.js +1 -0
  271. package/dist/wcs/p-f9944bde.entry.js +1 -0
  272. package/dist/wcs/p-fa173947.entry.js +1 -0
  273. package/dist/wcs/p-fb1577b5.entry.js +1 -0
  274. package/dist/wcs/p-febe9ccc.entry.js +1 -0
  275. package/dist/wcs/p-ff6d0dfd.entry.js +1 -0
  276. package/dist/wcs/wcs.css +1 -1
  277. package/dist/wcs/wcs.esm.js +1 -1
  278. package/loader/index.d.ts +0 -1
  279. package/package.json +25 -22
  280. package/dist/types/interface.d.ts +0 -3
  281. package/dist/wcs/p-16dca526.entry.js +0 -1
  282. package/dist/wcs/p-4f228fcb.entry.js +0 -134
  283. package/dist/wcs/p-66520e5a.entry.js +0 -1
  284. package/dist/wcs/p-d31287c6.entry.js +0 -1
  285. package/dist/wcs/p-f73f235b.js +0 -1
  286. package/schematics/.gitignore +0 -18
  287. package/schematics/.npmignore +0 -4
  288. package/schematics/collection.json +0 -9
  289. package/schematics/src/ng-add/files/fonts/avenir-black.woff +0 -0
  290. package/schematics/src/ng-add/files/fonts/avenir-book.woff +0 -0
  291. package/schematics/src/ng-add/files/fonts/avenir-lighter.woff +0 -0
  292. package/schematics/src/ng-add/files/fonts/avenir-medium.woff +0 -0
  293. package/schematics/src/ng-add/files/sncf-logo.png +0 -0
  294. package/schematics/src/ng-add/index.d.ts +0 -3
  295. package/schematics/src/ng-add/index.js +0 -119
  296. package/schematics/src/ng-add/index.js.map +0 -1
  297. package/schematics/src/ng-add/schema.json +0 -5
@@ -0,0 +1,1635 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-3cb9d725.js');
6
+ const popper = require('./popper-5777994b.js');
7
+
8
+ /**!
9
+ * tippy.js v6.3.7
10
+ * (c) 2017-2021 atomiks
11
+ * MIT License
12
+ */
13
+ var BOX_CLASS = "tippy-box";
14
+ var CONTENT_CLASS = "tippy-content";
15
+ var BACKDROP_CLASS = "tippy-backdrop";
16
+ var ARROW_CLASS = "tippy-arrow";
17
+ var SVG_ARROW_CLASS = "tippy-svg-arrow";
18
+ var TOUCH_OPTIONS = {
19
+ passive: true,
20
+ capture: true
21
+ };
22
+ var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
23
+ return document.body;
24
+ };
25
+ function getValueAtIndexOrReturn(value, index, defaultValue) {
26
+ if (Array.isArray(value)) {
27
+ var v = value[index];
28
+ return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
29
+ }
30
+
31
+ return value;
32
+ }
33
+ function isType(value, type) {
34
+ var str = {}.toString.call(value);
35
+ return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
36
+ }
37
+ function invokeWithArgsOrReturn(value, args) {
38
+ return typeof value === 'function' ? value.apply(void 0, args) : value;
39
+ }
40
+ function debounce(fn, ms) {
41
+ // Avoid wrapping in `setTimeout` if ms is 0 anyway
42
+ if (ms === 0) {
43
+ return fn;
44
+ }
45
+
46
+ var timeout;
47
+ return function (arg) {
48
+ clearTimeout(timeout);
49
+ timeout = setTimeout(function () {
50
+ fn(arg);
51
+ }, ms);
52
+ };
53
+ }
54
+ function splitBySpaces(value) {
55
+ return value.split(/\s+/).filter(Boolean);
56
+ }
57
+ function normalizeToArray(value) {
58
+ return [].concat(value);
59
+ }
60
+ function pushIfUnique(arr, value) {
61
+ if (arr.indexOf(value) === -1) {
62
+ arr.push(value);
63
+ }
64
+ }
65
+ function unique(arr) {
66
+ return arr.filter(function (item, index) {
67
+ return arr.indexOf(item) === index;
68
+ });
69
+ }
70
+ function getBasePlacement(placement) {
71
+ return placement.split('-')[0];
72
+ }
73
+ function arrayFrom(value) {
74
+ return [].slice.call(value);
75
+ }
76
+ function removeUndefinedProps(obj) {
77
+ return Object.keys(obj).reduce(function (acc, key) {
78
+ if (obj[key] !== undefined) {
79
+ acc[key] = obj[key];
80
+ }
81
+
82
+ return acc;
83
+ }, {});
84
+ }
85
+
86
+ function div() {
87
+ return document.createElement('div');
88
+ }
89
+ function isElement(value) {
90
+ return ['Element', 'Fragment'].some(function (type) {
91
+ return isType(value, type);
92
+ });
93
+ }
94
+ function isNodeList(value) {
95
+ return isType(value, 'NodeList');
96
+ }
97
+ function isMouseEvent(value) {
98
+ return isType(value, 'MouseEvent');
99
+ }
100
+ function isReferenceElement(value) {
101
+ return !!(value && value._tippy && value._tippy.reference === value);
102
+ }
103
+ function getArrayOfElements(value) {
104
+ if (isElement(value)) {
105
+ return [value];
106
+ }
107
+
108
+ if (isNodeList(value)) {
109
+ return arrayFrom(value);
110
+ }
111
+
112
+ if (Array.isArray(value)) {
113
+ return value;
114
+ }
115
+
116
+ return arrayFrom(document.querySelectorAll(value));
117
+ }
118
+ function setTransitionDuration(els, value) {
119
+ els.forEach(function (el) {
120
+ if (el) {
121
+ el.style.transitionDuration = value + "ms";
122
+ }
123
+ });
124
+ }
125
+ function setVisibilityState(els, state) {
126
+ els.forEach(function (el) {
127
+ if (el) {
128
+ el.setAttribute('data-state', state);
129
+ }
130
+ });
131
+ }
132
+ function getOwnerDocument(elementOrElements) {
133
+ var _element$ownerDocumen;
134
+
135
+ var _normalizeToArray = normalizeToArray(elementOrElements),
136
+ element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
137
+
138
+
139
+ return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
140
+ }
141
+ function isCursorOutsideInteractiveBorder(popperTreeData, event) {
142
+ var clientX = event.clientX,
143
+ clientY = event.clientY;
144
+ return popperTreeData.every(function (_ref) {
145
+ var popperRect = _ref.popperRect,
146
+ popperState = _ref.popperState,
147
+ props = _ref.props;
148
+ var interactiveBorder = props.interactiveBorder;
149
+ var basePlacement = getBasePlacement(popperState.placement);
150
+ var offsetData = popperState.modifiersData.offset;
151
+
152
+ if (!offsetData) {
153
+ return true;
154
+ }
155
+
156
+ var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;
157
+ var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;
158
+ var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;
159
+ var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;
160
+ var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
161
+ var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
162
+ var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
163
+ var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
164
+ return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
165
+ });
166
+ }
167
+ function updateTransitionEndListener(box, action, listener) {
168
+ var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire
169
+ // `webkitTransitionEnd`...
170
+
171
+ ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
172
+ box[method](event, listener);
173
+ });
174
+ }
175
+ /**
176
+ * Compared to xxx.contains, this function works for dom structures with shadow
177
+ * dom
178
+ */
179
+
180
+ function actualContains(parent, child) {
181
+ var target = child;
182
+
183
+ while (target) {
184
+ var _target$getRootNode;
185
+
186
+ if (parent.contains(target)) {
187
+ return true;
188
+ }
189
+
190
+ target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
191
+ }
192
+
193
+ return false;
194
+ }
195
+
196
+ var currentInput = {
197
+ isTouch: false
198
+ };
199
+ var lastMouseMoveTime = 0;
200
+ /**
201
+ * When a `touchstart` event is fired, it's assumed the user is using touch
202
+ * input. We'll bind a `mousemove` event listener to listen for mouse input in
203
+ * the future. This way, the `isTouch` property is fully dynamic and will handle
204
+ * hybrid devices that use a mix of touch + mouse input.
205
+ */
206
+
207
+ function onDocumentTouchStart() {
208
+ if (currentInput.isTouch) {
209
+ return;
210
+ }
211
+
212
+ currentInput.isTouch = true;
213
+
214
+ if (window.performance) {
215
+ document.addEventListener('mousemove', onDocumentMouseMove);
216
+ }
217
+ }
218
+ /**
219
+ * When two `mousemove` event are fired consecutively within 20ms, it's assumed
220
+ * the user is using mouse input again. `mousemove` can fire on touch devices as
221
+ * well, but very rarely that quickly.
222
+ */
223
+
224
+ function onDocumentMouseMove() {
225
+ var now = performance.now();
226
+
227
+ if (now - lastMouseMoveTime < 20) {
228
+ currentInput.isTouch = false;
229
+ document.removeEventListener('mousemove', onDocumentMouseMove);
230
+ }
231
+
232
+ lastMouseMoveTime = now;
233
+ }
234
+ /**
235
+ * When an element is in focus and has a tippy, leaving the tab/window and
236
+ * returning causes it to show again. For mouse users this is unexpected, but
237
+ * for keyboard use it makes sense.
238
+ * TODO: find a better technique to solve this problem
239
+ */
240
+
241
+ function onWindowBlur() {
242
+ var activeElement = document.activeElement;
243
+
244
+ if (isReferenceElement(activeElement)) {
245
+ var instance = activeElement._tippy;
246
+
247
+ if (activeElement.blur && !instance.state.isVisible) {
248
+ activeElement.blur();
249
+ }
250
+ }
251
+ }
252
+ function bindGlobalEventListeners() {
253
+ document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
254
+ window.addEventListener('blur', onWindowBlur);
255
+ }
256
+
257
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
258
+ var isIE11 = isBrowser ? // @ts-ignore
259
+ !!window.msCrypto : false;
260
+
261
+ var pluginProps = {
262
+ animateFill: false,
263
+ followCursor: false,
264
+ inlinePositioning: false,
265
+ sticky: false
266
+ };
267
+ var renderProps = {
268
+ allowHTML: false,
269
+ animation: 'fade',
270
+ arrow: true,
271
+ content: '',
272
+ inertia: false,
273
+ maxWidth: 350,
274
+ role: 'tooltip',
275
+ theme: '',
276
+ zIndex: 9999
277
+ };
278
+ var defaultProps = Object.assign({
279
+ appendTo: TIPPY_DEFAULT_APPEND_TO,
280
+ aria: {
281
+ content: 'auto',
282
+ expanded: 'auto'
283
+ },
284
+ delay: 0,
285
+ duration: [300, 250],
286
+ getReferenceClientRect: null,
287
+ hideOnClick: true,
288
+ ignoreAttributes: false,
289
+ interactive: false,
290
+ interactiveBorder: 2,
291
+ interactiveDebounce: 0,
292
+ moveTransition: '',
293
+ offset: [0, 10],
294
+ onAfterUpdate: function onAfterUpdate() {},
295
+ onBeforeUpdate: function onBeforeUpdate() {},
296
+ onCreate: function onCreate() {},
297
+ onDestroy: function onDestroy() {},
298
+ onHidden: function onHidden() {},
299
+ onHide: function onHide() {},
300
+ onMount: function onMount() {},
301
+ onShow: function onShow() {},
302
+ onShown: function onShown() {},
303
+ onTrigger: function onTrigger() {},
304
+ onUntrigger: function onUntrigger() {},
305
+ onClickOutside: function onClickOutside() {},
306
+ placement: 'top',
307
+ plugins: [],
308
+ popperOptions: {},
309
+ render: null,
310
+ showOnCreate: false,
311
+ touch: true,
312
+ trigger: 'mouseenter focus',
313
+ triggerTarget: null
314
+ }, pluginProps, renderProps);
315
+ var defaultKeys = Object.keys(defaultProps);
316
+ var setDefaultProps = function setDefaultProps(partialProps) {
317
+
318
+ var keys = Object.keys(partialProps);
319
+ keys.forEach(function (key) {
320
+ defaultProps[key] = partialProps[key];
321
+ });
322
+ };
323
+ function getExtendedPassedProps(passedProps) {
324
+ var plugins = passedProps.plugins || [];
325
+ var pluginProps = plugins.reduce(function (acc, plugin) {
326
+ var name = plugin.name,
327
+ defaultValue = plugin.defaultValue;
328
+
329
+ if (name) {
330
+ var _name;
331
+
332
+ acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
333
+ }
334
+
335
+ return acc;
336
+ }, {});
337
+ return Object.assign({}, passedProps, pluginProps);
338
+ }
339
+ function getDataAttributeProps(reference, plugins) {
340
+ var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
341
+ plugins: plugins
342
+ }))) : defaultKeys;
343
+ var props = propKeys.reduce(function (acc, key) {
344
+ var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
345
+
346
+ if (!valueAsString) {
347
+ return acc;
348
+ }
349
+
350
+ if (key === 'content') {
351
+ acc[key] = valueAsString;
352
+ } else {
353
+ try {
354
+ acc[key] = JSON.parse(valueAsString);
355
+ } catch (e) {
356
+ acc[key] = valueAsString;
357
+ }
358
+ }
359
+
360
+ return acc;
361
+ }, {});
362
+ return props;
363
+ }
364
+ function evaluateProps(reference, props) {
365
+ var out = Object.assign({}, props, {
366
+ content: invokeWithArgsOrReturn(props.content, [reference])
367
+ }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
368
+ out.aria = Object.assign({}, defaultProps.aria, out.aria);
369
+ out.aria = {
370
+ expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
371
+ content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
372
+ };
373
+ return out;
374
+ }
375
+
376
+ var innerHTML = function innerHTML() {
377
+ return 'innerHTML';
378
+ };
379
+
380
+ function dangerouslySetInnerHTML(element, html) {
381
+ element[innerHTML()] = html;
382
+ }
383
+
384
+ function createArrowElement(value) {
385
+ var arrow = div();
386
+
387
+ if (value === true) {
388
+ arrow.className = ARROW_CLASS;
389
+ } else {
390
+ arrow.className = SVG_ARROW_CLASS;
391
+
392
+ if (isElement(value)) {
393
+ arrow.appendChild(value);
394
+ } else {
395
+ dangerouslySetInnerHTML(arrow, value);
396
+ }
397
+ }
398
+
399
+ return arrow;
400
+ }
401
+
402
+ function setContent(content, props) {
403
+ if (isElement(props.content)) {
404
+ dangerouslySetInnerHTML(content, '');
405
+ content.appendChild(props.content);
406
+ } else if (typeof props.content !== 'function') {
407
+ if (props.allowHTML) {
408
+ dangerouslySetInnerHTML(content, props.content);
409
+ } else {
410
+ content.textContent = props.content;
411
+ }
412
+ }
413
+ }
414
+ function getChildren(popper) {
415
+ var box = popper.firstElementChild;
416
+ var boxChildren = arrayFrom(box.children);
417
+ return {
418
+ box: box,
419
+ content: boxChildren.find(function (node) {
420
+ return node.classList.contains(CONTENT_CLASS);
421
+ }),
422
+ arrow: boxChildren.find(function (node) {
423
+ return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
424
+ }),
425
+ backdrop: boxChildren.find(function (node) {
426
+ return node.classList.contains(BACKDROP_CLASS);
427
+ })
428
+ };
429
+ }
430
+ function render(instance) {
431
+ var popper = div();
432
+ var box = div();
433
+ box.className = BOX_CLASS;
434
+ box.setAttribute('data-state', 'hidden');
435
+ box.setAttribute('tabindex', '-1');
436
+ var content = div();
437
+ content.className = CONTENT_CLASS;
438
+ content.setAttribute('data-state', 'hidden');
439
+ setContent(content, instance.props);
440
+ popper.appendChild(box);
441
+ box.appendChild(content);
442
+ onUpdate(instance.props, instance.props);
443
+
444
+ function onUpdate(prevProps, nextProps) {
445
+ var _getChildren = getChildren(popper),
446
+ box = _getChildren.box,
447
+ content = _getChildren.content,
448
+ arrow = _getChildren.arrow;
449
+
450
+ if (nextProps.theme) {
451
+ box.setAttribute('data-theme', nextProps.theme);
452
+ } else {
453
+ box.removeAttribute('data-theme');
454
+ }
455
+
456
+ if (typeof nextProps.animation === 'string') {
457
+ box.setAttribute('data-animation', nextProps.animation);
458
+ } else {
459
+ box.removeAttribute('data-animation');
460
+ }
461
+
462
+ if (nextProps.inertia) {
463
+ box.setAttribute('data-inertia', '');
464
+ } else {
465
+ box.removeAttribute('data-inertia');
466
+ }
467
+
468
+ box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth;
469
+
470
+ if (nextProps.role) {
471
+ box.setAttribute('role', nextProps.role);
472
+ } else {
473
+ box.removeAttribute('role');
474
+ }
475
+
476
+ if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
477
+ setContent(content, instance.props);
478
+ }
479
+
480
+ if (nextProps.arrow) {
481
+ if (!arrow) {
482
+ box.appendChild(createArrowElement(nextProps.arrow));
483
+ } else if (prevProps.arrow !== nextProps.arrow) {
484
+ box.removeChild(arrow);
485
+ box.appendChild(createArrowElement(nextProps.arrow));
486
+ }
487
+ } else if (arrow) {
488
+ box.removeChild(arrow);
489
+ }
490
+ }
491
+
492
+ return {
493
+ popper: popper,
494
+ onUpdate: onUpdate
495
+ };
496
+ } // Runtime check to identify if the render function is the default one; this
497
+ // way we can apply default CSS transitions logic and it can be tree-shaken away
498
+
499
+ render.$$tippy = true;
500
+
501
+ var idCounter = 1;
502
+ var mouseMoveListeners = []; // Used by `hideAll()`
503
+
504
+ var mountedInstances = [];
505
+ function createTippy(reference, passedProps) {
506
+ var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
507
+ // 🔒 Private members
508
+ // ===========================================================================
509
+
510
+ var showTimeout;
511
+ var hideTimeout;
512
+ var scheduleHideAnimationFrame;
513
+ var isVisibleFromClick = false;
514
+ var didHideDueToDocumentMouseDown = false;
515
+ var didTouchMove = false;
516
+ var ignoreOnFirstUpdate = false;
517
+ var lastTriggerEvent;
518
+ var currentTransitionEndListener;
519
+ var onFirstUpdate;
520
+ var listeners = [];
521
+ var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);
522
+ var currentTarget; // ===========================================================================
523
+ // 🔑 Public members
524
+ // ===========================================================================
525
+
526
+ var id = idCounter++;
527
+ var popperInstance = null;
528
+ var plugins = unique(props.plugins);
529
+ var state = {
530
+ // Is the instance currently enabled?
531
+ isEnabled: true,
532
+ // Is the tippy currently showing and not transitioning out?
533
+ isVisible: false,
534
+ // Has the instance been destroyed?
535
+ isDestroyed: false,
536
+ // Is the tippy currently mounted to the DOM?
537
+ isMounted: false,
538
+ // Has the tippy finished transitioning in?
539
+ isShown: false
540
+ };
541
+ var instance = {
542
+ // properties
543
+ id: id,
544
+ reference: reference,
545
+ popper: div(),
546
+ popperInstance: popperInstance,
547
+ props: props,
548
+ state: state,
549
+ plugins: plugins,
550
+ // methods
551
+ clearDelayTimeouts: clearDelayTimeouts,
552
+ setProps: setProps,
553
+ setContent: setContent,
554
+ show: show,
555
+ hide: hide,
556
+ hideWithInteractivity: hideWithInteractivity,
557
+ enable: enable,
558
+ disable: disable,
559
+ unmount: unmount,
560
+ destroy: destroy
561
+ }; // TODO: Investigate why this early return causes a TDZ error in the tests —
562
+ // it doesn't seem to happen in the browser
563
+
564
+ /* istanbul ignore if */
565
+
566
+ if (!props.render) {
567
+
568
+ return instance;
569
+ } // ===========================================================================
570
+ // Initial mutations
571
+ // ===========================================================================
572
+
573
+
574
+ var _props$render = props.render(instance),
575
+ popper$1 = _props$render.popper,
576
+ onUpdate = _props$render.onUpdate;
577
+
578
+ popper$1.setAttribute('data-tippy-root', '');
579
+ popper$1.id = "tippy-" + instance.id;
580
+ instance.popper = popper$1;
581
+ reference._tippy = instance;
582
+ popper$1._tippy = instance;
583
+ var pluginsHooks = plugins.map(function (plugin) {
584
+ return plugin.fn(instance);
585
+ });
586
+ var hasAriaExpanded = reference.hasAttribute('aria-expanded');
587
+ addListeners();
588
+ handleAriaExpandedAttribute();
589
+ handleStyles();
590
+ invokeHook('onCreate', [instance]);
591
+
592
+ if (props.showOnCreate) {
593
+ scheduleShow();
594
+ } // Prevent a tippy with a delay from hiding if the cursor left then returned
595
+ // before it started hiding
596
+
597
+
598
+ popper$1.addEventListener('mouseenter', function () {
599
+ if (instance.props.interactive && instance.state.isVisible) {
600
+ instance.clearDelayTimeouts();
601
+ }
602
+ });
603
+ popper$1.addEventListener('mouseleave', function () {
604
+ if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
605
+ getDocument().addEventListener('mousemove', debouncedOnMouseMove);
606
+ }
607
+ });
608
+ return instance; // ===========================================================================
609
+ // 🔒 Private methods
610
+ // ===========================================================================
611
+
612
+ function getNormalizedTouchSettings() {
613
+ var touch = instance.props.touch;
614
+ return Array.isArray(touch) ? touch : [touch, 0];
615
+ }
616
+
617
+ function getIsCustomTouchBehavior() {
618
+ return getNormalizedTouchSettings()[0] === 'hold';
619
+ }
620
+
621
+ function getIsDefaultRenderFn() {
622
+ var _instance$props$rende;
623
+
624
+ // @ts-ignore
625
+ return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
626
+ }
627
+
628
+ function getCurrentTarget() {
629
+ return currentTarget || reference;
630
+ }
631
+
632
+ function getDocument() {
633
+ var parent = getCurrentTarget().parentNode;
634
+ return parent ? getOwnerDocument(parent) : document;
635
+ }
636
+
637
+ function getDefaultTemplateChildren() {
638
+ return getChildren(popper$1);
639
+ }
640
+
641
+ function getDelay(isShow) {
642
+ // For touch or keyboard input, force `0` delay for UX reasons
643
+ // Also if the instance is mounted but not visible (transitioning out),
644
+ // ignore delay
645
+ if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
646
+ return 0;
647
+ }
648
+
649
+ return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
650
+ }
651
+
652
+ function handleStyles(fromHide) {
653
+ if (fromHide === void 0) {
654
+ fromHide = false;
655
+ }
656
+
657
+ popper$1.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
658
+ popper$1.style.zIndex = "" + instance.props.zIndex;
659
+ }
660
+
661
+ function invokeHook(hook, args, shouldInvokePropsHook) {
662
+ if (shouldInvokePropsHook === void 0) {
663
+ shouldInvokePropsHook = true;
664
+ }
665
+
666
+ pluginsHooks.forEach(function (pluginHooks) {
667
+ if (pluginHooks[hook]) {
668
+ pluginHooks[hook].apply(pluginHooks, args);
669
+ }
670
+ });
671
+
672
+ if (shouldInvokePropsHook) {
673
+ var _instance$props;
674
+
675
+ (_instance$props = instance.props)[hook].apply(_instance$props, args);
676
+ }
677
+ }
678
+
679
+ function handleAriaContentAttribute() {
680
+ var aria = instance.props.aria;
681
+
682
+ if (!aria.content) {
683
+ return;
684
+ }
685
+
686
+ var attr = "aria-" + aria.content;
687
+ var id = popper$1.id;
688
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
689
+ nodes.forEach(function (node) {
690
+ var currentValue = node.getAttribute(attr);
691
+
692
+ if (instance.state.isVisible) {
693
+ node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
694
+ } else {
695
+ var nextValue = currentValue && currentValue.replace(id, '').trim();
696
+
697
+ if (nextValue) {
698
+ node.setAttribute(attr, nextValue);
699
+ } else {
700
+ node.removeAttribute(attr);
701
+ }
702
+ }
703
+ });
704
+ }
705
+
706
+ function handleAriaExpandedAttribute() {
707
+ if (hasAriaExpanded || !instance.props.aria.expanded) {
708
+ return;
709
+ }
710
+
711
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
712
+ nodes.forEach(function (node) {
713
+ if (instance.props.interactive) {
714
+ node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
715
+ } else {
716
+ node.removeAttribute('aria-expanded');
717
+ }
718
+ });
719
+ }
720
+
721
+ function cleanupInteractiveMouseListeners() {
722
+ getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
723
+ mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
724
+ return listener !== debouncedOnMouseMove;
725
+ });
726
+ }
727
+
728
+ function onDocumentPress(event) {
729
+ // Moved finger to scroll instead of an intentional tap outside
730
+ if (currentInput.isTouch) {
731
+ if (didTouchMove || event.type === 'mousedown') {
732
+ return;
733
+ }
734
+ }
735
+
736
+ var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
737
+
738
+ if (instance.props.interactive && actualContains(popper$1, actualTarget)) {
739
+ return;
740
+ } // Clicked on the event listeners target
741
+
742
+
743
+ if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
744
+ return actualContains(el, actualTarget);
745
+ })) {
746
+ if (currentInput.isTouch) {
747
+ return;
748
+ }
749
+
750
+ if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {
751
+ return;
752
+ }
753
+ } else {
754
+ invokeHook('onClickOutside', [instance, event]);
755
+ }
756
+
757
+ if (instance.props.hideOnClick === true) {
758
+ instance.clearDelayTimeouts();
759
+ instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
760
+ // currentTarget. This lets a tippy with `focus` trigger know that it
761
+ // should not show
762
+
763
+ didHideDueToDocumentMouseDown = true;
764
+ setTimeout(function () {
765
+ didHideDueToDocumentMouseDown = false;
766
+ }); // The listener gets added in `scheduleShow()`, but this may be hiding it
767
+ // before it shows, and hide()'s early bail-out behavior can prevent it
768
+ // from being cleaned up
769
+
770
+ if (!instance.state.isMounted) {
771
+ removeDocumentPress();
772
+ }
773
+ }
774
+ }
775
+
776
+ function onTouchMove() {
777
+ didTouchMove = true;
778
+ }
779
+
780
+ function onTouchStart() {
781
+ didTouchMove = false;
782
+ }
783
+
784
+ function addDocumentPress() {
785
+ var doc = getDocument();
786
+ doc.addEventListener('mousedown', onDocumentPress, true);
787
+ doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
788
+ doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
789
+ doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
790
+ }
791
+
792
+ function removeDocumentPress() {
793
+ var doc = getDocument();
794
+ doc.removeEventListener('mousedown', onDocumentPress, true);
795
+ doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
796
+ doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
797
+ doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
798
+ }
799
+
800
+ function onTransitionedOut(duration, callback) {
801
+ onTransitionEnd(duration, function () {
802
+ if (!instance.state.isVisible && popper$1.parentNode && popper$1.parentNode.contains(popper$1)) {
803
+ callback();
804
+ }
805
+ });
806
+ }
807
+
808
+ function onTransitionedIn(duration, callback) {
809
+ onTransitionEnd(duration, callback);
810
+ }
811
+
812
+ function onTransitionEnd(duration, callback) {
813
+ var box = getDefaultTemplateChildren().box;
814
+
815
+ function listener(event) {
816
+ if (event.target === box) {
817
+ updateTransitionEndListener(box, 'remove', listener);
818
+ callback();
819
+ }
820
+ } // Make callback synchronous if duration is 0
821
+ // `transitionend` won't fire otherwise
822
+
823
+
824
+ if (duration === 0) {
825
+ return callback();
826
+ }
827
+
828
+ updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
829
+ updateTransitionEndListener(box, 'add', listener);
830
+ currentTransitionEndListener = listener;
831
+ }
832
+
833
+ function on(eventType, handler, options) {
834
+ if (options === void 0) {
835
+ options = false;
836
+ }
837
+
838
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
839
+ nodes.forEach(function (node) {
840
+ node.addEventListener(eventType, handler, options);
841
+ listeners.push({
842
+ node: node,
843
+ eventType: eventType,
844
+ handler: handler,
845
+ options: options
846
+ });
847
+ });
848
+ }
849
+
850
+ function addListeners() {
851
+ if (getIsCustomTouchBehavior()) {
852
+ on('touchstart', onTrigger, {
853
+ passive: true
854
+ });
855
+ on('touchend', onMouseLeave, {
856
+ passive: true
857
+ });
858
+ }
859
+
860
+ splitBySpaces(instance.props.trigger).forEach(function (eventType) {
861
+ if (eventType === 'manual') {
862
+ return;
863
+ }
864
+
865
+ on(eventType, onTrigger);
866
+
867
+ switch (eventType) {
868
+ case 'mouseenter':
869
+ on('mouseleave', onMouseLeave);
870
+ break;
871
+
872
+ case 'focus':
873
+ on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
874
+ break;
875
+
876
+ case 'focusin':
877
+ on('focusout', onBlurOrFocusOut);
878
+ break;
879
+ }
880
+ });
881
+ }
882
+
883
+ function removeListeners() {
884
+ listeners.forEach(function (_ref) {
885
+ var node = _ref.node,
886
+ eventType = _ref.eventType,
887
+ handler = _ref.handler,
888
+ options = _ref.options;
889
+ node.removeEventListener(eventType, handler, options);
890
+ });
891
+ listeners = [];
892
+ }
893
+
894
+ function onTrigger(event) {
895
+ var _lastTriggerEvent;
896
+
897
+ var shouldScheduleClickHide = false;
898
+
899
+ if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
900
+ return;
901
+ }
902
+
903
+ var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';
904
+ lastTriggerEvent = event;
905
+ currentTarget = event.currentTarget;
906
+ handleAriaExpandedAttribute();
907
+
908
+ if (!instance.state.isVisible && isMouseEvent(event)) {
909
+ // If scrolling, `mouseenter` events can be fired if the cursor lands
910
+ // over a new target, but `mousemove` events don't get fired. This
911
+ // causes interactive tooltips to get stuck open until the cursor is
912
+ // moved
913
+ mouseMoveListeners.forEach(function (listener) {
914
+ return listener(event);
915
+ });
916
+ } // Toggle show/hide when clicking click-triggered tooltips
917
+
918
+
919
+ if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
920
+ shouldScheduleClickHide = true;
921
+ } else {
922
+ scheduleShow(event);
923
+ }
924
+
925
+ if (event.type === 'click') {
926
+ isVisibleFromClick = !shouldScheduleClickHide;
927
+ }
928
+
929
+ if (shouldScheduleClickHide && !wasFocused) {
930
+ scheduleHide(event);
931
+ }
932
+ }
933
+
934
+ function onMouseMove(event) {
935
+ var target = event.target;
936
+ var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper$1.contains(target);
937
+
938
+ if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
939
+ return;
940
+ }
941
+
942
+ var popperTreeData = getNestedPopperTree().concat(popper$1).map(function (popper) {
943
+ var _instance$popperInsta;
944
+
945
+ var instance = popper._tippy;
946
+ var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;
947
+
948
+ if (state) {
949
+ return {
950
+ popperRect: popper.getBoundingClientRect(),
951
+ popperState: state,
952
+ props: props
953
+ };
954
+ }
955
+
956
+ return null;
957
+ }).filter(Boolean);
958
+
959
+ if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
960
+ cleanupInteractiveMouseListeners();
961
+ scheduleHide(event);
962
+ }
963
+ }
964
+
965
+ function onMouseLeave(event) {
966
+ var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;
967
+
968
+ if (shouldBail) {
969
+ return;
970
+ }
971
+
972
+ if (instance.props.interactive) {
973
+ instance.hideWithInteractivity(event);
974
+ return;
975
+ }
976
+
977
+ scheduleHide(event);
978
+ }
979
+
980
+ function onBlurOrFocusOut(event) {
981
+ if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {
982
+ return;
983
+ } // If focus was moved to within the popper
984
+
985
+
986
+ if (instance.props.interactive && event.relatedTarget && popper$1.contains(event.relatedTarget)) {
987
+ return;
988
+ }
989
+
990
+ scheduleHide(event);
991
+ }
992
+
993
+ function isEventListenerStopped(event) {
994
+ return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;
995
+ }
996
+
997
+ function createPopperInstance() {
998
+ destroyPopperInstance();
999
+ var _instance$props2 = instance.props,
1000
+ popperOptions = _instance$props2.popperOptions,
1001
+ placement = _instance$props2.placement,
1002
+ offset = _instance$props2.offset,
1003
+ getReferenceClientRect = _instance$props2.getReferenceClientRect,
1004
+ moveTransition = _instance$props2.moveTransition;
1005
+ var arrow = getIsDefaultRenderFn() ? getChildren(popper$1).arrow : null;
1006
+ var computedReference = getReferenceClientRect ? {
1007
+ getBoundingClientRect: getReferenceClientRect,
1008
+ contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
1009
+ } : reference;
1010
+ var tippyModifier = {
1011
+ name: '$$tippy',
1012
+ enabled: true,
1013
+ phase: 'beforeWrite',
1014
+ requires: ['computeStyles'],
1015
+ fn: function fn(_ref2) {
1016
+ var state = _ref2.state;
1017
+
1018
+ if (getIsDefaultRenderFn()) {
1019
+ var _getDefaultTemplateCh = getDefaultTemplateChildren(),
1020
+ box = _getDefaultTemplateCh.box;
1021
+
1022
+ ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {
1023
+ if (attr === 'placement') {
1024
+ box.setAttribute('data-placement', state.placement);
1025
+ } else {
1026
+ if (state.attributes.popper["data-popper-" + attr]) {
1027
+ box.setAttribute("data-" + attr, '');
1028
+ } else {
1029
+ box.removeAttribute("data-" + attr);
1030
+ }
1031
+ }
1032
+ });
1033
+ state.attributes.popper = {};
1034
+ }
1035
+ }
1036
+ };
1037
+ var modifiers = [{
1038
+ name: 'offset',
1039
+ options: {
1040
+ offset: offset
1041
+ }
1042
+ }, {
1043
+ name: 'preventOverflow',
1044
+ options: {
1045
+ padding: {
1046
+ top: 2,
1047
+ bottom: 2,
1048
+ left: 5,
1049
+ right: 5
1050
+ }
1051
+ }
1052
+ }, {
1053
+ name: 'flip',
1054
+ options: {
1055
+ padding: 5
1056
+ }
1057
+ }, {
1058
+ name: 'computeStyles',
1059
+ options: {
1060
+ adaptive: !moveTransition
1061
+ }
1062
+ }, tippyModifier];
1063
+
1064
+ if (getIsDefaultRenderFn() && arrow) {
1065
+ modifiers.push({
1066
+ name: 'arrow',
1067
+ options: {
1068
+ element: arrow,
1069
+ padding: 3
1070
+ }
1071
+ });
1072
+ }
1073
+
1074
+ modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
1075
+ instance.popperInstance = popper.createPopper(computedReference, popper$1, Object.assign({}, popperOptions, {
1076
+ placement: placement,
1077
+ onFirstUpdate: onFirstUpdate,
1078
+ modifiers: modifiers
1079
+ }));
1080
+ }
1081
+
1082
+ function destroyPopperInstance() {
1083
+ if (instance.popperInstance) {
1084
+ instance.popperInstance.destroy();
1085
+ instance.popperInstance = null;
1086
+ }
1087
+ }
1088
+
1089
+ function mount() {
1090
+ var appendTo = instance.props.appendTo;
1091
+ var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
1092
+ // it's directly after the reference element so the elements inside the
1093
+ // tippy can be tabbed to
1094
+ // If there are clipping issues, the user can specify a different appendTo
1095
+ // and ensure focus management is handled correctly manually
1096
+
1097
+ var node = getCurrentTarget();
1098
+
1099
+ if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
1100
+ parentNode = node.parentNode;
1101
+ } else {
1102
+ parentNode = invokeWithArgsOrReturn(appendTo, [node]);
1103
+ } // The popper element needs to exist on the DOM before its position can be
1104
+ // updated as Popper needs to read its dimensions
1105
+
1106
+
1107
+ if (!parentNode.contains(popper$1)) {
1108
+ parentNode.appendChild(popper$1);
1109
+ }
1110
+
1111
+ instance.state.isMounted = true;
1112
+ createPopperInstance();
1113
+ }
1114
+
1115
+ function getNestedPopperTree() {
1116
+ return arrayFrom(popper$1.querySelectorAll('[data-tippy-root]'));
1117
+ }
1118
+
1119
+ function scheduleShow(event) {
1120
+ instance.clearDelayTimeouts();
1121
+
1122
+ if (event) {
1123
+ invokeHook('onTrigger', [instance, event]);
1124
+ }
1125
+
1126
+ addDocumentPress();
1127
+ var delay = getDelay(true);
1128
+
1129
+ var _getNormalizedTouchSe = getNormalizedTouchSettings(),
1130
+ touchValue = _getNormalizedTouchSe[0],
1131
+ touchDelay = _getNormalizedTouchSe[1];
1132
+
1133
+ if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {
1134
+ delay = touchDelay;
1135
+ }
1136
+
1137
+ if (delay) {
1138
+ showTimeout = setTimeout(function () {
1139
+ instance.show();
1140
+ }, delay);
1141
+ } else {
1142
+ instance.show();
1143
+ }
1144
+ }
1145
+
1146
+ function scheduleHide(event) {
1147
+ instance.clearDelayTimeouts();
1148
+ invokeHook('onUntrigger', [instance, event]);
1149
+
1150
+ if (!instance.state.isVisible) {
1151
+ removeDocumentPress();
1152
+ return;
1153
+ } // For interactive tippies, scheduleHide is added to a document.body handler
1154
+ // from onMouseLeave so must intercept scheduled hides from mousemove/leave
1155
+ // events when trigger contains mouseenter and click, and the tip is
1156
+ // currently shown as a result of a click.
1157
+
1158
+
1159
+ if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {
1160
+ return;
1161
+ }
1162
+
1163
+ var delay = getDelay(false);
1164
+
1165
+ if (delay) {
1166
+ hideTimeout = setTimeout(function () {
1167
+ if (instance.state.isVisible) {
1168
+ instance.hide();
1169
+ }
1170
+ }, delay);
1171
+ } else {
1172
+ // Fixes a `transitionend` problem when it fires 1 frame too
1173
+ // late sometimes, we don't want hide() to be called.
1174
+ scheduleHideAnimationFrame = requestAnimationFrame(function () {
1175
+ instance.hide();
1176
+ });
1177
+ }
1178
+ } // ===========================================================================
1179
+ // 🔑 Public methods
1180
+ // ===========================================================================
1181
+
1182
+
1183
+ function enable() {
1184
+ instance.state.isEnabled = true;
1185
+ }
1186
+
1187
+ function disable() {
1188
+ // Disabling the instance should also hide it
1189
+ // https://github.com/atomiks/tippy.js-react/issues/106
1190
+ instance.hide();
1191
+ instance.state.isEnabled = false;
1192
+ }
1193
+
1194
+ function clearDelayTimeouts() {
1195
+ clearTimeout(showTimeout);
1196
+ clearTimeout(hideTimeout);
1197
+ cancelAnimationFrame(scheduleHideAnimationFrame);
1198
+ }
1199
+
1200
+ function setProps(partialProps) {
1201
+
1202
+ if (instance.state.isDestroyed) {
1203
+ return;
1204
+ }
1205
+
1206
+ invokeHook('onBeforeUpdate', [instance, partialProps]);
1207
+ removeListeners();
1208
+ var prevProps = instance.props;
1209
+ var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
1210
+ ignoreAttributes: true
1211
+ }));
1212
+ instance.props = nextProps;
1213
+ addListeners();
1214
+
1215
+ if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
1216
+ cleanupInteractiveMouseListeners();
1217
+ debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
1218
+ } // Ensure stale aria-expanded attributes are removed
1219
+
1220
+
1221
+ if (prevProps.triggerTarget && !nextProps.triggerTarget) {
1222
+ normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
1223
+ node.removeAttribute('aria-expanded');
1224
+ });
1225
+ } else if (nextProps.triggerTarget) {
1226
+ reference.removeAttribute('aria-expanded');
1227
+ }
1228
+
1229
+ handleAriaExpandedAttribute();
1230
+ handleStyles();
1231
+
1232
+ if (onUpdate) {
1233
+ onUpdate(prevProps, nextProps);
1234
+ }
1235
+
1236
+ if (instance.popperInstance) {
1237
+ createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,
1238
+ // and the nested ones get re-rendered first.
1239
+ // https://github.com/atomiks/tippyjs-react/issues/177
1240
+ // TODO: find a cleaner / more efficient solution(!)
1241
+
1242
+ getNestedPopperTree().forEach(function (nestedPopper) {
1243
+ // React (and other UI libs likely) requires a rAF wrapper as it flushes
1244
+ // its work in one
1245
+ requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
1246
+ });
1247
+ }
1248
+
1249
+ invokeHook('onAfterUpdate', [instance, partialProps]);
1250
+ }
1251
+
1252
+ function setContent(content) {
1253
+ instance.setProps({
1254
+ content: content
1255
+ });
1256
+ }
1257
+
1258
+ function show() {
1259
+
1260
+
1261
+ var isAlreadyVisible = instance.state.isVisible;
1262
+ var isDestroyed = instance.state.isDestroyed;
1263
+ var isDisabled = !instance.state.isEnabled;
1264
+ var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
1265
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
1266
+
1267
+ if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
1268
+ return;
1269
+ } // Normalize `disabled` behavior across browsers.
1270
+ // Firefox allows events on disabled elements, but Chrome doesn't.
1271
+ // Using a wrapper element (i.e. <span>) is recommended.
1272
+
1273
+
1274
+ if (getCurrentTarget().hasAttribute('disabled')) {
1275
+ return;
1276
+ }
1277
+
1278
+ invokeHook('onShow', [instance], false);
1279
+
1280
+ if (instance.props.onShow(instance) === false) {
1281
+ return;
1282
+ }
1283
+
1284
+ instance.state.isVisible = true;
1285
+
1286
+ if (getIsDefaultRenderFn()) {
1287
+ popper$1.style.visibility = 'visible';
1288
+ }
1289
+
1290
+ handleStyles();
1291
+ addDocumentPress();
1292
+
1293
+ if (!instance.state.isMounted) {
1294
+ popper$1.style.transition = 'none';
1295
+ } // If flipping to the opposite side after hiding at least once, the
1296
+ // animation will use the wrong placement without resetting the duration
1297
+
1298
+
1299
+ if (getIsDefaultRenderFn()) {
1300
+ var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),
1301
+ box = _getDefaultTemplateCh2.box,
1302
+ content = _getDefaultTemplateCh2.content;
1303
+
1304
+ setTransitionDuration([box, content], 0);
1305
+ }
1306
+
1307
+ onFirstUpdate = function onFirstUpdate() {
1308
+ var _instance$popperInsta2;
1309
+
1310
+ if (!instance.state.isVisible || ignoreOnFirstUpdate) {
1311
+ return;
1312
+ }
1313
+
1314
+ ignoreOnFirstUpdate = true; // reflow
1315
+ popper$1.style.transition = instance.props.moveTransition;
1316
+
1317
+ if (getIsDefaultRenderFn() && instance.props.animation) {
1318
+ var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),
1319
+ _box = _getDefaultTemplateCh3.box,
1320
+ _content = _getDefaultTemplateCh3.content;
1321
+
1322
+ setTransitionDuration([_box, _content], duration);
1323
+ setVisibilityState([_box, _content], 'visible');
1324
+ }
1325
+
1326
+ handleAriaContentAttribute();
1327
+ handleAriaExpandedAttribute();
1328
+ pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
1329
+ // popper has been positioned for the first time
1330
+
1331
+ (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
1332
+ invokeHook('onMount', [instance]);
1333
+
1334
+ if (instance.props.animation && getIsDefaultRenderFn()) {
1335
+ onTransitionedIn(duration, function () {
1336
+ instance.state.isShown = true;
1337
+ invokeHook('onShown', [instance]);
1338
+ });
1339
+ }
1340
+ };
1341
+
1342
+ mount();
1343
+ }
1344
+
1345
+ function hide() {
1346
+
1347
+
1348
+ var isAlreadyHidden = !instance.state.isVisible;
1349
+ var isDestroyed = instance.state.isDestroyed;
1350
+ var isDisabled = !instance.state.isEnabled;
1351
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
1352
+
1353
+ if (isAlreadyHidden || isDestroyed || isDisabled) {
1354
+ return;
1355
+ }
1356
+
1357
+ invokeHook('onHide', [instance], false);
1358
+
1359
+ if (instance.props.onHide(instance) === false) {
1360
+ return;
1361
+ }
1362
+
1363
+ instance.state.isVisible = false;
1364
+ instance.state.isShown = false;
1365
+ ignoreOnFirstUpdate = false;
1366
+ isVisibleFromClick = false;
1367
+
1368
+ if (getIsDefaultRenderFn()) {
1369
+ popper$1.style.visibility = 'hidden';
1370
+ }
1371
+
1372
+ cleanupInteractiveMouseListeners();
1373
+ removeDocumentPress();
1374
+ handleStyles(true);
1375
+
1376
+ if (getIsDefaultRenderFn()) {
1377
+ var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
1378
+ box = _getDefaultTemplateCh4.box,
1379
+ content = _getDefaultTemplateCh4.content;
1380
+
1381
+ if (instance.props.animation) {
1382
+ setTransitionDuration([box, content], duration);
1383
+ setVisibilityState([box, content], 'hidden');
1384
+ }
1385
+ }
1386
+
1387
+ handleAriaContentAttribute();
1388
+ handleAriaExpandedAttribute();
1389
+
1390
+ if (instance.props.animation) {
1391
+ if (getIsDefaultRenderFn()) {
1392
+ onTransitionedOut(duration, instance.unmount);
1393
+ }
1394
+ } else {
1395
+ instance.unmount();
1396
+ }
1397
+ }
1398
+
1399
+ function hideWithInteractivity(event) {
1400
+
1401
+ getDocument().addEventListener('mousemove', debouncedOnMouseMove);
1402
+ pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
1403
+ debouncedOnMouseMove(event);
1404
+ }
1405
+
1406
+ function unmount() {
1407
+
1408
+ if (instance.state.isVisible) {
1409
+ instance.hide();
1410
+ }
1411
+
1412
+ if (!instance.state.isMounted) {
1413
+ return;
1414
+ }
1415
+
1416
+ destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper
1417
+ // tree by default. This seems mainly for interactive tippies, but we should
1418
+ // find a workaround if possible
1419
+
1420
+ getNestedPopperTree().forEach(function (nestedPopper) {
1421
+ nestedPopper._tippy.unmount();
1422
+ });
1423
+
1424
+ if (popper$1.parentNode) {
1425
+ popper$1.parentNode.removeChild(popper$1);
1426
+ }
1427
+
1428
+ mountedInstances = mountedInstances.filter(function (i) {
1429
+ return i !== instance;
1430
+ });
1431
+ instance.state.isMounted = false;
1432
+ invokeHook('onHidden', [instance]);
1433
+ }
1434
+
1435
+ function destroy() {
1436
+
1437
+ if (instance.state.isDestroyed) {
1438
+ return;
1439
+ }
1440
+
1441
+ instance.clearDelayTimeouts();
1442
+ instance.unmount();
1443
+ removeListeners();
1444
+ delete reference._tippy;
1445
+ instance.state.isDestroyed = true;
1446
+ invokeHook('onDestroy', [instance]);
1447
+ }
1448
+ }
1449
+
1450
+ function tippy(targets, optionalProps) {
1451
+ if (optionalProps === void 0) {
1452
+ optionalProps = {};
1453
+ }
1454
+
1455
+ var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
1456
+
1457
+ bindGlobalEventListeners();
1458
+ var passedProps = Object.assign({}, optionalProps, {
1459
+ plugins: plugins
1460
+ });
1461
+ var elements = getArrayOfElements(targets);
1462
+
1463
+ var instances = elements.reduce(function (acc, reference) {
1464
+ var instance = reference && createTippy(reference, passedProps);
1465
+
1466
+ if (instance) {
1467
+ acc.push(instance);
1468
+ }
1469
+
1470
+ return acc;
1471
+ }, []);
1472
+ return isElement(targets) ? instances[0] : instances;
1473
+ }
1474
+
1475
+ tippy.defaultProps = defaultProps;
1476
+ tippy.setDefaultProps = setDefaultProps;
1477
+ tippy.currentInput = currentInput;
1478
+
1479
+ // every time the popper is destroyed (i.e. a new target), removing the styles
1480
+ // and causing transitions to break for singletons when the console is open, but
1481
+ // most notably for non-transform styles being used, `gpuAcceleration: false`.
1482
+
1483
+ Object.assign({}, popper.applyStyles, {
1484
+ effect: function effect(_ref) {
1485
+ var state = _ref.state;
1486
+ var initialStyles = {
1487
+ popper: {
1488
+ position: state.options.strategy,
1489
+ left: '0',
1490
+ top: '0',
1491
+ margin: '0'
1492
+ },
1493
+ arrow: {
1494
+ position: 'absolute'
1495
+ },
1496
+ reference: {}
1497
+ };
1498
+ Object.assign(state.elements.popper.style, initialStyles.popper);
1499
+ state.styles = initialStyles;
1500
+
1501
+ if (state.elements.arrow) {
1502
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
1503
+ } // intentionally return no cleanup function
1504
+ // return () => { ... }
1505
+
1506
+ }
1507
+ });
1508
+
1509
+ tippy.setDefaultProps({
1510
+ render: render
1511
+ });
1512
+
1513
+ const tooltipCss = ":host{display:none}";
1514
+
1515
+ let Tooltip = class {
1516
+ constructor(hostRef) {
1517
+ index.registerInstance(this, hostRef);
1518
+ /**
1519
+ * Where the tooltip is going to show relative to the element it's describing.
1520
+ */
1521
+ this.position = 'bottom';
1522
+ /**
1523
+ * Determines if the tooltip has interactive content inside of it, so that it can be hovered over and clicked inside
1524
+ * without hiding.
1525
+ */
1526
+ this.interactive = false;
1527
+ /**
1528
+ * Specifies the maximum width of the tooltip. Useful to prevent it from being too horizontally wide to read.
1529
+ *
1530
+ * If the viewport's width is smaller than maxWidth, core CSS ensures the tippy remains smaller than the screen.
1531
+ */
1532
+ this.maxWidth = 350;
1533
+ /**
1534
+ * Delay in ms once a trigger event is fired before the tooltip shows or hides.
1535
+ *
1536
+ * You can provide an array with two values to define a different duration for show and hide.
1537
+ *
1538
+ * `[showDelay, hideDelay]`
1539
+ *
1540
+ * Use null to use default value.
1541
+ */
1542
+ this.delay = 0;
1543
+ /**
1544
+ * Duration in ms of the transition animation.
1545
+ */
1546
+ this.duration = [300, 250];
1547
+ /**
1548
+ * Determines the events that cause the tooltip to show. Multiple event names are separated by spaces.
1549
+ *
1550
+ * See: https://atomiks.github.io/tippyjs/v6/all-props/#trigger
1551
+ */
1552
+ this.trigger = 'mouseenter focus';
1553
+ /**
1554
+ * Allows you to change the theme used by tippy.
1555
+ *
1556
+ * The WCS theme is used by default and uses the WCS CSS variables.
1557
+ *
1558
+ * You can create a theme by following this documentation and choosing a custom name :
1559
+ * https://atomiks.github.io/tippyjs/v6/themes/
1560
+ */
1561
+ this.theme = 'wcs';
1562
+ }
1563
+ componentWillLoad() {
1564
+ this.tippyInstance = tippy(document.getElementById(this.for), {
1565
+ theme: this.theme,
1566
+ allowHTML: true,
1567
+ content: this.el.innerHTML,
1568
+ maxWidth: this.maxWidth,
1569
+ placement: this.position,
1570
+ delay: this.delay,
1571
+ duration: this.duration,
1572
+ interactive: this.interactive,
1573
+ trigger: this.trigger
1574
+ });
1575
+ }
1576
+ updateProps() {
1577
+ this.tippyInstance.setProps({
1578
+ interactive: this.interactive,
1579
+ placement: this.position,
1580
+ maxWidth: this.maxWidth,
1581
+ theme: this.theme,
1582
+ delay: this.delay,
1583
+ duration: this.duration,
1584
+ trigger: this.trigger
1585
+ });
1586
+ }
1587
+ updateTippyContent() {
1588
+ this.tippyInstance.setProps({
1589
+ content: this.el.innerHTML
1590
+ });
1591
+ }
1592
+ /**
1593
+ * Programmatically hide the tooltip
1594
+ */
1595
+ async hide() {
1596
+ this.tippyInstance.hide();
1597
+ }
1598
+ /**
1599
+ * Programmatically show the tooltip
1600
+ */
1601
+ async show() {
1602
+ this.tippyInstance.show();
1603
+ }
1604
+ /**
1605
+ * Temporarily prevent the tooltip from showing or hiding
1606
+ */
1607
+ async disable() {
1608
+ this.tippyInstance.disable();
1609
+ }
1610
+ /**
1611
+ * Re-enable a disabled tooltip
1612
+ */
1613
+ async enable() {
1614
+ this.tippyInstance.enable();
1615
+ }
1616
+ disconnectedCallback() {
1617
+ this.tippyInstance.destroy();
1618
+ }
1619
+ render() {
1620
+ return (index.h(index.Host, null, index.h("slot", { onSlotchange: _ => this.updateTippyContent() })));
1621
+ }
1622
+ get el() { return index.getElement(this); }
1623
+ static get watchers() { return {
1624
+ "interactive": ["updateProps"],
1625
+ "position": ["updateProps"],
1626
+ "maxWidth": ["updateProps"],
1627
+ "theme": ["updateProps"],
1628
+ "delay": ["updateProps"],
1629
+ "duration": ["updateProps"],
1630
+ "trigger": ["updateProps"]
1631
+ }; }
1632
+ };
1633
+ Tooltip.style = tooltipCss;
1634
+
1635
+ exports.wcs_tooltip = Tooltip;