bootstrap-table-multiple-sort.js 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226
  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. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  17. function createCommonjsModule(fn, module) {
  18. return module = { exports: {} }, fn(module, module.exports), module.exports;
  19. }
  20. var check = function (it) {
  21. return it && it.Math == Math && it;
  22. };
  23. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  24. var global_1 =
  25. // eslint-disable-next-line es/no-global-this -- safe
  26. check(typeof globalThis == 'object' && globalThis) ||
  27. check(typeof window == 'object' && window) ||
  28. // eslint-disable-next-line no-restricted-globals -- safe
  29. check(typeof self == 'object' && self) ||
  30. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  31. // eslint-disable-next-line no-new-func -- fallback
  32. (function () { return this; })() || Function('return this')();
  33. var fails = function (exec) {
  34. try {
  35. return !!exec();
  36. } catch (error) {
  37. return true;
  38. }
  39. };
  40. // Detect IE8's incomplete defineProperty implementation
  41. var descriptors = !fails(function () {
  42. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  43. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  44. });
  45. var functionBindNative = !fails(function () {
  46. var test = (function () { /* empty */ }).bind();
  47. // eslint-disable-next-line no-prototype-builtins -- safe
  48. return typeof test != 'function' || test.hasOwnProperty('prototype');
  49. });
  50. var call$1 = Function.prototype.call;
  51. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  52. return call$1.apply(call$1, arguments);
  53. };
  54. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  55. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  56. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  57. // Nashorn ~ JDK8 bug
  58. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  59. // `Object.prototype.propertyIsEnumerable` method implementation
  60. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  61. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  62. var descriptor = getOwnPropertyDescriptor$1(this, V);
  63. return !!descriptor && descriptor.enumerable;
  64. } : $propertyIsEnumerable;
  65. var objectPropertyIsEnumerable = {
  66. f: f$5
  67. };
  68. var createPropertyDescriptor = function (bitmap, value) {
  69. return {
  70. enumerable: !(bitmap & 1),
  71. configurable: !(bitmap & 2),
  72. writable: !(bitmap & 4),
  73. value: value
  74. };
  75. };
  76. var FunctionPrototype$1 = Function.prototype;
  77. var bind$1 = FunctionPrototype$1.bind;
  78. var call = FunctionPrototype$1.call;
  79. var uncurryThis = functionBindNative && bind$1.bind(call, call);
  80. var functionUncurryThis = functionBindNative ? function (fn) {
  81. return fn && uncurryThis(fn);
  82. } : function (fn) {
  83. return fn && function () {
  84. return call.apply(fn, arguments);
  85. };
  86. };
  87. var toString$1 = functionUncurryThis({}.toString);
  88. var stringSlice = functionUncurryThis(''.slice);
  89. var classofRaw = function (it) {
  90. return stringSlice(toString$1(it), 8, -1);
  91. };
  92. var Object$4 = global_1.Object;
  93. var split = functionUncurryThis(''.split);
  94. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  95. var indexedObject = fails(function () {
  96. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  97. // eslint-disable-next-line no-prototype-builtins -- safe
  98. return !Object$4('z').propertyIsEnumerable(0);
  99. }) ? function (it) {
  100. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  101. } : Object$4;
  102. var TypeError$9 = global_1.TypeError;
  103. // `RequireObjectCoercible` abstract operation
  104. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  105. var requireObjectCoercible = function (it) {
  106. if (it == undefined) throw TypeError$9("Can't call method on " + it);
  107. return it;
  108. };
  109. // toObject with fallback for non-array-like ES3 strings
  110. var toIndexedObject = function (it) {
  111. return indexedObject(requireObjectCoercible(it));
  112. };
  113. // `IsCallable` abstract operation
  114. // https://tc39.es/ecma262/#sec-iscallable
  115. var isCallable = function (argument) {
  116. return typeof argument == 'function';
  117. };
  118. var isObject = function (it) {
  119. return typeof it == 'object' ? it !== null : isCallable(it);
  120. };
  121. var aFunction = function (argument) {
  122. return isCallable(argument) ? argument : undefined;
  123. };
  124. var getBuiltIn = function (namespace, method) {
  125. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  126. };
  127. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  128. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  129. var process = global_1.process;
  130. var Deno = global_1.Deno;
  131. var versions = process && process.versions || Deno && Deno.version;
  132. var v8 = versions && versions.v8;
  133. var match, version;
  134. if (v8) {
  135. match = v8.split('.');
  136. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  137. // but their correct versions are not interesting for us
  138. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  139. }
  140. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  141. // so check `userAgent` even if `.v8` exists, but 0
  142. if (!version && engineUserAgent) {
  143. match = engineUserAgent.match(/Edge\/(\d+)/);
  144. if (!match || match[1] >= 74) {
  145. match = engineUserAgent.match(/Chrome\/(\d+)/);
  146. if (match) version = +match[1];
  147. }
  148. }
  149. var engineV8Version = version;
  150. /* eslint-disable es/no-symbol -- required for testing */
  151. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  152. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  153. var symbol = Symbol();
  154. // Chrome 38 Symbol has incorrect toString conversion
  155. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  156. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  157. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  158. !Symbol.sham && engineV8Version && engineV8Version < 41;
  159. });
  160. /* eslint-disable es/no-symbol -- required for testing */
  161. var useSymbolAsUid = nativeSymbol
  162. && !Symbol.sham
  163. && typeof Symbol.iterator == 'symbol';
  164. var Object$3 = global_1.Object;
  165. var isSymbol = useSymbolAsUid ? function (it) {
  166. return typeof it == 'symbol';
  167. } : function (it) {
  168. var $Symbol = getBuiltIn('Symbol');
  169. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  170. };
  171. var String$3 = global_1.String;
  172. var tryToString = function (argument) {
  173. try {
  174. return String$3(argument);
  175. } catch (error) {
  176. return 'Object';
  177. }
  178. };
  179. var TypeError$8 = global_1.TypeError;
  180. // `Assert: IsCallable(argument) is true`
  181. var aCallable = function (argument) {
  182. if (isCallable(argument)) return argument;
  183. throw TypeError$8(tryToString(argument) + ' is not a function');
  184. };
  185. // `GetMethod` abstract operation
  186. // https://tc39.es/ecma262/#sec-getmethod
  187. var getMethod = function (V, P) {
  188. var func = V[P];
  189. return func == null ? undefined : aCallable(func);
  190. };
  191. var TypeError$7 = global_1.TypeError;
  192. // `OrdinaryToPrimitive` abstract operation
  193. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  194. var ordinaryToPrimitive = function (input, pref) {
  195. var fn, val;
  196. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  197. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  198. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  199. throw TypeError$7("Can't convert object to primitive value");
  200. };
  201. // eslint-disable-next-line es/no-object-defineproperty -- safe
  202. var defineProperty$1 = Object.defineProperty;
  203. var setGlobal = function (key, value) {
  204. try {
  205. defineProperty$1(global_1, key, { value: value, configurable: true, writable: true });
  206. } catch (error) {
  207. global_1[key] = value;
  208. } return value;
  209. };
  210. var SHARED = '__core-js_shared__';
  211. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  212. var sharedStore = store$1;
  213. var shared = createCommonjsModule(function (module) {
  214. (module.exports = function (key, value) {
  215. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  216. })('versions', []).push({
  217. version: '3.21.1',
  218. mode: 'global',
  219. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  220. license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
  221. source: 'https://github.com/zloirock/core-js'
  222. });
  223. });
  224. var Object$2 = global_1.Object;
  225. // `ToObject` abstract operation
  226. // https://tc39.es/ecma262/#sec-toobject
  227. var toObject = function (argument) {
  228. return Object$2(requireObjectCoercible(argument));
  229. };
  230. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  231. // `HasOwnProperty` abstract operation
  232. // https://tc39.es/ecma262/#sec-hasownproperty
  233. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  234. return hasOwnProperty(toObject(it), key);
  235. };
  236. var id = 0;
  237. var postfix = Math.random();
  238. var toString = functionUncurryThis(1.0.toString);
  239. var uid = function (key) {
  240. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  241. };
  242. var WellKnownSymbolsStore = shared('wks');
  243. var Symbol$2 = global_1.Symbol;
  244. var symbolFor = Symbol$2 && Symbol$2['for'];
  245. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  246. var wellKnownSymbol = function (name) {
  247. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  248. var description = 'Symbol.' + name;
  249. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  250. WellKnownSymbolsStore[name] = Symbol$2[name];
  251. } else if (useSymbolAsUid && symbolFor) {
  252. WellKnownSymbolsStore[name] = symbolFor(description);
  253. } else {
  254. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  255. }
  256. } return WellKnownSymbolsStore[name];
  257. };
  258. var TypeError$6 = global_1.TypeError;
  259. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  260. // `ToPrimitive` abstract operation
  261. // https://tc39.es/ecma262/#sec-toprimitive
  262. var toPrimitive = function (input, pref) {
  263. if (!isObject(input) || isSymbol(input)) return input;
  264. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  265. var result;
  266. if (exoticToPrim) {
  267. if (pref === undefined) pref = 'default';
  268. result = functionCall(exoticToPrim, input, pref);
  269. if (!isObject(result) || isSymbol(result)) return result;
  270. throw TypeError$6("Can't convert object to primitive value");
  271. }
  272. if (pref === undefined) pref = 'number';
  273. return ordinaryToPrimitive(input, pref);
  274. };
  275. // `ToPropertyKey` abstract operation
  276. // https://tc39.es/ecma262/#sec-topropertykey
  277. var toPropertyKey = function (argument) {
  278. var key = toPrimitive(argument, 'string');
  279. return isSymbol(key) ? key : key + '';
  280. };
  281. var document$1 = global_1.document;
  282. // typeof document.createElement is 'object' in old IE
  283. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  284. var documentCreateElement = function (it) {
  285. return EXISTS$1 ? document$1.createElement(it) : {};
  286. };
  287. // Thanks to IE8 for its funny defineProperty
  288. var ie8DomDefine = !descriptors && !fails(function () {
  289. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  290. return Object.defineProperty(documentCreateElement('div'), 'a', {
  291. get: function () { return 7; }
  292. }).a != 7;
  293. });
  294. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  295. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  296. // `Object.getOwnPropertyDescriptor` method
  297. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  298. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  299. O = toIndexedObject(O);
  300. P = toPropertyKey(P);
  301. if (ie8DomDefine) try {
  302. return $getOwnPropertyDescriptor$1(O, P);
  303. } catch (error) { /* empty */ }
  304. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  305. };
  306. var objectGetOwnPropertyDescriptor = {
  307. f: f$4
  308. };
  309. // V8 ~ Chrome 36-
  310. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  311. var v8PrototypeDefineBug = descriptors && fails(function () {
  312. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  313. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  314. value: 42,
  315. writable: false
  316. }).prototype != 42;
  317. });
  318. var String$2 = global_1.String;
  319. var TypeError$5 = global_1.TypeError;
  320. // `Assert: Type(argument) is Object`
  321. var anObject = function (argument) {
  322. if (isObject(argument)) return argument;
  323. throw TypeError$5(String$2(argument) + ' is not an object');
  324. };
  325. var TypeError$4 = global_1.TypeError;
  326. // eslint-disable-next-line es/no-object-defineproperty -- safe
  327. var $defineProperty = Object.defineProperty;
  328. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  329. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  330. var ENUMERABLE = 'enumerable';
  331. var CONFIGURABLE$1 = 'configurable';
  332. var WRITABLE = 'writable';
  333. // `Object.defineProperty` method
  334. // https://tc39.es/ecma262/#sec-object.defineproperty
  335. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  336. anObject(O);
  337. P = toPropertyKey(P);
  338. anObject(Attributes);
  339. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  340. var current = $getOwnPropertyDescriptor(O, P);
  341. if (current && current[WRITABLE]) {
  342. O[P] = Attributes.value;
  343. Attributes = {
  344. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  345. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  346. writable: false
  347. };
  348. }
  349. } return $defineProperty(O, P, Attributes);
  350. } : $defineProperty : function defineProperty(O, P, Attributes) {
  351. anObject(O);
  352. P = toPropertyKey(P);
  353. anObject(Attributes);
  354. if (ie8DomDefine) try {
  355. return $defineProperty(O, P, Attributes);
  356. } catch (error) { /* empty */ }
  357. if ('get' in Attributes || 'set' in Attributes) throw TypeError$4('Accessors not supported');
  358. if ('value' in Attributes) O[P] = Attributes.value;
  359. return O;
  360. };
  361. var objectDefineProperty = {
  362. f: f$3
  363. };
  364. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  365. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  366. } : function (object, key, value) {
  367. object[key] = value;
  368. return object;
  369. };
  370. var functionToString = functionUncurryThis(Function.toString);
  371. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  372. if (!isCallable(sharedStore.inspectSource)) {
  373. sharedStore.inspectSource = function (it) {
  374. return functionToString(it);
  375. };
  376. }
  377. var inspectSource = sharedStore.inspectSource;
  378. var WeakMap$1 = global_1.WeakMap;
  379. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  380. var keys = shared('keys');
  381. var sharedKey = function (key) {
  382. return keys[key] || (keys[key] = uid(key));
  383. };
  384. var hiddenKeys$1 = {};
  385. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  386. var TypeError$3 = global_1.TypeError;
  387. var WeakMap = global_1.WeakMap;
  388. var set, get, has;
  389. var enforce = function (it) {
  390. return has(it) ? get(it) : set(it, {});
  391. };
  392. var getterFor = function (TYPE) {
  393. return function (it) {
  394. var state;
  395. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  396. throw TypeError$3('Incompatible receiver, ' + TYPE + ' required');
  397. } return state;
  398. };
  399. };
  400. if (nativeWeakMap || sharedStore.state) {
  401. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  402. var wmget = functionUncurryThis(store.get);
  403. var wmhas = functionUncurryThis(store.has);
  404. var wmset = functionUncurryThis(store.set);
  405. set = function (it, metadata) {
  406. if (wmhas(store, it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  407. metadata.facade = it;
  408. wmset(store, it, metadata);
  409. return metadata;
  410. };
  411. get = function (it) {
  412. return wmget(store, it) || {};
  413. };
  414. has = function (it) {
  415. return wmhas(store, it);
  416. };
  417. } else {
  418. var STATE = sharedKey('state');
  419. hiddenKeys$1[STATE] = true;
  420. set = function (it, metadata) {
  421. if (hasOwnProperty_1(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  422. metadata.facade = it;
  423. createNonEnumerableProperty(it, STATE, metadata);
  424. return metadata;
  425. };
  426. get = function (it) {
  427. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  428. };
  429. has = function (it) {
  430. return hasOwnProperty_1(it, STATE);
  431. };
  432. }
  433. var internalState = {
  434. set: set,
  435. get: get,
  436. has: has,
  437. enforce: enforce,
  438. getterFor: getterFor
  439. };
  440. var FunctionPrototype = Function.prototype;
  441. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  442. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  443. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  444. // additional protection from minified / mangled / dropped function names
  445. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  446. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  447. var functionName = {
  448. EXISTS: EXISTS,
  449. PROPER: PROPER,
  450. CONFIGURABLE: CONFIGURABLE
  451. };
  452. var redefine = createCommonjsModule(function (module) {
  453. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  454. var getInternalState = internalState.get;
  455. var enforceInternalState = internalState.enforce;
  456. var TEMPLATE = String(String).split('String');
  457. (module.exports = function (O, key, value, options) {
  458. var unsafe = options ? !!options.unsafe : false;
  459. var simple = options ? !!options.enumerable : false;
  460. var noTargetGet = options ? !!options.noTargetGet : false;
  461. var name = options && options.name !== undefined ? options.name : key;
  462. var state;
  463. if (isCallable(value)) {
  464. if (String(name).slice(0, 7) === 'Symbol(') {
  465. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  466. }
  467. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  468. createNonEnumerableProperty(value, 'name', name);
  469. }
  470. state = enforceInternalState(value);
  471. if (!state.source) {
  472. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  473. }
  474. }
  475. if (O === global_1) {
  476. if (simple) O[key] = value;
  477. else setGlobal(key, value);
  478. return;
  479. } else if (!unsafe) {
  480. delete O[key];
  481. } else if (!noTargetGet && O[key]) {
  482. simple = true;
  483. }
  484. if (simple) O[key] = value;
  485. else createNonEnumerableProperty(O, key, value);
  486. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  487. })(Function.prototype, 'toString', function toString() {
  488. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  489. });
  490. });
  491. var ceil = Math.ceil;
  492. var floor$1 = Math.floor;
  493. // `ToIntegerOrInfinity` abstract operation
  494. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  495. var toIntegerOrInfinity = function (argument) {
  496. var number = +argument;
  497. // eslint-disable-next-line no-self-compare -- safe
  498. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  499. };
  500. var max$3 = Math.max;
  501. var min$2 = Math.min;
  502. // Helper for a popular repeating case of the spec:
  503. // Let integer be ? ToInteger(index).
  504. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  505. var toAbsoluteIndex = function (index, length) {
  506. var integer = toIntegerOrInfinity(index);
  507. return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
  508. };
  509. var min$1 = Math.min;
  510. // `ToLength` abstract operation
  511. // https://tc39.es/ecma262/#sec-tolength
  512. var toLength = function (argument) {
  513. return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  514. };
  515. // `LengthOfArrayLike` abstract operation
  516. // https://tc39.es/ecma262/#sec-lengthofarraylike
  517. var lengthOfArrayLike = function (obj) {
  518. return toLength(obj.length);
  519. };
  520. // `Array.prototype.{ indexOf, includes }` methods implementation
  521. var createMethod$2 = function (IS_INCLUDES) {
  522. return function ($this, el, fromIndex) {
  523. var O = toIndexedObject($this);
  524. var length = lengthOfArrayLike(O);
  525. var index = toAbsoluteIndex(fromIndex, length);
  526. var value;
  527. // Array#includes uses SameValueZero equality algorithm
  528. // eslint-disable-next-line no-self-compare -- NaN check
  529. if (IS_INCLUDES && el != el) while (length > index) {
  530. value = O[index++];
  531. // eslint-disable-next-line no-self-compare -- NaN check
  532. if (value != value) return true;
  533. // Array#indexOf ignores holes, Array#includes - not
  534. } else for (;length > index; index++) {
  535. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  536. } return !IS_INCLUDES && -1;
  537. };
  538. };
  539. var arrayIncludes = {
  540. // `Array.prototype.includes` method
  541. // https://tc39.es/ecma262/#sec-array.prototype.includes
  542. includes: createMethod$2(true),
  543. // `Array.prototype.indexOf` method
  544. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  545. indexOf: createMethod$2(false)
  546. };
  547. var indexOf = arrayIncludes.indexOf;
  548. var push$2 = functionUncurryThis([].push);
  549. var objectKeysInternal = function (object, names) {
  550. var O = toIndexedObject(object);
  551. var i = 0;
  552. var result = [];
  553. var key;
  554. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
  555. // Don't enum bug & hidden keys
  556. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  557. ~indexOf(result, key) || push$2(result, key);
  558. }
  559. return result;
  560. };
  561. // IE8- don't enum bug keys
  562. var enumBugKeys = [
  563. 'constructor',
  564. 'hasOwnProperty',
  565. 'isPrototypeOf',
  566. 'propertyIsEnumerable',
  567. 'toLocaleString',
  568. 'toString',
  569. 'valueOf'
  570. ];
  571. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  572. // `Object.getOwnPropertyNames` method
  573. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  574. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  575. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  576. return objectKeysInternal(O, hiddenKeys);
  577. };
  578. var objectGetOwnPropertyNames = {
  579. f: f$2
  580. };
  581. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  582. var f$1 = Object.getOwnPropertySymbols;
  583. var objectGetOwnPropertySymbols = {
  584. f: f$1
  585. };
  586. var concat$1 = functionUncurryThis([].concat);
  587. // all object keys, includes non-enumerable and symbols
  588. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  589. var keys = objectGetOwnPropertyNames.f(anObject(it));
  590. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  591. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  592. };
  593. var copyConstructorProperties = function (target, source, exceptions) {
  594. var keys = ownKeys(source);
  595. var defineProperty = objectDefineProperty.f;
  596. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  597. for (var i = 0; i < keys.length; i++) {
  598. var key = keys[i];
  599. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  600. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  601. }
  602. }
  603. };
  604. var replacement = /#|\.prototype\./;
  605. var isForced = function (feature, detection) {
  606. var value = data[normalize(feature)];
  607. return value == POLYFILL ? true
  608. : value == NATIVE ? false
  609. : isCallable(detection) ? fails(detection)
  610. : !!detection;
  611. };
  612. var normalize = isForced.normalize = function (string) {
  613. return String(string).replace(replacement, '.').toLowerCase();
  614. };
  615. var data = isForced.data = {};
  616. var NATIVE = isForced.NATIVE = 'N';
  617. var POLYFILL = isForced.POLYFILL = 'P';
  618. var isForced_1 = isForced;
  619. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  620. /*
  621. options.target - name of the target object
  622. options.global - target is the global object
  623. options.stat - export as static methods of target
  624. options.proto - export as prototype methods of target
  625. options.real - real prototype method for the `pure` version
  626. options.forced - export even if the native feature is available
  627. options.bind - bind methods to the target, required for the `pure` version
  628. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  629. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  630. options.sham - add a flag to not completely full polyfills
  631. options.enumerable - export as enumerable property
  632. options.noTargetGet - prevent calling a getter on target
  633. options.name - the .name of the function if it does not match the key
  634. */
  635. var _export = function (options, source) {
  636. var TARGET = options.target;
  637. var GLOBAL = options.global;
  638. var STATIC = options.stat;
  639. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  640. if (GLOBAL) {
  641. target = global_1;
  642. } else if (STATIC) {
  643. target = global_1[TARGET] || setGlobal(TARGET, {});
  644. } else {
  645. target = (global_1[TARGET] || {}).prototype;
  646. }
  647. if (target) for (key in source) {
  648. sourceProperty = source[key];
  649. if (options.noTargetGet) {
  650. descriptor = getOwnPropertyDescriptor(target, key);
  651. targetProperty = descriptor && descriptor.value;
  652. } else targetProperty = target[key];
  653. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  654. // contained in target
  655. if (!FORCED && targetProperty !== undefined) {
  656. if (typeof sourceProperty == typeof targetProperty) continue;
  657. copyConstructorProperties(sourceProperty, targetProperty);
  658. }
  659. // add a flag to not completely full polyfills
  660. if (options.sham || (targetProperty && targetProperty.sham)) {
  661. createNonEnumerableProperty(sourceProperty, 'sham', true);
  662. }
  663. // extend global
  664. redefine(target, key, sourceProperty, options);
  665. }
  666. };
  667. var bind = functionUncurryThis(functionUncurryThis.bind);
  668. // optional / simple context binding
  669. var functionBindContext = function (fn, that) {
  670. aCallable(fn);
  671. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  672. return fn.apply(that, arguments);
  673. };
  674. };
  675. // `IsArray` abstract operation
  676. // https://tc39.es/ecma262/#sec-isarray
  677. // eslint-disable-next-line es/no-array-isarray -- safe
  678. var isArray = Array.isArray || function isArray(argument) {
  679. return classofRaw(argument) == 'Array';
  680. };
  681. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  682. var test$1 = {};
  683. test$1[TO_STRING_TAG$1] = 'z';
  684. var toStringTagSupport = String(test$1) === '[object z]';
  685. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  686. var Object$1 = global_1.Object;
  687. // ES3 wrong here
  688. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  689. // fallback for IE11 Script Access Denied error
  690. var tryGet = function (it, key) {
  691. try {
  692. return it[key];
  693. } catch (error) { /* empty */ }
  694. };
  695. // getting tag from ES6+ `Object.prototype.toString`
  696. var classof = toStringTagSupport ? classofRaw : function (it) {
  697. var O, tag, result;
  698. return it === undefined ? 'Undefined' : it === null ? 'Null'
  699. // @@toStringTag case
  700. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  701. // builtinTag case
  702. : CORRECT_ARGUMENTS ? classofRaw(O)
  703. // ES3 arguments fallback
  704. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  705. };
  706. var noop = function () { /* empty */ };
  707. var empty = [];
  708. var construct = getBuiltIn('Reflect', 'construct');
  709. var constructorRegExp = /^\s*(?:class|function)\b/;
  710. var exec = functionUncurryThis(constructorRegExp.exec);
  711. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  712. var isConstructorModern = function isConstructor(argument) {
  713. if (!isCallable(argument)) return false;
  714. try {
  715. construct(noop, empty, argument);
  716. return true;
  717. } catch (error) {
  718. return false;
  719. }
  720. };
  721. var isConstructorLegacy = function isConstructor(argument) {
  722. if (!isCallable(argument)) return false;
  723. switch (classof(argument)) {
  724. case 'AsyncFunction':
  725. case 'GeneratorFunction':
  726. case 'AsyncGeneratorFunction': return false;
  727. }
  728. try {
  729. // we can't check .prototype since constructors produced by .bind haven't it
  730. // `Function#toString` throws on some built-it function in some legacy engines
  731. // (for example, `DOMQuad` and similar in FF41-)
  732. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  733. } catch (error) {
  734. return true;
  735. }
  736. };
  737. isConstructorLegacy.sham = true;
  738. // `IsConstructor` abstract operation
  739. // https://tc39.es/ecma262/#sec-isconstructor
  740. var isConstructor = !construct || fails(function () {
  741. var called;
  742. return isConstructorModern(isConstructorModern.call)
  743. || !isConstructorModern(Object)
  744. || !isConstructorModern(function () { called = true; })
  745. || called;
  746. }) ? isConstructorLegacy : isConstructorModern;
  747. var SPECIES$2 = wellKnownSymbol('species');
  748. var Array$3 = global_1.Array;
  749. // a part of `ArraySpeciesCreate` abstract operation
  750. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  751. var arraySpeciesConstructor = function (originalArray) {
  752. var C;
  753. if (isArray(originalArray)) {
  754. C = originalArray.constructor;
  755. // cross-realm fallback
  756. if (isConstructor(C) && (C === Array$3 || isArray(C.prototype))) C = undefined;
  757. else if (isObject(C)) {
  758. C = C[SPECIES$2];
  759. if (C === null) C = undefined;
  760. }
  761. } return C === undefined ? Array$3 : C;
  762. };
  763. // `ArraySpeciesCreate` abstract operation
  764. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  765. var arraySpeciesCreate = function (originalArray, length) {
  766. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  767. };
  768. var push$1 = functionUncurryThis([].push);
  769. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  770. var createMethod$1 = function (TYPE) {
  771. var IS_MAP = TYPE == 1;
  772. var IS_FILTER = TYPE == 2;
  773. var IS_SOME = TYPE == 3;
  774. var IS_EVERY = TYPE == 4;
  775. var IS_FIND_INDEX = TYPE == 6;
  776. var IS_FILTER_REJECT = TYPE == 7;
  777. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  778. return function ($this, callbackfn, that, specificCreate) {
  779. var O = toObject($this);
  780. var self = indexedObject(O);
  781. var boundFunction = functionBindContext(callbackfn, that);
  782. var length = lengthOfArrayLike(self);
  783. var index = 0;
  784. var create = specificCreate || arraySpeciesCreate;
  785. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  786. var value, result;
  787. for (;length > index; index++) if (NO_HOLES || index in self) {
  788. value = self[index];
  789. result = boundFunction(value, index, O);
  790. if (TYPE) {
  791. if (IS_MAP) target[index] = result; // map
  792. else if (result) switch (TYPE) {
  793. case 3: return true; // some
  794. case 5: return value; // find
  795. case 6: return index; // findIndex
  796. case 2: push$1(target, value); // filter
  797. } else switch (TYPE) {
  798. case 4: return false; // every
  799. case 7: push$1(target, value); // filterReject
  800. }
  801. }
  802. }
  803. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  804. };
  805. };
  806. var arrayIteration = {
  807. // `Array.prototype.forEach` method
  808. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  809. forEach: createMethod$1(0),
  810. // `Array.prototype.map` method
  811. // https://tc39.es/ecma262/#sec-array.prototype.map
  812. map: createMethod$1(1),
  813. // `Array.prototype.filter` method
  814. // https://tc39.es/ecma262/#sec-array.prototype.filter
  815. filter: createMethod$1(2),
  816. // `Array.prototype.some` method
  817. // https://tc39.es/ecma262/#sec-array.prototype.some
  818. some: createMethod$1(3),
  819. // `Array.prototype.every` method
  820. // https://tc39.es/ecma262/#sec-array.prototype.every
  821. every: createMethod$1(4),
  822. // `Array.prototype.find` method
  823. // https://tc39.es/ecma262/#sec-array.prototype.find
  824. find: createMethod$1(5),
  825. // `Array.prototype.findIndex` method
  826. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  827. findIndex: createMethod$1(6),
  828. // `Array.prototype.filterReject` method
  829. // https://github.com/tc39/proposal-array-filtering
  830. filterReject: createMethod$1(7)
  831. };
  832. // `Object.keys` method
  833. // https://tc39.es/ecma262/#sec-object.keys
  834. // eslint-disable-next-line es/no-object-keys -- safe
  835. var objectKeys = Object.keys || function keys(O) {
  836. return objectKeysInternal(O, enumBugKeys);
  837. };
  838. // `Object.defineProperties` method
  839. // https://tc39.es/ecma262/#sec-object.defineproperties
  840. // eslint-disable-next-line es/no-object-defineproperties -- safe
  841. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  842. anObject(O);
  843. var props = toIndexedObject(Properties);
  844. var keys = objectKeys(Properties);
  845. var length = keys.length;
  846. var index = 0;
  847. var key;
  848. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  849. return O;
  850. };
  851. var objectDefineProperties = {
  852. f: f
  853. };
  854. var html = getBuiltIn('document', 'documentElement');
  855. /* global ActiveXObject -- old IE, WSH */
  856. var GT = '>';
  857. var LT = '<';
  858. var PROTOTYPE = 'prototype';
  859. var SCRIPT = 'script';
  860. var IE_PROTO = sharedKey('IE_PROTO');
  861. var EmptyConstructor = function () { /* empty */ };
  862. var scriptTag = function (content) {
  863. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  864. };
  865. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  866. var NullProtoObjectViaActiveX = function (activeXDocument) {
  867. activeXDocument.write(scriptTag(''));
  868. activeXDocument.close();
  869. var temp = activeXDocument.parentWindow.Object;
  870. activeXDocument = null; // avoid memory leak
  871. return temp;
  872. };
  873. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  874. var NullProtoObjectViaIFrame = function () {
  875. // Thrash, waste and sodomy: IE GC bug
  876. var iframe = documentCreateElement('iframe');
  877. var JS = 'java' + SCRIPT + ':';
  878. var iframeDocument;
  879. iframe.style.display = 'none';
  880. html.appendChild(iframe);
  881. // https://github.com/zloirock/core-js/issues/475
  882. iframe.src = String(JS);
  883. iframeDocument = iframe.contentWindow.document;
  884. iframeDocument.open();
  885. iframeDocument.write(scriptTag('document.F=Object'));
  886. iframeDocument.close();
  887. return iframeDocument.F;
  888. };
  889. // Check for document.domain and active x support
  890. // No need to use active x approach when document.domain is not set
  891. // see https://github.com/es-shims/es5-shim/issues/150
  892. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  893. // avoid IE GC bug
  894. var activeXDocument;
  895. var NullProtoObject = function () {
  896. try {
  897. activeXDocument = new ActiveXObject('htmlfile');
  898. } catch (error) { /* ignore */ }
  899. NullProtoObject = typeof document != 'undefined'
  900. ? document.domain && activeXDocument
  901. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  902. : NullProtoObjectViaIFrame()
  903. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  904. var length = enumBugKeys.length;
  905. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  906. return NullProtoObject();
  907. };
  908. hiddenKeys$1[IE_PROTO] = true;
  909. // `Object.create` method
  910. // https://tc39.es/ecma262/#sec-object.create
  911. var objectCreate = Object.create || function create(O, Properties) {
  912. var result;
  913. if (O !== null) {
  914. EmptyConstructor[PROTOTYPE] = anObject(O);
  915. result = new EmptyConstructor();
  916. EmptyConstructor[PROTOTYPE] = null;
  917. // add "__proto__" for Object.getPrototypeOf polyfill
  918. result[IE_PROTO] = O;
  919. } else result = NullProtoObject();
  920. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  921. };
  922. var UNSCOPABLES = wellKnownSymbol('unscopables');
  923. var ArrayPrototype = Array.prototype;
  924. // Array.prototype[@@unscopables]
  925. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  926. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  927. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  928. configurable: true,
  929. value: objectCreate(null)
  930. });
  931. }
  932. // add a key to Array.prototype[@@unscopables]
  933. var addToUnscopables = function (key) {
  934. ArrayPrototype[UNSCOPABLES][key] = true;
  935. };
  936. var $find = arrayIteration.find;
  937. var FIND = 'find';
  938. var SKIPS_HOLES = true;
  939. // Shouldn't skip holes
  940. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  941. // `Array.prototype.find` method
  942. // https://tc39.es/ecma262/#sec-array.prototype.find
  943. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  944. find: function find(callbackfn /* , that = undefined */) {
  945. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  946. }
  947. });
  948. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  949. addToUnscopables(FIND);
  950. // `Object.prototype.toString` method implementation
  951. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  952. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  953. return '[object ' + classof(this) + ']';
  954. };
  955. // `Object.prototype.toString` method
  956. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  957. if (!toStringTagSupport) {
  958. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  959. }
  960. var SPECIES$1 = wellKnownSymbol('species');
  961. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  962. // We can't use this feature detection in V8 since it causes
  963. // deoptimization and serious performance degradation
  964. // https://github.com/zloirock/core-js/issues/677
  965. return engineV8Version >= 51 || !fails(function () {
  966. var array = [];
  967. var constructor = array.constructor = {};
  968. constructor[SPECIES$1] = function () {
  969. return { foo: 1 };
  970. };
  971. return array[METHOD_NAME](Boolean).foo !== 1;
  972. });
  973. };
  974. var $map = arrayIteration.map;
  975. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('map');
  976. // `Array.prototype.map` method
  977. // https://tc39.es/ecma262/#sec-array.prototype.map
  978. // with adding support of @@species
  979. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  980. map: function map(callbackfn /* , thisArg */) {
  981. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  982. }
  983. });
  984. var String$1 = global_1.String;
  985. var toString_1 = function (argument) {
  986. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  987. return String$1(argument);
  988. };
  989. var createProperty = function (object, key, value) {
  990. var propertyKey = toPropertyKey(key);
  991. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  992. else object[propertyKey] = value;
  993. };
  994. var Array$2 = global_1.Array;
  995. var max$2 = Math.max;
  996. var arraySliceSimple = function (O, start, end) {
  997. var length = lengthOfArrayLike(O);
  998. var k = toAbsoluteIndex(start, length);
  999. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1000. var result = Array$2(max$2(fin - k, 0));
  1001. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1002. result.length = n;
  1003. return result;
  1004. };
  1005. var floor = Math.floor;
  1006. var mergeSort = function (array, comparefn) {
  1007. var length = array.length;
  1008. var middle = floor(length / 2);
  1009. return length < 8 ? insertionSort(array, comparefn) : merge(
  1010. array,
  1011. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  1012. mergeSort(arraySliceSimple(array, middle), comparefn),
  1013. comparefn
  1014. );
  1015. };
  1016. var insertionSort = function (array, comparefn) {
  1017. var length = array.length;
  1018. var i = 1;
  1019. var element, j;
  1020. while (i < length) {
  1021. j = i;
  1022. element = array[i];
  1023. while (j && comparefn(array[j - 1], element) > 0) {
  1024. array[j] = array[--j];
  1025. }
  1026. if (j !== i++) array[j] = element;
  1027. } return array;
  1028. };
  1029. var merge = function (array, left, right, comparefn) {
  1030. var llength = left.length;
  1031. var rlength = right.length;
  1032. var lindex = 0;
  1033. var rindex = 0;
  1034. while (lindex < llength || rindex < rlength) {
  1035. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1036. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1037. : lindex < llength ? left[lindex++] : right[rindex++];
  1038. } return array;
  1039. };
  1040. var arraySort = mergeSort;
  1041. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1042. var method = [][METHOD_NAME];
  1043. return !!method && fails(function () {
  1044. // eslint-disable-next-line no-useless-call -- required for testing
  1045. method.call(null, argument || function () { return 1; }, 1);
  1046. });
  1047. };
  1048. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  1049. var engineFfVersion = !!firefox && +firefox[1];
  1050. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  1051. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  1052. var engineWebkitVersion = !!webkit && +webkit[1];
  1053. var test = [];
  1054. var un$Sort = functionUncurryThis(test.sort);
  1055. var push = functionUncurryThis(test.push);
  1056. // IE8-
  1057. var FAILS_ON_UNDEFINED = fails(function () {
  1058. test.sort(undefined);
  1059. });
  1060. // V8 bug
  1061. var FAILS_ON_NULL = fails(function () {
  1062. test.sort(null);
  1063. });
  1064. // Old WebKit
  1065. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  1066. var STABLE_SORT = !fails(function () {
  1067. // feature detection can be too slow, so check engines versions
  1068. if (engineV8Version) return engineV8Version < 70;
  1069. if (engineFfVersion && engineFfVersion > 3) return;
  1070. if (engineIsIeOrEdge) return true;
  1071. if (engineWebkitVersion) return engineWebkitVersion < 603;
  1072. var result = '';
  1073. var code, chr, value, index;
  1074. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1075. for (code = 65; code < 76; code++) {
  1076. chr = String.fromCharCode(code);
  1077. switch (code) {
  1078. case 66: case 69: case 70: case 72: value = 3; break;
  1079. case 68: case 71: value = 4; break;
  1080. default: value = 2;
  1081. }
  1082. for (index = 0; index < 47; index++) {
  1083. test.push({ k: chr + index, v: value });
  1084. }
  1085. }
  1086. test.sort(function (a, b) { return b.v - a.v; });
  1087. for (index = 0; index < test.length; index++) {
  1088. chr = test[index].k.charAt(0);
  1089. if (result.charAt(result.length - 1) !== chr) result += chr;
  1090. }
  1091. return result !== 'DGBEFHACIJK';
  1092. });
  1093. var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  1094. var getSortCompare = function (comparefn) {
  1095. return function (x, y) {
  1096. if (y === undefined) return -1;
  1097. if (x === undefined) return 1;
  1098. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1099. return toString_1(x) > toString_1(y) ? 1 : -1;
  1100. };
  1101. };
  1102. // `Array.prototype.sort` method
  1103. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1104. _export({ target: 'Array', proto: true, forced: FORCED$2 }, {
  1105. sort: function sort(comparefn) {
  1106. if (comparefn !== undefined) aCallable(comparefn);
  1107. var array = toObject(this);
  1108. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  1109. var items = [];
  1110. var arrayLength = lengthOfArrayLike(array);
  1111. var itemsLength, index;
  1112. for (index = 0; index < arrayLength; index++) {
  1113. if (index in array) push(items, array[index]);
  1114. }
  1115. arraySort(items, getSortCompare(comparefn));
  1116. itemsLength = items.length;
  1117. index = 0;
  1118. while (index < itemsLength) array[index] = items[index++];
  1119. while (index < arrayLength) delete array[index++];
  1120. return array;
  1121. }
  1122. });
  1123. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1124. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  1125. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1126. var TypeError$2 = global_1.TypeError;
  1127. // We can't use this feature detection in V8 since it causes
  1128. // deoptimization and serious performance degradation
  1129. // https://github.com/zloirock/core-js/issues/679
  1130. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1131. var array = [];
  1132. array[IS_CONCAT_SPREADABLE] = false;
  1133. return array.concat()[0] !== array;
  1134. });
  1135. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1136. var isConcatSpreadable = function (O) {
  1137. if (!isObject(O)) return false;
  1138. var spreadable = O[IS_CONCAT_SPREADABLE];
  1139. return spreadable !== undefined ? !!spreadable : isArray(O);
  1140. };
  1141. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1142. // `Array.prototype.concat` method
  1143. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1144. // with adding support of @@isConcatSpreadable and @@species
  1145. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  1146. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1147. concat: function concat(arg) {
  1148. var O = toObject(this);
  1149. var A = arraySpeciesCreate(O, 0);
  1150. var n = 0;
  1151. var i, k, length, len, E;
  1152. for (i = -1, length = arguments.length; i < length; i++) {
  1153. E = i === -1 ? O : arguments[i];
  1154. if (isConcatSpreadable(E)) {
  1155. len = lengthOfArrayLike(E);
  1156. if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1157. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1158. } else {
  1159. if (n >= MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1160. createProperty(A, n++, E);
  1161. }
  1162. }
  1163. A.length = n;
  1164. return A;
  1165. }
  1166. });
  1167. var $includes = arrayIncludes.includes;
  1168. // `Array.prototype.includes` method
  1169. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1170. _export({ target: 'Array', proto: true }, {
  1171. includes: function includes(el /* , fromIndex = 0 */) {
  1172. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1173. }
  1174. });
  1175. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1176. addToUnscopables('includes');
  1177. // eslint-disable-next-line es/no-object-assign -- safe
  1178. var $assign = Object.assign;
  1179. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1180. var defineProperty = Object.defineProperty;
  1181. var concat = functionUncurryThis([].concat);
  1182. // `Object.assign` method
  1183. // https://tc39.es/ecma262/#sec-object.assign
  1184. var objectAssign = !$assign || fails(function () {
  1185. // should have correct order of operations (Edge bug)
  1186. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1187. enumerable: true,
  1188. get: function () {
  1189. defineProperty(this, 'b', {
  1190. value: 3,
  1191. enumerable: false
  1192. });
  1193. }
  1194. }), { b: 2 })).b !== 1) return true;
  1195. // should work with symbols and should have deterministic property order (V8 bug)
  1196. var A = {};
  1197. var B = {};
  1198. // eslint-disable-next-line es/no-symbol -- safe
  1199. var symbol = Symbol();
  1200. var alphabet = 'abcdefghijklmnopqrst';
  1201. A[symbol] = 7;
  1202. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1203. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1204. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1205. var T = toObject(target);
  1206. var argumentsLength = arguments.length;
  1207. var index = 1;
  1208. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1209. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1210. while (argumentsLength > index) {
  1211. var S = indexedObject(arguments[index++]);
  1212. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1213. var length = keys.length;
  1214. var j = 0;
  1215. var key;
  1216. while (length > j) {
  1217. key = keys[j++];
  1218. if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key];
  1219. }
  1220. } return T;
  1221. } : $assign;
  1222. // `Object.assign` method
  1223. // https://tc39.es/ecma262/#sec-object.assign
  1224. // eslint-disable-next-line es/no-object-assign -- required for testing
  1225. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  1226. assign: objectAssign
  1227. });
  1228. var arraySlice = functionUncurryThis([].slice);
  1229. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1230. var SPECIES = wellKnownSymbol('species');
  1231. var Array$1 = global_1.Array;
  1232. var max$1 = Math.max;
  1233. // `Array.prototype.slice` method
  1234. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1235. // fallback for not array-like ES3 strings and DOM objects
  1236. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1237. slice: function slice(start, end) {
  1238. var O = toIndexedObject(this);
  1239. var length = lengthOfArrayLike(O);
  1240. var k = toAbsoluteIndex(start, length);
  1241. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1242. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1243. var Constructor, result, n;
  1244. if (isArray(O)) {
  1245. Constructor = O.constructor;
  1246. // cross-realm fallback
  1247. if (isConstructor(Constructor) && (Constructor === Array$1 || isArray(Constructor.prototype))) {
  1248. Constructor = undefined;
  1249. } else if (isObject(Constructor)) {
  1250. Constructor = Constructor[SPECIES];
  1251. if (Constructor === null) Constructor = undefined;
  1252. }
  1253. if (Constructor === Array$1 || Constructor === undefined) {
  1254. return arraySlice(O, k, fin);
  1255. }
  1256. }
  1257. result = new (Constructor === undefined ? Array$1 : Constructor)(max$1(fin - k, 0));
  1258. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1259. result.length = n;
  1260. return result;
  1261. }
  1262. });
  1263. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  1264. var TypeError$1 = global_1.TypeError;
  1265. var max = Math.max;
  1266. var min = Math.min;
  1267. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1268. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  1269. // `Array.prototype.splice` method
  1270. // https://tc39.es/ecma262/#sec-array.prototype.splice
  1271. // with adding support of @@species
  1272. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1273. splice: function splice(start, deleteCount /* , ...items */) {
  1274. var O = toObject(this);
  1275. var len = lengthOfArrayLike(O);
  1276. var actualStart = toAbsoluteIndex(start, len);
  1277. var argumentsLength = arguments.length;
  1278. var insertCount, actualDeleteCount, A, k, from, to;
  1279. if (argumentsLength === 0) {
  1280. insertCount = actualDeleteCount = 0;
  1281. } else if (argumentsLength === 1) {
  1282. insertCount = 0;
  1283. actualDeleteCount = len - actualStart;
  1284. } else {
  1285. insertCount = argumentsLength - 2;
  1286. actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  1287. }
  1288. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  1289. throw TypeError$1(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  1290. }
  1291. A = arraySpeciesCreate(O, actualDeleteCount);
  1292. for (k = 0; k < actualDeleteCount; k++) {
  1293. from = actualStart + k;
  1294. if (from in O) createProperty(A, k, O[from]);
  1295. }
  1296. A.length = actualDeleteCount;
  1297. if (insertCount < actualDeleteCount) {
  1298. for (k = actualStart; k < len - actualDeleteCount; k++) {
  1299. from = k + actualDeleteCount;
  1300. to = k + insertCount;
  1301. if (from in O) O[to] = O[from];
  1302. else delete O[to];
  1303. }
  1304. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  1305. } else if (insertCount > actualDeleteCount) {
  1306. for (k = len - actualDeleteCount; k > actualStart; k--) {
  1307. from = k + actualDeleteCount - 1;
  1308. to = k + insertCount - 1;
  1309. if (from in O) O[to] = O[from];
  1310. else delete O[to];
  1311. }
  1312. }
  1313. for (k = 0; k < insertCount; k++) {
  1314. O[k + actualStart] = arguments[k + 2];
  1315. }
  1316. O.length = len - actualDeleteCount + insertCount;
  1317. return A;
  1318. }
  1319. });
  1320. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1321. var $IndexOf = arrayIncludes.indexOf;
  1322. var un$IndexOf = functionUncurryThis([].indexOf);
  1323. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1324. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1325. // `Array.prototype.indexOf` method
  1326. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1327. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1328. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1329. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1330. return NEGATIVE_ZERO
  1331. // convert -0 to +0
  1332. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1333. : $IndexOf(this, searchElement, fromIndex);
  1334. }
  1335. });
  1336. // a string of all valid unicode whitespaces
  1337. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1338. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1339. var replace = functionUncurryThis(''.replace);
  1340. var whitespace = '[' + whitespaces + ']';
  1341. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1342. var rtrim = RegExp(whitespace + whitespace + '*$');
  1343. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1344. var createMethod = function (TYPE) {
  1345. return function ($this) {
  1346. var string = toString_1(requireObjectCoercible($this));
  1347. if (TYPE & 1) string = replace(string, ltrim, '');
  1348. if (TYPE & 2) string = replace(string, rtrim, '');
  1349. return string;
  1350. };
  1351. };
  1352. var stringTrim = {
  1353. // `String.prototype.{ trimLeft, trimStart }` methods
  1354. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1355. start: createMethod(1),
  1356. // `String.prototype.{ trimRight, trimEnd }` methods
  1357. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1358. end: createMethod(2),
  1359. // `String.prototype.trim` method
  1360. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1361. trim: createMethod(3)
  1362. };
  1363. var trim = stringTrim.trim;
  1364. var charAt = functionUncurryThis(''.charAt);
  1365. var n$ParseFloat = global_1.parseFloat;
  1366. var Symbol$1 = global_1.Symbol;
  1367. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  1368. var FORCED = 1 / n$ParseFloat(whitespaces + '-0') !== -Infinity
  1369. // MS Edge 18- broken with boxed symbols
  1370. || (ITERATOR && !fails(function () { n$ParseFloat(Object(ITERATOR)); }));
  1371. // `parseFloat` method
  1372. // https://tc39.es/ecma262/#sec-parsefloat-string
  1373. var numberParseFloat = FORCED ? function parseFloat(string) {
  1374. var trimmedString = trim(toString_1(string));
  1375. var result = n$ParseFloat(trimmedString);
  1376. return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
  1377. } : n$ParseFloat;
  1378. // `parseFloat` method
  1379. // https://tc39.es/ecma262/#sec-parsefloat-string
  1380. _export({ global: true, forced: parseFloat != numberParseFloat }, {
  1381. parseFloat: numberParseFloat
  1382. });
  1383. // `RegExp.prototype.flags` getter implementation
  1384. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1385. var regexpFlags = function () {
  1386. var that = anObject(this);
  1387. var result = '';
  1388. if (that.global) result += 'g';
  1389. if (that.ignoreCase) result += 'i';
  1390. if (that.multiline) result += 'm';
  1391. if (that.dotAll) result += 's';
  1392. if (that.unicode) result += 'u';
  1393. if (that.sticky) result += 'y';
  1394. return result;
  1395. };
  1396. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1397. var TO_STRING = 'toString';
  1398. var RegExpPrototype = RegExp.prototype;
  1399. var n$ToString = RegExpPrototype[TO_STRING];
  1400. var getFlags = functionUncurryThis(regexpFlags);
  1401. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1402. // FF44- RegExp#toString has a wrong name
  1403. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1404. // `RegExp.prototype.toString` method
  1405. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1406. if (NOT_GENERIC || INCORRECT_NAME) {
  1407. redefine(RegExp.prototype, TO_STRING, function toString() {
  1408. var R = anObject(this);
  1409. var p = toString_1(R.source);
  1410. var rf = R.flags;
  1411. var f = toString_1(rf === undefined && objectIsPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
  1412. return '/' + p + '/' + f;
  1413. }, { unsafe: true });
  1414. }
  1415. /**
  1416. * @author Nadim Basalamah <dimbslmh@gmail.com>
  1417. * @version: v1.1.0
  1418. * https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
  1419. * Modification: ErwannNevou <https://github.com/ErwannNevou>
  1420. */
  1421. var isSingleSort = false;
  1422. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1423. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults.icons, {
  1424. plus: {
  1425. bootstrap3: 'glyphicon-plus',
  1426. bootstrap4: 'fa-plus',
  1427. bootstrap5: 'bi-plus',
  1428. semantic: 'fa-plus',
  1429. materialize: 'plus',
  1430. foundation: 'fa-plus',
  1431. bulma: 'fa-plus',
  1432. 'bootstrap-table': 'icon-plus'
  1433. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock',
  1434. minus: {
  1435. bootstrap3: 'glyphicon-minus',
  1436. bootstrap4: 'fa-minus',
  1437. bootstrap5: 'bi-dash',
  1438. semantic: 'fa-minus',
  1439. materialize: 'minus',
  1440. foundation: 'fa-minus',
  1441. bulma: 'fa-minus',
  1442. 'bootstrap-table': 'icon-minus'
  1443. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock',
  1444. sort: {
  1445. bootstrap3: 'glyphicon-sort',
  1446. bootstrap4: 'fa-sort',
  1447. bootstrap5: 'bi-arrow-down-up',
  1448. semantic: 'fa-sort',
  1449. materialize: 'sort',
  1450. foundation: 'fa-sort',
  1451. bulma: 'fa-sort',
  1452. 'bootstrap-table': 'icon-sort-amount-asc'
  1453. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock'
  1454. });
  1455. var theme = {
  1456. bootstrap3: {
  1457. html: {
  1458. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n <h4 class=\"modal-title\" id=\"%sLabel\">%s</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\">\n <button id=\"add\" type=\"button\" class=\"btn btn-default\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-default\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1459. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1460. multipleSortSelect: '<select class="%s %s form-control">'
  1461. }
  1462. },
  1463. bootstrap4: {
  1464. html: {
  1465. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1466. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1467. multipleSortSelect: '<select class="%s %s form-control">'
  1468. }
  1469. },
  1470. bootstrap5: {
  1471. html: {
  1472. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1473. multipleSortButton: '<button class="multi-sort %s" type="button" data-bs-toggle="modal" data-bs-target="#%s" title="%s">%s</button>',
  1474. multipleSortSelect: '<select class="%s %s form-control">'
  1475. }
  1476. },
  1477. semantic: {
  1478. html: {
  1479. multipleSortModal: "\n <div class=\"ui modal tiny\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <i class=\"close icon\"></i>\n <div class=\"header\" id=\"%sLabel\">\n %s\n </div>\n <div class=\"image content\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"ui button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"ui button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <div class=\"ui button deny\">%s</div>\n <div class=\"ui button approve multi-sort-order-button\">%s</div>\n </div>\n </div>\n ",
  1480. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1481. multipleSortSelect: '<select class="%s %s">'
  1482. }
  1483. },
  1484. materialize: {
  1485. html: {
  1486. multipleSortModal: "\n <div id=\"%s\" class=\"modal\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-content\" id=\"%sLabel\">\n <h4>%s</h4>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn\">%s</a>\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn multi-sort-order-button\">%s</a>\n </div>\n </div>\n </div>\n ",
  1487. multipleSortButton: '<a class="multi-sort %s modal-trigger" href="#%s" type="button" data-toggle="modal" title="%s">%s</a>',
  1488. multipleSortSelect: '<select class="%s %s browser-default">'
  1489. }
  1490. },
  1491. foundation: {
  1492. html: {
  1493. multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
  1494. multipleSortButton: '<button class="multi-sort %s" data-open="%s" title="%s">%s</button>',
  1495. multipleSortSelect: '<select class="%s %s browser-default">'
  1496. }
  1497. },
  1498. bulma: {
  1499. html: {
  1500. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <button type=\"button\" class=\"waves-effect waves-light button\" data-close>%s</button>\n <button type=\"button\" class=\"waves-effect waves-light button multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n ",
  1501. multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
  1502. multipleSortSelect: '<select class="%s %s browser-default">'
  1503. }
  1504. },
  1505. 'bootstrap-table': {
  1506. html: {
  1507. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"mt-30\">\n <button type=\"button\" class=\"btn\" data-close>%s</button>\n <button type=\"button\" class=\"btn multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1508. multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
  1509. multipleSortSelect: '<select class="%s %s browser-default">'
  1510. }
  1511. }
  1512. }[$__default["default"].fn.bootstrapTable.theme];
  1513. var showSortModal = function showSortModal(that) {
  1514. var _selector = that.sortModalSelector;
  1515. var _id = "#".concat(_selector);
  1516. var o = that.options;
  1517. if (!$__default["default"](_id).hasClass('modal')) {
  1518. var sModal = Utils.sprintf(theme.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
  1519. $__default["default"]('body').append($__default["default"](sModal));
  1520. that.$sortModal = $__default["default"](_id);
  1521. var $rows = that.$sortModal.find('tbody > tr');
  1522. that.$sortModal.off('click', '#add').on('click', '#add', function () {
  1523. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1524. var current = that.$sortModal.find('tbody tr').length;
  1525. if (current < total) {
  1526. current++;
  1527. that.addLevel();
  1528. that.setButtonStates();
  1529. }
  1530. });
  1531. that.$sortModal.off('click', '#delete').on('click', '#delete', function () {
  1532. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1533. var current = that.$sortModal.find('tbody tr').length;
  1534. if (current > 1 && current <= total) {
  1535. current--;
  1536. that.$sortModal.find('tbody tr:last').remove();
  1537. that.setButtonStates();
  1538. }
  1539. });
  1540. that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
  1541. var $rows = that.$sortModal.find('tbody > tr');
  1542. var $alert = that.$sortModal.find('div.alert');
  1543. var fields = [];
  1544. var results = [];
  1545. var sortPriority = $__default["default"].map($rows, function (row) {
  1546. var $row = $__default["default"](row);
  1547. var name = $row.find('.multi-sort-name').val();
  1548. var order = $row.find('.multi-sort-order').val();
  1549. fields.push(name);
  1550. return {
  1551. sortName: name,
  1552. sortOrder: order
  1553. };
  1554. });
  1555. var sorted_fields = fields.sort();
  1556. for (var i = 0; i < fields.length - 1; i++) {
  1557. if (sorted_fields[i + 1] === sorted_fields[i]) {
  1558. results.push(sorted_fields[i]);
  1559. }
  1560. }
  1561. if (results.length > 0) {
  1562. if ($alert.length === 0) {
  1563. $alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
  1564. $__default["default"]($alert).insertBefore(that.$sortModal.find('.bars'));
  1565. }
  1566. } else {
  1567. if ($alert.length === 1) {
  1568. $__default["default"]($alert).remove();
  1569. }
  1570. if (['bootstrap3', 'bootstrap4', 'bootstrap5'].includes($__default["default"].fn.bootstrapTable.theme)) {
  1571. that.$sortModal.modal('hide');
  1572. }
  1573. that.multiSort(sortPriority);
  1574. }
  1575. });
  1576. if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
  1577. if (that.options.sortName) {
  1578. that.options.sortPriority = [{
  1579. sortName: that.options.sortName,
  1580. sortOrder: that.options.sortOrder
  1581. }];
  1582. }
  1583. }
  1584. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1585. if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
  1586. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1587. that.addLevel(i, that.options.sortPriority[i]);
  1588. }
  1589. }
  1590. } else {
  1591. that.addLevel(0);
  1592. }
  1593. that.setButtonStates();
  1594. }
  1595. };
  1596. $__default["default"].fn.bootstrapTable.methods.push('multipleSort');
  1597. $__default["default"].fn.bootstrapTable.methods.push('multiSort');
  1598. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1599. showMultiSort: false,
  1600. showMultiSortButton: true,
  1601. multiSortStrictSort: false,
  1602. sortPriority: null,
  1603. onMultipleSort: function onMultipleSort() {
  1604. return false;
  1605. }
  1606. });
  1607. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  1608. 'multiple-sort.bs.table': 'onMultipleSort'
  1609. });
  1610. $__default["default"].extend($__default["default"].fn.bootstrapTable.locales, {
  1611. formatMultipleSort: function formatMultipleSort() {
  1612. return 'Multiple Sort';
  1613. },
  1614. formatAddLevel: function formatAddLevel() {
  1615. return 'Add Level';
  1616. },
  1617. formatDeleteLevel: function formatDeleteLevel() {
  1618. return 'Delete Level';
  1619. },
  1620. formatColumn: function formatColumn() {
  1621. return 'Column';
  1622. },
  1623. formatOrder: function formatOrder() {
  1624. return 'Order';
  1625. },
  1626. formatSortBy: function formatSortBy() {
  1627. return 'Sort by';
  1628. },
  1629. formatThenBy: function formatThenBy() {
  1630. return 'Then by';
  1631. },
  1632. formatSort: function formatSort() {
  1633. return 'Sort';
  1634. },
  1635. formatCancel: function formatCancel() {
  1636. return 'Cancel';
  1637. },
  1638. formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
  1639. return 'Duplicate(s) detected!';
  1640. },
  1641. formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
  1642. return 'Please remove or change any duplicate column.';
  1643. },
  1644. formatSortOrders: function formatSortOrders() {
  1645. return {
  1646. asc: 'Ascending',
  1647. desc: 'Descending'
  1648. };
  1649. }
  1650. });
  1651. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, $__default["default"].fn.bootstrapTable.locales);
  1652. var BootstrapTable = $__default["default"].fn.bootstrapTable.Constructor;
  1653. var _initToolbar = BootstrapTable.prototype.initToolbar;
  1654. var _destroy = BootstrapTable.prototype.destroy;
  1655. BootstrapTable.prototype.initToolbar = function () {
  1656. var _this = this;
  1657. this.showToolbar = this.showToolbar || this.options.showMultiSort;
  1658. var that = this;
  1659. var sortModalSelector = "sortModal_".concat(this.$el.attr('id'));
  1660. var sortModalId = "#".concat(sortModalSelector);
  1661. var $multiSortBtn = this.$toolbar.find('div.multi-sort');
  1662. var o = this.options;
  1663. this.$sortModal = $__default["default"](sortModalId);
  1664. this.sortModalSelector = sortModalSelector;
  1665. if (that.options.sortPriority !== null) {
  1666. that.onMultipleSort();
  1667. }
  1668. if (this.options.showMultiSortButton) {
  1669. this.buttons = Object.assign(this.buttons, {
  1670. multipleSort: {
  1671. html: Utils.sprintf(theme.html.multipleSortButton, that.constants.buttonsClass, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort))
  1672. }
  1673. });
  1674. }
  1675. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1676. args[_key] = arguments[_key];
  1677. }
  1678. _initToolbar.apply(this, Array.prototype.slice.apply(args));
  1679. if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null) {
  1680. var t = that.options.queryParams;
  1681. that.options.queryParams = function (params) {
  1682. params.multiSort = that.options.sortPriority;
  1683. return t(params);
  1684. };
  1685. }
  1686. if (this.options.showMultiSort) {
  1687. if (!$multiSortBtn.length && this.options.showMultiSortButton) {
  1688. if ($__default["default"].fn.bootstrapTable.theme === 'semantic') {
  1689. this.$toolbar.find('.multi-sort').on('click', function () {
  1690. $__default["default"](sortModalId).modal('show');
  1691. });
  1692. } else if ($__default["default"].fn.bootstrapTable.theme === 'materialize') {
  1693. this.$toolbar.find('.multi-sort').on('click', function () {
  1694. $__default["default"](sortModalId).modal();
  1695. });
  1696. } else if ($__default["default"].fn.bootstrapTable.theme === 'bootstrap-table') {
  1697. this.$toolbar.find('.multi-sort').on('click', function () {
  1698. $__default["default"](sortModalId).addClass('show');
  1699. });
  1700. } else if ($__default["default"].fn.bootstrapTable.theme === 'foundation') {
  1701. this.$toolbar.find('.multi-sort').on('click', function () {
  1702. if (!_this.foundationModal) {
  1703. // eslint-disable-next-line no-undef
  1704. _this.foundationModal = new Foundation.Reveal($__default["default"](sortModalId));
  1705. }
  1706. _this.foundationModal.open();
  1707. });
  1708. } else if ($__default["default"].fn.bootstrapTable.theme === 'bulma') {
  1709. this.$toolbar.find('.multi-sort').on('click', function () {
  1710. $__default["default"]('html').toggleClass('is-clipped');
  1711. $__default["default"](sortModalId).toggleClass('is-active');
  1712. $__default["default"]('button[data-close]').one('click', function () {
  1713. $__default["default"]('html').toggleClass('is-clipped');
  1714. $__default["default"](sortModalId).toggleClass('is-active');
  1715. });
  1716. });
  1717. }
  1718. showSortModal(that);
  1719. }
  1720. this.$el.on('sort.bs.table', function () {
  1721. isSingleSort = true;
  1722. });
  1723. this.$el.on('multiple-sort.bs.table', function () {
  1724. isSingleSort = false;
  1725. });
  1726. this.$el.on('load-success.bs.table', function () {
  1727. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1728. that.onMultipleSort();
  1729. }
  1730. });
  1731. this.$el.on('column-switch.bs.table', function (field, checked) {
  1732. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1733. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1734. if (that.options.sortPriority[i].sortName === checked) {
  1735. that.options.sortPriority.splice(i, 1);
  1736. }
  1737. }
  1738. that.assignSortableArrows();
  1739. }
  1740. that.$sortModal.remove();
  1741. showSortModal(that);
  1742. });
  1743. this.$el.on('reset-view.bs.table', function () {
  1744. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object') {
  1745. that.assignSortableArrows();
  1746. }
  1747. });
  1748. }
  1749. };
  1750. BootstrapTable.prototype.destroy = function () {
  1751. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1752. args[_key2] = arguments[_key2];
  1753. }
  1754. _destroy.apply(this, Array.prototype.slice.apply(args));
  1755. if (this.options.showMultiSort) {
  1756. this.enableCustomSort = false;
  1757. this.$sortModal.remove();
  1758. }
  1759. };
  1760. BootstrapTable.prototype.multipleSort = function () {
  1761. var that = this;
  1762. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1763. that.onMultipleSort();
  1764. }
  1765. };
  1766. BootstrapTable.prototype.onMultipleSort = function () {
  1767. var that = this;
  1768. var cmp = function cmp(x, y) {
  1769. return x > y ? 1 : x < y ? -1 : 0;
  1770. };
  1771. var arrayCmp = function arrayCmp(a, b) {
  1772. var arr1 = [];
  1773. var arr2 = [];
  1774. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1775. var fieldName = that.options.sortPriority[i].sortName;
  1776. var fieldIndex = that.header.fields.indexOf(fieldName);
  1777. var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
  1778. if (that.header.sortNames[fieldIndex]) {
  1779. fieldName = that.header.sortNames[fieldIndex];
  1780. }
  1781. var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
  1782. var aa = Utils.getItemField(a, fieldName);
  1783. var bb = Utils.getItemField(b, fieldName);
  1784. var value1 = $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb]);
  1785. var value2 = $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa]);
  1786. if (value1 !== undefined && value2 !== undefined) {
  1787. arr1.push(order * value1);
  1788. arr2.push(order * value2);
  1789. continue;
  1790. }
  1791. if (aa === undefined || aa === null) aa = '';
  1792. if (bb === undefined || bb === null) bb = '';
  1793. if ($__default["default"].isNumeric(aa) && $__default["default"].isNumeric(bb)) {
  1794. aa = parseFloat(aa);
  1795. bb = parseFloat(bb);
  1796. } else {
  1797. aa = aa.toString();
  1798. bb = bb.toString();
  1799. if (that.options.multiSortStrictSort) {
  1800. aa = aa.toLowerCase();
  1801. bb = bb.toLowerCase();
  1802. }
  1803. }
  1804. arr1.push(order * cmp(aa, bb));
  1805. arr2.push(order * cmp(bb, aa));
  1806. }
  1807. return cmp(arr1, arr2);
  1808. };
  1809. this.enableCustomSort = true;
  1810. this.data.sort(function (a, b) {
  1811. return arrayCmp(a, b);
  1812. });
  1813. this.initBody();
  1814. this.assignSortableArrows();
  1815. this.trigger('multiple-sort');
  1816. };
  1817. BootstrapTable.prototype.addLevel = function (index, sortPriority) {
  1818. var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
  1819. this.$sortModal.find('tbody').append($__default["default"]('<tr>').append($__default["default"]('<td>').text(text)).append($__default["default"]('<td>').append($__default["default"](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($__default["default"]('<td>').append($__default["default"](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
  1820. var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
  1821. var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
  1822. $__default["default"].each(this.columns, function (i, column) {
  1823. if (column.sortable === false || column.visible === false) {
  1824. return true;
  1825. }
  1826. $multiSortName.append("<option value=\"".concat(column.field, "\">").concat(column.title, "</option>"));
  1827. });
  1828. $__default["default"].each(this.options.formatSortOrders(), function (value, order) {
  1829. $multiSortOrder.append("<option value=\"".concat(value, "\">").concat(order, "</option>"));
  1830. });
  1831. if (sortPriority !== undefined) {
  1832. $multiSortName.find("option[value=\"".concat(sortPriority.sortName, "\"]")).attr('selected', true);
  1833. $multiSortOrder.find("option[value=\"".concat(sortPriority.sortOrder, "\"]")).attr('selected', true);
  1834. }
  1835. };
  1836. BootstrapTable.prototype.assignSortableArrows = function () {
  1837. var that = this;
  1838. var headers = that.$header.find('th');
  1839. for (var i = 0; i < headers.length; i++) {
  1840. for (var c = 0; c < that.options.sortPriority.length; c++) {
  1841. if ($__default["default"](headers[i]).data('field') === that.options.sortPriority[c].sortName) {
  1842. $__default["default"](headers[i]).find('.sortable').removeClass('desc asc').addClass(that.options.sortPriority[c].sortOrder);
  1843. }
  1844. }
  1845. }
  1846. };
  1847. BootstrapTable.prototype.setButtonStates = function () {
  1848. var total = this.$sortModal.find('.multi-sort-name:first option').length;
  1849. var current = this.$sortModal.find('tbody tr').length;
  1850. if (current === total) {
  1851. this.$sortModal.find('#add').attr('disabled', 'disabled');
  1852. }
  1853. if (current > 1) {
  1854. this.$sortModal.find('#delete').removeAttr('disabled');
  1855. }
  1856. if (current < total) {
  1857. this.$sortModal.find('#add').removeAttr('disabled');
  1858. }
  1859. if (current === 1) {
  1860. this.$sortModal.find('#delete').attr('disabled', 'disabled');
  1861. }
  1862. };
  1863. BootstrapTable.prototype.multiSort = function (sortPriority) {
  1864. var _this2 = this;
  1865. this.options.sortPriority = sortPriority;
  1866. this.options.sortName = undefined;
  1867. if (this.options.sidePagination === 'server') {
  1868. var queryParams = this.options.queryParams;
  1869. this.options.queryParams = function (params) {
  1870. params.multiSort = _this2.options.sortPriority;
  1871. return $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(_this2.options, queryParams, [params]);
  1872. };
  1873. isSingleSort = false;
  1874. this.initServer(this.options.silentSort);
  1875. return;
  1876. }
  1877. this.onMultipleSort();
  1878. };
  1879. }));