utils.js 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BootstrapTable = {}, global.jQuery));
  5. })(this, (function (exports, $) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  17. function createCommonjsModule(fn, module) {
  18. return module = { exports: {} }, fn(module, module.exports), module.exports;
  19. }
  20. var check = function (it) {
  21. return it && it.Math == Math && it;
  22. };
  23. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  24. var global_1 =
  25. // eslint-disable-next-line es/no-global-this -- safe
  26. check(typeof globalThis == 'object' && globalThis) ||
  27. check(typeof window == 'object' && window) ||
  28. // eslint-disable-next-line no-restricted-globals -- safe
  29. check(typeof self == 'object' && self) ||
  30. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  31. // eslint-disable-next-line no-new-func -- fallback
  32. (function () { return this; })() || Function('return this')();
  33. var fails = function (exec) {
  34. try {
  35. return !!exec();
  36. } catch (error) {
  37. return true;
  38. }
  39. };
  40. // Detect IE8's incomplete defineProperty implementation
  41. var descriptors = !fails(function () {
  42. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  43. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  44. });
  45. var functionBindNative = !fails(function () {
  46. var test = (function () { /* empty */ }).bind();
  47. // eslint-disable-next-line no-prototype-builtins -- safe
  48. return typeof test != 'function' || test.hasOwnProperty('prototype');
  49. });
  50. var call$2 = Function.prototype.call;
  51. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  52. return call$2.apply(call$2, arguments);
  53. };
  54. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  55. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  56. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  57. // Nashorn ~ JDK8 bug
  58. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  59. // `Object.prototype.propertyIsEnumerable` method implementation
  60. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  61. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  62. var descriptor = getOwnPropertyDescriptor$1(this, V);
  63. return !!descriptor && descriptor.enumerable;
  64. } : $propertyIsEnumerable;
  65. var objectPropertyIsEnumerable = {
  66. f: f$5
  67. };
  68. var createPropertyDescriptor = function (bitmap, value) {
  69. return {
  70. enumerable: !(bitmap & 1),
  71. configurable: !(bitmap & 2),
  72. writable: !(bitmap & 4),
  73. value: value
  74. };
  75. };
  76. var FunctionPrototype$2 = Function.prototype;
  77. var bind$1 = FunctionPrototype$2.bind;
  78. var call$1 = FunctionPrototype$2.call;
  79. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  80. var functionUncurryThis = functionBindNative ? function (fn) {
  81. return fn && uncurryThis(fn);
  82. } : function (fn) {
  83. return fn && function () {
  84. return call$1.apply(fn, arguments);
  85. };
  86. };
  87. var toString$1 = functionUncurryThis({}.toString);
  88. var stringSlice$5 = functionUncurryThis(''.slice);
  89. var classofRaw = function (it) {
  90. return stringSlice$5(toString$1(it), 8, -1);
  91. };
  92. var Object$4 = global_1.Object;
  93. var split = functionUncurryThis(''.split);
  94. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  95. var indexedObject = fails(function () {
  96. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  97. // eslint-disable-next-line no-prototype-builtins -- safe
  98. return !Object$4('z').propertyIsEnumerable(0);
  99. }) ? function (it) {
  100. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  101. } : Object$4;
  102. var TypeError$a = global_1.TypeError;
  103. // `RequireObjectCoercible` abstract operation
  104. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  105. var requireObjectCoercible = function (it) {
  106. if (it == undefined) throw TypeError$a("Can't call method on " + it);
  107. return it;
  108. };
  109. // toObject with fallback for non-array-like ES3 strings
  110. var toIndexedObject = function (it) {
  111. return indexedObject(requireObjectCoercible(it));
  112. };
  113. // `IsCallable` abstract operation
  114. // https://tc39.es/ecma262/#sec-iscallable
  115. var isCallable = function (argument) {
  116. return typeof argument == 'function';
  117. };
  118. var isObject = function (it) {
  119. return typeof it == 'object' ? it !== null : isCallable(it);
  120. };
  121. var aFunction = function (argument) {
  122. return isCallable(argument) ? argument : undefined;
  123. };
  124. var getBuiltIn = function (namespace, method) {
  125. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  126. };
  127. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  128. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  129. var process = global_1.process;
  130. var Deno = global_1.Deno;
  131. var versions = process && process.versions || Deno && Deno.version;
  132. var v8 = versions && versions.v8;
  133. var match, version;
  134. if (v8) {
  135. match = v8.split('.');
  136. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  137. // but their correct versions are not interesting for us
  138. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  139. }
  140. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  141. // so check `userAgent` even if `.v8` exists, but 0
  142. if (!version && engineUserAgent) {
  143. match = engineUserAgent.match(/Edge\/(\d+)/);
  144. if (!match || match[1] >= 74) {
  145. match = engineUserAgent.match(/Chrome\/(\d+)/);
  146. if (match) version = +match[1];
  147. }
  148. }
  149. var engineV8Version = version;
  150. /* eslint-disable es/no-symbol -- required for testing */
  151. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  152. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  153. var symbol = Symbol();
  154. // Chrome 38 Symbol has incorrect toString conversion
  155. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  156. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  157. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  158. !Symbol.sham && engineV8Version && engineV8Version < 41;
  159. });
  160. /* eslint-disable es/no-symbol -- required for testing */
  161. var useSymbolAsUid = nativeSymbol
  162. && !Symbol.sham
  163. && typeof Symbol.iterator == 'symbol';
  164. var Object$3 = global_1.Object;
  165. var isSymbol = useSymbolAsUid ? function (it) {
  166. return typeof it == 'symbol';
  167. } : function (it) {
  168. var $Symbol = getBuiltIn('Symbol');
  169. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  170. };
  171. var String$3 = global_1.String;
  172. var tryToString = function (argument) {
  173. try {
  174. return String$3(argument);
  175. } catch (error) {
  176. return 'Object';
  177. }
  178. };
  179. var TypeError$9 = global_1.TypeError;
  180. // `Assert: IsCallable(argument) is true`
  181. var aCallable = function (argument) {
  182. if (isCallable(argument)) return argument;
  183. throw TypeError$9(tryToString(argument) + ' is not a function');
  184. };
  185. // `GetMethod` abstract operation
  186. // https://tc39.es/ecma262/#sec-getmethod
  187. var getMethod = function (V, P) {
  188. var func = V[P];
  189. return func == null ? undefined : aCallable(func);
  190. };
  191. var TypeError$8 = global_1.TypeError;
  192. // `OrdinaryToPrimitive` abstract operation
  193. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  194. var ordinaryToPrimitive = function (input, pref) {
  195. var fn, val;
  196. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  197. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  198. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  199. throw TypeError$8("Can't convert object to primitive value");
  200. };
  201. // eslint-disable-next-line es/no-object-defineproperty -- safe
  202. var defineProperty = Object.defineProperty;
  203. var setGlobal = function (key, value) {
  204. try {
  205. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  206. } catch (error) {
  207. global_1[key] = value;
  208. } return value;
  209. };
  210. var SHARED = '__core-js_shared__';
  211. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  212. var sharedStore = store$1;
  213. var shared = createCommonjsModule(function (module) {
  214. (module.exports = function (key, value) {
  215. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  216. })('versions', []).push({
  217. version: '3.21.1',
  218. mode: 'global',
  219. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  220. license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
  221. source: 'https://github.com/zloirock/core-js'
  222. });
  223. });
  224. var Object$2 = global_1.Object;
  225. // `ToObject` abstract operation
  226. // https://tc39.es/ecma262/#sec-toobject
  227. var toObject = function (argument) {
  228. return Object$2(requireObjectCoercible(argument));
  229. };
  230. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  231. // `HasOwnProperty` abstract operation
  232. // https://tc39.es/ecma262/#sec-hasownproperty
  233. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  234. return hasOwnProperty(toObject(it), key);
  235. };
  236. var id = 0;
  237. var postfix = Math.random();
  238. var toString = functionUncurryThis(1.0.toString);
  239. var uid = function (key) {
  240. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  241. };
  242. var WellKnownSymbolsStore = shared('wks');
  243. var Symbol$1 = global_1.Symbol;
  244. var symbolFor = Symbol$1 && Symbol$1['for'];
  245. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  246. var wellKnownSymbol = function (name) {
  247. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  248. var description = 'Symbol.' + name;
  249. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  250. WellKnownSymbolsStore[name] = Symbol$1[name];
  251. } else if (useSymbolAsUid && symbolFor) {
  252. WellKnownSymbolsStore[name] = symbolFor(description);
  253. } else {
  254. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  255. }
  256. } return WellKnownSymbolsStore[name];
  257. };
  258. var TypeError$7 = global_1.TypeError;
  259. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  260. // `ToPrimitive` abstract operation
  261. // https://tc39.es/ecma262/#sec-toprimitive
  262. var toPrimitive = function (input, pref) {
  263. if (!isObject(input) || isSymbol(input)) return input;
  264. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  265. var result;
  266. if (exoticToPrim) {
  267. if (pref === undefined) pref = 'default';
  268. result = functionCall(exoticToPrim, input, pref);
  269. if (!isObject(result) || isSymbol(result)) return result;
  270. throw TypeError$7("Can't convert object to primitive value");
  271. }
  272. if (pref === undefined) pref = 'number';
  273. return ordinaryToPrimitive(input, pref);
  274. };
  275. // `ToPropertyKey` abstract operation
  276. // https://tc39.es/ecma262/#sec-topropertykey
  277. var toPropertyKey = function (argument) {
  278. var key = toPrimitive(argument, 'string');
  279. return isSymbol(key) ? key : key + '';
  280. };
  281. var document$1 = global_1.document;
  282. // typeof document.createElement is 'object' in old IE
  283. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  284. var documentCreateElement = function (it) {
  285. return EXISTS$1 ? document$1.createElement(it) : {};
  286. };
  287. // Thanks to IE8 for its funny defineProperty
  288. var ie8DomDefine = !descriptors && !fails(function () {
  289. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  290. return Object.defineProperty(documentCreateElement('div'), 'a', {
  291. get: function () { return 7; }
  292. }).a != 7;
  293. });
  294. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  295. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  296. // `Object.getOwnPropertyDescriptor` method
  297. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  298. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  299. O = toIndexedObject(O);
  300. P = toPropertyKey(P);
  301. if (ie8DomDefine) try {
  302. return $getOwnPropertyDescriptor$1(O, P);
  303. } catch (error) { /* empty */ }
  304. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  305. };
  306. var objectGetOwnPropertyDescriptor = {
  307. f: f$4
  308. };
  309. // V8 ~ Chrome 36-
  310. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  311. var v8PrototypeDefineBug = descriptors && fails(function () {
  312. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  313. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  314. value: 42,
  315. writable: false
  316. }).prototype != 42;
  317. });
  318. var String$2 = global_1.String;
  319. var TypeError$6 = global_1.TypeError;
  320. // `Assert: Type(argument) is Object`
  321. var anObject = function (argument) {
  322. if (isObject(argument)) return argument;
  323. throw TypeError$6(String$2(argument) + ' is not an object');
  324. };
  325. var TypeError$5 = global_1.TypeError;
  326. // eslint-disable-next-line es/no-object-defineproperty -- safe
  327. var $defineProperty = Object.defineProperty;
  328. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  329. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  330. var ENUMERABLE = 'enumerable';
  331. var CONFIGURABLE$1 = 'configurable';
  332. var WRITABLE = 'writable';
  333. // `Object.defineProperty` method
  334. // https://tc39.es/ecma262/#sec-object.defineproperty
  335. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  336. anObject(O);
  337. P = toPropertyKey(P);
  338. anObject(Attributes);
  339. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  340. var current = $getOwnPropertyDescriptor(O, P);
  341. if (current && current[WRITABLE]) {
  342. O[P] = Attributes.value;
  343. Attributes = {
  344. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  345. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  346. writable: false
  347. };
  348. }
  349. } return $defineProperty(O, P, Attributes);
  350. } : $defineProperty : function defineProperty(O, P, Attributes) {
  351. anObject(O);
  352. P = toPropertyKey(P);
  353. anObject(Attributes);
  354. if (ie8DomDefine) try {
  355. return $defineProperty(O, P, Attributes);
  356. } catch (error) { /* empty */ }
  357. if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported');
  358. if ('value' in Attributes) O[P] = Attributes.value;
  359. return O;
  360. };
  361. var objectDefineProperty = {
  362. f: f$3
  363. };
  364. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  365. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  366. } : function (object, key, value) {
  367. object[key] = value;
  368. return object;
  369. };
  370. var functionToString = functionUncurryThis(Function.toString);
  371. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  372. if (!isCallable(sharedStore.inspectSource)) {
  373. sharedStore.inspectSource = function (it) {
  374. return functionToString(it);
  375. };
  376. }
  377. var inspectSource = sharedStore.inspectSource;
  378. var WeakMap$1 = global_1.WeakMap;
  379. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  380. var keys = shared('keys');
  381. var sharedKey = function (key) {
  382. return keys[key] || (keys[key] = uid(key));
  383. };
  384. var hiddenKeys$1 = {};
  385. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  386. var TypeError$4 = global_1.TypeError;
  387. var WeakMap = global_1.WeakMap;
  388. var set, get, has;
  389. var enforce = function (it) {
  390. return has(it) ? get(it) : set(it, {});
  391. };
  392. var getterFor = function (TYPE) {
  393. return function (it) {
  394. var state;
  395. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  396. throw TypeError$4('Incompatible receiver, ' + TYPE + ' required');
  397. } return state;
  398. };
  399. };
  400. if (nativeWeakMap || sharedStore.state) {
  401. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  402. var wmget = functionUncurryThis(store.get);
  403. var wmhas = functionUncurryThis(store.has);
  404. var wmset = functionUncurryThis(store.set);
  405. set = function (it, metadata) {
  406. if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  407. metadata.facade = it;
  408. wmset(store, it, metadata);
  409. return metadata;
  410. };
  411. get = function (it) {
  412. return wmget(store, it) || {};
  413. };
  414. has = function (it) {
  415. return wmhas(store, it);
  416. };
  417. } else {
  418. var STATE = sharedKey('state');
  419. hiddenKeys$1[STATE] = true;
  420. set = function (it, metadata) {
  421. if (hasOwnProperty_1(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  422. metadata.facade = it;
  423. createNonEnumerableProperty(it, STATE, metadata);
  424. return metadata;
  425. };
  426. get = function (it) {
  427. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  428. };
  429. has = function (it) {
  430. return hasOwnProperty_1(it, STATE);
  431. };
  432. }
  433. var internalState = {
  434. set: set,
  435. get: get,
  436. has: has,
  437. enforce: enforce,
  438. getterFor: getterFor
  439. };
  440. var FunctionPrototype$1 = Function.prototype;
  441. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  442. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  443. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  444. // additional protection from minified / mangled / dropped function names
  445. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  446. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  447. var functionName = {
  448. EXISTS: EXISTS,
  449. PROPER: PROPER,
  450. CONFIGURABLE: CONFIGURABLE
  451. };
  452. var redefine = createCommonjsModule(function (module) {
  453. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  454. var getInternalState = internalState.get;
  455. var enforceInternalState = internalState.enforce;
  456. var TEMPLATE = String(String).split('String');
  457. (module.exports = function (O, key, value, options) {
  458. var unsafe = options ? !!options.unsafe : false;
  459. var simple = options ? !!options.enumerable : false;
  460. var noTargetGet = options ? !!options.noTargetGet : false;
  461. var name = options && options.name !== undefined ? options.name : key;
  462. var state;
  463. if (isCallable(value)) {
  464. if (String(name).slice(0, 7) === 'Symbol(') {
  465. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  466. }
  467. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  468. createNonEnumerableProperty(value, 'name', name);
  469. }
  470. state = enforceInternalState(value);
  471. if (!state.source) {
  472. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  473. }
  474. }
  475. if (O === global_1) {
  476. if (simple) O[key] = value;
  477. else setGlobal(key, value);
  478. return;
  479. } else if (!unsafe) {
  480. delete O[key];
  481. } else if (!noTargetGet && O[key]) {
  482. simple = true;
  483. }
  484. if (simple) O[key] = value;
  485. else createNonEnumerableProperty(O, key, value);
  486. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  487. })(Function.prototype, 'toString', function toString() {
  488. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  489. });
  490. });
  491. var ceil = Math.ceil;
  492. var floor$2 = Math.floor;
  493. // `ToIntegerOrInfinity` abstract operation
  494. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  495. var toIntegerOrInfinity = function (argument) {
  496. var number = +argument;
  497. // eslint-disable-next-line no-self-compare -- safe
  498. return number !== number || number === 0 ? 0 : (number > 0 ? floor$2 : ceil)(number);
  499. };
  500. var max$2 = Math.max;
  501. var min$3 = Math.min;
  502. // Helper for a popular repeating case of the spec:
  503. // Let integer be ? ToInteger(index).
  504. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  505. var toAbsoluteIndex = function (index, length) {
  506. var integer = toIntegerOrInfinity(index);
  507. return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
  508. };
  509. var min$2 = Math.min;
  510. // `ToLength` abstract operation
  511. // https://tc39.es/ecma262/#sec-tolength
  512. var toLength = function (argument) {
  513. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  514. };
  515. // `LengthOfArrayLike` abstract operation
  516. // https://tc39.es/ecma262/#sec-lengthofarraylike
  517. var lengthOfArrayLike = function (obj) {
  518. return toLength(obj.length);
  519. };
  520. // `Array.prototype.{ indexOf, includes }` methods implementation
  521. var createMethod$3 = function (IS_INCLUDES) {
  522. return function ($this, el, fromIndex) {
  523. var O = toIndexedObject($this);
  524. var length = lengthOfArrayLike(O);
  525. var index = toAbsoluteIndex(fromIndex, length);
  526. var value;
  527. // Array#includes uses SameValueZero equality algorithm
  528. // eslint-disable-next-line no-self-compare -- NaN check
  529. if (IS_INCLUDES && el != el) while (length > index) {
  530. value = O[index++];
  531. // eslint-disable-next-line no-self-compare -- NaN check
  532. if (value != value) return true;
  533. // Array#indexOf ignores holes, Array#includes - not
  534. } else for (;length > index; index++) {
  535. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  536. } return !IS_INCLUDES && -1;
  537. };
  538. };
  539. var arrayIncludes = {
  540. // `Array.prototype.includes` method
  541. // https://tc39.es/ecma262/#sec-array.prototype.includes
  542. includes: createMethod$3(true),
  543. // `Array.prototype.indexOf` method
  544. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  545. indexOf: createMethod$3(false)
  546. };
  547. var indexOf$1 = arrayIncludes.indexOf;
  548. var push$4 = functionUncurryThis([].push);
  549. var objectKeysInternal = function (object, names) {
  550. var O = toIndexedObject(object);
  551. var i = 0;
  552. var result = [];
  553. var key;
  554. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$4(result, key);
  555. // Don't enum bug & hidden keys
  556. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  557. ~indexOf$1(result, key) || push$4(result, key);
  558. }
  559. return result;
  560. };
  561. // IE8- don't enum bug keys
  562. var enumBugKeys = [
  563. 'constructor',
  564. 'hasOwnProperty',
  565. 'isPrototypeOf',
  566. 'propertyIsEnumerable',
  567. 'toLocaleString',
  568. 'toString',
  569. 'valueOf'
  570. ];
  571. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  572. // `Object.getOwnPropertyNames` method
  573. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  574. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  575. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  576. return objectKeysInternal(O, hiddenKeys);
  577. };
  578. var objectGetOwnPropertyNames = {
  579. f: f$2
  580. };
  581. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  582. var f$1 = Object.getOwnPropertySymbols;
  583. var objectGetOwnPropertySymbols = {
  584. f: f$1
  585. };
  586. var concat$1 = functionUncurryThis([].concat);
  587. // all object keys, includes non-enumerable and symbols
  588. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  589. var keys = objectGetOwnPropertyNames.f(anObject(it));
  590. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  591. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  592. };
  593. var copyConstructorProperties = function (target, source, exceptions) {
  594. var keys = ownKeys(source);
  595. var defineProperty = objectDefineProperty.f;
  596. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  597. for (var i = 0; i < keys.length; i++) {
  598. var key = keys[i];
  599. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  600. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  601. }
  602. }
  603. };
  604. var replacement = /#|\.prototype\./;
  605. var isForced = function (feature, detection) {
  606. var value = data[normalize(feature)];
  607. return value == POLYFILL ? true
  608. : value == NATIVE ? false
  609. : isCallable(detection) ? fails(detection)
  610. : !!detection;
  611. };
  612. var normalize = isForced.normalize = function (string) {
  613. return String(string).replace(replacement, '.').toLowerCase();
  614. };
  615. var data = isForced.data = {};
  616. var NATIVE = isForced.NATIVE = 'N';
  617. var POLYFILL = isForced.POLYFILL = 'P';
  618. var isForced_1 = isForced;
  619. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  620. /*
  621. options.target - name of the target object
  622. options.global - target is the global object
  623. options.stat - export as static methods of target
  624. options.proto - export as prototype methods of target
  625. options.real - real prototype method for the `pure` version
  626. options.forced - export even if the native feature is available
  627. options.bind - bind methods to the target, required for the `pure` version
  628. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  629. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  630. options.sham - add a flag to not completely full polyfills
  631. options.enumerable - export as enumerable property
  632. options.noTargetGet - prevent calling a getter on target
  633. options.name - the .name of the function if it does not match the key
  634. */
  635. var _export = function (options, source) {
  636. var TARGET = options.target;
  637. var GLOBAL = options.global;
  638. var STATIC = options.stat;
  639. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  640. if (GLOBAL) {
  641. target = global_1;
  642. } else if (STATIC) {
  643. target = global_1[TARGET] || setGlobal(TARGET, {});
  644. } else {
  645. target = (global_1[TARGET] || {}).prototype;
  646. }
  647. if (target) for (key in source) {
  648. sourceProperty = source[key];
  649. if (options.noTargetGet) {
  650. descriptor = getOwnPropertyDescriptor(target, key);
  651. targetProperty = descriptor && descriptor.value;
  652. } else targetProperty = target[key];
  653. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  654. // contained in target
  655. if (!FORCED && targetProperty !== undefined) {
  656. if (typeof sourceProperty == typeof targetProperty) continue;
  657. copyConstructorProperties(sourceProperty, targetProperty);
  658. }
  659. // add a flag to not completely full polyfills
  660. if (options.sham || (targetProperty && targetProperty.sham)) {
  661. createNonEnumerableProperty(sourceProperty, 'sham', true);
  662. }
  663. // extend global
  664. redefine(target, key, sourceProperty, options);
  665. }
  666. };
  667. var bind = functionUncurryThis(functionUncurryThis.bind);
  668. // optional / simple context binding
  669. var functionBindContext = function (fn, that) {
  670. aCallable(fn);
  671. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  672. return fn.apply(that, arguments);
  673. };
  674. };
  675. // `IsArray` abstract operation
  676. // https://tc39.es/ecma262/#sec-isarray
  677. // eslint-disable-next-line es/no-array-isarray -- safe
  678. var isArray = Array.isArray || function isArray(argument) {
  679. return classofRaw(argument) == 'Array';
  680. };
  681. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  682. var test$1 = {};
  683. test$1[TO_STRING_TAG$1] = 'z';
  684. var toStringTagSupport = String(test$1) === '[object z]';
  685. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  686. var Object$1 = global_1.Object;
  687. // ES3 wrong here
  688. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  689. // fallback for IE11 Script Access Denied error
  690. var tryGet = function (it, key) {
  691. try {
  692. return it[key];
  693. } catch (error) { /* empty */ }
  694. };
  695. // getting tag from ES6+ `Object.prototype.toString`
  696. var classof = toStringTagSupport ? classofRaw : function (it) {
  697. var O, tag, result;
  698. return it === undefined ? 'Undefined' : it === null ? 'Null'
  699. // @@toStringTag case
  700. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  701. // builtinTag case
  702. : CORRECT_ARGUMENTS ? classofRaw(O)
  703. // ES3 arguments fallback
  704. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  705. };
  706. var noop = function () { /* empty */ };
  707. var empty = [];
  708. var construct = getBuiltIn('Reflect', 'construct');
  709. var constructorRegExp = /^\s*(?:class|function)\b/;
  710. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  711. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  712. var isConstructorModern = function isConstructor(argument) {
  713. if (!isCallable(argument)) return false;
  714. try {
  715. construct(noop, empty, argument);
  716. return true;
  717. } catch (error) {
  718. return false;
  719. }
  720. };
  721. var isConstructorLegacy = function isConstructor(argument) {
  722. if (!isCallable(argument)) return false;
  723. switch (classof(argument)) {
  724. case 'AsyncFunction':
  725. case 'GeneratorFunction':
  726. case 'AsyncGeneratorFunction': return false;
  727. }
  728. try {
  729. // we can't check .prototype since constructors produced by .bind haven't it
  730. // `Function#toString` throws on some built-it function in some legacy engines
  731. // (for example, `DOMQuad` and similar in FF41-)
  732. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  733. } catch (error) {
  734. return true;
  735. }
  736. };
  737. isConstructorLegacy.sham = true;
  738. // `IsConstructor` abstract operation
  739. // https://tc39.es/ecma262/#sec-isconstructor
  740. var isConstructor = !construct || fails(function () {
  741. var called;
  742. return isConstructorModern(isConstructorModern.call)
  743. || !isConstructorModern(Object)
  744. || !isConstructorModern(function () { called = true; })
  745. || called;
  746. }) ? isConstructorLegacy : isConstructorModern;
  747. var SPECIES$3 = wellKnownSymbol('species');
  748. var Array$2 = global_1.Array;
  749. // a part of `ArraySpeciesCreate` abstract operation
  750. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  751. var arraySpeciesConstructor = function (originalArray) {
  752. var C;
  753. if (isArray(originalArray)) {
  754. C = originalArray.constructor;
  755. // cross-realm fallback
  756. if (isConstructor(C) && (C === Array$2 || isArray(C.prototype))) C = undefined;
  757. else if (isObject(C)) {
  758. C = C[SPECIES$3];
  759. if (C === null) C = undefined;
  760. }
  761. } return C === undefined ? Array$2 : C;
  762. };
  763. // `ArraySpeciesCreate` abstract operation
  764. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  765. var arraySpeciesCreate = function (originalArray, length) {
  766. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  767. };
  768. var push$3 = functionUncurryThis([].push);
  769. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  770. var createMethod$2 = function (TYPE) {
  771. var IS_MAP = TYPE == 1;
  772. var IS_FILTER = TYPE == 2;
  773. var IS_SOME = TYPE == 3;
  774. var IS_EVERY = TYPE == 4;
  775. var IS_FIND_INDEX = TYPE == 6;
  776. var IS_FILTER_REJECT = TYPE == 7;
  777. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  778. return function ($this, callbackfn, that, specificCreate) {
  779. var O = toObject($this);
  780. var self = indexedObject(O);
  781. var boundFunction = functionBindContext(callbackfn, that);
  782. var length = lengthOfArrayLike(self);
  783. var index = 0;
  784. var create = specificCreate || arraySpeciesCreate;
  785. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  786. var value, result;
  787. for (;length > index; index++) if (NO_HOLES || index in self) {
  788. value = self[index];
  789. result = boundFunction(value, index, O);
  790. if (TYPE) {
  791. if (IS_MAP) target[index] = result; // map
  792. else if (result) switch (TYPE) {
  793. case 3: return true; // some
  794. case 5: return value; // find
  795. case 6: return index; // findIndex
  796. case 2: push$3(target, value); // filter
  797. } else switch (TYPE) {
  798. case 4: return false; // every
  799. case 7: push$3(target, value); // filterReject
  800. }
  801. }
  802. }
  803. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  804. };
  805. };
  806. var arrayIteration = {
  807. // `Array.prototype.forEach` method
  808. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  809. forEach: createMethod$2(0),
  810. // `Array.prototype.map` method
  811. // https://tc39.es/ecma262/#sec-array.prototype.map
  812. map: createMethod$2(1),
  813. // `Array.prototype.filter` method
  814. // https://tc39.es/ecma262/#sec-array.prototype.filter
  815. filter: createMethod$2(2),
  816. // `Array.prototype.some` method
  817. // https://tc39.es/ecma262/#sec-array.prototype.some
  818. some: createMethod$2(3),
  819. // `Array.prototype.every` method
  820. // https://tc39.es/ecma262/#sec-array.prototype.every
  821. every: createMethod$2(4),
  822. // `Array.prototype.find` method
  823. // https://tc39.es/ecma262/#sec-array.prototype.find
  824. find: createMethod$2(5),
  825. // `Array.prototype.findIndex` method
  826. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  827. findIndex: createMethod$2(6),
  828. // `Array.prototype.filterReject` method
  829. // https://github.com/tc39/proposal-array-filtering
  830. filterReject: createMethod$2(7)
  831. };
  832. // `Object.keys` method
  833. // https://tc39.es/ecma262/#sec-object.keys
  834. // eslint-disable-next-line es/no-object-keys -- safe
  835. var objectKeys = Object.keys || function keys(O) {
  836. return objectKeysInternal(O, enumBugKeys);
  837. };
  838. // `Object.defineProperties` method
  839. // https://tc39.es/ecma262/#sec-object.defineproperties
  840. // eslint-disable-next-line es/no-object-defineproperties -- safe
  841. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  842. anObject(O);
  843. var props = toIndexedObject(Properties);
  844. var keys = objectKeys(Properties);
  845. var length = keys.length;
  846. var index = 0;
  847. var key;
  848. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  849. return O;
  850. };
  851. var objectDefineProperties = {
  852. f: f
  853. };
  854. var html = getBuiltIn('document', 'documentElement');
  855. /* global ActiveXObject -- old IE, WSH */
  856. var GT = '>';
  857. var LT = '<';
  858. var PROTOTYPE = 'prototype';
  859. var SCRIPT = 'script';
  860. var IE_PROTO = sharedKey('IE_PROTO');
  861. var EmptyConstructor = function () { /* empty */ };
  862. var scriptTag = function (content) {
  863. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  864. };
  865. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  866. var NullProtoObjectViaActiveX = function (activeXDocument) {
  867. activeXDocument.write(scriptTag(''));
  868. activeXDocument.close();
  869. var temp = activeXDocument.parentWindow.Object;
  870. activeXDocument = null; // avoid memory leak
  871. return temp;
  872. };
  873. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  874. var NullProtoObjectViaIFrame = function () {
  875. // Thrash, waste and sodomy: IE GC bug
  876. var iframe = documentCreateElement('iframe');
  877. var JS = 'java' + SCRIPT + ':';
  878. var iframeDocument;
  879. iframe.style.display = 'none';
  880. html.appendChild(iframe);
  881. // https://github.com/zloirock/core-js/issues/475
  882. iframe.src = String(JS);
  883. iframeDocument = iframe.contentWindow.document;
  884. iframeDocument.open();
  885. iframeDocument.write(scriptTag('document.F=Object'));
  886. iframeDocument.close();
  887. return iframeDocument.F;
  888. };
  889. // Check for document.domain and active x support
  890. // No need to use active x approach when document.domain is not set
  891. // see https://github.com/es-shims/es5-shim/issues/150
  892. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  893. // avoid IE GC bug
  894. var activeXDocument;
  895. var NullProtoObject = function () {
  896. try {
  897. activeXDocument = new ActiveXObject('htmlfile');
  898. } catch (error) { /* ignore */ }
  899. NullProtoObject = typeof document != 'undefined'
  900. ? document.domain && activeXDocument
  901. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  902. : NullProtoObjectViaIFrame()
  903. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  904. var length = enumBugKeys.length;
  905. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  906. return NullProtoObject();
  907. };
  908. hiddenKeys$1[IE_PROTO] = true;
  909. // `Object.create` method
  910. // https://tc39.es/ecma262/#sec-object.create
  911. var objectCreate = Object.create || function create(O, Properties) {
  912. var result;
  913. if (O !== null) {
  914. EmptyConstructor[PROTOTYPE] = anObject(O);
  915. result = new EmptyConstructor();
  916. EmptyConstructor[PROTOTYPE] = null;
  917. // add "__proto__" for Object.getPrototypeOf polyfill
  918. result[IE_PROTO] = O;
  919. } else result = NullProtoObject();
  920. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  921. };
  922. var UNSCOPABLES = wellKnownSymbol('unscopables');
  923. var ArrayPrototype = Array.prototype;
  924. // Array.prototype[@@unscopables]
  925. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  926. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  927. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  928. configurable: true,
  929. value: objectCreate(null)
  930. });
  931. }
  932. // add a key to Array.prototype[@@unscopables]
  933. var addToUnscopables = function (key) {
  934. ArrayPrototype[UNSCOPABLES][key] = true;
  935. };
  936. var $find = arrayIteration.find;
  937. var FIND = 'find';
  938. var SKIPS_HOLES = true;
  939. // Shouldn't skip holes
  940. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  941. // `Array.prototype.find` method
  942. // https://tc39.es/ecma262/#sec-array.prototype.find
  943. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  944. find: function find(callbackfn /* , that = undefined */) {
  945. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  946. }
  947. });
  948. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  949. addToUnscopables(FIND);
  950. // `Object.prototype.toString` method implementation
  951. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  952. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  953. return '[object ' + classof(this) + ']';
  954. };
  955. // `Object.prototype.toString` method
  956. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  957. if (!toStringTagSupport) {
  958. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  959. }
  960. var String$1 = global_1.String;
  961. var toString_1 = function (argument) {
  962. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  963. return String$1(argument);
  964. };
  965. // a string of all valid unicode whitespaces
  966. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  967. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  968. var replace$2 = functionUncurryThis(''.replace);
  969. var whitespace = '[' + whitespaces + ']';
  970. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  971. var rtrim = RegExp(whitespace + whitespace + '*$');
  972. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  973. var createMethod$1 = function (TYPE) {
  974. return function ($this) {
  975. var string = toString_1(requireObjectCoercible($this));
  976. if (TYPE & 1) string = replace$2(string, ltrim, '');
  977. if (TYPE & 2) string = replace$2(string, rtrim, '');
  978. return string;
  979. };
  980. };
  981. var stringTrim = {
  982. // `String.prototype.{ trimLeft, trimStart }` methods
  983. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  984. start: createMethod$1(1),
  985. // `String.prototype.{ trimRight, trimEnd }` methods
  986. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  987. end: createMethod$1(2),
  988. // `String.prototype.trim` method
  989. // https://tc39.es/ecma262/#sec-string.prototype.trim
  990. trim: createMethod$1(3)
  991. };
  992. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  993. var non = '\u200B\u0085\u180E';
  994. // check that a method works with the correct list
  995. // of whitespaces and has a correct name
  996. var stringTrimForced = function (METHOD_NAME) {
  997. return fails(function () {
  998. return !!whitespaces[METHOD_NAME]()
  999. || non[METHOD_NAME]() !== non
  1000. || (PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  1001. });
  1002. };
  1003. var $trim = stringTrim.trim;
  1004. // `String.prototype.trim` method
  1005. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1006. _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
  1007. trim: function trim() {
  1008. return $trim(this);
  1009. }
  1010. });
  1011. // `RegExp.prototype.flags` getter implementation
  1012. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1013. var regexpFlags = function () {
  1014. var that = anObject(this);
  1015. var result = '';
  1016. if (that.global) result += 'g';
  1017. if (that.ignoreCase) result += 'i';
  1018. if (that.multiline) result += 'm';
  1019. if (that.dotAll) result += 's';
  1020. if (that.unicode) result += 'u';
  1021. if (that.sticky) result += 'y';
  1022. return result;
  1023. };
  1024. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1025. var TO_STRING = 'toString';
  1026. var RegExpPrototype$1 = RegExp.prototype;
  1027. var n$ToString = RegExpPrototype$1[TO_STRING];
  1028. var getFlags = functionUncurryThis(regexpFlags);
  1029. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1030. // FF44- RegExp#toString has a wrong name
  1031. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1032. // `RegExp.prototype.toString` method
  1033. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1034. if (NOT_GENERIC || INCORRECT_NAME) {
  1035. redefine(RegExp.prototype, TO_STRING, function toString() {
  1036. var R = anObject(this);
  1037. var p = toString_1(R.source);
  1038. var rf = R.flags;
  1039. var f = toString_1(rf === undefined && objectIsPrototypeOf(RegExpPrototype$1, R) && !('flags' in RegExpPrototype$1) ? getFlags(R) : rf);
  1040. return '/' + p + '/' + f;
  1041. }, { unsafe: true });
  1042. }
  1043. var createProperty = function (object, key, value) {
  1044. var propertyKey = toPropertyKey(key);
  1045. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1046. else object[propertyKey] = value;
  1047. };
  1048. var Array$1 = global_1.Array;
  1049. var max$1 = Math.max;
  1050. var arraySliceSimple = function (O, start, end) {
  1051. var length = lengthOfArrayLike(O);
  1052. var k = toAbsoluteIndex(start, length);
  1053. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1054. var result = Array$1(max$1(fin - k, 0));
  1055. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1056. result.length = n;
  1057. return result;
  1058. };
  1059. var floor$1 = Math.floor;
  1060. var mergeSort = function (array, comparefn) {
  1061. var length = array.length;
  1062. var middle = floor$1(length / 2);
  1063. return length < 8 ? insertionSort(array, comparefn) : merge(
  1064. array,
  1065. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  1066. mergeSort(arraySliceSimple(array, middle), comparefn),
  1067. comparefn
  1068. );
  1069. };
  1070. var insertionSort = function (array, comparefn) {
  1071. var length = array.length;
  1072. var i = 1;
  1073. var element, j;
  1074. while (i < length) {
  1075. j = i;
  1076. element = array[i];
  1077. while (j && comparefn(array[j - 1], element) > 0) {
  1078. array[j] = array[--j];
  1079. }
  1080. if (j !== i++) array[j] = element;
  1081. } return array;
  1082. };
  1083. var merge = function (array, left, right, comparefn) {
  1084. var llength = left.length;
  1085. var rlength = right.length;
  1086. var lindex = 0;
  1087. var rindex = 0;
  1088. while (lindex < llength || rindex < rlength) {
  1089. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1090. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1091. : lindex < llength ? left[lindex++] : right[rindex++];
  1092. } return array;
  1093. };
  1094. var arraySort = mergeSort;
  1095. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1096. var method = [][METHOD_NAME];
  1097. return !!method && fails(function () {
  1098. // eslint-disable-next-line no-useless-call -- required for testing
  1099. method.call(null, argument || function () { return 1; }, 1);
  1100. });
  1101. };
  1102. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  1103. var engineFfVersion = !!firefox && +firefox[1];
  1104. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  1105. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  1106. var engineWebkitVersion = !!webkit && +webkit[1];
  1107. var test = [];
  1108. var un$Sort = functionUncurryThis(test.sort);
  1109. var push$2 = functionUncurryThis(test.push);
  1110. // IE8-
  1111. var FAILS_ON_UNDEFINED = fails(function () {
  1112. test.sort(undefined);
  1113. });
  1114. // V8 bug
  1115. var FAILS_ON_NULL = fails(function () {
  1116. test.sort(null);
  1117. });
  1118. // Old WebKit
  1119. var STRICT_METHOD$3 = arrayMethodIsStrict('sort');
  1120. var STABLE_SORT = !fails(function () {
  1121. // feature detection can be too slow, so check engines versions
  1122. if (engineV8Version) return engineV8Version < 70;
  1123. if (engineFfVersion && engineFfVersion > 3) return;
  1124. if (engineIsIeOrEdge) return true;
  1125. if (engineWebkitVersion) return engineWebkitVersion < 603;
  1126. var result = '';
  1127. var code, chr, value, index;
  1128. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1129. for (code = 65; code < 76; code++) {
  1130. chr = String.fromCharCode(code);
  1131. switch (code) {
  1132. case 66: case 69: case 70: case 72: value = 3; break;
  1133. case 68: case 71: value = 4; break;
  1134. default: value = 2;
  1135. }
  1136. for (index = 0; index < 47; index++) {
  1137. test.push({ k: chr + index, v: value });
  1138. }
  1139. }
  1140. test.sort(function (a, b) { return b.v - a.v; });
  1141. for (index = 0; index < test.length; index++) {
  1142. chr = test[index].k.charAt(0);
  1143. if (result.charAt(result.length - 1) !== chr) result += chr;
  1144. }
  1145. return result !== 'DGBEFHACIJK';
  1146. });
  1147. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$3 || !STABLE_SORT;
  1148. var getSortCompare = function (comparefn) {
  1149. return function (x, y) {
  1150. if (y === undefined) return -1;
  1151. if (x === undefined) return 1;
  1152. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1153. return toString_1(x) > toString_1(y) ? 1 : -1;
  1154. };
  1155. };
  1156. // `Array.prototype.sort` method
  1157. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1158. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  1159. sort: function sort(comparefn) {
  1160. if (comparefn !== undefined) aCallable(comparefn);
  1161. var array = toObject(this);
  1162. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  1163. var items = [];
  1164. var arrayLength = lengthOfArrayLike(array);
  1165. var itemsLength, index;
  1166. for (index = 0; index < arrayLength; index++) {
  1167. if (index in array) push$2(items, array[index]);
  1168. }
  1169. arraySort(items, getSortCompare(comparefn));
  1170. itemsLength = items.length;
  1171. index = 0;
  1172. while (index < itemsLength) array[index] = items[index++];
  1173. while (index < arrayLength) delete array[index++];
  1174. return array;
  1175. }
  1176. });
  1177. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1178. var $RegExp$2 = global_1.RegExp;
  1179. var UNSUPPORTED_Y$2 = fails(function () {
  1180. var re = $RegExp$2('a', 'y');
  1181. re.lastIndex = 2;
  1182. return re.exec('abcd') != null;
  1183. });
  1184. // UC Browser bug
  1185. // https://github.com/zloirock/core-js/issues/1008
  1186. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1187. return !$RegExp$2('a', 'y').sticky;
  1188. });
  1189. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1190. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1191. var re = $RegExp$2('^r', 'gy');
  1192. re.lastIndex = 2;
  1193. return re.exec('str') != null;
  1194. });
  1195. var regexpStickyHelpers = {
  1196. BROKEN_CARET: BROKEN_CARET,
  1197. MISSED_STICKY: MISSED_STICKY,
  1198. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1199. };
  1200. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1201. var $RegExp$1 = global_1.RegExp;
  1202. var regexpUnsupportedDotAll = fails(function () {
  1203. var re = $RegExp$1('.', 's');
  1204. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1205. });
  1206. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1207. var $RegExp = global_1.RegExp;
  1208. var regexpUnsupportedNcg = fails(function () {
  1209. var re = $RegExp('(?<a>b)', 'g');
  1210. return re.exec('b').groups.a !== 'b' ||
  1211. 'b'.replace(re, '$<a>c') !== 'bc';
  1212. });
  1213. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1214. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1215. var getInternalState = internalState.get;
  1216. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1217. var nativeExec = RegExp.prototype.exec;
  1218. var patchedExec = nativeExec;
  1219. var charAt$3 = functionUncurryThis(''.charAt);
  1220. var indexOf = functionUncurryThis(''.indexOf);
  1221. var replace$1 = functionUncurryThis(''.replace);
  1222. var stringSlice$4 = functionUncurryThis(''.slice);
  1223. var UPDATES_LAST_INDEX_WRONG = (function () {
  1224. var re1 = /a/;
  1225. var re2 = /b*/g;
  1226. functionCall(nativeExec, re1, 'a');
  1227. functionCall(nativeExec, re2, 'a');
  1228. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1229. })();
  1230. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1231. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1232. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1233. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1234. if (PATCH) {
  1235. patchedExec = function exec(string) {
  1236. var re = this;
  1237. var state = getInternalState(re);
  1238. var str = toString_1(string);
  1239. var raw = state.raw;
  1240. var result, reCopy, lastIndex, match, i, object, group;
  1241. if (raw) {
  1242. raw.lastIndex = re.lastIndex;
  1243. result = functionCall(patchedExec, raw, str);
  1244. re.lastIndex = raw.lastIndex;
  1245. return result;
  1246. }
  1247. var groups = state.groups;
  1248. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1249. var flags = functionCall(regexpFlags, re);
  1250. var source = re.source;
  1251. var charsAdded = 0;
  1252. var strCopy = str;
  1253. if (sticky) {
  1254. flags = replace$1(flags, 'y', '');
  1255. if (indexOf(flags, 'g') === -1) {
  1256. flags += 'g';
  1257. }
  1258. strCopy = stringSlice$4(str, re.lastIndex);
  1259. // Support anchored sticky behavior.
  1260. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1261. source = '(?: ' + source + ')';
  1262. strCopy = ' ' + strCopy;
  1263. charsAdded++;
  1264. }
  1265. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1266. // simulate the 'y' flag.
  1267. reCopy = new RegExp('^(?:' + source + ')', flags);
  1268. }
  1269. if (NPCG_INCLUDED) {
  1270. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1271. }
  1272. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1273. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1274. if (sticky) {
  1275. if (match) {
  1276. match.input = stringSlice$4(match.input, charsAdded);
  1277. match[0] = stringSlice$4(match[0], charsAdded);
  1278. match.index = re.lastIndex;
  1279. re.lastIndex += match[0].length;
  1280. } else re.lastIndex = 0;
  1281. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1282. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1283. }
  1284. if (NPCG_INCLUDED && match && match.length > 1) {
  1285. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1286. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1287. functionCall(nativeReplace, match[0], reCopy, function () {
  1288. for (i = 1; i < arguments.length - 2; i++) {
  1289. if (arguments[i] === undefined) match[i] = undefined;
  1290. }
  1291. });
  1292. }
  1293. if (match && groups) {
  1294. match.groups = object = objectCreate(null);
  1295. for (i = 0; i < groups.length; i++) {
  1296. group = groups[i];
  1297. object[group[0]] = match[group[1]];
  1298. }
  1299. }
  1300. return match;
  1301. };
  1302. }
  1303. var regexpExec = patchedExec;
  1304. // `RegExp.prototype.exec` method
  1305. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1306. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1307. exec: regexpExec
  1308. });
  1309. var FunctionPrototype = Function.prototype;
  1310. var apply = FunctionPrototype.apply;
  1311. var call = FunctionPrototype.call;
  1312. // eslint-disable-next-line es/no-reflect -- safe
  1313. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1314. return call.apply(apply, arguments);
  1315. });
  1316. // TODO: Remove from `core-js@4` since it's moved to entry points
  1317. var SPECIES$2 = wellKnownSymbol('species');
  1318. var RegExpPrototype = RegExp.prototype;
  1319. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1320. var SYMBOL = wellKnownSymbol(KEY);
  1321. var DELEGATES_TO_SYMBOL = !fails(function () {
  1322. // String methods call symbol-named RegEp methods
  1323. var O = {};
  1324. O[SYMBOL] = function () { return 7; };
  1325. return ''[KEY](O) != 7;
  1326. });
  1327. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1328. // Symbol-named RegExp methods call .exec
  1329. var execCalled = false;
  1330. var re = /a/;
  1331. if (KEY === 'split') {
  1332. // We can't use real regex here since it causes deoptimization
  1333. // and serious performance degradation in V8
  1334. // https://github.com/zloirock/core-js/issues/306
  1335. re = {};
  1336. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1337. // a new one. We need to return the patched regex when creating the new one.
  1338. re.constructor = {};
  1339. re.constructor[SPECIES$2] = function () { return re; };
  1340. re.flags = '';
  1341. re[SYMBOL] = /./[SYMBOL];
  1342. }
  1343. re.exec = function () { execCalled = true; return null; };
  1344. re[SYMBOL]('');
  1345. return !execCalled;
  1346. });
  1347. if (
  1348. !DELEGATES_TO_SYMBOL ||
  1349. !DELEGATES_TO_EXEC ||
  1350. FORCED
  1351. ) {
  1352. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  1353. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1354. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  1355. var $exec = regexp.exec;
  1356. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  1357. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1358. // The native String method already delegates to @@method (this
  1359. // polyfilled function), leasing to infinite recursion.
  1360. // We avoid it by directly calling the native @@method method.
  1361. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1362. }
  1363. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1364. }
  1365. return { done: false };
  1366. });
  1367. redefine(String.prototype, KEY, methods[0]);
  1368. redefine(RegExpPrototype, SYMBOL, methods[1]);
  1369. }
  1370. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  1371. };
  1372. var charAt$2 = functionUncurryThis(''.charAt);
  1373. var charCodeAt = functionUncurryThis(''.charCodeAt);
  1374. var stringSlice$3 = functionUncurryThis(''.slice);
  1375. var createMethod = function (CONVERT_TO_STRING) {
  1376. return function ($this, pos) {
  1377. var S = toString_1(requireObjectCoercible($this));
  1378. var position = toIntegerOrInfinity(pos);
  1379. var size = S.length;
  1380. var first, second;
  1381. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1382. first = charCodeAt(S, position);
  1383. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1384. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1385. ? CONVERT_TO_STRING
  1386. ? charAt$2(S, position)
  1387. : first
  1388. : CONVERT_TO_STRING
  1389. ? stringSlice$3(S, position, position + 2)
  1390. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1391. };
  1392. };
  1393. var stringMultibyte = {
  1394. // `String.prototype.codePointAt` method
  1395. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1396. codeAt: createMethod(false),
  1397. // `String.prototype.at` method
  1398. // https://github.com/mathiasbynens/String.prototype.at
  1399. charAt: createMethod(true)
  1400. };
  1401. var charAt$1 = stringMultibyte.charAt;
  1402. // `AdvanceStringIndex` abstract operation
  1403. // https://tc39.es/ecma262/#sec-advancestringindex
  1404. var advanceStringIndex = function (S, index, unicode) {
  1405. return index + (unicode ? charAt$1(S, index).length : 1);
  1406. };
  1407. var floor = Math.floor;
  1408. var charAt = functionUncurryThis(''.charAt);
  1409. var replace = functionUncurryThis(''.replace);
  1410. var stringSlice$2 = functionUncurryThis(''.slice);
  1411. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1412. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1413. // `GetSubstitution` abstract operation
  1414. // https://tc39.es/ecma262/#sec-getsubstitution
  1415. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1416. var tailPos = position + matched.length;
  1417. var m = captures.length;
  1418. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1419. if (namedCaptures !== undefined) {
  1420. namedCaptures = toObject(namedCaptures);
  1421. symbols = SUBSTITUTION_SYMBOLS;
  1422. }
  1423. return replace(replacement, symbols, function (match, ch) {
  1424. var capture;
  1425. switch (charAt(ch, 0)) {
  1426. case '$': return '$';
  1427. case '&': return matched;
  1428. case '`': return stringSlice$2(str, 0, position);
  1429. case "'": return stringSlice$2(str, tailPos);
  1430. case '<':
  1431. capture = namedCaptures[stringSlice$2(ch, 1, -1)];
  1432. break;
  1433. default: // \d\d?
  1434. var n = +ch;
  1435. if (n === 0) return match;
  1436. if (n > m) {
  1437. var f = floor(n / 10);
  1438. if (f === 0) return match;
  1439. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  1440. return match;
  1441. }
  1442. capture = captures[n - 1];
  1443. }
  1444. return capture === undefined ? '' : capture;
  1445. });
  1446. };
  1447. var TypeError$3 = global_1.TypeError;
  1448. // `RegExpExec` abstract operation
  1449. // https://tc39.es/ecma262/#sec-regexpexec
  1450. var regexpExecAbstract = function (R, S) {
  1451. var exec = R.exec;
  1452. if (isCallable(exec)) {
  1453. var result = functionCall(exec, R, S);
  1454. if (result !== null) anObject(result);
  1455. return result;
  1456. }
  1457. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  1458. throw TypeError$3('RegExp#exec called on incompatible receiver');
  1459. };
  1460. var REPLACE = wellKnownSymbol('replace');
  1461. var max = Math.max;
  1462. var min$1 = Math.min;
  1463. var concat = functionUncurryThis([].concat);
  1464. var push$1 = functionUncurryThis([].push);
  1465. var stringIndexOf = functionUncurryThis(''.indexOf);
  1466. var stringSlice$1 = functionUncurryThis(''.slice);
  1467. var maybeToString = function (it) {
  1468. return it === undefined ? it : String(it);
  1469. };
  1470. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1471. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1472. var REPLACE_KEEPS_$0 = (function () {
  1473. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1474. return 'a'.replace(/./, '$0') === '$0';
  1475. })();
  1476. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1477. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1478. if (/./[REPLACE]) {
  1479. return /./[REPLACE]('a', '$0') === '';
  1480. }
  1481. return false;
  1482. })();
  1483. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1484. var re = /./;
  1485. re.exec = function () {
  1486. var result = [];
  1487. result.groups = { a: '7' };
  1488. return result;
  1489. };
  1490. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  1491. return ''.replace(re, '$<a>') !== '7';
  1492. });
  1493. // @@replace logic
  1494. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  1495. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1496. return [
  1497. // `String.prototype.replace` method
  1498. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1499. function replace(searchValue, replaceValue) {
  1500. var O = requireObjectCoercible(this);
  1501. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  1502. return replacer
  1503. ? functionCall(replacer, searchValue, O, replaceValue)
  1504. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  1505. },
  1506. // `RegExp.prototype[@@replace]` method
  1507. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1508. function (string, replaceValue) {
  1509. var rx = anObject(this);
  1510. var S = toString_1(string);
  1511. if (
  1512. typeof replaceValue == 'string' &&
  1513. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  1514. stringIndexOf(replaceValue, '$<') === -1
  1515. ) {
  1516. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  1517. if (res.done) return res.value;
  1518. }
  1519. var functionalReplace = isCallable(replaceValue);
  1520. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  1521. var global = rx.global;
  1522. if (global) {
  1523. var fullUnicode = rx.unicode;
  1524. rx.lastIndex = 0;
  1525. }
  1526. var results = [];
  1527. while (true) {
  1528. var result = regexpExecAbstract(rx, S);
  1529. if (result === null) break;
  1530. push$1(results, result);
  1531. if (!global) break;
  1532. var matchStr = toString_1(result[0]);
  1533. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1534. }
  1535. var accumulatedResult = '';
  1536. var nextSourcePosition = 0;
  1537. for (var i = 0; i < results.length; i++) {
  1538. result = results[i];
  1539. var matched = toString_1(result[0]);
  1540. var position = max(min$1(toIntegerOrInfinity(result.index), S.length), 0);
  1541. var captures = [];
  1542. // NOTE: This is equivalent to
  1543. // captures = result.slice(1).map(maybeToString)
  1544. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1545. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1546. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1547. for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
  1548. var namedCaptures = result.groups;
  1549. if (functionalReplace) {
  1550. var replacerArgs = concat([matched], captures, position, S);
  1551. if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
  1552. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  1553. } else {
  1554. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1555. }
  1556. if (position >= nextSourcePosition) {
  1557. accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
  1558. nextSourcePosition = position + matched.length;
  1559. }
  1560. }
  1561. return accumulatedResult + stringSlice$1(S, nextSourcePosition);
  1562. }
  1563. ];
  1564. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  1565. var SPECIES$1 = wellKnownSymbol('species');
  1566. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1567. // We can't use this feature detection in V8 since it causes
  1568. // deoptimization and serious performance degradation
  1569. // https://github.com/zloirock/core-js/issues/677
  1570. return engineV8Version >= 51 || !fails(function () {
  1571. var array = [];
  1572. var constructor = array.constructor = {};
  1573. constructor[SPECIES$1] = function () {
  1574. return { foo: 1 };
  1575. };
  1576. return array[METHOD_NAME](Boolean).foo !== 1;
  1577. });
  1578. };
  1579. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1580. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1581. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1582. var TypeError$2 = global_1.TypeError;
  1583. // We can't use this feature detection in V8 since it causes
  1584. // deoptimization and serious performance degradation
  1585. // https://github.com/zloirock/core-js/issues/679
  1586. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1587. var array = [];
  1588. array[IS_CONCAT_SPREADABLE] = false;
  1589. return array.concat()[0] !== array;
  1590. });
  1591. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1592. var isConcatSpreadable = function (O) {
  1593. if (!isObject(O)) return false;
  1594. var spreadable = O[IS_CONCAT_SPREADABLE];
  1595. return spreadable !== undefined ? !!spreadable : isArray(O);
  1596. };
  1597. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1598. // `Array.prototype.concat` method
  1599. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1600. // with adding support of @@isConcatSpreadable and @@species
  1601. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1602. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1603. concat: function concat(arg) {
  1604. var O = toObject(this);
  1605. var A = arraySpeciesCreate(O, 0);
  1606. var n = 0;
  1607. var i, k, length, len, E;
  1608. for (i = -1, length = arguments.length; i < length; i++) {
  1609. E = i === -1 ? O : arguments[i];
  1610. if (isConcatSpreadable(E)) {
  1611. len = lengthOfArrayLike(E);
  1612. if (n + len > MAX_SAFE_INTEGER) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1613. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1614. } else {
  1615. if (n >= MAX_SAFE_INTEGER) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1616. createProperty(A, n++, E);
  1617. }
  1618. }
  1619. A.length = n;
  1620. return A;
  1621. }
  1622. });
  1623. var $filter = arrayIteration.filter;
  1624. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1625. // `Array.prototype.filter` method
  1626. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1627. // with adding support of @@species
  1628. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1629. filter: function filter(callbackfn /* , thisArg */) {
  1630. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1631. }
  1632. });
  1633. // @@match logic
  1634. fixRegexpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  1635. return [
  1636. // `String.prototype.match` method
  1637. // https://tc39.es/ecma262/#sec-string.prototype.match
  1638. function match(regexp) {
  1639. var O = requireObjectCoercible(this);
  1640. var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
  1641. return matcher ? functionCall(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString_1(O));
  1642. },
  1643. // `RegExp.prototype[@@match]` method
  1644. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  1645. function (string) {
  1646. var rx = anObject(this);
  1647. var S = toString_1(string);
  1648. var res = maybeCallNative(nativeMatch, rx, S);
  1649. if (res.done) return res.value;
  1650. if (!rx.global) return regexpExecAbstract(rx, S);
  1651. var fullUnicode = rx.unicode;
  1652. rx.lastIndex = 0;
  1653. var A = [];
  1654. var n = 0;
  1655. var result;
  1656. while ((result = regexpExecAbstract(rx, S)) !== null) {
  1657. var matchStr = toString_1(result[0]);
  1658. A[n] = matchStr;
  1659. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1660. n++;
  1661. }
  1662. return n === 0 ? null : A;
  1663. }
  1664. ];
  1665. });
  1666. var MATCH = wellKnownSymbol('match');
  1667. // `IsRegExp` abstract operation
  1668. // https://tc39.es/ecma262/#sec-isregexp
  1669. var isRegexp = function (it) {
  1670. var isRegExp;
  1671. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1672. };
  1673. var TypeError$1 = global_1.TypeError;
  1674. // `Assert: IsConstructor(argument) is true`
  1675. var aConstructor = function (argument) {
  1676. if (isConstructor(argument)) return argument;
  1677. throw TypeError$1(tryToString(argument) + ' is not a constructor');
  1678. };
  1679. var SPECIES = wellKnownSymbol('species');
  1680. // `SpeciesConstructor` abstract operation
  1681. // https://tc39.es/ecma262/#sec-speciesconstructor
  1682. var speciesConstructor = function (O, defaultConstructor) {
  1683. var C = anObject(O).constructor;
  1684. var S;
  1685. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  1686. };
  1687. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1688. var MAX_UINT32 = 0xFFFFFFFF;
  1689. var min = Math.min;
  1690. var $push = [].push;
  1691. var exec = functionUncurryThis(/./.exec);
  1692. var push = functionUncurryThis($push);
  1693. var stringSlice = functionUncurryThis(''.slice);
  1694. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1695. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1696. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1697. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1698. var re = /(?:)/;
  1699. var originalExec = re.exec;
  1700. re.exec = function () { return originalExec.apply(this, arguments); };
  1701. var result = 'ab'.split(re);
  1702. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1703. });
  1704. // @@split logic
  1705. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1706. var internalSplit;
  1707. if (
  1708. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1709. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1710. 'test'.split(/(?:)/, -1).length != 4 ||
  1711. 'ab'.split(/(?:ab)*/).length != 2 ||
  1712. '.'.split(/(.?)(.?)/).length != 4 ||
  1713. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1714. '.'.split(/()()/).length > 1 ||
  1715. ''.split(/.?/).length
  1716. ) {
  1717. // based on es5-shim implementation, need to rework it
  1718. internalSplit = function (separator, limit) {
  1719. var string = toString_1(requireObjectCoercible(this));
  1720. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1721. if (lim === 0) return [];
  1722. if (separator === undefined) return [string];
  1723. // If `separator` is not a regex, use native split
  1724. if (!isRegexp(separator)) {
  1725. return functionCall(nativeSplit, string, separator, lim);
  1726. }
  1727. var output = [];
  1728. var flags = (separator.ignoreCase ? 'i' : '') +
  1729. (separator.multiline ? 'm' : '') +
  1730. (separator.unicode ? 'u' : '') +
  1731. (separator.sticky ? 'y' : '');
  1732. var lastLastIndex = 0;
  1733. // Make `global` and avoid `lastIndex` issues by working with a copy
  1734. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1735. var match, lastIndex, lastLength;
  1736. while (match = functionCall(regexpExec, separatorCopy, string)) {
  1737. lastIndex = separatorCopy.lastIndex;
  1738. if (lastIndex > lastLastIndex) {
  1739. push(output, stringSlice(string, lastLastIndex, match.index));
  1740. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  1741. lastLength = match[0].length;
  1742. lastLastIndex = lastIndex;
  1743. if (output.length >= lim) break;
  1744. }
  1745. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1746. }
  1747. if (lastLastIndex === string.length) {
  1748. if (lastLength || !exec(separatorCopy, '')) push(output, '');
  1749. } else push(output, stringSlice(string, lastLastIndex));
  1750. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  1751. };
  1752. // Chakra, V8
  1753. } else if ('0'.split(undefined, 0).length) {
  1754. internalSplit = function (separator, limit) {
  1755. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  1756. };
  1757. } else internalSplit = nativeSplit;
  1758. return [
  1759. // `String.prototype.split` method
  1760. // https://tc39.es/ecma262/#sec-string.prototype.split
  1761. function split(separator, limit) {
  1762. var O = requireObjectCoercible(this);
  1763. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  1764. return splitter
  1765. ? functionCall(splitter, separator, O, limit)
  1766. : functionCall(internalSplit, toString_1(O), separator, limit);
  1767. },
  1768. // `RegExp.prototype[@@split]` method
  1769. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1770. //
  1771. // NOTE: This cannot be properly polyfilled in engines that don't support
  1772. // the 'y' flag.
  1773. function (string, limit) {
  1774. var rx = anObject(this);
  1775. var S = toString_1(string);
  1776. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1777. if (res.done) return res.value;
  1778. var C = speciesConstructor(rx, RegExp);
  1779. var unicodeMatching = rx.unicode;
  1780. var flags = (rx.ignoreCase ? 'i' : '') +
  1781. (rx.multiline ? 'm' : '') +
  1782. (rx.unicode ? 'u' : '') +
  1783. (UNSUPPORTED_Y ? 'g' : 'y');
  1784. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1785. // simulate the 'y' flag.
  1786. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1787. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1788. if (lim === 0) return [];
  1789. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1790. var p = 0;
  1791. var q = 0;
  1792. var A = [];
  1793. while (q < S.length) {
  1794. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1795. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  1796. var e;
  1797. if (
  1798. z === null ||
  1799. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1800. ) {
  1801. q = advanceStringIndex(S, q, unicodeMatching);
  1802. } else {
  1803. push(A, stringSlice(S, p, q));
  1804. if (A.length === lim) return A;
  1805. for (var i = 1; i <= z.length - 1; i++) {
  1806. push(A, z[i]);
  1807. if (A.length === lim) return A;
  1808. }
  1809. q = p = e;
  1810. }
  1811. }
  1812. push(A, stringSlice(S, p));
  1813. return A;
  1814. }
  1815. ];
  1816. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  1817. var $includes = arrayIncludes.includes;
  1818. // `Array.prototype.includes` method
  1819. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1820. _export({ target: 'Array', proto: true }, {
  1821. includes: function includes(el /* , fromIndex = 0 */) {
  1822. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1823. }
  1824. });
  1825. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1826. addToUnscopables('includes');
  1827. // iterable DOM collections
  1828. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1829. var domIterables = {
  1830. CSSRuleList: 0,
  1831. CSSStyleDeclaration: 0,
  1832. CSSValueList: 0,
  1833. ClientRectList: 0,
  1834. DOMRectList: 0,
  1835. DOMStringList: 0,
  1836. DOMTokenList: 1,
  1837. DataTransferItemList: 0,
  1838. FileList: 0,
  1839. HTMLAllCollection: 0,
  1840. HTMLCollection: 0,
  1841. HTMLFormElement: 0,
  1842. HTMLSelectElement: 0,
  1843. MediaList: 0,
  1844. MimeTypeArray: 0,
  1845. NamedNodeMap: 0,
  1846. NodeList: 1,
  1847. PaintRequestList: 0,
  1848. Plugin: 0,
  1849. PluginArray: 0,
  1850. SVGLengthList: 0,
  1851. SVGNumberList: 0,
  1852. SVGPathSegList: 0,
  1853. SVGPointList: 0,
  1854. SVGStringList: 0,
  1855. SVGTransformList: 0,
  1856. SourceBufferList: 0,
  1857. StyleSheetList: 0,
  1858. TextTrackCueList: 0,
  1859. TextTrackList: 0,
  1860. TouchList: 0
  1861. };
  1862. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1863. var classList = documentCreateElement('span').classList;
  1864. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1865. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1866. var $forEach = arrayIteration.forEach;
  1867. var STRICT_METHOD$2 = arrayMethodIsStrict('forEach');
  1868. // `Array.prototype.forEach` method implementation
  1869. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1870. var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
  1871. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1872. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  1873. } : [].forEach;
  1874. var handlePrototype = function (CollectionPrototype) {
  1875. // some Chrome versions have non-configurable methods on DOMTokenList
  1876. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1877. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1878. } catch (error) {
  1879. CollectionPrototype.forEach = arrayForEach;
  1880. }
  1881. };
  1882. for (var COLLECTION_NAME in domIterables) {
  1883. if (domIterables[COLLECTION_NAME]) {
  1884. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1885. }
  1886. }
  1887. handlePrototype(domTokenListPrototype);
  1888. var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
  1889. // `Object.keys` method
  1890. // https://tc39.es/ecma262/#sec-object.keys
  1891. _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  1892. keys: function keys(it) {
  1893. return objectKeys(toObject(it));
  1894. }
  1895. });
  1896. var un$Join = functionUncurryThis([].join);
  1897. var ES3_STRINGS = indexedObject != Object;
  1898. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  1899. // `Array.prototype.join` method
  1900. // https://tc39.es/ecma262/#sec-array.prototype.join
  1901. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  1902. join: function join(separator) {
  1903. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1904. }
  1905. });
  1906. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1907. var $IndexOf = arrayIncludes.indexOf;
  1908. var un$IndexOf = functionUncurryThis([].indexOf);
  1909. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1910. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1911. // `Array.prototype.indexOf` method
  1912. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1913. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1914. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1915. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1916. return NEGATIVE_ZERO
  1917. // convert -0 to +0
  1918. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1919. : $IndexOf(this, searchElement, fromIndex);
  1920. }
  1921. });
  1922. /* eslint-disable no-use-before-define */
  1923. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1924. var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
  1925. function getInputClass(that) {
  1926. var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1927. var formControlClass = isSelect ? that.constants.classes.select : that.constants.classes.input;
  1928. return that.options.iconSize ? Utils.sprintf('%s-%s', formControlClass, that.options.iconSize) : formControlClass;
  1929. }
  1930. function getOptionsFromSelectControl(selectControl) {
  1931. return selectControl[0].options;
  1932. }
  1933. function getControlContainer(that) {
  1934. if (that.options.filterControlContainer) {
  1935. return $__default["default"]("".concat(that.options.filterControlContainer));
  1936. }
  1937. if (that.options.height && that._initialized) {
  1938. return $__default["default"]('.fixed-table-header table thead');
  1939. }
  1940. return that.$header;
  1941. }
  1942. function isKeyAllowed(keyCode) {
  1943. return $__default["default"].inArray(keyCode, [37, 38, 39, 40]) > -1;
  1944. }
  1945. function getSearchControls(that) {
  1946. return getControlContainer(that).find(searchControls);
  1947. }
  1948. function hideUnusedSelectOptions(selectControl, uniqueValues) {
  1949. var options = getOptionsFromSelectControl(selectControl);
  1950. for (var i = 0; i < options.length; i++) {
  1951. if (options[i].value !== '') {
  1952. if (!uniqueValues.hasOwnProperty(options[i].value)) {
  1953. selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
  1954. } else {
  1955. selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
  1956. }
  1957. }
  1958. }
  1959. }
  1960. function existOptionInSelectControl(selectControl, value) {
  1961. var options = getOptionsFromSelectControl(selectControl);
  1962. for (var i = 0; i < options.length; i++) {
  1963. if (options[i].value === Utils.unescapeHTML(value)) {
  1964. // The value is not valid to add
  1965. return true;
  1966. }
  1967. } // If we get here, the value is valid to add
  1968. return false;
  1969. }
  1970. function addOptionToSelectControl(selectControl, _value, text, selected, shouldCompareText) {
  1971. var value = _value === undefined || _value === null ? '' : _value.toString().trim();
  1972. value = Utils.removeHTML(value);
  1973. text = Utils.removeHTML(text);
  1974. if (existOptionInSelectControl(selectControl, value)) {
  1975. return;
  1976. }
  1977. var isSelected = shouldCompareText ? value === selected || text === selected : value === selected;
  1978. var option = new Option(text, value, false, isSelected);
  1979. selectControl.get(0).add(option);
  1980. }
  1981. function sortSelectControl(selectControl, orderBy) {
  1982. var $selectControl = selectControl.get(0);
  1983. if (orderBy === 'server') {
  1984. return;
  1985. }
  1986. var tmpAry = new Array();
  1987. for (var i = 0; i < $selectControl.options.length; i++) {
  1988. tmpAry[i] = new Array();
  1989. tmpAry[i][0] = $selectControl.options[i].text;
  1990. tmpAry[i][1] = $selectControl.options[i].value;
  1991. tmpAry[i][2] = $selectControl.options[i].selected;
  1992. }
  1993. tmpAry.sort(function (a, b) {
  1994. return Utils.sort(a[0], b[0], orderBy === 'desc' ? -1 : 1);
  1995. });
  1996. while ($selectControl.options.length > 0) {
  1997. $selectControl.options[0] = null;
  1998. }
  1999. for (var _i = 0; _i < tmpAry.length; _i++) {
  2000. var op = new Option(tmpAry[_i][0], tmpAry[_i][1], false, tmpAry[_i][2]);
  2001. $selectControl.add(op);
  2002. }
  2003. }
  2004. function fixHeaderCSS(_ref) {
  2005. var $tableHeader = _ref.$tableHeader;
  2006. $tableHeader.css('height', $tableHeader.find('table').outerHeight(true));
  2007. }
  2008. function getElementClass($element) {
  2009. return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
  2010. }
  2011. function getCursorPosition(el) {
  2012. if ($__default["default"](el).is('input[type=search]')) {
  2013. var pos = 0;
  2014. if ('selectionStart' in el) {
  2015. pos = el.selectionStart;
  2016. } else if ('selection' in document) {
  2017. el.focus();
  2018. var Sel = document.selection.createRange();
  2019. var SelLength = document.selection.createRange().text.length;
  2020. Sel.moveStart('character', -el.value.length);
  2021. pos = Sel.text.length - SelLength;
  2022. }
  2023. return pos;
  2024. }
  2025. return -1;
  2026. }
  2027. function cacheValues(that) {
  2028. var searchControls = getSearchControls(that);
  2029. that._valuesFilterControl = [];
  2030. searchControls.each(function () {
  2031. var $field = $__default["default"](this);
  2032. var fieldClass = getElementClass($field);
  2033. if (that.options.height && !that.options.filterControlContainer) {
  2034. $field = $__default["default"](".fixed-table-header .".concat(fieldClass));
  2035. } else if (that.options.filterControlContainer) {
  2036. $field = $__default["default"]("".concat(that.options.filterControlContainer, " .").concat(fieldClass));
  2037. } else {
  2038. $field = $__default["default"](".".concat(fieldClass));
  2039. }
  2040. that._valuesFilterControl.push({
  2041. field: $field.closest('[data-field]').data('field'),
  2042. value: $field.val(),
  2043. position: getCursorPosition($field.get(0)),
  2044. hasFocus: $field.is(':focus')
  2045. });
  2046. });
  2047. }
  2048. function setCaretPosition(elem, caretPos) {
  2049. try {
  2050. if (elem) {
  2051. if (elem.createTextRange) {
  2052. var range = elem.createTextRange();
  2053. range.move('character', caretPos);
  2054. range.select();
  2055. } else {
  2056. elem.setSelectionRange(caretPos, caretPos);
  2057. }
  2058. }
  2059. } catch (ex) {// ignored
  2060. }
  2061. }
  2062. function setValues(that) {
  2063. var field = null;
  2064. var result = [];
  2065. var searchControls = getSearchControls(that);
  2066. if (that._valuesFilterControl.length > 0) {
  2067. // Callback to apply after settings fields values
  2068. var callbacks = [];
  2069. searchControls.each(function (i, el) {
  2070. var $this = $__default["default"](el);
  2071. field = $this.closest('[data-field]').data('field');
  2072. result = that._valuesFilterControl.filter(function (valueObj) {
  2073. return valueObj.field === field;
  2074. });
  2075. if (result.length > 0) {
  2076. if (result[0].hasFocus || result[0].value) {
  2077. var fieldToFocusCallback = function (element, cacheElementInfo) {
  2078. // Closure here to capture the field information
  2079. var closedCallback = function closedCallback() {
  2080. if (cacheElementInfo.hasFocus) {
  2081. element.focus();
  2082. }
  2083. if (Array.isArray(cacheElementInfo.value)) {
  2084. var $element = $__default["default"](element);
  2085. $__default["default"].each(cacheElementInfo.value, function (i, e) {
  2086. $element.find(Utils.sprintf('option[value=\'%s\']', e)).prop('selected', true);
  2087. });
  2088. } else {
  2089. element.value = cacheElementInfo.value;
  2090. }
  2091. setCaretPosition(element, cacheElementInfo.position);
  2092. };
  2093. return closedCallback;
  2094. }($this.get(0), result[0]);
  2095. callbacks.push(fieldToFocusCallback);
  2096. }
  2097. }
  2098. }); // Callback call.
  2099. if (callbacks.length > 0) {
  2100. callbacks.forEach(function (callback) {
  2101. return callback();
  2102. });
  2103. }
  2104. }
  2105. }
  2106. function collectBootstrapTableFilterCookies() {
  2107. var cookies = [];
  2108. var foundCookies = document.cookie.match(/bs\.table\.(filterControl|searchText)/g);
  2109. var foundLocalStorage = localStorage;
  2110. if (foundCookies) {
  2111. $__default["default"].each(foundCookies, function (i, _cookie) {
  2112. var cookie = _cookie;
  2113. if (/./.test(cookie)) {
  2114. cookie = cookie.split('.').pop();
  2115. }
  2116. if ($__default["default"].inArray(cookie, cookies) === -1) {
  2117. cookies.push(cookie);
  2118. }
  2119. });
  2120. }
  2121. if (foundLocalStorage) {
  2122. for (var i = 0; i < foundLocalStorage.length; i++) {
  2123. var cookie = foundLocalStorage.key(i);
  2124. if (/./.test(cookie)) {
  2125. cookie = cookie.split('.').pop();
  2126. }
  2127. if (!cookies.includes(cookie)) {
  2128. cookies.push(cookie);
  2129. }
  2130. }
  2131. }
  2132. return cookies;
  2133. }
  2134. function escapeID(id) {
  2135. // eslint-disable-next-line no-useless-escape
  2136. return String(id).replace(/([:.\[\],])/g, '\\$1');
  2137. }
  2138. function isColumnSearchableViaSelect(_ref2) {
  2139. var filterControl = _ref2.filterControl,
  2140. searchable = _ref2.searchable;
  2141. return filterControl && filterControl.toLowerCase() === 'select' && searchable;
  2142. }
  2143. function isFilterDataNotGiven(_ref3) {
  2144. var filterData = _ref3.filterData;
  2145. return filterData === undefined || filterData.toLowerCase() === 'column';
  2146. }
  2147. function hasSelectControlElement(selectControl) {
  2148. return selectControl && selectControl.length > 0;
  2149. }
  2150. function initFilterSelectControls(that) {
  2151. var data = that.options.data;
  2152. $__default["default"].each(that.header.fields, function (j, field) {
  2153. var column = that.columns[that.fieldsColumnsIndex[field]];
  2154. var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
  2155. if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
  2156. if (!selectControl[0].multiple && selectControl.get(selectControl.length - 1).options.length === 0) {
  2157. // Added the default option, must use a non-breaking space(&nbsp;) to pass the W3C validator
  2158. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder || ' ', column.filterDefault);
  2159. }
  2160. var uniqueValues = {};
  2161. for (var i = 0; i < data.length; i++) {
  2162. // Added a new value
  2163. var fieldValue = Utils.getItemField(data[i], field, false);
  2164. var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
  2165. var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
  2166. if (!fieldValue) {
  2167. fieldValue = formattedValue;
  2168. column._forceFormatter = true;
  2169. }
  2170. if (column.filterDataCollector) {
  2171. formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
  2172. }
  2173. if (column.searchFormatter) {
  2174. fieldValue = formattedValue;
  2175. }
  2176. uniqueValues[formattedValue] = fieldValue;
  2177. if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
  2178. formattedValue.forEach(function (value) {
  2179. addOptionToSelectControl(selectControl, value, value, column.filterDefault);
  2180. });
  2181. continue;
  2182. }
  2183. } // eslint-disable-next-line guard-for-in
  2184. for (var key in uniqueValues) {
  2185. addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
  2186. }
  2187. }
  2188. });
  2189. }
  2190. function getFilterDataMethod(objFilterDataMethod, searchTerm) {
  2191. var keys = Object.keys(objFilterDataMethod);
  2192. for (var i = 0; i < keys.length; i++) {
  2193. if (keys[i] === searchTerm) {
  2194. return objFilterDataMethod[searchTerm];
  2195. }
  2196. }
  2197. return null;
  2198. }
  2199. function createControls(that, header) {
  2200. var addedFilterControl = false;
  2201. var html;
  2202. $__default["default"].each(that.columns, function (_, column) {
  2203. html = [];
  2204. if (!column.visible) {
  2205. return;
  2206. }
  2207. if (!column.filterControl && !that.options.filterControlContainer) {
  2208. html.push('<div class="no-filter-control"></div>');
  2209. } else if (that.options.filterControlContainer) {
  2210. // Use a filter control container instead of th
  2211. var $filterControls = $__default["default"](".bootstrap-table-filter-control-".concat(column.field));
  2212. $__default["default"].each($filterControls, function (_, filterControl) {
  2213. var $filterControl = $__default["default"](filterControl);
  2214. if (!$filterControl.is('[type=radio]')) {
  2215. var placeholder = column.filterControlPlaceholder || '';
  2216. $filterControl.attr('placeholder', placeholder).val(column.filterDefault);
  2217. }
  2218. $filterControl.attr('data-field', column.field);
  2219. });
  2220. addedFilterControl = true;
  2221. } else {
  2222. // Create the control based on the html defined in the filterTemplate array.
  2223. var nameControl = column.filterControl.toLowerCase();
  2224. html.push('<div class="filter-control">');
  2225. addedFilterControl = true;
  2226. if (column.searchable && that.options.filterTemplate[nameControl]) {
  2227. html.push(that.options.filterTemplate[nameControl](that, column, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
  2228. }
  2229. } // Filtering by default when it is set.
  2230. if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
  2231. if ($__default["default"].isEmptyObject(that.filterColumnsPartial)) {
  2232. that.filterColumnsPartial = {};
  2233. }
  2234. that.filterColumnsPartial[column.field] = column.filterDefault;
  2235. }
  2236. $__default["default"].each(header.find('th'), function (_, th) {
  2237. var $th = $__default["default"](th);
  2238. if ($th.data('field') === column.field) {
  2239. $th.find('.filter-control').remove();
  2240. $th.find('.fht-cell').html(html.join(''));
  2241. return false;
  2242. }
  2243. });
  2244. if (column.filterData && column.filterData.toLowerCase() !== 'column') {
  2245. var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
  2246. var filterDataSource;
  2247. var selectControl;
  2248. if (filterDataType) {
  2249. filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
  2250. selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
  2251. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault, true);
  2252. filterDataType(that, filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
  2253. } else {
  2254. throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
  2255. }
  2256. }
  2257. });
  2258. if (addedFilterControl) {
  2259. header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
  2260. var currentTarget = _ref4.currentTarget,
  2261. keyCode = _ref4.keyCode;
  2262. keyCode = obj ? obj.keyCode : keyCode;
  2263. if (that.options.searchOnEnterKey && keyCode !== 13) {
  2264. return;
  2265. }
  2266. if (isKeyAllowed(keyCode)) {
  2267. return;
  2268. }
  2269. var $currentTarget = $__default["default"](currentTarget);
  2270. if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
  2271. return;
  2272. }
  2273. clearTimeout(currentTarget.timeoutId || 0);
  2274. currentTarget.timeoutId = setTimeout(function () {
  2275. that.onColumnSearch({
  2276. currentTarget: currentTarget,
  2277. keyCode: keyCode
  2278. });
  2279. }, that.options.searchTimeOut);
  2280. });
  2281. header.off('change', 'select', '.fc-multipleselect').on('change', 'select', '.fc-multipleselect', function (_ref5) {
  2282. var currentTarget = _ref5.currentTarget,
  2283. keyCode = _ref5.keyCode;
  2284. var $selectControl = $__default["default"](currentTarget);
  2285. var value = $selectControl.val();
  2286. if (Array.isArray(value)) {
  2287. for (var i = 0; i < value.length; i++) {
  2288. if (value[i] && value[i].length > 0 && value[i].trim()) {
  2289. $selectControl.find("option[value=\"".concat(value[i], "\"]")).attr('selected', true);
  2290. }
  2291. }
  2292. } else if (value && value.length > 0 && value.trim()) {
  2293. $selectControl.find('option[selected]').removeAttr('selected');
  2294. $selectControl.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  2295. } else {
  2296. $selectControl.find('option[selected]').removeAttr('selected');
  2297. }
  2298. clearTimeout(currentTarget.timeoutId || 0);
  2299. currentTarget.timeoutId = setTimeout(function () {
  2300. that.onColumnSearch({
  2301. currentTarget: currentTarget,
  2302. keyCode: keyCode
  2303. });
  2304. }, that.options.searchTimeOut);
  2305. });
  2306. header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
  2307. var currentTarget = _ref6.currentTarget,
  2308. keyCode = _ref6.keyCode;
  2309. var $input = $__default["default"](currentTarget);
  2310. var oldValue = $input.val();
  2311. if (oldValue === '') {
  2312. return;
  2313. }
  2314. setTimeout(function () {
  2315. var newValue = $input.val();
  2316. if (newValue === '') {
  2317. clearTimeout(currentTarget.timeoutId || 0);
  2318. currentTarget.timeoutId = setTimeout(function () {
  2319. that.onColumnSearch({
  2320. currentTarget: currentTarget,
  2321. keyCode: keyCode
  2322. });
  2323. }, that.options.searchTimeOut);
  2324. }
  2325. }, 1);
  2326. });
  2327. header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
  2328. var currentTarget = _ref7.currentTarget,
  2329. keyCode = _ref7.keyCode;
  2330. clearTimeout(currentTarget.timeoutId || 0);
  2331. currentTarget.timeoutId = setTimeout(function () {
  2332. that.onColumnSearch({
  2333. currentTarget: currentTarget,
  2334. keyCode: keyCode
  2335. });
  2336. }, that.options.searchTimeOut);
  2337. }); // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
  2338. if (header.find('.date-filter-control').length > 0) {
  2339. $__default["default"].each(that.columns, function (i, _ref8) {
  2340. var filterDefault = _ref8.filterDefault,
  2341. filterControl = _ref8.filterControl,
  2342. field = _ref8.field,
  2343. filterDatepickerOptions = _ref8.filterDatepickerOptions;
  2344. if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
  2345. var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field));
  2346. if (filterDefault) {
  2347. $datepicker.value(filterDefault);
  2348. }
  2349. if (filterDatepickerOptions.min) {
  2350. $datepicker.attr('min', filterDatepickerOptions.min);
  2351. }
  2352. if (filterDatepickerOptions.max) {
  2353. $datepicker.attr('max', filterDatepickerOptions.max);
  2354. }
  2355. if (filterDatepickerOptions.step) {
  2356. $datepicker.attr('step', filterDatepickerOptions.step);
  2357. }
  2358. if (filterDatepickerOptions.pattern) {
  2359. $datepicker.attr('pattern', filterDatepickerOptions.pattern);
  2360. }
  2361. $datepicker.on('change', function (_ref9) {
  2362. var currentTarget = _ref9.currentTarget;
  2363. clearTimeout(currentTarget.timeoutId || 0);
  2364. currentTarget.timeoutId = setTimeout(function () {
  2365. that.onColumnSearch({
  2366. currentTarget: currentTarget
  2367. });
  2368. }, that.options.searchTimeOut);
  2369. });
  2370. }
  2371. });
  2372. }
  2373. if (that.options.sidePagination !== 'server') {
  2374. that.triggerSearch();
  2375. }
  2376. if (!that.options.filterControlVisible) {
  2377. header.find('.filter-control, .no-filter-control').hide();
  2378. }
  2379. } else {
  2380. header.find('.filter-control, .no-filter-control').hide();
  2381. }
  2382. that.trigger('created-controls');
  2383. }
  2384. function getDirectionOfSelectOptions(_alignment) {
  2385. var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
  2386. switch (alignment) {
  2387. case 'left':
  2388. return 'ltr';
  2389. case 'right':
  2390. return 'rtl';
  2391. case 'auto':
  2392. return 'auto';
  2393. default:
  2394. return 'ltr';
  2395. }
  2396. }
  2397. function syncHeaders(that) {
  2398. if (!that.options.height) {
  2399. return;
  2400. }
  2401. var fixedHeader = $__default["default"]('.fixed-table-header table thead');
  2402. if (fixedHeader.length === 0) {
  2403. return;
  2404. }
  2405. that.$header.children().find('th[data-field]').each(function (_, element) {
  2406. if (element.classList[0] !== 'bs-checkbox') {
  2407. var $element = $__default["default"](element);
  2408. var $field = $element.data('field');
  2409. var $fixedField = $__default["default"]("th[data-field='".concat($field, "']")).not($element);
  2410. var input = $element.find('input');
  2411. var fixedInput = $fixedField.find('input');
  2412. if (input.length > 0 && fixedInput.length > 0) {
  2413. if (input.val() !== fixedInput.val()) {
  2414. input.val(fixedInput.val());
  2415. }
  2416. }
  2417. }
  2418. });
  2419. }
  2420. var filterDataMethods = {
  2421. func: function func(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2422. var variableValues = window[filterDataSource].apply(); // eslint-disable-next-line guard-for-in
  2423. for (var key in variableValues) {
  2424. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2425. }
  2426. if (that.options.sortSelectOptions) {
  2427. sortSelectControl(selectControl, filterOrderBy);
  2428. }
  2429. setValues(that);
  2430. },
  2431. obj: function obj(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2432. var objectKeys = filterDataSource.split('.');
  2433. var variableName = objectKeys.shift();
  2434. var variableValues = window[variableName];
  2435. if (objectKeys.length > 0) {
  2436. objectKeys.forEach(function (key) {
  2437. variableValues = variableValues[key];
  2438. });
  2439. } // eslint-disable-next-line guard-for-in
  2440. for (var key in variableValues) {
  2441. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2442. }
  2443. if (that.options.sortSelectOptions) {
  2444. sortSelectControl(selectControl, filterOrderBy);
  2445. }
  2446. setValues(that);
  2447. },
  2448. var: function _var(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2449. var variableValues = window[filterDataSource];
  2450. var isArray = Array.isArray(variableValues);
  2451. for (var key in variableValues) {
  2452. if (isArray) {
  2453. addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected, true);
  2454. } else {
  2455. addOptionToSelectControl(selectControl, key, variableValues[key], selected, true);
  2456. }
  2457. }
  2458. if (that.options.sortSelectOptions) {
  2459. sortSelectControl(selectControl, filterOrderBy);
  2460. }
  2461. setValues(that);
  2462. },
  2463. url: function url(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2464. $__default["default"].ajax({
  2465. url: filterDataSource,
  2466. dataType: 'json',
  2467. success: function success(data) {
  2468. // eslint-disable-next-line guard-for-in
  2469. for (var key in data) {
  2470. addOptionToSelectControl(selectControl, key, data[key], selected);
  2471. }
  2472. if (that.options.sortSelectOptions) {
  2473. sortSelectControl(selectControl, filterOrderBy);
  2474. }
  2475. setValues(that);
  2476. }
  2477. });
  2478. },
  2479. json: function json(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2480. var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
  2481. for (var key in variableValues) {
  2482. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2483. }
  2484. if (that.options.sortSelectOptions) {
  2485. sortSelectControl(selectControl, filterOrderBy);
  2486. }
  2487. setValues(that);
  2488. }
  2489. };
  2490. exports.addOptionToSelectControl = addOptionToSelectControl;
  2491. exports.cacheValues = cacheValues;
  2492. exports.collectBootstrapTableFilterCookies = collectBootstrapTableFilterCookies;
  2493. exports.createControls = createControls;
  2494. exports.escapeID = escapeID;
  2495. exports.existOptionInSelectControl = existOptionInSelectControl;
  2496. exports.fixHeaderCSS = fixHeaderCSS;
  2497. exports.getControlContainer = getControlContainer;
  2498. exports.getCursorPosition = getCursorPosition;
  2499. exports.getDirectionOfSelectOptions = getDirectionOfSelectOptions;
  2500. exports.getElementClass = getElementClass;
  2501. exports.getFilterDataMethod = getFilterDataMethod;
  2502. exports.getInputClass = getInputClass;
  2503. exports.getOptionsFromSelectControl = getOptionsFromSelectControl;
  2504. exports.getSearchControls = getSearchControls;
  2505. exports.hasSelectControlElement = hasSelectControlElement;
  2506. exports.hideUnusedSelectOptions = hideUnusedSelectOptions;
  2507. exports.initFilterSelectControls = initFilterSelectControls;
  2508. exports.isColumnSearchableViaSelect = isColumnSearchableViaSelect;
  2509. exports.isFilterDataNotGiven = isFilterDataNotGiven;
  2510. exports.isKeyAllowed = isKeyAllowed;
  2511. exports.setCaretPosition = setCaretPosition;
  2512. exports.setValues = setValues;
  2513. exports.sortSelectControl = sortSelectControl;
  2514. exports.syncHeaders = syncHeaders;
  2515. Object.defineProperty(exports, '__esModule', { value: true });
  2516. }));