bootstrap-table-reorder-rows.js 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _inherits(subClass, superClass) {
  31. if (typeof superClass !== "function" && superClass !== null) {
  32. throw new TypeError("Super expression must either be null or a function");
  33. }
  34. subClass.prototype = Object.create(superClass && superClass.prototype, {
  35. constructor: {
  36. value: subClass,
  37. writable: true,
  38. configurable: true
  39. }
  40. });
  41. Object.defineProperty(subClass, "prototype", {
  42. writable: false
  43. });
  44. if (superClass) _setPrototypeOf(subClass, superClass);
  45. }
  46. function _getPrototypeOf(o) {
  47. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  48. return o.__proto__ || Object.getPrototypeOf(o);
  49. };
  50. return _getPrototypeOf(o);
  51. }
  52. function _setPrototypeOf(o, p) {
  53. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  54. o.__proto__ = p;
  55. return o;
  56. };
  57. return _setPrototypeOf(o, p);
  58. }
  59. function _isNativeReflectConstruct() {
  60. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  61. if (Reflect.construct.sham) return false;
  62. if (typeof Proxy === "function") return true;
  63. try {
  64. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. } else if (call !== void 0) {
  80. throw new TypeError("Derived constructors may only return object or undefined");
  81. }
  82. return _assertThisInitialized(self);
  83. }
  84. function _createSuper(Derived) {
  85. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  86. return function _createSuperInternal() {
  87. var Super = _getPrototypeOf(Derived),
  88. result;
  89. if (hasNativeReflectConstruct) {
  90. var NewTarget = _getPrototypeOf(this).constructor;
  91. result = Reflect.construct(Super, arguments, NewTarget);
  92. } else {
  93. result = Super.apply(this, arguments);
  94. }
  95. return _possibleConstructorReturn(this, result);
  96. };
  97. }
  98. function _superPropBase(object, property) {
  99. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  100. object = _getPrototypeOf(object);
  101. if (object === null) break;
  102. }
  103. return object;
  104. }
  105. function _get() {
  106. if (typeof Reflect !== "undefined" && Reflect.get) {
  107. _get = Reflect.get;
  108. } else {
  109. _get = function _get(target, property, receiver) {
  110. var base = _superPropBase(target, property);
  111. if (!base) return;
  112. var desc = Object.getOwnPropertyDescriptor(base, property);
  113. if (desc.get) {
  114. return desc.get.call(arguments.length < 3 ? target : receiver);
  115. }
  116. return desc.value;
  117. };
  118. }
  119. return _get.apply(this, arguments);
  120. }
  121. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  122. function createCommonjsModule(fn, module) {
  123. return module = { exports: {} }, fn(module, module.exports), module.exports;
  124. }
  125. var check = function (it) {
  126. return it && it.Math == Math && it;
  127. };
  128. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  129. var global_1 =
  130. // eslint-disable-next-line es-x/no-global-this -- safe
  131. check(typeof globalThis == 'object' && globalThis) ||
  132. check(typeof window == 'object' && window) ||
  133. // eslint-disable-next-line no-restricted-globals -- safe
  134. check(typeof self == 'object' && self) ||
  135. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  136. // eslint-disable-next-line no-new-func -- fallback
  137. (function () { return this; })() || Function('return this')();
  138. var fails = function (exec) {
  139. try {
  140. return !!exec();
  141. } catch (error) {
  142. return true;
  143. }
  144. };
  145. // Detect IE8's incomplete defineProperty implementation
  146. var descriptors = !fails(function () {
  147. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  148. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  149. });
  150. var functionBindNative = !fails(function () {
  151. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  152. var test = (function () { /* empty */ }).bind();
  153. // eslint-disable-next-line no-prototype-builtins -- safe
  154. return typeof test != 'function' || test.hasOwnProperty('prototype');
  155. });
  156. var call$1 = Function.prototype.call;
  157. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  158. return call$1.apply(call$1, arguments);
  159. };
  160. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  161. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  162. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  163. // Nashorn ~ JDK8 bug
  164. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  165. // `Object.prototype.propertyIsEnumerable` method implementation
  166. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  167. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  168. var descriptor = getOwnPropertyDescriptor$1(this, V);
  169. return !!descriptor && descriptor.enumerable;
  170. } : $propertyIsEnumerable;
  171. var objectPropertyIsEnumerable = {
  172. f: f$4
  173. };
  174. var createPropertyDescriptor = function (bitmap, value) {
  175. return {
  176. enumerable: !(bitmap & 1),
  177. configurable: !(bitmap & 2),
  178. writable: !(bitmap & 4),
  179. value: value
  180. };
  181. };
  182. var FunctionPrototype$1 = Function.prototype;
  183. var bind = FunctionPrototype$1.bind;
  184. var call = FunctionPrototype$1.call;
  185. var uncurryThis = functionBindNative && bind.bind(call, call);
  186. var functionUncurryThis = functionBindNative ? function (fn) {
  187. return fn && uncurryThis(fn);
  188. } : function (fn) {
  189. return fn && function () {
  190. return call.apply(fn, arguments);
  191. };
  192. };
  193. var toString$1 = functionUncurryThis({}.toString);
  194. var stringSlice = functionUncurryThis(''.slice);
  195. var classofRaw = function (it) {
  196. return stringSlice(toString$1(it), 8, -1);
  197. };
  198. var Object$4 = global_1.Object;
  199. var split = functionUncurryThis(''.split);
  200. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  201. var indexedObject = fails(function () {
  202. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  203. // eslint-disable-next-line no-prototype-builtins -- safe
  204. return !Object$4('z').propertyIsEnumerable(0);
  205. }) ? function (it) {
  206. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  207. } : Object$4;
  208. var TypeError$9 = global_1.TypeError;
  209. // `RequireObjectCoercible` abstract operation
  210. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  211. var requireObjectCoercible = function (it) {
  212. if (it == undefined) throw TypeError$9("Can't call method on " + it);
  213. return it;
  214. };
  215. // toObject with fallback for non-array-like ES3 strings
  216. var toIndexedObject = function (it) {
  217. return indexedObject(requireObjectCoercible(it));
  218. };
  219. // `IsCallable` abstract operation
  220. // https://tc39.es/ecma262/#sec-iscallable
  221. var isCallable = function (argument) {
  222. return typeof argument == 'function';
  223. };
  224. var isObject = function (it) {
  225. return typeof it == 'object' ? it !== null : isCallable(it);
  226. };
  227. var aFunction = function (argument) {
  228. return isCallable(argument) ? argument : undefined;
  229. };
  230. var getBuiltIn = function (namespace, method) {
  231. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  232. };
  233. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  234. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  235. var process = global_1.process;
  236. var Deno = global_1.Deno;
  237. var versions = process && process.versions || Deno && Deno.version;
  238. var v8 = versions && versions.v8;
  239. var match, version;
  240. if (v8) {
  241. match = v8.split('.');
  242. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  243. // but their correct versions are not interesting for us
  244. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  245. }
  246. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  247. // so check `userAgent` even if `.v8` exists, but 0
  248. if (!version && engineUserAgent) {
  249. match = engineUserAgent.match(/Edge\/(\d+)/);
  250. if (!match || match[1] >= 74) {
  251. match = engineUserAgent.match(/Chrome\/(\d+)/);
  252. if (match) version = +match[1];
  253. }
  254. }
  255. var engineV8Version = version;
  256. /* eslint-disable es-x/no-symbol -- required for testing */
  257. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  258. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  259. var symbol = Symbol();
  260. // Chrome 38 Symbol has incorrect toString conversion
  261. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  262. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  263. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  264. !Symbol.sham && engineV8Version && engineV8Version < 41;
  265. });
  266. /* eslint-disable es-x/no-symbol -- required for testing */
  267. var useSymbolAsUid = nativeSymbol
  268. && !Symbol.sham
  269. && typeof Symbol.iterator == 'symbol';
  270. var Object$3 = global_1.Object;
  271. var isSymbol = useSymbolAsUid ? function (it) {
  272. return typeof it == 'symbol';
  273. } : function (it) {
  274. var $Symbol = getBuiltIn('Symbol');
  275. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  276. };
  277. var String$2 = global_1.String;
  278. var tryToString = function (argument) {
  279. try {
  280. return String$2(argument);
  281. } catch (error) {
  282. return 'Object';
  283. }
  284. };
  285. var TypeError$8 = global_1.TypeError;
  286. // `Assert: IsCallable(argument) is true`
  287. var aCallable = function (argument) {
  288. if (isCallable(argument)) return argument;
  289. throw TypeError$8(tryToString(argument) + ' is not a function');
  290. };
  291. // `GetMethod` abstract operation
  292. // https://tc39.es/ecma262/#sec-getmethod
  293. var getMethod = function (V, P) {
  294. var func = V[P];
  295. return func == null ? undefined : aCallable(func);
  296. };
  297. var TypeError$7 = global_1.TypeError;
  298. // `OrdinaryToPrimitive` abstract operation
  299. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  300. var ordinaryToPrimitive = function (input, pref) {
  301. var fn, val;
  302. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  303. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  304. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  305. throw TypeError$7("Can't convert object to primitive value");
  306. };
  307. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  308. var defineProperty = Object.defineProperty;
  309. var setGlobal = function (key, value) {
  310. try {
  311. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  312. } catch (error) {
  313. global_1[key] = value;
  314. } return value;
  315. };
  316. var SHARED = '__core-js_shared__';
  317. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  318. var sharedStore = store$1;
  319. var shared = createCommonjsModule(function (module) {
  320. (module.exports = function (key, value) {
  321. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  322. })('versions', []).push({
  323. version: '3.22.4',
  324. mode: 'global',
  325. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  326. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  327. source: 'https://github.com/zloirock/core-js'
  328. });
  329. });
  330. var Object$2 = global_1.Object;
  331. // `ToObject` abstract operation
  332. // https://tc39.es/ecma262/#sec-toobject
  333. var toObject = function (argument) {
  334. return Object$2(requireObjectCoercible(argument));
  335. };
  336. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  337. // `HasOwnProperty` abstract operation
  338. // https://tc39.es/ecma262/#sec-hasownproperty
  339. // eslint-disable-next-line es-x/no-object-hasown -- safe
  340. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  341. return hasOwnProperty(toObject(it), key);
  342. };
  343. var id = 0;
  344. var postfix = Math.random();
  345. var toString = functionUncurryThis(1.0.toString);
  346. var uid = function (key) {
  347. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  348. };
  349. var WellKnownSymbolsStore = shared('wks');
  350. var Symbol$1 = global_1.Symbol;
  351. var symbolFor = Symbol$1 && Symbol$1['for'];
  352. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  353. var wellKnownSymbol = function (name) {
  354. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  355. var description = 'Symbol.' + name;
  356. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  357. WellKnownSymbolsStore[name] = Symbol$1[name];
  358. } else if (useSymbolAsUid && symbolFor) {
  359. WellKnownSymbolsStore[name] = symbolFor(description);
  360. } else {
  361. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  362. }
  363. } return WellKnownSymbolsStore[name];
  364. };
  365. var TypeError$6 = global_1.TypeError;
  366. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  367. // `ToPrimitive` abstract operation
  368. // https://tc39.es/ecma262/#sec-toprimitive
  369. var toPrimitive = function (input, pref) {
  370. if (!isObject(input) || isSymbol(input)) return input;
  371. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  372. var result;
  373. if (exoticToPrim) {
  374. if (pref === undefined) pref = 'default';
  375. result = functionCall(exoticToPrim, input, pref);
  376. if (!isObject(result) || isSymbol(result)) return result;
  377. throw TypeError$6("Can't convert object to primitive value");
  378. }
  379. if (pref === undefined) pref = 'number';
  380. return ordinaryToPrimitive(input, pref);
  381. };
  382. // `ToPropertyKey` abstract operation
  383. // https://tc39.es/ecma262/#sec-topropertykey
  384. var toPropertyKey = function (argument) {
  385. var key = toPrimitive(argument, 'string');
  386. return isSymbol(key) ? key : key + '';
  387. };
  388. var document = global_1.document;
  389. // typeof document.createElement is 'object' in old IE
  390. var EXISTS$1 = isObject(document) && isObject(document.createElement);
  391. var documentCreateElement = function (it) {
  392. return EXISTS$1 ? document.createElement(it) : {};
  393. };
  394. // Thanks to IE8 for its funny defineProperty
  395. var ie8DomDefine = !descriptors && !fails(function () {
  396. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  397. return Object.defineProperty(documentCreateElement('div'), 'a', {
  398. get: function () { return 7; }
  399. }).a != 7;
  400. });
  401. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  402. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  403. // `Object.getOwnPropertyDescriptor` method
  404. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  405. var f$3 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  406. O = toIndexedObject(O);
  407. P = toPropertyKey(P);
  408. if (ie8DomDefine) try {
  409. return $getOwnPropertyDescriptor$1(O, P);
  410. } catch (error) { /* empty */ }
  411. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  412. };
  413. var objectGetOwnPropertyDescriptor = {
  414. f: f$3
  415. };
  416. // V8 ~ Chrome 36-
  417. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  418. var v8PrototypeDefineBug = descriptors && fails(function () {
  419. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  420. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  421. value: 42,
  422. writable: false
  423. }).prototype != 42;
  424. });
  425. var String$1 = global_1.String;
  426. var TypeError$5 = global_1.TypeError;
  427. // `Assert: Type(argument) is Object`
  428. var anObject = function (argument) {
  429. if (isObject(argument)) return argument;
  430. throw TypeError$5(String$1(argument) + ' is not an object');
  431. };
  432. var TypeError$4 = global_1.TypeError;
  433. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  434. var $defineProperty = Object.defineProperty;
  435. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  436. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  437. var ENUMERABLE = 'enumerable';
  438. var CONFIGURABLE$1 = 'configurable';
  439. var WRITABLE = 'writable';
  440. // `Object.defineProperty` method
  441. // https://tc39.es/ecma262/#sec-object.defineproperty
  442. var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  443. anObject(O);
  444. P = toPropertyKey(P);
  445. anObject(Attributes);
  446. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  447. var current = $getOwnPropertyDescriptor(O, P);
  448. if (current && current[WRITABLE]) {
  449. O[P] = Attributes.value;
  450. Attributes = {
  451. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  452. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  453. writable: false
  454. };
  455. }
  456. } return $defineProperty(O, P, Attributes);
  457. } : $defineProperty : function defineProperty(O, P, Attributes) {
  458. anObject(O);
  459. P = toPropertyKey(P);
  460. anObject(Attributes);
  461. if (ie8DomDefine) try {
  462. return $defineProperty(O, P, Attributes);
  463. } catch (error) { /* empty */ }
  464. if ('get' in Attributes || 'set' in Attributes) throw TypeError$4('Accessors not supported');
  465. if ('value' in Attributes) O[P] = Attributes.value;
  466. return O;
  467. };
  468. var objectDefineProperty = {
  469. f: f$2
  470. };
  471. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  472. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  473. } : function (object, key, value) {
  474. object[key] = value;
  475. return object;
  476. };
  477. var FunctionPrototype = Function.prototype;
  478. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  479. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  480. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  481. // additional protection from minified / mangled / dropped function names
  482. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  483. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  484. var functionName = {
  485. EXISTS: EXISTS,
  486. PROPER: PROPER,
  487. CONFIGURABLE: CONFIGURABLE
  488. };
  489. var functionToString = functionUncurryThis(Function.toString);
  490. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  491. if (!isCallable(sharedStore.inspectSource)) {
  492. sharedStore.inspectSource = function (it) {
  493. return functionToString(it);
  494. };
  495. }
  496. var inspectSource = sharedStore.inspectSource;
  497. var WeakMap$1 = global_1.WeakMap;
  498. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  499. var keys = shared('keys');
  500. var sharedKey = function (key) {
  501. return keys[key] || (keys[key] = uid(key));
  502. };
  503. var hiddenKeys$1 = {};
  504. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  505. var TypeError$3 = global_1.TypeError;
  506. var WeakMap = global_1.WeakMap;
  507. var set, get, has;
  508. var enforce = function (it) {
  509. return has(it) ? get(it) : set(it, {});
  510. };
  511. var getterFor = function (TYPE) {
  512. return function (it) {
  513. var state;
  514. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  515. throw TypeError$3('Incompatible receiver, ' + TYPE + ' required');
  516. } return state;
  517. };
  518. };
  519. if (nativeWeakMap || sharedStore.state) {
  520. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  521. var wmget = functionUncurryThis(store.get);
  522. var wmhas = functionUncurryThis(store.has);
  523. var wmset = functionUncurryThis(store.set);
  524. set = function (it, metadata) {
  525. if (wmhas(store, it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  526. metadata.facade = it;
  527. wmset(store, it, metadata);
  528. return metadata;
  529. };
  530. get = function (it) {
  531. return wmget(store, it) || {};
  532. };
  533. has = function (it) {
  534. return wmhas(store, it);
  535. };
  536. } else {
  537. var STATE = sharedKey('state');
  538. hiddenKeys$1[STATE] = true;
  539. set = function (it, metadata) {
  540. if (hasOwnProperty_1(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  541. metadata.facade = it;
  542. createNonEnumerableProperty(it, STATE, metadata);
  543. return metadata;
  544. };
  545. get = function (it) {
  546. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  547. };
  548. has = function (it) {
  549. return hasOwnProperty_1(it, STATE);
  550. };
  551. }
  552. var internalState = {
  553. set: set,
  554. get: get,
  555. has: has,
  556. enforce: enforce,
  557. getterFor: getterFor
  558. };
  559. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  560. var defineProperty = objectDefineProperty.f;
  561. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  562. var enforceInternalState = internalState.enforce;
  563. var getInternalState = internalState.get;
  564. var CONFIGURABLE_LENGTH = !fails(function () {
  565. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  566. });
  567. var TEMPLATE = String(String).split('String');
  568. var makeBuiltIn = module.exports = function (value, name, options) {
  569. if (String(name).slice(0, 7) === 'Symbol(') {
  570. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  571. }
  572. if (options && options.getter) name = 'get ' + name;
  573. if (options && options.setter) name = 'set ' + name;
  574. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  575. defineProperty(value, 'name', { value: name, configurable: true });
  576. }
  577. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  578. defineProperty(value, 'length', { value: options.arity });
  579. }
  580. var state = enforceInternalState(value);
  581. if (!hasOwnProperty_1(state, 'source')) {
  582. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  583. } return value;
  584. };
  585. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  586. // eslint-disable-next-line no-extend-native -- required
  587. Function.prototype.toString = makeBuiltIn(function toString() {
  588. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  589. }, 'toString');
  590. });
  591. var defineBuiltIn = function (O, key, value, options) {
  592. var unsafe = options ? !!options.unsafe : false;
  593. var simple = options ? !!options.enumerable : false;
  594. var noTargetGet = options ? !!options.noTargetGet : false;
  595. var name = options && options.name !== undefined ? options.name : key;
  596. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  597. if (O === global_1) {
  598. if (simple) O[key] = value;
  599. else setGlobal(key, value);
  600. return O;
  601. } else if (!unsafe) {
  602. delete O[key];
  603. } else if (!noTargetGet && O[key]) {
  604. simple = true;
  605. }
  606. if (simple) O[key] = value;
  607. else createNonEnumerableProperty(O, key, value);
  608. return O;
  609. };
  610. var ceil = Math.ceil;
  611. var floor = Math.floor;
  612. // `ToIntegerOrInfinity` abstract operation
  613. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  614. var toIntegerOrInfinity = function (argument) {
  615. var number = +argument;
  616. // eslint-disable-next-line no-self-compare -- safe
  617. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  618. };
  619. var max$1 = Math.max;
  620. var min$2 = Math.min;
  621. // Helper for a popular repeating case of the spec:
  622. // Let integer be ? ToInteger(index).
  623. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  624. var toAbsoluteIndex = function (index, length) {
  625. var integer = toIntegerOrInfinity(index);
  626. return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
  627. };
  628. var min$1 = Math.min;
  629. // `ToLength` abstract operation
  630. // https://tc39.es/ecma262/#sec-tolength
  631. var toLength = function (argument) {
  632. return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  633. };
  634. // `LengthOfArrayLike` abstract operation
  635. // https://tc39.es/ecma262/#sec-lengthofarraylike
  636. var lengthOfArrayLike = function (obj) {
  637. return toLength(obj.length);
  638. };
  639. // `Array.prototype.{ indexOf, includes }` methods implementation
  640. var createMethod = function (IS_INCLUDES) {
  641. return function ($this, el, fromIndex) {
  642. var O = toIndexedObject($this);
  643. var length = lengthOfArrayLike(O);
  644. var index = toAbsoluteIndex(fromIndex, length);
  645. var value;
  646. // Array#includes uses SameValueZero equality algorithm
  647. // eslint-disable-next-line no-self-compare -- NaN check
  648. if (IS_INCLUDES && el != el) while (length > index) {
  649. value = O[index++];
  650. // eslint-disable-next-line no-self-compare -- NaN check
  651. if (value != value) return true;
  652. // Array#indexOf ignores holes, Array#includes - not
  653. } else for (;length > index; index++) {
  654. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  655. } return !IS_INCLUDES && -1;
  656. };
  657. };
  658. var arrayIncludes = {
  659. // `Array.prototype.includes` method
  660. // https://tc39.es/ecma262/#sec-array.prototype.includes
  661. includes: createMethod(true),
  662. // `Array.prototype.indexOf` method
  663. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  664. indexOf: createMethod(false)
  665. };
  666. var indexOf = arrayIncludes.indexOf;
  667. var push = functionUncurryThis([].push);
  668. var objectKeysInternal = function (object, names) {
  669. var O = toIndexedObject(object);
  670. var i = 0;
  671. var result = [];
  672. var key;
  673. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push(result, key);
  674. // Don't enum bug & hidden keys
  675. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  676. ~indexOf(result, key) || push(result, key);
  677. }
  678. return result;
  679. };
  680. // IE8- don't enum bug keys
  681. var enumBugKeys = [
  682. 'constructor',
  683. 'hasOwnProperty',
  684. 'isPrototypeOf',
  685. 'propertyIsEnumerable',
  686. 'toLocaleString',
  687. 'toString',
  688. 'valueOf'
  689. ];
  690. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  691. // `Object.getOwnPropertyNames` method
  692. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  693. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  694. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  695. return objectKeysInternal(O, hiddenKeys);
  696. };
  697. var objectGetOwnPropertyNames = {
  698. f: f$1
  699. };
  700. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  701. var f = Object.getOwnPropertySymbols;
  702. var objectGetOwnPropertySymbols = {
  703. f: f
  704. };
  705. var concat = functionUncurryThis([].concat);
  706. // all object keys, includes non-enumerable and symbols
  707. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  708. var keys = objectGetOwnPropertyNames.f(anObject(it));
  709. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  710. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  711. };
  712. var copyConstructorProperties = function (target, source, exceptions) {
  713. var keys = ownKeys(source);
  714. var defineProperty = objectDefineProperty.f;
  715. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  716. for (var i = 0; i < keys.length; i++) {
  717. var key = keys[i];
  718. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  719. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  720. }
  721. }
  722. };
  723. var replacement = /#|\.prototype\./;
  724. var isForced = function (feature, detection) {
  725. var value = data[normalize(feature)];
  726. return value == POLYFILL ? true
  727. : value == NATIVE ? false
  728. : isCallable(detection) ? fails(detection)
  729. : !!detection;
  730. };
  731. var normalize = isForced.normalize = function (string) {
  732. return String(string).replace(replacement, '.').toLowerCase();
  733. };
  734. var data = isForced.data = {};
  735. var NATIVE = isForced.NATIVE = 'N';
  736. var POLYFILL = isForced.POLYFILL = 'P';
  737. var isForced_1 = isForced;
  738. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  739. /*
  740. options.target - name of the target object
  741. options.global - target is the global object
  742. options.stat - export as static methods of target
  743. options.proto - export as prototype methods of target
  744. options.real - real prototype method for the `pure` version
  745. options.forced - export even if the native feature is available
  746. options.bind - bind methods to the target, required for the `pure` version
  747. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  748. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  749. options.sham - add a flag to not completely full polyfills
  750. options.enumerable - export as enumerable property
  751. options.noTargetGet - prevent calling a getter on target
  752. options.name - the .name of the function if it does not match the key
  753. */
  754. var _export = function (options, source) {
  755. var TARGET = options.target;
  756. var GLOBAL = options.global;
  757. var STATIC = options.stat;
  758. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  759. if (GLOBAL) {
  760. target = global_1;
  761. } else if (STATIC) {
  762. target = global_1[TARGET] || setGlobal(TARGET, {});
  763. } else {
  764. target = (global_1[TARGET] || {}).prototype;
  765. }
  766. if (target) for (key in source) {
  767. sourceProperty = source[key];
  768. if (options.noTargetGet) {
  769. descriptor = getOwnPropertyDescriptor(target, key);
  770. targetProperty = descriptor && descriptor.value;
  771. } else targetProperty = target[key];
  772. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  773. // contained in target
  774. if (!FORCED && targetProperty !== undefined) {
  775. if (typeof sourceProperty == typeof targetProperty) continue;
  776. copyConstructorProperties(sourceProperty, targetProperty);
  777. }
  778. // add a flag to not completely full polyfills
  779. if (options.sham || (targetProperty && targetProperty.sham)) {
  780. createNonEnumerableProperty(sourceProperty, 'sham', true);
  781. }
  782. defineBuiltIn(target, key, sourceProperty, options);
  783. }
  784. };
  785. // `IsArray` abstract operation
  786. // https://tc39.es/ecma262/#sec-isarray
  787. // eslint-disable-next-line es-x/no-array-isarray -- safe
  788. var isArray = Array.isArray || function isArray(argument) {
  789. return classofRaw(argument) == 'Array';
  790. };
  791. var createProperty = function (object, key, value) {
  792. var propertyKey = toPropertyKey(key);
  793. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  794. else object[propertyKey] = value;
  795. };
  796. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  797. var test = {};
  798. test[TO_STRING_TAG$1] = 'z';
  799. var toStringTagSupport = String(test) === '[object z]';
  800. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  801. var Object$1 = global_1.Object;
  802. // ES3 wrong here
  803. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  804. // fallback for IE11 Script Access Denied error
  805. var tryGet = function (it, key) {
  806. try {
  807. return it[key];
  808. } catch (error) { /* empty */ }
  809. };
  810. // getting tag from ES6+ `Object.prototype.toString`
  811. var classof = toStringTagSupport ? classofRaw : function (it) {
  812. var O, tag, result;
  813. return it === undefined ? 'Undefined' : it === null ? 'Null'
  814. // @@toStringTag case
  815. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  816. // builtinTag case
  817. : CORRECT_ARGUMENTS ? classofRaw(O)
  818. // ES3 arguments fallback
  819. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  820. };
  821. var noop = function () { /* empty */ };
  822. var empty = [];
  823. var construct = getBuiltIn('Reflect', 'construct');
  824. var constructorRegExp = /^\s*(?:class|function)\b/;
  825. var exec = functionUncurryThis(constructorRegExp.exec);
  826. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  827. var isConstructorModern = function isConstructor(argument) {
  828. if (!isCallable(argument)) return false;
  829. try {
  830. construct(noop, empty, argument);
  831. return true;
  832. } catch (error) {
  833. return false;
  834. }
  835. };
  836. var isConstructorLegacy = function isConstructor(argument) {
  837. if (!isCallable(argument)) return false;
  838. switch (classof(argument)) {
  839. case 'AsyncFunction':
  840. case 'GeneratorFunction':
  841. case 'AsyncGeneratorFunction': return false;
  842. }
  843. try {
  844. // we can't check .prototype since constructors produced by .bind haven't it
  845. // `Function#toString` throws on some built-it function in some legacy engines
  846. // (for example, `DOMQuad` and similar in FF41-)
  847. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  848. } catch (error) {
  849. return true;
  850. }
  851. };
  852. isConstructorLegacy.sham = true;
  853. // `IsConstructor` abstract operation
  854. // https://tc39.es/ecma262/#sec-isconstructor
  855. var isConstructor = !construct || fails(function () {
  856. var called;
  857. return isConstructorModern(isConstructorModern.call)
  858. || !isConstructorModern(Object)
  859. || !isConstructorModern(function () { called = true; })
  860. || called;
  861. }) ? isConstructorLegacy : isConstructorModern;
  862. var SPECIES$1 = wellKnownSymbol('species');
  863. var Array$1 = global_1.Array;
  864. // a part of `ArraySpeciesCreate` abstract operation
  865. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  866. var arraySpeciesConstructor = function (originalArray) {
  867. var C;
  868. if (isArray(originalArray)) {
  869. C = originalArray.constructor;
  870. // cross-realm fallback
  871. if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
  872. else if (isObject(C)) {
  873. C = C[SPECIES$1];
  874. if (C === null) C = undefined;
  875. }
  876. } return C === undefined ? Array$1 : C;
  877. };
  878. // `ArraySpeciesCreate` abstract operation
  879. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  880. var arraySpeciesCreate = function (originalArray, length) {
  881. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  882. };
  883. var SPECIES = wellKnownSymbol('species');
  884. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  885. // We can't use this feature detection in V8 since it causes
  886. // deoptimization and serious performance degradation
  887. // https://github.com/zloirock/core-js/issues/677
  888. return engineV8Version >= 51 || !fails(function () {
  889. var array = [];
  890. var constructor = array.constructor = {};
  891. constructor[SPECIES] = function () {
  892. return { foo: 1 };
  893. };
  894. return array[METHOD_NAME](Boolean).foo !== 1;
  895. });
  896. };
  897. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  898. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  899. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  900. var TypeError$2 = global_1.TypeError;
  901. // We can't use this feature detection in V8 since it causes
  902. // deoptimization and serious performance degradation
  903. // https://github.com/zloirock/core-js/issues/679
  904. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  905. var array = [];
  906. array[IS_CONCAT_SPREADABLE] = false;
  907. return array.concat()[0] !== array;
  908. });
  909. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  910. var isConcatSpreadable = function (O) {
  911. if (!isObject(O)) return false;
  912. var spreadable = O[IS_CONCAT_SPREADABLE];
  913. return spreadable !== undefined ? !!spreadable : isArray(O);
  914. };
  915. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  916. // `Array.prototype.concat` method
  917. // https://tc39.es/ecma262/#sec-array.prototype.concat
  918. // with adding support of @@isConcatSpreadable and @@species
  919. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  920. // eslint-disable-next-line no-unused-vars -- required for `.length`
  921. concat: function concat(arg) {
  922. var O = toObject(this);
  923. var A = arraySpeciesCreate(O, 0);
  924. var n = 0;
  925. var i, k, length, len, E;
  926. for (i = -1, length = arguments.length; i < length; i++) {
  927. E = i === -1 ? O : arguments[i];
  928. if (isConcatSpreadable(E)) {
  929. len = lengthOfArrayLike(E);
  930. if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  931. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  932. } else {
  933. if (n >= MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  934. createProperty(A, n++, E);
  935. }
  936. }
  937. A.length = n;
  938. return A;
  939. }
  940. });
  941. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  942. var method = [][METHOD_NAME];
  943. return !!method && fails(function () {
  944. // eslint-disable-next-line no-useless-call -- required for testing
  945. method.call(null, argument || function () { return 1; }, 1);
  946. });
  947. };
  948. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  949. var $IndexOf = arrayIncludes.indexOf;
  950. var un$IndexOf = functionUncurryThis([].indexOf);
  951. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  952. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  953. // `Array.prototype.indexOf` method
  954. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  955. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  956. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  957. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  958. return NEGATIVE_ZERO
  959. // convert -0 to +0
  960. ? un$IndexOf(this, searchElement, fromIndex) || 0
  961. : $IndexOf(this, searchElement, fromIndex);
  962. }
  963. });
  964. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  965. var TypeError$1 = global_1.TypeError;
  966. var max = Math.max;
  967. var min = Math.min;
  968. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  969. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  970. // `Array.prototype.splice` method
  971. // https://tc39.es/ecma262/#sec-array.prototype.splice
  972. // with adding support of @@species
  973. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  974. splice: function splice(start, deleteCount /* , ...items */) {
  975. var O = toObject(this);
  976. var len = lengthOfArrayLike(O);
  977. var actualStart = toAbsoluteIndex(start, len);
  978. var argumentsLength = arguments.length;
  979. var insertCount, actualDeleteCount, A, k, from, to;
  980. if (argumentsLength === 0) {
  981. insertCount = actualDeleteCount = 0;
  982. } else if (argumentsLength === 1) {
  983. insertCount = 0;
  984. actualDeleteCount = len - actualStart;
  985. } else {
  986. insertCount = argumentsLength - 2;
  987. actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  988. }
  989. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  990. throw TypeError$1(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  991. }
  992. A = arraySpeciesCreate(O, actualDeleteCount);
  993. for (k = 0; k < actualDeleteCount; k++) {
  994. from = actualStart + k;
  995. if (from in O) createProperty(A, k, O[from]);
  996. }
  997. A.length = actualDeleteCount;
  998. if (insertCount < actualDeleteCount) {
  999. for (k = actualStart; k < len - actualDeleteCount; k++) {
  1000. from = k + actualDeleteCount;
  1001. to = k + insertCount;
  1002. if (from in O) O[to] = O[from];
  1003. else delete O[to];
  1004. }
  1005. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  1006. } else if (insertCount > actualDeleteCount) {
  1007. for (k = len - actualDeleteCount; k > actualStart; k--) {
  1008. from = k + actualDeleteCount - 1;
  1009. to = k + insertCount - 1;
  1010. if (from in O) O[to] = O[from];
  1011. else delete O[to];
  1012. }
  1013. }
  1014. for (k = 0; k < insertCount; k++) {
  1015. O[k + actualStart] = arguments[k + 2];
  1016. }
  1017. O.length = len - actualDeleteCount + insertCount;
  1018. return A;
  1019. }
  1020. });
  1021. /**
  1022. * @author: Dennis Hernández
  1023. * @webSite: http://djhvscf.github.io/Blog
  1024. * @update zhixin wen <wenzhixin2010@gmail.com>
  1025. */
  1026. var rowAttr = function rowAttr(row, index) {
  1027. return {
  1028. id: "customId_".concat(index)
  1029. };
  1030. };
  1031. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1032. reorderableRows: false,
  1033. onDragStyle: null,
  1034. onDropStyle: null,
  1035. onDragClass: 'reorder_rows_onDragClass',
  1036. dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
  1037. useRowAttrFunc: false,
  1038. // eslint-disable-next-line no-unused-vars
  1039. onReorderRowsDrag: function onReorderRowsDrag(row) {
  1040. return false;
  1041. },
  1042. // eslint-disable-next-line no-unused-vars
  1043. onReorderRowsDrop: function onReorderRowsDrop(row) {
  1044. return false;
  1045. },
  1046. // eslint-disable-next-line no-unused-vars
  1047. onReorderRow: function onReorderRow(newData) {
  1048. return false;
  1049. },
  1050. onDragStop: function onDragStop() {},
  1051. onAllowDrop: function onAllowDrop() {
  1052. return true;
  1053. }
  1054. });
  1055. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  1056. 'reorder-row.bs.table': 'onReorderRow'
  1057. });
  1058. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1059. _inherits(_class, _$$BootstrapTable);
  1060. var _super = _createSuper(_class);
  1061. function _class() {
  1062. _classCallCheck(this, _class);
  1063. return _super.apply(this, arguments);
  1064. }
  1065. _createClass(_class, [{
  1066. key: "init",
  1067. value: function init() {
  1068. var _this = this,
  1069. _get3;
  1070. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1071. args[_key] = arguments[_key];
  1072. }
  1073. if (!this.options.reorderableRows) {
  1074. var _get2;
  1075. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1076. return;
  1077. }
  1078. if (this.options.useRowAttrFunc) {
  1079. this.options.rowAttributes = rowAttr;
  1080. }
  1081. var onPostBody = this.options.onPostBody;
  1082. this.options.onPostBody = function () {
  1083. setTimeout(function () {
  1084. _this.makeRowsReorderable();
  1085. onPostBody.call(_this.options, _this.options.data);
  1086. }, 1);
  1087. };
  1088. (_get3 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get3, [this].concat(args));
  1089. }
  1090. }, {
  1091. key: "makeRowsReorderable",
  1092. value: function makeRowsReorderable() {
  1093. var _this2 = this;
  1094. this.$el.tableDnD({
  1095. onDragStyle: this.options.onDragStyle,
  1096. onDropStyle: this.options.onDropStyle,
  1097. onDragClass: this.options.onDragClass,
  1098. onAllowDrop: function onAllowDrop(hoveredRow, draggedRow) {
  1099. return _this2.onAllowDrop(hoveredRow, draggedRow);
  1100. },
  1101. onDragStop: function onDragStop(table, draggedRow) {
  1102. return _this2.onDragStop(table, draggedRow);
  1103. },
  1104. onDragStart: function onDragStart(table, droppedRow) {
  1105. return _this2.onDropStart(table, droppedRow);
  1106. },
  1107. onDrop: function onDrop(table, droppedRow) {
  1108. return _this2.onDrop(table, droppedRow);
  1109. },
  1110. dragHandle: this.options.dragHandle
  1111. });
  1112. }
  1113. }, {
  1114. key: "onDropStart",
  1115. value: function onDropStart(table, draggingTd) {
  1116. this.$draggingTd = $__default["default"](draggingTd).css('cursor', 'move');
  1117. this.draggingIndex = $__default["default"](this.$draggingTd.parent()).data('index'); // Call the user defined function
  1118. this.options.onReorderRowsDrag(this.data[this.draggingIndex]);
  1119. }
  1120. }, {
  1121. key: "onDragStop",
  1122. value: function onDragStop(table, draggedRow) {
  1123. var rowIndexDraggedRow = $__default["default"](draggedRow).data('index');
  1124. var draggedRowItem = this.data[rowIndexDraggedRow];
  1125. this.options.onDragStop(table, draggedRowItem, draggedRow);
  1126. }
  1127. }, {
  1128. key: "onAllowDrop",
  1129. value: function onAllowDrop(hoveredRow, draggedRow) {
  1130. var rowIndexDraggedRow = $__default["default"](draggedRow).data('index');
  1131. var rowIndexHoveredRow = $__default["default"](hoveredRow).data('index');
  1132. var draggedRowItem = this.data[rowIndexDraggedRow];
  1133. var hoveredRowItem = this.data[rowIndexHoveredRow];
  1134. return this.options.onAllowDrop(hoveredRowItem, draggedRowItem, hoveredRow, draggedRow);
  1135. }
  1136. }, {
  1137. key: "onDrop",
  1138. value: function onDrop(table) {
  1139. this.$draggingTd.css('cursor', '');
  1140. var newData = [];
  1141. for (var i = 0; i < table.tBodies[0].rows.length; i++) {
  1142. var $tr = $__default["default"](table.tBodies[0].rows[i]);
  1143. newData.push(this.data[$tr.data('index')]);
  1144. $tr.data('index', i);
  1145. }
  1146. var draggingRow = this.data[this.draggingIndex];
  1147. var droppedIndex = newData.indexOf(this.data[this.draggingIndex]);
  1148. var droppedRow = this.data[droppedIndex];
  1149. var index = this.options.data.indexOf(this.data[droppedIndex]);
  1150. this.options.data.splice(this.options.data.indexOf(draggingRow), 1);
  1151. this.options.data.splice(index, 0, draggingRow);
  1152. this.initSearch(); // Call the user defined function
  1153. this.options.onReorderRowsDrop(droppedRow); // Call the event reorder-row
  1154. this.trigger('reorder-row', newData, draggingRow, droppedRow);
  1155. }
  1156. }, {
  1157. key: "initSearch",
  1158. value: function initSearch() {
  1159. this.ignoreInitSort = true;
  1160. _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
  1161. }
  1162. }, {
  1163. key: "initSort",
  1164. value: function initSort() {
  1165. if (this.ignoreInitSort) {
  1166. this.ignoreInitSort = false;
  1167. return;
  1168. }
  1169. _get(_getPrototypeOf(_class.prototype), "initSort", this).call(this);
  1170. }
  1171. }]);
  1172. return _class;
  1173. }($__default["default"].BootstrapTable);
  1174. }));