@wfrog/vc-ui 1.3.1 → 1.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 (219) hide show
  1. package/dist/es/chunk/{CCmEeM7D.mjs → B3GxuXVE.mjs} +6 -6
  2. package/dist/es/chunk/BL8WhaLp.mjs +427 -0
  3. package/dist/es/chunk/{BiHWk71g.mjs → BPqrpkTb.mjs} +4 -4
  4. package/dist/es/chunk/{C_7t9blX.mjs → BZ1uhZQF.mjs} +1 -1
  5. package/dist/es/chunk/{-ga82G_B.mjs → BdVq9mV6.mjs} +1 -1
  6. package/dist/es/chunk/{DGGhWn1A.mjs → BfjuZmry.mjs} +6 -5
  7. package/dist/es/chunk/{BLLKi_0v.mjs → Bu3XHP55.mjs} +1 -1
  8. package/dist/es/chunk/{DEiqPcuO.mjs → BvNFaD5d.mjs} +3 -3
  9. package/dist/es/chunk/BxibBO68.mjs +5741 -0
  10. package/dist/es/chunk/{DO-mBaf5.mjs → By7FMB3I.mjs} +1 -43
  11. package/dist/es/chunk/{DATKTbFj.mjs → CGhekNBa.mjs} +5 -5
  12. package/dist/es/chunk/{plK2vnjp.mjs → CJ0afvkJ.mjs} +1 -1
  13. package/dist/es/chunk/{CtYp4FB7.mjs → CK5Bluh4.mjs} +2 -2
  14. package/dist/es/chunk/{Vv8g5_A1.mjs → CKZGL4_3.mjs} +9 -8
  15. package/dist/es/chunk/CNEMJL35.mjs +69 -0
  16. package/dist/es/chunk/{C9ldJ8Hh.mjs → CPCieLBG.mjs} +1 -1
  17. package/dist/es/chunk/{C50_dziC.mjs → CQz3lhyS.mjs} +2 -1
  18. package/dist/es/chunk/{Cekqdlxf.mjs → CbYM6R_O.mjs} +12 -77
  19. package/dist/es/chunk/{CQbpo0im.mjs → CboHfRXN.mjs} +5 -6
  20. package/dist/es/chunk/{BambM7zX.mjs → Cdh3HNZa.mjs} +2 -2
  21. package/dist/es/chunk/{aX4SRHmD.mjs → Cg-Krnly.mjs} +2 -1
  22. package/dist/es/chunk/{9qQNa4bM.mjs → Cjp0Czyu.mjs} +1 -1
  23. package/dist/es/chunk/Cmb_E8Ip.mjs +184 -0
  24. package/dist/es/chunk/{BIK5Djc_.mjs → Co77DVCw.mjs} +2 -2
  25. package/dist/es/chunk/CqTa_Vd-.mjs +375 -0
  26. package/dist/es/{components/dual-pane/dual-pane.mjs → chunk/CsjEhAYY.mjs} +11 -91
  27. package/dist/es/chunk/{BQyZW57B.mjs → CwXV7M2F.mjs} +3 -3
  28. package/dist/es/chunk/{b9dx0jdT.mjs → D1MHFKtN.mjs} +3 -3
  29. package/dist/es/chunk/{DskGUrkJ.mjs → D6m3vWpc.mjs} +2 -1
  30. package/dist/es/chunk/{4F1xxyju.mjs → D6nWUATi.mjs} +48 -2117
  31. package/dist/es/chunk/{C6bIuBQg.mjs → D7CQDxqy.mjs} +3 -3
  32. package/dist/es/chunk/{Dqk3gyUk.mjs → D9Lr0Bzb.mjs} +1 -374
  33. package/dist/es/chunk/{Xk5kfdyT.mjs → DAIuzoFs.mjs} +2 -1
  34. package/dist/es/chunk/{OVbHCQoq.mjs → DCS0eqqM.mjs} +3 -101
  35. package/dist/es/chunk/{BJTCqgn1.mjs → DDR6UjaC.mjs} +1 -1
  36. package/dist/es/chunk/{BKmk2ptO.mjs → DNsAO9iB.mjs} +2 -2
  37. package/dist/es/chunk/{-_x5oKYF.mjs → DQK0ezHm.mjs} +5 -4
  38. package/dist/es/chunk/{BQHHM_Gw.mjs → DQi1QPak.mjs} +30 -70
  39. package/dist/es/chunk/{BaqDgAvL.mjs → DSt2uDNE.mjs} +22 -434
  40. package/dist/es/chunk/DSw4GnC6.mjs +44 -0
  41. package/dist/es/chunk/DTbnchOm.mjs +94 -0
  42. package/dist/es/chunk/DViraU6I.mjs +45 -0
  43. package/dist/es/chunk/{C540ZOUa.mjs → DX84QR5M.mjs} +10 -9
  44. package/dist/es/chunk/DYKOYbzT.mjs +2003 -0
  45. package/dist/es/chunk/{D1PKXAql.mjs → D_F7nIja.mjs} +3 -4
  46. package/dist/es/chunk/{DcTh6n4x.mjs → D_Mvdscy.mjs} +5 -4
  47. package/dist/es/chunk/DhGOsWxx.mjs +6 -0
  48. package/dist/es/chunk/{DFxeI_lP.mjs → DhGcJR5p.mjs} +6 -6
  49. package/dist/es/chunk/DxxbB5jY.mjs +34 -0
  50. package/dist/es/chunk/EMeQxUfH.mjs +49 -0
  51. package/dist/es/chunk/{eN6VJ63C.mjs → F2ph6lWu.mjs} +9 -8
  52. package/dist/es/chunk/{Dn-BFXcJ.mjs → dN0VcQc2.mjs} +1 -1
  53. package/dist/es/chunk/{DTpr71Gd.mjs → e5i7OJY-.mjs} +4 -4
  54. package/dist/es/chunk/fueZ9sVu.mjs +890 -0
  55. package/dist/es/chunk/{CV2NA_2e.mjs → ipA7n6-J.mjs} +1 -1
  56. package/dist/es/chunk/{Dw-yyl2m.mjs → q2jRgbir.mjs} +2 -2
  57. package/dist/es/chunk/{C72pWnuz.mjs → w7VqVeWU.mjs} +5 -4
  58. package/dist/es/chunk/{DWcIzeMM.mjs → ytiKcA3H.mjs} +108 -10
  59. package/dist/es/chunk/{DFHjl3eL.mjs → yuIXvUxc.mjs} +1 -1
  60. package/dist/es/components/backbottom/backbottom.mjs +2 -2
  61. package/dist/es/components/button/button.d.ts +2 -1
  62. package/dist/es/components/button/button.mjs +68 -17
  63. package/dist/es/components/button/button.vue.d.ts +4 -1
  64. package/dist/es/components/choice/choice.mjs +3 -2
  65. package/dist/es/components/color-switcher/color-switcher.d.ts +15 -0
  66. package/dist/es/components/color-switcher/color-switcher.mjs +1215 -0
  67. package/dist/es/components/color-switcher/color-switcher.vue.d.ts +122 -0
  68. package/dist/es/components/color-switcher/index.css +5 -0
  69. package/dist/es/components/color-switcher/index.d.ts +4 -0
  70. package/dist/es/components/color-switcher/index.mjs +6 -0
  71. package/dist/es/components/cropper/cropper.mjs +12 -11
  72. package/dist/es/components/cropper/cropper.vue.d.ts +2 -2
  73. package/dist/es/components/currency/currency.mjs +7 -7
  74. package/dist/es/components/dark-switcher/dark-switcher.d.ts +10 -0
  75. package/dist/es/components/dark-switcher/dark-switcher.mjs +87 -0
  76. package/dist/es/components/dark-switcher/dark-switcher.vue.d.ts +12 -0
  77. package/dist/es/components/dark-switcher/index.css +11 -0
  78. package/dist/es/components/dark-switcher/index.d.ts +4 -0
  79. package/dist/es/components/dark-switcher/index.mjs +6 -0
  80. package/dist/es/components/daterange-picker/daterange-picker.mjs +21 -20
  81. package/dist/es/components/dialog/dialog.d.ts +1 -1
  82. package/dist/es/components/dialog/dialog.mjs +46 -61
  83. package/dist/es/components/dialog/dialog.vue.d.ts +1 -3
  84. package/dist/es/components/dialog/index.css +31 -32
  85. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +12 -12
  86. package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -5
  87. package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +14 -13
  88. package/dist/es/components/drag-verify/drag-verify.mjs +14 -14
  89. package/dist/es/components/drag-verify/index.css +11 -11
  90. package/dist/es/components/drawer/drawer.mjs +14 -14
  91. package/dist/es/components/drawer/index.css +16 -15
  92. package/dist/es/components/easy-pagination/easy-pagination.mjs +4 -4
  93. package/dist/es/components/el-icon/el-icon.mjs +2 -2
  94. package/dist/es/components/explorer/docs/data.d.ts +13 -0
  95. package/dist/es/components/explorer/explorer.d.ts +12 -0
  96. package/dist/es/components/explorer/explorer.mjs +64 -0
  97. package/dist/es/components/explorer/explorer.vue.d.ts +183 -0
  98. package/dist/es/components/explorer/explorer2.mjs +6 -0
  99. package/dist/es/components/explorer/index.css +14 -0
  100. package/dist/es/components/explorer/index.d.ts +4 -0
  101. package/dist/es/components/explorer/index.mjs +6 -0
  102. package/dist/es/components/explorer-column-table/explorer-column-table.d.ts +23 -0
  103. package/dist/es/components/explorer-column-table/explorer-column-table.mjs +2948 -0
  104. package/dist/es/components/explorer-column-table/explorer-column-table.vue.d.ts +1486 -0
  105. package/dist/es/components/explorer-column-table/index.css +49 -0
  106. package/dist/es/components/explorer-column-table/index.d.ts +4 -0
  107. package/dist/es/components/explorer-column-table/index.mjs +6 -0
  108. package/dist/es/components/explorer-filter/explorer-filter.d.ts +12 -0
  109. package/dist/es/components/explorer-filter/explorer-filter.mjs +81 -0
  110. package/dist/es/components/explorer-filter/explorer-filter.vue.d.ts +14 -0
  111. package/dist/es/components/explorer-filter/index.css +7 -0
  112. package/dist/es/components/explorer-filter/index.d.ts +4 -0
  113. package/dist/es/components/explorer-filter/index.mjs +6 -0
  114. package/dist/es/components/explorer-footer/explorer-footer.d.ts +5 -0
  115. package/dist/es/components/explorer-footer/explorer-footer.mjs +92 -0
  116. package/dist/es/components/explorer-footer/explorer-footer.vue.d.ts +21 -0
  117. package/dist/es/components/explorer-footer/index.css +7 -0
  118. package/dist/es/components/explorer-footer/index.d.ts +4 -0
  119. package/dist/es/components/explorer-footer/index.mjs +6 -0
  120. package/dist/es/components/explorer-list/explorer-list.d.ts +23 -0
  121. package/dist/es/components/explorer-list/explorer-list.mjs +157 -0
  122. package/dist/es/components/explorer-list/explorer-list.vue.d.ts +38 -0
  123. package/dist/es/components/explorer-list/index.css +47 -0
  124. package/dist/es/components/explorer-list/index.d.ts +4 -0
  125. package/dist/es/components/explorer-list/index.mjs +6 -0
  126. package/dist/es/components/explorer-panel/explorer-panel.d.ts +14 -0
  127. package/dist/es/components/explorer-panel/explorer-panel.mjs +77 -0
  128. package/dist/es/components/explorer-panel/explorer-panel.vue.d.ts +253 -0
  129. package/dist/es/components/explorer-panel/explorer-panel2.mjs +6 -0
  130. package/dist/es/components/explorer-panel/index.css +12 -0
  131. package/dist/es/components/explorer-panel/index.d.ts +4 -0
  132. package/dist/es/components/explorer-panel/index.mjs +6 -0
  133. package/dist/es/components/explorer-query/explorer-query.d.ts +11 -0
  134. package/dist/es/components/explorer-query/explorer-query.mjs +2376 -0
  135. package/dist/es/components/explorer-query/explorer-query.vue.d.ts +396 -0
  136. package/dist/es/components/explorer-query/index.css +36 -0
  137. package/dist/es/components/explorer-query/index.d.ts +4 -0
  138. package/dist/es/components/explorer-query/index.mjs +6 -0
  139. package/dist/es/components/explorer-table/explorer-table.d.ts +11 -0
  140. package/dist/es/components/explorer-table/explorer-table.mjs +116 -0
  141. package/dist/es/components/explorer-table/explorer-table.vue.d.ts +25 -0
  142. package/dist/es/components/explorer-table/index.css +18 -0
  143. package/dist/es/components/explorer-table/index.d.ts +4 -0
  144. package/dist/es/components/explorer-table/index.mjs +6 -0
  145. package/dist/es/components/explorer-tools/components/column-setter.vue.d.ts +3028 -0
  146. package/dist/es/components/explorer-tools/explorer-tools.d.ts +35 -0
  147. package/dist/es/components/explorer-tools/explorer-tools.mjs +585 -0
  148. package/dist/es/components/explorer-tools/explorer-tools.vue.d.ts +43 -0
  149. package/dist/es/components/explorer-tools/index.css +60 -0
  150. package/dist/es/components/explorer-tools/index.d.ts +4 -0
  151. package/dist/es/components/explorer-tools/index.mjs +6 -0
  152. package/dist/es/components/explorer-tree/explorer-tree.d.ts +22 -0
  153. package/dist/es/components/explorer-tree/explorer-tree.mjs +174 -0
  154. package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +2055 -0
  155. package/dist/es/components/explorer-tree/index.css +55 -0
  156. package/dist/es/components/explorer-tree/index.d.ts +4 -0
  157. package/dist/es/components/explorer-tree/index.mjs +6 -0
  158. package/dist/es/components/icon/icon2.mjs +2 -2
  159. package/dist/es/components/icon-picker/components/collections.vue.d.ts +242 -196
  160. package/dist/es/components/icon-picker/icon-picker.mjs +38 -921
  161. package/dist/es/components/icon-picker/index.css +31 -29
  162. package/dist/es/components/iconify-icon/iconify-icon.mjs +2 -2
  163. package/dist/es/components/image/image.mjs +5 -5
  164. package/dist/es/components/image/image.vue.d.ts +7 -7
  165. package/dist/es/components/input/index.css +4 -5
  166. package/dist/es/components/input/input.mjs +7 -7
  167. package/dist/es/components/input/input.vue.d.ts +3 -3
  168. package/dist/es/components/input-number/input-number.mjs +5 -5
  169. package/dist/es/components/pca-picker/components/c.vue.d.ts +3 -3
  170. package/dist/es/components/pca-picker/index.css +4 -4
  171. package/dist/es/components/pca-picker/pca-picker.mjs +21 -209
  172. package/dist/es/components/pca-picker/pca-picker.vue.d.ts +10 -10
  173. package/dist/es/components/screenfull/screenfull.mjs +4 -4
  174. package/dist/es/components/scrollbar/index.css +6 -5
  175. package/dist/es/components/scrollbar/scrollbar.d.ts +2 -0
  176. package/dist/es/components/scrollbar/scrollbar.mjs +17 -12
  177. package/dist/es/components/scrollbar/scrollbar.vue.d.ts +156 -134
  178. package/dist/es/components/select/select.mjs +7 -7
  179. package/dist/es/components/single-player/index.css +11 -11
  180. package/dist/es/components/single-player/single-player.mjs +20 -19
  181. package/dist/es/components/splitter/index.d.ts +4 -0
  182. package/dist/es/components/splitter/index.mjs +6 -0
  183. package/dist/es/components/splitter/splitter.d.ts +4 -0
  184. package/dist/es/components/splitter/splitter.mjs +28 -0
  185. package/dist/es/components/{dual-pane/dual-pane.vue.d.ts → splitter/splitter.vue.d.ts} +3 -5
  186. package/dist/es/components/splitter-panel/index.css +5 -0
  187. package/dist/es/components/splitter-panel/index.d.ts +4 -0
  188. package/dist/es/components/splitter-panel/index.mjs +6 -0
  189. package/dist/es/components/splitter-panel/splitter-panel.d.ts +3 -0
  190. package/dist/es/components/splitter-panel/splitter-panel.mjs +49 -0
  191. package/dist/es/components/splitter-panel/splitter-panel.vue.d.ts +20 -0
  192. package/dist/es/components/svg-icon/svg-icon.mjs +2 -2
  193. package/dist/es/components/switch/switch.mjs +2 -2
  194. package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
  195. package/dist/es/components/tags/tags.mjs +12 -11
  196. package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
  197. package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +1 -1
  198. package/dist/es/components/thousand-input/thousand-input.mjs +3 -3
  199. package/dist/es/components/thousand-input/thousand-input.vue.d.ts +8 -8
  200. package/dist/es/components/tinymce/index.css +1 -1
  201. package/dist/es/components/tinymce/tinymce.d.ts +1 -0
  202. package/dist/es/components/tinymce/tinymce.mjs +20 -11
  203. package/dist/es/components/tinymce/tinymce.vue.d.ts +1 -0
  204. package/dist/es/components/tree-picker/popover-cascader.css +1 -1
  205. package/dist/es/components/tree-picker/tree-picker.mjs +11 -10
  206. package/dist/es/components/tree-picker/tree-picker.vue.d.ts +10 -10
  207. package/dist/es/components/upload-file/upload-file.mjs +2 -2
  208. package/dist/es/index.d.ts +14 -1
  209. package/dist/es/index.mjs +69 -39
  210. package/dist/es/use/usePersistentModel/index.d.ts +4 -0
  211. package/dist/es/use/usePersistentModel/index.mjs +19 -0
  212. package/dist/global.d.ts +14 -1
  213. package/dist/index.css +450 -123
  214. package/package.json +4 -1
  215. package/dist/es/chunk/DVNTpOBR.mjs +0 -4
  216. package/dist/es/components/dual-pane/dual-pane.d.ts +0 -8
  217. package/dist/es/components/dual-pane/index.css +0 -8
  218. package/dist/es/components/dual-pane/index.d.ts +0 -4
  219. package/dist/es/components/dual-pane/index.mjs +0 -6
@@ -0,0 +1,2948 @@
1
+ import './index.css'
2
+ import '../../chunk/By7FMB3I.mjs';
3
+ import { E as ElTable, a as ElTableColumn } from '../../chunk/BxibBO68.mjs';
4
+ import { E as ElCheckbox } from '../../chunk/DSt2uDNE.mjs';
5
+ /* empty css */
6
+ import '../../chunk/BfjuZmry.mjs';
7
+ import '../../chunk/D_Mvdscy.mjs';
8
+ /* empty css */
9
+ import { defineComponent, useTemplateRef, useCssModule, shallowRef, computed, createBlock, openBlock, normalizeClass, unref, withCtx, createVNode, createCommentVNode, createElementVNode } from 'vue';
10
+ import { C as Component$1 } from '../choice/choice.mjs';
11
+ import { C as Component$2 } from '../input-number/input-number.mjs';
12
+ import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
13
+
14
+ /**!
15
+ * Sortable 1.15.6
16
+ * @author RubaXa <trash@rubaxa.org>
17
+ * @author owenm <owen23355@gmail.com>
18
+ * @license MIT
19
+ */
20
+ function ownKeys(object, enumerableOnly) {
21
+ var keys = Object.keys(object);
22
+ if (Object.getOwnPropertySymbols) {
23
+ var symbols = Object.getOwnPropertySymbols(object);
24
+ if (enumerableOnly) {
25
+ symbols = symbols.filter(function (sym) {
26
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
27
+ });
28
+ }
29
+ keys.push.apply(keys, symbols);
30
+ }
31
+ return keys;
32
+ }
33
+ function _objectSpread2(target) {
34
+ for (var i = 1; i < arguments.length; i++) {
35
+ var source = arguments[i] != null ? arguments[i] : {};
36
+ if (i % 2) {
37
+ ownKeys(Object(source), true).forEach(function (key) {
38
+ _defineProperty(target, key, source[key]);
39
+ });
40
+ } else if (Object.getOwnPropertyDescriptors) {
41
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
42
+ } else {
43
+ ownKeys(Object(source)).forEach(function (key) {
44
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
45
+ });
46
+ }
47
+ }
48
+ return target;
49
+ }
50
+ function _typeof(obj) {
51
+ "@babel/helpers - typeof";
52
+
53
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
54
+ _typeof = function (obj) {
55
+ return typeof obj;
56
+ };
57
+ } else {
58
+ _typeof = function (obj) {
59
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
60
+ };
61
+ }
62
+ return _typeof(obj);
63
+ }
64
+ function _defineProperty(obj, key, value) {
65
+ if (key in obj) {
66
+ Object.defineProperty(obj, key, {
67
+ value: value,
68
+ enumerable: true,
69
+ configurable: true,
70
+ writable: true
71
+ });
72
+ } else {
73
+ obj[key] = value;
74
+ }
75
+ return obj;
76
+ }
77
+ function _extends() {
78
+ _extends = Object.assign || function (target) {
79
+ for (var i = 1; i < arguments.length; i++) {
80
+ var source = arguments[i];
81
+ for (var key in source) {
82
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
83
+ target[key] = source[key];
84
+ }
85
+ }
86
+ }
87
+ return target;
88
+ };
89
+ return _extends.apply(this, arguments);
90
+ }
91
+ function _objectWithoutPropertiesLoose(source, excluded) {
92
+ if (source == null) return {};
93
+ var target = {};
94
+ var sourceKeys = Object.keys(source);
95
+ var key, i;
96
+ for (i = 0; i < sourceKeys.length; i++) {
97
+ key = sourceKeys[i];
98
+ if (excluded.indexOf(key) >= 0) continue;
99
+ target[key] = source[key];
100
+ }
101
+ return target;
102
+ }
103
+ function _objectWithoutProperties(source, excluded) {
104
+ if (source == null) return {};
105
+ var target = _objectWithoutPropertiesLoose(source, excluded);
106
+ var key, i;
107
+ if (Object.getOwnPropertySymbols) {
108
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
109
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
110
+ key = sourceSymbolKeys[i];
111
+ if (excluded.indexOf(key) >= 0) continue;
112
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
113
+ target[key] = source[key];
114
+ }
115
+ }
116
+ return target;
117
+ }
118
+
119
+ var version = "1.15.6";
120
+
121
+ function userAgent(pattern) {
122
+ if (typeof window !== 'undefined' && window.navigator) {
123
+ return !! /*@__PURE__*/navigator.userAgent.match(pattern);
124
+ }
125
+ }
126
+ var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
127
+ var Edge = userAgent(/Edge/i);
128
+ var FireFox = userAgent(/firefox/i);
129
+ var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
130
+ var IOS = userAgent(/iP(ad|od|hone)/i);
131
+ var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
132
+
133
+ var captureMode = {
134
+ capture: false,
135
+ passive: false
136
+ };
137
+ function on(el, event, fn) {
138
+ el.addEventListener(event, fn, !IE11OrLess && captureMode);
139
+ }
140
+ function off(el, event, fn) {
141
+ el.removeEventListener(event, fn, !IE11OrLess && captureMode);
142
+ }
143
+ function matches( /**HTMLElement*/el, /**String*/selector) {
144
+ if (!selector) return;
145
+ selector[0] === '>' && (selector = selector.substring(1));
146
+ if (el) {
147
+ try {
148
+ if (el.matches) {
149
+ return el.matches(selector);
150
+ } else if (el.msMatchesSelector) {
151
+ return el.msMatchesSelector(selector);
152
+ } else if (el.webkitMatchesSelector) {
153
+ return el.webkitMatchesSelector(selector);
154
+ }
155
+ } catch (_) {
156
+ return false;
157
+ }
158
+ }
159
+ return false;
160
+ }
161
+ function getParentOrHost(el) {
162
+ return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
163
+ }
164
+ function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
165
+ if (el) {
166
+ ctx = ctx || document;
167
+ do {
168
+ if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
169
+ return el;
170
+ }
171
+ if (el === ctx) break;
172
+ /* jshint boss:true */
173
+ } while (el = getParentOrHost(el));
174
+ }
175
+ return null;
176
+ }
177
+ var R_SPACE = /\s+/g;
178
+ function toggleClass(el, name, state) {
179
+ if (el && name) {
180
+ if (el.classList) {
181
+ el.classList[state ? 'add' : 'remove'](name);
182
+ } else {
183
+ var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
184
+ el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
185
+ }
186
+ }
187
+ }
188
+ function css(el, prop, val) {
189
+ var style = el && el.style;
190
+ if (style) {
191
+ if (val === void 0) {
192
+ if (document.defaultView && document.defaultView.getComputedStyle) {
193
+ val = document.defaultView.getComputedStyle(el, '');
194
+ } else if (el.currentStyle) {
195
+ val = el.currentStyle;
196
+ }
197
+ return prop === void 0 ? val : val[prop];
198
+ } else {
199
+ if (!(prop in style) && prop.indexOf('webkit') === -1) {
200
+ prop = '-webkit-' + prop;
201
+ }
202
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
203
+ }
204
+ }
205
+ }
206
+ function matrix(el, selfOnly) {
207
+ var appliedTransforms = '';
208
+ if (typeof el === 'string') {
209
+ appliedTransforms = el;
210
+ } else {
211
+ do {
212
+ var transform = css(el, 'transform');
213
+ if (transform && transform !== 'none') {
214
+ appliedTransforms = transform + ' ' + appliedTransforms;
215
+ }
216
+ /* jshint boss:true */
217
+ } while (!selfOnly && (el = el.parentNode));
218
+ }
219
+ var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
220
+ /*jshint -W056 */
221
+ return matrixFn && new matrixFn(appliedTransforms);
222
+ }
223
+ function find(ctx, tagName, iterator) {
224
+ if (ctx) {
225
+ var list = ctx.getElementsByTagName(tagName),
226
+ i = 0,
227
+ n = list.length;
228
+ if (iterator) {
229
+ for (; i < n; i++) {
230
+ iterator(list[i], i);
231
+ }
232
+ }
233
+ return list;
234
+ }
235
+ return [];
236
+ }
237
+ function getWindowScrollingElement() {
238
+ var scrollingElement = document.scrollingElement;
239
+ if (scrollingElement) {
240
+ return scrollingElement;
241
+ } else {
242
+ return document.documentElement;
243
+ }
244
+ }
245
+
246
+ /**
247
+ * Returns the "bounding client rect" of given element
248
+ * @param {HTMLElement} el The element whose boundingClientRect is wanted
249
+ * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
250
+ * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
251
+ * @param {[Boolean]} undoScale Whether the container's scale() should be undone
252
+ * @param {[HTMLElement]} container The parent the element will be placed in
253
+ * @return {Object} The boundingClientRect of el, with specified adjustments
254
+ */
255
+ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
256
+ if (!el.getBoundingClientRect && el !== window) return;
257
+ var elRect, top, left, bottom, right, height, width;
258
+ if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
259
+ elRect = el.getBoundingClientRect();
260
+ top = elRect.top;
261
+ left = elRect.left;
262
+ bottom = elRect.bottom;
263
+ right = elRect.right;
264
+ height = elRect.height;
265
+ width = elRect.width;
266
+ } else {
267
+ top = 0;
268
+ left = 0;
269
+ bottom = window.innerHeight;
270
+ right = window.innerWidth;
271
+ height = window.innerHeight;
272
+ width = window.innerWidth;
273
+ }
274
+ if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
275
+ // Adjust for translate()
276
+ container = container || el.parentNode;
277
+
278
+ // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
279
+ // Not needed on <= IE11
280
+ if (!IE11OrLess) {
281
+ do {
282
+ if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
283
+ var containerRect = container.getBoundingClientRect();
284
+
285
+ // Set relative to edges of padding box of container
286
+ top -= containerRect.top + parseInt(css(container, 'border-top-width'));
287
+ left -= containerRect.left + parseInt(css(container, 'border-left-width'));
288
+ bottom = top + elRect.height;
289
+ right = left + elRect.width;
290
+ break;
291
+ }
292
+ /* jshint boss:true */
293
+ } while (container = container.parentNode);
294
+ }
295
+ }
296
+ if (undoScale && el !== window) {
297
+ // Adjust for scale()
298
+ var elMatrix = matrix(container || el),
299
+ scaleX = elMatrix && elMatrix.a,
300
+ scaleY = elMatrix && elMatrix.d;
301
+ if (elMatrix) {
302
+ top /= scaleY;
303
+ left /= scaleX;
304
+ width /= scaleX;
305
+ height /= scaleY;
306
+ bottom = top + height;
307
+ right = left + width;
308
+ }
309
+ }
310
+ return {
311
+ top: top,
312
+ left: left,
313
+ bottom: bottom,
314
+ right: right,
315
+ width: width,
316
+ height: height
317
+ };
318
+ }
319
+
320
+ /**
321
+ * Checks if a side of an element is scrolled past a side of its parents
322
+ * @param {HTMLElement} el The element who's side being scrolled out of view is in question
323
+ * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
324
+ * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
325
+ * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
326
+ */
327
+ function isScrolledPast(el, elSide, parentSide) {
328
+ var parent = getParentAutoScrollElement(el, true),
329
+ elSideVal = getRect(el)[elSide];
330
+
331
+ /* jshint boss:true */
332
+ while (parent) {
333
+ var parentSideVal = getRect(parent)[parentSide],
334
+ visible = void 0;
335
+ {
336
+ visible = elSideVal >= parentSideVal;
337
+ }
338
+ if (!visible) return parent;
339
+ if (parent === getWindowScrollingElement()) break;
340
+ parent = getParentAutoScrollElement(parent, false);
341
+ }
342
+ return false;
343
+ }
344
+
345
+ /**
346
+ * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
347
+ * and non-draggable elements
348
+ * @param {HTMLElement} el The parent element
349
+ * @param {Number} childNum The index of the child
350
+ * @param {Object} options Parent Sortable's options
351
+ * @return {HTMLElement} The child at index childNum, or null if not found
352
+ */
353
+ function getChild(el, childNum, options, includeDragEl) {
354
+ var currentChild = 0,
355
+ i = 0,
356
+ children = el.children;
357
+ while (i < children.length) {
358
+ if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
359
+ if (currentChild === childNum) {
360
+ return children[i];
361
+ }
362
+ currentChild++;
363
+ }
364
+ i++;
365
+ }
366
+ return null;
367
+ }
368
+
369
+ /**
370
+ * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
371
+ * @param {HTMLElement} el Parent element
372
+ * @param {selector} selector Any other elements that should be ignored
373
+ * @return {HTMLElement} The last child, ignoring ghostEl
374
+ */
375
+ function lastChild(el, selector) {
376
+ var last = el.lastElementChild;
377
+ while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
378
+ last = last.previousElementSibling;
379
+ }
380
+ return last || null;
381
+ }
382
+
383
+ /**
384
+ * Returns the index of an element within its parent for a selected set of
385
+ * elements
386
+ * @param {HTMLElement} el
387
+ * @param {selector} selector
388
+ * @return {number}
389
+ */
390
+ function index(el, selector) {
391
+ var index = 0;
392
+ if (!el || !el.parentNode) {
393
+ return -1;
394
+ }
395
+
396
+ /* jshint boss:true */
397
+ while (el = el.previousElementSibling) {
398
+ if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
399
+ index++;
400
+ }
401
+ }
402
+ return index;
403
+ }
404
+
405
+ /**
406
+ * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
407
+ * The value is returned in real pixels.
408
+ * @param {HTMLElement} el
409
+ * @return {Array} Offsets in the format of [left, top]
410
+ */
411
+ function getRelativeScrollOffset(el) {
412
+ var offsetLeft = 0,
413
+ offsetTop = 0,
414
+ winScroller = getWindowScrollingElement();
415
+ if (el) {
416
+ do {
417
+ var elMatrix = matrix(el),
418
+ scaleX = elMatrix.a,
419
+ scaleY = elMatrix.d;
420
+ offsetLeft += el.scrollLeft * scaleX;
421
+ offsetTop += el.scrollTop * scaleY;
422
+ } while (el !== winScroller && (el = el.parentNode));
423
+ }
424
+ return [offsetLeft, offsetTop];
425
+ }
426
+
427
+ /**
428
+ * Returns the index of the object within the given array
429
+ * @param {Array} arr Array that may or may not hold the object
430
+ * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
431
+ * @return {Number} The index of the object in the array, or -1
432
+ */
433
+ function indexOfObject(arr, obj) {
434
+ for (var i in arr) {
435
+ if (!arr.hasOwnProperty(i)) continue;
436
+ for (var key in obj) {
437
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
438
+ }
439
+ }
440
+ return -1;
441
+ }
442
+ function getParentAutoScrollElement(el, includeSelf) {
443
+ // skip to window
444
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
445
+ var elem = el;
446
+ var gotSelf = false;
447
+ do {
448
+ // we don't need to get elem css if it isn't even overflowing in the first place (performance)
449
+ if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
450
+ var elemCSS = css(elem);
451
+ if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
452
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
453
+ if (gotSelf || includeSelf) return elem;
454
+ gotSelf = true;
455
+ }
456
+ }
457
+ /* jshint boss:true */
458
+ } while (elem = elem.parentNode);
459
+ return getWindowScrollingElement();
460
+ }
461
+ function extend(dst, src) {
462
+ if (dst && src) {
463
+ for (var key in src) {
464
+ if (src.hasOwnProperty(key)) {
465
+ dst[key] = src[key];
466
+ }
467
+ }
468
+ }
469
+ return dst;
470
+ }
471
+ function isRectEqual(rect1, rect2) {
472
+ return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
473
+ }
474
+ var _throttleTimeout;
475
+ function throttle(callback, ms) {
476
+ return function () {
477
+ if (!_throttleTimeout) {
478
+ var args = arguments,
479
+ _this = this;
480
+ if (args.length === 1) {
481
+ callback.call(_this, args[0]);
482
+ } else {
483
+ callback.apply(_this, args);
484
+ }
485
+ _throttleTimeout = setTimeout(function () {
486
+ _throttleTimeout = void 0;
487
+ }, ms);
488
+ }
489
+ };
490
+ }
491
+ function cancelThrottle() {
492
+ clearTimeout(_throttleTimeout);
493
+ _throttleTimeout = void 0;
494
+ }
495
+ function scrollBy(el, x, y) {
496
+ el.scrollLeft += x;
497
+ el.scrollTop += y;
498
+ }
499
+ function clone(el) {
500
+ var Polymer = window.Polymer;
501
+ var $ = window.jQuery || window.Zepto;
502
+ if (Polymer && Polymer.dom) {
503
+ return Polymer.dom(el).cloneNode(true);
504
+ } else if ($) {
505
+ return $(el).clone(true)[0];
506
+ } else {
507
+ return el.cloneNode(true);
508
+ }
509
+ }
510
+ function getChildContainingRectFromElement(container, options, ghostEl) {
511
+ var rect = {};
512
+ Array.from(container.children).forEach(function (child) {
513
+ var _rect$left, _rect$top, _rect$right, _rect$bottom;
514
+ if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
515
+ var childRect = getRect(child);
516
+ rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
517
+ rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
518
+ rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
519
+ rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
520
+ });
521
+ rect.width = rect.right - rect.left;
522
+ rect.height = rect.bottom - rect.top;
523
+ rect.x = rect.left;
524
+ rect.y = rect.top;
525
+ return rect;
526
+ }
527
+ var expando = 'Sortable' + new Date().getTime();
528
+
529
+ function AnimationStateManager() {
530
+ var animationStates = [],
531
+ animationCallbackId;
532
+ return {
533
+ captureAnimationState: function captureAnimationState() {
534
+ animationStates = [];
535
+ if (!this.options.animation) return;
536
+ var children = [].slice.call(this.el.children);
537
+ children.forEach(function (child) {
538
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
539
+ animationStates.push({
540
+ target: child,
541
+ rect: getRect(child)
542
+ });
543
+ var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
544
+
545
+ // If animating: compensate for current animation
546
+ if (child.thisAnimationDuration) {
547
+ var childMatrix = matrix(child, true);
548
+ if (childMatrix) {
549
+ fromRect.top -= childMatrix.f;
550
+ fromRect.left -= childMatrix.e;
551
+ }
552
+ }
553
+ child.fromRect = fromRect;
554
+ });
555
+ },
556
+ addAnimationState: function addAnimationState(state) {
557
+ animationStates.push(state);
558
+ },
559
+ removeAnimationState: function removeAnimationState(target) {
560
+ animationStates.splice(indexOfObject(animationStates, {
561
+ target: target
562
+ }), 1);
563
+ },
564
+ animateAll: function animateAll(callback) {
565
+ var _this = this;
566
+ if (!this.options.animation) {
567
+ clearTimeout(animationCallbackId);
568
+ if (typeof callback === 'function') callback();
569
+ return;
570
+ }
571
+ var animating = false,
572
+ animationTime = 0;
573
+ animationStates.forEach(function (state) {
574
+ var time = 0,
575
+ target = state.target,
576
+ fromRect = target.fromRect,
577
+ toRect = getRect(target),
578
+ prevFromRect = target.prevFromRect,
579
+ prevToRect = target.prevToRect,
580
+ animatingRect = state.rect,
581
+ targetMatrix = matrix(target, true);
582
+ if (targetMatrix) {
583
+ // Compensate for current animation
584
+ toRect.top -= targetMatrix.f;
585
+ toRect.left -= targetMatrix.e;
586
+ }
587
+ target.toRect = toRect;
588
+ if (target.thisAnimationDuration) {
589
+ // Could also check if animatingRect is between fromRect and toRect
590
+ if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
591
+ // Make sure animatingRect is on line between toRect & fromRect
592
+ (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
593
+ // If returning to same place as started from animation and on same axis
594
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
595
+ }
596
+ }
597
+
598
+ // if fromRect != toRect: animate
599
+ if (!isRectEqual(toRect, fromRect)) {
600
+ target.prevFromRect = fromRect;
601
+ target.prevToRect = toRect;
602
+ if (!time) {
603
+ time = _this.options.animation;
604
+ }
605
+ _this.animate(target, animatingRect, toRect, time);
606
+ }
607
+ if (time) {
608
+ animating = true;
609
+ animationTime = Math.max(animationTime, time);
610
+ clearTimeout(target.animationResetTimer);
611
+ target.animationResetTimer = setTimeout(function () {
612
+ target.animationTime = 0;
613
+ target.prevFromRect = null;
614
+ target.fromRect = null;
615
+ target.prevToRect = null;
616
+ target.thisAnimationDuration = null;
617
+ }, time);
618
+ target.thisAnimationDuration = time;
619
+ }
620
+ });
621
+ clearTimeout(animationCallbackId);
622
+ if (!animating) {
623
+ if (typeof callback === 'function') callback();
624
+ } else {
625
+ animationCallbackId = setTimeout(function () {
626
+ if (typeof callback === 'function') callback();
627
+ }, animationTime);
628
+ }
629
+ animationStates = [];
630
+ },
631
+ animate: function animate(target, currentRect, toRect, duration) {
632
+ if (duration) {
633
+ css(target, 'transition', '');
634
+ css(target, 'transform', '');
635
+ var elMatrix = matrix(this.el),
636
+ scaleX = elMatrix && elMatrix.a,
637
+ scaleY = elMatrix && elMatrix.d,
638
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
639
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
640
+ target.animatingX = !!translateX;
641
+ target.animatingY = !!translateY;
642
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
643
+ this.forRepaintDummy = repaint(target); // repaint
644
+
645
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
646
+ css(target, 'transform', 'translate3d(0,0,0)');
647
+ typeof target.animated === 'number' && clearTimeout(target.animated);
648
+ target.animated = setTimeout(function () {
649
+ css(target, 'transition', '');
650
+ css(target, 'transform', '');
651
+ target.animated = false;
652
+ target.animatingX = false;
653
+ target.animatingY = false;
654
+ }, duration);
655
+ }
656
+ }
657
+ };
658
+ }
659
+ function repaint(target) {
660
+ return target.offsetWidth;
661
+ }
662
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
663
+ return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
664
+ }
665
+
666
+ var plugins = [];
667
+ var defaults = {
668
+ initializeByDefault: true
669
+ };
670
+ var PluginManager = {
671
+ mount: function mount(plugin) {
672
+ // Set default static properties
673
+ for (var option in defaults) {
674
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
675
+ plugin[option] = defaults[option];
676
+ }
677
+ }
678
+ plugins.forEach(function (p) {
679
+ if (p.pluginName === plugin.pluginName) {
680
+ throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
681
+ }
682
+ });
683
+ plugins.push(plugin);
684
+ },
685
+ pluginEvent: function pluginEvent(eventName, sortable, evt) {
686
+ var _this = this;
687
+ this.eventCanceled = false;
688
+ evt.cancel = function () {
689
+ _this.eventCanceled = true;
690
+ };
691
+ var eventNameGlobal = eventName + 'Global';
692
+ plugins.forEach(function (plugin) {
693
+ if (!sortable[plugin.pluginName]) return;
694
+ // Fire global events if it exists in this sortable
695
+ if (sortable[plugin.pluginName][eventNameGlobal]) {
696
+ sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
697
+ sortable: sortable
698
+ }, evt));
699
+ }
700
+
701
+ // Only fire plugin event if plugin is enabled in this sortable,
702
+ // and plugin has event defined
703
+ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
704
+ sortable[plugin.pluginName][eventName](_objectSpread2({
705
+ sortable: sortable
706
+ }, evt));
707
+ }
708
+ });
709
+ },
710
+ initializePlugins: function initializePlugins(sortable, el, defaults, options) {
711
+ plugins.forEach(function (plugin) {
712
+ var pluginName = plugin.pluginName;
713
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
714
+ var initialized = new plugin(sortable, el, sortable.options);
715
+ initialized.sortable = sortable;
716
+ initialized.options = sortable.options;
717
+ sortable[pluginName] = initialized;
718
+
719
+ // Add default options from plugin
720
+ _extends(defaults, initialized.defaults);
721
+ });
722
+ for (var option in sortable.options) {
723
+ if (!sortable.options.hasOwnProperty(option)) continue;
724
+ var modified = this.modifyOption(sortable, option, sortable.options[option]);
725
+ if (typeof modified !== 'undefined') {
726
+ sortable.options[option] = modified;
727
+ }
728
+ }
729
+ },
730
+ getEventProperties: function getEventProperties(name, sortable) {
731
+ var eventProperties = {};
732
+ plugins.forEach(function (plugin) {
733
+ if (typeof plugin.eventProperties !== 'function') return;
734
+ _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
735
+ });
736
+ return eventProperties;
737
+ },
738
+ modifyOption: function modifyOption(sortable, name, value) {
739
+ var modifiedValue;
740
+ plugins.forEach(function (plugin) {
741
+ // Plugin must exist on the Sortable
742
+ if (!sortable[plugin.pluginName]) return;
743
+
744
+ // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
745
+ if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
746
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
747
+ }
748
+ });
749
+ return modifiedValue;
750
+ }
751
+ };
752
+
753
+ function dispatchEvent(_ref) {
754
+ var sortable = _ref.sortable,
755
+ rootEl = _ref.rootEl,
756
+ name = _ref.name,
757
+ targetEl = _ref.targetEl,
758
+ cloneEl = _ref.cloneEl,
759
+ toEl = _ref.toEl,
760
+ fromEl = _ref.fromEl,
761
+ oldIndex = _ref.oldIndex,
762
+ newIndex = _ref.newIndex,
763
+ oldDraggableIndex = _ref.oldDraggableIndex,
764
+ newDraggableIndex = _ref.newDraggableIndex,
765
+ originalEvent = _ref.originalEvent,
766
+ putSortable = _ref.putSortable,
767
+ extraEventProperties = _ref.extraEventProperties;
768
+ sortable = sortable || rootEl && rootEl[expando];
769
+ if (!sortable) return;
770
+ var evt,
771
+ options = sortable.options,
772
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
773
+ // Support for new CustomEvent feature
774
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
775
+ evt = new CustomEvent(name, {
776
+ bubbles: true,
777
+ cancelable: true
778
+ });
779
+ } else {
780
+ evt = document.createEvent('Event');
781
+ evt.initEvent(name, true, true);
782
+ }
783
+ evt.to = toEl || rootEl;
784
+ evt.from = fromEl || rootEl;
785
+ evt.item = targetEl || rootEl;
786
+ evt.clone = cloneEl;
787
+ evt.oldIndex = oldIndex;
788
+ evt.newIndex = newIndex;
789
+ evt.oldDraggableIndex = oldDraggableIndex;
790
+ evt.newDraggableIndex = newDraggableIndex;
791
+ evt.originalEvent = originalEvent;
792
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
793
+ var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
794
+ for (var option in allEventProperties) {
795
+ evt[option] = allEventProperties[option];
796
+ }
797
+ if (rootEl) {
798
+ rootEl.dispatchEvent(evt);
799
+ }
800
+ if (options[onName]) {
801
+ options[onName].call(sortable, evt);
802
+ }
803
+ }
804
+
805
+ var _excluded = ["evt"];
806
+ var pluginEvent = function pluginEvent(eventName, sortable) {
807
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
808
+ originalEvent = _ref.evt,
809
+ data = _objectWithoutProperties(_ref, _excluded);
810
+ PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
811
+ dragEl: dragEl,
812
+ parentEl: parentEl,
813
+ ghostEl: ghostEl,
814
+ rootEl: rootEl,
815
+ nextEl: nextEl,
816
+ lastDownEl: lastDownEl,
817
+ cloneEl: cloneEl,
818
+ cloneHidden: cloneHidden,
819
+ dragStarted: moved,
820
+ putSortable: putSortable,
821
+ activeSortable: Sortable.active,
822
+ originalEvent: originalEvent,
823
+ oldIndex: oldIndex,
824
+ oldDraggableIndex: oldDraggableIndex,
825
+ newIndex: newIndex,
826
+ newDraggableIndex: newDraggableIndex,
827
+ hideGhostForTarget: _hideGhostForTarget,
828
+ unhideGhostForTarget: _unhideGhostForTarget,
829
+ cloneNowHidden: function cloneNowHidden() {
830
+ cloneHidden = true;
831
+ },
832
+ cloneNowShown: function cloneNowShown() {
833
+ cloneHidden = false;
834
+ },
835
+ dispatchSortableEvent: function dispatchSortableEvent(name) {
836
+ _dispatchEvent({
837
+ sortable: sortable,
838
+ name: name,
839
+ originalEvent: originalEvent
840
+ });
841
+ }
842
+ }, data));
843
+ };
844
+ function _dispatchEvent(info) {
845
+ dispatchEvent(_objectSpread2({
846
+ putSortable: putSortable,
847
+ cloneEl: cloneEl,
848
+ targetEl: dragEl,
849
+ rootEl: rootEl,
850
+ oldIndex: oldIndex,
851
+ oldDraggableIndex: oldDraggableIndex,
852
+ newIndex: newIndex,
853
+ newDraggableIndex: newDraggableIndex
854
+ }, info));
855
+ }
856
+ var dragEl,
857
+ parentEl,
858
+ ghostEl,
859
+ rootEl,
860
+ nextEl,
861
+ lastDownEl,
862
+ cloneEl,
863
+ cloneHidden,
864
+ oldIndex,
865
+ newIndex,
866
+ oldDraggableIndex,
867
+ newDraggableIndex,
868
+ activeGroup,
869
+ putSortable,
870
+ awaitingDragStarted = false,
871
+ ignoreNextClick = false,
872
+ sortables = [],
873
+ tapEvt,
874
+ touchEvt,
875
+ lastDx,
876
+ lastDy,
877
+ tapDistanceLeft,
878
+ tapDistanceTop,
879
+ moved,
880
+ lastTarget,
881
+ lastDirection,
882
+ pastFirstInvertThresh = false,
883
+ isCircumstantialInvert = false,
884
+ targetMoveDistance,
885
+ // For positioning ghost absolutely
886
+ ghostRelativeParent,
887
+ ghostRelativeParentInitialScroll = [],
888
+ // (left, top)
889
+
890
+ _silent = false,
891
+ savedInputChecked = [];
892
+
893
+ /** @const */
894
+ var documentExists = typeof document !== 'undefined',
895
+ PositionGhostAbsolutely = IOS,
896
+ CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
897
+ // This will not pass for IE9, because IE9 DnD only works on anchors
898
+ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
899
+ supportCssPointerEvents = function () {
900
+ if (!documentExists) return;
901
+ // false when <= IE11
902
+ if (IE11OrLess) {
903
+ return false;
904
+ }
905
+ var el = document.createElement('x');
906
+ el.style.cssText = 'pointer-events:auto';
907
+ return el.style.pointerEvents === 'auto';
908
+ }(),
909
+ _detectDirection = function _detectDirection(el, options) {
910
+ var elCSS = css(el),
911
+ elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
912
+ child1 = getChild(el, 0, options),
913
+ child2 = getChild(el, 1, options),
914
+ firstChildCSS = child1 && css(child1),
915
+ secondChildCSS = child2 && css(child2),
916
+ firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
917
+ secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
918
+ if (elCSS.display === 'flex') {
919
+ return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
920
+ }
921
+ if (elCSS.display === 'grid') {
922
+ return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
923
+ }
924
+ if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
925
+ var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
926
+ return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
927
+ }
928
+ return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
929
+ },
930
+ _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
931
+ var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
932
+ dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
933
+ dragElOppLength = vertical ? dragRect.width : dragRect.height,
934
+ targetS1Opp = vertical ? targetRect.left : targetRect.top,
935
+ targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
936
+ targetOppLength = vertical ? targetRect.width : targetRect.height;
937
+ return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
938
+ },
939
+ /**
940
+ * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
941
+ * @param {Number} x X position
942
+ * @param {Number} y Y position
943
+ * @return {HTMLElement} Element of the first found nearest Sortable
944
+ */
945
+ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
946
+ var ret;
947
+ sortables.some(function (sortable) {
948
+ var threshold = sortable[expando].options.emptyInsertThreshold;
949
+ if (!threshold || lastChild(sortable)) return;
950
+ var rect = getRect(sortable),
951
+ insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
952
+ insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
953
+ if (insideHorizontally && insideVertically) {
954
+ return ret = sortable;
955
+ }
956
+ });
957
+ return ret;
958
+ },
959
+ _prepareGroup = function _prepareGroup(options) {
960
+ function toFn(value, pull) {
961
+ return function (to, from, dragEl, evt) {
962
+ var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
963
+ if (value == null && (pull || sameGroup)) {
964
+ // Default pull value
965
+ // Default pull and put value if same group
966
+ return true;
967
+ } else if (value == null || value === false) {
968
+ return false;
969
+ } else if (pull && value === 'clone') {
970
+ return value;
971
+ } else if (typeof value === 'function') {
972
+ return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
973
+ } else {
974
+ var otherGroup = (pull ? to : from).options.group.name;
975
+ return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
976
+ }
977
+ };
978
+ }
979
+ var group = {};
980
+ var originalGroup = options.group;
981
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
982
+ originalGroup = {
983
+ name: originalGroup
984
+ };
985
+ }
986
+ group.name = originalGroup.name;
987
+ group.checkPull = toFn(originalGroup.pull, true);
988
+ group.checkPut = toFn(originalGroup.put);
989
+ group.revertClone = originalGroup.revertClone;
990
+ options.group = group;
991
+ },
992
+ _hideGhostForTarget = function _hideGhostForTarget() {
993
+ if (!supportCssPointerEvents && ghostEl) {
994
+ css(ghostEl, 'display', 'none');
995
+ }
996
+ },
997
+ _unhideGhostForTarget = function _unhideGhostForTarget() {
998
+ if (!supportCssPointerEvents && ghostEl) {
999
+ css(ghostEl, 'display', '');
1000
+ }
1001
+ };
1002
+
1003
+ // #1184 fix - Prevent click event on fallback if dragged but item not changed position
1004
+ if (documentExists && !ChromeForAndroid) {
1005
+ document.addEventListener('click', function (evt) {
1006
+ if (ignoreNextClick) {
1007
+ evt.preventDefault();
1008
+ evt.stopPropagation && evt.stopPropagation();
1009
+ evt.stopImmediatePropagation && evt.stopImmediatePropagation();
1010
+ ignoreNextClick = false;
1011
+ return false;
1012
+ }
1013
+ }, true);
1014
+ }
1015
+ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
1016
+ if (dragEl) {
1017
+ evt = evt.touches ? evt.touches[0] : evt;
1018
+ var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
1019
+ if (nearest) {
1020
+ // Create imitation event
1021
+ var event = {};
1022
+ for (var i in evt) {
1023
+ if (evt.hasOwnProperty(i)) {
1024
+ event[i] = evt[i];
1025
+ }
1026
+ }
1027
+ event.target = event.rootEl = nearest;
1028
+ event.preventDefault = void 0;
1029
+ event.stopPropagation = void 0;
1030
+ nearest[expando]._onDragOver(event);
1031
+ }
1032
+ }
1033
+ };
1034
+ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
1035
+ if (dragEl) {
1036
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1037
+ }
1038
+ };
1039
+
1040
+ /**
1041
+ * @class Sortable
1042
+ * @param {HTMLElement} el
1043
+ * @param {Object} [options]
1044
+ */
1045
+ function Sortable(el, options) {
1046
+ if (!(el && el.nodeType && el.nodeType === 1)) {
1047
+ throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
1048
+ }
1049
+ this.el = el; // root element
1050
+ this.options = options = _extends({}, options);
1051
+
1052
+ // Export instance
1053
+ el[expando] = this;
1054
+ var defaults = {
1055
+ group: null,
1056
+ sort: true,
1057
+ disabled: false,
1058
+ store: null,
1059
+ handle: null,
1060
+ draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
1061
+ swapThreshold: 1,
1062
+ // percentage; 0 <= x <= 1
1063
+ invertSwap: false,
1064
+ // invert always
1065
+ invertedSwapThreshold: null,
1066
+ // will be set to same as swapThreshold if default
1067
+ removeCloneOnHide: true,
1068
+ direction: function direction() {
1069
+ return _detectDirection(el, this.options);
1070
+ },
1071
+ ghostClass: 'sortable-ghost',
1072
+ chosenClass: 'sortable-chosen',
1073
+ dragClass: 'sortable-drag',
1074
+ ignore: 'a, img',
1075
+ filter: null,
1076
+ preventOnFilter: true,
1077
+ animation: 0,
1078
+ easing: null,
1079
+ setData: function setData(dataTransfer, dragEl) {
1080
+ dataTransfer.setData('Text', dragEl.textContent);
1081
+ },
1082
+ dropBubble: false,
1083
+ dragoverBubble: false,
1084
+ dataIdAttr: 'data-id',
1085
+ delay: 0,
1086
+ delayOnTouchOnly: false,
1087
+ touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
1088
+ forceFallback: false,
1089
+ fallbackClass: 'sortable-fallback',
1090
+ fallbackOnBody: false,
1091
+ fallbackTolerance: 0,
1092
+ fallbackOffset: {
1093
+ x: 0,
1094
+ y: 0
1095
+ },
1096
+ // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
1097
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
1098
+ emptyInsertThreshold: 5
1099
+ };
1100
+ PluginManager.initializePlugins(this, el, defaults);
1101
+
1102
+ // Set default options
1103
+ for (var name in defaults) {
1104
+ !(name in options) && (options[name] = defaults[name]);
1105
+ }
1106
+ _prepareGroup(options);
1107
+
1108
+ // Bind all private methods
1109
+ for (var fn in this) {
1110
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
1111
+ this[fn] = this[fn].bind(this);
1112
+ }
1113
+ }
1114
+
1115
+ // Setup drag mode
1116
+ this.nativeDraggable = options.forceFallback ? false : supportDraggable;
1117
+ if (this.nativeDraggable) {
1118
+ // Touch start threshold cannot be greater than the native dragstart threshold
1119
+ this.options.touchStartThreshold = 1;
1120
+ }
1121
+
1122
+ // Bind events
1123
+ if (options.supportPointer) {
1124
+ on(el, 'pointerdown', this._onTapStart);
1125
+ } else {
1126
+ on(el, 'mousedown', this._onTapStart);
1127
+ on(el, 'touchstart', this._onTapStart);
1128
+ }
1129
+ if (this.nativeDraggable) {
1130
+ on(el, 'dragover', this);
1131
+ on(el, 'dragenter', this);
1132
+ }
1133
+ sortables.push(this.el);
1134
+
1135
+ // Restore sorting
1136
+ options.store && options.store.get && this.sort(options.store.get(this) || []);
1137
+
1138
+ // Add animation state manager
1139
+ _extends(this, AnimationStateManager());
1140
+ }
1141
+ Sortable.prototype = /** @lends Sortable.prototype */{
1142
+ constructor: Sortable,
1143
+ _isOutsideThisEl: function _isOutsideThisEl(target) {
1144
+ if (!this.el.contains(target) && target !== this.el) {
1145
+ lastTarget = null;
1146
+ }
1147
+ },
1148
+ _getDirection: function _getDirection(evt, target) {
1149
+ return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
1150
+ },
1151
+ _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
1152
+ if (!evt.cancelable) return;
1153
+ var _this = this,
1154
+ el = this.el,
1155
+ options = this.options,
1156
+ preventOnFilter = options.preventOnFilter,
1157
+ type = evt.type,
1158
+ touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
1159
+ target = (touch || evt).target,
1160
+ originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
1161
+ filter = options.filter;
1162
+ _saveInputCheckedState(el);
1163
+
1164
+ // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
1165
+ if (dragEl) {
1166
+ return;
1167
+ }
1168
+ if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
1169
+ return; // only left button and enabled
1170
+ }
1171
+
1172
+ // cancel dnd if original target is content editable
1173
+ if (originalTarget.isContentEditable) {
1174
+ return;
1175
+ }
1176
+
1177
+ // Safari ignores further event handling after mousedown
1178
+ if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
1179
+ return;
1180
+ }
1181
+ target = closest(target, options.draggable, el, false);
1182
+ if (target && target.animated) {
1183
+ return;
1184
+ }
1185
+ if (lastDownEl === target) {
1186
+ // Ignoring duplicate `down`
1187
+ return;
1188
+ }
1189
+
1190
+ // Get the index of the dragged element within its parent
1191
+ oldIndex = index(target);
1192
+ oldDraggableIndex = index(target, options.draggable);
1193
+
1194
+ // Check filter
1195
+ if (typeof filter === 'function') {
1196
+ if (filter.call(this, evt, target, this)) {
1197
+ _dispatchEvent({
1198
+ sortable: _this,
1199
+ rootEl: originalTarget,
1200
+ name: 'filter',
1201
+ targetEl: target,
1202
+ toEl: el,
1203
+ fromEl: el
1204
+ });
1205
+ pluginEvent('filter', _this, {
1206
+ evt: evt
1207
+ });
1208
+ preventOnFilter && evt.preventDefault();
1209
+ return; // cancel dnd
1210
+ }
1211
+ } else if (filter) {
1212
+ filter = filter.split(',').some(function (criteria) {
1213
+ criteria = closest(originalTarget, criteria.trim(), el, false);
1214
+ if (criteria) {
1215
+ _dispatchEvent({
1216
+ sortable: _this,
1217
+ rootEl: criteria,
1218
+ name: 'filter',
1219
+ targetEl: target,
1220
+ fromEl: el,
1221
+ toEl: el
1222
+ });
1223
+ pluginEvent('filter', _this, {
1224
+ evt: evt
1225
+ });
1226
+ return true;
1227
+ }
1228
+ });
1229
+ if (filter) {
1230
+ preventOnFilter && evt.preventDefault();
1231
+ return; // cancel dnd
1232
+ }
1233
+ }
1234
+ if (options.handle && !closest(originalTarget, options.handle, el, false)) {
1235
+ return;
1236
+ }
1237
+
1238
+ // Prepare `dragstart`
1239
+ this._prepareDragStart(evt, touch, target);
1240
+ },
1241
+ _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
1242
+ var _this = this,
1243
+ el = _this.el,
1244
+ options = _this.options,
1245
+ ownerDocument = el.ownerDocument,
1246
+ dragStartFn;
1247
+ if (target && !dragEl && target.parentNode === el) {
1248
+ var dragRect = getRect(target);
1249
+ rootEl = el;
1250
+ dragEl = target;
1251
+ parentEl = dragEl.parentNode;
1252
+ nextEl = dragEl.nextSibling;
1253
+ lastDownEl = target;
1254
+ activeGroup = options.group;
1255
+ Sortable.dragged = dragEl;
1256
+ tapEvt = {
1257
+ target: dragEl,
1258
+ clientX: (touch || evt).clientX,
1259
+ clientY: (touch || evt).clientY
1260
+ };
1261
+ tapDistanceLeft = tapEvt.clientX - dragRect.left;
1262
+ tapDistanceTop = tapEvt.clientY - dragRect.top;
1263
+ this._lastX = (touch || evt).clientX;
1264
+ this._lastY = (touch || evt).clientY;
1265
+ dragEl.style['will-change'] = 'all';
1266
+ dragStartFn = function dragStartFn() {
1267
+ pluginEvent('delayEnded', _this, {
1268
+ evt: evt
1269
+ });
1270
+ if (Sortable.eventCanceled) {
1271
+ _this._onDrop();
1272
+ return;
1273
+ }
1274
+ // Delayed drag has been triggered
1275
+ // we can re-enable the events: touchmove/mousemove
1276
+ _this._disableDelayedDragEvents();
1277
+ if (!FireFox && _this.nativeDraggable) {
1278
+ dragEl.draggable = true;
1279
+ }
1280
+
1281
+ // Bind the events: dragstart/dragend
1282
+ _this._triggerDragStart(evt, touch);
1283
+
1284
+ // Drag start event
1285
+ _dispatchEvent({
1286
+ sortable: _this,
1287
+ name: 'choose',
1288
+ originalEvent: evt
1289
+ });
1290
+
1291
+ // Chosen item
1292
+ toggleClass(dragEl, options.chosenClass, true);
1293
+ };
1294
+
1295
+ // Disable "draggable"
1296
+ options.ignore.split(',').forEach(function (criteria) {
1297
+ find(dragEl, criteria.trim(), _disableDraggable);
1298
+ });
1299
+ on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1300
+ on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1301
+ on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1302
+ if (options.supportPointer) {
1303
+ on(ownerDocument, 'pointerup', _this._onDrop);
1304
+ // Native D&D triggers pointercancel
1305
+ !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
1306
+ } else {
1307
+ on(ownerDocument, 'mouseup', _this._onDrop);
1308
+ on(ownerDocument, 'touchend', _this._onDrop);
1309
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1310
+ }
1311
+
1312
+ // Make dragEl draggable (must be before delay for FireFox)
1313
+ if (FireFox && this.nativeDraggable) {
1314
+ this.options.touchStartThreshold = 4;
1315
+ dragEl.draggable = true;
1316
+ }
1317
+ pluginEvent('delayStart', this, {
1318
+ evt: evt
1319
+ });
1320
+
1321
+ // Delay is impossible for native DnD in Edge or IE
1322
+ if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1323
+ if (Sortable.eventCanceled) {
1324
+ this._onDrop();
1325
+ return;
1326
+ }
1327
+ // If the user moves the pointer or let go the click or touch
1328
+ // before the delay has been reached:
1329
+ // disable the delayed drag
1330
+ if (options.supportPointer) {
1331
+ on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
1332
+ on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
1333
+ } else {
1334
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1335
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1336
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1337
+ }
1338
+ on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1339
+ on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1340
+ options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
1341
+ _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
1342
+ } else {
1343
+ dragStartFn();
1344
+ }
1345
+ }
1346
+ },
1347
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
1348
+ var touch = e.touches ? e.touches[0] : e;
1349
+ if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
1350
+ this._disableDelayedDrag();
1351
+ }
1352
+ },
1353
+ _disableDelayedDrag: function _disableDelayedDrag() {
1354
+ dragEl && _disableDraggable(dragEl);
1355
+ clearTimeout(this._dragStartTimer);
1356
+ this._disableDelayedDragEvents();
1357
+ },
1358
+ _disableDelayedDragEvents: function _disableDelayedDragEvents() {
1359
+ var ownerDocument = this.el.ownerDocument;
1360
+ off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1361
+ off(ownerDocument, 'touchend', this._disableDelayedDrag);
1362
+ off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1363
+ off(ownerDocument, 'pointerup', this._disableDelayedDrag);
1364
+ off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
1365
+ off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1366
+ off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1367
+ off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
1368
+ },
1369
+ _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
1370
+ touch = touch || evt.pointerType == 'touch' && evt;
1371
+ if (!this.nativeDraggable || touch) {
1372
+ if (this.options.supportPointer) {
1373
+ on(document, 'pointermove', this._onTouchMove);
1374
+ } else if (touch) {
1375
+ on(document, 'touchmove', this._onTouchMove);
1376
+ } else {
1377
+ on(document, 'mousemove', this._onTouchMove);
1378
+ }
1379
+ } else {
1380
+ on(dragEl, 'dragend', this);
1381
+ on(rootEl, 'dragstart', this._onDragStart);
1382
+ }
1383
+ try {
1384
+ if (document.selection) {
1385
+ _nextTick(function () {
1386
+ document.selection.empty();
1387
+ });
1388
+ } else {
1389
+ window.getSelection().removeAllRanges();
1390
+ }
1391
+ } catch (err) {}
1392
+ },
1393
+ _dragStarted: function _dragStarted(fallback, evt) {
1394
+ awaitingDragStarted = false;
1395
+ if (rootEl && dragEl) {
1396
+ pluginEvent('dragStarted', this, {
1397
+ evt: evt
1398
+ });
1399
+ if (this.nativeDraggable) {
1400
+ on(document, 'dragover', _checkOutsideTargetEl);
1401
+ }
1402
+ var options = this.options;
1403
+
1404
+ // Apply effect
1405
+ !fallback && toggleClass(dragEl, options.dragClass, false);
1406
+ toggleClass(dragEl, options.ghostClass, true);
1407
+ Sortable.active = this;
1408
+ fallback && this._appendGhost();
1409
+
1410
+ // Drag start event
1411
+ _dispatchEvent({
1412
+ sortable: this,
1413
+ name: 'start',
1414
+ originalEvent: evt
1415
+ });
1416
+ } else {
1417
+ this._nulling();
1418
+ }
1419
+ },
1420
+ _emulateDragOver: function _emulateDragOver() {
1421
+ if (touchEvt) {
1422
+ this._lastX = touchEvt.clientX;
1423
+ this._lastY = touchEvt.clientY;
1424
+ _hideGhostForTarget();
1425
+ var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1426
+ var parent = target;
1427
+ while (target && target.shadowRoot) {
1428
+ target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1429
+ if (target === parent) break;
1430
+ parent = target;
1431
+ }
1432
+ dragEl.parentNode[expando]._isOutsideThisEl(target);
1433
+ if (parent) {
1434
+ do {
1435
+ if (parent[expando]) {
1436
+ var inserted = void 0;
1437
+ inserted = parent[expando]._onDragOver({
1438
+ clientX: touchEvt.clientX,
1439
+ clientY: touchEvt.clientY,
1440
+ target: target,
1441
+ rootEl: parent
1442
+ });
1443
+ if (inserted && !this.options.dragoverBubble) {
1444
+ break;
1445
+ }
1446
+ }
1447
+ target = parent; // store last element
1448
+ }
1449
+ /* jshint boss:true */ while (parent = getParentOrHost(parent));
1450
+ }
1451
+ _unhideGhostForTarget();
1452
+ }
1453
+ },
1454
+ _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
1455
+ if (tapEvt) {
1456
+ var options = this.options,
1457
+ fallbackTolerance = options.fallbackTolerance,
1458
+ fallbackOffset = options.fallbackOffset,
1459
+ touch = evt.touches ? evt.touches[0] : evt,
1460
+ ghostMatrix = ghostEl && matrix(ghostEl, true),
1461
+ scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
1462
+ scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
1463
+ relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
1464
+ dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
1465
+ dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
1466
+
1467
+ // only set the status to dragging, when we are actually dragging
1468
+ if (!Sortable.active && !awaitingDragStarted) {
1469
+ if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
1470
+ return;
1471
+ }
1472
+ this._onDragStart(evt, true);
1473
+ }
1474
+ if (ghostEl) {
1475
+ if (ghostMatrix) {
1476
+ ghostMatrix.e += dx - (lastDx || 0);
1477
+ ghostMatrix.f += dy - (lastDy || 0);
1478
+ } else {
1479
+ ghostMatrix = {
1480
+ a: 1,
1481
+ b: 0,
1482
+ c: 0,
1483
+ d: 1,
1484
+ e: dx,
1485
+ f: dy
1486
+ };
1487
+ }
1488
+ var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
1489
+ css(ghostEl, 'webkitTransform', cssMatrix);
1490
+ css(ghostEl, 'mozTransform', cssMatrix);
1491
+ css(ghostEl, 'msTransform', cssMatrix);
1492
+ css(ghostEl, 'transform', cssMatrix);
1493
+ lastDx = dx;
1494
+ lastDy = dy;
1495
+ touchEvt = touch;
1496
+ }
1497
+ evt.cancelable && evt.preventDefault();
1498
+ }
1499
+ },
1500
+ _appendGhost: function _appendGhost() {
1501
+ // Bug if using scale(): https://stackoverflow.com/questions/2637058
1502
+ // Not being adjusted for
1503
+ if (!ghostEl) {
1504
+ var container = this.options.fallbackOnBody ? document.body : rootEl,
1505
+ rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
1506
+ options = this.options;
1507
+
1508
+ // Position absolutely
1509
+ if (PositionGhostAbsolutely) {
1510
+ // Get relatively positioned parent
1511
+ ghostRelativeParent = container;
1512
+ while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
1513
+ ghostRelativeParent = ghostRelativeParent.parentNode;
1514
+ }
1515
+ if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1516
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1517
+ rect.top += ghostRelativeParent.scrollTop;
1518
+ rect.left += ghostRelativeParent.scrollLeft;
1519
+ } else {
1520
+ ghostRelativeParent = getWindowScrollingElement();
1521
+ }
1522
+ ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
1523
+ }
1524
+ ghostEl = dragEl.cloneNode(true);
1525
+ toggleClass(ghostEl, options.ghostClass, false);
1526
+ toggleClass(ghostEl, options.fallbackClass, true);
1527
+ toggleClass(ghostEl, options.dragClass, true);
1528
+ css(ghostEl, 'transition', '');
1529
+ css(ghostEl, 'transform', '');
1530
+ css(ghostEl, 'box-sizing', 'border-box');
1531
+ css(ghostEl, 'margin', 0);
1532
+ css(ghostEl, 'top', rect.top);
1533
+ css(ghostEl, 'left', rect.left);
1534
+ css(ghostEl, 'width', rect.width);
1535
+ css(ghostEl, 'height', rect.height);
1536
+ css(ghostEl, 'opacity', '0.8');
1537
+ css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
1538
+ css(ghostEl, 'zIndex', '100000');
1539
+ css(ghostEl, 'pointerEvents', 'none');
1540
+ Sortable.ghost = ghostEl;
1541
+ container.appendChild(ghostEl);
1542
+
1543
+ // Set transform-origin
1544
+ css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
1545
+ }
1546
+ },
1547
+ _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
1548
+ var _this = this;
1549
+ var dataTransfer = evt.dataTransfer;
1550
+ var options = _this.options;
1551
+ pluginEvent('dragStart', this, {
1552
+ evt: evt
1553
+ });
1554
+ if (Sortable.eventCanceled) {
1555
+ this._onDrop();
1556
+ return;
1557
+ }
1558
+ pluginEvent('setupClone', this);
1559
+ if (!Sortable.eventCanceled) {
1560
+ cloneEl = clone(dragEl);
1561
+ cloneEl.removeAttribute("id");
1562
+ cloneEl.draggable = false;
1563
+ cloneEl.style['will-change'] = '';
1564
+ this._hideClone();
1565
+ toggleClass(cloneEl, this.options.chosenClass, false);
1566
+ Sortable.clone = cloneEl;
1567
+ }
1568
+
1569
+ // #1143: IFrame support workaround
1570
+ _this.cloneId = _nextTick(function () {
1571
+ pluginEvent('clone', _this);
1572
+ if (Sortable.eventCanceled) return;
1573
+ if (!_this.options.removeCloneOnHide) {
1574
+ rootEl.insertBefore(cloneEl, dragEl);
1575
+ }
1576
+ _this._hideClone();
1577
+ _dispatchEvent({
1578
+ sortable: _this,
1579
+ name: 'clone'
1580
+ });
1581
+ });
1582
+ !fallback && toggleClass(dragEl, options.dragClass, true);
1583
+
1584
+ // Set proper drop events
1585
+ if (fallback) {
1586
+ ignoreNextClick = true;
1587
+ _this._loopId = setInterval(_this._emulateDragOver, 50);
1588
+ } else {
1589
+ // Undo what was set in _prepareDragStart before drag started
1590
+ off(document, 'mouseup', _this._onDrop);
1591
+ off(document, 'touchend', _this._onDrop);
1592
+ off(document, 'touchcancel', _this._onDrop);
1593
+ if (dataTransfer) {
1594
+ dataTransfer.effectAllowed = 'move';
1595
+ options.setData && options.setData.call(_this, dataTransfer, dragEl);
1596
+ }
1597
+ on(document, 'drop', _this);
1598
+
1599
+ // #1276 fix:
1600
+ css(dragEl, 'transform', 'translateZ(0)');
1601
+ }
1602
+ awaitingDragStarted = true;
1603
+ _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1604
+ on(document, 'selectstart', _this);
1605
+ moved = true;
1606
+ window.getSelection().removeAllRanges();
1607
+ if (Safari) {
1608
+ css(document.body, 'user-select', 'none');
1609
+ }
1610
+ },
1611
+ // Returns true - if no further action is needed (either inserted or another condition)
1612
+ _onDragOver: function _onDragOver( /**Event*/evt) {
1613
+ var el = this.el,
1614
+ target = evt.target,
1615
+ dragRect,
1616
+ targetRect,
1617
+ revert,
1618
+ options = this.options,
1619
+ group = options.group,
1620
+ activeSortable = Sortable.active,
1621
+ isOwner = activeGroup === group,
1622
+ canSort = options.sort,
1623
+ fromSortable = putSortable || activeSortable,
1624
+ vertical,
1625
+ _this = this,
1626
+ completedFired = false;
1627
+ if (_silent) return;
1628
+ function dragOverEvent(name, extra) {
1629
+ pluginEvent(name, _this, _objectSpread2({
1630
+ evt: evt,
1631
+ isOwner: isOwner,
1632
+ axis: vertical ? 'vertical' : 'horizontal',
1633
+ revert: revert,
1634
+ dragRect: dragRect,
1635
+ targetRect: targetRect,
1636
+ canSort: canSort,
1637
+ fromSortable: fromSortable,
1638
+ target: target,
1639
+ completed: completed,
1640
+ onMove: function onMove(target, after) {
1641
+ return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
1642
+ },
1643
+ changed: changed
1644
+ }, extra));
1645
+ }
1646
+
1647
+ // Capture animation state
1648
+ function capture() {
1649
+ dragOverEvent('dragOverAnimationCapture');
1650
+ _this.captureAnimationState();
1651
+ if (_this !== fromSortable) {
1652
+ fromSortable.captureAnimationState();
1653
+ }
1654
+ }
1655
+
1656
+ // Return invocation when dragEl is inserted (or completed)
1657
+ function completed(insertion) {
1658
+ dragOverEvent('dragOverCompleted', {
1659
+ insertion: insertion
1660
+ });
1661
+ if (insertion) {
1662
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1663
+ if (isOwner) {
1664
+ activeSortable._hideClone();
1665
+ } else {
1666
+ activeSortable._showClone(_this);
1667
+ }
1668
+ if (_this !== fromSortable) {
1669
+ // Set ghost class to new sortable's ghost class
1670
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1671
+ toggleClass(dragEl, options.ghostClass, true);
1672
+ }
1673
+ if (putSortable !== _this && _this !== Sortable.active) {
1674
+ putSortable = _this;
1675
+ } else if (_this === Sortable.active && putSortable) {
1676
+ putSortable = null;
1677
+ }
1678
+
1679
+ // Animation
1680
+ if (fromSortable === _this) {
1681
+ _this._ignoreWhileAnimating = target;
1682
+ }
1683
+ _this.animateAll(function () {
1684
+ dragOverEvent('dragOverAnimationComplete');
1685
+ _this._ignoreWhileAnimating = null;
1686
+ });
1687
+ if (_this !== fromSortable) {
1688
+ fromSortable.animateAll();
1689
+ fromSortable._ignoreWhileAnimating = null;
1690
+ }
1691
+ }
1692
+
1693
+ // Null lastTarget if it is not inside a previously swapped element
1694
+ if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1695
+ lastTarget = null;
1696
+ }
1697
+
1698
+ // no bubbling and not fallback
1699
+ if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1700
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1701
+
1702
+ // Do not detect for empty insert if already inserted
1703
+ !insertion && nearestEmptyInsertDetectEvent(evt);
1704
+ }
1705
+ !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1706
+ return completedFired = true;
1707
+ }
1708
+
1709
+ // Call when dragEl has been inserted
1710
+ function changed() {
1711
+ newIndex = index(dragEl);
1712
+ newDraggableIndex = index(dragEl, options.draggable);
1713
+ _dispatchEvent({
1714
+ sortable: _this,
1715
+ name: 'change',
1716
+ toEl: el,
1717
+ newIndex: newIndex,
1718
+ newDraggableIndex: newDraggableIndex,
1719
+ originalEvent: evt
1720
+ });
1721
+ }
1722
+ if (evt.preventDefault !== void 0) {
1723
+ evt.cancelable && evt.preventDefault();
1724
+ }
1725
+ target = closest(target, options.draggable, el, true);
1726
+ dragOverEvent('dragOver');
1727
+ if (Sortable.eventCanceled) return completedFired;
1728
+ if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1729
+ return completed(false);
1730
+ }
1731
+ ignoreNextClick = false;
1732
+ if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
1733
+ : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
1734
+ vertical = this._getDirection(evt, target) === 'vertical';
1735
+ dragRect = getRect(dragEl);
1736
+ dragOverEvent('dragOverValid');
1737
+ if (Sortable.eventCanceled) return completedFired;
1738
+ if (revert) {
1739
+ parentEl = rootEl; // actualization
1740
+ capture();
1741
+ this._hideClone();
1742
+ dragOverEvent('revert');
1743
+ if (!Sortable.eventCanceled) {
1744
+ if (nextEl) {
1745
+ rootEl.insertBefore(dragEl, nextEl);
1746
+ } else {
1747
+ rootEl.appendChild(dragEl);
1748
+ }
1749
+ }
1750
+ return completed(true);
1751
+ }
1752
+ var elLastChild = lastChild(el, options.draggable);
1753
+ if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
1754
+ // Insert to end of list
1755
+
1756
+ // If already at end of list: Do not insert
1757
+ if (elLastChild === dragEl) {
1758
+ return completed(false);
1759
+ }
1760
+
1761
+ // if there is a last element, it is the target
1762
+ if (elLastChild && el === evt.target) {
1763
+ target = elLastChild;
1764
+ }
1765
+ if (target) {
1766
+ targetRect = getRect(target);
1767
+ }
1768
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
1769
+ capture();
1770
+ if (elLastChild && elLastChild.nextSibling) {
1771
+ // the last draggable element is not the last node
1772
+ el.insertBefore(dragEl, elLastChild.nextSibling);
1773
+ } else {
1774
+ el.appendChild(dragEl);
1775
+ }
1776
+ parentEl = el; // actualization
1777
+
1778
+ changed();
1779
+ return completed(true);
1780
+ }
1781
+ } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
1782
+ // Insert to start of list
1783
+ var firstChild = getChild(el, 0, options, true);
1784
+ if (firstChild === dragEl) {
1785
+ return completed(false);
1786
+ }
1787
+ target = firstChild;
1788
+ targetRect = getRect(target);
1789
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
1790
+ capture();
1791
+ el.insertBefore(dragEl, firstChild);
1792
+ parentEl = el; // actualization
1793
+
1794
+ changed();
1795
+ return completed(true);
1796
+ }
1797
+ } else if (target.parentNode === el) {
1798
+ targetRect = getRect(target);
1799
+ var direction = 0,
1800
+ targetBeforeFirstSwap,
1801
+ differentLevel = dragEl.parentNode !== el,
1802
+ differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
1803
+ side1 = vertical ? 'top' : 'left',
1804
+ scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
1805
+ scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
1806
+ if (lastTarget !== target) {
1807
+ targetBeforeFirstSwap = targetRect[side1];
1808
+ pastFirstInvertThresh = false;
1809
+ isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
1810
+ }
1811
+ direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
1812
+ var sibling;
1813
+ if (direction !== 0) {
1814
+ // Check if target is beside dragEl in respective direction (ignoring hidden elements)
1815
+ var dragIndex = index(dragEl);
1816
+ do {
1817
+ dragIndex -= direction;
1818
+ sibling = parentEl.children[dragIndex];
1819
+ } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
1820
+ }
1821
+ // If dragEl is already beside target: Do not insert
1822
+ if (direction === 0 || sibling === target) {
1823
+ return completed(false);
1824
+ }
1825
+ lastTarget = target;
1826
+ lastDirection = direction;
1827
+ var nextSibling = target.nextElementSibling,
1828
+ after = false;
1829
+ after = direction === 1;
1830
+ var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
1831
+ if (moveVector !== false) {
1832
+ if (moveVector === 1 || moveVector === -1) {
1833
+ after = moveVector === 1;
1834
+ }
1835
+ _silent = true;
1836
+ setTimeout(_unsilent, 30);
1837
+ capture();
1838
+ if (after && !nextSibling) {
1839
+ el.appendChild(dragEl);
1840
+ } else {
1841
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
1842
+ }
1843
+
1844
+ // Undo chrome's scroll adjustment (has no effect on other browsers)
1845
+ if (scrolledPastTop) {
1846
+ scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
1847
+ }
1848
+ parentEl = dragEl.parentNode; // actualization
1849
+
1850
+ // must be done before animation
1851
+ if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
1852
+ targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
1853
+ }
1854
+ changed();
1855
+ return completed(true);
1856
+ }
1857
+ }
1858
+ if (el.contains(dragEl)) {
1859
+ return completed(false);
1860
+ }
1861
+ }
1862
+ return false;
1863
+ },
1864
+ _ignoreWhileAnimating: null,
1865
+ _offMoveEvents: function _offMoveEvents() {
1866
+ off(document, 'mousemove', this._onTouchMove);
1867
+ off(document, 'touchmove', this._onTouchMove);
1868
+ off(document, 'pointermove', this._onTouchMove);
1869
+ off(document, 'dragover', nearestEmptyInsertDetectEvent);
1870
+ off(document, 'mousemove', nearestEmptyInsertDetectEvent);
1871
+ off(document, 'touchmove', nearestEmptyInsertDetectEvent);
1872
+ },
1873
+ _offUpEvents: function _offUpEvents() {
1874
+ var ownerDocument = this.el.ownerDocument;
1875
+ off(ownerDocument, 'mouseup', this._onDrop);
1876
+ off(ownerDocument, 'touchend', this._onDrop);
1877
+ off(ownerDocument, 'pointerup', this._onDrop);
1878
+ off(ownerDocument, 'pointercancel', this._onDrop);
1879
+ off(ownerDocument, 'touchcancel', this._onDrop);
1880
+ off(document, 'selectstart', this);
1881
+ },
1882
+ _onDrop: function _onDrop( /**Event*/evt) {
1883
+ var el = this.el,
1884
+ options = this.options;
1885
+
1886
+ // Get the index of the dragged element within its parent
1887
+ newIndex = index(dragEl);
1888
+ newDraggableIndex = index(dragEl, options.draggable);
1889
+ pluginEvent('drop', this, {
1890
+ evt: evt
1891
+ });
1892
+ parentEl = dragEl && dragEl.parentNode;
1893
+
1894
+ // Get again after plugin event
1895
+ newIndex = index(dragEl);
1896
+ newDraggableIndex = index(dragEl, options.draggable);
1897
+ if (Sortable.eventCanceled) {
1898
+ this._nulling();
1899
+ return;
1900
+ }
1901
+ awaitingDragStarted = false;
1902
+ isCircumstantialInvert = false;
1903
+ pastFirstInvertThresh = false;
1904
+ clearInterval(this._loopId);
1905
+ clearTimeout(this._dragStartTimer);
1906
+ _cancelNextTick(this.cloneId);
1907
+ _cancelNextTick(this._dragStartId);
1908
+
1909
+ // Unbind events
1910
+ if (this.nativeDraggable) {
1911
+ off(document, 'drop', this);
1912
+ off(el, 'dragstart', this._onDragStart);
1913
+ }
1914
+ this._offMoveEvents();
1915
+ this._offUpEvents();
1916
+ if (Safari) {
1917
+ css(document.body, 'user-select', '');
1918
+ }
1919
+ css(dragEl, 'transform', '');
1920
+ if (evt) {
1921
+ if (moved) {
1922
+ evt.cancelable && evt.preventDefault();
1923
+ !options.dropBubble && evt.stopPropagation();
1924
+ }
1925
+ ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
1926
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
1927
+ // Remove clone(s)
1928
+ cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
1929
+ }
1930
+ if (dragEl) {
1931
+ if (this.nativeDraggable) {
1932
+ off(dragEl, 'dragend', this);
1933
+ }
1934
+ _disableDraggable(dragEl);
1935
+ dragEl.style['will-change'] = '';
1936
+
1937
+ // Remove classes
1938
+ // ghostClass is added in dragStarted
1939
+ if (moved && !awaitingDragStarted) {
1940
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
1941
+ }
1942
+ toggleClass(dragEl, this.options.chosenClass, false);
1943
+
1944
+ // Drag stop event
1945
+ _dispatchEvent({
1946
+ sortable: this,
1947
+ name: 'unchoose',
1948
+ toEl: parentEl,
1949
+ newIndex: null,
1950
+ newDraggableIndex: null,
1951
+ originalEvent: evt
1952
+ });
1953
+ if (rootEl !== parentEl) {
1954
+ if (newIndex >= 0) {
1955
+ // Add event
1956
+ _dispatchEvent({
1957
+ rootEl: parentEl,
1958
+ name: 'add',
1959
+ toEl: parentEl,
1960
+ fromEl: rootEl,
1961
+ originalEvent: evt
1962
+ });
1963
+
1964
+ // Remove event
1965
+ _dispatchEvent({
1966
+ sortable: this,
1967
+ name: 'remove',
1968
+ toEl: parentEl,
1969
+ originalEvent: evt
1970
+ });
1971
+
1972
+ // drag from one list and drop into another
1973
+ _dispatchEvent({
1974
+ rootEl: parentEl,
1975
+ name: 'sort',
1976
+ toEl: parentEl,
1977
+ fromEl: rootEl,
1978
+ originalEvent: evt
1979
+ });
1980
+ _dispatchEvent({
1981
+ sortable: this,
1982
+ name: 'sort',
1983
+ toEl: parentEl,
1984
+ originalEvent: evt
1985
+ });
1986
+ }
1987
+ putSortable && putSortable.save();
1988
+ } else {
1989
+ if (newIndex !== oldIndex) {
1990
+ if (newIndex >= 0) {
1991
+ // drag & drop within the same list
1992
+ _dispatchEvent({
1993
+ sortable: this,
1994
+ name: 'update',
1995
+ toEl: parentEl,
1996
+ originalEvent: evt
1997
+ });
1998
+ _dispatchEvent({
1999
+ sortable: this,
2000
+ name: 'sort',
2001
+ toEl: parentEl,
2002
+ originalEvent: evt
2003
+ });
2004
+ }
2005
+ }
2006
+ }
2007
+ if (Sortable.active) {
2008
+ /* jshint eqnull:true */
2009
+ if (newIndex == null || newIndex === -1) {
2010
+ newIndex = oldIndex;
2011
+ newDraggableIndex = oldDraggableIndex;
2012
+ }
2013
+ _dispatchEvent({
2014
+ sortable: this,
2015
+ name: 'end',
2016
+ toEl: parentEl,
2017
+ originalEvent: evt
2018
+ });
2019
+
2020
+ // Save sorting
2021
+ this.save();
2022
+ }
2023
+ }
2024
+ }
2025
+ this._nulling();
2026
+ },
2027
+ _nulling: function _nulling() {
2028
+ pluginEvent('nulling', this);
2029
+ rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2030
+ savedInputChecked.forEach(function (el) {
2031
+ el.checked = true;
2032
+ });
2033
+ savedInputChecked.length = lastDx = lastDy = 0;
2034
+ },
2035
+ handleEvent: function handleEvent( /**Event*/evt) {
2036
+ switch (evt.type) {
2037
+ case 'drop':
2038
+ case 'dragend':
2039
+ this._onDrop(evt);
2040
+ break;
2041
+ case 'dragenter':
2042
+ case 'dragover':
2043
+ if (dragEl) {
2044
+ this._onDragOver(evt);
2045
+ _globalDragOver(evt);
2046
+ }
2047
+ break;
2048
+ case 'selectstart':
2049
+ evt.preventDefault();
2050
+ break;
2051
+ }
2052
+ },
2053
+ /**
2054
+ * Serializes the item into an array of string.
2055
+ * @returns {String[]}
2056
+ */
2057
+ toArray: function toArray() {
2058
+ var order = [],
2059
+ el,
2060
+ children = this.el.children,
2061
+ i = 0,
2062
+ n = children.length,
2063
+ options = this.options;
2064
+ for (; i < n; i++) {
2065
+ el = children[i];
2066
+ if (closest(el, options.draggable, this.el, false)) {
2067
+ order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
2068
+ }
2069
+ }
2070
+ return order;
2071
+ },
2072
+ /**
2073
+ * Sorts the elements according to the array.
2074
+ * @param {String[]} order order of the items
2075
+ */
2076
+ sort: function sort(order, useAnimation) {
2077
+ var items = {},
2078
+ rootEl = this.el;
2079
+ this.toArray().forEach(function (id, i) {
2080
+ var el = rootEl.children[i];
2081
+ if (closest(el, this.options.draggable, rootEl, false)) {
2082
+ items[id] = el;
2083
+ }
2084
+ }, this);
2085
+ useAnimation && this.captureAnimationState();
2086
+ order.forEach(function (id) {
2087
+ if (items[id]) {
2088
+ rootEl.removeChild(items[id]);
2089
+ rootEl.appendChild(items[id]);
2090
+ }
2091
+ });
2092
+ useAnimation && this.animateAll();
2093
+ },
2094
+ /**
2095
+ * Save the current sorting
2096
+ */
2097
+ save: function save() {
2098
+ var store = this.options.store;
2099
+ store && store.set && store.set(this);
2100
+ },
2101
+ /**
2102
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2103
+ * @param {HTMLElement} el
2104
+ * @param {String} [selector] default: `options.draggable`
2105
+ * @returns {HTMLElement|null}
2106
+ */
2107
+ closest: function closest$1(el, selector) {
2108
+ return closest(el, selector || this.options.draggable, this.el, false);
2109
+ },
2110
+ /**
2111
+ * Set/get option
2112
+ * @param {string} name
2113
+ * @param {*} [value]
2114
+ * @returns {*}
2115
+ */
2116
+ option: function option(name, value) {
2117
+ var options = this.options;
2118
+ if (value === void 0) {
2119
+ return options[name];
2120
+ } else {
2121
+ var modifiedValue = PluginManager.modifyOption(this, name, value);
2122
+ if (typeof modifiedValue !== 'undefined') {
2123
+ options[name] = modifiedValue;
2124
+ } else {
2125
+ options[name] = value;
2126
+ }
2127
+ if (name === 'group') {
2128
+ _prepareGroup(options);
2129
+ }
2130
+ }
2131
+ },
2132
+ /**
2133
+ * Destroy
2134
+ */
2135
+ destroy: function destroy() {
2136
+ pluginEvent('destroy', this);
2137
+ var el = this.el;
2138
+ el[expando] = null;
2139
+ off(el, 'mousedown', this._onTapStart);
2140
+ off(el, 'touchstart', this._onTapStart);
2141
+ off(el, 'pointerdown', this._onTapStart);
2142
+ if (this.nativeDraggable) {
2143
+ off(el, 'dragover', this);
2144
+ off(el, 'dragenter', this);
2145
+ }
2146
+ // Remove draggable attributes
2147
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
2148
+ el.removeAttribute('draggable');
2149
+ });
2150
+ this._onDrop();
2151
+ this._disableDelayedDragEvents();
2152
+ sortables.splice(sortables.indexOf(this.el), 1);
2153
+ this.el = el = null;
2154
+ },
2155
+ _hideClone: function _hideClone() {
2156
+ if (!cloneHidden) {
2157
+ pluginEvent('hideClone', this);
2158
+ if (Sortable.eventCanceled) return;
2159
+ css(cloneEl, 'display', 'none');
2160
+ if (this.options.removeCloneOnHide && cloneEl.parentNode) {
2161
+ cloneEl.parentNode.removeChild(cloneEl);
2162
+ }
2163
+ cloneHidden = true;
2164
+ }
2165
+ },
2166
+ _showClone: function _showClone(putSortable) {
2167
+ if (putSortable.lastPutMode !== 'clone') {
2168
+ this._hideClone();
2169
+ return;
2170
+ }
2171
+ if (cloneHidden) {
2172
+ pluginEvent('showClone', this);
2173
+ if (Sortable.eventCanceled) return;
2174
+
2175
+ // show clone at dragEl or original position
2176
+ if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
2177
+ rootEl.insertBefore(cloneEl, dragEl);
2178
+ } else if (nextEl) {
2179
+ rootEl.insertBefore(cloneEl, nextEl);
2180
+ } else {
2181
+ rootEl.appendChild(cloneEl);
2182
+ }
2183
+ if (this.options.group.revertClone) {
2184
+ this.animate(dragEl, cloneEl);
2185
+ }
2186
+ css(cloneEl, 'display', '');
2187
+ cloneHidden = false;
2188
+ }
2189
+ }
2190
+ };
2191
+ function _globalDragOver( /**Event*/evt) {
2192
+ if (evt.dataTransfer) {
2193
+ evt.dataTransfer.dropEffect = 'move';
2194
+ }
2195
+ evt.cancelable && evt.preventDefault();
2196
+ }
2197
+ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
2198
+ var evt,
2199
+ sortable = fromEl[expando],
2200
+ onMoveFn = sortable.options.onMove,
2201
+ retVal;
2202
+ // Support for new CustomEvent feature
2203
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
2204
+ evt = new CustomEvent('move', {
2205
+ bubbles: true,
2206
+ cancelable: true
2207
+ });
2208
+ } else {
2209
+ evt = document.createEvent('Event');
2210
+ evt.initEvent('move', true, true);
2211
+ }
2212
+ evt.to = toEl;
2213
+ evt.from = fromEl;
2214
+ evt.dragged = dragEl;
2215
+ evt.draggedRect = dragRect;
2216
+ evt.related = targetEl || toEl;
2217
+ evt.relatedRect = targetRect || getRect(toEl);
2218
+ evt.willInsertAfter = willInsertAfter;
2219
+ evt.originalEvent = originalEvent;
2220
+ fromEl.dispatchEvent(evt);
2221
+ if (onMoveFn) {
2222
+ retVal = onMoveFn.call(sortable, evt, originalEvent);
2223
+ }
2224
+ return retVal;
2225
+ }
2226
+ function _disableDraggable(el) {
2227
+ el.draggable = false;
2228
+ }
2229
+ function _unsilent() {
2230
+ _silent = false;
2231
+ }
2232
+ function _ghostIsFirst(evt, vertical, sortable) {
2233
+ var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2234
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2235
+ var spacer = 10;
2236
+ return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2237
+ }
2238
+ function _ghostIsLast(evt, vertical, sortable) {
2239
+ var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2240
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2241
+ var spacer = 10;
2242
+ return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2243
+ }
2244
+ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2245
+ var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
2246
+ targetLength = vertical ? targetRect.height : targetRect.width,
2247
+ targetS1 = vertical ? targetRect.top : targetRect.left,
2248
+ targetS2 = vertical ? targetRect.bottom : targetRect.right,
2249
+ invert = false;
2250
+ if (!invertSwap) {
2251
+ // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
2252
+ if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
2253
+ // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
2254
+ // check if past first invert threshold on side opposite of lastDirection
2255
+ if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
2256
+ // past first invert threshold, do not restrict inverted threshold to dragEl shadow
2257
+ pastFirstInvertThresh = true;
2258
+ }
2259
+ if (!pastFirstInvertThresh) {
2260
+ // dragEl shadow (target move distance shadow)
2261
+ if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
2262
+ : mouseOnAxis > targetS2 - targetMoveDistance) {
2263
+ return -lastDirection;
2264
+ }
2265
+ } else {
2266
+ invert = true;
2267
+ }
2268
+ } else {
2269
+ // Regular
2270
+ if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
2271
+ return _getInsertDirection(target);
2272
+ }
2273
+ }
2274
+ }
2275
+ invert = invert || invertSwap;
2276
+ if (invert) {
2277
+ // Invert of regular
2278
+ if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
2279
+ return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
2280
+ }
2281
+ }
2282
+ return 0;
2283
+ }
2284
+
2285
+ /**
2286
+ * Gets the direction dragEl must be swapped relative to target in order to make it
2287
+ * seem that dragEl has been "inserted" into that element's position
2288
+ * @param {HTMLElement} target The target whose position dragEl is being inserted at
2289
+ * @return {Number} Direction dragEl must be swapped
2290
+ */
2291
+ function _getInsertDirection(target) {
2292
+ if (index(dragEl) < index(target)) {
2293
+ return 1;
2294
+ } else {
2295
+ return -1;
2296
+ }
2297
+ }
2298
+
2299
+ /**
2300
+ * Generate id
2301
+ * @param {HTMLElement} el
2302
+ * @returns {String}
2303
+ * @private
2304
+ */
2305
+ function _generateId(el) {
2306
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
2307
+ i = str.length,
2308
+ sum = 0;
2309
+ while (i--) {
2310
+ sum += str.charCodeAt(i);
2311
+ }
2312
+ return sum.toString(36);
2313
+ }
2314
+ function _saveInputCheckedState(root) {
2315
+ savedInputChecked.length = 0;
2316
+ var inputs = root.getElementsByTagName('input');
2317
+ var idx = inputs.length;
2318
+ while (idx--) {
2319
+ var el = inputs[idx];
2320
+ el.checked && savedInputChecked.push(el);
2321
+ }
2322
+ }
2323
+ function _nextTick(fn) {
2324
+ return setTimeout(fn, 0);
2325
+ }
2326
+ function _cancelNextTick(id) {
2327
+ return clearTimeout(id);
2328
+ }
2329
+
2330
+ // Fixed #973:
2331
+ if (documentExists) {
2332
+ on(document, 'touchmove', function (evt) {
2333
+ if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2334
+ evt.preventDefault();
2335
+ }
2336
+ });
2337
+ }
2338
+
2339
+ // Export utils
2340
+ Sortable.utils = {
2341
+ on: on,
2342
+ off: off,
2343
+ css: css,
2344
+ find: find,
2345
+ is: function is(el, selector) {
2346
+ return !!closest(el, selector, el, false);
2347
+ },
2348
+ extend: extend,
2349
+ throttle: throttle,
2350
+ closest: closest,
2351
+ toggleClass: toggleClass,
2352
+ clone: clone,
2353
+ index: index,
2354
+ nextTick: _nextTick,
2355
+ cancelNextTick: _cancelNextTick,
2356
+ detectDirection: _detectDirection,
2357
+ getChild: getChild,
2358
+ expando: expando
2359
+ };
2360
+
2361
+ /**
2362
+ * Get the Sortable instance of an element
2363
+ * @param {HTMLElement} element The element
2364
+ * @return {Sortable|undefined} The instance of Sortable
2365
+ */
2366
+ Sortable.get = function (element) {
2367
+ return element[expando];
2368
+ };
2369
+
2370
+ /**
2371
+ * Mount a plugin to Sortable
2372
+ * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
2373
+ */
2374
+ Sortable.mount = function () {
2375
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
2376
+ plugins[_key] = arguments[_key];
2377
+ }
2378
+ if (plugins[0].constructor === Array) plugins = plugins[0];
2379
+ plugins.forEach(function (plugin) {
2380
+ if (!plugin.prototype || !plugin.prototype.constructor) {
2381
+ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2382
+ }
2383
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2384
+ PluginManager.mount(plugin);
2385
+ });
2386
+ };
2387
+
2388
+ /**
2389
+ * Create sortable instance
2390
+ * @param {HTMLElement} el
2391
+ * @param {Object} [options]
2392
+ */
2393
+ Sortable.create = function (el, options) {
2394
+ return new Sortable(el, options);
2395
+ };
2396
+
2397
+ // Export
2398
+ Sortable.version = version;
2399
+
2400
+ var autoScrolls = [],
2401
+ scrollEl,
2402
+ scrollRootEl,
2403
+ scrolling = false,
2404
+ lastAutoScrollX,
2405
+ lastAutoScrollY,
2406
+ touchEvt$1,
2407
+ pointerElemChangedInterval;
2408
+ function AutoScrollPlugin() {
2409
+ function AutoScroll() {
2410
+ this.defaults = {
2411
+ scroll: true,
2412
+ forceAutoScrollFallback: false,
2413
+ scrollSensitivity: 30,
2414
+ scrollSpeed: 10,
2415
+ bubbleScroll: true
2416
+ };
2417
+
2418
+ // Bind all private methods
2419
+ for (var fn in this) {
2420
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2421
+ this[fn] = this[fn].bind(this);
2422
+ }
2423
+ }
2424
+ }
2425
+ AutoScroll.prototype = {
2426
+ dragStarted: function dragStarted(_ref) {
2427
+ var originalEvent = _ref.originalEvent;
2428
+ if (this.sortable.nativeDraggable) {
2429
+ on(document, 'dragover', this._handleAutoScroll);
2430
+ } else {
2431
+ if (this.options.supportPointer) {
2432
+ on(document, 'pointermove', this._handleFallbackAutoScroll);
2433
+ } else if (originalEvent.touches) {
2434
+ on(document, 'touchmove', this._handleFallbackAutoScroll);
2435
+ } else {
2436
+ on(document, 'mousemove', this._handleFallbackAutoScroll);
2437
+ }
2438
+ }
2439
+ },
2440
+ dragOverCompleted: function dragOverCompleted(_ref2) {
2441
+ var originalEvent = _ref2.originalEvent;
2442
+ // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
2443
+ if (!this.options.dragOverBubble && !originalEvent.rootEl) {
2444
+ this._handleAutoScroll(originalEvent);
2445
+ }
2446
+ },
2447
+ drop: function drop() {
2448
+ if (this.sortable.nativeDraggable) {
2449
+ off(document, 'dragover', this._handleAutoScroll);
2450
+ } else {
2451
+ off(document, 'pointermove', this._handleFallbackAutoScroll);
2452
+ off(document, 'touchmove', this._handleFallbackAutoScroll);
2453
+ off(document, 'mousemove', this._handleFallbackAutoScroll);
2454
+ }
2455
+ clearPointerElemChangedInterval();
2456
+ clearAutoScrolls();
2457
+ cancelThrottle();
2458
+ },
2459
+ nulling: function nulling() {
2460
+ touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
2461
+ autoScrolls.length = 0;
2462
+ },
2463
+ _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
2464
+ this._handleAutoScroll(evt, true);
2465
+ },
2466
+ _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
2467
+ var _this = this;
2468
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2469
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2470
+ elem = document.elementFromPoint(x, y);
2471
+ touchEvt$1 = evt;
2472
+
2473
+ // IE does not seem to have native autoscroll,
2474
+ // Edge's autoscroll seems too conditional,
2475
+ // MACOS Safari does not have autoscroll,
2476
+ // Firefox and Chrome are good
2477
+ if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
2478
+ autoScroll(evt, this.options, elem, fallback);
2479
+
2480
+ // Listener for pointer element change
2481
+ var ogElemScroller = getParentAutoScrollElement(elem, true);
2482
+ if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
2483
+ pointerElemChangedInterval && clearPointerElemChangedInterval();
2484
+ // Detect for pointer elem change, emulating native DnD behaviour
2485
+ pointerElemChangedInterval = setInterval(function () {
2486
+ var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
2487
+ if (newElem !== ogElemScroller) {
2488
+ ogElemScroller = newElem;
2489
+ clearAutoScrolls();
2490
+ }
2491
+ autoScroll(evt, _this.options, newElem, fallback);
2492
+ }, 10);
2493
+ lastAutoScrollX = x;
2494
+ lastAutoScrollY = y;
2495
+ }
2496
+ } else {
2497
+ // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
2498
+ if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
2499
+ clearAutoScrolls();
2500
+ return;
2501
+ }
2502
+ autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
2503
+ }
2504
+ }
2505
+ };
2506
+ return _extends(AutoScroll, {
2507
+ pluginName: 'scroll',
2508
+ initializeByDefault: true
2509
+ });
2510
+ }
2511
+ function clearAutoScrolls() {
2512
+ autoScrolls.forEach(function (autoScroll) {
2513
+ clearInterval(autoScroll.pid);
2514
+ });
2515
+ autoScrolls = [];
2516
+ }
2517
+ function clearPointerElemChangedInterval() {
2518
+ clearInterval(pointerElemChangedInterval);
2519
+ }
2520
+ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
2521
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
2522
+ if (!options.scroll) return;
2523
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2524
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2525
+ sens = options.scrollSensitivity,
2526
+ speed = options.scrollSpeed,
2527
+ winScroller = getWindowScrollingElement();
2528
+ var scrollThisInstance = false,
2529
+ scrollCustomFn;
2530
+
2531
+ // New scroll root, set scrollEl
2532
+ if (scrollRootEl !== rootEl) {
2533
+ scrollRootEl = rootEl;
2534
+ clearAutoScrolls();
2535
+ scrollEl = options.scroll;
2536
+ scrollCustomFn = options.scrollFn;
2537
+ if (scrollEl === true) {
2538
+ scrollEl = getParentAutoScrollElement(rootEl, true);
2539
+ }
2540
+ }
2541
+ var layersOut = 0;
2542
+ var currentParent = scrollEl;
2543
+ do {
2544
+ var el = currentParent,
2545
+ rect = getRect(el),
2546
+ top = rect.top,
2547
+ bottom = rect.bottom,
2548
+ left = rect.left,
2549
+ right = rect.right,
2550
+ width = rect.width,
2551
+ height = rect.height,
2552
+ canScrollX = void 0,
2553
+ canScrollY = void 0,
2554
+ scrollWidth = el.scrollWidth,
2555
+ scrollHeight = el.scrollHeight,
2556
+ elCSS = css(el),
2557
+ scrollPosX = el.scrollLeft,
2558
+ scrollPosY = el.scrollTop;
2559
+ if (el === winScroller) {
2560
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
2561
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
2562
+ } else {
2563
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
2564
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
2565
+ }
2566
+ var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
2567
+ var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
2568
+ if (!autoScrolls[layersOut]) {
2569
+ for (var i = 0; i <= layersOut; i++) {
2570
+ if (!autoScrolls[i]) {
2571
+ autoScrolls[i] = {};
2572
+ }
2573
+ }
2574
+ }
2575
+ if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
2576
+ autoScrolls[layersOut].el = el;
2577
+ autoScrolls[layersOut].vx = vx;
2578
+ autoScrolls[layersOut].vy = vy;
2579
+ clearInterval(autoScrolls[layersOut].pid);
2580
+ if (vx != 0 || vy != 0) {
2581
+ scrollThisInstance = true;
2582
+ /* jshint loopfunc:true */
2583
+ autoScrolls[layersOut].pid = setInterval(function () {
2584
+ // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
2585
+ if (isFallback && this.layer === 0) {
2586
+ Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
2587
+ }
2588
+ var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
2589
+ var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
2590
+ if (typeof scrollCustomFn === 'function') {
2591
+ if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
2592
+ return;
2593
+ }
2594
+ }
2595
+ scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
2596
+ }.bind({
2597
+ layer: layersOut
2598
+ }), 24);
2599
+ }
2600
+ }
2601
+ layersOut++;
2602
+ } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
2603
+ scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
2604
+ }, 30);
2605
+
2606
+ var drop = function drop(_ref) {
2607
+ var originalEvent = _ref.originalEvent,
2608
+ putSortable = _ref.putSortable,
2609
+ dragEl = _ref.dragEl,
2610
+ activeSortable = _ref.activeSortable,
2611
+ dispatchSortableEvent = _ref.dispatchSortableEvent,
2612
+ hideGhostForTarget = _ref.hideGhostForTarget,
2613
+ unhideGhostForTarget = _ref.unhideGhostForTarget;
2614
+ if (!originalEvent) return;
2615
+ var toSortable = putSortable || activeSortable;
2616
+ hideGhostForTarget();
2617
+ var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
2618
+ var target = document.elementFromPoint(touch.clientX, touch.clientY);
2619
+ unhideGhostForTarget();
2620
+ if (toSortable && !toSortable.el.contains(target)) {
2621
+ dispatchSortableEvent('spill');
2622
+ this.onSpill({
2623
+ dragEl: dragEl,
2624
+ putSortable: putSortable
2625
+ });
2626
+ }
2627
+ };
2628
+ function Revert() {}
2629
+ Revert.prototype = {
2630
+ startIndex: null,
2631
+ dragStart: function dragStart(_ref2) {
2632
+ var oldDraggableIndex = _ref2.oldDraggableIndex;
2633
+ this.startIndex = oldDraggableIndex;
2634
+ },
2635
+ onSpill: function onSpill(_ref3) {
2636
+ var dragEl = _ref3.dragEl,
2637
+ putSortable = _ref3.putSortable;
2638
+ this.sortable.captureAnimationState();
2639
+ if (putSortable) {
2640
+ putSortable.captureAnimationState();
2641
+ }
2642
+ var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
2643
+ if (nextSibling) {
2644
+ this.sortable.el.insertBefore(dragEl, nextSibling);
2645
+ } else {
2646
+ this.sortable.el.appendChild(dragEl);
2647
+ }
2648
+ this.sortable.animateAll();
2649
+ if (putSortable) {
2650
+ putSortable.animateAll();
2651
+ }
2652
+ },
2653
+ drop: drop
2654
+ };
2655
+ _extends(Revert, {
2656
+ pluginName: 'revertOnSpill'
2657
+ });
2658
+ function Remove() {}
2659
+ Remove.prototype = {
2660
+ onSpill: function onSpill(_ref4) {
2661
+ var dragEl = _ref4.dragEl,
2662
+ putSortable = _ref4.putSortable;
2663
+ var parentSortable = putSortable || this.sortable;
2664
+ parentSortable.captureAnimationState();
2665
+ dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
2666
+ parentSortable.animateAll();
2667
+ },
2668
+ drop: drop
2669
+ };
2670
+ _extends(Remove, {
2671
+ pluginName: 'removeOnSpill'
2672
+ });
2673
+
2674
+ Sortable.mount(new AutoScrollPlugin());
2675
+ Sortable.mount(Remove, Revert);
2676
+
2677
+ const _sfc_main = /* @__PURE__ */ defineComponent({
2678
+ __name: "explorer-column-table",
2679
+ props: {
2680
+ data: {},
2681
+ size: {},
2682
+ mode: { default: "easy" },
2683
+ highlightCurrent: { type: Boolean, default: false },
2684
+ height: { default: 320 },
2685
+ emptyColumn: { type: Boolean, default: false }
2686
+ },
2687
+ emits: ["update:data"],
2688
+ setup(__props, { expose: __expose, emit: __emit }) {
2689
+ const props = __props;
2690
+ const emits = __emit;
2691
+ const tableRef = useTemplateRef("tableRef");
2692
+ const $style = useCssModule();
2693
+ const sortable = shallowRef(null);
2694
+ const myData = computed({
2695
+ get() {
2696
+ if (!props.data) {
2697
+ return [];
2698
+ }
2699
+ return props.data.map((item) => {
2700
+ if (item.fixed) {
2701
+ item.formFixed = [item.fixed];
2702
+ }
2703
+ return item;
2704
+ });
2705
+ },
2706
+ set(val) {
2707
+ emits("update:data", val);
2708
+ }
2709
+ });
2710
+ const widthOptions = [
2711
+ { label: "宽", value: "width" },
2712
+ { label: "最小宽", value: "minWidth" }
2713
+ ];
2714
+ const alignOptions = [
2715
+ { label: "左", value: "left" },
2716
+ { label: "中", value: "center" },
2717
+ { label: "右", value: "right" }
2718
+ ];
2719
+ const fixedOptions = [
2720
+ { label: "左", value: "left" },
2721
+ { label: "右", value: "right" }
2722
+ ];
2723
+ const widthConfig = computed(() => {
2724
+ if (props.size === "small") {
2725
+ return { width: 210, data: 140, fixed: 100, truncate: 50 };
2726
+ }
2727
+ if (props.size === "default") {
2728
+ return { width: 240, data: 160, fixed: 120, truncate: 60 };
2729
+ }
2730
+ return { width: 260, data: 200, fixed: 140, truncate: 76 };
2731
+ });
2732
+ const isFullMode = computed(() => props.mode === "full");
2733
+ function handleWidthChange(row) {
2734
+ if (row.widthType === "width") {
2735
+ row.width = row.minWidth;
2736
+ delete row.minWidth;
2737
+ } else {
2738
+ row.minWidth = row.width;
2739
+ delete row.width;
2740
+ }
2741
+ }
2742
+ function handleFixedChange(row) {
2743
+ if (Array.isArray(row.formFixed)) {
2744
+ if (row.formFixed.length === 0) {
2745
+ delete row.fixed;
2746
+ }
2747
+ if (row.formFixed.length === 1) {
2748
+ row.fixed = row.formFixed[0];
2749
+ }
2750
+ if (row.formFixed.length === 2) {
2751
+ row.fixed = row.formFixed[1];
2752
+ row.formFixed = [row.formFixed[1]];
2753
+ }
2754
+ }
2755
+ }
2756
+ function init() {
2757
+ const el = tableRef.value?.$el.querySelector(".el-table__body tbody");
2758
+ if (!el) {
2759
+ return;
2760
+ }
2761
+ if (sortable.value) {
2762
+ sortable.value.destroy();
2763
+ }
2764
+ sortable.value = new Sortable(el, {
2765
+ animation: 150,
2766
+ handle: `.${$style.label}`,
2767
+ // 可选:指定拖拽手柄
2768
+ onEnd: (evt) => {
2769
+ const { newIndex, oldIndex } = evt;
2770
+ if (newIndex !== void 0 && oldIndex !== void 0) {
2771
+ const item = myData.value.splice(oldIndex, 1)[0];
2772
+ myData.value.splice(newIndex, 0, item);
2773
+ }
2774
+ myData.value = [...myData.value];
2775
+ }
2776
+ });
2777
+ }
2778
+ __expose({ init });
2779
+ return (_ctx, _cache) => {
2780
+ const _component_ElCheckbox = ElCheckbox;
2781
+ const _component_ElTableColumn = ElTableColumn;
2782
+ const _component_el_checkbox = ElCheckbox;
2783
+ const _component_ElTable = ElTable;
2784
+ return openBlock(), createBlock(_component_ElTable, {
2785
+ ref_key: "tableRef",
2786
+ ref: tableRef,
2787
+ data: unref(myData),
2788
+ "row-key": "prop",
2789
+ border: "",
2790
+ size: __props.size,
2791
+ height: __props.height,
2792
+ "scrollbar-always-on": "",
2793
+ class: normalizeClass(unref($style).table)
2794
+ }, {
2795
+ default: withCtx(() => [
2796
+ createVNode(_component_ElTableColumn, {
2797
+ prop: "label",
2798
+ label: "列名",
2799
+ "min-width": 200,
2800
+ "show-overflow-tooltip": ""
2801
+ }, {
2802
+ default: withCtx(({ row }) => [
2803
+ createElementVNode("div", {
2804
+ class: normalizeClass(unref($style).label)
2805
+ }, [
2806
+ createVNode(_component_ElCheckbox, {
2807
+ modelValue: row.visible,
2808
+ "onUpdate:modelValue": ($event) => row.visible = $event,
2809
+ label: row.label,
2810
+ size: __props.size
2811
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "size"])
2812
+ ], 2)
2813
+ ]),
2814
+ _: 1
2815
+ }),
2816
+ unref(isFullMode) ? (openBlock(), createBlock(_component_ElTableColumn, {
2817
+ key: 0,
2818
+ label: "宽度",
2819
+ width: unref(widthConfig).width,
2820
+ align: "center"
2821
+ }, {
2822
+ default: withCtx(({ row }) => [
2823
+ createElementVNode("div", {
2824
+ class: normalizeClass(unref($style)["item-container"])
2825
+ }, [
2826
+ createVNode(Component$1, {
2827
+ modelValue: row.widthType,
2828
+ "onUpdate:modelValue": ($event) => row.widthType = $event,
2829
+ options: widthOptions,
2830
+ size: __props.size,
2831
+ onChange: ($event) => handleWidthChange(row)
2832
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "onChange"]),
2833
+ row.widthType === "width" ? (openBlock(), createBlock(Component$2, {
2834
+ key: 0,
2835
+ modelValue: row.width,
2836
+ "onUpdate:modelValue": ($event) => row.width = $event,
2837
+ min: 0,
2838
+ size: __props.size,
2839
+ controls: false,
2840
+ "input-width": "50px"
2841
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size"])) : (openBlock(), createBlock(Component$2, {
2842
+ key: 1,
2843
+ modelValue: row.minWidth,
2844
+ "onUpdate:modelValue": ($event) => row.minWidth = $event,
2845
+ min: 0,
2846
+ size: __props.size,
2847
+ controls: false,
2848
+ "input-width": "50px"
2849
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size"]))
2850
+ ], 2)
2851
+ ]),
2852
+ _: 1
2853
+ }, 8, ["width"])) : createCommentVNode("", true),
2854
+ unref(isFullMode) ? (openBlock(), createBlock(_component_ElTableColumn, {
2855
+ key: 1,
2856
+ label: "数据位置",
2857
+ width: unref(widthConfig).data,
2858
+ align: "center"
2859
+ }, {
2860
+ default: withCtx(({ row }) => [
2861
+ createElementVNode("div", {
2862
+ class: normalizeClass(unref($style)["item-container"])
2863
+ }, [
2864
+ createVNode(Component$1, {
2865
+ modelValue: row.align,
2866
+ "onUpdate:modelValue": ($event) => row.align = $event,
2867
+ options: alignOptions,
2868
+ size: __props.size
2869
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size"])
2870
+ ], 2)
2871
+ ]),
2872
+ _: 1
2873
+ }, 8, ["width"])) : createCommentVNode("", true),
2874
+ unref(isFullMode) ? (openBlock(), createBlock(_component_ElTableColumn, {
2875
+ key: 2,
2876
+ label: "冻结位置",
2877
+ width: unref(widthConfig).fixed,
2878
+ align: "center"
2879
+ }, {
2880
+ default: withCtx(({ row }) => [
2881
+ createElementVNode("div", {
2882
+ class: normalizeClass(unref($style)["item-container"])
2883
+ }, [
2884
+ createVNode(Component$1, {
2885
+ modelValue: row.formFixed,
2886
+ "onUpdate:modelValue": ($event) => row.formFixed = $event,
2887
+ multiple: "",
2888
+ options: fixedOptions,
2889
+ size: __props.size,
2890
+ onChange: ($event) => handleFixedChange(row)
2891
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "onChange"])
2892
+ ], 2)
2893
+ ]),
2894
+ _: 1
2895
+ }, 8, ["width"])) : createCommentVNode("", true),
2896
+ unref(isFullMode) ? (openBlock(), createBlock(_component_ElTableColumn, {
2897
+ key: 3,
2898
+ label: "截断",
2899
+ width: unref(widthConfig).truncate,
2900
+ align: "center"
2901
+ }, {
2902
+ default: withCtx(({ row }) => [
2903
+ createElementVNode("div", {
2904
+ class: normalizeClass(unref($style)["item-container"])
2905
+ }, [
2906
+ createVNode(_component_el_checkbox, {
2907
+ modelValue: row.showOverflowTooltip,
2908
+ "onUpdate:modelValue": ($event) => row.showOverflowTooltip = $event,
2909
+ size: __props.size,
2910
+ border: "",
2911
+ class: normalizeClass(unref($style).truncate)
2912
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "class"])
2913
+ ], 2)
2914
+ ]),
2915
+ _: 1
2916
+ }, 8, ["width"])) : createCommentVNode("", true),
2917
+ __props.emptyColumn ? (openBlock(), createBlock(_component_ElTableColumn, {
2918
+ key: 4,
2919
+ label: ""
2920
+ })) : createCommentVNode("", true)
2921
+ ]),
2922
+ _: 1
2923
+ }, 8, ["data", "size", "height", "class"]);
2924
+ };
2925
+ }
2926
+ });
2927
+
2928
+ /* unplugin-vue-components disabled */const table = "_table_ysja6_1";
2929
+ const label = "_label_ysja6_8";
2930
+ const truncate = "_truncate_ysja6_43";
2931
+ const style0 = {
2932
+ table: table,
2933
+ label: label,
2934
+ "item-container": "_item-container_ysja6_31",
2935
+ truncate: truncate
2936
+ };
2937
+
2938
+ const cssModules = {
2939
+ "$style": style0
2940
+ };
2941
+ const Component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
2942
+
2943
+ const __vite_glob_0_20 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2944
+ __proto__: null,
2945
+ default: Component
2946
+ }, Symbol.toStringTag, { value: 'Module' }));
2947
+
2948
+ export { Component as C, __vite_glob_0_20 as _ };