sortable.min.js 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607
  1. /*! Sortable 1.13.0 - MIT | git://github.com/SortableJS/Sortable.git */
  2. !(function (t, e) {
  3. "object" == typeof exports && "undefined" != typeof module
  4. ? (module.exports = e())
  5. : "function" == typeof define && define.amd
  6. ? define(e)
  7. : ((t = t || self).Sortable = e());
  8. })(this, function () {
  9. "use strict";
  10. function o(t) {
  11. return (o =
  12. "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
  13. ? function (t) {
  14. return typeof t;
  15. }
  16. : function (t) {
  17. return t &&
  18. "function" == typeof Symbol &&
  19. t.constructor === Symbol &&
  20. t !== Symbol.prototype
  21. ? "symbol"
  22. : typeof t;
  23. })(t);
  24. }
  25. function a() {
  26. return (a =
  27. Object.assign ||
  28. function (t) {
  29. for (var e = 1; e < arguments.length; e++) {
  30. var n = arguments[e];
  31. for (var o in n)
  32. Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
  33. }
  34. return t;
  35. }).apply(this, arguments);
  36. }
  37. function I(i) {
  38. for (var t = 1; t < arguments.length; t++) {
  39. var r = null != arguments[t] ? arguments[t] : {},
  40. e = Object.keys(r);
  41. "function" == typeof Object.getOwnPropertySymbols &&
  42. (e = e.concat(
  43. Object.getOwnPropertySymbols(r).filter(function (t) {
  44. return Object.getOwnPropertyDescriptor(r, t).enumerable;
  45. })
  46. )),
  47. e.forEach(function (t) {
  48. var e, n, o;
  49. (e = i),
  50. (o = r[(n = t)]),
  51. n in e
  52. ? Object.defineProperty(e, n, {
  53. value: o,
  54. enumerable: !0,
  55. configurable: !0,
  56. writable: !0
  57. })
  58. : (e[n] = o);
  59. });
  60. }
  61. return i;
  62. }
  63. function l(t, e) {
  64. if (null == t) return {};
  65. var n,
  66. o,
  67. i = (function (t, e) {
  68. if (null == t) return {};
  69. var n,
  70. o,
  71. i = {},
  72. r = Object.keys(t);
  73. for (o = 0; o < r.length; o++)
  74. (n = r[o]), 0 <= e.indexOf(n) || (i[n] = t[n]);
  75. return i;
  76. })(t, e);
  77. if (Object.getOwnPropertySymbols) {
  78. var r = Object.getOwnPropertySymbols(t);
  79. for (o = 0; o < r.length; o++)
  80. (n = r[o]),
  81. 0 <= e.indexOf(n) ||
  82. (Object.prototype.propertyIsEnumerable.call(t, n) && (i[n] = t[n]));
  83. }
  84. return i;
  85. }
  86. function e(t) {
  87. return (
  88. (function (t) {
  89. if (Array.isArray(t)) {
  90. for (var e = 0, n = new Array(t.length); e < t.length; e++)
  91. n[e] = t[e];
  92. return n;
  93. }
  94. })(t) ||
  95. (function (t) {
  96. if (
  97. Symbol.iterator in Object(t) ||
  98. "[object Arguments]" === Object.prototype.toString.call(t)
  99. )
  100. return Array.from(t);
  101. })(t) ||
  102. (function () {
  103. throw new TypeError("Invalid attempt to spread non-iterable instance");
  104. })()
  105. );
  106. }
  107. function t(t) {
  108. if ("undefined" != typeof window && window.navigator)
  109. return !!navigator.userAgent.match(t);
  110. }
  111. var w = t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),
  112. E = t(/Edge/i),
  113. c = t(/firefox/i),
  114. u = t(/safari/i) && !t(/chrome/i) && !t(/android/i),
  115. n = t(/iP(ad|od|hone)/i),
  116. i = t(/chrome/i) && t(/android/i),
  117. r = { capture: !1, passive: !1 };
  118. function d(t, e, n) {
  119. t.addEventListener(e, n, !w && r);
  120. }
  121. function s(t, e, n) {
  122. t.removeEventListener(e, n, !w && r);
  123. }
  124. function h(t, e) {
  125. if (e) {
  126. if ((">" === e[0] && (e = e.substring(1)), t))
  127. try {
  128. if (t.matches) return t.matches(e);
  129. if (t.msMatchesSelector) return t.msMatchesSelector(e);
  130. if (t.webkitMatchesSelector) return t.webkitMatchesSelector(e);
  131. } catch (t) {
  132. return !1;
  133. }
  134. return !1;
  135. }
  136. }
  137. function P(t, e, n, o) {
  138. if (t) {
  139. n = n || document;
  140. do {
  141. if (
  142. (null != e &&
  143. (">" === e[0] ? t.parentNode === n && h(t, e) : h(t, e))) ||
  144. (o && t === n)
  145. )
  146. return t;
  147. if (t === n) break;
  148. } while (
  149. (t =
  150. (i = t).host && i !== document && i.host.nodeType
  151. ? i.host
  152. : i.parentNode)
  153. );
  154. }
  155. var i;
  156. return null;
  157. }
  158. var f,
  159. p = /\s+/g;
  160. function k(t, e, n) {
  161. if (t && e)
  162. if (t.classList) t.classList[n ? "add" : "remove"](e);
  163. else {
  164. var o = (" " + t.className + " ")
  165. .replace(p, " ")
  166. .replace(" " + e + " ", " ");
  167. t.className = (o + (n ? " " + e : "")).replace(p, " ");
  168. }
  169. }
  170. function R(t, e, n) {
  171. var o = t && t.style;
  172. if (o) {
  173. if (void 0 === n)
  174. return (
  175. document.defaultView && document.defaultView.getComputedStyle
  176. ? (n = document.defaultView.getComputedStyle(t, ""))
  177. : t.currentStyle && (n = t.currentStyle),
  178. void 0 === e ? n : n[e]
  179. );
  180. e in o || -1 !== e.indexOf("webkit") || (e = "-webkit-" + e),
  181. (o[e] = n + ("string" == typeof n ? "" : "px"));
  182. }
  183. }
  184. function v(t, e) {
  185. var n = "";
  186. if ("string" == typeof t) n = t;
  187. else
  188. do {
  189. var o = R(t, "transform");
  190. o && "none" !== o && (n = o + " " + n);
  191. } while (!e && (t = t.parentNode));
  192. var i =
  193. window.DOMMatrix ||
  194. window.WebKitCSSMatrix ||
  195. window.CSSMatrix ||
  196. window.MSCSSMatrix;
  197. return i && new i(n);
  198. }
  199. function g(t, e, n) {
  200. if (t) {
  201. var o = t.getElementsByTagName(e),
  202. i = 0,
  203. r = o.length;
  204. if (n) for (; i < r; i++) n(o[i], i);
  205. return o;
  206. }
  207. return [];
  208. }
  209. function A() {
  210. var t = document.scrollingElement;
  211. return t || document.documentElement;
  212. }
  213. function X(t, e, n, o, i) {
  214. if (t.getBoundingClientRect || t === window) {
  215. var r, a, l, s, c, u, d;
  216. if (
  217. ((d =
  218. t !== window && t.parentNode && t !== A()
  219. ? ((a = (r = t.getBoundingClientRect()).top),
  220. (l = r.left),
  221. (s = r.bottom),
  222. (c = r.right),
  223. (u = r.height),
  224. r.width)
  225. : ((l = a = 0),
  226. (s = window.innerHeight),
  227. (c = window.innerWidth),
  228. (u = window.innerHeight),
  229. window.innerWidth)),
  230. (e || n) && t !== window && ((i = i || t.parentNode), !w))
  231. )
  232. do {
  233. if (
  234. i &&
  235. i.getBoundingClientRect &&
  236. ("none" !== R(i, "transform") ||
  237. (n && "static" !== R(i, "position")))
  238. ) {
  239. var h = i.getBoundingClientRect();
  240. (a -= h.top + parseInt(R(i, "border-top-width"))),
  241. (l -= h.left + parseInt(R(i, "border-left-width"))),
  242. (s = a + r.height),
  243. (c = l + r.width);
  244. break;
  245. }
  246. } while ((i = i.parentNode));
  247. if (o && t !== window) {
  248. var f = v(i || t),
  249. p = f && f.a,
  250. g = f && f.d;
  251. f && ((s = (a /= g) + (u /= g)), (c = (l /= p) + (d /= p)));
  252. }
  253. return { top: a, left: l, bottom: s, right: c, width: d, height: u };
  254. }
  255. }
  256. function Y(t, e, n) {
  257. for (var o = H(t, !0), i = X(t)[e]; o; ) {
  258. var r = X(o)[n];
  259. if (!("top" === n || "left" === n ? r <= i : i <= r)) return o;
  260. if (o === A()) break;
  261. o = H(o, !1);
  262. }
  263. return !1;
  264. }
  265. function m(t, e, n) {
  266. for (var o = 0, i = 0, r = t.children; i < r.length; ) {
  267. if (
  268. "none" !== r[i].style.display &&
  269. r[i] !== Rt.ghost &&
  270. r[i] !== Rt.dragged &&
  271. P(r[i], n.draggable, t, !1)
  272. ) {
  273. if (o === e) return r[i];
  274. o++;
  275. }
  276. i++;
  277. }
  278. return null;
  279. }
  280. function B(t, e) {
  281. for (
  282. var n = t.lastElementChild;
  283. n && (n === Rt.ghost || "none" === R(n, "display") || (e && !h(n, e)));
  284. )
  285. n = n.previousElementSibling;
  286. return n || null;
  287. }
  288. function F(t, e) {
  289. var n = 0;
  290. if (!t || !t.parentNode) return -1;
  291. for (; (t = t.previousElementSibling); )
  292. "TEMPLATE" === t.nodeName.toUpperCase() ||
  293. t === Rt.clone ||
  294. (e && !h(t, e)) ||
  295. n++;
  296. return n;
  297. }
  298. function b(t) {
  299. var e = 0,
  300. n = 0,
  301. o = A();
  302. if (t)
  303. do {
  304. var i = v(t),
  305. r = i.a,
  306. a = i.d;
  307. (e += t.scrollLeft * r), (n += t.scrollTop * a);
  308. } while (t !== o && (t = t.parentNode));
  309. return [e, n];
  310. }
  311. function H(t, e) {
  312. if (!t || !t.getBoundingClientRect) return A();
  313. var n = t,
  314. o = !1;
  315. do {
  316. if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
  317. var i = R(n);
  318. if (
  319. (n.clientWidth < n.scrollWidth &&
  320. ("auto" == i.overflowX || "scroll" == i.overflowX)) ||
  321. (n.clientHeight < n.scrollHeight &&
  322. ("auto" == i.overflowY || "scroll" == i.overflowY))
  323. ) {
  324. if (!n.getBoundingClientRect || n === document.body) return A();
  325. if (o || e) return n;
  326. o = !0;
  327. }
  328. }
  329. } while ((n = n.parentNode));
  330. return A();
  331. }
  332. function y(t, e) {
  333. return (
  334. Math.round(t.top) === Math.round(e.top) &&
  335. Math.round(t.left) === Math.round(e.left) &&
  336. Math.round(t.height) === Math.round(e.height) &&
  337. Math.round(t.width) === Math.round(e.width)
  338. );
  339. }
  340. function D(e, n) {
  341. return function () {
  342. if (!f) {
  343. var t = arguments;
  344. 1 === t.length ? e.call(this, t[0]) : e.apply(this, t),
  345. (f = setTimeout(function () {
  346. f = void 0;
  347. }, n));
  348. }
  349. };
  350. }
  351. function L(t, e, n) {
  352. (t.scrollLeft += e), (t.scrollTop += n);
  353. }
  354. function S(t) {
  355. var e = window.Polymer,
  356. n = window.jQuery || window.Zepto;
  357. return e && e.dom
  358. ? e.dom(t).cloneNode(!0)
  359. : n
  360. ? n(t).clone(!0)[0]
  361. : t.cloneNode(!0);
  362. }
  363. function _(t, e) {
  364. R(t, "position", "absolute"),
  365. R(t, "top", e.top),
  366. R(t, "left", e.left),
  367. R(t, "width", e.width),
  368. R(t, "height", e.height);
  369. }
  370. function C(t) {
  371. R(t, "position", ""),
  372. R(t, "top", ""),
  373. R(t, "left", ""),
  374. R(t, "width", ""),
  375. R(t, "height", "");
  376. }
  377. var j = "Sortable" + new Date().getTime();
  378. function T() {
  379. var e,
  380. o = [];
  381. return {
  382. captureAnimationState: function () {
  383. (o = []),
  384. this.options.animation &&
  385. [].slice.call(this.el.children).forEach(function (t) {
  386. if ("none" !== R(t, "display") && t !== Rt.ghost) {
  387. o.push({ target: t, rect: X(t) });
  388. var e = I({}, o[o.length - 1].rect);
  389. if (t.thisAnimationDuration) {
  390. var n = v(t, !0);
  391. n && ((e.top -= n.f), (e.left -= n.e));
  392. }
  393. t.fromRect = e;
  394. }
  395. });
  396. },
  397. addAnimationState: function (t) {
  398. o.push(t);
  399. },
  400. removeAnimationState: function (t) {
  401. o.splice(
  402. (function (t, e) {
  403. for (var n in t)
  404. if (t.hasOwnProperty(n))
  405. for (var o in e)
  406. if (e.hasOwnProperty(o) && e[o] === t[n][o]) return Number(n);
  407. return -1;
  408. })(o, { target: t }),
  409. 1
  410. );
  411. },
  412. animateAll: function (t) {
  413. var c = this;
  414. if (!this.options.animation)
  415. return clearTimeout(e), void ("function" == typeof t && t());
  416. var u = !1,
  417. d = 0;
  418. o.forEach(function (t) {
  419. var e = 0,
  420. n = t.target,
  421. o = n.fromRect,
  422. i = X(n),
  423. r = n.prevFromRect,
  424. a = n.prevToRect,
  425. l = t.rect,
  426. s = v(n, !0);
  427. s && ((i.top -= s.f), (i.left -= s.e)),
  428. (n.toRect = i),
  429. n.thisAnimationDuration &&
  430. y(r, i) &&
  431. !y(o, i) &&
  432. (l.top - i.top) / (l.left - i.left) ==
  433. (o.top - i.top) / (o.left - i.left) &&
  434. (e = (function (t, e, n, o) {
  435. return (
  436. (Math.sqrt(
  437. Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)
  438. ) /
  439. Math.sqrt(
  440. Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)
  441. )) *
  442. o.animation
  443. );
  444. })(l, r, a, c.options)),
  445. y(i, o) ||
  446. ((n.prevFromRect = o),
  447. (n.prevToRect = i),
  448. e || (e = c.options.animation),
  449. c.animate(n, l, i, e)),
  450. e &&
  451. ((u = !0),
  452. (d = Math.max(d, e)),
  453. clearTimeout(n.animationResetTimer),
  454. (n.animationResetTimer = setTimeout(function () {
  455. (n.animationTime = 0),
  456. (n.prevFromRect = null),
  457. (n.fromRect = null),
  458. (n.prevToRect = null),
  459. (n.thisAnimationDuration = null);
  460. }, e)),
  461. (n.thisAnimationDuration = e));
  462. }),
  463. clearTimeout(e),
  464. u
  465. ? (e = setTimeout(function () {
  466. "function" == typeof t && t();
  467. }, d))
  468. : "function" == typeof t && t(),
  469. (o = []);
  470. },
  471. animate: function (t, e, n, o) {
  472. if (o) {
  473. R(t, "transition", ""), R(t, "transform", "");
  474. var i = v(this.el),
  475. r = i && i.a,
  476. a = i && i.d,
  477. l = (e.left - n.left) / (r || 1),
  478. s = (e.top - n.top) / (a || 1);
  479. (t.animatingX = !!l),
  480. (t.animatingY = !!s),
  481. R(t, "transform", "translate3d(" + l + "px," + s + "px,0)"),
  482. (this.forRepaintDummy = (function (t) {
  483. return t.offsetWidth;
  484. })(t)),
  485. R(
  486. t,
  487. "transition",
  488. "transform " +
  489. o +
  490. "ms" +
  491. (this.options.easing ? " " + this.options.easing : "")
  492. ),
  493. R(t, "transform", "translate3d(0,0,0)"),
  494. "number" == typeof t.animated && clearTimeout(t.animated),
  495. (t.animated = setTimeout(function () {
  496. R(t, "transition", ""),
  497. R(t, "transform", ""),
  498. (t.animated = !1),
  499. (t.animatingX = !1),
  500. (t.animatingY = !1);
  501. }, o));
  502. }
  503. }
  504. };
  505. }
  506. var x = [],
  507. M = { initializeByDefault: !0 },
  508. O = {
  509. mount: function (e) {
  510. for (var t in M) !M.hasOwnProperty(t) || t in e || (e[t] = M[t]);
  511. x.forEach(function (t) {
  512. if (t.pluginName === e.pluginName)
  513. throw "Sortable: Cannot mount plugin ".concat(
  514. e.pluginName,
  515. " more than once"
  516. );
  517. }),
  518. x.push(e);
  519. },
  520. pluginEvent: function (e, n, o) {
  521. var t = this;
  522. (this.eventCanceled = !1),
  523. (o.cancel = function () {
  524. t.eventCanceled = !0;
  525. });
  526. var i = e + "Global";
  527. x.forEach(function (t) {
  528. n[t.pluginName] &&
  529. (n[t.pluginName][i] && n[t.pluginName][i](I({ sortable: n }, o)),
  530. n.options[t.pluginName] &&
  531. n[t.pluginName][e] &&
  532. n[t.pluginName][e](I({ sortable: n }, o)));
  533. });
  534. },
  535. initializePlugins: function (o, i, r, t) {
  536. for (var e in (x.forEach(function (t) {
  537. var e = t.pluginName;
  538. if (o.options[e] || t.initializeByDefault) {
  539. var n = new t(o, i, o.options);
  540. (n.sortable = o),
  541. (n.options = o.options),
  542. (o[e] = n),
  543. a(r, n.defaults);
  544. }
  545. }),
  546. o.options))
  547. if (o.options.hasOwnProperty(e)) {
  548. var n = this.modifyOption(o, e, o.options[e]);
  549. void 0 !== n && (o.options[e] = n);
  550. }
  551. },
  552. getEventProperties: function (e, n) {
  553. var o = {};
  554. return (
  555. x.forEach(function (t) {
  556. "function" == typeof t.eventProperties &&
  557. a(o, t.eventProperties.call(n[t.pluginName], e));
  558. }),
  559. o
  560. );
  561. },
  562. modifyOption: function (e, n, o) {
  563. var i;
  564. return (
  565. x.forEach(function (t) {
  566. e[t.pluginName] &&
  567. t.optionListeners &&
  568. "function" == typeof t.optionListeners[n] &&
  569. (i = t.optionListeners[n].call(e[t.pluginName], o));
  570. }),
  571. i
  572. );
  573. }
  574. };
  575. function N(t) {
  576. var e = t.sortable,
  577. n = t.rootEl,
  578. o = t.name,
  579. i = t.targetEl,
  580. r = t.cloneEl,
  581. a = t.toEl,
  582. l = t.fromEl,
  583. s = t.oldIndex,
  584. c = t.newIndex,
  585. u = t.oldDraggableIndex,
  586. d = t.newDraggableIndex,
  587. h = t.originalEvent,
  588. f = t.putSortable,
  589. p = t.extraEventProperties;
  590. if ((e = e || (n && n[j]))) {
  591. var g,
  592. v = e.options,
  593. m = "on" + o.charAt(0).toUpperCase() + o.substr(1);
  594. !window.CustomEvent || w || E
  595. ? (g = document.createEvent("Event")).initEvent(o, !0, !0)
  596. : (g = new CustomEvent(o, { bubbles: !0, cancelable: !0 })),
  597. (g.to = a || n),
  598. (g.from = l || n),
  599. (g.item = i || n),
  600. (g.clone = r),
  601. (g.oldIndex = s),
  602. (g.newIndex = c),
  603. (g.oldDraggableIndex = u),
  604. (g.newDraggableIndex = d),
  605. (g.originalEvent = h),
  606. (g.pullMode = f ? f.lastPutMode : void 0);
  607. var b = I({}, p, O.getEventProperties(o, e));
  608. for (var y in b) g[y] = b[y];
  609. n && n.dispatchEvent(g), v[m] && v[m].call(e, g);
  610. }
  611. }
  612. function K(t, e, n) {
  613. var o = 2 < arguments.length && void 0 !== n ? n : {},
  614. i = o.evt,
  615. r = l(o, ["evt"]);
  616. O.pluginEvent.bind(Rt)(
  617. t,
  618. e,
  619. I(
  620. {
  621. dragEl: z,
  622. parentEl: G,
  623. ghostEl: U,
  624. rootEl: q,
  625. nextEl: V,
  626. lastDownEl: Z,
  627. cloneEl: Q,
  628. cloneHidden: $,
  629. dragStarted: dt,
  630. putSortable: it,
  631. activeSortable: Rt.active,
  632. originalEvent: i,
  633. oldIndex: J,
  634. oldDraggableIndex: et,
  635. newIndex: tt,
  636. newDraggableIndex: nt,
  637. hideGhostForTarget: At,
  638. unhideGhostForTarget: It,
  639. cloneNowHidden: function () {
  640. $ = !0;
  641. },
  642. cloneNowShown: function () {
  643. $ = !1;
  644. },
  645. dispatchSortableEvent: function (t) {
  646. W({ sortable: e, name: t, originalEvent: i });
  647. }
  648. },
  649. r
  650. )
  651. );
  652. }
  653. function W(t) {
  654. N(
  655. I(
  656. {
  657. putSortable: it,
  658. cloneEl: Q,
  659. targetEl: z,
  660. rootEl: q,
  661. oldIndex: J,
  662. oldDraggableIndex: et,
  663. newIndex: tt,
  664. newDraggableIndex: nt
  665. },
  666. t
  667. )
  668. );
  669. }
  670. var z,
  671. G,
  672. U,
  673. q,
  674. V,
  675. Z,
  676. Q,
  677. $,
  678. J,
  679. tt,
  680. et,
  681. nt,
  682. ot,
  683. it,
  684. rt,
  685. at,
  686. lt,
  687. st,
  688. ct,
  689. ut,
  690. dt,
  691. ht,
  692. ft,
  693. pt,
  694. gt,
  695. vt = !1,
  696. mt = !1,
  697. bt = [],
  698. yt = !1,
  699. wt = !1,
  700. Et = [],
  701. Dt = !1,
  702. St = [],
  703. _t = "undefined" != typeof document,
  704. Ct = n,
  705. Tt = E || w ? "cssFloat" : "float",
  706. xt = _t && !i && !n && "draggable" in document.createElement("div"),
  707. Mt = (function () {
  708. if (_t) {
  709. if (w) return !1;
  710. var t = document.createElement("x");
  711. return (
  712. (t.style.cssText = "pointer-events:auto"),
  713. "auto" === t.style.pointerEvents
  714. );
  715. }
  716. })(),
  717. Ot = function (t, e) {
  718. var n = R(t),
  719. o =
  720. parseInt(n.width) -
  721. parseInt(n.paddingLeft) -
  722. parseInt(n.paddingRight) -
  723. parseInt(n.borderLeftWidth) -
  724. parseInt(n.borderRightWidth),
  725. i = m(t, 0, e),
  726. r = m(t, 1, e),
  727. a = i && R(i),
  728. l = r && R(r),
  729. s = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + X(i).width,
  730. c = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + X(r).width;
  731. if ("flex" === n.display)
  732. return "column" === n.flexDirection ||
  733. "column-reverse" === n.flexDirection
  734. ? "vertical"
  735. : "horizontal";
  736. if ("grid" === n.display)
  737. return n.gridTemplateColumns.split(" ").length <= 1
  738. ? "vertical"
  739. : "horizontal";
  740. if (i && a.float && "none" !== a.float) {
  741. var u = "left" === a.float ? "left" : "right";
  742. return !r || ("both" !== l.clear && l.clear !== u)
  743. ? "horizontal"
  744. : "vertical";
  745. }
  746. return i &&
  747. ("block" === a.display ||
  748. "flex" === a.display ||
  749. "table" === a.display ||
  750. "grid" === a.display ||
  751. (o <= s && "none" === n[Tt]) ||
  752. (r && "none" === n[Tt] && o < s + c))
  753. ? "vertical"
  754. : "horizontal";
  755. },
  756. Nt = function (t) {
  757. function s(a, l) {
  758. return function (t, e, n, o) {
  759. var i =
  760. t.options.group.name &&
  761. e.options.group.name &&
  762. t.options.group.name === e.options.group.name;
  763. if (null == a && (l || i)) return !0;
  764. if (null == a || !1 === a) return !1;
  765. if (l && "clone" === a) return a;
  766. if ("function" == typeof a) return s(a(t, e, n, o), l)(t, e, n, o);
  767. var r = (l ? t : e).options.group.name;
  768. return (
  769. !0 === a ||
  770. ("string" == typeof a && a === r) ||
  771. (a.join && -1 < a.indexOf(r))
  772. );
  773. };
  774. }
  775. var e = {},
  776. n = t.group;
  777. (n && "object" == o(n)) || (n = { name: n }),
  778. (e.name = n.name),
  779. (e.checkPull = s(n.pull, !0)),
  780. (e.checkPut = s(n.put)),
  781. (e.revertClone = n.revertClone),
  782. (t.group = e);
  783. },
  784. At = function () {
  785. !Mt && U && R(U, "display", "none");
  786. },
  787. It = function () {
  788. !Mt && U && R(U, "display", "");
  789. };
  790. _t &&
  791. document.addEventListener(
  792. "click",
  793. function (t) {
  794. if (mt)
  795. return (
  796. t.preventDefault(),
  797. t.stopPropagation && t.stopPropagation(),
  798. t.stopImmediatePropagation && t.stopImmediatePropagation(),
  799. (mt = !1)
  800. );
  801. },
  802. !0
  803. );
  804. function Pt(t) {
  805. if (z) {
  806. var e = (function (r, a) {
  807. var l;
  808. return (
  809. bt.some(function (t) {
  810. if (!B(t)) {
  811. var e = X(t),
  812. n = t[j].options.emptyInsertThreshold,
  813. o = r >= e.left - n && r <= e.right + n,
  814. i = a >= e.top - n && a <= e.bottom + n;
  815. return n && o && i ? (l = t) : void 0;
  816. }
  817. }),
  818. l
  819. );
  820. })((t = t.touches ? t.touches[0] : t).clientX, t.clientY);
  821. if (e) {
  822. var n = {};
  823. for (var o in t) t.hasOwnProperty(o) && (n[o] = t[o]);
  824. (n.target = n.rootEl = e),
  825. (n.preventDefault = void 0),
  826. (n.stopPropagation = void 0),
  827. e[j]._onDragOver(n);
  828. }
  829. }
  830. }
  831. function kt(t) {
  832. z && z.parentNode[j]._isOutsideThisEl(t.target);
  833. }
  834. function Rt(t, e) {
  835. if (!t || !t.nodeType || 1 !== t.nodeType)
  836. throw "Sortable: `el` must be an HTMLElement, not ".concat(
  837. {}.toString.call(t)
  838. );
  839. (this.el = t), (this.options = e = a({}, e)), (t[j] = this);
  840. var n = {
  841. group: null,
  842. sort: !0,
  843. disabled: !1,
  844. store: null,
  845. handle: null,
  846. draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
  847. swapThreshold: 1,
  848. invertSwap: !1,
  849. invertedSwapThreshold: null,
  850. removeCloneOnHide: !0,
  851. direction: function () {
  852. return Ot(t, this.options);
  853. },
  854. ghostClass: "sortable-ghost",
  855. chosenClass: "sortable-chosen",
  856. dragClass: "sortable-drag",
  857. ignore: "a, img",
  858. filter: null,
  859. preventOnFilter: !0,
  860. animation: 0,
  861. easing: null,
  862. setData: function (t, e) {
  863. t.setData("Text", e.textContent);
  864. },
  865. dropBubble: !1,
  866. dragoverBubble: !1,
  867. dataIdAttr: "data-id",
  868. delay: 0,
  869. delayOnTouchOnly: !1,
  870. touchStartThreshold:
  871. (Number.parseInt ? Number : window).parseInt(
  872. window.devicePixelRatio,
  873. 10
  874. ) || 1,
  875. forceFallback: !1,
  876. fallbackClass: "sortable-fallback",
  877. fallbackOnBody: !1,
  878. fallbackTolerance: 0,
  879. fallbackOffset: { x: 0, y: 0 },
  880. supportPointer:
  881. !1 !== Rt.supportPointer && "PointerEvent" in window && !u,
  882. emptyInsertThreshold: 5
  883. };
  884. for (var o in (O.initializePlugins(this, t, n), n)) o in e || (e[o] = n[o]);
  885. for (var i in (Nt(e), this))
  886. "_" === i.charAt(0) &&
  887. "function" == typeof this[i] &&
  888. (this[i] = this[i].bind(this));
  889. (this.nativeDraggable = !e.forceFallback && xt),
  890. this.nativeDraggable && (this.options.touchStartThreshold = 1),
  891. e.supportPointer
  892. ? d(t, "pointerdown", this._onTapStart)
  893. : (d(t, "mousedown", this._onTapStart),
  894. d(t, "touchstart", this._onTapStart)),
  895. this.nativeDraggable && (d(t, "dragover", this), d(t, "dragenter", this)),
  896. bt.push(this.el),
  897. e.store && e.store.get && this.sort(e.store.get(this) || []),
  898. a(this, T());
  899. }
  900. function Xt(t, e, n, o, i, r, a, l) {
  901. var s,
  902. c,
  903. u = t[j],
  904. d = u.options.onMove;
  905. return (
  906. !window.CustomEvent || w || E
  907. ? (s = document.createEvent("Event")).initEvent("move", !0, !0)
  908. : (s = new CustomEvent("move", { bubbles: !0, cancelable: !0 })),
  909. (s.to = e),
  910. (s.from = t),
  911. (s.dragged = n),
  912. (s.draggedRect = o),
  913. (s.related = i || e),
  914. (s.relatedRect = r || X(e)),
  915. (s.willInsertAfter = l),
  916. (s.originalEvent = a),
  917. t.dispatchEvent(s),
  918. d && (c = d.call(u, s, a)),
  919. c
  920. );
  921. }
  922. function Yt(t) {
  923. t.draggable = !1;
  924. }
  925. function Bt() {
  926. Dt = !1;
  927. }
  928. function Ft(t) {
  929. for (
  930. var e = t.tagName + t.className + t.src + t.href + t.textContent,
  931. n = e.length,
  932. o = 0;
  933. n--;
  934. )
  935. o += e.charCodeAt(n);
  936. return o.toString(36);
  937. }
  938. function Ht(t) {
  939. return setTimeout(t, 0);
  940. }
  941. function Lt(t) {
  942. return clearTimeout(t);
  943. }
  944. (Rt.prototype = {
  945. constructor: Rt,
  946. _isOutsideThisEl: function (t) {
  947. this.el.contains(t) || t === this.el || (ht = null);
  948. },
  949. _getDirection: function (t, e) {
  950. return "function" == typeof this.options.direction
  951. ? this.options.direction.call(this, t, e, z)
  952. : this.options.direction;
  953. },
  954. _onTapStart: function (e) {
  955. if (e.cancelable) {
  956. var n = this,
  957. o = this.el,
  958. t = this.options,
  959. i = t.preventOnFilter,
  960. r = e.type,
  961. a =
  962. (e.touches && e.touches[0]) ||
  963. (e.pointerType && "touch" === e.pointerType && e),
  964. l = (a || e).target,
  965. s =
  966. (e.target.shadowRoot &&
  967. ((e.path && e.path[0]) ||
  968. (e.composedPath && e.composedPath()[0]))) ||
  969. l,
  970. c = t.filter;
  971. if (
  972. ((function (t) {
  973. St.length = 0;
  974. var e = t.getElementsByTagName("input"),
  975. n = e.length;
  976. for (; n--; ) {
  977. var o = e[n];
  978. o.checked && St.push(o);
  979. }
  980. })(o),
  981. !z &&
  982. !(
  983. (/mousedown|pointerdown/.test(r) && 0 !== e.button) ||
  984. t.disabled
  985. ) &&
  986. !s.isContentEditable &&
  987. (this.nativeDraggable ||
  988. !u ||
  989. !l ||
  990. "SELECT" !== l.tagName.toUpperCase()) &&
  991. !(((l = P(l, t.draggable, o, !1)) && l.animated) || Z === l))
  992. ) {
  993. if (((J = F(l)), (et = F(l, t.draggable)), "function" == typeof c)) {
  994. if (c.call(this, e, l, this))
  995. return (
  996. W({
  997. sortable: n,
  998. rootEl: s,
  999. name: "filter",
  1000. targetEl: l,
  1001. toEl: o,
  1002. fromEl: o
  1003. }),
  1004. K("filter", n, { evt: e }),
  1005. void (i && e.cancelable && e.preventDefault())
  1006. );
  1007. } else if (
  1008. c &&
  1009. (c = c.split(",").some(function (t) {
  1010. if ((t = P(s, t.trim(), o, !1)))
  1011. return (
  1012. W({
  1013. sortable: n,
  1014. rootEl: t,
  1015. name: "filter",
  1016. targetEl: l,
  1017. fromEl: o,
  1018. toEl: o
  1019. }),
  1020. K("filter", n, { evt: e }),
  1021. !0
  1022. );
  1023. }))
  1024. )
  1025. return void (i && e.cancelable && e.preventDefault());
  1026. (t.handle && !P(s, t.handle, o, !1)) ||
  1027. this._prepareDragStart(e, a, l);
  1028. }
  1029. }
  1030. },
  1031. _prepareDragStart: function (t, e, n) {
  1032. var o,
  1033. i = this,
  1034. r = i.el,
  1035. a = i.options,
  1036. l = r.ownerDocument;
  1037. if (n && !z && n.parentNode === r) {
  1038. var s = X(n);
  1039. if (
  1040. ((q = r),
  1041. (G = (z = n).parentNode),
  1042. (V = z.nextSibling),
  1043. (Z = n),
  1044. (ot = a.group),
  1045. (rt = {
  1046. target: (Rt.dragged = z),
  1047. clientX: (e || t).clientX,
  1048. clientY: (e || t).clientY
  1049. }),
  1050. (ct = rt.clientX - s.left),
  1051. (ut = rt.clientY - s.top),
  1052. (this._lastX = (e || t).clientX),
  1053. (this._lastY = (e || t).clientY),
  1054. (z.style["will-change"] = "all"),
  1055. (o = function () {
  1056. K("delayEnded", i, { evt: t }),
  1057. Rt.eventCanceled
  1058. ? i._onDrop()
  1059. : (i._disableDelayedDragEvents(),
  1060. !c && i.nativeDraggable && (z.draggable = !0),
  1061. i._triggerDragStart(t, e),
  1062. W({ sortable: i, name: "choose", originalEvent: t }),
  1063. k(z, a.chosenClass, !0));
  1064. }),
  1065. a.ignore.split(",").forEach(function (t) {
  1066. g(z, t.trim(), Yt);
  1067. }),
  1068. d(l, "dragover", Pt),
  1069. d(l, "mousemove", Pt),
  1070. d(l, "touchmove", Pt),
  1071. d(l, "mouseup", i._onDrop),
  1072. d(l, "touchend", i._onDrop),
  1073. d(l, "touchcancel", i._onDrop),
  1074. c &&
  1075. this.nativeDraggable &&
  1076. ((this.options.touchStartThreshold = 4), (z.draggable = !0)),
  1077. K("delayStart", this, { evt: t }),
  1078. !a.delay ||
  1079. (a.delayOnTouchOnly && !e) ||
  1080. (this.nativeDraggable && (E || w)))
  1081. )
  1082. o();
  1083. else {
  1084. if (Rt.eventCanceled) return void this._onDrop();
  1085. d(l, "mouseup", i._disableDelayedDrag),
  1086. d(l, "touchend", i._disableDelayedDrag),
  1087. d(l, "touchcancel", i._disableDelayedDrag),
  1088. d(l, "mousemove", i._delayedDragTouchMoveHandler),
  1089. d(l, "touchmove", i._delayedDragTouchMoveHandler),
  1090. a.supportPointer &&
  1091. d(l, "pointermove", i._delayedDragTouchMoveHandler),
  1092. (i._dragStartTimer = setTimeout(o, a.delay));
  1093. }
  1094. }
  1095. },
  1096. _delayedDragTouchMoveHandler: function (t) {
  1097. var e = t.touches ? t.touches[0] : t;
  1098. Math.max(
  1099. Math.abs(e.clientX - this._lastX),
  1100. Math.abs(e.clientY - this._lastY)
  1101. ) >=
  1102. Math.floor(
  1103. this.options.touchStartThreshold /
  1104. ((this.nativeDraggable && window.devicePixelRatio) || 1)
  1105. ) && this._disableDelayedDrag();
  1106. },
  1107. _disableDelayedDrag: function () {
  1108. z && Yt(z),
  1109. clearTimeout(this._dragStartTimer),
  1110. this._disableDelayedDragEvents();
  1111. },
  1112. _disableDelayedDragEvents: function () {
  1113. var t = this.el.ownerDocument;
  1114. s(t, "mouseup", this._disableDelayedDrag),
  1115. s(t, "touchend", this._disableDelayedDrag),
  1116. s(t, "touchcancel", this._disableDelayedDrag),
  1117. s(t, "mousemove", this._delayedDragTouchMoveHandler),
  1118. s(t, "touchmove", this._delayedDragTouchMoveHandler),
  1119. s(t, "pointermove", this._delayedDragTouchMoveHandler);
  1120. },
  1121. _triggerDragStart: function (t, e) {
  1122. (e = e || ("touch" == t.pointerType && t)),
  1123. !this.nativeDraggable || e
  1124. ? this.options.supportPointer
  1125. ? d(document, "pointermove", this._onTouchMove)
  1126. : d(document, e ? "touchmove" : "mousemove", this._onTouchMove)
  1127. : (d(z, "dragend", this), d(q, "dragstart", this._onDragStart));
  1128. try {
  1129. document.selection
  1130. ? Ht(function () {
  1131. document.selection.empty();
  1132. })
  1133. : window.getSelection().removeAllRanges();
  1134. } catch (t) {}
  1135. },
  1136. _dragStarted: function (t, e) {
  1137. if (((vt = !1), q && z)) {
  1138. K("dragStarted", this, { evt: e }),
  1139. this.nativeDraggable && d(document, "dragover", kt);
  1140. var n = this.options;
  1141. t || k(z, n.dragClass, !1),
  1142. k(z, n.ghostClass, !0),
  1143. (Rt.active = this),
  1144. t && this._appendGhost(),
  1145. W({ sortable: this, name: "start", originalEvent: e });
  1146. } else this._nulling();
  1147. },
  1148. _emulateDragOver: function () {
  1149. if (at) {
  1150. (this._lastX = at.clientX), (this._lastY = at.clientY), At();
  1151. for (
  1152. var t = document.elementFromPoint(at.clientX, at.clientY), e = t;
  1153. t &&
  1154. t.shadowRoot &&
  1155. (t = t.shadowRoot.elementFromPoint(at.clientX, at.clientY)) !== e;
  1156. )
  1157. e = t;
  1158. if ((z.parentNode[j]._isOutsideThisEl(t), e))
  1159. do {
  1160. if (e[j]) {
  1161. if (
  1162. e[j]._onDragOver({
  1163. clientX: at.clientX,
  1164. clientY: at.clientY,
  1165. target: t,
  1166. rootEl: e
  1167. }) &&
  1168. !this.options.dragoverBubble
  1169. )
  1170. break;
  1171. }
  1172. t = e;
  1173. } while ((e = e.parentNode));
  1174. It();
  1175. }
  1176. },
  1177. _onTouchMove: function (t) {
  1178. if (rt) {
  1179. var e = this.options,
  1180. n = e.fallbackTolerance,
  1181. o = e.fallbackOffset,
  1182. i = t.touches ? t.touches[0] : t,
  1183. r = U && v(U, !0),
  1184. a = U && r && r.a,
  1185. l = U && r && r.d,
  1186. s = Ct && gt && b(gt),
  1187. c =
  1188. (i.clientX - rt.clientX + o.x) / (a || 1) +
  1189. (s ? s[0] - Et[0] : 0) / (a || 1),
  1190. u =
  1191. (i.clientY - rt.clientY + o.y) / (l || 1) +
  1192. (s ? s[1] - Et[1] : 0) / (l || 1);
  1193. if (!Rt.active && !vt) {
  1194. if (
  1195. n &&
  1196. Math.max(
  1197. Math.abs(i.clientX - this._lastX),
  1198. Math.abs(i.clientY - this._lastY)
  1199. ) < n
  1200. )
  1201. return;
  1202. this._onDragStart(t, !0);
  1203. }
  1204. if (U) {
  1205. r
  1206. ? ((r.e += c - (lt || 0)), (r.f += u - (st || 0)))
  1207. : (r = { a: 1, b: 0, c: 0, d: 1, e: c, f: u });
  1208. var d = "matrix("
  1209. .concat(r.a, ",")
  1210. .concat(r.b, ",")
  1211. .concat(r.c, ",")
  1212. .concat(r.d, ",")
  1213. .concat(r.e, ",")
  1214. .concat(r.f, ")");
  1215. R(U, "webkitTransform", d),
  1216. R(U, "mozTransform", d),
  1217. R(U, "msTransform", d),
  1218. R(U, "transform", d),
  1219. (lt = c),
  1220. (st = u),
  1221. (at = i);
  1222. }
  1223. t.cancelable && t.preventDefault();
  1224. }
  1225. },
  1226. _appendGhost: function () {
  1227. if (!U) {
  1228. var t = this.options.fallbackOnBody ? document.body : q,
  1229. e = X(z, !0, Ct, !0, t),
  1230. n = this.options;
  1231. if (Ct) {
  1232. for (
  1233. gt = t;
  1234. "static" === R(gt, "position") &&
  1235. "none" === R(gt, "transform") &&
  1236. gt !== document;
  1237. )
  1238. gt = gt.parentNode;
  1239. gt !== document.body && gt !== document.documentElement
  1240. ? (gt === document && (gt = A()),
  1241. (e.top += gt.scrollTop),
  1242. (e.left += gt.scrollLeft))
  1243. : (gt = A()),
  1244. (Et = b(gt));
  1245. }
  1246. k((U = z.cloneNode(!0)), n.ghostClass, !1),
  1247. k(U, n.fallbackClass, !0),
  1248. k(U, n.dragClass, !0),
  1249. R(U, "transition", ""),
  1250. R(U, "transform", ""),
  1251. R(U, "box-sizing", "border-box"),
  1252. R(U, "margin", 0),
  1253. R(U, "top", e.top),
  1254. R(U, "left", e.left),
  1255. R(U, "width", e.width),
  1256. R(U, "height", e.height),
  1257. R(U, "opacity", "0.8"),
  1258. R(U, "position", Ct ? "absolute" : "fixed"),
  1259. R(U, "zIndex", "100000"),
  1260. R(U, "pointerEvents", "none"),
  1261. (Rt.ghost = U),
  1262. t.appendChild(U),
  1263. R(
  1264. U,
  1265. "transform-origin",
  1266. (ct / parseInt(U.style.width)) * 100 +
  1267. "% " +
  1268. (ut / parseInt(U.style.height)) * 100 +
  1269. "%"
  1270. );
  1271. }
  1272. },
  1273. _onDragStart: function (t, e) {
  1274. var n = this,
  1275. o = t.dataTransfer,
  1276. i = n.options;
  1277. K("dragStart", this, { evt: t }),
  1278. Rt.eventCanceled
  1279. ? this._onDrop()
  1280. : (K("setupClone", this),
  1281. Rt.eventCanceled ||
  1282. (((Q = S(z)).draggable = !1),
  1283. (Q.style["will-change"] = ""),
  1284. this._hideClone(),
  1285. k(Q, this.options.chosenClass, !1),
  1286. (Rt.clone = Q)),
  1287. (n.cloneId = Ht(function () {
  1288. K("clone", n),
  1289. Rt.eventCanceled ||
  1290. (n.options.removeCloneOnHide || q.insertBefore(Q, z),
  1291. n._hideClone(),
  1292. W({ sortable: n, name: "clone" }));
  1293. })),
  1294. e || k(z, i.dragClass, !0),
  1295. e
  1296. ? ((mt = !0), (n._loopId = setInterval(n._emulateDragOver, 50)))
  1297. : (s(document, "mouseup", n._onDrop),
  1298. s(document, "touchend", n._onDrop),
  1299. s(document, "touchcancel", n._onDrop),
  1300. o &&
  1301. ((o.effectAllowed = "move"),
  1302. i.setData && i.setData.call(n, o, z)),
  1303. d(document, "drop", n),
  1304. R(z, "transform", "translateZ(0)")),
  1305. (vt = !0),
  1306. (n._dragStartId = Ht(n._dragStarted.bind(n, e, t))),
  1307. d(document, "selectstart", n),
  1308. (dt = !0),
  1309. u && R(document.body, "user-select", "none"));
  1310. },
  1311. _onDragOver: function (n) {
  1312. var o,
  1313. i,
  1314. r,
  1315. a,
  1316. l = this.el,
  1317. s = n.target,
  1318. e = this.options,
  1319. t = e.group,
  1320. c = Rt.active,
  1321. u = ot === t,
  1322. d = e.sort,
  1323. h = it || c,
  1324. f = this,
  1325. p = !1;
  1326. if (!Dt) {
  1327. if (
  1328. (void 0 !== n.preventDefault && n.cancelable && n.preventDefault(),
  1329. (s = P(s, e.draggable, l, !0)),
  1330. M("dragOver"),
  1331. Rt.eventCanceled)
  1332. )
  1333. return p;
  1334. if (
  1335. z.contains(n.target) ||
  1336. (s.animated && s.animatingX && s.animatingY) ||
  1337. f._ignoreWhileAnimating === s
  1338. )
  1339. return N(!1);
  1340. if (
  1341. ((mt = !1),
  1342. c &&
  1343. !e.disabled &&
  1344. (u
  1345. ? d || (r = !q.contains(z))
  1346. : it === this ||
  1347. ((this.lastPutMode = ot.checkPull(this, c, z, n)) &&
  1348. t.checkPut(this, c, z, n))))
  1349. ) {
  1350. if (
  1351. ((a = "vertical" === this._getDirection(n, s)),
  1352. (o = X(z)),
  1353. M("dragOverValid"),
  1354. Rt.eventCanceled)
  1355. )
  1356. return p;
  1357. if (r)
  1358. return (
  1359. (G = q),
  1360. O(),
  1361. this._hideClone(),
  1362. M("revert"),
  1363. Rt.eventCanceled || (V ? q.insertBefore(z, V) : q.appendChild(z)),
  1364. N(!0)
  1365. );
  1366. var g = B(l, e.draggable);
  1367. if (
  1368. !g ||
  1369. ((function (t, e, n) {
  1370. var o = X(B(n.el, n.options.draggable));
  1371. return e
  1372. ? t.clientX > o.right + 10 ||
  1373. (t.clientX <= o.right &&
  1374. t.clientY > o.bottom &&
  1375. t.clientX >= o.left)
  1376. : (t.clientX > o.right && t.clientY > o.top) ||
  1377. (t.clientX <= o.right && t.clientY > o.bottom + 10);
  1378. })(n, a, this) &&
  1379. !g.animated)
  1380. ) {
  1381. if (g === z) return N(!1);
  1382. if (
  1383. (g && l === n.target && (s = g),
  1384. s && (i = X(s)),
  1385. !1 !== Xt(q, l, z, o, s, i, n, !!s))
  1386. )
  1387. return O(), l.appendChild(z), (G = l), A(), N(!0);
  1388. } else if (s.parentNode === l) {
  1389. i = X(s);
  1390. var v,
  1391. m,
  1392. b,
  1393. y = z.parentNode !== l,
  1394. w = !(function (t, e, n) {
  1395. var o = n ? t.left : t.top,
  1396. i = n ? t.right : t.bottom,
  1397. r = n ? t.width : t.height,
  1398. a = n ? e.left : e.top,
  1399. l = n ? e.right : e.bottom,
  1400. s = n ? e.width : e.height;
  1401. return o === a || i === l || o + r / 2 === a + s / 2;
  1402. })(
  1403. (z.animated && z.toRect) || o,
  1404. (s.animated && s.toRect) || i,
  1405. a
  1406. ),
  1407. E = a ? "top" : "left",
  1408. D = Y(s, "top", "top") || Y(z, "top", "top"),
  1409. S = D ? D.scrollTop : void 0;
  1410. if (
  1411. (ht !== s &&
  1412. ((m = i[E]), (yt = !1), (wt = (!w && e.invertSwap) || y)),
  1413. 0 !==
  1414. (v = (function (t, e, n, o, i, r, a, l) {
  1415. var s = o ? t.clientY : t.clientX,
  1416. c = o ? n.height : n.width,
  1417. u = o ? n.top : n.left,
  1418. d = o ? n.bottom : n.right,
  1419. h = !1;
  1420. if (!a)
  1421. if (l && pt < c * i) {
  1422. if (
  1423. (!yt &&
  1424. (1 === ft
  1425. ? u + (c * r) / 2 < s
  1426. : s < d - (c * r) / 2) &&
  1427. (yt = !0),
  1428. yt)
  1429. )
  1430. h = !0;
  1431. else if (1 === ft ? s < u + pt : d - pt < s) return -ft;
  1432. } else if (
  1433. u + (c * (1 - i)) / 2 < s &&
  1434. s < d - (c * (1 - i)) / 2
  1435. )
  1436. return (function (t) {
  1437. return F(z) < F(t) ? 1 : -1;
  1438. })(e);
  1439. if (
  1440. (h = h || a) &&
  1441. (s < u + (c * r) / 2 || d - (c * r) / 2 < s)
  1442. )
  1443. return u + c / 2 < s ? 1 : -1;
  1444. return 0;
  1445. })(
  1446. n,
  1447. s,
  1448. i,
  1449. a,
  1450. w ? 1 : e.swapThreshold,
  1451. null == e.invertedSwapThreshold
  1452. ? e.swapThreshold
  1453. : e.invertedSwapThreshold,
  1454. wt,
  1455. ht === s
  1456. )))
  1457. )
  1458. for (
  1459. var _ = F(z);
  1460. (_ -= v),
  1461. (b = G.children[_]) &&
  1462. ("none" === R(b, "display") || b === U);
  1463. );
  1464. if (0 === v || b === s) return N(!1);
  1465. ft = v;
  1466. var C = (ht = s).nextElementSibling,
  1467. T = !1,
  1468. x = Xt(q, l, z, o, s, i, n, (T = 1 === v));
  1469. if (!1 !== x)
  1470. return (
  1471. (1 !== x && -1 !== x) || (T = 1 === x),
  1472. (Dt = !0),
  1473. setTimeout(Bt, 30),
  1474. O(),
  1475. T && !C
  1476. ? l.appendChild(z)
  1477. : s.parentNode.insertBefore(z, T ? C : s),
  1478. D && L(D, 0, S - D.scrollTop),
  1479. (G = z.parentNode),
  1480. void 0 === m || wt || (pt = Math.abs(m - X(s)[E])),
  1481. A(),
  1482. N(!0)
  1483. );
  1484. }
  1485. if (l.contains(z)) return N(!1);
  1486. }
  1487. return !1;
  1488. }
  1489. function M(t, e) {
  1490. K(
  1491. t,
  1492. f,
  1493. I(
  1494. {
  1495. evt: n,
  1496. isOwner: u,
  1497. axis: a ? "vertical" : "horizontal",
  1498. revert: r,
  1499. dragRect: o,
  1500. targetRect: i,
  1501. canSort: d,
  1502. fromSortable: h,
  1503. target: s,
  1504. completed: N,
  1505. onMove: function (t, e) {
  1506. return Xt(q, l, z, o, t, X(t), n, e);
  1507. },
  1508. changed: A
  1509. },
  1510. e
  1511. )
  1512. );
  1513. }
  1514. function O() {
  1515. M("dragOverAnimationCapture"),
  1516. f.captureAnimationState(),
  1517. f !== h && h.captureAnimationState();
  1518. }
  1519. function N(t) {
  1520. return (
  1521. M("dragOverCompleted", { insertion: t }),
  1522. t &&
  1523. (u ? c._hideClone() : c._showClone(f),
  1524. f !== h &&
  1525. (k(z, it ? it.options.ghostClass : c.options.ghostClass, !1),
  1526. k(z, e.ghostClass, !0)),
  1527. it !== f && f !== Rt.active
  1528. ? (it = f)
  1529. : f === Rt.active && it && (it = null),
  1530. h === f && (f._ignoreWhileAnimating = s),
  1531. f.animateAll(function () {
  1532. M("dragOverAnimationComplete"), (f._ignoreWhileAnimating = null);
  1533. }),
  1534. f !== h && (h.animateAll(), (h._ignoreWhileAnimating = null))),
  1535. ((s === z && !z.animated) || (s === l && !s.animated)) && (ht = null),
  1536. e.dragoverBubble ||
  1537. n.rootEl ||
  1538. s === document ||
  1539. (z.parentNode[j]._isOutsideThisEl(n.target), t || Pt(n)),
  1540. !e.dragoverBubble && n.stopPropagation && n.stopPropagation(),
  1541. (p = !0)
  1542. );
  1543. }
  1544. function A() {
  1545. (tt = F(z)),
  1546. (nt = F(z, e.draggable)),
  1547. W({
  1548. sortable: f,
  1549. name: "change",
  1550. toEl: l,
  1551. newIndex: tt,
  1552. newDraggableIndex: nt,
  1553. originalEvent: n
  1554. });
  1555. }
  1556. },
  1557. _ignoreWhileAnimating: null,
  1558. _offMoveEvents: function () {
  1559. s(document, "mousemove", this._onTouchMove),
  1560. s(document, "touchmove", this._onTouchMove),
  1561. s(document, "pointermove", this._onTouchMove),
  1562. s(document, "dragover", Pt),
  1563. s(document, "mousemove", Pt),
  1564. s(document, "touchmove", Pt);
  1565. },
  1566. _offUpEvents: function () {
  1567. var t = this.el.ownerDocument;
  1568. s(t, "mouseup", this._onDrop),
  1569. s(t, "touchend", this._onDrop),
  1570. s(t, "pointerup", this._onDrop),
  1571. s(t, "touchcancel", this._onDrop),
  1572. s(document, "selectstart", this);
  1573. },
  1574. _onDrop: function (t) {
  1575. var e = this.el,
  1576. n = this.options;
  1577. (tt = F(z)),
  1578. (nt = F(z, n.draggable)),
  1579. K("drop", this, { evt: t }),
  1580. (G = z && z.parentNode),
  1581. (tt = F(z)),
  1582. (nt = F(z, n.draggable)),
  1583. Rt.eventCanceled ||
  1584. ((yt = wt = vt = !1),
  1585. clearInterval(this._loopId),
  1586. clearTimeout(this._dragStartTimer),
  1587. Lt(this.cloneId),
  1588. Lt(this._dragStartId),
  1589. this.nativeDraggable &&
  1590. (s(document, "drop", this), s(e, "dragstart", this._onDragStart)),
  1591. this._offMoveEvents(),
  1592. this._offUpEvents(),
  1593. u && R(document.body, "user-select", ""),
  1594. R(z, "transform", ""),
  1595. t &&
  1596. (dt &&
  1597. (t.cancelable && t.preventDefault(),
  1598. n.dropBubble || t.stopPropagation()),
  1599. U && U.parentNode && U.parentNode.removeChild(U),
  1600. (q === G || (it && "clone" !== it.lastPutMode)) &&
  1601. Q &&
  1602. Q.parentNode &&
  1603. Q.parentNode.removeChild(Q),
  1604. z &&
  1605. (this.nativeDraggable && s(z, "dragend", this),
  1606. Yt(z),
  1607. (z.style["will-change"] = ""),
  1608. dt &&
  1609. !vt &&
  1610. k(z, it ? it.options.ghostClass : this.options.ghostClass, !1),
  1611. k(z, this.options.chosenClass, !1),
  1612. W({
  1613. sortable: this,
  1614. name: "unchoose",
  1615. toEl: G,
  1616. newIndex: null,
  1617. newDraggableIndex: null,
  1618. originalEvent: t
  1619. }),
  1620. q !== G
  1621. ? (0 <= tt &&
  1622. (W({
  1623. rootEl: G,
  1624. name: "add",
  1625. toEl: G,
  1626. fromEl: q,
  1627. originalEvent: t
  1628. }),
  1629. W({
  1630. sortable: this,
  1631. name: "remove",
  1632. toEl: G,
  1633. originalEvent: t
  1634. }),
  1635. W({
  1636. rootEl: G,
  1637. name: "sort",
  1638. toEl: G,
  1639. fromEl: q,
  1640. originalEvent: t
  1641. }),
  1642. W({
  1643. sortable: this,
  1644. name: "sort",
  1645. toEl: G,
  1646. originalEvent: t
  1647. })),
  1648. it && it.save())
  1649. : tt !== J &&
  1650. 0 <= tt &&
  1651. (W({
  1652. sortable: this,
  1653. name: "update",
  1654. toEl: G,
  1655. originalEvent: t
  1656. }),
  1657. W({
  1658. sortable: this,
  1659. name: "sort",
  1660. toEl: G,
  1661. originalEvent: t
  1662. })),
  1663. Rt.active &&
  1664. ((null != tt && -1 !== tt) || ((tt = J), (nt = et)),
  1665. W({ sortable: this, name: "end", toEl: G, originalEvent: t }),
  1666. this.save())))),
  1667. this._nulling();
  1668. },
  1669. _nulling: function () {
  1670. K("nulling", this),
  1671. (q =
  1672. z =
  1673. G =
  1674. U =
  1675. V =
  1676. Q =
  1677. Z =
  1678. $ =
  1679. rt =
  1680. at =
  1681. dt =
  1682. tt =
  1683. nt =
  1684. J =
  1685. et =
  1686. ht =
  1687. ft =
  1688. it =
  1689. ot =
  1690. Rt.dragged =
  1691. Rt.ghost =
  1692. Rt.clone =
  1693. Rt.active =
  1694. null),
  1695. St.forEach(function (t) {
  1696. t.checked = !0;
  1697. }),
  1698. (St.length = lt = st = 0);
  1699. },
  1700. handleEvent: function (t) {
  1701. switch (t.type) {
  1702. case "drop":
  1703. case "dragend":
  1704. this._onDrop(t);
  1705. break;
  1706. case "dragenter":
  1707. case "dragover":
  1708. z &&
  1709. (this._onDragOver(t),
  1710. (function (t) {
  1711. t.dataTransfer && (t.dataTransfer.dropEffect = "move");
  1712. t.cancelable && t.preventDefault();
  1713. })(t));
  1714. break;
  1715. case "selectstart":
  1716. t.preventDefault();
  1717. }
  1718. },
  1719. toArray: function () {
  1720. for (
  1721. var t,
  1722. e = [],
  1723. n = this.el.children,
  1724. o = 0,
  1725. i = n.length,
  1726. r = this.options;
  1727. o < i;
  1728. o++
  1729. )
  1730. P((t = n[o]), r.draggable, this.el, !1) &&
  1731. e.push(t.getAttribute(r.dataIdAttr) || Ft(t));
  1732. return e;
  1733. },
  1734. sort: function (t, e) {
  1735. var o = {},
  1736. i = this.el;
  1737. this.toArray().forEach(function (t, e) {
  1738. var n = i.children[e];
  1739. P(n, this.options.draggable, i, !1) && (o[t] = n);
  1740. }, this),
  1741. e && this.captureAnimationState(),
  1742. t.forEach(function (t) {
  1743. o[t] && (i.removeChild(o[t]), i.appendChild(o[t]));
  1744. }),
  1745. e && this.animateAll();
  1746. },
  1747. save: function () {
  1748. var t = this.options.store;
  1749. t && t.set && t.set(this);
  1750. },
  1751. closest: function (t, e) {
  1752. return P(t, e || this.options.draggable, this.el, !1);
  1753. },
  1754. option: function (t, e) {
  1755. var n = this.options;
  1756. if (void 0 === e) return n[t];
  1757. var o = O.modifyOption(this, t, e);
  1758. (n[t] = void 0 !== o ? o : e), "group" === t && Nt(n);
  1759. },
  1760. destroy: function () {
  1761. K("destroy", this);
  1762. var t = this.el;
  1763. (t[j] = null),
  1764. s(t, "mousedown", this._onTapStart),
  1765. s(t, "touchstart", this._onTapStart),
  1766. s(t, "pointerdown", this._onTapStart),
  1767. this.nativeDraggable &&
  1768. (s(t, "dragover", this), s(t, "dragenter", this)),
  1769. Array.prototype.forEach.call(
  1770. t.querySelectorAll("[draggable]"),
  1771. function (t) {
  1772. t.removeAttribute("draggable");
  1773. }
  1774. ),
  1775. this._onDrop(),
  1776. this._disableDelayedDragEvents(),
  1777. bt.splice(bt.indexOf(this.el), 1),
  1778. (this.el = t = null);
  1779. },
  1780. _hideClone: function () {
  1781. if (!$) {
  1782. if ((K("hideClone", this), Rt.eventCanceled)) return;
  1783. R(Q, "display", "none"),
  1784. this.options.removeCloneOnHide &&
  1785. Q.parentNode &&
  1786. Q.parentNode.removeChild(Q),
  1787. ($ = !0);
  1788. }
  1789. },
  1790. _showClone: function (t) {
  1791. if ("clone" === t.lastPutMode) {
  1792. if ($) {
  1793. if ((K("showClone", this), Rt.eventCanceled)) return;
  1794. z.parentNode != q || this.options.group.revertClone
  1795. ? V
  1796. ? q.insertBefore(Q, V)
  1797. : q.appendChild(Q)
  1798. : q.insertBefore(Q, z),
  1799. this.options.group.revertClone && this.animate(z, Q),
  1800. R(Q, "display", ""),
  1801. ($ = !1);
  1802. }
  1803. } else this._hideClone();
  1804. }
  1805. }),
  1806. _t &&
  1807. d(document, "touchmove", function (t) {
  1808. (Rt.active || vt) && t.cancelable && t.preventDefault();
  1809. }),
  1810. (Rt.utils = {
  1811. on: d,
  1812. off: s,
  1813. css: R,
  1814. find: g,
  1815. is: function (t, e) {
  1816. return !!P(t, e, t, !1);
  1817. },
  1818. extend: function (t, e) {
  1819. if (t && e) for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
  1820. return t;
  1821. },
  1822. throttle: D,
  1823. closest: P,
  1824. toggleClass: k,
  1825. clone: S,
  1826. index: F,
  1827. nextTick: Ht,
  1828. cancelNextTick: Lt,
  1829. detectDirection: Ot,
  1830. getChild: m
  1831. }),
  1832. (Rt.get = function (t) {
  1833. return t[j];
  1834. }),
  1835. (Rt.mount = function () {
  1836. for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
  1837. e[n] = arguments[n];
  1838. e[0].constructor === Array && (e = e[0]),
  1839. e.forEach(function (t) {
  1840. if (!t.prototype || !t.prototype.constructor)
  1841. throw "Sortable: Mounted plugin must be a constructor function, not ".concat(
  1842. {}.toString.call(t)
  1843. );
  1844. t.utils && (Rt.utils = I({}, Rt.utils, t.utils)), O.mount(t);
  1845. });
  1846. }),
  1847. (Rt.create = function (t, e) {
  1848. return new Rt(t, e);
  1849. });
  1850. var jt,
  1851. Kt,
  1852. Wt,
  1853. zt,
  1854. Gt,
  1855. Ut,
  1856. qt = [],
  1857. Vt = !(Rt.version = "1.13.0");
  1858. function Zt() {
  1859. qt.forEach(function (t) {
  1860. clearInterval(t.pid);
  1861. }),
  1862. (qt = []);
  1863. }
  1864. function Qt() {
  1865. clearInterval(Ut);
  1866. }
  1867. function $t(t) {
  1868. var e = t.originalEvent,
  1869. n = t.putSortable,
  1870. o = t.dragEl,
  1871. i = t.activeSortable,
  1872. r = t.dispatchSortableEvent,
  1873. a = t.hideGhostForTarget,
  1874. l = t.unhideGhostForTarget;
  1875. if (e) {
  1876. var s = n || i;
  1877. a();
  1878. var c =
  1879. e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e,
  1880. u = document.elementFromPoint(c.clientX, c.clientY);
  1881. l(),
  1882. s &&
  1883. !s.el.contains(u) &&
  1884. (r("spill"), this.onSpill({ dragEl: o, putSortable: n }));
  1885. }
  1886. }
  1887. var Jt,
  1888. te = D(function (n, t, e, o) {
  1889. if (t.scroll) {
  1890. var i,
  1891. r = (n.touches ? n.touches[0] : n).clientX,
  1892. a = (n.touches ? n.touches[0] : n).clientY,
  1893. l = t.scrollSensitivity,
  1894. s = t.scrollSpeed,
  1895. c = A(),
  1896. u = !1;
  1897. Kt !== e &&
  1898. ((Kt = e),
  1899. Zt(),
  1900. (jt = t.scroll),
  1901. (i = t.scrollFn),
  1902. !0 === jt && (jt = H(e, !0)));
  1903. var d = 0,
  1904. h = jt;
  1905. do {
  1906. var f = h,
  1907. p = X(f),
  1908. g = p.top,
  1909. v = p.bottom,
  1910. m = p.left,
  1911. b = p.right,
  1912. y = p.width,
  1913. w = p.height,
  1914. E = void 0,
  1915. D = void 0,
  1916. S = f.scrollWidth,
  1917. _ = f.scrollHeight,
  1918. C = R(f),
  1919. T = f.scrollLeft,
  1920. x = f.scrollTop;
  1921. D =
  1922. f === c
  1923. ? ((E =
  1924. y < S &&
  1925. ("auto" === C.overflowX ||
  1926. "scroll" === C.overflowX ||
  1927. "visible" === C.overflowX)),
  1928. w < _ &&
  1929. ("auto" === C.overflowY ||
  1930. "scroll" === C.overflowY ||
  1931. "visible" === C.overflowY))
  1932. : ((E =
  1933. y < S &&
  1934. ("auto" === C.overflowX || "scroll" === C.overflowX)),
  1935. w < _ && ("auto" === C.overflowY || "scroll" === C.overflowY));
  1936. var M =
  1937. E &&
  1938. (Math.abs(b - r) <= l && T + y < S) -
  1939. (Math.abs(m - r) <= l && !!T),
  1940. O =
  1941. D &&
  1942. (Math.abs(v - a) <= l && x + w < _) -
  1943. (Math.abs(g - a) <= l && !!x);
  1944. if (!qt[d]) for (var N = 0; N <= d; N++) qt[N] || (qt[N] = {});
  1945. (qt[d].vx == M && qt[d].vy == O && qt[d].el === f) ||
  1946. ((qt[d].el = f),
  1947. (qt[d].vx = M),
  1948. (qt[d].vy = O),
  1949. clearInterval(qt[d].pid),
  1950. (0 == M && 0 == O) ||
  1951. ((u = !0),
  1952. (qt[d].pid = setInterval(
  1953. function () {
  1954. o && 0 === this.layer && Rt.active._onTouchMove(Gt);
  1955. var t = qt[this.layer].vy ? qt[this.layer].vy * s : 0,
  1956. e = qt[this.layer].vx ? qt[this.layer].vx * s : 0;
  1957. ("function" == typeof i &&
  1958. "continue" !==
  1959. i.call(
  1960. Rt.dragged.parentNode[j],
  1961. e,
  1962. t,
  1963. n,
  1964. Gt,
  1965. qt[this.layer].el
  1966. )) ||
  1967. L(qt[this.layer].el, e, t);
  1968. }.bind({ layer: d }),
  1969. 24
  1970. )))),
  1971. d++;
  1972. } while (t.bubbleScroll && h !== c && (h = H(h, !1)));
  1973. Vt = u;
  1974. }
  1975. }, 30);
  1976. function ee() {}
  1977. function ne() {}
  1978. (ee.prototype = {
  1979. startIndex: null,
  1980. dragStart: function (t) {
  1981. var e = t.oldDraggableIndex;
  1982. this.startIndex = e;
  1983. },
  1984. onSpill: function (t) {
  1985. var e = t.dragEl,
  1986. n = t.putSortable;
  1987. this.sortable.captureAnimationState(), n && n.captureAnimationState();
  1988. var o = m(this.sortable.el, this.startIndex, this.options);
  1989. o ? this.sortable.el.insertBefore(e, o) : this.sortable.el.appendChild(e),
  1990. this.sortable.animateAll(),
  1991. n && n.animateAll();
  1992. },
  1993. drop: $t
  1994. }),
  1995. a(ee, { pluginName: "revertOnSpill" }),
  1996. (ne.prototype = {
  1997. onSpill: function (t) {
  1998. var e = t.dragEl,
  1999. n = t.putSortable || this.sortable;
  2000. n.captureAnimationState(),
  2001. e.parentNode && e.parentNode.removeChild(e),
  2002. n.animateAll();
  2003. },
  2004. drop: $t
  2005. }),
  2006. a(ne, { pluginName: "removeOnSpill" });
  2007. var oe,
  2008. ie,
  2009. re,
  2010. ae,
  2011. le,
  2012. se = [],
  2013. ce = [],
  2014. ue = !1,
  2015. de = !1,
  2016. he = !1;
  2017. function fe(o, i) {
  2018. ce.forEach(function (t, e) {
  2019. var n = i.children[t.sortableIndex + (o ? Number(e) : 0)];
  2020. n ? i.insertBefore(t, n) : i.appendChild(t);
  2021. });
  2022. }
  2023. function pe() {
  2024. se.forEach(function (t) {
  2025. t !== re && t.parentNode && t.parentNode.removeChild(t);
  2026. });
  2027. }
  2028. return (
  2029. Rt.mount(
  2030. new (function () {
  2031. function t() {
  2032. for (var t in ((this.defaults = {
  2033. scroll: !0,
  2034. scrollSensitivity: 30,
  2035. scrollSpeed: 10,
  2036. bubbleScroll: !0
  2037. }),
  2038. this))
  2039. "_" === t.charAt(0) &&
  2040. "function" == typeof this[t] &&
  2041. (this[t] = this[t].bind(this));
  2042. }
  2043. return (
  2044. (t.prototype = {
  2045. dragStarted: function (t) {
  2046. var e = t.originalEvent;
  2047. this.sortable.nativeDraggable
  2048. ? d(document, "dragover", this._handleAutoScroll)
  2049. : this.options.supportPointer
  2050. ? d(document, "pointermove", this._handleFallbackAutoScroll)
  2051. : e.touches
  2052. ? d(document, "touchmove", this._handleFallbackAutoScroll)
  2053. : d(document, "mousemove", this._handleFallbackAutoScroll);
  2054. },
  2055. dragOverCompleted: function (t) {
  2056. var e = t.originalEvent;
  2057. this.options.dragOverBubble ||
  2058. e.rootEl ||
  2059. this._handleAutoScroll(e);
  2060. },
  2061. drop: function () {
  2062. this.sortable.nativeDraggable
  2063. ? s(document, "dragover", this._handleAutoScroll)
  2064. : (s(document, "pointermove", this._handleFallbackAutoScroll),
  2065. s(document, "touchmove", this._handleFallbackAutoScroll),
  2066. s(document, "mousemove", this._handleFallbackAutoScroll)),
  2067. Qt(),
  2068. Zt(),
  2069. clearTimeout(f),
  2070. (f = void 0);
  2071. },
  2072. nulling: function () {
  2073. (Gt = Kt = jt = Vt = Ut = Wt = zt = null), (qt.length = 0);
  2074. },
  2075. _handleFallbackAutoScroll: function (t) {
  2076. this._handleAutoScroll(t, !0);
  2077. },
  2078. _handleAutoScroll: function (e, n) {
  2079. var o = this,
  2080. i = (e.touches ? e.touches[0] : e).clientX,
  2081. r = (e.touches ? e.touches[0] : e).clientY,
  2082. t = document.elementFromPoint(i, r);
  2083. if (((Gt = e), n || E || w || u)) {
  2084. te(e, this.options, t, n);
  2085. var a = H(t, !0);
  2086. !Vt ||
  2087. (Ut && i === Wt && r === zt) ||
  2088. (Ut && Qt(),
  2089. (Ut = setInterval(function () {
  2090. var t = H(document.elementFromPoint(i, r), !0);
  2091. t !== a && ((a = t), Zt()), te(e, o.options, t, n);
  2092. }, 10)),
  2093. (Wt = i),
  2094. (zt = r));
  2095. } else {
  2096. if (!this.options.bubbleScroll || H(t, !0) === A())
  2097. return void Zt();
  2098. te(e, this.options, H(t, !1), !1);
  2099. }
  2100. }
  2101. }),
  2102. a(t, { pluginName: "scroll", initializeByDefault: !0 })
  2103. );
  2104. })()
  2105. ),
  2106. Rt.mount(ne, ee),
  2107. Rt.mount(
  2108. new (function () {
  2109. function t() {
  2110. this.defaults = { swapClass: "sortable-swap-highlight" };
  2111. }
  2112. return (
  2113. (t.prototype = {
  2114. dragStart: function (t) {
  2115. var e = t.dragEl;
  2116. Jt = e;
  2117. },
  2118. dragOverValid: function (t) {
  2119. var e = t.completed,
  2120. n = t.target,
  2121. o = t.onMove,
  2122. i = t.activeSortable,
  2123. r = t.changed,
  2124. a = t.cancel;
  2125. if (i.options.swap) {
  2126. var l = this.sortable.el,
  2127. s = this.options;
  2128. if (n && n !== l) {
  2129. var c = Jt;
  2130. (Jt = !1 !== o(n) ? (k(n, s.swapClass, !0), n) : null),
  2131. c && c !== Jt && k(c, s.swapClass, !1);
  2132. }
  2133. r(), e(!0), a();
  2134. }
  2135. },
  2136. drop: function (t) {
  2137. var e = t.activeSortable,
  2138. n = t.putSortable,
  2139. o = t.dragEl,
  2140. i = n || this.sortable,
  2141. r = this.options;
  2142. Jt && k(Jt, r.swapClass, !1),
  2143. Jt &&
  2144. (r.swap || (n && n.options.swap)) &&
  2145. o !== Jt &&
  2146. (i.captureAnimationState(),
  2147. i !== e && e.captureAnimationState(),
  2148. (function (t, e) {
  2149. var n,
  2150. o,
  2151. i = t.parentNode,
  2152. r = e.parentNode;
  2153. if (!i || !r || i.isEqualNode(e) || r.isEqualNode(t))
  2154. return;
  2155. (n = F(t)), (o = F(e)), i.isEqualNode(r) && n < o && o++;
  2156. i.insertBefore(e, i.children[n]),
  2157. r.insertBefore(t, r.children[o]);
  2158. })(o, Jt),
  2159. i.animateAll(),
  2160. i !== e && e.animateAll());
  2161. },
  2162. nulling: function () {
  2163. Jt = null;
  2164. }
  2165. }),
  2166. a(t, {
  2167. pluginName: "swap",
  2168. eventProperties: function () {
  2169. return { swapItem: Jt };
  2170. }
  2171. })
  2172. );
  2173. })()
  2174. ),
  2175. Rt.mount(
  2176. new (function () {
  2177. function t(o) {
  2178. for (var t in this)
  2179. "_" === t.charAt(0) &&
  2180. "function" == typeof this[t] &&
  2181. (this[t] = this[t].bind(this));
  2182. o.options.supportPointer
  2183. ? d(document, "pointerup", this._deselectMultiDrag)
  2184. : (d(document, "mouseup", this._deselectMultiDrag),
  2185. d(document, "touchend", this._deselectMultiDrag)),
  2186. d(document, "keydown", this._checkKeyDown),
  2187. d(document, "keyup", this._checkKeyUp),
  2188. (this.defaults = {
  2189. selectedClass: "sortable-selected",
  2190. multiDragKey: null,
  2191. setData: function (t, e) {
  2192. var n = "";
  2193. se.length && ie === o
  2194. ? se.forEach(function (t, e) {
  2195. n += (e ? ", " : "") + t.textContent;
  2196. })
  2197. : (n = e.textContent),
  2198. t.setData("Text", n);
  2199. }
  2200. });
  2201. }
  2202. return (
  2203. (t.prototype = {
  2204. multiDragKeyDown: !1,
  2205. isMultiDrag: !1,
  2206. delayStartGlobal: function (t) {
  2207. var e = t.dragEl;
  2208. re = e;
  2209. },
  2210. delayEnded: function () {
  2211. this.isMultiDrag = ~se.indexOf(re);
  2212. },
  2213. setupClone: function (t) {
  2214. var e = t.sortable,
  2215. n = t.cancel;
  2216. if (this.isMultiDrag) {
  2217. for (var o = 0; o < se.length; o++)
  2218. ce.push(S(se[o])),
  2219. (ce[o].sortableIndex = se[o].sortableIndex),
  2220. (ce[o].draggable = !1),
  2221. (ce[o].style["will-change"] = ""),
  2222. k(ce[o], this.options.selectedClass, !1),
  2223. se[o] === re && k(ce[o], this.options.chosenClass, !1);
  2224. e._hideClone(), n();
  2225. }
  2226. },
  2227. clone: function (t) {
  2228. var e = t.sortable,
  2229. n = t.rootEl,
  2230. o = t.dispatchSortableEvent,
  2231. i = t.cancel;
  2232. this.isMultiDrag &&
  2233. (this.options.removeCloneOnHide ||
  2234. (se.length && ie === e && (fe(!0, n), o("clone"), i())));
  2235. },
  2236. showClone: function (t) {
  2237. var e = t.cloneNowShown,
  2238. n = t.rootEl,
  2239. o = t.cancel;
  2240. this.isMultiDrag &&
  2241. (fe(!1, n),
  2242. ce.forEach(function (t) {
  2243. R(t, "display", "");
  2244. }),
  2245. e(),
  2246. (le = !1),
  2247. o());
  2248. },
  2249. hideClone: function (t) {
  2250. var e = this,
  2251. n = (t.sortable, t.cloneNowHidden),
  2252. o = t.cancel;
  2253. this.isMultiDrag &&
  2254. (ce.forEach(function (t) {
  2255. R(t, "display", "none"),
  2256. e.options.removeCloneOnHide &&
  2257. t.parentNode &&
  2258. t.parentNode.removeChild(t);
  2259. }),
  2260. n(),
  2261. (le = !0),
  2262. o());
  2263. },
  2264. dragStartGlobal: function (t) {
  2265. t.sortable;
  2266. !this.isMultiDrag && ie && ie.multiDrag._deselectMultiDrag(),
  2267. se.forEach(function (t) {
  2268. t.sortableIndex = F(t);
  2269. }),
  2270. (se = se.sort(function (t, e) {
  2271. return t.sortableIndex - e.sortableIndex;
  2272. })),
  2273. (he = !0);
  2274. },
  2275. dragStarted: function (t) {
  2276. var e = this,
  2277. n = t.sortable;
  2278. if (this.isMultiDrag) {
  2279. if (
  2280. this.options.sort &&
  2281. (n.captureAnimationState(), this.options.animation)
  2282. ) {
  2283. se.forEach(function (t) {
  2284. t !== re && R(t, "position", "absolute");
  2285. });
  2286. var o = X(re, !1, !0, !0);
  2287. se.forEach(function (t) {
  2288. t !== re && _(t, o);
  2289. }),
  2290. (ue = de = !0);
  2291. }
  2292. n.animateAll(function () {
  2293. (ue = de = !1),
  2294. e.options.animation &&
  2295. se.forEach(function (t) {
  2296. C(t);
  2297. }),
  2298. e.options.sort && pe();
  2299. });
  2300. }
  2301. },
  2302. dragOver: function (t) {
  2303. var e = t.target,
  2304. n = t.completed,
  2305. o = t.cancel;
  2306. de && ~se.indexOf(e) && (n(!1), o());
  2307. },
  2308. revert: function (t) {
  2309. var e = t.fromSortable,
  2310. n = t.rootEl,
  2311. o = t.sortable,
  2312. i = t.dragRect;
  2313. 1 < se.length &&
  2314. (se.forEach(function (t) {
  2315. o.addAnimationState({ target: t, rect: de ? X(t) : i }),
  2316. C(t),
  2317. (t.fromRect = i),
  2318. e.removeAnimationState(t);
  2319. }),
  2320. (de = !1),
  2321. (function (o, i) {
  2322. se.forEach(function (t, e) {
  2323. var n = i.children[t.sortableIndex + (o ? Number(e) : 0)];
  2324. n ? i.insertBefore(t, n) : i.appendChild(t);
  2325. });
  2326. })(!this.options.removeCloneOnHide, n));
  2327. },
  2328. dragOverCompleted: function (t) {
  2329. var e = t.sortable,
  2330. n = t.isOwner,
  2331. o = t.insertion,
  2332. i = t.activeSortable,
  2333. r = t.parentEl,
  2334. a = t.putSortable,
  2335. l = this.options;
  2336. if (o) {
  2337. if (
  2338. (n && i._hideClone(),
  2339. (ue = !1),
  2340. l.animation &&
  2341. 1 < se.length &&
  2342. (de || (!n && !i.options.sort && !a)))
  2343. ) {
  2344. var s = X(re, !1, !0, !0);
  2345. se.forEach(function (t) {
  2346. t !== re && (_(t, s), r.appendChild(t));
  2347. }),
  2348. (de = !0);
  2349. }
  2350. if (!n)
  2351. if ((de || pe(), 1 < se.length)) {
  2352. var c = le;
  2353. i._showClone(e),
  2354. i.options.animation &&
  2355. !le &&
  2356. c &&
  2357. ce.forEach(function (t) {
  2358. i.addAnimationState({ target: t, rect: ae }),
  2359. (t.fromRect = ae),
  2360. (t.thisAnimationDuration = null);
  2361. });
  2362. } else i._showClone(e);
  2363. }
  2364. },
  2365. dragOverAnimationCapture: function (t) {
  2366. var e = t.dragRect,
  2367. n = t.isOwner,
  2368. o = t.activeSortable;
  2369. if (
  2370. (se.forEach(function (t) {
  2371. t.thisAnimationDuration = null;
  2372. }),
  2373. o.options.animation && !n && o.multiDrag.isMultiDrag)
  2374. ) {
  2375. ae = a({}, e);
  2376. var i = v(re, !0);
  2377. (ae.top -= i.f), (ae.left -= i.e);
  2378. }
  2379. },
  2380. dragOverAnimationComplete: function () {
  2381. de && ((de = !1), pe());
  2382. },
  2383. drop: function (t) {
  2384. var e = t.originalEvent,
  2385. n = t.rootEl,
  2386. o = t.parentEl,
  2387. i = t.sortable,
  2388. r = t.dispatchSortableEvent,
  2389. a = t.oldIndex,
  2390. l = t.putSortable,
  2391. s = l || this.sortable;
  2392. if (e) {
  2393. var c = this.options,
  2394. u = o.children;
  2395. if (!he)
  2396. if (
  2397. (c.multiDragKey &&
  2398. !this.multiDragKeyDown &&
  2399. this._deselectMultiDrag(),
  2400. k(re, c.selectedClass, !~se.indexOf(re)),
  2401. ~se.indexOf(re))
  2402. )
  2403. se.splice(se.indexOf(re), 1),
  2404. (oe = null),
  2405. N({
  2406. sortable: i,
  2407. rootEl: n,
  2408. name: "deselect",
  2409. targetEl: re,
  2410. originalEvt: e
  2411. });
  2412. else {
  2413. if (
  2414. (se.push(re),
  2415. N({
  2416. sortable: i,
  2417. rootEl: n,
  2418. name: "select",
  2419. targetEl: re,
  2420. originalEvt: e
  2421. }),
  2422. e.shiftKey && oe && i.el.contains(oe))
  2423. ) {
  2424. var d,
  2425. h,
  2426. f = F(oe),
  2427. p = F(re);
  2428. if (~f && ~p && f !== p)
  2429. for (
  2430. d = f < p ? ((h = f), p) : ((h = p), f + 1);
  2431. h < d;
  2432. h++
  2433. )
  2434. ~se.indexOf(u[h]) ||
  2435. (k(u[h], c.selectedClass, !0),
  2436. se.push(u[h]),
  2437. N({
  2438. sortable: i,
  2439. rootEl: n,
  2440. name: "select",
  2441. targetEl: u[h],
  2442. originalEvt: e
  2443. }));
  2444. } else oe = re;
  2445. ie = s;
  2446. }
  2447. if (he && this.isMultiDrag) {
  2448. if ((o[j].options.sort || o !== n) && 1 < se.length) {
  2449. var g = X(re),
  2450. v = F(re, ":not(." + this.options.selectedClass + ")");
  2451. if (
  2452. (!ue && c.animation && (re.thisAnimationDuration = null),
  2453. s.captureAnimationState(),
  2454. !ue &&
  2455. (c.animation &&
  2456. ((re.fromRect = g),
  2457. se.forEach(function (t) {
  2458. if (((t.thisAnimationDuration = null), t !== re)) {
  2459. var e = de ? X(t) : g;
  2460. (t.fromRect = e),
  2461. s.addAnimationState({ target: t, rect: e });
  2462. }
  2463. })),
  2464. pe(),
  2465. se.forEach(function (t) {
  2466. u[v] ? o.insertBefore(t, u[v]) : o.appendChild(t),
  2467. v++;
  2468. }),
  2469. a === F(re)))
  2470. ) {
  2471. var m = !1;
  2472. se.forEach(function (t) {
  2473. t.sortableIndex === F(t) || (m = !0);
  2474. }),
  2475. m && r("update");
  2476. }
  2477. se.forEach(function (t) {
  2478. C(t);
  2479. }),
  2480. s.animateAll();
  2481. }
  2482. ie = s;
  2483. }
  2484. (n === o || (l && "clone" !== l.lastPutMode)) &&
  2485. ce.forEach(function (t) {
  2486. t.parentNode && t.parentNode.removeChild(t);
  2487. });
  2488. }
  2489. },
  2490. nullingGlobal: function () {
  2491. (this.isMultiDrag = he = !1), (ce.length = 0);
  2492. },
  2493. destroyGlobal: function () {
  2494. this._deselectMultiDrag(),
  2495. s(document, "pointerup", this._deselectMultiDrag),
  2496. s(document, "mouseup", this._deselectMultiDrag),
  2497. s(document, "touchend", this._deselectMultiDrag),
  2498. s(document, "keydown", this._checkKeyDown),
  2499. s(document, "keyup", this._checkKeyUp);
  2500. },
  2501. _deselectMultiDrag: function (t) {
  2502. if (
  2503. !(
  2504. (void 0 !== he && he) ||
  2505. ie !== this.sortable ||
  2506. (t &&
  2507. P(
  2508. t.target,
  2509. this.options.draggable,
  2510. this.sortable.el,
  2511. !1
  2512. )) ||
  2513. (t && 0 !== t.button)
  2514. )
  2515. )
  2516. for (; se.length; ) {
  2517. var e = se[0];
  2518. k(e, this.options.selectedClass, !1),
  2519. se.shift(),
  2520. N({
  2521. sortable: this.sortable,
  2522. rootEl: this.sortable.el,
  2523. name: "deselect",
  2524. targetEl: e,
  2525. originalEvt: t
  2526. });
  2527. }
  2528. },
  2529. _checkKeyDown: function (t) {
  2530. t.key === this.options.multiDragKey &&
  2531. (this.multiDragKeyDown = !0);
  2532. },
  2533. _checkKeyUp: function (t) {
  2534. t.key === this.options.multiDragKey &&
  2535. (this.multiDragKeyDown = !1);
  2536. }
  2537. }),
  2538. a(t, {
  2539. pluginName: "multiDrag",
  2540. utils: {
  2541. select: function (t) {
  2542. var e = t.parentNode[j];
  2543. e &&
  2544. e.options.multiDrag &&
  2545. !~se.indexOf(t) &&
  2546. (ie &&
  2547. ie !== e &&
  2548. (ie.multiDrag._deselectMultiDrag(), (ie = e)),
  2549. k(t, e.options.selectedClass, !0),
  2550. se.push(t));
  2551. },
  2552. deselect: function (t) {
  2553. var e = t.parentNode[j],
  2554. n = se.indexOf(t);
  2555. e &&
  2556. e.options.multiDrag &&
  2557. ~n &&
  2558. (k(t, e.options.selectedClass, !1), se.splice(n, 1));
  2559. }
  2560. },
  2561. eventProperties: function () {
  2562. var n = this,
  2563. o = [],
  2564. i = [];
  2565. return (
  2566. se.forEach(function (t) {
  2567. var e;
  2568. o.push({ multiDragElement: t, index: t.sortableIndex }),
  2569. (e =
  2570. de && t !== re
  2571. ? -1
  2572. : de
  2573. ? F(t, ":not(." + n.options.selectedClass + ")")
  2574. : F(t)),
  2575. i.push({ multiDragElement: t, index: e });
  2576. }),
  2577. {
  2578. items: e(se),
  2579. clones: [].concat(ce),
  2580. oldIndicies: o,
  2581. newIndicies: i
  2582. }
  2583. );
  2584. },
  2585. optionListeners: {
  2586. multiDragKey: function (t) {
  2587. return (
  2588. "ctrl" === (t = t.toLowerCase())
  2589. ? (t = "Control")
  2590. : 1 < t.length &&
  2591. (t = t.charAt(0).toUpperCase() + t.substr(1)),
  2592. t
  2593. );
  2594. }
  2595. }
  2596. })
  2597. );
  2598. })()
  2599. ),
  2600. Rt
  2601. );
  2602. });