bootstrap-table-group-by.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624
  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 _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  11. _typeof = function (obj) {
  12. return typeof obj;
  13. };
  14. } else {
  15. _typeof = function (obj) {
  16. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  17. };
  18. }
  19. return _typeof(obj);
  20. }
  21. function _classCallCheck(instance, Constructor) {
  22. if (!(instance instanceof Constructor)) {
  23. throw new TypeError("Cannot call a class as a function");
  24. }
  25. }
  26. function _defineProperties(target, props) {
  27. for (var i = 0; i < props.length; i++) {
  28. var descriptor = props[i];
  29. descriptor.enumerable = descriptor.enumerable || false;
  30. descriptor.configurable = true;
  31. if ("value" in descriptor) descriptor.writable = true;
  32. Object.defineProperty(target, descriptor.key, descriptor);
  33. }
  34. }
  35. function _createClass(Constructor, protoProps, staticProps) {
  36. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  37. if (staticProps) _defineProperties(Constructor, staticProps);
  38. return Constructor;
  39. }
  40. function _inherits(subClass, superClass) {
  41. if (typeof superClass !== "function" && superClass !== null) {
  42. throw new TypeError("Super expression must either be null or a function");
  43. }
  44. subClass.prototype = Object.create(superClass && superClass.prototype, {
  45. constructor: {
  46. value: subClass,
  47. writable: true,
  48. configurable: true
  49. }
  50. });
  51. if (superClass) _setPrototypeOf(subClass, superClass);
  52. }
  53. function _getPrototypeOf(o) {
  54. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  55. return o.__proto__ || Object.getPrototypeOf(o);
  56. };
  57. return _getPrototypeOf(o);
  58. }
  59. function _setPrototypeOf(o, p) {
  60. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  61. o.__proto__ = p;
  62. return o;
  63. };
  64. return _setPrototypeOf(o, p);
  65. }
  66. function _isNativeReflectConstruct() {
  67. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  68. if (Reflect.construct.sham) return false;
  69. if (typeof Proxy === "function") return true;
  70. try {
  71. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  72. return true;
  73. } catch (e) {
  74. return false;
  75. }
  76. }
  77. function _assertThisInitialized(self) {
  78. if (self === void 0) {
  79. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80. }
  81. return self;
  82. }
  83. function _possibleConstructorReturn(self, call) {
  84. if (call && (typeof call === "object" || typeof call === "function")) {
  85. return call;
  86. }
  87. return _assertThisInitialized(self);
  88. }
  89. function _createSuper(Derived) {
  90. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  91. return function _createSuperInternal() {
  92. var Super = _getPrototypeOf(Derived),
  93. result;
  94. if (hasNativeReflectConstruct) {
  95. var NewTarget = _getPrototypeOf(this).constructor;
  96. result = Reflect.construct(Super, arguments, NewTarget);
  97. } else {
  98. result = Super.apply(this, arguments);
  99. }
  100. return _possibleConstructorReturn(this, result);
  101. };
  102. }
  103. function _superPropBase(object, property) {
  104. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  105. object = _getPrototypeOf(object);
  106. if (object === null) break;
  107. }
  108. return object;
  109. }
  110. function _get(target, property, receiver) {
  111. if (typeof Reflect !== "undefined" && Reflect.get) {
  112. _get = Reflect.get;
  113. } else {
  114. _get = function _get(target, property, receiver) {
  115. var base = _superPropBase(target, property);
  116. if (!base) return;
  117. var desc = Object.getOwnPropertyDescriptor(base, property);
  118. if (desc.get) {
  119. return desc.get.call(receiver);
  120. }
  121. return desc.value;
  122. };
  123. }
  124. return _get(target, property, receiver || target);
  125. }
  126. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  127. function createCommonjsModule(fn, module) {
  128. return module = { exports: {} }, fn(module, module.exports), module.exports;
  129. }
  130. var check = function (it) {
  131. return it && it.Math == Math && it;
  132. };
  133. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  134. var global_1 =
  135. // eslint-disable-next-line es/no-global-this -- safe
  136. check(typeof globalThis == 'object' && globalThis) ||
  137. check(typeof window == 'object' && window) ||
  138. // eslint-disable-next-line no-restricted-globals -- safe
  139. check(typeof self == 'object' && self) ||
  140. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  141. // eslint-disable-next-line no-new-func -- fallback
  142. (function () { return this; })() || Function('return this')();
  143. // iterable DOM collections
  144. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  145. var domIterables = {
  146. CSSRuleList: 0,
  147. CSSStyleDeclaration: 0,
  148. CSSValueList: 0,
  149. ClientRectList: 0,
  150. DOMRectList: 0,
  151. DOMStringList: 0,
  152. DOMTokenList: 1,
  153. DataTransferItemList: 0,
  154. FileList: 0,
  155. HTMLAllCollection: 0,
  156. HTMLCollection: 0,
  157. HTMLFormElement: 0,
  158. HTMLSelectElement: 0,
  159. MediaList: 0,
  160. MimeTypeArray: 0,
  161. NamedNodeMap: 0,
  162. NodeList: 1,
  163. PaintRequestList: 0,
  164. Plugin: 0,
  165. PluginArray: 0,
  166. SVGLengthList: 0,
  167. SVGNumberList: 0,
  168. SVGPathSegList: 0,
  169. SVGPointList: 0,
  170. SVGStringList: 0,
  171. SVGTransformList: 0,
  172. SourceBufferList: 0,
  173. StyleSheetList: 0,
  174. TextTrackCueList: 0,
  175. TextTrackList: 0,
  176. TouchList: 0
  177. };
  178. var aFunction$1 = function (it) {
  179. if (typeof it != 'function') {
  180. throw TypeError(String(it) + ' is not a function');
  181. } return it;
  182. };
  183. // optional / simple context binding
  184. var functionBindContext = function (fn, that, length) {
  185. aFunction$1(fn);
  186. if (that === undefined) return fn;
  187. switch (length) {
  188. case 0: return function () {
  189. return fn.call(that);
  190. };
  191. case 1: return function (a) {
  192. return fn.call(that, a);
  193. };
  194. case 2: return function (a, b) {
  195. return fn.call(that, a, b);
  196. };
  197. case 3: return function (a, b, c) {
  198. return fn.call(that, a, b, c);
  199. };
  200. }
  201. return function (/* ...args */) {
  202. return fn.apply(that, arguments);
  203. };
  204. };
  205. var fails = function (exec) {
  206. try {
  207. return !!exec();
  208. } catch (error) {
  209. return true;
  210. }
  211. };
  212. var toString = {}.toString;
  213. var classofRaw = function (it) {
  214. return toString.call(it).slice(8, -1);
  215. };
  216. var split = ''.split;
  217. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  218. var indexedObject = fails(function () {
  219. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  220. // eslint-disable-next-line no-prototype-builtins -- safe
  221. return !Object('z').propertyIsEnumerable(0);
  222. }) ? function (it) {
  223. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  224. } : Object;
  225. // `RequireObjectCoercible` abstract operation
  226. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  227. var requireObjectCoercible = function (it) {
  228. if (it == undefined) throw TypeError("Can't call method on " + it);
  229. return it;
  230. };
  231. // `ToObject` abstract operation
  232. // https://tc39.es/ecma262/#sec-toobject
  233. var toObject = function (argument) {
  234. return Object(requireObjectCoercible(argument));
  235. };
  236. var ceil = Math.ceil;
  237. var floor = Math.floor;
  238. // `ToInteger` abstract operation
  239. // https://tc39.es/ecma262/#sec-tointeger
  240. var toInteger = function (argument) {
  241. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  242. };
  243. var min$1 = Math.min;
  244. // `ToLength` abstract operation
  245. // https://tc39.es/ecma262/#sec-tolength
  246. var toLength = function (argument) {
  247. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  248. };
  249. var isObject = function (it) {
  250. return typeof it === 'object' ? it !== null : typeof it === 'function';
  251. };
  252. // `IsArray` abstract operation
  253. // https://tc39.es/ecma262/#sec-isarray
  254. // eslint-disable-next-line es/no-array-isarray -- safe
  255. var isArray = Array.isArray || function isArray(arg) {
  256. return classofRaw(arg) == 'Array';
  257. };
  258. // Detect IE8's incomplete defineProperty implementation
  259. var descriptors = !fails(function () {
  260. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  261. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  262. });
  263. var document$1 = global_1.document;
  264. // typeof document.createElement is 'object' in old IE
  265. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  266. var documentCreateElement = function (it) {
  267. return EXISTS ? document$1.createElement(it) : {};
  268. };
  269. // Thank's IE8 for his funny defineProperty
  270. var ie8DomDefine = !descriptors && !fails(function () {
  271. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  272. return Object.defineProperty(documentCreateElement('div'), 'a', {
  273. get: function () { return 7; }
  274. }).a != 7;
  275. });
  276. var anObject = function (it) {
  277. if (!isObject(it)) {
  278. throw TypeError(String(it) + ' is not an object');
  279. } return it;
  280. };
  281. // `ToPrimitive` abstract operation
  282. // https://tc39.es/ecma262/#sec-toprimitive
  283. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  284. // and the second argument - flag - preferred type is a string
  285. var toPrimitive = function (input, PREFERRED_STRING) {
  286. if (!isObject(input)) return input;
  287. var fn, val;
  288. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  289. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  290. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  291. throw TypeError("Can't convert object to primitive value");
  292. };
  293. // eslint-disable-next-line es/no-object-defineproperty -- safe
  294. var $defineProperty = Object.defineProperty;
  295. // `Object.defineProperty` method
  296. // https://tc39.es/ecma262/#sec-object.defineproperty
  297. var f$4 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  298. anObject(O);
  299. P = toPrimitive(P, true);
  300. anObject(Attributes);
  301. if (ie8DomDefine) try {
  302. return $defineProperty(O, P, Attributes);
  303. } catch (error) { /* empty */ }
  304. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  305. if ('value' in Attributes) O[P] = Attributes.value;
  306. return O;
  307. };
  308. var objectDefineProperty = {
  309. f: f$4
  310. };
  311. var createPropertyDescriptor = function (bitmap, value) {
  312. return {
  313. enumerable: !(bitmap & 1),
  314. configurable: !(bitmap & 2),
  315. writable: !(bitmap & 4),
  316. value: value
  317. };
  318. };
  319. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  320. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  321. } : function (object, key, value) {
  322. object[key] = value;
  323. return object;
  324. };
  325. var setGlobal = function (key, value) {
  326. try {
  327. createNonEnumerableProperty(global_1, key, value);
  328. } catch (error) {
  329. global_1[key] = value;
  330. } return value;
  331. };
  332. var SHARED = '__core-js_shared__';
  333. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  334. var sharedStore = store$1;
  335. var shared = createCommonjsModule(function (module) {
  336. (module.exports = function (key, value) {
  337. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  338. })('versions', []).push({
  339. version: '3.10.1',
  340. mode: 'global',
  341. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  342. });
  343. });
  344. var hasOwnProperty = {}.hasOwnProperty;
  345. var has$1 = function (it, key) {
  346. return hasOwnProperty.call(it, key);
  347. };
  348. var id = 0;
  349. var postfix = Math.random();
  350. var uid = function (key) {
  351. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  352. };
  353. var engineIsNode = classofRaw(global_1.process) == 'process';
  354. var path = global_1;
  355. var aFunction = function (variable) {
  356. return typeof variable == 'function' ? variable : undefined;
  357. };
  358. var getBuiltIn = function (namespace, method) {
  359. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  360. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  361. };
  362. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  363. var process = global_1.process;
  364. var versions = process && process.versions;
  365. var v8 = versions && versions.v8;
  366. var match, version;
  367. if (v8) {
  368. match = v8.split('.');
  369. version = match[0] + match[1];
  370. } else if (engineUserAgent) {
  371. match = engineUserAgent.match(/Edge\/(\d+)/);
  372. if (!match || match[1] >= 74) {
  373. match = engineUserAgent.match(/Chrome\/(\d+)/);
  374. if (match) version = match[1];
  375. }
  376. }
  377. var engineV8Version = version && +version;
  378. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  379. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  380. // eslint-disable-next-line es/no-symbol -- required for testing
  381. return !Symbol.sham &&
  382. // Chrome 38 Symbol has incorrect toString conversion
  383. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  384. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  385. });
  386. /* eslint-disable es/no-symbol -- required for testing */
  387. var useSymbolAsUid = nativeSymbol
  388. && !Symbol.sham
  389. && typeof Symbol.iterator == 'symbol';
  390. var WellKnownSymbolsStore = shared('wks');
  391. var Symbol$1 = global_1.Symbol;
  392. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  393. var wellKnownSymbol = function (name) {
  394. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  395. if (nativeSymbol && has$1(Symbol$1, name)) {
  396. WellKnownSymbolsStore[name] = Symbol$1[name];
  397. } else {
  398. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  399. }
  400. } return WellKnownSymbolsStore[name];
  401. };
  402. var SPECIES$2 = wellKnownSymbol('species');
  403. // `ArraySpeciesCreate` abstract operation
  404. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  405. var arraySpeciesCreate = function (originalArray, length) {
  406. var C;
  407. if (isArray(originalArray)) {
  408. C = originalArray.constructor;
  409. // cross-realm fallback
  410. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  411. else if (isObject(C)) {
  412. C = C[SPECIES$2];
  413. if (C === null) C = undefined;
  414. }
  415. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  416. };
  417. var push = [].push;
  418. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  419. var createMethod$1 = function (TYPE) {
  420. var IS_MAP = TYPE == 1;
  421. var IS_FILTER = TYPE == 2;
  422. var IS_SOME = TYPE == 3;
  423. var IS_EVERY = TYPE == 4;
  424. var IS_FIND_INDEX = TYPE == 6;
  425. var IS_FILTER_OUT = TYPE == 7;
  426. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  427. return function ($this, callbackfn, that, specificCreate) {
  428. var O = toObject($this);
  429. var self = indexedObject(O);
  430. var boundFunction = functionBindContext(callbackfn, that, 3);
  431. var length = toLength(self.length);
  432. var index = 0;
  433. var create = specificCreate || arraySpeciesCreate;
  434. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  435. var value, result;
  436. for (;length > index; index++) if (NO_HOLES || index in self) {
  437. value = self[index];
  438. result = boundFunction(value, index, O);
  439. if (TYPE) {
  440. if (IS_MAP) target[index] = result; // map
  441. else if (result) switch (TYPE) {
  442. case 3: return true; // some
  443. case 5: return value; // find
  444. case 6: return index; // findIndex
  445. case 2: push.call(target, value); // filter
  446. } else switch (TYPE) {
  447. case 4: return false; // every
  448. case 7: push.call(target, value); // filterOut
  449. }
  450. }
  451. }
  452. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  453. };
  454. };
  455. var arrayIteration = {
  456. // `Array.prototype.forEach` method
  457. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  458. forEach: createMethod$1(0),
  459. // `Array.prototype.map` method
  460. // https://tc39.es/ecma262/#sec-array.prototype.map
  461. map: createMethod$1(1),
  462. // `Array.prototype.filter` method
  463. // https://tc39.es/ecma262/#sec-array.prototype.filter
  464. filter: createMethod$1(2),
  465. // `Array.prototype.some` method
  466. // https://tc39.es/ecma262/#sec-array.prototype.some
  467. some: createMethod$1(3),
  468. // `Array.prototype.every` method
  469. // https://tc39.es/ecma262/#sec-array.prototype.every
  470. every: createMethod$1(4),
  471. // `Array.prototype.find` method
  472. // https://tc39.es/ecma262/#sec-array.prototype.find
  473. find: createMethod$1(5),
  474. // `Array.prototype.findIndex` method
  475. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  476. findIndex: createMethod$1(6),
  477. // `Array.prototype.filterOut` method
  478. // https://github.com/tc39/proposal-array-filtering
  479. filterOut: createMethod$1(7)
  480. };
  481. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  482. var method = [][METHOD_NAME];
  483. return !!method && fails(function () {
  484. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  485. method.call(null, argument || function () { throw 1; }, 1);
  486. });
  487. };
  488. var $forEach = arrayIteration.forEach;
  489. var STRICT_METHOD$2 = arrayMethodIsStrict('forEach');
  490. // `Array.prototype.forEach` method implementation
  491. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  492. var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
  493. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  494. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  495. } : [].forEach;
  496. for (var COLLECTION_NAME in domIterables) {
  497. var Collection = global_1[COLLECTION_NAME];
  498. var CollectionPrototype = Collection && Collection.prototype;
  499. // some Chrome versions have non-configurable methods on DOMTokenList
  500. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  501. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  502. } catch (error) {
  503. CollectionPrototype.forEach = arrayForEach;
  504. }
  505. }
  506. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  507. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  508. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  509. // Nashorn ~ JDK8 bug
  510. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  511. // `Object.prototype.propertyIsEnumerable` method implementation
  512. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  513. var f$3 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  514. var descriptor = getOwnPropertyDescriptor$1(this, V);
  515. return !!descriptor && descriptor.enumerable;
  516. } : $propertyIsEnumerable;
  517. var objectPropertyIsEnumerable = {
  518. f: f$3
  519. };
  520. // toObject with fallback for non-array-like ES3 strings
  521. var toIndexedObject = function (it) {
  522. return indexedObject(requireObjectCoercible(it));
  523. };
  524. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  525. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  526. // `Object.getOwnPropertyDescriptor` method
  527. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  528. var f$2 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  529. O = toIndexedObject(O);
  530. P = toPrimitive(P, true);
  531. if (ie8DomDefine) try {
  532. return $getOwnPropertyDescriptor(O, P);
  533. } catch (error) { /* empty */ }
  534. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  535. };
  536. var objectGetOwnPropertyDescriptor = {
  537. f: f$2
  538. };
  539. var functionToString = Function.toString;
  540. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  541. if (typeof sharedStore.inspectSource != 'function') {
  542. sharedStore.inspectSource = function (it) {
  543. return functionToString.call(it);
  544. };
  545. }
  546. var inspectSource = sharedStore.inspectSource;
  547. var WeakMap$1 = global_1.WeakMap;
  548. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  549. var keys = shared('keys');
  550. var sharedKey = function (key) {
  551. return keys[key] || (keys[key] = uid(key));
  552. };
  553. var hiddenKeys$1 = {};
  554. var WeakMap = global_1.WeakMap;
  555. var set, get, has;
  556. var enforce = function (it) {
  557. return has(it) ? get(it) : set(it, {});
  558. };
  559. var getterFor = function (TYPE) {
  560. return function (it) {
  561. var state;
  562. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  563. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  564. } return state;
  565. };
  566. };
  567. if (nativeWeakMap) {
  568. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  569. var wmget = store.get;
  570. var wmhas = store.has;
  571. var wmset = store.set;
  572. set = function (it, metadata) {
  573. metadata.facade = it;
  574. wmset.call(store, it, metadata);
  575. return metadata;
  576. };
  577. get = function (it) {
  578. return wmget.call(store, it) || {};
  579. };
  580. has = function (it) {
  581. return wmhas.call(store, it);
  582. };
  583. } else {
  584. var STATE = sharedKey('state');
  585. hiddenKeys$1[STATE] = true;
  586. set = function (it, metadata) {
  587. metadata.facade = it;
  588. createNonEnumerableProperty(it, STATE, metadata);
  589. return metadata;
  590. };
  591. get = function (it) {
  592. return has$1(it, STATE) ? it[STATE] : {};
  593. };
  594. has = function (it) {
  595. return has$1(it, STATE);
  596. };
  597. }
  598. var internalState = {
  599. set: set,
  600. get: get,
  601. has: has,
  602. enforce: enforce,
  603. getterFor: getterFor
  604. };
  605. var redefine = createCommonjsModule(function (module) {
  606. var getInternalState = internalState.get;
  607. var enforceInternalState = internalState.enforce;
  608. var TEMPLATE = String(String).split('String');
  609. (module.exports = function (O, key, value, options) {
  610. var unsafe = options ? !!options.unsafe : false;
  611. var simple = options ? !!options.enumerable : false;
  612. var noTargetGet = options ? !!options.noTargetGet : false;
  613. var state;
  614. if (typeof value == 'function') {
  615. if (typeof key == 'string' && !has$1(value, 'name')) {
  616. createNonEnumerableProperty(value, 'name', key);
  617. }
  618. state = enforceInternalState(value);
  619. if (!state.source) {
  620. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  621. }
  622. }
  623. if (O === global_1) {
  624. if (simple) O[key] = value;
  625. else setGlobal(key, value);
  626. return;
  627. } else if (!unsafe) {
  628. delete O[key];
  629. } else if (!noTargetGet && O[key]) {
  630. simple = true;
  631. }
  632. if (simple) O[key] = value;
  633. else createNonEnumerableProperty(O, key, value);
  634. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  635. })(Function.prototype, 'toString', function toString() {
  636. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  637. });
  638. });
  639. var max$1 = Math.max;
  640. var min = Math.min;
  641. // Helper for a popular repeating case of the spec:
  642. // Let integer be ? ToInteger(index).
  643. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  644. var toAbsoluteIndex = function (index, length) {
  645. var integer = toInteger(index);
  646. return integer < 0 ? max$1(integer + length, 0) : min(integer, length);
  647. };
  648. // `Array.prototype.{ indexOf, includes }` methods implementation
  649. var createMethod = function (IS_INCLUDES) {
  650. return function ($this, el, fromIndex) {
  651. var O = toIndexedObject($this);
  652. var length = toLength(O.length);
  653. var index = toAbsoluteIndex(fromIndex, length);
  654. var value;
  655. // Array#includes uses SameValueZero equality algorithm
  656. // eslint-disable-next-line no-self-compare -- NaN check
  657. if (IS_INCLUDES && el != el) while (length > index) {
  658. value = O[index++];
  659. // eslint-disable-next-line no-self-compare -- NaN check
  660. if (value != value) return true;
  661. // Array#indexOf ignores holes, Array#includes - not
  662. } else for (;length > index; index++) {
  663. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  664. } return !IS_INCLUDES && -1;
  665. };
  666. };
  667. var arrayIncludes = {
  668. // `Array.prototype.includes` method
  669. // https://tc39.es/ecma262/#sec-array.prototype.includes
  670. includes: createMethod(true),
  671. // `Array.prototype.indexOf` method
  672. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  673. indexOf: createMethod(false)
  674. };
  675. var indexOf = arrayIncludes.indexOf;
  676. var objectKeysInternal = function (object, names) {
  677. var O = toIndexedObject(object);
  678. var i = 0;
  679. var result = [];
  680. var key;
  681. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  682. // Don't enum bug & hidden keys
  683. while (names.length > i) if (has$1(O, key = names[i++])) {
  684. ~indexOf(result, key) || result.push(key);
  685. }
  686. return result;
  687. };
  688. // IE8- don't enum bug keys
  689. var enumBugKeys = [
  690. 'constructor',
  691. 'hasOwnProperty',
  692. 'isPrototypeOf',
  693. 'propertyIsEnumerable',
  694. 'toLocaleString',
  695. 'toString',
  696. 'valueOf'
  697. ];
  698. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  699. // `Object.getOwnPropertyNames` method
  700. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  701. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  702. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  703. return objectKeysInternal(O, hiddenKeys);
  704. };
  705. var objectGetOwnPropertyNames = {
  706. f: f$1
  707. };
  708. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  709. var f = Object.getOwnPropertySymbols;
  710. var objectGetOwnPropertySymbols = {
  711. f: f
  712. };
  713. // all object keys, includes non-enumerable and symbols
  714. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  715. var keys = objectGetOwnPropertyNames.f(anObject(it));
  716. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  717. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  718. };
  719. var copyConstructorProperties = function (target, source) {
  720. var keys = ownKeys(source);
  721. var defineProperty = objectDefineProperty.f;
  722. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  723. for (var i = 0; i < keys.length; i++) {
  724. var key = keys[i];
  725. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  726. }
  727. };
  728. var replacement = /#|\.prototype\./;
  729. var isForced = function (feature, detection) {
  730. var value = data[normalize(feature)];
  731. return value == POLYFILL ? true
  732. : value == NATIVE ? false
  733. : typeof detection == 'function' ? fails(detection)
  734. : !!detection;
  735. };
  736. var normalize = isForced.normalize = function (string) {
  737. return String(string).replace(replacement, '.').toLowerCase();
  738. };
  739. var data = isForced.data = {};
  740. var NATIVE = isForced.NATIVE = 'N';
  741. var POLYFILL = isForced.POLYFILL = 'P';
  742. var isForced_1 = isForced;
  743. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  744. /*
  745. options.target - name of the target object
  746. options.global - target is the global object
  747. options.stat - export as static methods of target
  748. options.proto - export as prototype methods of target
  749. options.real - real prototype method for the `pure` version
  750. options.forced - export even if the native feature is available
  751. options.bind - bind methods to the target, required for the `pure` version
  752. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  753. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  754. options.sham - add a flag to not completely full polyfills
  755. options.enumerable - export as enumerable property
  756. options.noTargetGet - prevent calling a getter on target
  757. */
  758. var _export = function (options, source) {
  759. var TARGET = options.target;
  760. var GLOBAL = options.global;
  761. var STATIC = options.stat;
  762. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  763. if (GLOBAL) {
  764. target = global_1;
  765. } else if (STATIC) {
  766. target = global_1[TARGET] || setGlobal(TARGET, {});
  767. } else {
  768. target = (global_1[TARGET] || {}).prototype;
  769. }
  770. if (target) for (key in source) {
  771. sourceProperty = source[key];
  772. if (options.noTargetGet) {
  773. descriptor = getOwnPropertyDescriptor(target, key);
  774. targetProperty = descriptor && descriptor.value;
  775. } else targetProperty = target[key];
  776. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  777. // contained in target
  778. if (!FORCED && targetProperty !== undefined) {
  779. if (typeof sourceProperty === typeof targetProperty) continue;
  780. copyConstructorProperties(sourceProperty, targetProperty);
  781. }
  782. // add a flag to not completely full polyfills
  783. if (options.sham || (targetProperty && targetProperty.sham)) {
  784. createNonEnumerableProperty(sourceProperty, 'sham', true);
  785. }
  786. // extend global
  787. redefine(target, key, sourceProperty, options);
  788. }
  789. };
  790. var createProperty = function (object, key, value) {
  791. var propertyKey = toPrimitive(key);
  792. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  793. else object[propertyKey] = value;
  794. };
  795. var SPECIES$1 = wellKnownSymbol('species');
  796. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  797. // We can't use this feature detection in V8 since it causes
  798. // deoptimization and serious performance degradation
  799. // https://github.com/zloirock/core-js/issues/677
  800. return engineV8Version >= 51 || !fails(function () {
  801. var array = [];
  802. var constructor = array.constructor = {};
  803. constructor[SPECIES$1] = function () {
  804. return { foo: 1 };
  805. };
  806. return array[METHOD_NAME](Boolean).foo !== 1;
  807. });
  808. };
  809. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  810. var SPECIES = wellKnownSymbol('species');
  811. var nativeSlice = [].slice;
  812. var max = Math.max;
  813. // `Array.prototype.slice` method
  814. // https://tc39.es/ecma262/#sec-array.prototype.slice
  815. // fallback for not array-like ES3 strings and DOM objects
  816. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  817. slice: function slice(start, end) {
  818. var O = toIndexedObject(this);
  819. var length = toLength(O.length);
  820. var k = toAbsoluteIndex(start, length);
  821. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  822. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  823. var Constructor, result, n;
  824. if (isArray(O)) {
  825. Constructor = O.constructor;
  826. // cross-realm fallback
  827. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  828. Constructor = undefined;
  829. } else if (isObject(Constructor)) {
  830. Constructor = Constructor[SPECIES];
  831. if (Constructor === null) Constructor = undefined;
  832. }
  833. if (Constructor === Array || Constructor === undefined) {
  834. return nativeSlice.call(O, k, fin);
  835. }
  836. }
  837. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  838. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  839. result.length = n;
  840. return result;
  841. }
  842. });
  843. var test = [];
  844. var nativeSort = test.sort;
  845. // IE8-
  846. var FAILS_ON_UNDEFINED = fails(function () {
  847. test.sort(undefined);
  848. });
  849. // V8 bug
  850. var FAILS_ON_NULL = fails(function () {
  851. test.sort(null);
  852. });
  853. // Old WebKit
  854. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  855. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1;
  856. // `Array.prototype.sort` method
  857. // https://tc39.es/ecma262/#sec-array.prototype.sort
  858. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  859. sort: function sort(comparefn) {
  860. return comparefn === undefined
  861. ? nativeSort.call(toObject(this))
  862. : nativeSort.call(toObject(this), aFunction$1(comparefn));
  863. }
  864. });
  865. var nativeJoin = [].join;
  866. var ES3_STRINGS = indexedObject != Object;
  867. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  868. // `Array.prototype.join` method
  869. // https://tc39.es/ecma262/#sec-array.prototype.join
  870. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  871. join: function join(separator) {
  872. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  873. }
  874. });
  875. var defineProperty$1 = objectDefineProperty.f;
  876. var FunctionPrototype = Function.prototype;
  877. var FunctionPrototypeToString = FunctionPrototype.toString;
  878. var nameRE = /^\s*function ([^ (]*)/;
  879. var NAME = 'name';
  880. // Function instances `.name` property
  881. // https://tc39.es/ecma262/#sec-function-instances-name
  882. if (descriptors && !(NAME in FunctionPrototype)) {
  883. defineProperty$1(FunctionPrototype, NAME, {
  884. configurable: true,
  885. get: function () {
  886. try {
  887. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  888. } catch (error) {
  889. return '';
  890. }
  891. }
  892. });
  893. }
  894. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  895. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  896. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  897. // We can't use this feature detection in V8 since it causes
  898. // deoptimization and serious performance degradation
  899. // https://github.com/zloirock/core-js/issues/679
  900. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  901. var array = [];
  902. array[IS_CONCAT_SPREADABLE] = false;
  903. return array.concat()[0] !== array;
  904. });
  905. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  906. var isConcatSpreadable = function (O) {
  907. if (!isObject(O)) return false;
  908. var spreadable = O[IS_CONCAT_SPREADABLE];
  909. return spreadable !== undefined ? !!spreadable : isArray(O);
  910. };
  911. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  912. // `Array.prototype.concat` method
  913. // https://tc39.es/ecma262/#sec-array.prototype.concat
  914. // with adding support of @@isConcatSpreadable and @@species
  915. _export({ target: 'Array', proto: true, forced: FORCED }, {
  916. // eslint-disable-next-line no-unused-vars -- required for `.length`
  917. concat: function concat(arg) {
  918. var O = toObject(this);
  919. var A = arraySpeciesCreate(O, 0);
  920. var n = 0;
  921. var i, k, length, len, E;
  922. for (i = -1, length = arguments.length; i < length; i++) {
  923. E = i === -1 ? O : arguments[i];
  924. if (isConcatSpreadable(E)) {
  925. len = toLength(E.length);
  926. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  927. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  928. } else {
  929. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  930. createProperty(A, n++, E);
  931. }
  932. }
  933. A.length = n;
  934. return A;
  935. }
  936. });
  937. // `Object.keys` method
  938. // https://tc39.es/ecma262/#sec-object.keys
  939. // eslint-disable-next-line es/no-object-keys -- safe
  940. var objectKeys = Object.keys || function keys(O) {
  941. return objectKeysInternal(O, enumBugKeys);
  942. };
  943. // `Object.defineProperties` method
  944. // https://tc39.es/ecma262/#sec-object.defineproperties
  945. // eslint-disable-next-line es/no-object-defineproperties -- safe
  946. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  947. anObject(O);
  948. var keys = objectKeys(Properties);
  949. var length = keys.length;
  950. var index = 0;
  951. var key;
  952. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  953. return O;
  954. };
  955. var html = getBuiltIn('document', 'documentElement');
  956. var GT = '>';
  957. var LT = '<';
  958. var PROTOTYPE = 'prototype';
  959. var SCRIPT = 'script';
  960. var IE_PROTO = sharedKey('IE_PROTO');
  961. var EmptyConstructor = function () { /* empty */ };
  962. var scriptTag = function (content) {
  963. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  964. };
  965. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  966. var NullProtoObjectViaActiveX = function (activeXDocument) {
  967. activeXDocument.write(scriptTag(''));
  968. activeXDocument.close();
  969. var temp = activeXDocument.parentWindow.Object;
  970. activeXDocument = null; // avoid memory leak
  971. return temp;
  972. };
  973. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  974. var NullProtoObjectViaIFrame = function () {
  975. // Thrash, waste and sodomy: IE GC bug
  976. var iframe = documentCreateElement('iframe');
  977. var JS = 'java' + SCRIPT + ':';
  978. var iframeDocument;
  979. iframe.style.display = 'none';
  980. html.appendChild(iframe);
  981. // https://github.com/zloirock/core-js/issues/475
  982. iframe.src = String(JS);
  983. iframeDocument = iframe.contentWindow.document;
  984. iframeDocument.open();
  985. iframeDocument.write(scriptTag('document.F=Object'));
  986. iframeDocument.close();
  987. return iframeDocument.F;
  988. };
  989. // Check for document.domain and active x support
  990. // No need to use active x approach when document.domain is not set
  991. // see https://github.com/es-shims/es5-shim/issues/150
  992. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  993. // avoid IE GC bug
  994. var activeXDocument;
  995. var NullProtoObject = function () {
  996. try {
  997. /* global ActiveXObject -- old IE */
  998. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  999. } catch (error) { /* ignore */ }
  1000. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1001. var length = enumBugKeys.length;
  1002. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1003. return NullProtoObject();
  1004. };
  1005. hiddenKeys$1[IE_PROTO] = true;
  1006. // `Object.create` method
  1007. // https://tc39.es/ecma262/#sec-object.create
  1008. var objectCreate = Object.create || function create(O, Properties) {
  1009. var result;
  1010. if (O !== null) {
  1011. EmptyConstructor[PROTOTYPE] = anObject(O);
  1012. result = new EmptyConstructor();
  1013. EmptyConstructor[PROTOTYPE] = null;
  1014. // add "__proto__" for Object.getPrototypeOf polyfill
  1015. result[IE_PROTO] = O;
  1016. } else result = NullProtoObject();
  1017. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1018. };
  1019. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1020. var ArrayPrototype = Array.prototype;
  1021. // Array.prototype[@@unscopables]
  1022. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1023. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1024. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1025. configurable: true,
  1026. value: objectCreate(null)
  1027. });
  1028. }
  1029. // add a key to Array.prototype[@@unscopables]
  1030. var addToUnscopables = function (key) {
  1031. ArrayPrototype[UNSCOPABLES][key] = true;
  1032. };
  1033. var $find = arrayIteration.find;
  1034. var FIND = 'find';
  1035. var SKIPS_HOLES = true;
  1036. // Shouldn't skip holes
  1037. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1038. // `Array.prototype.find` method
  1039. // https://tc39.es/ecma262/#sec-array.prototype.find
  1040. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1041. find: function find(callbackfn /* , that = undefined */) {
  1042. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1043. }
  1044. });
  1045. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1046. addToUnscopables(FIND);
  1047. var $filter = arrayIteration.filter;
  1048. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1049. // `Array.prototype.filter` method
  1050. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1051. // with adding support of @@species
  1052. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1053. filter: function filter(callbackfn /* , thisArg */) {
  1054. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1055. }
  1056. });
  1057. // eslint-disable-next-line es/no-object-assign -- safe
  1058. var $assign = Object.assign;
  1059. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1060. var defineProperty = Object.defineProperty;
  1061. // `Object.assign` method
  1062. // https://tc39.es/ecma262/#sec-object.assign
  1063. var objectAssign = !$assign || fails(function () {
  1064. // should have correct order of operations (Edge bug)
  1065. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1066. enumerable: true,
  1067. get: function () {
  1068. defineProperty(this, 'b', {
  1069. value: 3,
  1070. enumerable: false
  1071. });
  1072. }
  1073. }), { b: 2 })).b !== 1) return true;
  1074. // should work with symbols and should have deterministic property order (V8 bug)
  1075. var A = {};
  1076. var B = {};
  1077. // eslint-disable-next-line es/no-symbol -- safe
  1078. var symbol = Symbol();
  1079. var alphabet = 'abcdefghijklmnopqrst';
  1080. A[symbol] = 7;
  1081. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1082. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1083. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1084. var T = toObject(target);
  1085. var argumentsLength = arguments.length;
  1086. var index = 1;
  1087. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1088. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1089. while (argumentsLength > index) {
  1090. var S = indexedObject(arguments[index++]);
  1091. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  1092. var length = keys.length;
  1093. var j = 0;
  1094. var key;
  1095. while (length > j) {
  1096. key = keys[j++];
  1097. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  1098. }
  1099. } return T;
  1100. } : $assign;
  1101. // `Object.assign` method
  1102. // https://tc39.es/ecma262/#sec-object.assign
  1103. // eslint-disable-next-line es/no-object-assign -- required for testing
  1104. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  1105. assign: objectAssign
  1106. });
  1107. /**
  1108. * @author: Yura Knoxville
  1109. * @version: v1.1.0
  1110. */
  1111. var initBodyCaller;
  1112. var groupBy = function groupBy(array, f) {
  1113. var tmpGroups = {};
  1114. array.forEach(function (o) {
  1115. var groups = f(o);
  1116. tmpGroups[groups] = tmpGroups[groups] || [];
  1117. tmpGroups[groups].push(o);
  1118. });
  1119. return tmpGroups;
  1120. };
  1121. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1122. collapseGroup: {
  1123. bootstrap3: 'glyphicon-chevron-up',
  1124. bootstrap5: 'bi-chevron-up',
  1125. materialize: 'arrow_drop_down'
  1126. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-angle-up',
  1127. expandGroup: {
  1128. bootstrap3: 'glyphicon-chevron-down',
  1129. bootstrap5: 'bi-chevron-down',
  1130. materialize: 'arrow_drop_up'
  1131. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-angle-down'
  1132. });
  1133. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1134. groupBy: false,
  1135. groupByField: '',
  1136. groupByFormatter: undefined,
  1137. groupByToggle: false,
  1138. groupByShowToggleIcon: false,
  1139. groupByCollapsedGroups: []
  1140. });
  1141. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1142. var BootstrapTable = $__default['default'].fn.bootstrapTable.Constructor;
  1143. var _initSort = BootstrapTable.prototype.initSort;
  1144. var _initBody = BootstrapTable.prototype.initBody;
  1145. var _updateSelected = BootstrapTable.prototype.updateSelected;
  1146. BootstrapTable.prototype.initSort = function () {
  1147. var _this = this;
  1148. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1149. args[_key] = arguments[_key];
  1150. }
  1151. _initSort.apply(this, Array.prototype.slice.apply(args));
  1152. var that = this;
  1153. this.tableGroups = [];
  1154. if (this.options.groupBy && this.options.groupByField !== '') {
  1155. if (this.options.sortName !== this.options.groupByField) {
  1156. if (this.options.customSort) {
  1157. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  1158. } else {
  1159. this.options.data.sort(function (a, b) {
  1160. var groupByFields = _this.getGroupByFields();
  1161. var fieldValuesA = [];
  1162. var fieldValuesB = [];
  1163. $__default['default'].each(groupByFields, function (i, field) {
  1164. fieldValuesA.push(a[field]);
  1165. fieldValuesB.push(b[field]);
  1166. });
  1167. a = fieldValuesA.join();
  1168. b = fieldValuesB.join();
  1169. return a.localeCompare(b, undefined, {
  1170. numeric: true
  1171. });
  1172. });
  1173. }
  1174. }
  1175. var groups = groupBy(that.data, function (item) {
  1176. var groupByFields = _this.getGroupByFields();
  1177. var groupValues = [];
  1178. $__default['default'].each(groupByFields, function (i, field) {
  1179. groupValues.push(item[field]);
  1180. });
  1181. return groupValues.join(', ');
  1182. });
  1183. var index = 0;
  1184. $__default['default'].each(groups, function (key, value) {
  1185. _this.tableGroups.push({
  1186. id: index,
  1187. name: key,
  1188. data: value
  1189. });
  1190. value.forEach(function (item) {
  1191. if (!item._data) {
  1192. item._data = {};
  1193. }
  1194. if (_this.isCollapsed(key, value)) {
  1195. item._class += ' hidden';
  1196. }
  1197. item._data['parent-index'] = index;
  1198. });
  1199. index++;
  1200. });
  1201. }
  1202. };
  1203. BootstrapTable.prototype.initBody = function () {
  1204. var _this2 = this;
  1205. initBodyCaller = true;
  1206. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1207. args[_key2] = arguments[_key2];
  1208. }
  1209. _initBody.apply(this, Array.prototype.slice.apply(args));
  1210. if (this.options.groupBy && this.options.groupByField !== '') {
  1211. var that = this;
  1212. var checkBox = false;
  1213. var visibleColumns = 0;
  1214. this.columns.forEach(function (column) {
  1215. if (column.checkbox) {
  1216. checkBox = true;
  1217. } else if (column.visible) {
  1218. visibleColumns += 1;
  1219. }
  1220. });
  1221. if (this.options.detailView && !this.options.cardView) {
  1222. visibleColumns += 1;
  1223. }
  1224. this.tableGroups.forEach(function (item) {
  1225. var html = [];
  1226. html.push(Utils.sprintf('<tr class="info groupBy %s" data-group-index="%s">', _this2.options.groupByToggle ? 'expanded' : '', item.id));
  1227. if (that.options.detailView && !that.options.cardView) {
  1228. html.push('<td class="detail"></td>');
  1229. }
  1230. if (checkBox) {
  1231. html.push('<td class="bs-checkbox">', '<input name="btSelectGroup" type="checkbox" />', '</td>');
  1232. }
  1233. var formattedValue = item.name;
  1234. if (that.options.groupByFormatter !== undefined) {
  1235. formattedValue = Utils.calculateObjectValue(that.options, that.options.groupByFormatter, [item.name, item.id, item.data]);
  1236. }
  1237. html.push('<td', Utils.sprintf(' colspan="%s"', visibleColumns), '>', formattedValue);
  1238. var icon = _this2.options.icons.collapseGroup;
  1239. if (_this2.isCollapsed(item.name, item.data)) {
  1240. icon = _this2.options.icons.expandGroup;
  1241. }
  1242. if (_this2.options.groupByToggle && _this2.options.groupByShowToggleIcon) {
  1243. html.push("<span class=\"float-right ".concat(_this2.options.iconsPrefix, " ").concat(icon, "\"></span>"));
  1244. }
  1245. html.push('</td></tr>');
  1246. that.$body.find("tr[data-parent-index=".concat(item.id, "]:first")).before($__default['default'](html.join('')));
  1247. });
  1248. this.$selectGroup = [];
  1249. this.$body.find('[name="btSelectGroup"]').each(function () {
  1250. var self = $__default['default'](this);
  1251. that.$selectGroup.push({
  1252. group: self,
  1253. item: that.$selectItem.filter(function () {
  1254. return $__default['default'](this).closest('tr').data('parent-index') === self.closest('tr').data('group-index');
  1255. })
  1256. });
  1257. });
  1258. if (this.options.groupByToggle) {
  1259. this.$container.off('click', '.groupBy').on('click', '.groupBy', function () {
  1260. var $this = $__default['default'](this);
  1261. var groupIndex = $this.closest('tr').data('group-index');
  1262. var $groupRows = that.$body.find("tr[data-parent-index=".concat(groupIndex, "]"));
  1263. $this.toggleClass('expanded collapsed');
  1264. $this.find('span').toggleClass("".concat(that.options.icons.collapseGroup, " ").concat(that.options.icons.expandGroup));
  1265. $groupRows.toggleClass('hidden');
  1266. $groupRows.each(function (i, element) {
  1267. return that.collapseRow($__default['default'](element).data('index'));
  1268. });
  1269. });
  1270. }
  1271. this.$container.off('click', '[name="btSelectGroup"]').on('click', '[name="btSelectGroup"]', function (event) {
  1272. event.stopImmediatePropagation();
  1273. var self = $__default['default'](this);
  1274. var checked = self.prop('checked');
  1275. that[checked ? 'checkGroup' : 'uncheckGroup']($__default['default'](this).closest('tr').data('group-index'));
  1276. });
  1277. }
  1278. initBodyCaller = false;
  1279. this.updateSelected();
  1280. };
  1281. BootstrapTable.prototype.updateSelected = function () {
  1282. if (!initBodyCaller) {
  1283. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1284. args[_key3] = arguments[_key3];
  1285. }
  1286. _updateSelected.apply(this, Array.prototype.slice.apply(args));
  1287. if (this.options.groupBy && this.options.groupByField !== '') {
  1288. this.$selectGroup.forEach(function (item) {
  1289. var checkGroup = item.item.filter(':enabled').length === item.item.filter(':enabled').filter(':checked').length;
  1290. item.group.prop('checked', checkGroup);
  1291. });
  1292. }
  1293. }
  1294. };
  1295. BootstrapTable.prototype.checkGroup = function (index) {
  1296. this.checkGroup_(index, true);
  1297. };
  1298. BootstrapTable.prototype.uncheckGroup = function (index) {
  1299. this.checkGroup_(index, false);
  1300. };
  1301. BootstrapTable.prototype.isCollapsed = function (groupKey, items) {
  1302. if (this.options.groupByCollapsedGroups) {
  1303. var collapsedGroups = Utils.calculateObjectValue(this, this.options.groupByCollapsedGroups, [groupKey, items], true);
  1304. if ($__default['default'].inArray(groupKey, collapsedGroups) > -1) {
  1305. return true;
  1306. }
  1307. }
  1308. return false;
  1309. };
  1310. BootstrapTable.prototype.checkGroup_ = function (index, checked) {
  1311. var rowsBefore = this.getSelections();
  1312. var filter = function filter() {
  1313. return $__default['default'](this).closest('tr').data('parent-index') === index;
  1314. };
  1315. this.$selectItem.filter(filter).prop('checked', checked);
  1316. this.updateRows();
  1317. this.updateSelected();
  1318. var rowsAfter = this.getSelections();
  1319. if (checked) {
  1320. this.trigger('check-all', rowsAfter, rowsBefore);
  1321. return;
  1322. }
  1323. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  1324. };
  1325. BootstrapTable.prototype.getGroupByFields = function () {
  1326. var groupByFields = this.options.groupByField;
  1327. if (!$__default['default'].isArray(this.options.groupByField)) {
  1328. groupByFields = [this.options.groupByField];
  1329. }
  1330. return groupByFields;
  1331. };
  1332. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1333. _inherits(_class, _$$BootstrapTable);
  1334. var _super = _createSuper(_class);
  1335. function _class() {
  1336. _classCallCheck(this, _class);
  1337. return _super.apply(this, arguments);
  1338. }
  1339. _createClass(_class, [{
  1340. key: "scrollTo",
  1341. value: function scrollTo(params) {
  1342. if (this.options.groupBy) {
  1343. var options = {
  1344. unit: 'px',
  1345. value: 0
  1346. };
  1347. if (_typeof(params) === 'object') {
  1348. options = Object.assign(options, params);
  1349. }
  1350. if (options.unit === 'rows') {
  1351. var scrollTo = 0;
  1352. this.$body.find("> tr:not(.groupBy):lt(".concat(options.value, ")")).each(function (i, el) {
  1353. scrollTo += $__default['default'](el).outerHeight(true);
  1354. });
  1355. var $targetColumn = this.$body.find("> tr:not(.groupBy):eq(".concat(options.value, ")"));
  1356. $targetColumn.prevAll('.groupBy').each(function (i, el) {
  1357. scrollTo += $__default['default'](el).outerHeight(true);
  1358. });
  1359. this.$tableBody.scrollTop(scrollTo);
  1360. return;
  1361. }
  1362. }
  1363. _get(_getPrototypeOf(_class.prototype), "scrollTo", this).call(this, params);
  1364. }
  1365. }]);
  1366. return _class;
  1367. }($__default['default'].BootstrapTable);
  1368. })));