bootstrap-table-multiple-sort.js 104 KB

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