bootstrap-table-group-by.js 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091
  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. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. function _classCallCheck(instance, Constructor) {
  17. if (!(instance instanceof Constructor)) {
  18. throw new TypeError("Cannot call a class as a function");
  19. }
  20. }
  21. function _defineProperties(target, props) {
  22. for (var i = 0; i < props.length; i++) {
  23. var descriptor = props[i];
  24. descriptor.enumerable = descriptor.enumerable || false;
  25. descriptor.configurable = true;
  26. if ("value" in descriptor) descriptor.writable = true;
  27. Object.defineProperty(target, descriptor.key, descriptor);
  28. }
  29. }
  30. function _createClass(Constructor, protoProps, staticProps) {
  31. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  32. if (staticProps) _defineProperties(Constructor, staticProps);
  33. Object.defineProperty(Constructor, "prototype", {
  34. writable: false
  35. });
  36. return Constructor;
  37. }
  38. function _inherits(subClass, superClass) {
  39. if (typeof superClass !== "function" && superClass !== null) {
  40. throw new TypeError("Super expression must either be null or a function");
  41. }
  42. subClass.prototype = Object.create(superClass && superClass.prototype, {
  43. constructor: {
  44. value: subClass,
  45. writable: true,
  46. configurable: true
  47. }
  48. });
  49. Object.defineProperty(subClass, "prototype", {
  50. writable: false
  51. });
  52. if (superClass) _setPrototypeOf(subClass, superClass);
  53. }
  54. function _getPrototypeOf(o) {
  55. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  56. return o.__proto__ || Object.getPrototypeOf(o);
  57. };
  58. return _getPrototypeOf(o);
  59. }
  60. function _setPrototypeOf(o, p) {
  61. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  62. o.__proto__ = p;
  63. return o;
  64. };
  65. return _setPrototypeOf(o, p);
  66. }
  67. function _isNativeReflectConstruct() {
  68. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  69. if (Reflect.construct.sham) return false;
  70. if (typeof Proxy === "function") return true;
  71. try {
  72. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  73. return true;
  74. } catch (e) {
  75. return false;
  76. }
  77. }
  78. function _assertThisInitialized(self) {
  79. if (self === void 0) {
  80. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  81. }
  82. return self;
  83. }
  84. function _possibleConstructorReturn(self, call) {
  85. if (call && (typeof call === "object" || typeof call === "function")) {
  86. return call;
  87. } else if (call !== void 0) {
  88. throw new TypeError("Derived constructors may only return object or undefined");
  89. }
  90. return _assertThisInitialized(self);
  91. }
  92. function _createSuper(Derived) {
  93. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  94. return function _createSuperInternal() {
  95. var Super = _getPrototypeOf(Derived),
  96. result;
  97. if (hasNativeReflectConstruct) {
  98. var NewTarget = _getPrototypeOf(this).constructor;
  99. result = Reflect.construct(Super, arguments, NewTarget);
  100. } else {
  101. result = Super.apply(this, arguments);
  102. }
  103. return _possibleConstructorReturn(this, result);
  104. };
  105. }
  106. function _superPropBase(object, property) {
  107. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  108. object = _getPrototypeOf(object);
  109. if (object === null) break;
  110. }
  111. return object;
  112. }
  113. function _get() {
  114. if (typeof Reflect !== "undefined" && Reflect.get) {
  115. _get = Reflect.get;
  116. } else {
  117. _get = function _get(target, property, receiver) {
  118. var base = _superPropBase(target, property);
  119. if (!base) return;
  120. var desc = Object.getOwnPropertyDescriptor(base, property);
  121. if (desc.get) {
  122. return desc.get.call(arguments.length < 3 ? target : receiver);
  123. }
  124. return desc.value;
  125. };
  126. }
  127. return _get.apply(this, arguments);
  128. }
  129. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  130. function createCommonjsModule(fn, module) {
  131. return module = { exports: {} }, fn(module, module.exports), module.exports;
  132. }
  133. var check = function (it) {
  134. return it && it.Math == Math && it;
  135. };
  136. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  137. var global_1 =
  138. // eslint-disable-next-line es-x/no-global-this -- safe
  139. check(typeof globalThis == 'object' && globalThis) ||
  140. check(typeof window == 'object' && window) ||
  141. // eslint-disable-next-line no-restricted-globals -- safe
  142. check(typeof self == 'object' && self) ||
  143. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  144. // eslint-disable-next-line no-new-func -- fallback
  145. (function () { return this; })() || Function('return this')();
  146. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  147. var defineProperty$2 = Object.defineProperty;
  148. var setGlobal = function (key, value) {
  149. try {
  150. defineProperty$2(global_1, key, { value: value, configurable: true, writable: true });
  151. } catch (error) {
  152. global_1[key] = value;
  153. } return value;
  154. };
  155. var SHARED = '__core-js_shared__';
  156. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  157. var sharedStore = store$1;
  158. var shared = createCommonjsModule(function (module) {
  159. (module.exports = function (key, value) {
  160. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  161. })('versions', []).push({
  162. version: '3.22.4',
  163. mode: 'global',
  164. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  165. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  166. source: 'https://github.com/zloirock/core-js'
  167. });
  168. });
  169. var fails = function (exec) {
  170. try {
  171. return !!exec();
  172. } catch (error) {
  173. return true;
  174. }
  175. };
  176. var functionBindNative = !fails(function () {
  177. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  178. var test = (function () { /* empty */ }).bind();
  179. // eslint-disable-next-line no-prototype-builtins -- safe
  180. return typeof test != 'function' || test.hasOwnProperty('prototype');
  181. });
  182. var FunctionPrototype$2 = Function.prototype;
  183. var bind$1 = FunctionPrototype$2.bind;
  184. var call$1 = FunctionPrototype$2.call;
  185. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  186. var functionUncurryThis = functionBindNative ? function (fn) {
  187. return fn && uncurryThis(fn);
  188. } : function (fn) {
  189. return fn && function () {
  190. return call$1.apply(fn, arguments);
  191. };
  192. };
  193. var TypeError$8 = global_1.TypeError;
  194. // `RequireObjectCoercible` abstract operation
  195. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  196. var requireObjectCoercible = function (it) {
  197. if (it == undefined) throw TypeError$8("Can't call method on " + it);
  198. return it;
  199. };
  200. var Object$4 = global_1.Object;
  201. // `ToObject` abstract operation
  202. // https://tc39.es/ecma262/#sec-toobject
  203. var toObject = function (argument) {
  204. return Object$4(requireObjectCoercible(argument));
  205. };
  206. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  207. // `HasOwnProperty` abstract operation
  208. // https://tc39.es/ecma262/#sec-hasownproperty
  209. // eslint-disable-next-line es-x/no-object-hasown -- safe
  210. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  211. return hasOwnProperty(toObject(it), key);
  212. };
  213. var id = 0;
  214. var postfix = Math.random();
  215. var toString$1 = functionUncurryThis(1.0.toString);
  216. var uid = function (key) {
  217. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
  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 aFunction = function (argument) {
  225. return isCallable(argument) ? argument : undefined;
  226. };
  227. var getBuiltIn = function (namespace, method) {
  228. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  229. };
  230. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  231. var process = global_1.process;
  232. var Deno = global_1.Deno;
  233. var versions = process && process.versions || Deno && Deno.version;
  234. var v8 = versions && versions.v8;
  235. var match, version;
  236. if (v8) {
  237. match = v8.split('.');
  238. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  239. // but their correct versions are not interesting for us
  240. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  241. }
  242. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  243. // so check `userAgent` even if `.v8` exists, but 0
  244. if (!version && engineUserAgent) {
  245. match = engineUserAgent.match(/Edge\/(\d+)/);
  246. if (!match || match[1] >= 74) {
  247. match = engineUserAgent.match(/Chrome\/(\d+)/);
  248. if (match) version = +match[1];
  249. }
  250. }
  251. var engineV8Version = version;
  252. /* eslint-disable es-x/no-symbol -- required for testing */
  253. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  254. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  255. var symbol = Symbol();
  256. // Chrome 38 Symbol has incorrect toString conversion
  257. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  258. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  259. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  260. !Symbol.sham && engineV8Version && engineV8Version < 41;
  261. });
  262. /* eslint-disable es-x/no-symbol -- required for testing */
  263. var useSymbolAsUid = nativeSymbol
  264. && !Symbol.sham
  265. && typeof Symbol.iterator == 'symbol';
  266. var WellKnownSymbolsStore = shared('wks');
  267. var Symbol$1 = global_1.Symbol;
  268. var symbolFor = Symbol$1 && Symbol$1['for'];
  269. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  270. var wellKnownSymbol = function (name) {
  271. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  272. var description = 'Symbol.' + name;
  273. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  274. WellKnownSymbolsStore[name] = Symbol$1[name];
  275. } else if (useSymbolAsUid && symbolFor) {
  276. WellKnownSymbolsStore[name] = symbolFor(description);
  277. } else {
  278. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  279. }
  280. } return WellKnownSymbolsStore[name];
  281. };
  282. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  283. var test$1 = {};
  284. test$1[TO_STRING_TAG$1] = 'z';
  285. var toStringTagSupport = String(test$1) === '[object z]';
  286. // Detect IE8's incomplete defineProperty implementation
  287. var descriptors = !fails(function () {
  288. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  289. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  290. });
  291. var isObject = function (it) {
  292. return typeof it == 'object' ? it !== null : isCallable(it);
  293. };
  294. var document$1 = global_1.document;
  295. // typeof document.createElement is 'object' in old IE
  296. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  297. var documentCreateElement = function (it) {
  298. return EXISTS$1 ? document$1.createElement(it) : {};
  299. };
  300. // Thanks to IE8 for its funny defineProperty
  301. var ie8DomDefine = !descriptors && !fails(function () {
  302. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  303. return Object.defineProperty(documentCreateElement('div'), 'a', {
  304. get: function () { return 7; }
  305. }).a != 7;
  306. });
  307. // V8 ~ Chrome 36-
  308. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  309. var v8PrototypeDefineBug = descriptors && fails(function () {
  310. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  311. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  312. value: 42,
  313. writable: false
  314. }).prototype != 42;
  315. });
  316. var String$3 = global_1.String;
  317. var TypeError$7 = global_1.TypeError;
  318. // `Assert: Type(argument) is Object`
  319. var anObject = function (argument) {
  320. if (isObject(argument)) return argument;
  321. throw TypeError$7(String$3(argument) + ' is not an object');
  322. };
  323. var call = Function.prototype.call;
  324. var functionCall = functionBindNative ? call.bind(call) : function () {
  325. return call.apply(call, arguments);
  326. };
  327. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  328. var Object$3 = global_1.Object;
  329. var isSymbol = useSymbolAsUid ? function (it) {
  330. return typeof it == 'symbol';
  331. } : function (it) {
  332. var $Symbol = getBuiltIn('Symbol');
  333. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  334. };
  335. var String$2 = global_1.String;
  336. var tryToString = function (argument) {
  337. try {
  338. return String$2(argument);
  339. } catch (error) {
  340. return 'Object';
  341. }
  342. };
  343. var TypeError$6 = global_1.TypeError;
  344. // `Assert: IsCallable(argument) is true`
  345. var aCallable = function (argument) {
  346. if (isCallable(argument)) return argument;
  347. throw TypeError$6(tryToString(argument) + ' is not a function');
  348. };
  349. // `GetMethod` abstract operation
  350. // https://tc39.es/ecma262/#sec-getmethod
  351. var getMethod = function (V, P) {
  352. var func = V[P];
  353. return func == null ? undefined : aCallable(func);
  354. };
  355. var TypeError$5 = global_1.TypeError;
  356. // `OrdinaryToPrimitive` abstract operation
  357. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  358. var ordinaryToPrimitive = function (input, pref) {
  359. var fn, val;
  360. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  361. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  362. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  363. throw TypeError$5("Can't convert object to primitive value");
  364. };
  365. var TypeError$4 = 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$4("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 TypeError$3 = global_1.TypeError;
  389. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  390. var $defineProperty = Object.defineProperty;
  391. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  392. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  393. var ENUMERABLE = 'enumerable';
  394. var CONFIGURABLE$1 = 'configurable';
  395. var WRITABLE = 'writable';
  396. // `Object.defineProperty` method
  397. // https://tc39.es/ecma262/#sec-object.defineproperty
  398. var f$5 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  399. anObject(O);
  400. P = toPropertyKey(P);
  401. anObject(Attributes);
  402. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  403. var current = $getOwnPropertyDescriptor$1(O, P);
  404. if (current && current[WRITABLE]) {
  405. O[P] = Attributes.value;
  406. Attributes = {
  407. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  408. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  409. writable: false
  410. };
  411. }
  412. } return $defineProperty(O, P, Attributes);
  413. } : $defineProperty : function defineProperty(O, P, Attributes) {
  414. anObject(O);
  415. P = toPropertyKey(P);
  416. anObject(Attributes);
  417. if (ie8DomDefine) try {
  418. return $defineProperty(O, P, Attributes);
  419. } catch (error) { /* empty */ }
  420. if ('get' in Attributes || 'set' in Attributes) throw TypeError$3('Accessors not supported');
  421. if ('value' in Attributes) O[P] = Attributes.value;
  422. return O;
  423. };
  424. var objectDefineProperty = {
  425. f: f$5
  426. };
  427. var createPropertyDescriptor = function (bitmap, value) {
  428. return {
  429. enumerable: !(bitmap & 1),
  430. configurable: !(bitmap & 2),
  431. writable: !(bitmap & 4),
  432. value: value
  433. };
  434. };
  435. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  436. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  437. } : function (object, key, value) {
  438. object[key] = value;
  439. return object;
  440. };
  441. var FunctionPrototype$1 = Function.prototype;
  442. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  443. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  444. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  445. // additional protection from minified / mangled / dropped function names
  446. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  447. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  448. var functionName = {
  449. EXISTS: EXISTS,
  450. PROPER: PROPER,
  451. CONFIGURABLE: CONFIGURABLE
  452. };
  453. var functionToString$1 = functionUncurryThis(Function.toString);
  454. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  455. if (!isCallable(sharedStore.inspectSource)) {
  456. sharedStore.inspectSource = function (it) {
  457. return functionToString$1(it);
  458. };
  459. }
  460. var inspectSource = sharedStore.inspectSource;
  461. var WeakMap$1 = global_1.WeakMap;
  462. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  463. var keys = shared('keys');
  464. var sharedKey = function (key) {
  465. return keys[key] || (keys[key] = uid(key));
  466. };
  467. var hiddenKeys$1 = {};
  468. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  469. var TypeError$2 = global_1.TypeError;
  470. var WeakMap = global_1.WeakMap;
  471. var set, get, has;
  472. var enforce = function (it) {
  473. return has(it) ? get(it) : set(it, {});
  474. };
  475. var getterFor = function (TYPE) {
  476. return function (it) {
  477. var state;
  478. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  479. throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  480. } return state;
  481. };
  482. };
  483. if (nativeWeakMap || sharedStore.state) {
  484. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  485. var wmget = functionUncurryThis(store.get);
  486. var wmhas = functionUncurryThis(store.has);
  487. var wmset = functionUncurryThis(store.set);
  488. set = function (it, metadata) {
  489. if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  490. metadata.facade = it;
  491. wmset(store, it, metadata);
  492. return metadata;
  493. };
  494. get = function (it) {
  495. return wmget(store, it) || {};
  496. };
  497. has = function (it) {
  498. return wmhas(store, it);
  499. };
  500. } else {
  501. var STATE = sharedKey('state');
  502. hiddenKeys$1[STATE] = true;
  503. set = function (it, metadata) {
  504. if (hasOwnProperty_1(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  505. metadata.facade = it;
  506. createNonEnumerableProperty(it, STATE, metadata);
  507. return metadata;
  508. };
  509. get = function (it) {
  510. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  511. };
  512. has = function (it) {
  513. return hasOwnProperty_1(it, STATE);
  514. };
  515. }
  516. var internalState = {
  517. set: set,
  518. get: get,
  519. has: has,
  520. enforce: enforce,
  521. getterFor: getterFor
  522. };
  523. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  524. var defineProperty = objectDefineProperty.f;
  525. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  526. var enforceInternalState = internalState.enforce;
  527. var getInternalState = internalState.get;
  528. var CONFIGURABLE_LENGTH = !fails(function () {
  529. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  530. });
  531. var TEMPLATE = String(String).split('String');
  532. var makeBuiltIn = module.exports = function (value, name, options) {
  533. if (String(name).slice(0, 7) === 'Symbol(') {
  534. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  535. }
  536. if (options && options.getter) name = 'get ' + name;
  537. if (options && options.setter) name = 'set ' + name;
  538. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  539. defineProperty(value, 'name', { value: name, configurable: true });
  540. }
  541. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  542. defineProperty(value, 'length', { value: options.arity });
  543. }
  544. var state = enforceInternalState(value);
  545. if (!hasOwnProperty_1(state, 'source')) {
  546. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  547. } return value;
  548. };
  549. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  550. // eslint-disable-next-line no-extend-native -- required
  551. Function.prototype.toString = makeBuiltIn(function toString() {
  552. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  553. }, 'toString');
  554. });
  555. var defineBuiltIn = function (O, key, value, options) {
  556. var unsafe = options ? !!options.unsafe : false;
  557. var simple = options ? !!options.enumerable : false;
  558. var noTargetGet = options ? !!options.noTargetGet : false;
  559. var name = options && options.name !== undefined ? options.name : key;
  560. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  561. if (O === global_1) {
  562. if (simple) O[key] = value;
  563. else setGlobal(key, value);
  564. return O;
  565. } else if (!unsafe) {
  566. delete O[key];
  567. } else if (!noTargetGet && O[key]) {
  568. simple = true;
  569. }
  570. if (simple) O[key] = value;
  571. else createNonEnumerableProperty(O, key, value);
  572. return O;
  573. };
  574. var toString = functionUncurryThis({}.toString);
  575. var stringSlice = functionUncurryThis(''.slice);
  576. var classofRaw = function (it) {
  577. return stringSlice(toString(it), 8, -1);
  578. };
  579. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  580. var Object$2 = global_1.Object;
  581. // ES3 wrong here
  582. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  583. // fallback for IE11 Script Access Denied error
  584. var tryGet = function (it, key) {
  585. try {
  586. return it[key];
  587. } catch (error) { /* empty */ }
  588. };
  589. // getting tag from ES6+ `Object.prototype.toString`
  590. var classof = toStringTagSupport ? classofRaw : function (it) {
  591. var O, tag, result;
  592. return it === undefined ? 'Undefined' : it === null ? 'Null'
  593. // @@toStringTag case
  594. : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG)) == 'string' ? tag
  595. // builtinTag case
  596. : CORRECT_ARGUMENTS ? classofRaw(O)
  597. // ES3 arguments fallback
  598. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  599. };
  600. // `Object.prototype.toString` method implementation
  601. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  602. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  603. return '[object ' + classof(this) + ']';
  604. };
  605. // `Object.prototype.toString` method
  606. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  607. if (!toStringTagSupport) {
  608. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  609. }
  610. // iterable DOM collections
  611. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  612. var domIterables = {
  613. CSSRuleList: 0,
  614. CSSStyleDeclaration: 0,
  615. CSSValueList: 0,
  616. ClientRectList: 0,
  617. DOMRectList: 0,
  618. DOMStringList: 0,
  619. DOMTokenList: 1,
  620. DataTransferItemList: 0,
  621. FileList: 0,
  622. HTMLAllCollection: 0,
  623. HTMLCollection: 0,
  624. HTMLFormElement: 0,
  625. HTMLSelectElement: 0,
  626. MediaList: 0,
  627. MimeTypeArray: 0,
  628. NamedNodeMap: 0,
  629. NodeList: 1,
  630. PaintRequestList: 0,
  631. Plugin: 0,
  632. PluginArray: 0,
  633. SVGLengthList: 0,
  634. SVGNumberList: 0,
  635. SVGPathSegList: 0,
  636. SVGPointList: 0,
  637. SVGStringList: 0,
  638. SVGTransformList: 0,
  639. SourceBufferList: 0,
  640. StyleSheetList: 0,
  641. TextTrackCueList: 0,
  642. TextTrackList: 0,
  643. TouchList: 0
  644. };
  645. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  646. var classList = documentCreateElement('span').classList;
  647. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  648. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  649. var bind = functionUncurryThis(functionUncurryThis.bind);
  650. // optional / simple context binding
  651. var functionBindContext = function (fn, that) {
  652. aCallable(fn);
  653. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  654. return fn.apply(that, arguments);
  655. };
  656. };
  657. var Object$1 = global_1.Object;
  658. var split = functionUncurryThis(''.split);
  659. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  660. var indexedObject = fails(function () {
  661. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  662. // eslint-disable-next-line no-prototype-builtins -- safe
  663. return !Object$1('z').propertyIsEnumerable(0);
  664. }) ? function (it) {
  665. return classofRaw(it) == 'String' ? split(it, '') : Object$1(it);
  666. } : Object$1;
  667. var ceil = Math.ceil;
  668. var floor$1 = Math.floor;
  669. // `ToIntegerOrInfinity` abstract operation
  670. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  671. var toIntegerOrInfinity = function (argument) {
  672. var number = +argument;
  673. // eslint-disable-next-line no-self-compare -- safe
  674. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  675. };
  676. var min$1 = Math.min;
  677. // `ToLength` abstract operation
  678. // https://tc39.es/ecma262/#sec-tolength
  679. var toLength = function (argument) {
  680. return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  681. };
  682. // `LengthOfArrayLike` abstract operation
  683. // https://tc39.es/ecma262/#sec-lengthofarraylike
  684. var lengthOfArrayLike = function (obj) {
  685. return toLength(obj.length);
  686. };
  687. // `IsArray` abstract operation
  688. // https://tc39.es/ecma262/#sec-isarray
  689. // eslint-disable-next-line es-x/no-array-isarray -- safe
  690. var isArray = Array.isArray || function isArray(argument) {
  691. return classofRaw(argument) == 'Array';
  692. };
  693. var noop = function () { /* empty */ };
  694. var empty = [];
  695. var construct = getBuiltIn('Reflect', 'construct');
  696. var constructorRegExp = /^\s*(?:class|function)\b/;
  697. var exec = functionUncurryThis(constructorRegExp.exec);
  698. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  699. var isConstructorModern = function isConstructor(argument) {
  700. if (!isCallable(argument)) return false;
  701. try {
  702. construct(noop, empty, argument);
  703. return true;
  704. } catch (error) {
  705. return false;
  706. }
  707. };
  708. var isConstructorLegacy = function isConstructor(argument) {
  709. if (!isCallable(argument)) return false;
  710. switch (classof(argument)) {
  711. case 'AsyncFunction':
  712. case 'GeneratorFunction':
  713. case 'AsyncGeneratorFunction': return false;
  714. }
  715. try {
  716. // we can't check .prototype since constructors produced by .bind haven't it
  717. // `Function#toString` throws on some built-it function in some legacy engines
  718. // (for example, `DOMQuad` and similar in FF41-)
  719. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  720. } catch (error) {
  721. return true;
  722. }
  723. };
  724. isConstructorLegacy.sham = true;
  725. // `IsConstructor` abstract operation
  726. // https://tc39.es/ecma262/#sec-isconstructor
  727. var isConstructor = !construct || fails(function () {
  728. var called;
  729. return isConstructorModern(isConstructorModern.call)
  730. || !isConstructorModern(Object)
  731. || !isConstructorModern(function () { called = true; })
  732. || called;
  733. }) ? isConstructorLegacy : isConstructorModern;
  734. var SPECIES$2 = wellKnownSymbol('species');
  735. var Array$3 = global_1.Array;
  736. // a part of `ArraySpeciesCreate` abstract operation
  737. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  738. var arraySpeciesConstructor = function (originalArray) {
  739. var C;
  740. if (isArray(originalArray)) {
  741. C = originalArray.constructor;
  742. // cross-realm fallback
  743. if (isConstructor(C) && (C === Array$3 || isArray(C.prototype))) C = undefined;
  744. else if (isObject(C)) {
  745. C = C[SPECIES$2];
  746. if (C === null) C = undefined;
  747. }
  748. } return C === undefined ? Array$3 : C;
  749. };
  750. // `ArraySpeciesCreate` abstract operation
  751. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  752. var arraySpeciesCreate = function (originalArray, length) {
  753. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  754. };
  755. var push$2 = functionUncurryThis([].push);
  756. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  757. var createMethod$1 = function (TYPE) {
  758. var IS_MAP = TYPE == 1;
  759. var IS_FILTER = TYPE == 2;
  760. var IS_SOME = TYPE == 3;
  761. var IS_EVERY = TYPE == 4;
  762. var IS_FIND_INDEX = TYPE == 6;
  763. var IS_FILTER_REJECT = TYPE == 7;
  764. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  765. return function ($this, callbackfn, that, specificCreate) {
  766. var O = toObject($this);
  767. var self = indexedObject(O);
  768. var boundFunction = functionBindContext(callbackfn, that);
  769. var length = lengthOfArrayLike(self);
  770. var index = 0;
  771. var create = specificCreate || arraySpeciesCreate;
  772. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  773. var value, result;
  774. for (;length > index; index++) if (NO_HOLES || index in self) {
  775. value = self[index];
  776. result = boundFunction(value, index, O);
  777. if (TYPE) {
  778. if (IS_MAP) target[index] = result; // map
  779. else if (result) switch (TYPE) {
  780. case 3: return true; // some
  781. case 5: return value; // find
  782. case 6: return index; // findIndex
  783. case 2: push$2(target, value); // filter
  784. } else switch (TYPE) {
  785. case 4: return false; // every
  786. case 7: push$2(target, value); // filterReject
  787. }
  788. }
  789. }
  790. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  791. };
  792. };
  793. var arrayIteration = {
  794. // `Array.prototype.forEach` method
  795. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  796. forEach: createMethod$1(0),
  797. // `Array.prototype.map` method
  798. // https://tc39.es/ecma262/#sec-array.prototype.map
  799. map: createMethod$1(1),
  800. // `Array.prototype.filter` method
  801. // https://tc39.es/ecma262/#sec-array.prototype.filter
  802. filter: createMethod$1(2),
  803. // `Array.prototype.some` method
  804. // https://tc39.es/ecma262/#sec-array.prototype.some
  805. some: createMethod$1(3),
  806. // `Array.prototype.every` method
  807. // https://tc39.es/ecma262/#sec-array.prototype.every
  808. every: createMethod$1(4),
  809. // `Array.prototype.find` method
  810. // https://tc39.es/ecma262/#sec-array.prototype.find
  811. find: createMethod$1(5),
  812. // `Array.prototype.findIndex` method
  813. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  814. findIndex: createMethod$1(6),
  815. // `Array.prototype.filterReject` method
  816. // https://github.com/tc39/proposal-array-filtering
  817. filterReject: createMethod$1(7)
  818. };
  819. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  820. var method = [][METHOD_NAME];
  821. return !!method && fails(function () {
  822. // eslint-disable-next-line no-useless-call -- required for testing
  823. method.call(null, argument || function () { return 1; }, 1);
  824. });
  825. };
  826. var $forEach = arrayIteration.forEach;
  827. var STRICT_METHOD$2 = arrayMethodIsStrict('forEach');
  828. // `Array.prototype.forEach` method implementation
  829. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  830. var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
  831. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  832. // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
  833. } : [].forEach;
  834. var handlePrototype = function (CollectionPrototype) {
  835. // some Chrome versions have non-configurable methods on DOMTokenList
  836. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  837. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  838. } catch (error) {
  839. CollectionPrototype.forEach = arrayForEach;
  840. }
  841. };
  842. for (var COLLECTION_NAME in domIterables) {
  843. if (domIterables[COLLECTION_NAME]) {
  844. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  845. }
  846. }
  847. handlePrototype(domTokenListPrototype);
  848. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  849. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  850. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  851. // Nashorn ~ JDK8 bug
  852. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  853. // `Object.prototype.propertyIsEnumerable` method implementation
  854. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  855. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  856. var descriptor = getOwnPropertyDescriptor$1(this, V);
  857. return !!descriptor && descriptor.enumerable;
  858. } : $propertyIsEnumerable;
  859. var objectPropertyIsEnumerable = {
  860. f: f$4
  861. };
  862. // toObject with fallback for non-array-like ES3 strings
  863. var toIndexedObject = function (it) {
  864. return indexedObject(requireObjectCoercible(it));
  865. };
  866. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  867. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  868. // `Object.getOwnPropertyDescriptor` method
  869. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  870. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  871. O = toIndexedObject(O);
  872. P = toPropertyKey(P);
  873. if (ie8DomDefine) try {
  874. return $getOwnPropertyDescriptor(O, P);
  875. } catch (error) { /* empty */ }
  876. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  877. };
  878. var objectGetOwnPropertyDescriptor = {
  879. f: f$3
  880. };
  881. var max$2 = Math.max;
  882. var min = Math.min;
  883. // Helper for a popular repeating case of the spec:
  884. // Let integer be ? ToInteger(index).
  885. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  886. var toAbsoluteIndex = function (index, length) {
  887. var integer = toIntegerOrInfinity(index);
  888. return integer < 0 ? max$2(integer + length, 0) : min(integer, length);
  889. };
  890. // `Array.prototype.{ indexOf, includes }` methods implementation
  891. var createMethod = function (IS_INCLUDES) {
  892. return function ($this, el, fromIndex) {
  893. var O = toIndexedObject($this);
  894. var length = lengthOfArrayLike(O);
  895. var index = toAbsoluteIndex(fromIndex, length);
  896. var value;
  897. // Array#includes uses SameValueZero equality algorithm
  898. // eslint-disable-next-line no-self-compare -- NaN check
  899. if (IS_INCLUDES && el != el) while (length > index) {
  900. value = O[index++];
  901. // eslint-disable-next-line no-self-compare -- NaN check
  902. if (value != value) return true;
  903. // Array#indexOf ignores holes, Array#includes - not
  904. } else for (;length > index; index++) {
  905. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  906. } return !IS_INCLUDES && -1;
  907. };
  908. };
  909. var arrayIncludes = {
  910. // `Array.prototype.includes` method
  911. // https://tc39.es/ecma262/#sec-array.prototype.includes
  912. includes: createMethod(true),
  913. // `Array.prototype.indexOf` method
  914. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  915. indexOf: createMethod(false)
  916. };
  917. var indexOf = arrayIncludes.indexOf;
  918. var push$1 = functionUncurryThis([].push);
  919. var objectKeysInternal = function (object, names) {
  920. var O = toIndexedObject(object);
  921. var i = 0;
  922. var result = [];
  923. var key;
  924. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
  925. // Don't enum bug & hidden keys
  926. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  927. ~indexOf(result, key) || push$1(result, key);
  928. }
  929. return result;
  930. };
  931. // IE8- don't enum bug keys
  932. var enumBugKeys = [
  933. 'constructor',
  934. 'hasOwnProperty',
  935. 'isPrototypeOf',
  936. 'propertyIsEnumerable',
  937. 'toLocaleString',
  938. 'toString',
  939. 'valueOf'
  940. ];
  941. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  942. // `Object.getOwnPropertyNames` method
  943. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  944. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  945. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  946. return objectKeysInternal(O, hiddenKeys);
  947. };
  948. var objectGetOwnPropertyNames = {
  949. f: f$2
  950. };
  951. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  952. var f$1 = Object.getOwnPropertySymbols;
  953. var objectGetOwnPropertySymbols = {
  954. f: f$1
  955. };
  956. var concat$1 = functionUncurryThis([].concat);
  957. // all object keys, includes non-enumerable and symbols
  958. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  959. var keys = objectGetOwnPropertyNames.f(anObject(it));
  960. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  961. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  962. };
  963. var copyConstructorProperties = function (target, source, exceptions) {
  964. var keys = ownKeys(source);
  965. var defineProperty = objectDefineProperty.f;
  966. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  967. for (var i = 0; i < keys.length; i++) {
  968. var key = keys[i];
  969. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  970. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  971. }
  972. }
  973. };
  974. var replacement = /#|\.prototype\./;
  975. var isForced = function (feature, detection) {
  976. var value = data[normalize(feature)];
  977. return value == POLYFILL ? true
  978. : value == NATIVE ? false
  979. : isCallable(detection) ? fails(detection)
  980. : !!detection;
  981. };
  982. var normalize = isForced.normalize = function (string) {
  983. return String(string).replace(replacement, '.').toLowerCase();
  984. };
  985. var data = isForced.data = {};
  986. var NATIVE = isForced.NATIVE = 'N';
  987. var POLYFILL = isForced.POLYFILL = 'P';
  988. var isForced_1 = isForced;
  989. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  990. /*
  991. options.target - name of the target object
  992. options.global - target is the global object
  993. options.stat - export as static methods of target
  994. options.proto - export as prototype methods of target
  995. options.real - real prototype method for the `pure` version
  996. options.forced - export even if the native feature is available
  997. options.bind - bind methods to the target, required for the `pure` version
  998. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  999. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  1000. options.sham - add a flag to not completely full polyfills
  1001. options.enumerable - export as enumerable property
  1002. options.noTargetGet - prevent calling a getter on target
  1003. options.name - the .name of the function if it does not match the key
  1004. */
  1005. var _export = function (options, source) {
  1006. var TARGET = options.target;
  1007. var GLOBAL = options.global;
  1008. var STATIC = options.stat;
  1009. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  1010. if (GLOBAL) {
  1011. target = global_1;
  1012. } else if (STATIC) {
  1013. target = global_1[TARGET] || setGlobal(TARGET, {});
  1014. } else {
  1015. target = (global_1[TARGET] || {}).prototype;
  1016. }
  1017. if (target) for (key in source) {
  1018. sourceProperty = source[key];
  1019. if (options.noTargetGet) {
  1020. descriptor = getOwnPropertyDescriptor(target, key);
  1021. targetProperty = descriptor && descriptor.value;
  1022. } else targetProperty = target[key];
  1023. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  1024. // contained in target
  1025. if (!FORCED && targetProperty !== undefined) {
  1026. if (typeof sourceProperty == typeof targetProperty) continue;
  1027. copyConstructorProperties(sourceProperty, targetProperty);
  1028. }
  1029. // add a flag to not completely full polyfills
  1030. if (options.sham || (targetProperty && targetProperty.sham)) {
  1031. createNonEnumerableProperty(sourceProperty, 'sham', true);
  1032. }
  1033. defineBuiltIn(target, key, sourceProperty, options);
  1034. }
  1035. };
  1036. var createProperty = function (object, key, value) {
  1037. var propertyKey = toPropertyKey(key);
  1038. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1039. else object[propertyKey] = value;
  1040. };
  1041. var SPECIES$1 = wellKnownSymbol('species');
  1042. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1043. // We can't use this feature detection in V8 since it causes
  1044. // deoptimization and serious performance degradation
  1045. // https://github.com/zloirock/core-js/issues/677
  1046. return engineV8Version >= 51 || !fails(function () {
  1047. var array = [];
  1048. var constructor = array.constructor = {};
  1049. constructor[SPECIES$1] = function () {
  1050. return { foo: 1 };
  1051. };
  1052. return array[METHOD_NAME](Boolean).foo !== 1;
  1053. });
  1054. };
  1055. var arraySlice = functionUncurryThis([].slice);
  1056. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1057. var SPECIES = wellKnownSymbol('species');
  1058. var Array$2 = global_1.Array;
  1059. var max$1 = Math.max;
  1060. // `Array.prototype.slice` method
  1061. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1062. // fallback for not array-like ES3 strings and DOM objects
  1063. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1064. slice: function slice(start, end) {
  1065. var O = toIndexedObject(this);
  1066. var length = lengthOfArrayLike(O);
  1067. var k = toAbsoluteIndex(start, length);
  1068. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1069. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1070. var Constructor, result, n;
  1071. if (isArray(O)) {
  1072. Constructor = O.constructor;
  1073. // cross-realm fallback
  1074. if (isConstructor(Constructor) && (Constructor === Array$2 || isArray(Constructor.prototype))) {
  1075. Constructor = undefined;
  1076. } else if (isObject(Constructor)) {
  1077. Constructor = Constructor[SPECIES];
  1078. if (Constructor === null) Constructor = undefined;
  1079. }
  1080. if (Constructor === Array$2 || Constructor === undefined) {
  1081. return arraySlice(O, k, fin);
  1082. }
  1083. }
  1084. result = new (Constructor === undefined ? Array$2 : Constructor)(max$1(fin - k, 0));
  1085. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1086. result.length = n;
  1087. return result;
  1088. }
  1089. });
  1090. var String$1 = global_1.String;
  1091. var toString_1 = function (argument) {
  1092. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1093. return String$1(argument);
  1094. };
  1095. var Array$1 = global_1.Array;
  1096. var max = Math.max;
  1097. var arraySliceSimple = function (O, start, end) {
  1098. var length = lengthOfArrayLike(O);
  1099. var k = toAbsoluteIndex(start, length);
  1100. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1101. var result = Array$1(max(fin - k, 0));
  1102. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1103. result.length = n;
  1104. return result;
  1105. };
  1106. var floor = Math.floor;
  1107. var mergeSort = function (array, comparefn) {
  1108. var length = array.length;
  1109. var middle = floor(length / 2);
  1110. return length < 8 ? insertionSort(array, comparefn) : merge(
  1111. array,
  1112. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  1113. mergeSort(arraySliceSimple(array, middle), comparefn),
  1114. comparefn
  1115. );
  1116. };
  1117. var insertionSort = function (array, comparefn) {
  1118. var length = array.length;
  1119. var i = 1;
  1120. var element, j;
  1121. while (i < length) {
  1122. j = i;
  1123. element = array[i];
  1124. while (j && comparefn(array[j - 1], element) > 0) {
  1125. array[j] = array[--j];
  1126. }
  1127. if (j !== i++) array[j] = element;
  1128. } return array;
  1129. };
  1130. var merge = function (array, left, right, comparefn) {
  1131. var llength = left.length;
  1132. var rlength = right.length;
  1133. var lindex = 0;
  1134. var rindex = 0;
  1135. while (lindex < llength || rindex < rlength) {
  1136. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1137. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1138. : lindex < llength ? left[lindex++] : right[rindex++];
  1139. } return array;
  1140. };
  1141. var arraySort = mergeSort;
  1142. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  1143. var engineFfVersion = !!firefox && +firefox[1];
  1144. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  1145. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  1146. var engineWebkitVersion = !!webkit && +webkit[1];
  1147. var test = [];
  1148. var un$Sort = functionUncurryThis(test.sort);
  1149. var push = functionUncurryThis(test.push);
  1150. // IE8-
  1151. var FAILS_ON_UNDEFINED = fails(function () {
  1152. test.sort(undefined);
  1153. });
  1154. // V8 bug
  1155. var FAILS_ON_NULL = fails(function () {
  1156. test.sort(null);
  1157. });
  1158. // Old WebKit
  1159. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  1160. var STABLE_SORT = !fails(function () {
  1161. // feature detection can be too slow, so check engines versions
  1162. if (engineV8Version) return engineV8Version < 70;
  1163. if (engineFfVersion && engineFfVersion > 3) return;
  1164. if (engineIsIeOrEdge) return true;
  1165. if (engineWebkitVersion) return engineWebkitVersion < 603;
  1166. var result = '';
  1167. var code, chr, value, index;
  1168. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1169. for (code = 65; code < 76; code++) {
  1170. chr = String.fromCharCode(code);
  1171. switch (code) {
  1172. case 66: case 69: case 70: case 72: value = 3; break;
  1173. case 68: case 71: value = 4; break;
  1174. default: value = 2;
  1175. }
  1176. for (index = 0; index < 47; index++) {
  1177. test.push({ k: chr + index, v: value });
  1178. }
  1179. }
  1180. test.sort(function (a, b) { return b.v - a.v; });
  1181. for (index = 0; index < test.length; index++) {
  1182. chr = test[index].k.charAt(0);
  1183. if (result.charAt(result.length - 1) !== chr) result += chr;
  1184. }
  1185. return result !== 'DGBEFHACIJK';
  1186. });
  1187. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  1188. var getSortCompare = function (comparefn) {
  1189. return function (x, y) {
  1190. if (y === undefined) return -1;
  1191. if (x === undefined) return 1;
  1192. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1193. return toString_1(x) > toString_1(y) ? 1 : -1;
  1194. };
  1195. };
  1196. // `Array.prototype.sort` method
  1197. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1198. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  1199. sort: function sort(comparefn) {
  1200. if (comparefn !== undefined) aCallable(comparefn);
  1201. var array = toObject(this);
  1202. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  1203. var items = [];
  1204. var arrayLength = lengthOfArrayLike(array);
  1205. var itemsLength, index;
  1206. for (index = 0; index < arrayLength; index++) {
  1207. if (index in array) push(items, array[index]);
  1208. }
  1209. arraySort(items, getSortCompare(comparefn));
  1210. itemsLength = items.length;
  1211. index = 0;
  1212. while (index < itemsLength) array[index] = items[index++];
  1213. while (index < arrayLength) delete array[index++];
  1214. return array;
  1215. }
  1216. });
  1217. var un$Join = functionUncurryThis([].join);
  1218. var ES3_STRINGS = indexedObject != Object;
  1219. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1220. // `Array.prototype.join` method
  1221. // https://tc39.es/ecma262/#sec-array.prototype.join
  1222. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1223. join: function join(separator) {
  1224. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1225. }
  1226. });
  1227. var FUNCTION_NAME_EXISTS = functionName.EXISTS;
  1228. var defineProperty$1 = objectDefineProperty.f;
  1229. var FunctionPrototype = Function.prototype;
  1230. var functionToString = functionUncurryThis(FunctionPrototype.toString);
  1231. var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
  1232. var regExpExec = functionUncurryThis(nameRE.exec);
  1233. var NAME = 'name';
  1234. // Function instances `.name` property
  1235. // https://tc39.es/ecma262/#sec-function-instances-name
  1236. if (descriptors && !FUNCTION_NAME_EXISTS) {
  1237. defineProperty$1(FunctionPrototype, NAME, {
  1238. configurable: true,
  1239. get: function () {
  1240. try {
  1241. return regExpExec(nameRE, functionToString(this))[1];
  1242. } catch (error) {
  1243. return '';
  1244. }
  1245. }
  1246. });
  1247. }
  1248. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1249. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1250. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1251. var TypeError$1 = global_1.TypeError;
  1252. // We can't use this feature detection in V8 since it causes
  1253. // deoptimization and serious performance degradation
  1254. // https://github.com/zloirock/core-js/issues/679
  1255. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1256. var array = [];
  1257. array[IS_CONCAT_SPREADABLE] = false;
  1258. return array.concat()[0] !== array;
  1259. });
  1260. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1261. var isConcatSpreadable = function (O) {
  1262. if (!isObject(O)) return false;
  1263. var spreadable = O[IS_CONCAT_SPREADABLE];
  1264. return spreadable !== undefined ? !!spreadable : isArray(O);
  1265. };
  1266. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1267. // `Array.prototype.concat` method
  1268. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1269. // with adding support of @@isConcatSpreadable and @@species
  1270. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  1271. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1272. concat: function concat(arg) {
  1273. var O = toObject(this);
  1274. var A = arraySpeciesCreate(O, 0);
  1275. var n = 0;
  1276. var i, k, length, len, E;
  1277. for (i = -1, length = arguments.length; i < length; i++) {
  1278. E = i === -1 ? O : arguments[i];
  1279. if (isConcatSpreadable(E)) {
  1280. len = lengthOfArrayLike(E);
  1281. if (n + len > MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1282. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1283. } else {
  1284. if (n >= MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1285. createProperty(A, n++, E);
  1286. }
  1287. }
  1288. A.length = n;
  1289. return A;
  1290. }
  1291. });
  1292. // `Object.keys` method
  1293. // https://tc39.es/ecma262/#sec-object.keys
  1294. // eslint-disable-next-line es-x/no-object-keys -- safe
  1295. var objectKeys = Object.keys || function keys(O) {
  1296. return objectKeysInternal(O, enumBugKeys);
  1297. };
  1298. // `Object.defineProperties` method
  1299. // https://tc39.es/ecma262/#sec-object.defineproperties
  1300. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  1301. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  1302. anObject(O);
  1303. var props = toIndexedObject(Properties);
  1304. var keys = objectKeys(Properties);
  1305. var length = keys.length;
  1306. var index = 0;
  1307. var key;
  1308. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  1309. return O;
  1310. };
  1311. var objectDefineProperties = {
  1312. f: f
  1313. };
  1314. var html = getBuiltIn('document', 'documentElement');
  1315. /* global ActiveXObject -- old IE, WSH */
  1316. var GT = '>';
  1317. var LT = '<';
  1318. var PROTOTYPE = 'prototype';
  1319. var SCRIPT = 'script';
  1320. var IE_PROTO = sharedKey('IE_PROTO');
  1321. var EmptyConstructor = function () { /* empty */ };
  1322. var scriptTag = function (content) {
  1323. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1324. };
  1325. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1326. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1327. activeXDocument.write(scriptTag(''));
  1328. activeXDocument.close();
  1329. var temp = activeXDocument.parentWindow.Object;
  1330. activeXDocument = null; // avoid memory leak
  1331. return temp;
  1332. };
  1333. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1334. var NullProtoObjectViaIFrame = function () {
  1335. // Thrash, waste and sodomy: IE GC bug
  1336. var iframe = documentCreateElement('iframe');
  1337. var JS = 'java' + SCRIPT + ':';
  1338. var iframeDocument;
  1339. iframe.style.display = 'none';
  1340. html.appendChild(iframe);
  1341. // https://github.com/zloirock/core-js/issues/475
  1342. iframe.src = String(JS);
  1343. iframeDocument = iframe.contentWindow.document;
  1344. iframeDocument.open();
  1345. iframeDocument.write(scriptTag('document.F=Object'));
  1346. iframeDocument.close();
  1347. return iframeDocument.F;
  1348. };
  1349. // Check for document.domain and active x support
  1350. // No need to use active x approach when document.domain is not set
  1351. // see https://github.com/es-shims/es5-shim/issues/150
  1352. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1353. // avoid IE GC bug
  1354. var activeXDocument;
  1355. var NullProtoObject = function () {
  1356. try {
  1357. activeXDocument = new ActiveXObject('htmlfile');
  1358. } catch (error) { /* ignore */ }
  1359. NullProtoObject = typeof document != 'undefined'
  1360. ? document.domain && activeXDocument
  1361. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1362. : NullProtoObjectViaIFrame()
  1363. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1364. var length = enumBugKeys.length;
  1365. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1366. return NullProtoObject();
  1367. };
  1368. hiddenKeys$1[IE_PROTO] = true;
  1369. // `Object.create` method
  1370. // https://tc39.es/ecma262/#sec-object.create
  1371. // eslint-disable-next-line es-x/no-object-create -- safe
  1372. var objectCreate = Object.create || function create(O, Properties) {
  1373. var result;
  1374. if (O !== null) {
  1375. EmptyConstructor[PROTOTYPE] = anObject(O);
  1376. result = new EmptyConstructor();
  1377. EmptyConstructor[PROTOTYPE] = null;
  1378. // add "__proto__" for Object.getPrototypeOf polyfill
  1379. result[IE_PROTO] = O;
  1380. } else result = NullProtoObject();
  1381. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  1382. };
  1383. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1384. var ArrayPrototype = Array.prototype;
  1385. // Array.prototype[@@unscopables]
  1386. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1387. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1388. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1389. configurable: true,
  1390. value: objectCreate(null)
  1391. });
  1392. }
  1393. // add a key to Array.prototype[@@unscopables]
  1394. var addToUnscopables = function (key) {
  1395. ArrayPrototype[UNSCOPABLES][key] = true;
  1396. };
  1397. var $find = arrayIteration.find;
  1398. var FIND = 'find';
  1399. var SKIPS_HOLES = true;
  1400. // Shouldn't skip holes
  1401. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1402. // `Array.prototype.find` method
  1403. // https://tc39.es/ecma262/#sec-array.prototype.find
  1404. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1405. find: function find(callbackfn /* , that = undefined */) {
  1406. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1407. }
  1408. });
  1409. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1410. addToUnscopables(FIND);
  1411. var $filter = arrayIteration.filter;
  1412. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1413. // `Array.prototype.filter` method
  1414. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1415. // with adding support of @@species
  1416. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1417. filter: function filter(callbackfn /* , thisArg */) {
  1418. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1419. }
  1420. });
  1421. // eslint-disable-next-line es-x/no-object-assign -- safe
  1422. var $assign = Object.assign;
  1423. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  1424. var defineProperty = Object.defineProperty;
  1425. var concat = functionUncurryThis([].concat);
  1426. // `Object.assign` method
  1427. // https://tc39.es/ecma262/#sec-object.assign
  1428. var objectAssign = !$assign || fails(function () {
  1429. // should have correct order of operations (Edge bug)
  1430. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1431. enumerable: true,
  1432. get: function () {
  1433. defineProperty(this, 'b', {
  1434. value: 3,
  1435. enumerable: false
  1436. });
  1437. }
  1438. }), { b: 2 })).b !== 1) return true;
  1439. // should work with symbols and should have deterministic property order (V8 bug)
  1440. var A = {};
  1441. var B = {};
  1442. // eslint-disable-next-line es-x/no-symbol -- safe
  1443. var symbol = Symbol();
  1444. var alphabet = 'abcdefghijklmnopqrst';
  1445. A[symbol] = 7;
  1446. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1447. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1448. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1449. var T = toObject(target);
  1450. var argumentsLength = arguments.length;
  1451. var index = 1;
  1452. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1453. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1454. while (argumentsLength > index) {
  1455. var S = indexedObject(arguments[index++]);
  1456. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1457. var length = keys.length;
  1458. var j = 0;
  1459. var key;
  1460. while (length > j) {
  1461. key = keys[j++];
  1462. if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key];
  1463. }
  1464. } return T;
  1465. } : $assign;
  1466. // `Object.assign` method
  1467. // https://tc39.es/ecma262/#sec-object.assign
  1468. // eslint-disable-next-line es-x/no-object-assign -- required for testing
  1469. _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, {
  1470. assign: objectAssign
  1471. });
  1472. /**
  1473. * @author: Yura Knoxville
  1474. * @version: v1.1.0
  1475. */
  1476. var initBodyCaller;
  1477. var groupBy = function groupBy(array, f) {
  1478. var tmpGroups = {};
  1479. array.forEach(function (o) {
  1480. var groups = f(o);
  1481. tmpGroups[groups] = tmpGroups[groups] || [];
  1482. tmpGroups[groups].push(o);
  1483. });
  1484. return tmpGroups;
  1485. };
  1486. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults.icons, {
  1487. collapseGroup: {
  1488. bootstrap3: 'glyphicon-chevron-up',
  1489. bootstrap5: 'bi-chevron-up',
  1490. materialize: 'arrow_drop_down'
  1491. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-angle-up',
  1492. expandGroup: {
  1493. bootstrap3: 'glyphicon-chevron-down',
  1494. bootstrap5: 'bi-chevron-down',
  1495. materialize: 'arrow_drop_up'
  1496. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-angle-down'
  1497. });
  1498. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1499. groupBy: false,
  1500. groupByField: '',
  1501. groupByFormatter: undefined,
  1502. groupByToggle: false,
  1503. groupByShowToggleIcon: false,
  1504. groupByCollapsedGroups: []
  1505. });
  1506. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1507. var BootstrapTable = $__default["default"].fn.bootstrapTable.Constructor;
  1508. var _initSort = BootstrapTable.prototype.initSort;
  1509. var _initBody = BootstrapTable.prototype.initBody;
  1510. var _updateSelected = BootstrapTable.prototype.updateSelected;
  1511. BootstrapTable.prototype.initSort = function () {
  1512. var _this = this;
  1513. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1514. args[_key] = arguments[_key];
  1515. }
  1516. _initSort.apply(this, Array.prototype.slice.apply(args));
  1517. var that = this;
  1518. this.tableGroups = [];
  1519. if (this.options.groupBy && this.options.groupByField !== '') {
  1520. if (this.options.sortName !== this.options.groupByField) {
  1521. if (this.options.customSort) {
  1522. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  1523. } else {
  1524. this.options.data.sort(function (a, b) {
  1525. var groupByFields = _this.getGroupByFields();
  1526. var fieldValuesA = [];
  1527. var fieldValuesB = [];
  1528. $__default["default"].each(groupByFields, function (i, field) {
  1529. fieldValuesA.push(a[field]);
  1530. fieldValuesB.push(b[field]);
  1531. });
  1532. a = fieldValuesA.join();
  1533. b = fieldValuesB.join();
  1534. return a.localeCompare(b, undefined, {
  1535. numeric: true
  1536. });
  1537. });
  1538. }
  1539. }
  1540. var groups = groupBy(that.data, function (item) {
  1541. var groupByFields = _this.getGroupByFields();
  1542. var groupValues = [];
  1543. $__default["default"].each(groupByFields, function (i, field) {
  1544. groupValues.push(item[field]);
  1545. });
  1546. return groupValues.join(', ');
  1547. });
  1548. var index = 0;
  1549. $__default["default"].each(groups, function (key, value) {
  1550. _this.tableGroups.push({
  1551. id: index,
  1552. name: key,
  1553. data: value
  1554. });
  1555. value.forEach(function (item) {
  1556. if (!item._data) {
  1557. item._data = {};
  1558. }
  1559. if (_this.isCollapsed(key, value)) {
  1560. item._class += ' hidden';
  1561. }
  1562. item._data['parent-index'] = index;
  1563. });
  1564. index++;
  1565. });
  1566. }
  1567. };
  1568. BootstrapTable.prototype.initBody = function () {
  1569. var _this2 = this;
  1570. initBodyCaller = true;
  1571. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1572. args[_key2] = arguments[_key2];
  1573. }
  1574. _initBody.apply(this, Array.prototype.slice.apply(args));
  1575. if (this.options.groupBy && this.options.groupByField !== '') {
  1576. var that = this;
  1577. var checkBox = false;
  1578. var visibleColumns = 0;
  1579. this.columns.forEach(function (column) {
  1580. if (column.checkbox) {
  1581. checkBox = true;
  1582. } else if (column.visible) {
  1583. visibleColumns += 1;
  1584. }
  1585. });
  1586. if (this.options.detailView && !this.options.cardView) {
  1587. visibleColumns += 1;
  1588. }
  1589. this.tableGroups.forEach(function (item) {
  1590. var html = [];
  1591. html.push(Utils.sprintf('<tr class="info groupBy %s" data-group-index="%s">', _this2.options.groupByToggle ? 'expanded' : '', item.id));
  1592. if (that.options.detailView && !that.options.cardView) {
  1593. html.push('<td class="detail"></td>');
  1594. }
  1595. if (checkBox) {
  1596. html.push('<td class="bs-checkbox">', '<input name="btSelectGroup" type="checkbox" />', '</td>');
  1597. }
  1598. var formattedValue = item.name;
  1599. if (that.options.groupByFormatter !== undefined) {
  1600. formattedValue = Utils.calculateObjectValue(that.options, that.options.groupByFormatter, [item.name, item.id, item.data]);
  1601. }
  1602. html.push('<td', Utils.sprintf(' colspan="%s"', visibleColumns), '>', formattedValue);
  1603. var icon = _this2.options.icons.collapseGroup;
  1604. if (_this2.isCollapsed(item.name, item.data)) {
  1605. icon = _this2.options.icons.expandGroup;
  1606. }
  1607. if (_this2.options.groupByToggle && _this2.options.groupByShowToggleIcon) {
  1608. html.push("<span class=\"float-right ".concat(_this2.options.iconsPrefix, " ").concat(icon, "\"></span>"));
  1609. }
  1610. html.push('</td></tr>');
  1611. that.$body.find("tr[data-parent-index=".concat(item.id, "]:first")).before($__default["default"](html.join('')));
  1612. });
  1613. this.$selectGroup = [];
  1614. this.$body.find('[name="btSelectGroup"]').each(function () {
  1615. var self = $__default["default"](this);
  1616. that.$selectGroup.push({
  1617. group: self,
  1618. item: that.$selectItem.filter(function () {
  1619. return $__default["default"](this).closest('tr').data('parent-index') === self.closest('tr').data('group-index');
  1620. })
  1621. });
  1622. });
  1623. if (this.options.groupByToggle) {
  1624. this.$container.off('click', '.groupBy').on('click', '.groupBy', function () {
  1625. var $this = $__default["default"](this);
  1626. var groupIndex = $this.closest('tr').data('group-index');
  1627. var $groupRows = that.$body.find("tr[data-parent-index=".concat(groupIndex, "]"));
  1628. $this.toggleClass('expanded collapsed');
  1629. $this.find('span').toggleClass("".concat(that.options.icons.collapseGroup, " ").concat(that.options.icons.expandGroup));
  1630. $groupRows.toggleClass('hidden');
  1631. $groupRows.each(function (i, element) {
  1632. return that.collapseRow($__default["default"](element).data('index'));
  1633. });
  1634. });
  1635. }
  1636. this.$container.off('click', '[name="btSelectGroup"]').on('click', '[name="btSelectGroup"]', function (event) {
  1637. event.stopImmediatePropagation();
  1638. var self = $__default["default"](this);
  1639. var checked = self.prop('checked');
  1640. that[checked ? 'checkGroup' : 'uncheckGroup']($__default["default"](this).closest('tr').data('group-index'));
  1641. });
  1642. }
  1643. initBodyCaller = false;
  1644. this.updateSelected();
  1645. };
  1646. BootstrapTable.prototype.updateSelected = function () {
  1647. if (!initBodyCaller) {
  1648. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1649. args[_key3] = arguments[_key3];
  1650. }
  1651. _updateSelected.apply(this, Array.prototype.slice.apply(args));
  1652. if (this.options.groupBy && this.options.groupByField !== '') {
  1653. this.$selectGroup.forEach(function (item) {
  1654. var checkGroup = item.item.filter(':enabled').length === item.item.filter(':enabled').filter(':checked').length;
  1655. item.group.prop('checked', checkGroup);
  1656. });
  1657. }
  1658. }
  1659. };
  1660. BootstrapTable.prototype.checkGroup = function (index) {
  1661. this.checkGroup_(index, true);
  1662. };
  1663. BootstrapTable.prototype.uncheckGroup = function (index) {
  1664. this.checkGroup_(index, false);
  1665. };
  1666. BootstrapTable.prototype.isCollapsed = function (groupKey, items) {
  1667. if (this.options.groupByCollapsedGroups) {
  1668. var collapsedGroups = Utils.calculateObjectValue(this, this.options.groupByCollapsedGroups, [groupKey, items], true);
  1669. if ($__default["default"].inArray(groupKey, collapsedGroups) > -1) {
  1670. return true;
  1671. }
  1672. }
  1673. return false;
  1674. };
  1675. BootstrapTable.prototype.checkGroup_ = function (index, checked) {
  1676. var rowsBefore = this.getSelections();
  1677. var filter = function filter() {
  1678. return $__default["default"](this).closest('tr').data('parent-index') === index;
  1679. };
  1680. this.$selectItem.filter(filter).prop('checked', checked);
  1681. this.updateRows();
  1682. this.updateSelected();
  1683. var rowsAfter = this.getSelections();
  1684. if (checked) {
  1685. this.trigger('check-all', rowsAfter, rowsBefore);
  1686. return;
  1687. }
  1688. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  1689. };
  1690. BootstrapTable.prototype.getGroupByFields = function () {
  1691. var groupByFields = this.options.groupByField;
  1692. if (!$__default["default"].isArray(this.options.groupByField)) {
  1693. groupByFields = [this.options.groupByField];
  1694. }
  1695. return groupByFields;
  1696. };
  1697. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1698. _inherits(_class, _$$BootstrapTable);
  1699. var _super = _createSuper(_class);
  1700. function _class() {
  1701. _classCallCheck(this, _class);
  1702. return _super.apply(this, arguments);
  1703. }
  1704. _createClass(_class, [{
  1705. key: "scrollTo",
  1706. value: function scrollTo(params) {
  1707. if (this.options.groupBy) {
  1708. var options = {
  1709. unit: 'px',
  1710. value: 0
  1711. };
  1712. if (_typeof(params) === 'object') {
  1713. options = Object.assign(options, params);
  1714. }
  1715. if (options.unit === 'rows') {
  1716. var scrollTo = 0;
  1717. this.$body.find("> tr:not(.groupBy):lt(".concat(options.value, ")")).each(function (i, el) {
  1718. scrollTo += $__default["default"](el).outerHeight(true);
  1719. });
  1720. var $targetColumn = this.$body.find("> tr:not(.groupBy):eq(".concat(options.value, ")"));
  1721. $targetColumn.prevAll('.groupBy').each(function (i, el) {
  1722. scrollTo += $__default["default"](el).outerHeight(true);
  1723. });
  1724. this.$tableBody.scrollTop(scrollTo);
  1725. return;
  1726. }
  1727. }
  1728. _get(_getPrototypeOf(_class.prototype), "scrollTo", this).call(this, params);
  1729. }
  1730. }]);
  1731. return _class;
  1732. }($__default["default"].BootstrapTable);
  1733. }));