bootstrap-table.js 318 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
  5. })(this, (function ($$n) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($$n);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. function _classCallCheck(instance, Constructor) {
  17. if (!(instance instanceof Constructor)) {
  18. throw new TypeError("Cannot call a class as a function");
  19. }
  20. }
  21. function _defineProperties(target, props) {
  22. for (var i = 0; i < props.length; i++) {
  23. var descriptor = props[i];
  24. descriptor.enumerable = descriptor.enumerable || false;
  25. descriptor.configurable = true;
  26. if ("value" in descriptor) descriptor.writable = true;
  27. Object.defineProperty(target, descriptor.key, descriptor);
  28. }
  29. }
  30. function _createClass(Constructor, protoProps, staticProps) {
  31. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  32. if (staticProps) _defineProperties(Constructor, staticProps);
  33. Object.defineProperty(Constructor, "prototype", {
  34. writable: false
  35. });
  36. return Constructor;
  37. }
  38. function _slicedToArray(arr, i) {
  39. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  40. }
  41. function _toConsumableArray(arr) {
  42. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  43. }
  44. function _arrayWithoutHoles(arr) {
  45. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  46. }
  47. function _arrayWithHoles(arr) {
  48. if (Array.isArray(arr)) return arr;
  49. }
  50. function _iterableToArray(iter) {
  51. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  52. }
  53. function _iterableToArrayLimit(arr, i) {
  54. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  55. if (_i == null) return;
  56. var _arr = [];
  57. var _n = true;
  58. var _d = false;
  59. var _s, _e;
  60. try {
  61. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  62. _arr.push(_s.value);
  63. if (i && _arr.length === i) break;
  64. }
  65. } catch (err) {
  66. _d = true;
  67. _e = err;
  68. } finally {
  69. try {
  70. if (!_n && _i["return"] != null) _i["return"]();
  71. } finally {
  72. if (_d) throw _e;
  73. }
  74. }
  75. return _arr;
  76. }
  77. function _unsupportedIterableToArray(o, minLen) {
  78. if (!o) return;
  79. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  80. var n = Object.prototype.toString.call(o).slice(8, -1);
  81. if (n === "Object" && o.constructor) n = o.constructor.name;
  82. if (n === "Map" || n === "Set") return Array.from(o);
  83. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  84. }
  85. function _arrayLikeToArray(arr, len) {
  86. if (len == null || len > arr.length) len = arr.length;
  87. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  88. return arr2;
  89. }
  90. function _nonIterableSpread() {
  91. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  92. }
  93. function _nonIterableRest() {
  94. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  95. }
  96. function _createForOfIteratorHelper(o, allowArrayLike) {
  97. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  98. if (!it) {
  99. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  100. if (it) o = it;
  101. var i = 0;
  102. var F = function () {};
  103. return {
  104. s: F,
  105. n: function () {
  106. if (i >= o.length) return {
  107. done: true
  108. };
  109. return {
  110. done: false,
  111. value: o[i++]
  112. };
  113. },
  114. e: function (e) {
  115. throw e;
  116. },
  117. f: F
  118. };
  119. }
  120. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  121. }
  122. var normalCompletion = true,
  123. didErr = false,
  124. err;
  125. return {
  126. s: function () {
  127. it = it.call(o);
  128. },
  129. n: function () {
  130. var step = it.next();
  131. normalCompletion = step.done;
  132. return step;
  133. },
  134. e: function (e) {
  135. didErr = true;
  136. err = e;
  137. },
  138. f: function () {
  139. try {
  140. if (!normalCompletion && it.return != null) it.return();
  141. } finally {
  142. if (didErr) throw err;
  143. }
  144. }
  145. };
  146. }
  147. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  148. var check = function (it) {
  149. return it && it.Math == Math && it;
  150. };
  151. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  152. var global$j =
  153. // eslint-disable-next-line es/no-global-this -- safe
  154. check(typeof globalThis == 'object' && globalThis) ||
  155. check(typeof window == 'object' && window) ||
  156. // eslint-disable-next-line no-restricted-globals -- safe
  157. check(typeof self == 'object' && self) ||
  158. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  159. // eslint-disable-next-line no-new-func -- fallback
  160. (function () { return this; })() || Function('return this')();
  161. var objectGetOwnPropertyDescriptor = {};
  162. var fails$u = function (exec) {
  163. try {
  164. return !!exec();
  165. } catch (error) {
  166. return true;
  167. }
  168. };
  169. var fails$t = fails$u;
  170. // Detect IE8's incomplete defineProperty implementation
  171. var descriptors = !fails$t(function () {
  172. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  173. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  174. });
  175. var fails$s = fails$u;
  176. var functionBindNative = !fails$s(function () {
  177. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  178. var test = (function () { /* empty */ }).bind();
  179. // eslint-disable-next-line no-prototype-builtins -- safe
  180. return typeof test != 'function' || test.hasOwnProperty('prototype');
  181. });
  182. var NATIVE_BIND$3 = functionBindNative;
  183. var call$e = Function.prototype.call;
  184. var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
  185. return call$e.apply(call$e, arguments);
  186. };
  187. var objectPropertyIsEnumerable = {};
  188. var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
  189. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  190. var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
  191. // Nashorn ~ JDK8 bug
  192. var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
  193. // `Object.prototype.propertyIsEnumerable` method implementation
  194. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  195. objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  196. var descriptor = getOwnPropertyDescriptor$5(this, V);
  197. return !!descriptor && descriptor.enumerable;
  198. } : $propertyIsEnumerable$1;
  199. var createPropertyDescriptor$4 = function (bitmap, value) {
  200. return {
  201. enumerable: !(bitmap & 1),
  202. configurable: !(bitmap & 2),
  203. writable: !(bitmap & 4),
  204. value: value
  205. };
  206. };
  207. var NATIVE_BIND$2 = functionBindNative;
  208. var FunctionPrototype$2 = Function.prototype;
  209. var call$d = FunctionPrototype$2.call;
  210. var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
  211. var functionUncurryThisRaw = function (fn) {
  212. return NATIVE_BIND$2 ? uncurryThisWithBind(fn) : function () {
  213. return call$d.apply(fn, arguments);
  214. };
  215. };
  216. var uncurryThisRaw$1 = functionUncurryThisRaw;
  217. var toString$h = uncurryThisRaw$1({}.toString);
  218. var stringSlice$7 = uncurryThisRaw$1(''.slice);
  219. var classofRaw$2 = function (it) {
  220. return stringSlice$7(toString$h(it), 8, -1);
  221. };
  222. var classofRaw$1 = classofRaw$2;
  223. var uncurryThisRaw = functionUncurryThisRaw;
  224. var functionUncurryThis = function (fn) {
  225. // Nashorn bug:
  226. // https://github.com/zloirock/core-js/issues/1128
  227. // https://github.com/zloirock/core-js/issues/1130
  228. if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
  229. };
  230. var uncurryThis$w = functionUncurryThis;
  231. var fails$r = fails$u;
  232. var classof$7 = classofRaw$2;
  233. var $Object$4 = Object;
  234. var split = uncurryThis$w(''.split);
  235. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  236. var indexedObject = fails$r(function () {
  237. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  238. // eslint-disable-next-line no-prototype-builtins -- safe
  239. return !$Object$4('z').propertyIsEnumerable(0);
  240. }) ? function (it) {
  241. return classof$7(it) == 'String' ? split(it, '') : $Object$4(it);
  242. } : $Object$4;
  243. // we can't use just `it == null` since of `document.all` special case
  244. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  245. var isNullOrUndefined$7 = function (it) {
  246. return it === null || it === undefined;
  247. };
  248. var isNullOrUndefined$6 = isNullOrUndefined$7;
  249. var $TypeError$c = TypeError;
  250. // `RequireObjectCoercible` abstract operation
  251. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  252. var requireObjectCoercible$b = function (it) {
  253. if (isNullOrUndefined$6(it)) throw $TypeError$c("Can't call method on " + it);
  254. return it;
  255. };
  256. // toObject with fallback for non-array-like ES3 strings
  257. var IndexedObject$3 = indexedObject;
  258. var requireObjectCoercible$a = requireObjectCoercible$b;
  259. var toIndexedObject$8 = function (it) {
  260. return IndexedObject$3(requireObjectCoercible$a(it));
  261. };
  262. var documentAll$2 = typeof document == 'object' && document.all;
  263. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  264. var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
  265. var documentAll_1 = {
  266. all: documentAll$2,
  267. IS_HTMLDDA: IS_HTMLDDA
  268. };
  269. var $documentAll$1 = documentAll_1;
  270. var documentAll$1 = $documentAll$1.all;
  271. // `IsCallable` abstract operation
  272. // https://tc39.es/ecma262/#sec-iscallable
  273. var isCallable$j = $documentAll$1.IS_HTMLDDA ? function (argument) {
  274. return typeof argument == 'function' || argument === documentAll$1;
  275. } : function (argument) {
  276. return typeof argument == 'function';
  277. };
  278. var isCallable$i = isCallable$j;
  279. var $documentAll = documentAll_1;
  280. var documentAll = $documentAll.all;
  281. var isObject$b = $documentAll.IS_HTMLDDA ? function (it) {
  282. return typeof it == 'object' ? it !== null : isCallable$i(it) || it === documentAll;
  283. } : function (it) {
  284. return typeof it == 'object' ? it !== null : isCallable$i(it);
  285. };
  286. var global$i = global$j;
  287. var isCallable$h = isCallable$j;
  288. var aFunction = function (argument) {
  289. return isCallable$h(argument) ? argument : undefined;
  290. };
  291. var getBuiltIn$6 = function (namespace, method) {
  292. return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
  293. };
  294. var uncurryThis$v = functionUncurryThis;
  295. var objectIsPrototypeOf = uncurryThis$v({}.isPrototypeOf);
  296. var getBuiltIn$5 = getBuiltIn$6;
  297. var engineUserAgent = getBuiltIn$5('navigator', 'userAgent') || '';
  298. var global$h = global$j;
  299. var userAgent$2 = engineUserAgent;
  300. var process = global$h.process;
  301. var Deno = global$h.Deno;
  302. var versions = process && process.versions || Deno && Deno.version;
  303. var v8 = versions && versions.v8;
  304. var match, version;
  305. if (v8) {
  306. match = v8.split('.');
  307. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  308. // but their correct versions are not interesting for us
  309. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  310. }
  311. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  312. // so check `userAgent` even if `.v8` exists, but 0
  313. if (!version && userAgent$2) {
  314. match = userAgent$2.match(/Edge\/(\d+)/);
  315. if (!match || match[1] >= 74) {
  316. match = userAgent$2.match(/Chrome\/(\d+)/);
  317. if (match) version = +match[1];
  318. }
  319. }
  320. var engineV8Version = version;
  321. /* eslint-disable es/no-symbol -- required for testing */
  322. var V8_VERSION$2 = engineV8Version;
  323. var fails$q = fails$u;
  324. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  325. var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () {
  326. var symbol = Symbol();
  327. // Chrome 38 Symbol has incorrect toString conversion
  328. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  329. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  330. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  331. !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
  332. });
  333. /* eslint-disable es/no-symbol -- required for testing */
  334. var NATIVE_SYMBOL$1 = symbolConstructorDetection;
  335. var useSymbolAsUid = NATIVE_SYMBOL$1
  336. && !Symbol.sham
  337. && typeof Symbol.iterator == 'symbol';
  338. var getBuiltIn$4 = getBuiltIn$6;
  339. var isCallable$g = isCallable$j;
  340. var isPrototypeOf$3 = objectIsPrototypeOf;
  341. var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
  342. var $Object$3 = Object;
  343. var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
  344. return typeof it == 'symbol';
  345. } : function (it) {
  346. var $Symbol = getBuiltIn$4('Symbol');
  347. return isCallable$g($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
  348. };
  349. var $String$3 = String;
  350. var tryToString$3 = function (argument) {
  351. try {
  352. return $String$3(argument);
  353. } catch (error) {
  354. return 'Object';
  355. }
  356. };
  357. var isCallable$f = isCallable$j;
  358. var tryToString$2 = tryToString$3;
  359. var $TypeError$b = TypeError;
  360. // `Assert: IsCallable(argument) is true`
  361. var aCallable$3 = function (argument) {
  362. if (isCallable$f(argument)) return argument;
  363. throw $TypeError$b(tryToString$2(argument) + ' is not a function');
  364. };
  365. var aCallable$2 = aCallable$3;
  366. var isNullOrUndefined$5 = isNullOrUndefined$7;
  367. // `GetMethod` abstract operation
  368. // https://tc39.es/ecma262/#sec-getmethod
  369. var getMethod$5 = function (V, P) {
  370. var func = V[P];
  371. return isNullOrUndefined$5(func) ? undefined : aCallable$2(func);
  372. };
  373. var call$c = functionCall;
  374. var isCallable$e = isCallable$j;
  375. var isObject$a = isObject$b;
  376. var $TypeError$a = TypeError;
  377. // `OrdinaryToPrimitive` abstract operation
  378. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  379. var ordinaryToPrimitive$1 = function (input, pref) {
  380. var fn, val;
  381. if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$a(val = call$c(fn, input))) return val;
  382. if (isCallable$e(fn = input.valueOf) && !isObject$a(val = call$c(fn, input))) return val;
  383. if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$a(val = call$c(fn, input))) return val;
  384. throw $TypeError$a("Can't convert object to primitive value");
  385. };
  386. var shared$4 = {exports: {}};
  387. var global$g = global$j;
  388. // eslint-disable-next-line es/no-object-defineproperty -- safe
  389. var defineProperty$7 = Object.defineProperty;
  390. var defineGlobalProperty$3 = function (key, value) {
  391. try {
  392. defineProperty$7(global$g, key, { value: value, configurable: true, writable: true });
  393. } catch (error) {
  394. global$g[key] = value;
  395. } return value;
  396. };
  397. var global$f = global$j;
  398. var defineGlobalProperty$2 = defineGlobalProperty$3;
  399. var SHARED = '__core-js_shared__';
  400. var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
  401. var sharedStore = store$3;
  402. var store$2 = sharedStore;
  403. (shared$4.exports = function (key, value) {
  404. return store$2[key] || (store$2[key] = value !== undefined ? value : {});
  405. })('versions', []).push({
  406. version: '3.25.5',
  407. mode: 'global',
  408. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  409. license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
  410. source: 'https://github.com/zloirock/core-js'
  411. });
  412. var requireObjectCoercible$9 = requireObjectCoercible$b;
  413. var $Object$2 = Object;
  414. // `ToObject` abstract operation
  415. // https://tc39.es/ecma262/#sec-toobject
  416. var toObject$9 = function (argument) {
  417. return $Object$2(requireObjectCoercible$9(argument));
  418. };
  419. var uncurryThis$u = functionUncurryThis;
  420. var toObject$8 = toObject$9;
  421. var hasOwnProperty = uncurryThis$u({}.hasOwnProperty);
  422. // `HasOwnProperty` abstract operation
  423. // https://tc39.es/ecma262/#sec-hasownproperty
  424. // eslint-disable-next-line es/no-object-hasown -- safe
  425. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  426. return hasOwnProperty(toObject$8(it), key);
  427. };
  428. var uncurryThis$t = functionUncurryThis;
  429. var id = 0;
  430. var postfix = Math.random();
  431. var toString$g = uncurryThis$t(1.0.toString);
  432. var uid$2 = function (key) {
  433. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
  434. };
  435. var global$e = global$j;
  436. var shared$3 = shared$4.exports;
  437. var hasOwn$b = hasOwnProperty_1;
  438. var uid$1 = uid$2;
  439. var NATIVE_SYMBOL = symbolConstructorDetection;
  440. var USE_SYMBOL_AS_UID = useSymbolAsUid;
  441. var WellKnownSymbolsStore = shared$3('wks');
  442. var Symbol$3 = global$e.Symbol;
  443. var symbolFor = Symbol$3 && Symbol$3['for'];
  444. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
  445. var wellKnownSymbol$j = function (name) {
  446. if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
  447. var description = 'Symbol.' + name;
  448. if (NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)) {
  449. WellKnownSymbolsStore[name] = Symbol$3[name];
  450. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  451. WellKnownSymbolsStore[name] = symbolFor(description);
  452. } else {
  453. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  454. }
  455. } return WellKnownSymbolsStore[name];
  456. };
  457. var call$b = functionCall;
  458. var isObject$9 = isObject$b;
  459. var isSymbol$2 = isSymbol$3;
  460. var getMethod$4 = getMethod$5;
  461. var ordinaryToPrimitive = ordinaryToPrimitive$1;
  462. var wellKnownSymbol$i = wellKnownSymbol$j;
  463. var $TypeError$9 = TypeError;
  464. var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
  465. // `ToPrimitive` abstract operation
  466. // https://tc39.es/ecma262/#sec-toprimitive
  467. var toPrimitive$2 = function (input, pref) {
  468. if (!isObject$9(input) || isSymbol$2(input)) return input;
  469. var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
  470. var result;
  471. if (exoticToPrim) {
  472. if (pref === undefined) pref = 'default';
  473. result = call$b(exoticToPrim, input, pref);
  474. if (!isObject$9(result) || isSymbol$2(result)) return result;
  475. throw $TypeError$9("Can't convert object to primitive value");
  476. }
  477. if (pref === undefined) pref = 'number';
  478. return ordinaryToPrimitive(input, pref);
  479. };
  480. var toPrimitive$1 = toPrimitive$2;
  481. var isSymbol$1 = isSymbol$3;
  482. // `ToPropertyKey` abstract operation
  483. // https://tc39.es/ecma262/#sec-topropertykey
  484. var toPropertyKey$3 = function (argument) {
  485. var key = toPrimitive$1(argument, 'string');
  486. return isSymbol$1(key) ? key : key + '';
  487. };
  488. var global$d = global$j;
  489. var isObject$8 = isObject$b;
  490. var document$1 = global$d.document;
  491. // typeof document.createElement is 'object' in old IE
  492. var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
  493. var documentCreateElement$2 = function (it) {
  494. return EXISTS$1 ? document$1.createElement(it) : {};
  495. };
  496. var DESCRIPTORS$e = descriptors;
  497. var fails$p = fails$u;
  498. var createElement = documentCreateElement$2;
  499. // Thanks to IE8 for its funny defineProperty
  500. var ie8DomDefine = !DESCRIPTORS$e && !fails$p(function () {
  501. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  502. return Object.defineProperty(createElement('div'), 'a', {
  503. get: function () { return 7; }
  504. }).a != 7;
  505. });
  506. var DESCRIPTORS$d = descriptors;
  507. var call$a = functionCall;
  508. var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
  509. var createPropertyDescriptor$3 = createPropertyDescriptor$4;
  510. var toIndexedObject$7 = toIndexedObject$8;
  511. var toPropertyKey$2 = toPropertyKey$3;
  512. var hasOwn$a = hasOwnProperty_1;
  513. var IE8_DOM_DEFINE$1 = ie8DomDefine;
  514. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  515. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  516. // `Object.getOwnPropertyDescriptor` method
  517. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  518. objectGetOwnPropertyDescriptor.f = DESCRIPTORS$d ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  519. O = toIndexedObject$7(O);
  520. P = toPropertyKey$2(P);
  521. if (IE8_DOM_DEFINE$1) try {
  522. return $getOwnPropertyDescriptor$1(O, P);
  523. } catch (error) { /* empty */ }
  524. if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
  525. };
  526. var objectDefineProperty = {};
  527. var DESCRIPTORS$c = descriptors;
  528. var fails$o = fails$u;
  529. // V8 ~ Chrome 36-
  530. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  531. var v8PrototypeDefineBug = DESCRIPTORS$c && fails$o(function () {
  532. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  533. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  534. value: 42,
  535. writable: false
  536. }).prototype != 42;
  537. });
  538. var isObject$7 = isObject$b;
  539. var $String$2 = String;
  540. var $TypeError$8 = TypeError;
  541. // `Assert: Type(argument) is Object`
  542. var anObject$d = function (argument) {
  543. if (isObject$7(argument)) return argument;
  544. throw $TypeError$8($String$2(argument) + ' is not an object');
  545. };
  546. var DESCRIPTORS$b = descriptors;
  547. var IE8_DOM_DEFINE = ie8DomDefine;
  548. var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
  549. var anObject$c = anObject$d;
  550. var toPropertyKey$1 = toPropertyKey$3;
  551. var $TypeError$7 = TypeError;
  552. // eslint-disable-next-line es/no-object-defineproperty -- safe
  553. var $defineProperty = Object.defineProperty;
  554. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  555. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  556. var ENUMERABLE = 'enumerable';
  557. var CONFIGURABLE$1 = 'configurable';
  558. var WRITABLE = 'writable';
  559. // `Object.defineProperty` method
  560. // https://tc39.es/ecma262/#sec-object.defineproperty
  561. objectDefineProperty.f = DESCRIPTORS$b ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
  562. anObject$c(O);
  563. P = toPropertyKey$1(P);
  564. anObject$c(Attributes);
  565. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  566. var current = $getOwnPropertyDescriptor(O, P);
  567. if (current && current[WRITABLE]) {
  568. O[P] = Attributes.value;
  569. Attributes = {
  570. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  571. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  572. writable: false
  573. };
  574. }
  575. } return $defineProperty(O, P, Attributes);
  576. } : $defineProperty : function defineProperty(O, P, Attributes) {
  577. anObject$c(O);
  578. P = toPropertyKey$1(P);
  579. anObject$c(Attributes);
  580. if (IE8_DOM_DEFINE) try {
  581. return $defineProperty(O, P, Attributes);
  582. } catch (error) { /* empty */ }
  583. if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
  584. if ('value' in Attributes) O[P] = Attributes.value;
  585. return O;
  586. };
  587. var DESCRIPTORS$a = descriptors;
  588. var definePropertyModule$5 = objectDefineProperty;
  589. var createPropertyDescriptor$2 = createPropertyDescriptor$4;
  590. var createNonEnumerableProperty$7 = DESCRIPTORS$a ? function (object, key, value) {
  591. return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
  592. } : function (object, key, value) {
  593. object[key] = value;
  594. return object;
  595. };
  596. var makeBuiltIn$2 = {exports: {}};
  597. var DESCRIPTORS$9 = descriptors;
  598. var hasOwn$9 = hasOwnProperty_1;
  599. var FunctionPrototype$1 = Function.prototype;
  600. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  601. var getDescriptor = DESCRIPTORS$9 && Object.getOwnPropertyDescriptor;
  602. var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
  603. // additional protection from minified / mangled / dropped function names
  604. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  605. var CONFIGURABLE = EXISTS && (!DESCRIPTORS$9 || (DESCRIPTORS$9 && getDescriptor(FunctionPrototype$1, 'name').configurable));
  606. var functionName = {
  607. EXISTS: EXISTS,
  608. PROPER: PROPER,
  609. CONFIGURABLE: CONFIGURABLE
  610. };
  611. var uncurryThis$s = functionUncurryThis;
  612. var isCallable$d = isCallable$j;
  613. var store$1 = sharedStore;
  614. var functionToString = uncurryThis$s(Function.toString);
  615. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  616. if (!isCallable$d(store$1.inspectSource)) {
  617. store$1.inspectSource = function (it) {
  618. return functionToString(it);
  619. };
  620. }
  621. var inspectSource$2 = store$1.inspectSource;
  622. var global$c = global$j;
  623. var isCallable$c = isCallable$j;
  624. var WeakMap$1 = global$c.WeakMap;
  625. var weakMapBasicDetection = isCallable$c(WeakMap$1) && /native code/.test(String(WeakMap$1));
  626. var shared$2 = shared$4.exports;
  627. var uid = uid$2;
  628. var keys$2 = shared$2('keys');
  629. var sharedKey$3 = function (key) {
  630. return keys$2[key] || (keys$2[key] = uid(key));
  631. };
  632. var hiddenKeys$4 = {};
  633. var NATIVE_WEAK_MAP = weakMapBasicDetection;
  634. var global$b = global$j;
  635. var isObject$6 = isObject$b;
  636. var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
  637. var hasOwn$8 = hasOwnProperty_1;
  638. var shared$1 = sharedStore;
  639. var sharedKey$2 = sharedKey$3;
  640. var hiddenKeys$3 = hiddenKeys$4;
  641. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  642. var TypeError$2 = global$b.TypeError;
  643. var WeakMap = global$b.WeakMap;
  644. var set, get, has;
  645. var enforce = function (it) {
  646. return has(it) ? get(it) : set(it, {});
  647. };
  648. var getterFor = function (TYPE) {
  649. return function (it) {
  650. var state;
  651. if (!isObject$6(it) || (state = get(it)).type !== TYPE) {
  652. throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  653. } return state;
  654. };
  655. };
  656. if (NATIVE_WEAK_MAP || shared$1.state) {
  657. var store = shared$1.state || (shared$1.state = new WeakMap());
  658. /* eslint-disable no-self-assign -- prototype methods protection */
  659. store.get = store.get;
  660. store.has = store.has;
  661. store.set = store.set;
  662. /* eslint-enable no-self-assign -- prototype methods protection */
  663. set = function (it, metadata) {
  664. if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
  665. metadata.facade = it;
  666. store.set(it, metadata);
  667. return metadata;
  668. };
  669. get = function (it) {
  670. return store.get(it) || {};
  671. };
  672. has = function (it) {
  673. return store.has(it);
  674. };
  675. } else {
  676. var STATE = sharedKey$2('state');
  677. hiddenKeys$3[STATE] = true;
  678. set = function (it, metadata) {
  679. if (hasOwn$8(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
  680. metadata.facade = it;
  681. createNonEnumerableProperty$6(it, STATE, metadata);
  682. return metadata;
  683. };
  684. get = function (it) {
  685. return hasOwn$8(it, STATE) ? it[STATE] : {};
  686. };
  687. has = function (it) {
  688. return hasOwn$8(it, STATE);
  689. };
  690. }
  691. var internalState = {
  692. set: set,
  693. get: get,
  694. has: has,
  695. enforce: enforce,
  696. getterFor: getterFor
  697. };
  698. var fails$n = fails$u;
  699. var isCallable$b = isCallable$j;
  700. var hasOwn$7 = hasOwnProperty_1;
  701. var DESCRIPTORS$8 = descriptors;
  702. var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
  703. var inspectSource$1 = inspectSource$2;
  704. var InternalStateModule$1 = internalState;
  705. var enforceInternalState$1 = InternalStateModule$1.enforce;
  706. var getInternalState$2 = InternalStateModule$1.get;
  707. // eslint-disable-next-line es/no-object-defineproperty -- safe
  708. var defineProperty$6 = Object.defineProperty;
  709. var CONFIGURABLE_LENGTH = DESCRIPTORS$8 && !fails$n(function () {
  710. return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  711. });
  712. var TEMPLATE = String(String).split('String');
  713. var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
  714. if (String(name).slice(0, 7) === 'Symbol(') {
  715. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  716. }
  717. if (options && options.getter) name = 'get ' + name;
  718. if (options && options.setter) name = 'set ' + name;
  719. if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
  720. if (DESCRIPTORS$8) defineProperty$6(value, 'name', { value: name, configurable: true });
  721. else value.name = name;
  722. }
  723. if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
  724. defineProperty$6(value, 'length', { value: options.arity });
  725. }
  726. try {
  727. if (options && hasOwn$7(options, 'constructor') && options.constructor) {
  728. if (DESCRIPTORS$8) defineProperty$6(value, 'prototype', { writable: false });
  729. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  730. } else if (value.prototype) value.prototype = undefined;
  731. } catch (error) { /* empty */ }
  732. var state = enforceInternalState$1(value);
  733. if (!hasOwn$7(state, 'source')) {
  734. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  735. } return value;
  736. };
  737. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  738. // eslint-disable-next-line no-extend-native -- required
  739. Function.prototype.toString = makeBuiltIn$1(function toString() {
  740. return isCallable$b(this) && getInternalState$2(this).source || inspectSource$1(this);
  741. }, 'toString');
  742. var isCallable$a = isCallable$j;
  743. var definePropertyModule$4 = objectDefineProperty;
  744. var makeBuiltIn = makeBuiltIn$2.exports;
  745. var defineGlobalProperty$1 = defineGlobalProperty$3;
  746. var defineBuiltIn$8 = function (O, key, value, options) {
  747. if (!options) options = {};
  748. var simple = options.enumerable;
  749. var name = options.name !== undefined ? options.name : key;
  750. if (isCallable$a(value)) makeBuiltIn(value, name, options);
  751. if (options.global) {
  752. if (simple) O[key] = value;
  753. else defineGlobalProperty$1(key, value);
  754. } else {
  755. try {
  756. if (!options.unsafe) delete O[key];
  757. else if (O[key]) simple = true;
  758. } catch (error) { /* empty */ }
  759. if (simple) O[key] = value;
  760. else definePropertyModule$4.f(O, key, {
  761. value: value,
  762. enumerable: false,
  763. configurable: !options.nonConfigurable,
  764. writable: !options.nonWritable
  765. });
  766. } return O;
  767. };
  768. var objectGetOwnPropertyNames = {};
  769. var ceil = Math.ceil;
  770. var floor$2 = Math.floor;
  771. // `Math.trunc` method
  772. // https://tc39.es/ecma262/#sec-math.trunc
  773. // eslint-disable-next-line es/no-math-trunc -- safe
  774. var mathTrunc = Math.trunc || function trunc(x) {
  775. var n = +x;
  776. return (n > 0 ? floor$2 : ceil)(n);
  777. };
  778. var trunc = mathTrunc;
  779. // `ToIntegerOrInfinity` abstract operation
  780. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  781. var toIntegerOrInfinity$5 = function (argument) {
  782. var number = +argument;
  783. // eslint-disable-next-line no-self-compare -- NaN check
  784. return number !== number || number === 0 ? 0 : trunc(number);
  785. };
  786. var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
  787. var max$4 = Math.max;
  788. var min$6 = Math.min;
  789. // Helper for a popular repeating case of the spec:
  790. // Let integer be ? ToInteger(index).
  791. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  792. var toAbsoluteIndex$4 = function (index, length) {
  793. var integer = toIntegerOrInfinity$4(index);
  794. return integer < 0 ? max$4(integer + length, 0) : min$6(integer, length);
  795. };
  796. var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
  797. var min$5 = Math.min;
  798. // `ToLength` abstract operation
  799. // https://tc39.es/ecma262/#sec-tolength
  800. var toLength$6 = function (argument) {
  801. return argument > 0 ? min$5(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  802. };
  803. var toLength$5 = toLength$6;
  804. // `LengthOfArrayLike` abstract operation
  805. // https://tc39.es/ecma262/#sec-lengthofarraylike
  806. var lengthOfArrayLike$7 = function (obj) {
  807. return toLength$5(obj.length);
  808. };
  809. var toIndexedObject$6 = toIndexedObject$8;
  810. var toAbsoluteIndex$3 = toAbsoluteIndex$4;
  811. var lengthOfArrayLike$6 = lengthOfArrayLike$7;
  812. // `Array.prototype.{ indexOf, includes }` methods implementation
  813. var createMethod$4 = function (IS_INCLUDES) {
  814. return function ($this, el, fromIndex) {
  815. var O = toIndexedObject$6($this);
  816. var length = lengthOfArrayLike$6(O);
  817. var index = toAbsoluteIndex$3(fromIndex, length);
  818. var value;
  819. // Array#includes uses SameValueZero equality algorithm
  820. // eslint-disable-next-line no-self-compare -- NaN check
  821. if (IS_INCLUDES && el != el) while (length > index) {
  822. value = O[index++];
  823. // eslint-disable-next-line no-self-compare -- NaN check
  824. if (value != value) return true;
  825. // Array#indexOf ignores holes, Array#includes - not
  826. } else for (;length > index; index++) {
  827. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  828. } return !IS_INCLUDES && -1;
  829. };
  830. };
  831. var arrayIncludes = {
  832. // `Array.prototype.includes` method
  833. // https://tc39.es/ecma262/#sec-array.prototype.includes
  834. includes: createMethod$4(true),
  835. // `Array.prototype.indexOf` method
  836. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  837. indexOf: createMethod$4(false)
  838. };
  839. var uncurryThis$r = functionUncurryThis;
  840. var hasOwn$6 = hasOwnProperty_1;
  841. var toIndexedObject$5 = toIndexedObject$8;
  842. var indexOf$1 = arrayIncludes.indexOf;
  843. var hiddenKeys$2 = hiddenKeys$4;
  844. var push$5 = uncurryThis$r([].push);
  845. var objectKeysInternal = function (object, names) {
  846. var O = toIndexedObject$5(object);
  847. var i = 0;
  848. var result = [];
  849. var key;
  850. for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
  851. // Don't enum bug & hidden keys
  852. while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
  853. ~indexOf$1(result, key) || push$5(result, key);
  854. }
  855. return result;
  856. };
  857. // IE8- don't enum bug keys
  858. var enumBugKeys$3 = [
  859. 'constructor',
  860. 'hasOwnProperty',
  861. 'isPrototypeOf',
  862. 'propertyIsEnumerable',
  863. 'toLocaleString',
  864. 'toString',
  865. 'valueOf'
  866. ];
  867. var internalObjectKeys$1 = objectKeysInternal;
  868. var enumBugKeys$2 = enumBugKeys$3;
  869. var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
  870. // `Object.getOwnPropertyNames` method
  871. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  872. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  873. objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  874. return internalObjectKeys$1(O, hiddenKeys$1);
  875. };
  876. var objectGetOwnPropertySymbols = {};
  877. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  878. objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
  879. var getBuiltIn$3 = getBuiltIn$6;
  880. var uncurryThis$q = functionUncurryThis;
  881. var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
  882. var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
  883. var anObject$b = anObject$d;
  884. var concat$2 = uncurryThis$q([].concat);
  885. // all object keys, includes non-enumerable and symbols
  886. var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
  887. var keys = getOwnPropertyNamesModule.f(anObject$b(it));
  888. var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
  889. return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
  890. };
  891. var hasOwn$5 = hasOwnProperty_1;
  892. var ownKeys = ownKeys$1;
  893. var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
  894. var definePropertyModule$3 = objectDefineProperty;
  895. var copyConstructorProperties$1 = function (target, source, exceptions) {
  896. var keys = ownKeys(source);
  897. var defineProperty = definePropertyModule$3.f;
  898. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  899. for (var i = 0; i < keys.length; i++) {
  900. var key = keys[i];
  901. if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
  902. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  903. }
  904. }
  905. };
  906. var fails$m = fails$u;
  907. var isCallable$9 = isCallable$j;
  908. var replacement = /#|\.prototype\./;
  909. var isForced$3 = function (feature, detection) {
  910. var value = data[normalize(feature)];
  911. return value == POLYFILL ? true
  912. : value == NATIVE ? false
  913. : isCallable$9(detection) ? fails$m(detection)
  914. : !!detection;
  915. };
  916. var normalize = isForced$3.normalize = function (string) {
  917. return String(string).replace(replacement, '.').toLowerCase();
  918. };
  919. var data = isForced$3.data = {};
  920. var NATIVE = isForced$3.NATIVE = 'N';
  921. var POLYFILL = isForced$3.POLYFILL = 'P';
  922. var isForced_1 = isForced$3;
  923. var global$a = global$j;
  924. var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
  925. var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
  926. var defineBuiltIn$7 = defineBuiltIn$8;
  927. var defineGlobalProperty = defineGlobalProperty$3;
  928. var copyConstructorProperties = copyConstructorProperties$1;
  929. var isForced$2 = isForced_1;
  930. /*
  931. options.target - name of the target object
  932. options.global - target is the global object
  933. options.stat - export as static methods of target
  934. options.proto - export as prototype methods of target
  935. options.real - real prototype method for the `pure` version
  936. options.forced - export even if the native feature is available
  937. options.bind - bind methods to the target, required for the `pure` version
  938. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  939. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  940. options.sham - add a flag to not completely full polyfills
  941. options.enumerable - export as enumerable property
  942. options.dontCallGetSet - prevent calling a getter on target
  943. options.name - the .name of the function if it does not match the key
  944. */
  945. var _export = function (options, source) {
  946. var TARGET = options.target;
  947. var GLOBAL = options.global;
  948. var STATIC = options.stat;
  949. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  950. if (GLOBAL) {
  951. target = global$a;
  952. } else if (STATIC) {
  953. target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
  954. } else {
  955. target = (global$a[TARGET] || {}).prototype;
  956. }
  957. if (target) for (key in source) {
  958. sourceProperty = source[key];
  959. if (options.dontCallGetSet) {
  960. descriptor = getOwnPropertyDescriptor$4(target, key);
  961. targetProperty = descriptor && descriptor.value;
  962. } else targetProperty = target[key];
  963. FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  964. // contained in target
  965. if (!FORCED && targetProperty !== undefined) {
  966. if (typeof sourceProperty == typeof targetProperty) continue;
  967. copyConstructorProperties(sourceProperty, targetProperty);
  968. }
  969. // add a flag to not completely full polyfills
  970. if (options.sham || (targetProperty && targetProperty.sham)) {
  971. createNonEnumerableProperty$5(sourceProperty, 'sham', true);
  972. }
  973. defineBuiltIn$7(target, key, sourceProperty, options);
  974. }
  975. };
  976. var internalObjectKeys = objectKeysInternal;
  977. var enumBugKeys$1 = enumBugKeys$3;
  978. // `Object.keys` method
  979. // https://tc39.es/ecma262/#sec-object.keys
  980. // eslint-disable-next-line es/no-object-keys -- safe
  981. var objectKeys$3 = Object.keys || function keys(O) {
  982. return internalObjectKeys(O, enumBugKeys$1);
  983. };
  984. var DESCRIPTORS$7 = descriptors;
  985. var uncurryThis$p = functionUncurryThis;
  986. var call$9 = functionCall;
  987. var fails$l = fails$u;
  988. var objectKeys$2 = objectKeys$3;
  989. var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
  990. var propertyIsEnumerableModule = objectPropertyIsEnumerable;
  991. var toObject$7 = toObject$9;
  992. var IndexedObject$2 = indexedObject;
  993. // eslint-disable-next-line es/no-object-assign -- safe
  994. var $assign = Object.assign;
  995. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  996. var defineProperty$5 = Object.defineProperty;
  997. var concat$1 = uncurryThis$p([].concat);
  998. // `Object.assign` method
  999. // https://tc39.es/ecma262/#sec-object.assign
  1000. var objectAssign = !$assign || fails$l(function () {
  1001. // should have correct order of operations (Edge bug)
  1002. if (DESCRIPTORS$7 && $assign({ b: 1 }, $assign(defineProperty$5({}, 'a', {
  1003. enumerable: true,
  1004. get: function () {
  1005. defineProperty$5(this, 'b', {
  1006. value: 3,
  1007. enumerable: false
  1008. });
  1009. }
  1010. }), { b: 2 })).b !== 1) return true;
  1011. // should work with symbols and should have deterministic property order (V8 bug)
  1012. var A = {};
  1013. var B = {};
  1014. // eslint-disable-next-line es/no-symbol -- safe
  1015. var symbol = Symbol();
  1016. var alphabet = 'abcdefghijklmnopqrst';
  1017. A[symbol] = 7;
  1018. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1019. return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet;
  1020. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1021. var T = toObject$7(target);
  1022. var argumentsLength = arguments.length;
  1023. var index = 1;
  1024. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1025. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  1026. while (argumentsLength > index) {
  1027. var S = IndexedObject$2(arguments[index++]);
  1028. var keys = getOwnPropertySymbols ? concat$1(objectKeys$2(S), getOwnPropertySymbols(S)) : objectKeys$2(S);
  1029. var length = keys.length;
  1030. var j = 0;
  1031. var key;
  1032. while (length > j) {
  1033. key = keys[j++];
  1034. if (!DESCRIPTORS$7 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
  1035. }
  1036. } return T;
  1037. } : $assign;
  1038. var $$m = _export;
  1039. var assign = objectAssign;
  1040. // `Object.assign` method
  1041. // https://tc39.es/ecma262/#sec-object.assign
  1042. // eslint-disable-next-line es/no-object-assign -- required for testing
  1043. $$m({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
  1044. assign: assign
  1045. });
  1046. var wellKnownSymbol$h = wellKnownSymbol$j;
  1047. var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
  1048. var test$2 = {};
  1049. test$2[TO_STRING_TAG$3] = 'z';
  1050. var toStringTagSupport = String(test$2) === '[object z]';
  1051. var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
  1052. var isCallable$8 = isCallable$j;
  1053. var classofRaw = classofRaw$2;
  1054. var wellKnownSymbol$g = wellKnownSymbol$j;
  1055. var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
  1056. var $Object$1 = Object;
  1057. // ES3 wrong here
  1058. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1059. // fallback for IE11 Script Access Denied error
  1060. var tryGet = function (it, key) {
  1061. try {
  1062. return it[key];
  1063. } catch (error) { /* empty */ }
  1064. };
  1065. // getting tag from ES6+ `Object.prototype.toString`
  1066. var classof$6 = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
  1067. var O, tag, result;
  1068. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1069. // @@toStringTag case
  1070. : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
  1071. // builtinTag case
  1072. : CORRECT_ARGUMENTS ? classofRaw(O)
  1073. // ES3 arguments fallback
  1074. : (result = classofRaw(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
  1075. };
  1076. var classof$5 = classof$6;
  1077. var $String$1 = String;
  1078. var toString$f = function (argument) {
  1079. if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1080. return $String$1(argument);
  1081. };
  1082. // a string of all valid unicode whitespaces
  1083. var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1084. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1085. var uncurryThis$o = functionUncurryThis;
  1086. var requireObjectCoercible$8 = requireObjectCoercible$b;
  1087. var toString$e = toString$f;
  1088. var whitespaces$3 = whitespaces$4;
  1089. var replace$3 = uncurryThis$o(''.replace);
  1090. var whitespace = '[' + whitespaces$3 + ']';
  1091. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1092. var rtrim = RegExp(whitespace + whitespace + '*$');
  1093. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1094. var createMethod$3 = function (TYPE) {
  1095. return function ($this) {
  1096. var string = toString$e(requireObjectCoercible$8($this));
  1097. if (TYPE & 1) string = replace$3(string, ltrim, '');
  1098. if (TYPE & 2) string = replace$3(string, rtrim, '');
  1099. return string;
  1100. };
  1101. };
  1102. var stringTrim = {
  1103. // `String.prototype.{ trimLeft, trimStart }` methods
  1104. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1105. start: createMethod$3(1),
  1106. // `String.prototype.{ trimRight, trimEnd }` methods
  1107. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1108. end: createMethod$3(2),
  1109. // `String.prototype.trim` method
  1110. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1111. trim: createMethod$3(3)
  1112. };
  1113. var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
  1114. var fails$k = fails$u;
  1115. var whitespaces$2 = whitespaces$4;
  1116. var non = '\u200B\u0085\u180E';
  1117. // check that a method works with the correct list
  1118. // of whitespaces and has a correct name
  1119. var stringTrimForced = function (METHOD_NAME) {
  1120. return fails$k(function () {
  1121. return !!whitespaces$2[METHOD_NAME]()
  1122. || non[METHOD_NAME]() !== non
  1123. || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME);
  1124. });
  1125. };
  1126. var $$l = _export;
  1127. var $trim = stringTrim.trim;
  1128. var forcedStringTrimMethod = stringTrimForced;
  1129. // `String.prototype.trim` method
  1130. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1131. $$l({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  1132. trim: function trim() {
  1133. return $trim(this);
  1134. }
  1135. });
  1136. var fails$j = fails$u;
  1137. var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
  1138. var method = [][METHOD_NAME];
  1139. return !!method && fails$j(function () {
  1140. // eslint-disable-next-line no-useless-call -- required for testing
  1141. method.call(null, argument || function () { return 1; }, 1);
  1142. });
  1143. };
  1144. var $$k = _export;
  1145. var uncurryThis$n = functionUncurryThis;
  1146. var IndexedObject$1 = indexedObject;
  1147. var toIndexedObject$4 = toIndexedObject$8;
  1148. var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
  1149. var nativeJoin = uncurryThis$n([].join);
  1150. var ES3_STRINGS = IndexedObject$1 != Object;
  1151. var STRICT_METHOD$3 = arrayMethodIsStrict$3('join', ',');
  1152. // `Array.prototype.join` method
  1153. // https://tc39.es/ecma262/#sec-array.prototype.join
  1154. $$k({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, {
  1155. join: function join(separator) {
  1156. return nativeJoin(toIndexedObject$4(this), separator === undefined ? ',' : separator);
  1157. }
  1158. });
  1159. var anObject$a = anObject$d;
  1160. // `RegExp.prototype.flags` getter implementation
  1161. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1162. var regexpFlags$1 = function () {
  1163. var that = anObject$a(this);
  1164. var result = '';
  1165. if (that.hasIndices) result += 'd';
  1166. if (that.global) result += 'g';
  1167. if (that.ignoreCase) result += 'i';
  1168. if (that.multiline) result += 'm';
  1169. if (that.dotAll) result += 's';
  1170. if (that.unicode) result += 'u';
  1171. if (that.unicodeSets) result += 'v';
  1172. if (that.sticky) result += 'y';
  1173. return result;
  1174. };
  1175. var fails$i = fails$u;
  1176. var global$9 = global$j;
  1177. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1178. var $RegExp$2 = global$9.RegExp;
  1179. var UNSUPPORTED_Y$3 = fails$i(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$1 = UNSUPPORTED_Y$3 || fails$i(function () {
  1187. return !$RegExp$2('a', 'y').sticky;
  1188. });
  1189. var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(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$1,
  1198. UNSUPPORTED_Y: UNSUPPORTED_Y$3
  1199. };
  1200. var objectDefineProperties = {};
  1201. var DESCRIPTORS$6 = descriptors;
  1202. var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
  1203. var definePropertyModule$2 = objectDefineProperty;
  1204. var anObject$9 = anObject$d;
  1205. var toIndexedObject$3 = toIndexedObject$8;
  1206. var objectKeys$1 = objectKeys$3;
  1207. // `Object.defineProperties` method
  1208. // https://tc39.es/ecma262/#sec-object.defineproperties
  1209. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1210. objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  1211. anObject$9(O);
  1212. var props = toIndexedObject$3(Properties);
  1213. var keys = objectKeys$1(Properties);
  1214. var length = keys.length;
  1215. var index = 0;
  1216. var key;
  1217. while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
  1218. return O;
  1219. };
  1220. var getBuiltIn$2 = getBuiltIn$6;
  1221. var html$1 = getBuiltIn$2('document', 'documentElement');
  1222. /* global ActiveXObject -- old IE, WSH */
  1223. var anObject$8 = anObject$d;
  1224. var definePropertiesModule = objectDefineProperties;
  1225. var enumBugKeys = enumBugKeys$3;
  1226. var hiddenKeys = hiddenKeys$4;
  1227. var html = html$1;
  1228. var documentCreateElement$1 = documentCreateElement$2;
  1229. var sharedKey$1 = sharedKey$3;
  1230. var GT = '>';
  1231. var LT = '<';
  1232. var PROTOTYPE = 'prototype';
  1233. var SCRIPT = 'script';
  1234. var IE_PROTO$1 = sharedKey$1('IE_PROTO');
  1235. var EmptyConstructor = function () { /* empty */ };
  1236. var scriptTag = function (content) {
  1237. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1238. };
  1239. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1240. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1241. activeXDocument.write(scriptTag(''));
  1242. activeXDocument.close();
  1243. var temp = activeXDocument.parentWindow.Object;
  1244. activeXDocument = null; // avoid memory leak
  1245. return temp;
  1246. };
  1247. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1248. var NullProtoObjectViaIFrame = function () {
  1249. // Thrash, waste and sodomy: IE GC bug
  1250. var iframe = documentCreateElement$1('iframe');
  1251. var JS = 'java' + SCRIPT + ':';
  1252. var iframeDocument;
  1253. iframe.style.display = 'none';
  1254. html.appendChild(iframe);
  1255. // https://github.com/zloirock/core-js/issues/475
  1256. iframe.src = String(JS);
  1257. iframeDocument = iframe.contentWindow.document;
  1258. iframeDocument.open();
  1259. iframeDocument.write(scriptTag('document.F=Object'));
  1260. iframeDocument.close();
  1261. return iframeDocument.F;
  1262. };
  1263. // Check for document.domain and active x support
  1264. // No need to use active x approach when document.domain is not set
  1265. // see https://github.com/es-shims/es5-shim/issues/150
  1266. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1267. // avoid IE GC bug
  1268. var activeXDocument;
  1269. var NullProtoObject = function () {
  1270. try {
  1271. activeXDocument = new ActiveXObject('htmlfile');
  1272. } catch (error) { /* ignore */ }
  1273. NullProtoObject = typeof document != 'undefined'
  1274. ? document.domain && activeXDocument
  1275. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1276. : NullProtoObjectViaIFrame()
  1277. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1278. var length = enumBugKeys.length;
  1279. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1280. return NullProtoObject();
  1281. };
  1282. hiddenKeys[IE_PROTO$1] = true;
  1283. // `Object.create` method
  1284. // https://tc39.es/ecma262/#sec-object.create
  1285. // eslint-disable-next-line es/no-object-create -- safe
  1286. var objectCreate = Object.create || function create(O, Properties) {
  1287. var result;
  1288. if (O !== null) {
  1289. EmptyConstructor[PROTOTYPE] = anObject$8(O);
  1290. result = new EmptyConstructor();
  1291. EmptyConstructor[PROTOTYPE] = null;
  1292. // add "__proto__" for Object.getPrototypeOf polyfill
  1293. result[IE_PROTO$1] = O;
  1294. } else result = NullProtoObject();
  1295. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1296. };
  1297. var fails$h = fails$u;
  1298. var global$8 = global$j;
  1299. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1300. var $RegExp$1 = global$8.RegExp;
  1301. var regexpUnsupportedDotAll = fails$h(function () {
  1302. var re = $RegExp$1('.', 's');
  1303. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1304. });
  1305. var fails$g = fails$u;
  1306. var global$7 = global$j;
  1307. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1308. var $RegExp = global$7.RegExp;
  1309. var regexpUnsupportedNcg = fails$g(function () {
  1310. var re = $RegExp('(?<a>b)', 'g');
  1311. return re.exec('b').groups.a !== 'b' ||
  1312. 'b'.replace(re, '$<a>c') !== 'bc';
  1313. });
  1314. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1315. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1316. var call$8 = functionCall;
  1317. var uncurryThis$m = functionUncurryThis;
  1318. var toString$d = toString$f;
  1319. var regexpFlags = regexpFlags$1;
  1320. var stickyHelpers$2 = regexpStickyHelpers;
  1321. var shared = shared$4.exports;
  1322. var create$2 = objectCreate;
  1323. var getInternalState$1 = internalState.get;
  1324. var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
  1325. var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
  1326. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1327. var nativeExec = RegExp.prototype.exec;
  1328. var patchedExec = nativeExec;
  1329. var charAt$5 = uncurryThis$m(''.charAt);
  1330. var indexOf = uncurryThis$m(''.indexOf);
  1331. var replace$2 = uncurryThis$m(''.replace);
  1332. var stringSlice$6 = uncurryThis$m(''.slice);
  1333. var UPDATES_LAST_INDEX_WRONG = (function () {
  1334. var re1 = /a/;
  1335. var re2 = /b*/g;
  1336. call$8(nativeExec, re1, 'a');
  1337. call$8(nativeExec, re2, 'a');
  1338. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1339. })();
  1340. var UNSUPPORTED_Y$2 = stickyHelpers$2.BROKEN_CARET;
  1341. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1342. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1343. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1;
  1344. if (PATCH) {
  1345. patchedExec = function exec(string) {
  1346. var re = this;
  1347. var state = getInternalState$1(re);
  1348. var str = toString$d(string);
  1349. var raw = state.raw;
  1350. var result, reCopy, lastIndex, match, i, object, group;
  1351. if (raw) {
  1352. raw.lastIndex = re.lastIndex;
  1353. result = call$8(patchedExec, raw, str);
  1354. re.lastIndex = raw.lastIndex;
  1355. return result;
  1356. }
  1357. var groups = state.groups;
  1358. var sticky = UNSUPPORTED_Y$2 && re.sticky;
  1359. var flags = call$8(regexpFlags, re);
  1360. var source = re.source;
  1361. var charsAdded = 0;
  1362. var strCopy = str;
  1363. if (sticky) {
  1364. flags = replace$2(flags, 'y', '');
  1365. if (indexOf(flags, 'g') === -1) {
  1366. flags += 'g';
  1367. }
  1368. strCopy = stringSlice$6(str, re.lastIndex);
  1369. // Support anchored sticky behavior.
  1370. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
  1371. source = '(?: ' + source + ')';
  1372. strCopy = ' ' + strCopy;
  1373. charsAdded++;
  1374. }
  1375. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1376. // simulate the 'y' flag.
  1377. reCopy = new RegExp('^(?:' + source + ')', flags);
  1378. }
  1379. if (NPCG_INCLUDED) {
  1380. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1381. }
  1382. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1383. match = call$8(nativeExec, sticky ? reCopy : re, strCopy);
  1384. if (sticky) {
  1385. if (match) {
  1386. match.input = stringSlice$6(match.input, charsAdded);
  1387. match[0] = stringSlice$6(match[0], charsAdded);
  1388. match.index = re.lastIndex;
  1389. re.lastIndex += match[0].length;
  1390. } else re.lastIndex = 0;
  1391. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1392. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1393. }
  1394. if (NPCG_INCLUDED && match && match.length > 1) {
  1395. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1396. // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
  1397. call$8(nativeReplace, match[0], reCopy, function () {
  1398. for (i = 1; i < arguments.length - 2; i++) {
  1399. if (arguments[i] === undefined) match[i] = undefined;
  1400. }
  1401. });
  1402. }
  1403. if (match && groups) {
  1404. match.groups = object = create$2(null);
  1405. for (i = 0; i < groups.length; i++) {
  1406. group = groups[i];
  1407. object[group[0]] = match[group[1]];
  1408. }
  1409. }
  1410. return match;
  1411. };
  1412. }
  1413. var regexpExec$3 = patchedExec;
  1414. var $$j = _export;
  1415. var exec$4 = regexpExec$3;
  1416. // `RegExp.prototype.exec` method
  1417. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1418. $$j({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, {
  1419. exec: exec$4
  1420. });
  1421. var NATIVE_BIND$1 = functionBindNative;
  1422. var FunctionPrototype = Function.prototype;
  1423. var apply$2 = FunctionPrototype.apply;
  1424. var call$7 = FunctionPrototype.call;
  1425. // eslint-disable-next-line es/no-reflect -- safe
  1426. var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$2) : function () {
  1427. return call$7.apply(apply$2, arguments);
  1428. });
  1429. // TODO: Remove from `core-js@4` since it's moved to entry points
  1430. var uncurryThis$l = functionUncurryThis;
  1431. var defineBuiltIn$6 = defineBuiltIn$8;
  1432. var regexpExec$2 = regexpExec$3;
  1433. var fails$f = fails$u;
  1434. var wellKnownSymbol$f = wellKnownSymbol$j;
  1435. var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
  1436. var SPECIES$5 = wellKnownSymbol$f('species');
  1437. var RegExpPrototype$3 = RegExp.prototype;
  1438. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1439. var SYMBOL = wellKnownSymbol$f(KEY);
  1440. var DELEGATES_TO_SYMBOL = !fails$f(function () {
  1441. // String methods call symbol-named RegEp methods
  1442. var O = {};
  1443. O[SYMBOL] = function () { return 7; };
  1444. return ''[KEY](O) != 7;
  1445. });
  1446. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () {
  1447. // Symbol-named RegExp methods call .exec
  1448. var execCalled = false;
  1449. var re = /a/;
  1450. if (KEY === 'split') {
  1451. // We can't use real regex here since it causes deoptimization
  1452. // and serious performance degradation in V8
  1453. // https://github.com/zloirock/core-js/issues/306
  1454. re = {};
  1455. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1456. // a new one. We need to return the patched regex when creating the new one.
  1457. re.constructor = {};
  1458. re.constructor[SPECIES$5] = function () { return re; };
  1459. re.flags = '';
  1460. re[SYMBOL] = /./[SYMBOL];
  1461. }
  1462. re.exec = function () { execCalled = true; return null; };
  1463. re[SYMBOL]('');
  1464. return !execCalled;
  1465. });
  1466. if (
  1467. !DELEGATES_TO_SYMBOL ||
  1468. !DELEGATES_TO_EXEC ||
  1469. FORCED
  1470. ) {
  1471. var uncurriedNativeRegExpMethod = uncurryThis$l(/./[SYMBOL]);
  1472. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1473. var uncurriedNativeMethod = uncurryThis$l(nativeMethod);
  1474. var $exec = regexp.exec;
  1475. if ($exec === regexpExec$2 || $exec === RegExpPrototype$3.exec) {
  1476. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1477. // The native String method already delegates to @@method (this
  1478. // polyfilled function), leasing to infinite recursion.
  1479. // We avoid it by directly calling the native @@method method.
  1480. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1481. }
  1482. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1483. }
  1484. return { done: false };
  1485. });
  1486. defineBuiltIn$6(String.prototype, KEY, methods[0]);
  1487. defineBuiltIn$6(RegExpPrototype$3, SYMBOL, methods[1]);
  1488. }
  1489. if (SHAM) createNonEnumerableProperty$4(RegExpPrototype$3[SYMBOL], 'sham', true);
  1490. };
  1491. var isObject$5 = isObject$b;
  1492. var classof$4 = classofRaw$2;
  1493. var wellKnownSymbol$e = wellKnownSymbol$j;
  1494. var MATCH$2 = wellKnownSymbol$e('match');
  1495. // `IsRegExp` abstract operation
  1496. // https://tc39.es/ecma262/#sec-isregexp
  1497. var isRegexp = function (it) {
  1498. var isRegExp;
  1499. return isObject$5(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
  1500. };
  1501. var uncurryThis$k = functionUncurryThis;
  1502. var fails$e = fails$u;
  1503. var isCallable$7 = isCallable$j;
  1504. var classof$3 = classof$6;
  1505. var getBuiltIn$1 = getBuiltIn$6;
  1506. var inspectSource = inspectSource$2;
  1507. var noop = function () { /* empty */ };
  1508. var empty = [];
  1509. var construct = getBuiltIn$1('Reflect', 'construct');
  1510. var constructorRegExp = /^\s*(?:class|function)\b/;
  1511. var exec$3 = uncurryThis$k(constructorRegExp.exec);
  1512. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1513. var isConstructorModern = function isConstructor(argument) {
  1514. if (!isCallable$7(argument)) return false;
  1515. try {
  1516. construct(noop, empty, argument);
  1517. return true;
  1518. } catch (error) {
  1519. return false;
  1520. }
  1521. };
  1522. var isConstructorLegacy = function isConstructor(argument) {
  1523. if (!isCallable$7(argument)) return false;
  1524. switch (classof$3(argument)) {
  1525. case 'AsyncFunction':
  1526. case 'GeneratorFunction':
  1527. case 'AsyncGeneratorFunction': return false;
  1528. }
  1529. try {
  1530. // we can't check .prototype since constructors produced by .bind haven't it
  1531. // `Function#toString` throws on some built-it function in some legacy engines
  1532. // (for example, `DOMQuad` and similar in FF41-)
  1533. return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
  1534. } catch (error) {
  1535. return true;
  1536. }
  1537. };
  1538. isConstructorLegacy.sham = true;
  1539. // `IsConstructor` abstract operation
  1540. // https://tc39.es/ecma262/#sec-isconstructor
  1541. var isConstructor$3 = !construct || fails$e(function () {
  1542. var called;
  1543. return isConstructorModern(isConstructorModern.call)
  1544. || !isConstructorModern(Object)
  1545. || !isConstructorModern(function () { called = true; })
  1546. || called;
  1547. }) ? isConstructorLegacy : isConstructorModern;
  1548. var isConstructor$2 = isConstructor$3;
  1549. var tryToString$1 = tryToString$3;
  1550. var $TypeError$6 = TypeError;
  1551. // `Assert: IsConstructor(argument) is true`
  1552. var aConstructor$1 = function (argument) {
  1553. if (isConstructor$2(argument)) return argument;
  1554. throw $TypeError$6(tryToString$1(argument) + ' is not a constructor');
  1555. };
  1556. var anObject$7 = anObject$d;
  1557. var aConstructor = aConstructor$1;
  1558. var isNullOrUndefined$4 = isNullOrUndefined$7;
  1559. var wellKnownSymbol$d = wellKnownSymbol$j;
  1560. var SPECIES$4 = wellKnownSymbol$d('species');
  1561. // `SpeciesConstructor` abstract operation
  1562. // https://tc39.es/ecma262/#sec-speciesconstructor
  1563. var speciesConstructor$1 = function (O, defaultConstructor) {
  1564. var C = anObject$7(O).constructor;
  1565. var S;
  1566. return C === undefined || isNullOrUndefined$4(S = anObject$7(C)[SPECIES$4]) ? defaultConstructor : aConstructor(S);
  1567. };
  1568. var uncurryThis$j = functionUncurryThis;
  1569. var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
  1570. var toString$c = toString$f;
  1571. var requireObjectCoercible$7 = requireObjectCoercible$b;
  1572. var charAt$4 = uncurryThis$j(''.charAt);
  1573. var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
  1574. var stringSlice$5 = uncurryThis$j(''.slice);
  1575. var createMethod$2 = function (CONVERT_TO_STRING) {
  1576. return function ($this, pos) {
  1577. var S = toString$c(requireObjectCoercible$7($this));
  1578. var position = toIntegerOrInfinity$2(pos);
  1579. var size = S.length;
  1580. var first, second;
  1581. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1582. first = charCodeAt$1(S, position);
  1583. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1584. || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1585. ? CONVERT_TO_STRING
  1586. ? charAt$4(S, position)
  1587. : first
  1588. : CONVERT_TO_STRING
  1589. ? stringSlice$5(S, position, position + 2)
  1590. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1591. };
  1592. };
  1593. var stringMultibyte = {
  1594. // `String.prototype.codePointAt` method
  1595. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1596. codeAt: createMethod$2(false),
  1597. // `String.prototype.at` method
  1598. // https://github.com/mathiasbynens/String.prototype.at
  1599. charAt: createMethod$2(true)
  1600. };
  1601. var charAt$3 = stringMultibyte.charAt;
  1602. // `AdvanceStringIndex` abstract operation
  1603. // https://tc39.es/ecma262/#sec-advancestringindex
  1604. var advanceStringIndex$3 = function (S, index, unicode) {
  1605. return index + (unicode ? charAt$3(S, index).length : 1);
  1606. };
  1607. var toPropertyKey = toPropertyKey$3;
  1608. var definePropertyModule$1 = objectDefineProperty;
  1609. var createPropertyDescriptor$1 = createPropertyDescriptor$4;
  1610. var createProperty$4 = function (object, key, value) {
  1611. var propertyKey = toPropertyKey(key);
  1612. if (propertyKey in object) definePropertyModule$1.f(object, propertyKey, createPropertyDescriptor$1(0, value));
  1613. else object[propertyKey] = value;
  1614. };
  1615. var toAbsoluteIndex$2 = toAbsoluteIndex$4;
  1616. var lengthOfArrayLike$5 = lengthOfArrayLike$7;
  1617. var createProperty$3 = createProperty$4;
  1618. var $Array$2 = Array;
  1619. var max$3 = Math.max;
  1620. var arraySliceSimple = function (O, start, end) {
  1621. var length = lengthOfArrayLike$5(O);
  1622. var k = toAbsoluteIndex$2(start, length);
  1623. var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
  1624. var result = $Array$2(max$3(fin - k, 0));
  1625. for (var n = 0; k < fin; k++, n++) createProperty$3(result, n, O[k]);
  1626. result.length = n;
  1627. return result;
  1628. };
  1629. var call$6 = functionCall;
  1630. var anObject$6 = anObject$d;
  1631. var isCallable$6 = isCallable$j;
  1632. var classof$2 = classofRaw$2;
  1633. var regexpExec$1 = regexpExec$3;
  1634. var $TypeError$5 = TypeError;
  1635. // `RegExpExec` abstract operation
  1636. // https://tc39.es/ecma262/#sec-regexpexec
  1637. var regexpExecAbstract = function (R, S) {
  1638. var exec = R.exec;
  1639. if (isCallable$6(exec)) {
  1640. var result = call$6(exec, R, S);
  1641. if (result !== null) anObject$6(result);
  1642. return result;
  1643. }
  1644. if (classof$2(R) === 'RegExp') return call$6(regexpExec$1, R, S);
  1645. throw $TypeError$5('RegExp#exec called on incompatible receiver');
  1646. };
  1647. var apply$1 = functionApply;
  1648. var call$5 = functionCall;
  1649. var uncurryThis$i = functionUncurryThis;
  1650. var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
  1651. var anObject$5 = anObject$d;
  1652. var isNullOrUndefined$3 = isNullOrUndefined$7;
  1653. var isRegExp$2 = isRegexp;
  1654. var requireObjectCoercible$6 = requireObjectCoercible$b;
  1655. var speciesConstructor = speciesConstructor$1;
  1656. var advanceStringIndex$2 = advanceStringIndex$3;
  1657. var toLength$4 = toLength$6;
  1658. var toString$b = toString$f;
  1659. var getMethod$3 = getMethod$5;
  1660. var arraySlice$3 = arraySliceSimple;
  1661. var callRegExpExec = regexpExecAbstract;
  1662. var regexpExec = regexpExec$3;
  1663. var stickyHelpers$1 = regexpStickyHelpers;
  1664. var fails$d = fails$u;
  1665. var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y;
  1666. var MAX_UINT32 = 0xFFFFFFFF;
  1667. var min$4 = Math.min;
  1668. var $push = [].push;
  1669. var exec$2 = uncurryThis$i(/./.exec);
  1670. var push$4 = uncurryThis$i($push);
  1671. var stringSlice$4 = uncurryThis$i(''.slice);
  1672. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1673. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1674. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () {
  1675. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1676. var re = /(?:)/;
  1677. var originalExec = re.exec;
  1678. re.exec = function () { return originalExec.apply(this, arguments); };
  1679. var result = 'ab'.split(re);
  1680. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1681. });
  1682. // @@split logic
  1683. fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1684. var internalSplit;
  1685. if (
  1686. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1687. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1688. 'test'.split(/(?:)/, -1).length != 4 ||
  1689. 'ab'.split(/(?:ab)*/).length != 2 ||
  1690. '.'.split(/(.?)(.?)/).length != 4 ||
  1691. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1692. '.'.split(/()()/).length > 1 ||
  1693. ''.split(/.?/).length
  1694. ) {
  1695. // based on es5-shim implementation, need to rework it
  1696. internalSplit = function (separator, limit) {
  1697. var string = toString$b(requireObjectCoercible$6(this));
  1698. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1699. if (lim === 0) return [];
  1700. if (separator === undefined) return [string];
  1701. // If `separator` is not a regex, use native split
  1702. if (!isRegExp$2(separator)) {
  1703. return call$5(nativeSplit, string, separator, lim);
  1704. }
  1705. var output = [];
  1706. var flags = (separator.ignoreCase ? 'i' : '') +
  1707. (separator.multiline ? 'm' : '') +
  1708. (separator.unicode ? 'u' : '') +
  1709. (separator.sticky ? 'y' : '');
  1710. var lastLastIndex = 0;
  1711. // Make `global` and avoid `lastIndex` issues by working with a copy
  1712. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1713. var match, lastIndex, lastLength;
  1714. while (match = call$5(regexpExec, separatorCopy, string)) {
  1715. lastIndex = separatorCopy.lastIndex;
  1716. if (lastIndex > lastLastIndex) {
  1717. push$4(output, stringSlice$4(string, lastLastIndex, match.index));
  1718. if (match.length > 1 && match.index < string.length) apply$1($push, output, arraySlice$3(match, 1));
  1719. lastLength = match[0].length;
  1720. lastLastIndex = lastIndex;
  1721. if (output.length >= lim) break;
  1722. }
  1723. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1724. }
  1725. if (lastLastIndex === string.length) {
  1726. if (lastLength || !exec$2(separatorCopy, '')) push$4(output, '');
  1727. } else push$4(output, stringSlice$4(string, lastLastIndex));
  1728. return output.length > lim ? arraySlice$3(output, 0, lim) : output;
  1729. };
  1730. // Chakra, V8
  1731. } else if ('0'.split(undefined, 0).length) {
  1732. internalSplit = function (separator, limit) {
  1733. return separator === undefined && limit === 0 ? [] : call$5(nativeSplit, this, separator, limit);
  1734. };
  1735. } else internalSplit = nativeSplit;
  1736. return [
  1737. // `String.prototype.split` method
  1738. // https://tc39.es/ecma262/#sec-string.prototype.split
  1739. function split(separator, limit) {
  1740. var O = requireObjectCoercible$6(this);
  1741. var splitter = isNullOrUndefined$3(separator) ? undefined : getMethod$3(separator, SPLIT);
  1742. return splitter
  1743. ? call$5(splitter, separator, O, limit)
  1744. : call$5(internalSplit, toString$b(O), separator, limit);
  1745. },
  1746. // `RegExp.prototype[@@split]` method
  1747. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1748. //
  1749. // NOTE: This cannot be properly polyfilled in engines that don't support
  1750. // the 'y' flag.
  1751. function (string, limit) {
  1752. var rx = anObject$5(this);
  1753. var S = toString$b(string);
  1754. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1755. if (res.done) return res.value;
  1756. var C = speciesConstructor(rx, RegExp);
  1757. var unicodeMatching = rx.unicode;
  1758. var flags = (rx.ignoreCase ? 'i' : '') +
  1759. (rx.multiline ? 'm' : '') +
  1760. (rx.unicode ? 'u' : '') +
  1761. (UNSUPPORTED_Y$1 ? 'g' : 'y');
  1762. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1763. // simulate the 'y' flag.
  1764. var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
  1765. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1766. if (lim === 0) return [];
  1767. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  1768. var p = 0;
  1769. var q = 0;
  1770. var A = [];
  1771. while (q < S.length) {
  1772. splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
  1773. var z = callRegExpExec(splitter, UNSUPPORTED_Y$1 ? stringSlice$4(S, q) : S);
  1774. var e;
  1775. if (
  1776. z === null ||
  1777. (e = min$4(toLength$4(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
  1778. ) {
  1779. q = advanceStringIndex$2(S, q, unicodeMatching);
  1780. } else {
  1781. push$4(A, stringSlice$4(S, p, q));
  1782. if (A.length === lim) return A;
  1783. for (var i = 1; i <= z.length - 1; i++) {
  1784. push$4(A, z[i]);
  1785. if (A.length === lim) return A;
  1786. }
  1787. q = p = e;
  1788. }
  1789. }
  1790. push$4(A, stringSlice$4(S, p));
  1791. return A;
  1792. }
  1793. ];
  1794. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
  1795. var DESCRIPTORS$5 = descriptors;
  1796. var uncurryThis$h = functionUncurryThis;
  1797. var objectKeys = objectKeys$3;
  1798. var toIndexedObject$2 = toIndexedObject$8;
  1799. var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1800. var propertyIsEnumerable = uncurryThis$h($propertyIsEnumerable);
  1801. var push$3 = uncurryThis$h([].push);
  1802. // `Object.{ entries, values }` methods implementation
  1803. var createMethod$1 = function (TO_ENTRIES) {
  1804. return function (it) {
  1805. var O = toIndexedObject$2(it);
  1806. var keys = objectKeys(O);
  1807. var length = keys.length;
  1808. var i = 0;
  1809. var result = [];
  1810. var key;
  1811. while (length > i) {
  1812. key = keys[i++];
  1813. if (!DESCRIPTORS$5 || propertyIsEnumerable(O, key)) {
  1814. push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
  1815. }
  1816. }
  1817. return result;
  1818. };
  1819. };
  1820. var objectToArray = {
  1821. // `Object.entries` method
  1822. // https://tc39.es/ecma262/#sec-object.entries
  1823. entries: createMethod$1(true),
  1824. // `Object.values` method
  1825. // https://tc39.es/ecma262/#sec-object.values
  1826. values: createMethod$1(false)
  1827. };
  1828. var $$i = _export;
  1829. var $entries = objectToArray.entries;
  1830. // `Object.entries` method
  1831. // https://tc39.es/ecma262/#sec-object.entries
  1832. $$i({ target: 'Object', stat: true }, {
  1833. entries: function entries(O) {
  1834. return $entries(O);
  1835. }
  1836. });
  1837. var wellKnownSymbol$c = wellKnownSymbol$j;
  1838. var create$1 = objectCreate;
  1839. var defineProperty$4 = objectDefineProperty.f;
  1840. var UNSCOPABLES = wellKnownSymbol$c('unscopables');
  1841. var ArrayPrototype = Array.prototype;
  1842. // Array.prototype[@@unscopables]
  1843. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1844. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1845. defineProperty$4(ArrayPrototype, UNSCOPABLES, {
  1846. configurable: true,
  1847. value: create$1(null)
  1848. });
  1849. }
  1850. // add a key to Array.prototype[@@unscopables]
  1851. var addToUnscopables$4 = function (key) {
  1852. ArrayPrototype[UNSCOPABLES][key] = true;
  1853. };
  1854. var $$h = _export;
  1855. var $includes = arrayIncludes.includes;
  1856. var fails$c = fails$u;
  1857. var addToUnscopables$3 = addToUnscopables$4;
  1858. // FF99+ bug
  1859. var BROKEN_ON_SPARSE = fails$c(function () {
  1860. return !Array(1).includes();
  1861. });
  1862. // `Array.prototype.includes` method
  1863. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1864. $$h({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1865. includes: function includes(el /* , fromIndex = 0 */) {
  1866. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1867. }
  1868. });
  1869. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1870. addToUnscopables$3('includes');
  1871. var classof$1 = classofRaw$2;
  1872. // `IsArray` abstract operation
  1873. // https://tc39.es/ecma262/#sec-isarray
  1874. // eslint-disable-next-line es/no-array-isarray -- safe
  1875. var isArray$5 = Array.isArray || function isArray(argument) {
  1876. return classof$1(argument) == 'Array';
  1877. };
  1878. var $TypeError$4 = TypeError;
  1879. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  1880. var doesNotExceedSafeInteger$2 = function (it) {
  1881. if (it > MAX_SAFE_INTEGER) throw $TypeError$4('Maximum allowed index exceeded');
  1882. return it;
  1883. };
  1884. var isArray$4 = isArray$5;
  1885. var isConstructor$1 = isConstructor$3;
  1886. var isObject$4 = isObject$b;
  1887. var wellKnownSymbol$b = wellKnownSymbol$j;
  1888. var SPECIES$3 = wellKnownSymbol$b('species');
  1889. var $Array$1 = Array;
  1890. // a part of `ArraySpeciesCreate` abstract operation
  1891. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1892. var arraySpeciesConstructor$1 = function (originalArray) {
  1893. var C;
  1894. if (isArray$4(originalArray)) {
  1895. C = originalArray.constructor;
  1896. // cross-realm fallback
  1897. if (isConstructor$1(C) && (C === $Array$1 || isArray$4(C.prototype))) C = undefined;
  1898. else if (isObject$4(C)) {
  1899. C = C[SPECIES$3];
  1900. if (C === null) C = undefined;
  1901. }
  1902. } return C === undefined ? $Array$1 : C;
  1903. };
  1904. var arraySpeciesConstructor = arraySpeciesConstructor$1;
  1905. // `ArraySpeciesCreate` abstract operation
  1906. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1907. var arraySpeciesCreate$3 = function (originalArray, length) {
  1908. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1909. };
  1910. var fails$b = fails$u;
  1911. var wellKnownSymbol$a = wellKnownSymbol$j;
  1912. var V8_VERSION$1 = engineV8Version;
  1913. var SPECIES$2 = wellKnownSymbol$a('species');
  1914. var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
  1915. // We can't use this feature detection in V8 since it causes
  1916. // deoptimization and serious performance degradation
  1917. // https://github.com/zloirock/core-js/issues/677
  1918. return V8_VERSION$1 >= 51 || !fails$b(function () {
  1919. var array = [];
  1920. var constructor = array.constructor = {};
  1921. constructor[SPECIES$2] = function () {
  1922. return { foo: 1 };
  1923. };
  1924. return array[METHOD_NAME](Boolean).foo !== 1;
  1925. });
  1926. };
  1927. var $$g = _export;
  1928. var fails$a = fails$u;
  1929. var isArray$3 = isArray$5;
  1930. var isObject$3 = isObject$b;
  1931. var toObject$6 = toObject$9;
  1932. var lengthOfArrayLike$4 = lengthOfArrayLike$7;
  1933. var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
  1934. var createProperty$2 = createProperty$4;
  1935. var arraySpeciesCreate$2 = arraySpeciesCreate$3;
  1936. var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
  1937. var wellKnownSymbol$9 = wellKnownSymbol$j;
  1938. var V8_VERSION = engineV8Version;
  1939. var IS_CONCAT_SPREADABLE = wellKnownSymbol$9('isConcatSpreadable');
  1940. // We can't use this feature detection in V8 since it causes
  1941. // deoptimization and serious performance degradation
  1942. // https://github.com/zloirock/core-js/issues/679
  1943. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () {
  1944. var array = [];
  1945. array[IS_CONCAT_SPREADABLE] = false;
  1946. return array.concat()[0] !== array;
  1947. });
  1948. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$4('concat');
  1949. var isConcatSpreadable = function (O) {
  1950. if (!isObject$3(O)) return false;
  1951. var spreadable = O[IS_CONCAT_SPREADABLE];
  1952. return spreadable !== undefined ? !!spreadable : isArray$3(O);
  1953. };
  1954. var FORCED$3 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1955. // `Array.prototype.concat` method
  1956. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1957. // with adding support of @@isConcatSpreadable and @@species
  1958. $$g({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
  1959. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1960. concat: function concat(arg) {
  1961. var O = toObject$6(this);
  1962. var A = arraySpeciesCreate$2(O, 0);
  1963. var n = 0;
  1964. var i, k, length, len, E;
  1965. for (i = -1, length = arguments.length; i < length; i++) {
  1966. E = i === -1 ? O : arguments[i];
  1967. if (isConcatSpreadable(E)) {
  1968. len = lengthOfArrayLike$4(E);
  1969. doesNotExceedSafeInteger$1(n + len);
  1970. for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
  1971. } else {
  1972. doesNotExceedSafeInteger$1(n + 1);
  1973. createProperty$2(A, n++, E);
  1974. }
  1975. }
  1976. A.length = n;
  1977. return A;
  1978. }
  1979. });
  1980. var uncurryThis$g = functionUncurryThis;
  1981. var aCallable$1 = aCallable$3;
  1982. var NATIVE_BIND = functionBindNative;
  1983. var bind$1 = uncurryThis$g(uncurryThis$g.bind);
  1984. // optional / simple context binding
  1985. var functionBindContext = function (fn, that) {
  1986. aCallable$1(fn);
  1987. return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
  1988. return fn.apply(that, arguments);
  1989. };
  1990. };
  1991. var bind = functionBindContext;
  1992. var uncurryThis$f = functionUncurryThis;
  1993. var IndexedObject = indexedObject;
  1994. var toObject$5 = toObject$9;
  1995. var lengthOfArrayLike$3 = lengthOfArrayLike$7;
  1996. var arraySpeciesCreate$1 = arraySpeciesCreate$3;
  1997. var push$2 = uncurryThis$f([].push);
  1998. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1999. var createMethod = function (TYPE) {
  2000. var IS_MAP = TYPE == 1;
  2001. var IS_FILTER = TYPE == 2;
  2002. var IS_SOME = TYPE == 3;
  2003. var IS_EVERY = TYPE == 4;
  2004. var IS_FIND_INDEX = TYPE == 6;
  2005. var IS_FILTER_REJECT = TYPE == 7;
  2006. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  2007. return function ($this, callbackfn, that, specificCreate) {
  2008. var O = toObject$5($this);
  2009. var self = IndexedObject(O);
  2010. var boundFunction = bind(callbackfn, that);
  2011. var length = lengthOfArrayLike$3(self);
  2012. var index = 0;
  2013. var create = specificCreate || arraySpeciesCreate$1;
  2014. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  2015. var value, result;
  2016. for (;length > index; index++) if (NO_HOLES || index in self) {
  2017. value = self[index];
  2018. result = boundFunction(value, index, O);
  2019. if (TYPE) {
  2020. if (IS_MAP) target[index] = result; // map
  2021. else if (result) switch (TYPE) {
  2022. case 3: return true; // some
  2023. case 5: return value; // find
  2024. case 6: return index; // findIndex
  2025. case 2: push$2(target, value); // filter
  2026. } else switch (TYPE) {
  2027. case 4: return false; // every
  2028. case 7: push$2(target, value); // filterReject
  2029. }
  2030. }
  2031. }
  2032. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  2033. };
  2034. };
  2035. var arrayIteration = {
  2036. // `Array.prototype.forEach` method
  2037. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  2038. forEach: createMethod(0),
  2039. // `Array.prototype.map` method
  2040. // https://tc39.es/ecma262/#sec-array.prototype.map
  2041. map: createMethod(1),
  2042. // `Array.prototype.filter` method
  2043. // https://tc39.es/ecma262/#sec-array.prototype.filter
  2044. filter: createMethod(2),
  2045. // `Array.prototype.some` method
  2046. // https://tc39.es/ecma262/#sec-array.prototype.some
  2047. some: createMethod(3),
  2048. // `Array.prototype.every` method
  2049. // https://tc39.es/ecma262/#sec-array.prototype.every
  2050. every: createMethod(4),
  2051. // `Array.prototype.find` method
  2052. // https://tc39.es/ecma262/#sec-array.prototype.find
  2053. find: createMethod(5),
  2054. // `Array.prototype.findIndex` method
  2055. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  2056. findIndex: createMethod(6),
  2057. // `Array.prototype.filterReject` method
  2058. // https://github.com/tc39/proposal-array-filtering
  2059. filterReject: createMethod(7)
  2060. };
  2061. var $$f = _export;
  2062. var $find = arrayIteration.find;
  2063. var addToUnscopables$2 = addToUnscopables$4;
  2064. var FIND = 'find';
  2065. var SKIPS_HOLES$1 = true;
  2066. // Shouldn't skip holes
  2067. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
  2068. // `Array.prototype.find` method
  2069. // https://tc39.es/ecma262/#sec-array.prototype.find
  2070. $$f({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
  2071. find: function find(callbackfn /* , that = undefined */) {
  2072. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2073. }
  2074. });
  2075. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  2076. addToUnscopables$2(FIND);
  2077. var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
  2078. var classof = classof$6;
  2079. // `Object.prototype.toString` method implementation
  2080. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2081. var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
  2082. return '[object ' + classof(this) + ']';
  2083. };
  2084. var TO_STRING_TAG_SUPPORT = toStringTagSupport;
  2085. var defineBuiltIn$5 = defineBuiltIn$8;
  2086. var toString$a = objectToString;
  2087. // `Object.prototype.toString` method
  2088. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2089. if (!TO_STRING_TAG_SUPPORT) {
  2090. defineBuiltIn$5(Object.prototype, 'toString', toString$a, { unsafe: true });
  2091. }
  2092. var isRegExp$1 = isRegexp;
  2093. var $TypeError$3 = TypeError;
  2094. var notARegexp = function (it) {
  2095. if (isRegExp$1(it)) {
  2096. throw $TypeError$3("The method doesn't accept regular expressions");
  2097. } return it;
  2098. };
  2099. var wellKnownSymbol$8 = wellKnownSymbol$j;
  2100. var MATCH$1 = wellKnownSymbol$8('match');
  2101. var correctIsRegexpLogic = function (METHOD_NAME) {
  2102. var regexp = /./;
  2103. try {
  2104. '/./'[METHOD_NAME](regexp);
  2105. } catch (error1) {
  2106. try {
  2107. regexp[MATCH$1] = false;
  2108. return '/./'[METHOD_NAME](regexp);
  2109. } catch (error2) { /* empty */ }
  2110. } return false;
  2111. };
  2112. var $$e = _export;
  2113. var uncurryThis$e = functionUncurryThis;
  2114. var notARegExp$2 = notARegexp;
  2115. var requireObjectCoercible$5 = requireObjectCoercible$b;
  2116. var toString$9 = toString$f;
  2117. var correctIsRegExpLogic$2 = correctIsRegexpLogic;
  2118. var stringIndexOf$2 = uncurryThis$e(''.indexOf);
  2119. // `String.prototype.includes` method
  2120. // https://tc39.es/ecma262/#sec-string.prototype.includes
  2121. $$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
  2122. includes: function includes(searchString /* , position = 0 */) {
  2123. return !!~stringIndexOf$2(
  2124. toString$9(requireObjectCoercible$5(this)),
  2125. toString$9(notARegExp$2(searchString)),
  2126. arguments.length > 1 ? arguments[1] : undefined
  2127. );
  2128. }
  2129. });
  2130. // iterable DOM collections
  2131. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  2132. var domIterables = {
  2133. CSSRuleList: 0,
  2134. CSSStyleDeclaration: 0,
  2135. CSSValueList: 0,
  2136. ClientRectList: 0,
  2137. DOMRectList: 0,
  2138. DOMStringList: 0,
  2139. DOMTokenList: 1,
  2140. DataTransferItemList: 0,
  2141. FileList: 0,
  2142. HTMLAllCollection: 0,
  2143. HTMLCollection: 0,
  2144. HTMLFormElement: 0,
  2145. HTMLSelectElement: 0,
  2146. MediaList: 0,
  2147. MimeTypeArray: 0,
  2148. NamedNodeMap: 0,
  2149. NodeList: 1,
  2150. PaintRequestList: 0,
  2151. Plugin: 0,
  2152. PluginArray: 0,
  2153. SVGLengthList: 0,
  2154. SVGNumberList: 0,
  2155. SVGPathSegList: 0,
  2156. SVGPointList: 0,
  2157. SVGStringList: 0,
  2158. SVGTransformList: 0,
  2159. SourceBufferList: 0,
  2160. StyleSheetList: 0,
  2161. TextTrackCueList: 0,
  2162. TextTrackList: 0,
  2163. TouchList: 0
  2164. };
  2165. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  2166. var documentCreateElement = documentCreateElement$2;
  2167. var classList = documentCreateElement('span').classList;
  2168. var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
  2169. var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
  2170. var $forEach = arrayIteration.forEach;
  2171. var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
  2172. var STRICT_METHOD$2 = arrayMethodIsStrict$2('forEach');
  2173. // `Array.prototype.forEach` method implementation
  2174. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  2175. var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
  2176. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2177. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  2178. } : [].forEach;
  2179. var global$6 = global$j;
  2180. var DOMIterables$1 = domIterables;
  2181. var DOMTokenListPrototype$1 = domTokenListPrototype;
  2182. var forEach = arrayForEach;
  2183. var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
  2184. var handlePrototype$1 = function (CollectionPrototype) {
  2185. // some Chrome versions have non-configurable methods on DOMTokenList
  2186. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  2187. createNonEnumerableProperty$3(CollectionPrototype, 'forEach', forEach);
  2188. } catch (error) {
  2189. CollectionPrototype.forEach = forEach;
  2190. }
  2191. };
  2192. for (var COLLECTION_NAME$1 in DOMIterables$1) {
  2193. if (DOMIterables$1[COLLECTION_NAME$1]) {
  2194. handlePrototype$1(global$6[COLLECTION_NAME$1] && global$6[COLLECTION_NAME$1].prototype);
  2195. }
  2196. }
  2197. handlePrototype$1(DOMTokenListPrototype$1);
  2198. var global$5 = global$j;
  2199. var fails$9 = fails$u;
  2200. var uncurryThis$d = functionUncurryThis;
  2201. var toString$8 = toString$f;
  2202. var trim$2 = stringTrim.trim;
  2203. var whitespaces$1 = whitespaces$4;
  2204. var charAt$2 = uncurryThis$d(''.charAt);
  2205. var $parseFloat$1 = global$5.parseFloat;
  2206. var Symbol$2 = global$5.Symbol;
  2207. var ITERATOR$4 = Symbol$2 && Symbol$2.iterator;
  2208. var FORCED$2 = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity
  2209. // MS Edge 18- broken with boxed symbols
  2210. || (ITERATOR$4 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$4)); }));
  2211. // `parseFloat` method
  2212. // https://tc39.es/ecma262/#sec-parsefloat-string
  2213. var numberParseFloat = FORCED$2 ? function parseFloat(string) {
  2214. var trimmedString = trim$2(toString$8(string));
  2215. var result = $parseFloat$1(trimmedString);
  2216. return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result;
  2217. } : $parseFloat$1;
  2218. var $$d = _export;
  2219. var $parseFloat = numberParseFloat;
  2220. // `parseFloat` method
  2221. // https://tc39.es/ecma262/#sec-parsefloat-string
  2222. $$d({ global: true, forced: parseFloat != $parseFloat }, {
  2223. parseFloat: $parseFloat
  2224. });
  2225. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  2226. var $$c = _export;
  2227. var uncurryThis$c = functionUncurryThis;
  2228. var $indexOf = arrayIncludes.indexOf;
  2229. var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
  2230. var nativeIndexOf = uncurryThis$c([].indexOf);
  2231. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
  2232. var STRICT_METHOD$1 = arrayMethodIsStrict$1('indexOf');
  2233. // `Array.prototype.indexOf` method
  2234. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  2235. $$c({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 }, {
  2236. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  2237. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  2238. return NEGATIVE_ZERO
  2239. // convert -0 to +0
  2240. ? nativeIndexOf(this, searchElement, fromIndex) || 0
  2241. : $indexOf(this, searchElement, fromIndex);
  2242. }
  2243. });
  2244. var tryToString = tryToString$3;
  2245. var $TypeError$2 = TypeError;
  2246. var deletePropertyOrThrow$2 = function (O, P) {
  2247. if (!delete O[P]) throw $TypeError$2('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
  2248. };
  2249. var arraySlice$2 = arraySliceSimple;
  2250. var floor$1 = Math.floor;
  2251. var mergeSort = function (array, comparefn) {
  2252. var length = array.length;
  2253. var middle = floor$1(length / 2);
  2254. return length < 8 ? insertionSort(array, comparefn) : merge(
  2255. array,
  2256. mergeSort(arraySlice$2(array, 0, middle), comparefn),
  2257. mergeSort(arraySlice$2(array, middle), comparefn),
  2258. comparefn
  2259. );
  2260. };
  2261. var insertionSort = function (array, comparefn) {
  2262. var length = array.length;
  2263. var i = 1;
  2264. var element, j;
  2265. while (i < length) {
  2266. j = i;
  2267. element = array[i];
  2268. while (j && comparefn(array[j - 1], element) > 0) {
  2269. array[j] = array[--j];
  2270. }
  2271. if (j !== i++) array[j] = element;
  2272. } return array;
  2273. };
  2274. var merge = function (array, left, right, comparefn) {
  2275. var llength = left.length;
  2276. var rlength = right.length;
  2277. var lindex = 0;
  2278. var rindex = 0;
  2279. while (lindex < llength || rindex < rlength) {
  2280. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  2281. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  2282. : lindex < llength ? left[lindex++] : right[rindex++];
  2283. } return array;
  2284. };
  2285. var arraySort = mergeSort;
  2286. var userAgent$1 = engineUserAgent;
  2287. var firefox = userAgent$1.match(/firefox\/(\d+)/i);
  2288. var engineFfVersion = !!firefox && +firefox[1];
  2289. var UA = engineUserAgent;
  2290. var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
  2291. var userAgent = engineUserAgent;
  2292. var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
  2293. var engineWebkitVersion = !!webkit && +webkit[1];
  2294. var $$b = _export;
  2295. var uncurryThis$b = functionUncurryThis;
  2296. var aCallable = aCallable$3;
  2297. var toObject$4 = toObject$9;
  2298. var lengthOfArrayLike$2 = lengthOfArrayLike$7;
  2299. var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
  2300. var toString$7 = toString$f;
  2301. var fails$8 = fails$u;
  2302. var internalSort = arraySort;
  2303. var arrayMethodIsStrict = arrayMethodIsStrict$4;
  2304. var FF = engineFfVersion;
  2305. var IE_OR_EDGE = engineIsIeOrEdge;
  2306. var V8 = engineV8Version;
  2307. var WEBKIT = engineWebkitVersion;
  2308. var test$1 = [];
  2309. var nativeSort = uncurryThis$b(test$1.sort);
  2310. var push$1 = uncurryThis$b(test$1.push);
  2311. // IE8-
  2312. var FAILS_ON_UNDEFINED = fails$8(function () {
  2313. test$1.sort(undefined);
  2314. });
  2315. // V8 bug
  2316. var FAILS_ON_NULL = fails$8(function () {
  2317. test$1.sort(null);
  2318. });
  2319. // Old WebKit
  2320. var STRICT_METHOD = arrayMethodIsStrict('sort');
  2321. var STABLE_SORT = !fails$8(function () {
  2322. // feature detection can be too slow, so check engines versions
  2323. if (V8) return V8 < 70;
  2324. if (FF && FF > 3) return;
  2325. if (IE_OR_EDGE) return true;
  2326. if (WEBKIT) return WEBKIT < 603;
  2327. var result = '';
  2328. var code, chr, value, index;
  2329. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  2330. for (code = 65; code < 76; code++) {
  2331. chr = String.fromCharCode(code);
  2332. switch (code) {
  2333. case 66: case 69: case 70: case 72: value = 3; break;
  2334. case 68: case 71: value = 4; break;
  2335. default: value = 2;
  2336. }
  2337. for (index = 0; index < 47; index++) {
  2338. test$1.push({ k: chr + index, v: value });
  2339. }
  2340. }
  2341. test$1.sort(function (a, b) { return b.v - a.v; });
  2342. for (index = 0; index < test$1.length; index++) {
  2343. chr = test$1[index].k.charAt(0);
  2344. if (result.charAt(result.length - 1) !== chr) result += chr;
  2345. }
  2346. return result !== 'DGBEFHACIJK';
  2347. });
  2348. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
  2349. var getSortCompare = function (comparefn) {
  2350. return function (x, y) {
  2351. if (y === undefined) return -1;
  2352. if (x === undefined) return 1;
  2353. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  2354. return toString$7(x) > toString$7(y) ? 1 : -1;
  2355. };
  2356. };
  2357. // `Array.prototype.sort` method
  2358. // https://tc39.es/ecma262/#sec-array.prototype.sort
  2359. $$b({ target: 'Array', proto: true, forced: FORCED$1 }, {
  2360. sort: function sort(comparefn) {
  2361. if (comparefn !== undefined) aCallable(comparefn);
  2362. var array = toObject$4(this);
  2363. if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
  2364. var items = [];
  2365. var arrayLength = lengthOfArrayLike$2(array);
  2366. var itemsLength, index;
  2367. for (index = 0; index < arrayLength; index++) {
  2368. if (index in array) push$1(items, array[index]);
  2369. }
  2370. internalSort(items, getSortCompare(comparefn));
  2371. itemsLength = lengthOfArrayLike$2(items);
  2372. index = 0;
  2373. while (index < itemsLength) array[index] = items[index++];
  2374. while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
  2375. return array;
  2376. }
  2377. });
  2378. var uncurryThis$a = functionUncurryThis;
  2379. var toObject$3 = toObject$9;
  2380. var floor = Math.floor;
  2381. var charAt$1 = uncurryThis$a(''.charAt);
  2382. var replace$1 = uncurryThis$a(''.replace);
  2383. var stringSlice$3 = uncurryThis$a(''.slice);
  2384. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  2385. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  2386. // `GetSubstitution` abstract operation
  2387. // https://tc39.es/ecma262/#sec-getsubstitution
  2388. var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
  2389. var tailPos = position + matched.length;
  2390. var m = captures.length;
  2391. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2392. if (namedCaptures !== undefined) {
  2393. namedCaptures = toObject$3(namedCaptures);
  2394. symbols = SUBSTITUTION_SYMBOLS;
  2395. }
  2396. return replace$1(replacement, symbols, function (match, ch) {
  2397. var capture;
  2398. switch (charAt$1(ch, 0)) {
  2399. case '$': return '$';
  2400. case '&': return matched;
  2401. case '`': return stringSlice$3(str, 0, position);
  2402. case "'": return stringSlice$3(str, tailPos);
  2403. case '<':
  2404. capture = namedCaptures[stringSlice$3(ch, 1, -1)];
  2405. break;
  2406. default: // \d\d?
  2407. var n = +ch;
  2408. if (n === 0) return match;
  2409. if (n > m) {
  2410. var f = floor(n / 10);
  2411. if (f === 0) return match;
  2412. if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
  2413. return match;
  2414. }
  2415. capture = captures[n - 1];
  2416. }
  2417. return capture === undefined ? '' : capture;
  2418. });
  2419. };
  2420. var apply = functionApply;
  2421. var call$4 = functionCall;
  2422. var uncurryThis$9 = functionUncurryThis;
  2423. var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
  2424. var fails$7 = fails$u;
  2425. var anObject$4 = anObject$d;
  2426. var isCallable$5 = isCallable$j;
  2427. var isNullOrUndefined$2 = isNullOrUndefined$7;
  2428. var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
  2429. var toLength$3 = toLength$6;
  2430. var toString$6 = toString$f;
  2431. var requireObjectCoercible$4 = requireObjectCoercible$b;
  2432. var advanceStringIndex$1 = advanceStringIndex$3;
  2433. var getMethod$2 = getMethod$5;
  2434. var getSubstitution = getSubstitution$1;
  2435. var regExpExec$2 = regexpExecAbstract;
  2436. var wellKnownSymbol$7 = wellKnownSymbol$j;
  2437. var REPLACE = wellKnownSymbol$7('replace');
  2438. var max$2 = Math.max;
  2439. var min$3 = Math.min;
  2440. var concat = uncurryThis$9([].concat);
  2441. var push = uncurryThis$9([].push);
  2442. var stringIndexOf$1 = uncurryThis$9(''.indexOf);
  2443. var stringSlice$2 = uncurryThis$9(''.slice);
  2444. var maybeToString = function (it) {
  2445. return it === undefined ? it : String(it);
  2446. };
  2447. // IE <= 11 replaces $0 with the whole match, as if it was $&
  2448. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  2449. var REPLACE_KEEPS_$0 = (function () {
  2450. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  2451. return 'a'.replace(/./, '$0') === '$0';
  2452. })();
  2453. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  2454. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  2455. if (/./[REPLACE]) {
  2456. return /./[REPLACE]('a', '$0') === '';
  2457. }
  2458. return false;
  2459. })();
  2460. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
  2461. var re = /./;
  2462. re.exec = function () {
  2463. var result = [];
  2464. result.groups = { a: '7' };
  2465. return result;
  2466. };
  2467. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  2468. return ''.replace(re, '$<a>') !== '7';
  2469. });
  2470. // @@replace logic
  2471. fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) {
  2472. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2473. return [
  2474. // `String.prototype.replace` method
  2475. // https://tc39.es/ecma262/#sec-string.prototype.replace
  2476. function replace(searchValue, replaceValue) {
  2477. var O = requireObjectCoercible$4(this);
  2478. var replacer = isNullOrUndefined$2(searchValue) ? undefined : getMethod$2(searchValue, REPLACE);
  2479. return replacer
  2480. ? call$4(replacer, searchValue, O, replaceValue)
  2481. : call$4(nativeReplace, toString$6(O), searchValue, replaceValue);
  2482. },
  2483. // `RegExp.prototype[@@replace]` method
  2484. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  2485. function (string, replaceValue) {
  2486. var rx = anObject$4(this);
  2487. var S = toString$6(string);
  2488. if (
  2489. typeof replaceValue == 'string' &&
  2490. stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  2491. stringIndexOf$1(replaceValue, '$<') === -1
  2492. ) {
  2493. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  2494. if (res.done) return res.value;
  2495. }
  2496. var functionalReplace = isCallable$5(replaceValue);
  2497. if (!functionalReplace) replaceValue = toString$6(replaceValue);
  2498. var global = rx.global;
  2499. if (global) {
  2500. var fullUnicode = rx.unicode;
  2501. rx.lastIndex = 0;
  2502. }
  2503. var results = [];
  2504. while (true) {
  2505. var result = regExpExec$2(rx, S);
  2506. if (result === null) break;
  2507. push(results, result);
  2508. if (!global) break;
  2509. var matchStr = toString$6(result[0]);
  2510. if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
  2511. }
  2512. var accumulatedResult = '';
  2513. var nextSourcePosition = 0;
  2514. for (var i = 0; i < results.length; i++) {
  2515. result = results[i];
  2516. var matched = toString$6(result[0]);
  2517. var position = max$2(min$3(toIntegerOrInfinity$1(result.index), S.length), 0);
  2518. var captures = [];
  2519. // NOTE: This is equivalent to
  2520. // captures = result.slice(1).map(maybeToString)
  2521. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2522. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2523. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2524. for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
  2525. var namedCaptures = result.groups;
  2526. if (functionalReplace) {
  2527. var replacerArgs = concat([matched], captures, position, S);
  2528. if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
  2529. var replacement = toString$6(apply(replaceValue, undefined, replacerArgs));
  2530. } else {
  2531. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2532. }
  2533. if (position >= nextSourcePosition) {
  2534. accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
  2535. nextSourcePosition = position + matched.length;
  2536. }
  2537. }
  2538. return accumulatedResult + stringSlice$2(S, nextSourcePosition);
  2539. }
  2540. ];
  2541. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  2542. var $$a = _export;
  2543. var $filter = arrayIteration.filter;
  2544. var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
  2545. var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
  2546. // `Array.prototype.filter` method
  2547. // https://tc39.es/ecma262/#sec-array.prototype.filter
  2548. // with adding support of @@species
  2549. $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
  2550. filter: function filter(callbackfn /* , thisArg */) {
  2551. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2552. }
  2553. });
  2554. // `SameValue` abstract operation
  2555. // https://tc39.es/ecma262/#sec-samevalue
  2556. // eslint-disable-next-line es/no-object-is -- safe
  2557. var sameValue$1 = Object.is || function is(x, y) {
  2558. // eslint-disable-next-line no-self-compare -- NaN check
  2559. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  2560. };
  2561. var call$3 = functionCall;
  2562. var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
  2563. var anObject$3 = anObject$d;
  2564. var isNullOrUndefined$1 = isNullOrUndefined$7;
  2565. var requireObjectCoercible$3 = requireObjectCoercible$b;
  2566. var sameValue = sameValue$1;
  2567. var toString$5 = toString$f;
  2568. var getMethod$1 = getMethod$5;
  2569. var regExpExec$1 = regexpExecAbstract;
  2570. // @@search logic
  2571. fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeCallNative) {
  2572. return [
  2573. // `String.prototype.search` method
  2574. // https://tc39.es/ecma262/#sec-string.prototype.search
  2575. function search(regexp) {
  2576. var O = requireObjectCoercible$3(this);
  2577. var searcher = isNullOrUndefined$1(regexp) ? undefined : getMethod$1(regexp, SEARCH);
  2578. return searcher ? call$3(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$5(O));
  2579. },
  2580. // `RegExp.prototype[@@search]` method
  2581. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  2582. function (string) {
  2583. var rx = anObject$3(this);
  2584. var S = toString$5(string);
  2585. var res = maybeCallNative(nativeSearch, rx, S);
  2586. if (res.done) return res.value;
  2587. var previousLastIndex = rx.lastIndex;
  2588. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  2589. var result = regExpExec$1(rx, S);
  2590. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  2591. return result === null ? -1 : result.index;
  2592. }
  2593. ];
  2594. });
  2595. var global$4 = global$j;
  2596. var fails$6 = fails$u;
  2597. var uncurryThis$8 = functionUncurryThis;
  2598. var toString$4 = toString$f;
  2599. var trim$1 = stringTrim.trim;
  2600. var whitespaces = whitespaces$4;
  2601. var $parseInt$1 = global$4.parseInt;
  2602. var Symbol$1 = global$4.Symbol;
  2603. var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
  2604. var hex = /^[+-]?0x/i;
  2605. var exec$1 = uncurryThis$8(hex.exec);
  2606. var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
  2607. // MS Edge 18- broken with boxed symbols
  2608. || (ITERATOR$3 && !fails$6(function () { $parseInt$1(Object(ITERATOR$3)); }));
  2609. // `parseInt` method
  2610. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2611. var numberParseInt = FORCED ? function parseInt(string, radix) {
  2612. var S = trim$1(toString$4(string));
  2613. return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
  2614. } : $parseInt$1;
  2615. var $$9 = _export;
  2616. var $parseInt = numberParseInt;
  2617. // `parseInt` method
  2618. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2619. $$9({ global: true, forced: parseInt != $parseInt }, {
  2620. parseInt: $parseInt
  2621. });
  2622. var $$8 = _export;
  2623. var $map = arrayIteration.map;
  2624. var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
  2625. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
  2626. // `Array.prototype.map` method
  2627. // https://tc39.es/ecma262/#sec-array.prototype.map
  2628. // with adding support of @@species
  2629. $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  2630. map: function map(callbackfn /* , thisArg */) {
  2631. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2632. }
  2633. });
  2634. var $$7 = _export;
  2635. var $findIndex = arrayIteration.findIndex;
  2636. var addToUnscopables$1 = addToUnscopables$4;
  2637. var FIND_INDEX = 'findIndex';
  2638. var SKIPS_HOLES = true;
  2639. // Shouldn't skip holes
  2640. if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
  2641. // `Array.prototype.findIndex` method
  2642. // https://tc39.es/ecma262/#sec-array.prototype.findindex
  2643. $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  2644. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  2645. return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2646. }
  2647. });
  2648. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  2649. addToUnscopables$1(FIND_INDEX);
  2650. var isCallable$4 = isCallable$j;
  2651. var $String = String;
  2652. var $TypeError$1 = TypeError;
  2653. var aPossiblePrototype$1 = function (argument) {
  2654. if (typeof argument == 'object' || isCallable$4(argument)) return argument;
  2655. throw $TypeError$1("Can't set " + $String(argument) + ' as a prototype');
  2656. };
  2657. /* eslint-disable no-proto -- safe */
  2658. var uncurryThis$7 = functionUncurryThis;
  2659. var anObject$2 = anObject$d;
  2660. var aPossiblePrototype = aPossiblePrototype$1;
  2661. // `Object.setPrototypeOf` method
  2662. // https://tc39.es/ecma262/#sec-object.setprototypeof
  2663. // Works with __proto__ only. Old v8 can't work with null proto objects.
  2664. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  2665. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  2666. var CORRECT_SETTER = false;
  2667. var test = {};
  2668. var setter;
  2669. try {
  2670. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  2671. setter = uncurryThis$7(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
  2672. setter(test, []);
  2673. CORRECT_SETTER = test instanceof Array;
  2674. } catch (error) { /* empty */ }
  2675. return function setPrototypeOf(O, proto) {
  2676. anObject$2(O);
  2677. aPossiblePrototype(proto);
  2678. if (CORRECT_SETTER) setter(O, proto);
  2679. else O.__proto__ = proto;
  2680. return O;
  2681. };
  2682. }() : undefined);
  2683. var isCallable$3 = isCallable$j;
  2684. var isObject$2 = isObject$b;
  2685. var setPrototypeOf$1 = objectSetPrototypeOf;
  2686. // makes subclassing work correct for wrapped built-ins
  2687. var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
  2688. var NewTarget, NewTargetPrototype;
  2689. if (
  2690. // it can work only with native `setPrototypeOf`
  2691. setPrototypeOf$1 &&
  2692. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  2693. isCallable$3(NewTarget = dummy.constructor) &&
  2694. NewTarget !== Wrapper &&
  2695. isObject$2(NewTargetPrototype = NewTarget.prototype) &&
  2696. NewTargetPrototype !== Wrapper.prototype
  2697. ) setPrototypeOf$1($this, NewTargetPrototype);
  2698. return $this;
  2699. };
  2700. var call$2 = functionCall;
  2701. var hasOwn$4 = hasOwnProperty_1;
  2702. var isPrototypeOf$2 = objectIsPrototypeOf;
  2703. var regExpFlags = regexpFlags$1;
  2704. var RegExpPrototype$2 = RegExp.prototype;
  2705. var regexpGetFlags = function (R) {
  2706. var flags = R.flags;
  2707. return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$4(R, 'flags') && isPrototypeOf$2(RegExpPrototype$2, R)
  2708. ? call$2(regExpFlags, R) : flags;
  2709. };
  2710. var defineProperty$3 = objectDefineProperty.f;
  2711. var proxyAccessor$1 = function (Target, Source, key) {
  2712. key in Target || defineProperty$3(Target, key, {
  2713. configurable: true,
  2714. get: function () { return Source[key]; },
  2715. set: function (it) { Source[key] = it; }
  2716. });
  2717. };
  2718. var getBuiltIn = getBuiltIn$6;
  2719. var definePropertyModule = objectDefineProperty;
  2720. var wellKnownSymbol$6 = wellKnownSymbol$j;
  2721. var DESCRIPTORS$4 = descriptors;
  2722. var SPECIES$1 = wellKnownSymbol$6('species');
  2723. var setSpecies$1 = function (CONSTRUCTOR_NAME) {
  2724. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  2725. var defineProperty = definePropertyModule.f;
  2726. if (DESCRIPTORS$4 && Constructor && !Constructor[SPECIES$1]) {
  2727. defineProperty(Constructor, SPECIES$1, {
  2728. configurable: true,
  2729. get: function () { return this; }
  2730. });
  2731. }
  2732. };
  2733. var DESCRIPTORS$3 = descriptors;
  2734. var global$3 = global$j;
  2735. var uncurryThis$6 = functionUncurryThis;
  2736. var isForced$1 = isForced_1;
  2737. var inheritIfRequired$1 = inheritIfRequired$2;
  2738. var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
  2739. var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
  2740. var isPrototypeOf$1 = objectIsPrototypeOf;
  2741. var isRegExp = isRegexp;
  2742. var toString$3 = toString$f;
  2743. var getRegExpFlags$1 = regexpGetFlags;
  2744. var stickyHelpers = regexpStickyHelpers;
  2745. var proxyAccessor = proxyAccessor$1;
  2746. var defineBuiltIn$4 = defineBuiltIn$8;
  2747. var fails$5 = fails$u;
  2748. var hasOwn$3 = hasOwnProperty_1;
  2749. var enforceInternalState = internalState.enforce;
  2750. var setSpecies = setSpecies$1;
  2751. var wellKnownSymbol$5 = wellKnownSymbol$j;
  2752. var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
  2753. var UNSUPPORTED_NCG = regexpUnsupportedNcg;
  2754. var MATCH = wellKnownSymbol$5('match');
  2755. var NativeRegExp = global$3.RegExp;
  2756. var RegExpPrototype$1 = NativeRegExp.prototype;
  2757. var SyntaxError = global$3.SyntaxError;
  2758. var exec = uncurryThis$6(RegExpPrototype$1.exec);
  2759. var charAt = uncurryThis$6(''.charAt);
  2760. var replace = uncurryThis$6(''.replace);
  2761. var stringIndexOf = uncurryThis$6(''.indexOf);
  2762. var stringSlice$1 = uncurryThis$6(''.slice);
  2763. // TODO: Use only proper RegExpIdentifierName
  2764. var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  2765. var re1 = /a/g;
  2766. var re2 = /a/g;
  2767. // "new" should create a new object, old webkit bug
  2768. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2769. var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
  2770. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  2771. var BASE_FORCED = DESCRIPTORS$3 &&
  2772. (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$5(function () {
  2773. re2[MATCH] = false;
  2774. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2775. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  2776. }));
  2777. var handleDotAll = function (string) {
  2778. var length = string.length;
  2779. var index = 0;
  2780. var result = '';
  2781. var brackets = false;
  2782. var chr;
  2783. for (; index <= length; index++) {
  2784. chr = charAt(string, index);
  2785. if (chr === '\\') {
  2786. result += chr + charAt(string, ++index);
  2787. continue;
  2788. }
  2789. if (!brackets && chr === '.') {
  2790. result += '[\\s\\S]';
  2791. } else {
  2792. if (chr === '[') {
  2793. brackets = true;
  2794. } else if (chr === ']') {
  2795. brackets = false;
  2796. } result += chr;
  2797. }
  2798. } return result;
  2799. };
  2800. var handleNCG = function (string) {
  2801. var length = string.length;
  2802. var index = 0;
  2803. var result = '';
  2804. var named = [];
  2805. var names = {};
  2806. var brackets = false;
  2807. var ncg = false;
  2808. var groupid = 0;
  2809. var groupname = '';
  2810. var chr;
  2811. for (; index <= length; index++) {
  2812. chr = charAt(string, index);
  2813. if (chr === '\\') {
  2814. chr = chr + charAt(string, ++index);
  2815. } else if (chr === ']') {
  2816. brackets = false;
  2817. } else if (!brackets) switch (true) {
  2818. case chr === '[':
  2819. brackets = true;
  2820. break;
  2821. case chr === '(':
  2822. if (exec(IS_NCG, stringSlice$1(string, index + 1))) {
  2823. index += 2;
  2824. ncg = true;
  2825. }
  2826. result += chr;
  2827. groupid++;
  2828. continue;
  2829. case chr === '>' && ncg:
  2830. if (groupname === '' || hasOwn$3(names, groupname)) {
  2831. throw new SyntaxError('Invalid capture group name');
  2832. }
  2833. names[groupname] = true;
  2834. named[named.length] = [groupname, groupid];
  2835. ncg = false;
  2836. groupname = '';
  2837. continue;
  2838. }
  2839. if (ncg) groupname += chr;
  2840. else result += chr;
  2841. } return [result, named];
  2842. };
  2843. // `RegExp` constructor
  2844. // https://tc39.es/ecma262/#sec-regexp-constructor
  2845. if (isForced$1('RegExp', BASE_FORCED)) {
  2846. var RegExpWrapper = function RegExp(pattern, flags) {
  2847. var thisIsRegExp = isPrototypeOf$1(RegExpPrototype$1, this);
  2848. var patternIsRegExp = isRegExp(pattern);
  2849. var flagsAreUndefined = flags === undefined;
  2850. var groups = [];
  2851. var rawPattern = pattern;
  2852. var rawFlags, dotAll, sticky, handled, result, state;
  2853. if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
  2854. return pattern;
  2855. }
  2856. if (patternIsRegExp || isPrototypeOf$1(RegExpPrototype$1, pattern)) {
  2857. pattern = pattern.source;
  2858. if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
  2859. }
  2860. pattern = pattern === undefined ? '' : toString$3(pattern);
  2861. flags = flags === undefined ? '' : toString$3(flags);
  2862. rawPattern = pattern;
  2863. if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
  2864. dotAll = !!flags && stringIndexOf(flags, 's') > -1;
  2865. if (dotAll) flags = replace(flags, /s/g, '');
  2866. }
  2867. rawFlags = flags;
  2868. if (MISSED_STICKY && 'sticky' in re1) {
  2869. sticky = !!flags && stringIndexOf(flags, 'y') > -1;
  2870. if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');
  2871. }
  2872. if (UNSUPPORTED_NCG) {
  2873. handled = handleNCG(pattern);
  2874. pattern = handled[0];
  2875. groups = handled[1];
  2876. }
  2877. result = inheritIfRequired$1(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$1, RegExpWrapper);
  2878. if (dotAll || sticky || groups.length) {
  2879. state = enforceInternalState(result);
  2880. if (dotAll) {
  2881. state.dotAll = true;
  2882. state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
  2883. }
  2884. if (sticky) state.sticky = true;
  2885. if (groups.length) state.groups = groups;
  2886. }
  2887. if (pattern !== rawPattern) try {
  2888. // fails in old engines, but we have no alternatives for unsupported regex syntax
  2889. createNonEnumerableProperty$2(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
  2890. } catch (error) { /* empty */ }
  2891. return result;
  2892. };
  2893. for (var keys$1 = getOwnPropertyNames$1(NativeRegExp), index = 0; keys$1.length > index;) {
  2894. proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index++]);
  2895. }
  2896. RegExpPrototype$1.constructor = RegExpWrapper;
  2897. RegExpWrapper.prototype = RegExpPrototype$1;
  2898. defineBuiltIn$4(global$3, 'RegExp', RegExpWrapper, { constructor: true });
  2899. }
  2900. // https://tc39.es/ecma262/#sec-get-regexp-@@species
  2901. setSpecies('RegExp');
  2902. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  2903. var defineBuiltIn$3 = defineBuiltIn$8;
  2904. var anObject$1 = anObject$d;
  2905. var $toString = toString$f;
  2906. var fails$4 = fails$u;
  2907. var getRegExpFlags = regexpGetFlags;
  2908. var TO_STRING = 'toString';
  2909. var RegExpPrototype = RegExp.prototype;
  2910. var nativeToString = RegExpPrototype[TO_STRING];
  2911. var NOT_GENERIC = fails$4(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  2912. // FF44- RegExp#toString has a wrong name
  2913. var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING;
  2914. // `RegExp.prototype.toString` method
  2915. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  2916. if (NOT_GENERIC || INCORRECT_NAME) {
  2917. defineBuiltIn$3(RegExp.prototype, TO_STRING, function toString() {
  2918. var R = anObject$1(this);
  2919. var pattern = $toString(R.source);
  2920. var flags = $toString(getRegExpFlags(R));
  2921. return '/' + pattern + '/' + flags;
  2922. }, { unsafe: true });
  2923. }
  2924. var uncurryThis$5 = functionUncurryThis;
  2925. var arraySlice$1 = uncurryThis$5([].slice);
  2926. var $$6 = _export;
  2927. var isArray$2 = isArray$5;
  2928. var isConstructor = isConstructor$3;
  2929. var isObject$1 = isObject$b;
  2930. var toAbsoluteIndex$1 = toAbsoluteIndex$4;
  2931. var lengthOfArrayLike$1 = lengthOfArrayLike$7;
  2932. var toIndexedObject$1 = toIndexedObject$8;
  2933. var createProperty$1 = createProperty$4;
  2934. var wellKnownSymbol$4 = wellKnownSymbol$j;
  2935. var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
  2936. var nativeSlice = arraySlice$1;
  2937. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
  2938. var SPECIES = wellKnownSymbol$4('species');
  2939. var $Array = Array;
  2940. var max$1 = Math.max;
  2941. // `Array.prototype.slice` method
  2942. // https://tc39.es/ecma262/#sec-array.prototype.slice
  2943. // fallback for not array-like ES3 strings and DOM objects
  2944. $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  2945. slice: function slice(start, end) {
  2946. var O = toIndexedObject$1(this);
  2947. var length = lengthOfArrayLike$1(O);
  2948. var k = toAbsoluteIndex$1(start, length);
  2949. var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
  2950. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  2951. var Constructor, result, n;
  2952. if (isArray$2(O)) {
  2953. Constructor = O.constructor;
  2954. // cross-realm fallback
  2955. if (isConstructor(Constructor) && (Constructor === $Array || isArray$2(Constructor.prototype))) {
  2956. Constructor = undefined;
  2957. } else if (isObject$1(Constructor)) {
  2958. Constructor = Constructor[SPECIES];
  2959. if (Constructor === null) Constructor = undefined;
  2960. }
  2961. if (Constructor === $Array || Constructor === undefined) {
  2962. return nativeSlice(O, k, fin);
  2963. }
  2964. }
  2965. result = new (Constructor === undefined ? $Array : Constructor)(max$1(fin - k, 0));
  2966. for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
  2967. result.length = n;
  2968. return result;
  2969. }
  2970. });
  2971. var iterators = {};
  2972. var fails$3 = fails$u;
  2973. var correctPrototypeGetter = !fails$3(function () {
  2974. function F() { /* empty */ }
  2975. F.prototype.constructor = null;
  2976. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  2977. return Object.getPrototypeOf(new F()) !== F.prototype;
  2978. });
  2979. var hasOwn$2 = hasOwnProperty_1;
  2980. var isCallable$2 = isCallable$j;
  2981. var toObject$2 = toObject$9;
  2982. var sharedKey = sharedKey$3;
  2983. var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
  2984. var IE_PROTO = sharedKey('IE_PROTO');
  2985. var $Object = Object;
  2986. var ObjectPrototype = $Object.prototype;
  2987. // `Object.getPrototypeOf` method
  2988. // https://tc39.es/ecma262/#sec-object.getprototypeof
  2989. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  2990. var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
  2991. var object = toObject$2(O);
  2992. if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
  2993. var constructor = object.constructor;
  2994. if (isCallable$2(constructor) && object instanceof constructor) {
  2995. return constructor.prototype;
  2996. } return object instanceof $Object ? ObjectPrototype : null;
  2997. };
  2998. var fails$2 = fails$u;
  2999. var isCallable$1 = isCallable$j;
  3000. var isObject = isObject$b;
  3001. var getPrototypeOf$1 = objectGetPrototypeOf;
  3002. var defineBuiltIn$2 = defineBuiltIn$8;
  3003. var wellKnownSymbol$3 = wellKnownSymbol$j;
  3004. var ITERATOR$2 = wellKnownSymbol$3('iterator');
  3005. var BUGGY_SAFARI_ITERATORS$1 = false;
  3006. // `%IteratorPrototype%` object
  3007. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  3008. var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
  3009. /* eslint-disable es/no-array-prototype-keys -- safe */
  3010. if ([].keys) {
  3011. arrayIterator = [].keys();
  3012. // Safari 8 has buggy iterators w/o `next`
  3013. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
  3014. else {
  3015. PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
  3016. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
  3017. }
  3018. }
  3019. var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$2(function () {
  3020. var test = {};
  3021. // FF44- legacy iterators case
  3022. return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
  3023. });
  3024. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
  3025. // `%IteratorPrototype%[@@iterator]()` method
  3026. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  3027. if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
  3028. defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
  3029. return this;
  3030. });
  3031. }
  3032. var iteratorsCore = {
  3033. IteratorPrototype: IteratorPrototype$2,
  3034. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
  3035. };
  3036. var defineProperty$2 = objectDefineProperty.f;
  3037. var hasOwn$1 = hasOwnProperty_1;
  3038. var wellKnownSymbol$2 = wellKnownSymbol$j;
  3039. var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
  3040. var setToStringTag$2 = function (target, TAG, STATIC) {
  3041. if (target && !STATIC) target = target.prototype;
  3042. if (target && !hasOwn$1(target, TO_STRING_TAG$1)) {
  3043. defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
  3044. }
  3045. };
  3046. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  3047. var create = objectCreate;
  3048. var createPropertyDescriptor = createPropertyDescriptor$4;
  3049. var setToStringTag$1 = setToStringTag$2;
  3050. var Iterators$2 = iterators;
  3051. var returnThis$1 = function () { return this; };
  3052. var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  3053. var TO_STRING_TAG = NAME + ' Iterator';
  3054. IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  3055. setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
  3056. Iterators$2[TO_STRING_TAG] = returnThis$1;
  3057. return IteratorConstructor;
  3058. };
  3059. var $$5 = _export;
  3060. var call$1 = functionCall;
  3061. var FunctionName = functionName;
  3062. var isCallable = isCallable$j;
  3063. var createIteratorConstructor = iteratorCreateConstructor;
  3064. var getPrototypeOf = objectGetPrototypeOf;
  3065. var setPrototypeOf = objectSetPrototypeOf;
  3066. var setToStringTag = setToStringTag$2;
  3067. var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
  3068. var defineBuiltIn$1 = defineBuiltIn$8;
  3069. var wellKnownSymbol$1 = wellKnownSymbol$j;
  3070. var Iterators$1 = iterators;
  3071. var IteratorsCore = iteratorsCore;
  3072. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  3073. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  3074. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3075. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3076. var ITERATOR$1 = wellKnownSymbol$1('iterator');
  3077. var KEYS = 'keys';
  3078. var VALUES = 'values';
  3079. var ENTRIES = 'entries';
  3080. var returnThis = function () { return this; };
  3081. var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3082. createIteratorConstructor(IteratorConstructor, NAME, next);
  3083. var getIterationMethod = function (KIND) {
  3084. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3085. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3086. switch (KIND) {
  3087. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3088. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3089. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3090. } return function () { return new IteratorConstructor(this); };
  3091. };
  3092. var TO_STRING_TAG = NAME + ' Iterator';
  3093. var INCORRECT_VALUES_NAME = false;
  3094. var IterablePrototype = Iterable.prototype;
  3095. var nativeIterator = IterablePrototype[ITERATOR$1]
  3096. || IterablePrototype['@@iterator']
  3097. || DEFAULT && IterablePrototype[DEFAULT];
  3098. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3099. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3100. var CurrentIteratorPrototype, methods, KEY;
  3101. // fix native
  3102. if (anyNativeIterator) {
  3103. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3104. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3105. if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3106. if (setPrototypeOf) {
  3107. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3108. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
  3109. defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
  3110. }
  3111. }
  3112. // Set @@toStringTag to native iterators
  3113. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
  3114. }
  3115. }
  3116. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  3117. if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3118. if (CONFIGURABLE_FUNCTION_NAME) {
  3119. createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
  3120. } else {
  3121. INCORRECT_VALUES_NAME = true;
  3122. defaultIterator = function values() { return call$1(nativeIterator, this); };
  3123. }
  3124. }
  3125. // export additional methods
  3126. if (DEFAULT) {
  3127. methods = {
  3128. values: getIterationMethod(VALUES),
  3129. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3130. entries: getIterationMethod(ENTRIES)
  3131. };
  3132. if (FORCED) for (KEY in methods) {
  3133. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3134. defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
  3135. }
  3136. } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3137. }
  3138. // define iterator
  3139. if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
  3140. defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
  3141. }
  3142. Iterators$1[NAME] = defaultIterator;
  3143. return methods;
  3144. };
  3145. // `CreateIterResultObject` abstract operation
  3146. // https://tc39.es/ecma262/#sec-createiterresultobject
  3147. var createIterResultObject$1 = function (value, done) {
  3148. return { value: value, done: done };
  3149. };
  3150. var toIndexedObject = toIndexedObject$8;
  3151. var addToUnscopables = addToUnscopables$4;
  3152. var Iterators = iterators;
  3153. var InternalStateModule = internalState;
  3154. var defineProperty$1 = objectDefineProperty.f;
  3155. var defineIterator = iteratorDefine;
  3156. var createIterResultObject = createIterResultObject$1;
  3157. var DESCRIPTORS$2 = descriptors;
  3158. var ARRAY_ITERATOR = 'Array Iterator';
  3159. var setInternalState = InternalStateModule.set;
  3160. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  3161. // `Array.prototype.entries` method
  3162. // https://tc39.es/ecma262/#sec-array.prototype.entries
  3163. // `Array.prototype.keys` method
  3164. // https://tc39.es/ecma262/#sec-array.prototype.keys
  3165. // `Array.prototype.values` method
  3166. // https://tc39.es/ecma262/#sec-array.prototype.values
  3167. // `Array.prototype[@@iterator]` method
  3168. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  3169. // `CreateArrayIterator` internal method
  3170. // https://tc39.es/ecma262/#sec-createarrayiterator
  3171. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  3172. setInternalState(this, {
  3173. type: ARRAY_ITERATOR,
  3174. target: toIndexedObject(iterated), // target
  3175. index: 0, // next index
  3176. kind: kind // kind
  3177. });
  3178. // `%ArrayIteratorPrototype%.next` method
  3179. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  3180. }, function () {
  3181. var state = getInternalState(this);
  3182. var target = state.target;
  3183. var kind = state.kind;
  3184. var index = state.index++;
  3185. if (!target || index >= target.length) {
  3186. state.target = undefined;
  3187. return createIterResultObject(undefined, true);
  3188. }
  3189. if (kind == 'keys') return createIterResultObject(index, false);
  3190. if (kind == 'values') return createIterResultObject(target[index], false);
  3191. return createIterResultObject([index, target[index]], false);
  3192. }, 'values');
  3193. // argumentsList[@@iterator] is %ArrayProto_values%
  3194. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  3195. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  3196. var values = Iterators.Arguments = Iterators.Array;
  3197. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  3198. addToUnscopables('keys');
  3199. addToUnscopables('values');
  3200. addToUnscopables('entries');
  3201. // V8 ~ Chrome 45- bug
  3202. if (DESCRIPTORS$2 && values.name !== 'values') try {
  3203. defineProperty$1(values, 'name', { value: 'values' });
  3204. } catch (error) { /* empty */ }
  3205. var global$2 = global$j;
  3206. var DOMIterables = domIterables;
  3207. var DOMTokenListPrototype = domTokenListPrototype;
  3208. var ArrayIteratorMethods = es_array_iterator;
  3209. var createNonEnumerableProperty = createNonEnumerableProperty$7;
  3210. var wellKnownSymbol = wellKnownSymbol$j;
  3211. var ITERATOR = wellKnownSymbol('iterator');
  3212. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  3213. var ArrayValues = ArrayIteratorMethods.values;
  3214. var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
  3215. if (CollectionPrototype) {
  3216. // some Chrome versions have non-configurable methods on DOMTokenList
  3217. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  3218. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  3219. } catch (error) {
  3220. CollectionPrototype[ITERATOR] = ArrayValues;
  3221. }
  3222. if (!CollectionPrototype[TO_STRING_TAG]) {
  3223. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  3224. }
  3225. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  3226. // some Chrome versions have non-configurable methods on DOMTokenList
  3227. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  3228. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  3229. } catch (error) {
  3230. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  3231. }
  3232. }
  3233. }
  3234. };
  3235. for (var COLLECTION_NAME in DOMIterables) {
  3236. handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
  3237. }
  3238. handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
  3239. var DESCRIPTORS$1 = descriptors;
  3240. var isArray$1 = isArray$5;
  3241. var $TypeError = TypeError;
  3242. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  3243. var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
  3244. // Safari < 13 does not throw an error in this case
  3245. var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$1 && !function () {
  3246. // makes no sense without proper strict mode support
  3247. if (this !== undefined) return true;
  3248. try {
  3249. // eslint-disable-next-line es/no-object-defineproperty -- safe
  3250. Object.defineProperty([], 'length', { writable: false }).length = 1;
  3251. } catch (error) {
  3252. return error instanceof TypeError;
  3253. }
  3254. }();
  3255. var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  3256. if (isArray$1(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
  3257. throw $TypeError('Cannot set read only .length');
  3258. } return O.length = length;
  3259. } : function (O, length) {
  3260. return O.length = length;
  3261. };
  3262. var $$4 = _export;
  3263. var toObject$1 = toObject$9;
  3264. var toAbsoluteIndex = toAbsoluteIndex$4;
  3265. var toIntegerOrInfinity = toIntegerOrInfinity$5;
  3266. var lengthOfArrayLike = lengthOfArrayLike$7;
  3267. var setArrayLength = arraySetLength;
  3268. var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
  3269. var arraySpeciesCreate = arraySpeciesCreate$3;
  3270. var createProperty = createProperty$4;
  3271. var deletePropertyOrThrow = deletePropertyOrThrow$2;
  3272. var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
  3273. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  3274. var max = Math.max;
  3275. var min$2 = Math.min;
  3276. // `Array.prototype.splice` method
  3277. // https://tc39.es/ecma262/#sec-array.prototype.splice
  3278. // with adding support of @@species
  3279. $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  3280. splice: function splice(start, deleteCount /* , ...items */) {
  3281. var O = toObject$1(this);
  3282. var len = lengthOfArrayLike(O);
  3283. var actualStart = toAbsoluteIndex(start, len);
  3284. var argumentsLength = arguments.length;
  3285. var insertCount, actualDeleteCount, A, k, from, to;
  3286. if (argumentsLength === 0) {
  3287. insertCount = actualDeleteCount = 0;
  3288. } else if (argumentsLength === 1) {
  3289. insertCount = 0;
  3290. actualDeleteCount = len - actualStart;
  3291. } else {
  3292. insertCount = argumentsLength - 2;
  3293. actualDeleteCount = min$2(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  3294. }
  3295. doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
  3296. A = arraySpeciesCreate(O, actualDeleteCount);
  3297. for (k = 0; k < actualDeleteCount; k++) {
  3298. from = actualStart + k;
  3299. if (from in O) createProperty(A, k, O[from]);
  3300. }
  3301. A.length = actualDeleteCount;
  3302. if (insertCount < actualDeleteCount) {
  3303. for (k = actualStart; k < len - actualDeleteCount; k++) {
  3304. from = k + actualDeleteCount;
  3305. to = k + insertCount;
  3306. if (from in O) O[to] = O[from];
  3307. else deletePropertyOrThrow(O, to);
  3308. }
  3309. for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
  3310. } else if (insertCount > actualDeleteCount) {
  3311. for (k = len - actualDeleteCount; k > actualStart; k--) {
  3312. from = k + actualDeleteCount - 1;
  3313. to = k + insertCount - 1;
  3314. if (from in O) O[to] = O[from];
  3315. else deletePropertyOrThrow(O, to);
  3316. }
  3317. }
  3318. for (k = 0; k < insertCount; k++) {
  3319. O[k + actualStart] = arguments[k + 2];
  3320. }
  3321. setArrayLength(O, len - actualDeleteCount + insertCount);
  3322. return A;
  3323. }
  3324. });
  3325. var uncurryThis$4 = functionUncurryThis;
  3326. // `thisNumberValue` abstract operation
  3327. // https://tc39.es/ecma262/#sec-thisnumbervalue
  3328. var thisNumberValue$1 = uncurryThis$4(1.0.valueOf);
  3329. var DESCRIPTORS = descriptors;
  3330. var global$1 = global$j;
  3331. var uncurryThis$3 = functionUncurryThis;
  3332. var isForced = isForced_1;
  3333. var defineBuiltIn = defineBuiltIn$8;
  3334. var hasOwn = hasOwnProperty_1;
  3335. var inheritIfRequired = inheritIfRequired$2;
  3336. var isPrototypeOf = objectIsPrototypeOf;
  3337. var isSymbol = isSymbol$3;
  3338. var toPrimitive = toPrimitive$2;
  3339. var fails$1 = fails$u;
  3340. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  3341. var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
  3342. var defineProperty = objectDefineProperty.f;
  3343. var thisNumberValue = thisNumberValue$1;
  3344. var trim = stringTrim.trim;
  3345. var NUMBER = 'Number';
  3346. var NativeNumber = global$1[NUMBER];
  3347. var NumberPrototype = NativeNumber.prototype;
  3348. var TypeError$1 = global$1.TypeError;
  3349. var arraySlice = uncurryThis$3(''.slice);
  3350. var charCodeAt = uncurryThis$3(''.charCodeAt);
  3351. // `ToNumeric` abstract operation
  3352. // https://tc39.es/ecma262/#sec-tonumeric
  3353. var toNumeric = function (value) {
  3354. var primValue = toPrimitive(value, 'number');
  3355. return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
  3356. };
  3357. // `ToNumber` abstract operation
  3358. // https://tc39.es/ecma262/#sec-tonumber
  3359. var toNumber = function (argument) {
  3360. var it = toPrimitive(argument, 'number');
  3361. var first, third, radix, maxCode, digits, length, index, code;
  3362. if (isSymbol(it)) throw TypeError$1('Cannot convert a Symbol value to a number');
  3363. if (typeof it == 'string' && it.length > 2) {
  3364. it = trim(it);
  3365. first = charCodeAt(it, 0);
  3366. if (first === 43 || first === 45) {
  3367. third = charCodeAt(it, 2);
  3368. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  3369. } else if (first === 48) {
  3370. switch (charCodeAt(it, 1)) {
  3371. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  3372. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  3373. default: return +it;
  3374. }
  3375. digits = arraySlice(it, 2);
  3376. length = digits.length;
  3377. for (index = 0; index < length; index++) {
  3378. code = charCodeAt(digits, index);
  3379. // parseInt parses a string to a first unavailable symbol
  3380. // but ToNumber should return NaN if a string contains unavailable symbols
  3381. if (code < 48 || code > maxCode) return NaN;
  3382. } return parseInt(digits, radix);
  3383. }
  3384. } return +it;
  3385. };
  3386. // `Number` constructor
  3387. // https://tc39.es/ecma262/#sec-number-constructor
  3388. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  3389. var NumberWrapper = function Number(value) {
  3390. var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  3391. var dummy = this;
  3392. // check on 1..constructor(foo) case
  3393. return isPrototypeOf(NumberPrototype, dummy) && fails$1(function () { thisNumberValue(dummy); })
  3394. ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
  3395. };
  3396. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  3397. // ES3:
  3398. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  3399. // ES2015 (in case, if modules with ES2015 Number statics required before):
  3400. 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
  3401. // ESNext
  3402. 'fromString,range'
  3403. ).split(','), j = 0, key; keys.length > j; j++) {
  3404. if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
  3405. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor$2(NativeNumber, key));
  3406. }
  3407. }
  3408. NumberWrapper.prototype = NumberPrototype;
  3409. NumberPrototype.constructor = NumberWrapper;
  3410. defineBuiltIn(global$1, NUMBER, NumberWrapper, { constructor: true });
  3411. }
  3412. var $$3 = _export;
  3413. var uncurryThis$2 = functionUncurryThis;
  3414. var isArray = isArray$5;
  3415. var nativeReverse = uncurryThis$2([].reverse);
  3416. var test = [1, 2];
  3417. // `Array.prototype.reverse` method
  3418. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  3419. // fix for Safari 12.0 bug
  3420. // https://bugs.webkit.org/show_bug.cgi?id=188794
  3421. $$3({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
  3422. reverse: function reverse() {
  3423. // eslint-disable-next-line no-self-assign -- dirty hack
  3424. if (isArray(this)) this.length = this.length;
  3425. return nativeReverse(this);
  3426. }
  3427. });
  3428. var $$2 = _export;
  3429. var toObject = toObject$9;
  3430. var nativeKeys = objectKeys$3;
  3431. var fails = fails$u;
  3432. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  3433. // `Object.keys` method
  3434. // https://tc39.es/ecma262/#sec-object.keys
  3435. $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  3436. keys: function keys(it) {
  3437. return nativeKeys(toObject(it));
  3438. }
  3439. });
  3440. var call = functionCall;
  3441. var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
  3442. var anObject = anObject$d;
  3443. var isNullOrUndefined = isNullOrUndefined$7;
  3444. var toLength$2 = toLength$6;
  3445. var toString$2 = toString$f;
  3446. var requireObjectCoercible$2 = requireObjectCoercible$b;
  3447. var getMethod = getMethod$5;
  3448. var advanceStringIndex = advanceStringIndex$3;
  3449. var regExpExec = regexpExecAbstract;
  3450. // @@match logic
  3451. fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  3452. return [
  3453. // `String.prototype.match` method
  3454. // https://tc39.es/ecma262/#sec-string.prototype.match
  3455. function match(regexp) {
  3456. var O = requireObjectCoercible$2(this);
  3457. var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
  3458. return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
  3459. },
  3460. // `RegExp.prototype[@@match]` method
  3461. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  3462. function (string) {
  3463. var rx = anObject(this);
  3464. var S = toString$2(string);
  3465. var res = maybeCallNative(nativeMatch, rx, S);
  3466. if (res.done) return res.value;
  3467. if (!rx.global) return regExpExec(rx, S);
  3468. var fullUnicode = rx.unicode;
  3469. rx.lastIndex = 0;
  3470. var A = [];
  3471. var n = 0;
  3472. var result;
  3473. while ((result = regExpExec(rx, S)) !== null) {
  3474. var matchStr = toString$2(result[0]);
  3475. A[n] = matchStr;
  3476. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
  3477. n++;
  3478. }
  3479. return n === 0 ? null : A;
  3480. }
  3481. ];
  3482. });
  3483. var $$1 = _export;
  3484. var uncurryThis$1 = functionUncurryThis;
  3485. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  3486. var toLength$1 = toLength$6;
  3487. var toString$1 = toString$f;
  3488. var notARegExp$1 = notARegexp;
  3489. var requireObjectCoercible$1 = requireObjectCoercible$b;
  3490. var correctIsRegExpLogic$1 = correctIsRegexpLogic;
  3491. // eslint-disable-next-line es/no-string-prototype-startswith -- safe
  3492. var nativeStartsWith = uncurryThis$1(''.startsWith);
  3493. var stringSlice = uncurryThis$1(''.slice);
  3494. var min$1 = Math.min;
  3495. var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('startsWith');
  3496. // https://github.com/zloirock/core-js/pull/702
  3497. var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
  3498. var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
  3499. return descriptor && !descriptor.writable;
  3500. }();
  3501. // `String.prototype.startsWith` method
  3502. // https://tc39.es/ecma262/#sec-string.prototype.startswith
  3503. $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
  3504. startsWith: function startsWith(searchString /* , position = 0 */) {
  3505. var that = toString$1(requireObjectCoercible$1(this));
  3506. notARegExp$1(searchString);
  3507. var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
  3508. var search = toString$1(searchString);
  3509. return nativeStartsWith
  3510. ? nativeStartsWith(that, search, index)
  3511. : stringSlice(that, index, index + search.length) === search;
  3512. }
  3513. });
  3514. var $ = _export;
  3515. var uncurryThis = functionUncurryThis;
  3516. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  3517. var toLength = toLength$6;
  3518. var toString = toString$f;
  3519. var notARegExp = notARegexp;
  3520. var requireObjectCoercible = requireObjectCoercible$b;
  3521. var correctIsRegExpLogic = correctIsRegexpLogic;
  3522. // eslint-disable-next-line es/no-string-prototype-endswith -- safe
  3523. var nativeEndsWith = uncurryThis(''.endsWith);
  3524. var slice = uncurryThis(''.slice);
  3525. var min = Math.min;
  3526. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
  3527. // https://github.com/zloirock/core-js/pull/702
  3528. var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
  3529. var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
  3530. return descriptor && !descriptor.writable;
  3531. }();
  3532. // `String.prototype.endsWith` method
  3533. // https://tc39.es/ecma262/#sec-string.prototype.endswith
  3534. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  3535. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  3536. var that = toString(requireObjectCoercible(this));
  3537. notARegExp(searchString);
  3538. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  3539. var len = that.length;
  3540. var end = endPosition === undefined ? len : min(toLength(endPosition), len);
  3541. var search = toString(searchString);
  3542. return nativeEndsWith
  3543. ? nativeEndsWith(that, search, end)
  3544. : slice(that, end - search.length, end) === search;
  3545. }
  3546. });
  3547. var Utils = {
  3548. getBootstrapVersion: function getBootstrapVersion() {
  3549. var bootstrapVersion = 5;
  3550. try {
  3551. var rawVersion = $__default["default"].fn.dropdown.Constructor.VERSION;
  3552. // Only try to parse VERSION if it is defined.
  3553. // It is undefined in older versions of Bootstrap (tested with 3.1.1).
  3554. if (rawVersion !== undefined) {
  3555. bootstrapVersion = parseInt(rawVersion, 10);
  3556. }
  3557. } catch (e) {
  3558. // ignore
  3559. }
  3560. try {
  3561. // eslint-disable-next-line no-undef
  3562. var _rawVersion = bootstrap.Tooltip.VERSION;
  3563. if (_rawVersion !== undefined) {
  3564. bootstrapVersion = parseInt(_rawVersion, 10);
  3565. }
  3566. } catch (e) {
  3567. // ignore
  3568. }
  3569. return bootstrapVersion;
  3570. },
  3571. getIconsPrefix: function getIconsPrefix(theme) {
  3572. return {
  3573. bootstrap3: 'glyphicon',
  3574. bootstrap4: 'fa',
  3575. bootstrap5: 'bi',
  3576. 'bootstrap-table': 'icon',
  3577. bulma: 'fa',
  3578. foundation: 'fa',
  3579. materialize: 'material-icons',
  3580. semantic: 'fa'
  3581. }[theme] || 'fa';
  3582. },
  3583. getIcons: function getIcons(prefix) {
  3584. return {
  3585. glyphicon: {
  3586. paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
  3587. paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
  3588. refresh: 'glyphicon-refresh icon-refresh',
  3589. toggleOff: 'glyphicon-list-alt icon-list-alt',
  3590. toggleOn: 'glyphicon-list-alt icon-list-alt',
  3591. columns: 'glyphicon-th icon-th',
  3592. detailOpen: 'glyphicon-plus icon-plus',
  3593. detailClose: 'glyphicon-minus icon-minus',
  3594. fullscreen: 'glyphicon-fullscreen',
  3595. search: 'glyphicon-search',
  3596. clearSearch: 'glyphicon-trash'
  3597. },
  3598. fa: {
  3599. paginationSwitchDown: 'fa-caret-square-down',
  3600. paginationSwitchUp: 'fa-caret-square-up',
  3601. refresh: 'fa-sync',
  3602. toggleOff: 'fa-toggle-off',
  3603. toggleOn: 'fa-toggle-on',
  3604. columns: 'fa-th-list',
  3605. detailOpen: 'fa-plus',
  3606. detailClose: 'fa-minus',
  3607. fullscreen: 'fa-arrows-alt',
  3608. search: 'fa-search',
  3609. clearSearch: 'fa-trash'
  3610. },
  3611. bi: {
  3612. paginationSwitchDown: 'bi-caret-down-square',
  3613. paginationSwitchUp: 'bi-caret-up-square',
  3614. refresh: 'bi-arrow-clockwise',
  3615. toggleOff: 'bi-toggle-off',
  3616. toggleOn: 'bi-toggle-on',
  3617. columns: 'bi-list-ul',
  3618. detailOpen: 'bi-plus',
  3619. detailClose: 'bi-dash',
  3620. fullscreen: 'bi-arrows-move',
  3621. search: 'bi-search',
  3622. clearSearch: 'bi-trash'
  3623. },
  3624. icon: {
  3625. paginationSwitchDown: 'icon-arrow-up-circle',
  3626. paginationSwitchUp: 'icon-arrow-down-circle',
  3627. refresh: 'icon-refresh-cw',
  3628. toggleOff: 'icon-toggle-right',
  3629. toggleOn: 'icon-toggle-right',
  3630. columns: 'icon-list',
  3631. detailOpen: 'icon-plus',
  3632. detailClose: 'icon-minus',
  3633. fullscreen: 'icon-maximize',
  3634. search: 'icon-search',
  3635. clearSearch: 'icon-trash-2'
  3636. },
  3637. 'material-icons': {
  3638. paginationSwitchDown: 'grid_on',
  3639. paginationSwitchUp: 'grid_off',
  3640. refresh: 'refresh',
  3641. toggleOff: 'tablet',
  3642. toggleOn: 'tablet_android',
  3643. columns: 'view_list',
  3644. detailOpen: 'add',
  3645. detailClose: 'remove',
  3646. fullscreen: 'fullscreen',
  3647. sort: 'sort',
  3648. search: 'search',
  3649. clearSearch: 'delete'
  3650. }
  3651. }[prefix];
  3652. },
  3653. getSearchInput: function getSearchInput(that) {
  3654. if (typeof that.options.searchSelector === 'string') {
  3655. return $__default["default"](that.options.searchSelector);
  3656. }
  3657. return that.$toolbar.find('.search input');
  3658. },
  3659. // it only does '%s', and return '' when arguments are undefined
  3660. sprintf: function sprintf(_str) {
  3661. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  3662. args[_key - 1] = arguments[_key];
  3663. }
  3664. var flag = true;
  3665. var i = 0;
  3666. var str = _str.replace(/%s/g, function () {
  3667. var arg = args[i++];
  3668. if (typeof arg === 'undefined') {
  3669. flag = false;
  3670. return '';
  3671. }
  3672. return arg;
  3673. });
  3674. return flag ? str : '';
  3675. },
  3676. isObject: function isObject(val) {
  3677. return val instanceof Object && !Array.isArray(val);
  3678. },
  3679. isEmptyObject: function isEmptyObject() {
  3680. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3681. return Object.entries(obj).length === 0 && obj.constructor === Object;
  3682. },
  3683. isNumeric: function isNumeric(n) {
  3684. return !isNaN(parseFloat(n)) && isFinite(n);
  3685. },
  3686. getFieldTitle: function getFieldTitle(list, value) {
  3687. var _iterator = _createForOfIteratorHelper(list),
  3688. _step;
  3689. try {
  3690. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  3691. var item = _step.value;
  3692. if (item.field === value) {
  3693. return item.title;
  3694. }
  3695. }
  3696. } catch (err) {
  3697. _iterator.e(err);
  3698. } finally {
  3699. _iterator.f();
  3700. }
  3701. return '';
  3702. },
  3703. setFieldIndex: function setFieldIndex(columns) {
  3704. var totalCol = 0;
  3705. var flag = [];
  3706. var _iterator2 = _createForOfIteratorHelper(columns[0]),
  3707. _step2;
  3708. try {
  3709. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  3710. var column = _step2.value;
  3711. totalCol += column.colspan || 1;
  3712. }
  3713. } catch (err) {
  3714. _iterator2.e(err);
  3715. } finally {
  3716. _iterator2.f();
  3717. }
  3718. for (var i = 0; i < columns.length; i++) {
  3719. flag[i] = [];
  3720. for (var j = 0; j < totalCol; j++) {
  3721. flag[i][j] = false;
  3722. }
  3723. }
  3724. for (var _i = 0; _i < columns.length; _i++) {
  3725. var _iterator3 = _createForOfIteratorHelper(columns[_i]),
  3726. _step3;
  3727. try {
  3728. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  3729. var r = _step3.value;
  3730. var rowspan = r.rowspan || 1;
  3731. var colspan = r.colspan || 1;
  3732. var index = flag[_i].indexOf(false);
  3733. r.colspanIndex = index;
  3734. if (colspan === 1) {
  3735. r.fieldIndex = index;
  3736. // when field is undefined, use index instead
  3737. if (typeof r.field === 'undefined') {
  3738. r.field = index;
  3739. }
  3740. } else {
  3741. r.colspanGroup = r.colspan;
  3742. }
  3743. for (var _j = 0; _j < rowspan; _j++) {
  3744. for (var k = 0; k < colspan; k++) {
  3745. flag[_i + _j][index + k] = true;
  3746. }
  3747. }
  3748. }
  3749. } catch (err) {
  3750. _iterator3.e(err);
  3751. } finally {
  3752. _iterator3.f();
  3753. }
  3754. }
  3755. },
  3756. normalizeAccent: function normalizeAccent(value) {
  3757. if (typeof value !== 'string') {
  3758. return value;
  3759. }
  3760. return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
  3761. },
  3762. updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
  3763. var _ref;
  3764. var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
  3765. var _iterator4 = _createForOfIteratorHelper(columns),
  3766. _step4;
  3767. try {
  3768. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  3769. var c = _step4.value;
  3770. var _iterator6 = _createForOfIteratorHelper(c),
  3771. _step6;
  3772. try {
  3773. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  3774. var r = _step6.value;
  3775. if (r.colspanGroup > 1) {
  3776. var colspan = 0;
  3777. var _loop = function _loop(i) {
  3778. var column = allColumns.find(function (col) {
  3779. return col.fieldIndex === i;
  3780. });
  3781. if (column.visible) {
  3782. colspan++;
  3783. }
  3784. };
  3785. for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
  3786. _loop(i);
  3787. }
  3788. r.colspan = colspan;
  3789. r.visible = colspan > 0;
  3790. }
  3791. }
  3792. } catch (err) {
  3793. _iterator6.e(err);
  3794. } finally {
  3795. _iterator6.f();
  3796. }
  3797. }
  3798. } catch (err) {
  3799. _iterator4.e(err);
  3800. } finally {
  3801. _iterator4.f();
  3802. }
  3803. if (columns.length < 2) {
  3804. return;
  3805. }
  3806. var _iterator5 = _createForOfIteratorHelper(fieldColumns),
  3807. _step5;
  3808. try {
  3809. var _loop2 = function _loop2() {
  3810. var column = _step5.value;
  3811. var sameColumns = allColumns.filter(function (col) {
  3812. return col.fieldIndex === column.fieldIndex;
  3813. });
  3814. if (sameColumns.length > 1) {
  3815. var _iterator7 = _createForOfIteratorHelper(sameColumns),
  3816. _step7;
  3817. try {
  3818. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  3819. var _c = _step7.value;
  3820. _c.visible = column.visible;
  3821. }
  3822. } catch (err) {
  3823. _iterator7.e(err);
  3824. } finally {
  3825. _iterator7.f();
  3826. }
  3827. }
  3828. };
  3829. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  3830. _loop2();
  3831. }
  3832. } catch (err) {
  3833. _iterator5.e(err);
  3834. } finally {
  3835. _iterator5.f();
  3836. }
  3837. },
  3838. getScrollBarWidth: function getScrollBarWidth() {
  3839. if (this.cachedWidth === undefined) {
  3840. var $inner = $__default["default"]('<div/>').addClass('fixed-table-scroll-inner');
  3841. var $outer = $__default["default"]('<div/>').addClass('fixed-table-scroll-outer');
  3842. $outer.append($inner);
  3843. $__default["default"]('body').append($outer);
  3844. var w1 = $inner[0].offsetWidth;
  3845. $outer.css('overflow', 'scroll');
  3846. var w2 = $inner[0].offsetWidth;
  3847. if (w1 === w2) {
  3848. w2 = $outer[0].clientWidth;
  3849. }
  3850. $outer.remove();
  3851. this.cachedWidth = w1 - w2;
  3852. }
  3853. return this.cachedWidth;
  3854. },
  3855. calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
  3856. var func = name;
  3857. if (typeof name === 'string') {
  3858. // support obj.func1.func2
  3859. var names = name.split('.');
  3860. if (names.length > 1) {
  3861. func = window;
  3862. var _iterator8 = _createForOfIteratorHelper(names),
  3863. _step8;
  3864. try {
  3865. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  3866. var f = _step8.value;
  3867. func = func[f];
  3868. }
  3869. } catch (err) {
  3870. _iterator8.e(err);
  3871. } finally {
  3872. _iterator8.f();
  3873. }
  3874. } else {
  3875. func = window[name];
  3876. }
  3877. }
  3878. if (func !== null && _typeof(func) === 'object') {
  3879. return func;
  3880. }
  3881. if (typeof func === 'function') {
  3882. return func.apply(self, args || []);
  3883. }
  3884. if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
  3885. return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
  3886. }
  3887. return defaultValue;
  3888. },
  3889. compareObjects: function compareObjects(objectA, objectB, compareLength) {
  3890. var aKeys = Object.keys(objectA);
  3891. var bKeys = Object.keys(objectB);
  3892. if (compareLength && aKeys.length !== bKeys.length) {
  3893. return false;
  3894. }
  3895. for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
  3896. var key = _aKeys[_i2];
  3897. if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
  3898. return false;
  3899. }
  3900. }
  3901. return true;
  3902. },
  3903. regexCompare: function regexCompare(value, search) {
  3904. try {
  3905. var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
  3906. if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
  3907. return true;
  3908. }
  3909. } catch (e) {
  3910. return false;
  3911. }
  3912. return false;
  3913. },
  3914. escapeHTML: function escapeHTML(text) {
  3915. if (!text) {
  3916. return text;
  3917. }
  3918. return text.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
  3919. },
  3920. unescapeHTML: function unescapeHTML(text) {
  3921. if (typeof text !== 'string' || !text) {
  3922. return text;
  3923. }
  3924. return text.toString().replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, '\'');
  3925. },
  3926. removeHTML: function removeHTML(text) {
  3927. if (!text) {
  3928. return text;
  3929. }
  3930. return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
  3931. },
  3932. getRealDataAttr: function getRealDataAttr(dataAttr) {
  3933. for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
  3934. var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
  3935. attr = _Object$entries$_i[0],
  3936. value = _Object$entries$_i[1];
  3937. var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
  3938. if (auxAttr !== attr) {
  3939. dataAttr[auxAttr] = value;
  3940. delete dataAttr[attr];
  3941. }
  3942. }
  3943. return dataAttr;
  3944. },
  3945. getItemField: function getItemField(item, field, escape) {
  3946. var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
  3947. var value = item;
  3948. // use column escape if it is defined
  3949. if (typeof columnEscape !== 'undefined') {
  3950. escape = columnEscape;
  3951. }
  3952. if (typeof field !== 'string' || item.hasOwnProperty(field)) {
  3953. return escape ? this.escapeHTML(item[field]) : item[field];
  3954. }
  3955. var props = field.split('.');
  3956. var _iterator9 = _createForOfIteratorHelper(props),
  3957. _step9;
  3958. try {
  3959. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  3960. var p = _step9.value;
  3961. value = value && value[p];
  3962. }
  3963. } catch (err) {
  3964. _iterator9.e(err);
  3965. } finally {
  3966. _iterator9.f();
  3967. }
  3968. return escape ? this.escapeHTML(value) : value;
  3969. },
  3970. isIEBrowser: function isIEBrowser() {
  3971. return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
  3972. },
  3973. findIndex: function findIndex(items, item) {
  3974. var _iterator10 = _createForOfIteratorHelper(items),
  3975. _step10;
  3976. try {
  3977. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  3978. var it = _step10.value;
  3979. if (JSON.stringify(it) === JSON.stringify(item)) {
  3980. return items.indexOf(it);
  3981. }
  3982. }
  3983. } catch (err) {
  3984. _iterator10.e(err);
  3985. } finally {
  3986. _iterator10.f();
  3987. }
  3988. return -1;
  3989. },
  3990. trToData: function trToData(columns, $els) {
  3991. var _this = this;
  3992. var data = [];
  3993. var m = [];
  3994. $els.each(function (y, el) {
  3995. var $el = $__default["default"](el);
  3996. var row = {};
  3997. // save tr's id, class and data-* attributes
  3998. row._id = $el.attr('id');
  3999. row._class = $el.attr('class');
  4000. row._data = _this.getRealDataAttr($el.data());
  4001. row._style = $el.attr('style');
  4002. $el.find('>td,>th').each(function (_x, el) {
  4003. var $el = $__default["default"](el);
  4004. var cspan = +$el.attr('colspan') || 1;
  4005. var rspan = +$el.attr('rowspan') || 1;
  4006. var x = _x;
  4007. // skip already occupied cells in current row
  4008. for (; m[y] && m[y][x]; x++) {
  4009. // ignore
  4010. }
  4011. // mark matrix elements occupied by current cell with true
  4012. for (var tx = x; tx < x + cspan; tx++) {
  4013. for (var ty = y; ty < y + rspan; ty++) {
  4014. if (!m[ty]) {
  4015. // fill missing rows
  4016. m[ty] = [];
  4017. }
  4018. m[ty][tx] = true;
  4019. }
  4020. }
  4021. var field = columns[x].field;
  4022. row[field] = $el.html().trim();
  4023. // save td's id, class and data-* attributes
  4024. row["_".concat(field, "_id")] = $el.attr('id');
  4025. row["_".concat(field, "_class")] = $el.attr('class');
  4026. row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
  4027. row["_".concat(field, "_colspan")] = $el.attr('colspan');
  4028. row["_".concat(field, "_title")] = $el.attr('title');
  4029. row["_".concat(field, "_data")] = _this.getRealDataAttr($el.data());
  4030. row["_".concat(field, "_style")] = $el.attr('style');
  4031. });
  4032. data.push(row);
  4033. });
  4034. return data;
  4035. },
  4036. sort: function sort(a, b, order, options, aPosition, bPosition) {
  4037. if (a === undefined || a === null) {
  4038. a = '';
  4039. }
  4040. if (b === undefined || b === null) {
  4041. b = '';
  4042. }
  4043. if (options.sortStable && a === b) {
  4044. a = aPosition;
  4045. b = bPosition;
  4046. }
  4047. // If both values are numeric, do a numeric comparison
  4048. if (this.isNumeric(a) && this.isNumeric(b)) {
  4049. // Convert numerical values form string to float.
  4050. a = parseFloat(a);
  4051. b = parseFloat(b);
  4052. if (a < b) {
  4053. return order * -1;
  4054. }
  4055. if (a > b) {
  4056. return order;
  4057. }
  4058. return 0;
  4059. }
  4060. if (options.sortEmptyLast) {
  4061. if (a === '') {
  4062. return 1;
  4063. }
  4064. if (b === '') {
  4065. return -1;
  4066. }
  4067. }
  4068. if (a === b) {
  4069. return 0;
  4070. }
  4071. // If value is not a string, convert to string
  4072. if (typeof a !== 'string') {
  4073. a = a.toString();
  4074. }
  4075. if (a.localeCompare(b) === -1) {
  4076. return order * -1;
  4077. }
  4078. return order;
  4079. },
  4080. getEventName: function getEventName(eventPrefix) {
  4081. var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  4082. id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
  4083. return "".concat(eventPrefix, "-").concat(id);
  4084. },
  4085. hasDetailViewIcon: function hasDetailViewIcon(options) {
  4086. return options.detailView && options.detailViewIcon && !options.cardView;
  4087. },
  4088. getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
  4089. return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
  4090. },
  4091. checkAutoMergeCells: function checkAutoMergeCells(data) {
  4092. var _iterator11 = _createForOfIteratorHelper(data),
  4093. _step11;
  4094. try {
  4095. for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
  4096. var row = _step11.value;
  4097. for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
  4098. var key = _Object$keys[_i4];
  4099. if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
  4100. return true;
  4101. }
  4102. }
  4103. }
  4104. } catch (err) {
  4105. _iterator11.e(err);
  4106. } finally {
  4107. _iterator11.f();
  4108. }
  4109. return false;
  4110. },
  4111. deepCopy: function deepCopy(arg) {
  4112. if (arg === undefined) {
  4113. return arg;
  4114. }
  4115. return $__default["default"].extend(true, Array.isArray(arg) ? [] : {}, arg);
  4116. },
  4117. debounce: function debounce(func, wait, immediate) {
  4118. var timeout;
  4119. return function executedFunction() {
  4120. var context = this;
  4121. var args = arguments;
  4122. var later = function later() {
  4123. timeout = null;
  4124. if (!immediate) func.apply(context, args);
  4125. };
  4126. var callNow = immediate && !timeout;
  4127. clearTimeout(timeout);
  4128. timeout = setTimeout(later, wait);
  4129. if (callNow) func.apply(context, args);
  4130. };
  4131. }
  4132. };
  4133. var VERSION = '1.21.2';
  4134. var bootstrapVersion = Utils.getBootstrapVersion();
  4135. var CONSTANTS = {
  4136. 3: {
  4137. classes: {
  4138. buttonsPrefix: 'btn',
  4139. buttons: 'default',
  4140. buttonsGroup: 'btn-group',
  4141. buttonsDropdown: 'btn-group',
  4142. pull: 'pull',
  4143. inputGroup: 'input-group',
  4144. inputPrefix: 'input-',
  4145. input: 'form-control',
  4146. select: 'form-control',
  4147. paginationDropdown: 'btn-group dropdown',
  4148. dropup: 'dropup',
  4149. dropdownActive: 'active',
  4150. paginationActive: 'active',
  4151. buttonActive: 'active'
  4152. },
  4153. html: {
  4154. toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4155. toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
  4156. toolbarDropdownSeparator: '<li class="divider"></li>',
  4157. pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4158. pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
  4159. dropdownCaret: '<span class="caret"></span>',
  4160. pagination: ['<ul class="pagination%s">', '</ul>'],
  4161. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4162. icon: '<i class="%s %s"></i>',
  4163. inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
  4164. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4165. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4166. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4167. }
  4168. },
  4169. 4: {
  4170. classes: {
  4171. buttonsPrefix: 'btn',
  4172. buttons: 'secondary',
  4173. buttonsGroup: 'btn-group',
  4174. buttonsDropdown: 'btn-group',
  4175. pull: 'float',
  4176. inputGroup: 'btn-group',
  4177. inputPrefix: 'form-control-',
  4178. input: 'form-control',
  4179. select: 'form-control',
  4180. paginationDropdown: 'btn-group dropdown',
  4181. dropup: 'dropup',
  4182. dropdownActive: 'active',
  4183. paginationActive: 'active',
  4184. buttonActive: 'active'
  4185. },
  4186. html: {
  4187. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
  4188. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4189. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4190. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4191. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4192. dropdownCaret: '<span class="caret"></span>',
  4193. pagination: ['<ul class="pagination%s">', '</ul>'],
  4194. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4195. icon: '<i class="%s %s"></i>',
  4196. inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
  4197. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4198. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4199. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4200. }
  4201. },
  4202. 5: {
  4203. classes: {
  4204. buttonsPrefix: 'btn',
  4205. buttons: 'secondary',
  4206. buttonsGroup: 'btn-group',
  4207. buttonsDropdown: 'btn-group',
  4208. pull: 'float',
  4209. inputGroup: 'btn-group',
  4210. inputPrefix: 'form-control-',
  4211. input: 'form-control',
  4212. select: 'form-select',
  4213. paginationDropdown: 'btn-group dropdown',
  4214. dropup: 'dropup',
  4215. dropdownActive: 'active',
  4216. paginationActive: 'active',
  4217. buttonActive: 'active'
  4218. },
  4219. html: {
  4220. dataToggle: 'data-bs-toggle',
  4221. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
  4222. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4223. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4224. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4225. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4226. dropdownCaret: '<span class="caret"></span>',
  4227. pagination: ['<ul class="pagination%s">', '</ul>'],
  4228. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4229. icon: '<i class="%s %s"></i>',
  4230. inputGroup: '<div class="input-group">%s%s</div>',
  4231. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4232. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4233. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4234. }
  4235. }
  4236. }[bootstrapVersion];
  4237. var DEFAULTS = {
  4238. height: undefined,
  4239. classes: 'table table-bordered table-hover',
  4240. buttons: {},
  4241. theadClasses: '',
  4242. headerStyle: function headerStyle(column) {
  4243. return {};
  4244. },
  4245. rowStyle: function rowStyle(row, index) {
  4246. return {};
  4247. },
  4248. rowAttributes: function rowAttributes(row, index) {
  4249. return {};
  4250. },
  4251. undefinedText: '-',
  4252. locale: undefined,
  4253. virtualScroll: false,
  4254. virtualScrollItemHeight: undefined,
  4255. sortable: true,
  4256. sortClass: undefined,
  4257. silentSort: true,
  4258. sortEmptyLast: false,
  4259. sortName: undefined,
  4260. sortOrder: undefined,
  4261. sortReset: false,
  4262. sortStable: false,
  4263. sortResetPage: false,
  4264. rememberOrder: false,
  4265. serverSort: true,
  4266. customSort: undefined,
  4267. columns: [[]],
  4268. data: [],
  4269. url: undefined,
  4270. method: 'get',
  4271. cache: true,
  4272. contentType: 'application/json',
  4273. dataType: 'json',
  4274. ajax: undefined,
  4275. ajaxOptions: {},
  4276. queryParams: function queryParams(params) {
  4277. return params;
  4278. },
  4279. queryParamsType: 'limit',
  4280. // 'limit', undefined
  4281. responseHandler: function responseHandler(res) {
  4282. return res;
  4283. },
  4284. totalField: 'total',
  4285. totalNotFilteredField: 'totalNotFiltered',
  4286. dataField: 'rows',
  4287. footerField: 'footer',
  4288. pagination: false,
  4289. paginationParts: ['pageInfo', 'pageSize', 'pageList'],
  4290. showExtendedPagination: false,
  4291. paginationLoop: true,
  4292. sidePagination: 'client',
  4293. // client or server
  4294. totalRows: 0,
  4295. totalNotFiltered: 0,
  4296. pageNumber: 1,
  4297. pageSize: 10,
  4298. pageList: [10, 25, 50, 100],
  4299. paginationHAlign: 'right',
  4300. // right, left
  4301. paginationVAlign: 'bottom',
  4302. // bottom, top, both
  4303. paginationDetailHAlign: 'left',
  4304. // right, left
  4305. paginationPreText: '&lsaquo;',
  4306. paginationNextText: '&rsaquo;',
  4307. paginationSuccessivelySize: 5,
  4308. // Maximum successively number of pages in a row
  4309. paginationPagesBySide: 1,
  4310. // Number of pages on each side (right, left) of the current page.
  4311. paginationUseIntermediate: false,
  4312. // Calculate intermediate pages for quick access
  4313. search: false,
  4314. searchHighlight: false,
  4315. searchOnEnterKey: false,
  4316. strictSearch: false,
  4317. regexSearch: false,
  4318. searchSelector: false,
  4319. visibleSearch: false,
  4320. showButtonIcons: true,
  4321. showButtonText: false,
  4322. showSearchButton: false,
  4323. showSearchClearButton: false,
  4324. trimOnSearch: true,
  4325. searchAlign: 'right',
  4326. searchTimeOut: 500,
  4327. searchText: '',
  4328. customSearch: undefined,
  4329. showHeader: true,
  4330. showFooter: false,
  4331. footerStyle: function footerStyle(column) {
  4332. return {};
  4333. },
  4334. searchAccentNeutralise: false,
  4335. showColumns: false,
  4336. showColumnsToggleAll: false,
  4337. showColumnsSearch: false,
  4338. minimumCountColumns: 1,
  4339. showPaginationSwitch: false,
  4340. showRefresh: false,
  4341. showToggle: false,
  4342. showFullscreen: false,
  4343. smartDisplay: true,
  4344. escape: false,
  4345. filterOptions: {
  4346. filterAlgorithm: 'and'
  4347. },
  4348. idField: undefined,
  4349. selectItemName: 'btSelectItem',
  4350. clickToSelect: false,
  4351. ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
  4352. var tagName = _ref.tagName;
  4353. return ['A', 'BUTTON'].includes(tagName);
  4354. },
  4355. singleSelect: false,
  4356. checkboxHeader: true,
  4357. maintainMetaData: false,
  4358. multipleSelectRow: false,
  4359. uniqueId: undefined,
  4360. cardView: false,
  4361. detailView: false,
  4362. detailViewIcon: true,
  4363. detailViewByClick: false,
  4364. detailViewAlign: 'left',
  4365. detailFormatter: function detailFormatter(index, row) {
  4366. return '';
  4367. },
  4368. detailFilter: function detailFilter(index, row) {
  4369. return true;
  4370. },
  4371. toolbar: undefined,
  4372. toolbarAlign: 'left',
  4373. buttonsToolbar: undefined,
  4374. buttonsAlign: 'right',
  4375. buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
  4376. buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
  4377. buttonsClass: CONSTANTS.classes.buttons,
  4378. iconsPrefix: undefined,
  4379. // init in initConstants
  4380. icons: {},
  4381. // init in initConstants
  4382. iconSize: undefined,
  4383. loadingFontSize: 'auto',
  4384. loadingTemplate: function loadingTemplate(loadingMessage) {
  4385. return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
  4386. },
  4387. onAll: function onAll(name, args) {
  4388. return false;
  4389. },
  4390. onClickCell: function onClickCell(field, value, row, $element) {
  4391. return false;
  4392. },
  4393. onDblClickCell: function onDblClickCell(field, value, row, $element) {
  4394. return false;
  4395. },
  4396. onClickRow: function onClickRow(item, $element) {
  4397. return false;
  4398. },
  4399. onDblClickRow: function onDblClickRow(item, $element) {
  4400. return false;
  4401. },
  4402. onSort: function onSort(name, order) {
  4403. return false;
  4404. },
  4405. onCheck: function onCheck(row) {
  4406. return false;
  4407. },
  4408. onUncheck: function onUncheck(row) {
  4409. return false;
  4410. },
  4411. onCheckAll: function onCheckAll(rows) {
  4412. return false;
  4413. },
  4414. onUncheckAll: function onUncheckAll(rows) {
  4415. return false;
  4416. },
  4417. onCheckSome: function onCheckSome(rows) {
  4418. return false;
  4419. },
  4420. onUncheckSome: function onUncheckSome(rows) {
  4421. return false;
  4422. },
  4423. onLoadSuccess: function onLoadSuccess(data) {
  4424. return false;
  4425. },
  4426. onLoadError: function onLoadError(status) {
  4427. return false;
  4428. },
  4429. onColumnSwitch: function onColumnSwitch(field, checked) {
  4430. return false;
  4431. },
  4432. onColumnSwitchAll: function onColumnSwitchAll(checked) {
  4433. return false;
  4434. },
  4435. onPageChange: function onPageChange(number, size) {
  4436. return false;
  4437. },
  4438. onSearch: function onSearch(text) {
  4439. return false;
  4440. },
  4441. onToggle: function onToggle(cardView) {
  4442. return false;
  4443. },
  4444. onPreBody: function onPreBody(data) {
  4445. return false;
  4446. },
  4447. onPostBody: function onPostBody() {
  4448. return false;
  4449. },
  4450. onPostHeader: function onPostHeader() {
  4451. return false;
  4452. },
  4453. onPostFooter: function onPostFooter() {
  4454. return false;
  4455. },
  4456. onExpandRow: function onExpandRow(index, row, $detail) {
  4457. return false;
  4458. },
  4459. onCollapseRow: function onCollapseRow(index, row) {
  4460. return false;
  4461. },
  4462. onRefreshOptions: function onRefreshOptions(options) {
  4463. return false;
  4464. },
  4465. onRefresh: function onRefresh(params) {
  4466. return false;
  4467. },
  4468. onResetView: function onResetView() {
  4469. return false;
  4470. },
  4471. onScrollBody: function onScrollBody() {
  4472. return false;
  4473. },
  4474. onTogglePagination: function onTogglePagination(newState) {
  4475. return false;
  4476. },
  4477. onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
  4478. return false;
  4479. }
  4480. };
  4481. var EN = {
  4482. formatLoadingMessage: function formatLoadingMessage() {
  4483. return 'Loading, please wait';
  4484. },
  4485. formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
  4486. return "".concat(pageNumber, " rows per page");
  4487. },
  4488. formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
  4489. if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
  4490. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
  4491. }
  4492. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
  4493. },
  4494. formatSRPaginationPreText: function formatSRPaginationPreText() {
  4495. return 'previous page';
  4496. },
  4497. formatSRPaginationPageText: function formatSRPaginationPageText(page) {
  4498. return "to page ".concat(page);
  4499. },
  4500. formatSRPaginationNextText: function formatSRPaginationNextText() {
  4501. return 'next page';
  4502. },
  4503. formatDetailPagination: function formatDetailPagination(totalRows) {
  4504. return "Showing ".concat(totalRows, " rows");
  4505. },
  4506. formatSearch: function formatSearch() {
  4507. return 'Search';
  4508. },
  4509. formatClearSearch: function formatClearSearch() {
  4510. return 'Clear Search';
  4511. },
  4512. formatNoMatches: function formatNoMatches() {
  4513. return 'No matching records found';
  4514. },
  4515. formatPaginationSwitch: function formatPaginationSwitch() {
  4516. return 'Hide/Show pagination';
  4517. },
  4518. formatPaginationSwitchDown: function formatPaginationSwitchDown() {
  4519. return 'Show pagination';
  4520. },
  4521. formatPaginationSwitchUp: function formatPaginationSwitchUp() {
  4522. return 'Hide pagination';
  4523. },
  4524. formatRefresh: function formatRefresh() {
  4525. return 'Refresh';
  4526. },
  4527. formatToggleOn: function formatToggleOn() {
  4528. return 'Show card view';
  4529. },
  4530. formatToggleOff: function formatToggleOff() {
  4531. return 'Hide card view';
  4532. },
  4533. formatColumns: function formatColumns() {
  4534. return 'Columns';
  4535. },
  4536. formatColumnsToggleAll: function formatColumnsToggleAll() {
  4537. return 'Toggle all';
  4538. },
  4539. formatFullscreen: function formatFullscreen() {
  4540. return 'Fullscreen';
  4541. },
  4542. formatAllRows: function formatAllRows() {
  4543. return 'All';
  4544. }
  4545. };
  4546. var COLUMN_DEFAULTS = {
  4547. field: undefined,
  4548. title: undefined,
  4549. titleTooltip: undefined,
  4550. class: undefined,
  4551. width: undefined,
  4552. widthUnit: 'px',
  4553. rowspan: undefined,
  4554. colspan: undefined,
  4555. align: undefined,
  4556. // left, right, center
  4557. halign: undefined,
  4558. // left, right, center
  4559. falign: undefined,
  4560. // left, right, center
  4561. valign: undefined,
  4562. // top, middle, bottom
  4563. cellStyle: undefined,
  4564. radio: false,
  4565. checkbox: false,
  4566. checkboxEnabled: true,
  4567. clickToSelect: true,
  4568. showSelectTitle: false,
  4569. sortable: false,
  4570. sortName: undefined,
  4571. order: 'asc',
  4572. // asc, desc
  4573. sorter: undefined,
  4574. visible: true,
  4575. switchable: true,
  4576. cardVisible: true,
  4577. searchable: true,
  4578. formatter: undefined,
  4579. footerFormatter: undefined,
  4580. detailFormatter: undefined,
  4581. searchFormatter: true,
  4582. searchHighlightFormatter: false,
  4583. escape: undefined,
  4584. events: undefined
  4585. };
  4586. var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
  4587. var EVENTS = {
  4588. 'all.bs.table': 'onAll',
  4589. 'click-row.bs.table': 'onClickRow',
  4590. 'dbl-click-row.bs.table': 'onDblClickRow',
  4591. 'click-cell.bs.table': 'onClickCell',
  4592. 'dbl-click-cell.bs.table': 'onDblClickCell',
  4593. 'sort.bs.table': 'onSort',
  4594. 'check.bs.table': 'onCheck',
  4595. 'uncheck.bs.table': 'onUncheck',
  4596. 'check-all.bs.table': 'onCheckAll',
  4597. 'uncheck-all.bs.table': 'onUncheckAll',
  4598. 'check-some.bs.table': 'onCheckSome',
  4599. 'uncheck-some.bs.table': 'onUncheckSome',
  4600. 'load-success.bs.table': 'onLoadSuccess',
  4601. 'load-error.bs.table': 'onLoadError',
  4602. 'column-switch.bs.table': 'onColumnSwitch',
  4603. 'column-switch-all.bs.table': 'onColumnSwitchAll',
  4604. 'page-change.bs.table': 'onPageChange',
  4605. 'search.bs.table': 'onSearch',
  4606. 'toggle.bs.table': 'onToggle',
  4607. 'pre-body.bs.table': 'onPreBody',
  4608. 'post-body.bs.table': 'onPostBody',
  4609. 'post-header.bs.table': 'onPostHeader',
  4610. 'post-footer.bs.table': 'onPostFooter',
  4611. 'expand-row.bs.table': 'onExpandRow',
  4612. 'collapse-row.bs.table': 'onCollapseRow',
  4613. 'refresh-options.bs.table': 'onRefreshOptions',
  4614. 'reset-view.bs.table': 'onResetView',
  4615. 'refresh.bs.table': 'onRefresh',
  4616. 'scroll-body.bs.table': 'onScrollBody',
  4617. 'toggle-pagination.bs.table': 'onTogglePagination',
  4618. 'virtual-scroll.bs.table': 'onVirtualScroll'
  4619. };
  4620. Object.assign(DEFAULTS, EN);
  4621. var Constants = {
  4622. VERSION: VERSION,
  4623. THEME: "bootstrap".concat(bootstrapVersion),
  4624. CONSTANTS: CONSTANTS,
  4625. DEFAULTS: DEFAULTS,
  4626. COLUMN_DEFAULTS: COLUMN_DEFAULTS,
  4627. METHODS: METHODS,
  4628. EVENTS: EVENTS,
  4629. LOCALES: {
  4630. en: EN,
  4631. 'en-US': EN
  4632. }
  4633. };
  4634. var BLOCK_ROWS = 50;
  4635. var CLUSTER_BLOCKS = 4;
  4636. var VirtualScroll = /*#__PURE__*/function () {
  4637. function VirtualScroll(options) {
  4638. var _this = this;
  4639. _classCallCheck(this, VirtualScroll);
  4640. this.rows = options.rows;
  4641. this.scrollEl = options.scrollEl;
  4642. this.contentEl = options.contentEl;
  4643. this.callback = options.callback;
  4644. this.itemHeight = options.itemHeight;
  4645. this.cache = {};
  4646. this.scrollTop = this.scrollEl.scrollTop;
  4647. this.initDOM(this.rows, options.fixedScroll);
  4648. this.scrollEl.scrollTop = this.scrollTop;
  4649. this.lastCluster = 0;
  4650. var onScroll = function onScroll() {
  4651. if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
  4652. _this.initDOM(_this.rows);
  4653. _this.callback(_this.startIndex, _this.endIndex);
  4654. }
  4655. };
  4656. this.scrollEl.addEventListener('scroll', onScroll, false);
  4657. this.destroy = function () {
  4658. _this.contentEl.innerHtml = '';
  4659. _this.scrollEl.removeEventListener('scroll', onScroll, false);
  4660. };
  4661. }
  4662. _createClass(VirtualScroll, [{
  4663. key: "initDOM",
  4664. value: function initDOM(rows, fixedScroll) {
  4665. if (typeof this.clusterHeight === 'undefined') {
  4666. this.cache.scrollTop = this.scrollEl.scrollTop;
  4667. this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
  4668. this.getRowsHeight(rows);
  4669. }
  4670. var data = this.initData(rows, this.getNum(fixedScroll));
  4671. var thisRows = data.rows.join('');
  4672. var dataChanged = this.checkChanges('data', thisRows);
  4673. var topOffsetChanged = this.checkChanges('top', data.topOffset);
  4674. var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
  4675. var html = [];
  4676. if (dataChanged && topOffsetChanged) {
  4677. if (data.topOffset) {
  4678. html.push(this.getExtra('top', data.topOffset));
  4679. }
  4680. html.push(thisRows);
  4681. if (data.bottomOffset) {
  4682. html.push(this.getExtra('bottom', data.bottomOffset));
  4683. }
  4684. this.startIndex = data.start;
  4685. this.endIndex = data.end;
  4686. this.contentEl.innerHTML = html.join('');
  4687. if (fixedScroll) {
  4688. this.contentEl.scrollTop = this.cache.scrollTop;
  4689. }
  4690. } else if (bottomOffsetChanged) {
  4691. this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
  4692. }
  4693. }
  4694. }, {
  4695. key: "getRowsHeight",
  4696. value: function getRowsHeight() {
  4697. if (typeof this.itemHeight === 'undefined') {
  4698. var nodes = this.contentEl.children;
  4699. var node = nodes[Math.floor(nodes.length / 2)];
  4700. this.itemHeight = node.offsetHeight;
  4701. }
  4702. this.blockHeight = this.itemHeight * BLOCK_ROWS;
  4703. this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
  4704. this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
  4705. }
  4706. }, {
  4707. key: "getNum",
  4708. value: function getNum(fixedScroll) {
  4709. this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
  4710. return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
  4711. }
  4712. }, {
  4713. key: "initData",
  4714. value: function initData(rows, num) {
  4715. if (rows.length < BLOCK_ROWS) {
  4716. return {
  4717. topOffset: 0,
  4718. bottomOffset: 0,
  4719. rowsAbove: 0,
  4720. rows: rows
  4721. };
  4722. }
  4723. var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
  4724. var end = start + this.clusterRows;
  4725. var topOffset = Math.max(start * this.itemHeight, 0);
  4726. var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
  4727. var thisRows = [];
  4728. var rowsAbove = start;
  4729. if (topOffset < 1) {
  4730. rowsAbove++;
  4731. }
  4732. for (var i = start; i < end; i++) {
  4733. rows[i] && thisRows.push(rows[i]);
  4734. }
  4735. return {
  4736. start: start,
  4737. end: end,
  4738. topOffset: topOffset,
  4739. bottomOffset: bottomOffset,
  4740. rowsAbove: rowsAbove,
  4741. rows: thisRows
  4742. };
  4743. }
  4744. }, {
  4745. key: "checkChanges",
  4746. value: function checkChanges(type, value) {
  4747. var changed = value !== this.cache[type];
  4748. this.cache[type] = value;
  4749. return changed;
  4750. }
  4751. }, {
  4752. key: "getExtra",
  4753. value: function getExtra(className, height) {
  4754. var tag = document.createElement('tr');
  4755. tag.className = "virtual-scroll-".concat(className);
  4756. if (height) {
  4757. tag.style.height = "".concat(height, "px");
  4758. }
  4759. return tag.outerHTML;
  4760. }
  4761. }]);
  4762. return VirtualScroll;
  4763. }();
  4764. var BootstrapTable = /*#__PURE__*/function () {
  4765. function BootstrapTable(el, options) {
  4766. _classCallCheck(this, BootstrapTable);
  4767. this.options = options;
  4768. this.$el = $__default["default"](el);
  4769. this.$el_ = this.$el.clone();
  4770. this.timeoutId_ = 0;
  4771. this.timeoutFooter_ = 0;
  4772. }
  4773. _createClass(BootstrapTable, [{
  4774. key: "init",
  4775. value: function init() {
  4776. this.initConstants();
  4777. this.initLocale();
  4778. this.initContainer();
  4779. this.initTable();
  4780. this.initHeader();
  4781. this.initData();
  4782. this.initHiddenRows();
  4783. this.initToolbar();
  4784. this.initPagination();
  4785. this.initBody();
  4786. this.initSearchText();
  4787. this.initServer();
  4788. }
  4789. }, {
  4790. key: "initConstants",
  4791. value: function initConstants() {
  4792. var opts = this.options;
  4793. this.constants = Constants.CONSTANTS;
  4794. this.constants.theme = $__default["default"].fn.bootstrapTable.theme;
  4795. this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle';
  4796. // init iconsPrefix and icons
  4797. var iconsPrefix = Utils.getIconsPrefix($__default["default"].fn.bootstrapTable.theme);
  4798. var icons = Utils.getIcons(iconsPrefix);
  4799. if (typeof opts.icons === 'string') {
  4800. opts.icons = Utils.calculateObjectValue(null, opts.icons);
  4801. }
  4802. opts.iconsPrefix = opts.iconsPrefix || $__default["default"].fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
  4803. opts.icons = Object.assign(icons, $__default["default"].fn.bootstrapTable.defaults.icons, opts.icons);
  4804. // init buttons class
  4805. var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
  4806. this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
  4807. this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
  4808. if (_typeof(this.buttons) !== 'object') {
  4809. this.buttons = {};
  4810. }
  4811. }
  4812. }, {
  4813. key: "initLocale",
  4814. value: function initLocale() {
  4815. if (this.options.locale) {
  4816. var locales = $__default["default"].fn.bootstrapTable.locales;
  4817. var parts = this.options.locale.split(/-|_/);
  4818. parts[0] = parts[0].toLowerCase();
  4819. if (parts[1]) {
  4820. parts[1] = parts[1].toUpperCase();
  4821. }
  4822. var localesToExtend = {};
  4823. if (locales[this.options.locale]) {
  4824. localesToExtend = locales[this.options.locale];
  4825. } else if (locales[parts.join('-')]) {
  4826. localesToExtend = locales[parts.join('-')];
  4827. } else if (locales[parts[0]]) {
  4828. localesToExtend = locales[parts[0]];
  4829. }
  4830. for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
  4831. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  4832. formatName = _Object$entries$_i[0],
  4833. func = _Object$entries$_i[1];
  4834. if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
  4835. continue;
  4836. }
  4837. this.options[formatName] = func;
  4838. }
  4839. }
  4840. }
  4841. }, {
  4842. key: "initContainer",
  4843. value: function initContainer() {
  4844. var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
  4845. var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
  4846. var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
  4847. this.$container = $__default["default"]("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
  4848. this.$container.insertAfter(this.$el);
  4849. this.$tableContainer = this.$container.find('.fixed-table-container');
  4850. this.$tableHeader = this.$container.find('.fixed-table-header');
  4851. this.$tableBody = this.$container.find('.fixed-table-body');
  4852. this.$tableLoading = this.$container.find('.fixed-table-loading');
  4853. this.$tableFooter = this.$el.find('tfoot');
  4854. // checking if custom table-toolbar exists or not
  4855. if (this.options.buttonsToolbar) {
  4856. this.$toolbar = $__default["default"]('body').find(this.options.buttonsToolbar);
  4857. } else {
  4858. this.$toolbar = this.$container.find('.fixed-table-toolbar');
  4859. }
  4860. this.$pagination = this.$container.find('.fixed-table-pagination');
  4861. this.$tableBody.append(this.$el);
  4862. this.$container.after('<div class="clearfix"></div>');
  4863. this.$el.addClass(this.options.classes);
  4864. this.$tableLoading.addClass(this.options.classes);
  4865. if (this.options.height) {
  4866. this.$tableContainer.addClass('fixed-height');
  4867. if (this.options.showFooter) {
  4868. this.$tableContainer.addClass('has-footer');
  4869. }
  4870. if (this.options.classes.split(' ').includes('table-bordered')) {
  4871. this.$tableBody.append('<div class="fixed-table-border"></div>');
  4872. this.$tableBorder = this.$tableBody.find('.fixed-table-border');
  4873. this.$tableLoading.addClass('fixed-table-border');
  4874. }
  4875. this.$tableFooter = this.$container.find('.fixed-table-footer');
  4876. }
  4877. }
  4878. }, {
  4879. key: "initTable",
  4880. value: function initTable() {
  4881. var _this = this;
  4882. var columns = [];
  4883. this.$header = this.$el.find('>thead');
  4884. if (!this.$header.length) {
  4885. this.$header = $__default["default"]("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
  4886. } else if (this.options.theadClasses) {
  4887. this.$header.addClass(this.options.theadClasses);
  4888. }
  4889. this._headerTrClasses = [];
  4890. this._headerTrStyles = [];
  4891. this.$header.find('tr').each(function (i, el) {
  4892. var $tr = $__default["default"](el);
  4893. var column = [];
  4894. $tr.find('th').each(function (i, el) {
  4895. var $th = $__default["default"](el);
  4896. // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
  4897. if (typeof $th.data('field') !== 'undefined') {
  4898. $th.data('field', "".concat($th.data('field')));
  4899. }
  4900. column.push($__default["default"].extend({}, {
  4901. title: $th.html(),
  4902. class: $th.attr('class'),
  4903. titleTooltip: $th.attr('title'),
  4904. rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
  4905. colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
  4906. }, $th.data()));
  4907. });
  4908. columns.push(column);
  4909. if ($tr.attr('class')) {
  4910. _this._headerTrClasses.push($tr.attr('class'));
  4911. }
  4912. if ($tr.attr('style')) {
  4913. _this._headerTrStyles.push($tr.attr('style'));
  4914. }
  4915. });
  4916. if (!Array.isArray(this.options.columns[0])) {
  4917. this.options.columns = [this.options.columns];
  4918. }
  4919. this.options.columns = $__default["default"].extend(true, [], columns, this.options.columns);
  4920. this.columns = [];
  4921. this.fieldsColumnsIndex = [];
  4922. Utils.setFieldIndex(this.options.columns);
  4923. this.options.columns.forEach(function (columns, i) {
  4924. columns.forEach(function (_column, j) {
  4925. var column = $__default["default"].extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, {
  4926. passed: _column
  4927. });
  4928. if (typeof column.fieldIndex !== 'undefined') {
  4929. _this.columns[column.fieldIndex] = column;
  4930. _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
  4931. }
  4932. _this.options.columns[i][j] = column;
  4933. });
  4934. });
  4935. // if options.data is setting, do not process tbody and tfoot data
  4936. if (!this.options.data.length) {
  4937. var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
  4938. if (htmlData.length) {
  4939. this.options.data = htmlData;
  4940. this.fromHtml = true;
  4941. }
  4942. }
  4943. if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
  4944. this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
  4945. }
  4946. if (this.footerData) {
  4947. this.$el.find('tfoot').html('<tr></tr>');
  4948. }
  4949. if (!this.options.showFooter || this.options.cardView) {
  4950. this.$tableFooter.hide();
  4951. } else {
  4952. this.$tableFooter.show();
  4953. }
  4954. }
  4955. }, {
  4956. key: "initHeader",
  4957. value: function initHeader() {
  4958. var _this2 = this;
  4959. var visibleColumns = {};
  4960. var headerHtml = [];
  4961. this.header = {
  4962. fields: [],
  4963. styles: [],
  4964. classes: [],
  4965. formatters: [],
  4966. detailFormatters: [],
  4967. events: [],
  4968. sorters: [],
  4969. sortNames: [],
  4970. cellStyles: [],
  4971. searchables: []
  4972. };
  4973. Utils.updateFieldGroup(this.options.columns, this.columns);
  4974. this.options.columns.forEach(function (columns, i) {
  4975. var html = [];
  4976. html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
  4977. var detailViewTemplate = '';
  4978. if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
  4979. var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
  4980. detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
  4981. }
  4982. if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
  4983. html.push(detailViewTemplate);
  4984. }
  4985. columns.forEach(function (column, j) {
  4986. var class_ = Utils.sprintf(' class="%s"', column['class']);
  4987. var unitWidth = column.widthUnit;
  4988. var width = parseFloat(column.width);
  4989. var columnHalign = column.halign ? column.halign : column.align;
  4990. var halign = Utils.sprintf('text-align: %s; ', columnHalign);
  4991. var align = Utils.sprintf('text-align: %s; ', column.align);
  4992. var style = Utils.sprintf('vertical-align: %s; ', column.valign);
  4993. style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
  4994. if (typeof column.fieldIndex === 'undefined' && !column.visible) {
  4995. return;
  4996. }
  4997. var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
  4998. var csses = [];
  4999. var classes = '';
  5000. if (headerStyle && headerStyle.css) {
  5001. for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
  5002. var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
  5003. key = _Object$entries2$_i[0],
  5004. value = _Object$entries2$_i[1];
  5005. csses.push("".concat(key, ": ").concat(value));
  5006. }
  5007. }
  5008. if (headerStyle && headerStyle.classes) {
  5009. classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
  5010. }
  5011. if (typeof column.fieldIndex !== 'undefined') {
  5012. _this2.header.fields[column.fieldIndex] = column.field;
  5013. _this2.header.styles[column.fieldIndex] = align + style;
  5014. _this2.header.classes[column.fieldIndex] = class_;
  5015. _this2.header.formatters[column.fieldIndex] = column.formatter;
  5016. _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
  5017. _this2.header.events[column.fieldIndex] = column.events;
  5018. _this2.header.sorters[column.fieldIndex] = column.sorter;
  5019. _this2.header.sortNames[column.fieldIndex] = column.sortName;
  5020. _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
  5021. _this2.header.searchables[column.fieldIndex] = column.searchable;
  5022. if (!column.visible) {
  5023. return;
  5024. }
  5025. if (_this2.options.cardView && !column.cardVisible) {
  5026. return;
  5027. }
  5028. visibleColumns[column.field] = column;
  5029. }
  5030. html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field),
  5031. // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
  5032. j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
  5033. html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? "sortable".concat(columnHalign === 'center' ? ' sortable-center' : '', " both") : ''));
  5034. var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
  5035. var title = text;
  5036. if (column.checkbox) {
  5037. text = '';
  5038. if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
  5039. text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
  5040. }
  5041. _this2.header.stateField = column.field;
  5042. }
  5043. if (column.radio) {
  5044. text = '';
  5045. _this2.header.stateField = column.field;
  5046. }
  5047. if (!text && column.showSelectTitle) {
  5048. text += title;
  5049. }
  5050. html.push(text);
  5051. html.push('</div>');
  5052. html.push('<div class="fht-cell"></div>');
  5053. html.push('</div>');
  5054. html.push('</th>');
  5055. });
  5056. if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
  5057. html.push(detailViewTemplate);
  5058. }
  5059. html.push('</tr>');
  5060. if (html.length > 3) {
  5061. headerHtml.push(html.join(''));
  5062. }
  5063. });
  5064. this.$header.html(headerHtml.join(''));
  5065. this.$header.find('th[data-field]').each(function (i, el) {
  5066. $__default["default"](el).data(visibleColumns[$__default["default"](el).data('field')]);
  5067. });
  5068. this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
  5069. var $this = $__default["default"](e.currentTarget);
  5070. if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
  5071. if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
  5072. return false;
  5073. }
  5074. }
  5075. if (_this2.options.sortable && $this.parent().data().sortable) {
  5076. _this2.onSort(e);
  5077. }
  5078. });
  5079. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  5080. $__default["default"](window).off(resizeEvent);
  5081. if (!this.options.showHeader || this.options.cardView) {
  5082. this.$header.hide();
  5083. this.$tableHeader.hide();
  5084. this.$tableLoading.css('top', 0);
  5085. } else {
  5086. this.$header.show();
  5087. this.$tableHeader.show();
  5088. this.$tableLoading.css('top', this.$header.outerHeight() + 1);
  5089. // Assign the correct sortable arrow
  5090. this.getCaret();
  5091. $__default["default"](window).on(resizeEvent, function () {
  5092. return _this2.resetView();
  5093. });
  5094. }
  5095. this.$selectAll = this.$header.find('[name="btSelectAll"]');
  5096. this.$selectAll.off('click').on('click', function (e) {
  5097. e.stopPropagation();
  5098. var checked = $__default["default"](e.currentTarget).prop('checked');
  5099. _this2[checked ? 'checkAll' : 'uncheckAll']();
  5100. _this2.updateSelected();
  5101. });
  5102. }
  5103. }, {
  5104. key: "initData",
  5105. value: function initData(data, type) {
  5106. if (type === 'append') {
  5107. this.options.data = this.options.data.concat(data);
  5108. } else if (type === 'prepend') {
  5109. this.options.data = [].concat(data).concat(this.options.data);
  5110. } else {
  5111. data = data || Utils.deepCopy(this.options.data);
  5112. this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
  5113. }
  5114. this.data = _toConsumableArray(this.options.data);
  5115. if (this.options.sortReset) {
  5116. this.unsortedData = _toConsumableArray(this.data);
  5117. }
  5118. if (this.options.sidePagination === 'server') {
  5119. return;
  5120. }
  5121. this.initSort();
  5122. }
  5123. }, {
  5124. key: "initSort",
  5125. value: function initSort() {
  5126. var _this3 = this;
  5127. var name = this.options.sortName;
  5128. var order = this.options.sortOrder === 'desc' ? -1 : 1;
  5129. var index = this.header.fields.indexOf(this.options.sortName);
  5130. var timeoutId = 0;
  5131. if (index !== -1) {
  5132. if (this.options.sortStable) {
  5133. this.data.forEach(function (row, i) {
  5134. if (!row.hasOwnProperty('_position')) {
  5135. row._position = i;
  5136. }
  5137. });
  5138. }
  5139. if (this.options.customSort) {
  5140. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  5141. } else {
  5142. this.data.sort(function (a, b) {
  5143. if (_this3.header.sortNames[index]) {
  5144. name = _this3.header.sortNames[index];
  5145. }
  5146. var aa = Utils.getItemField(a, name, _this3.options.escape);
  5147. var bb = Utils.getItemField(b, name, _this3.options.escape);
  5148. var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
  5149. if (value !== undefined) {
  5150. if (_this3.options.sortStable && value === 0) {
  5151. return order * (a._position - b._position);
  5152. }
  5153. return order * value;
  5154. }
  5155. return Utils.sort(aa, bb, order, _this3.options, a._position, b._position);
  5156. });
  5157. }
  5158. if (this.options.sortClass !== undefined) {
  5159. clearTimeout(timeoutId);
  5160. timeoutId = setTimeout(function () {
  5161. _this3.$el.removeClass(_this3.options.sortClass);
  5162. var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
  5163. _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
  5164. }, 250);
  5165. }
  5166. } else if (this.options.sortReset) {
  5167. this.data = _toConsumableArray(this.unsortedData);
  5168. }
  5169. }
  5170. }, {
  5171. key: "onSort",
  5172. value: function onSort(_ref) {
  5173. var type = _ref.type,
  5174. currentTarget = _ref.currentTarget;
  5175. var $this = type === 'keypress' ? $__default["default"](currentTarget) : $__default["default"](currentTarget).parent();
  5176. var $this_ = this.$header.find('th').eq($this.index());
  5177. this.$header.add(this.$header_).find('span.order').remove();
  5178. if (this.options.sortName === $this.data('field')) {
  5179. var currentSortOrder = this.options.sortOrder;
  5180. var initialSortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5181. if (currentSortOrder === undefined) {
  5182. this.options.sortOrder = 'asc';
  5183. } else if (currentSortOrder === 'asc') {
  5184. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'asc' ? 'desc' : undefined : 'desc';
  5185. } else if (this.options.sortOrder === 'desc') {
  5186. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'desc' ? 'asc' : undefined : 'asc';
  5187. }
  5188. if (this.options.sortOrder === undefined) {
  5189. this.options.sortName = undefined;
  5190. }
  5191. } else {
  5192. this.options.sortName = $this.data('field');
  5193. if (this.options.rememberOrder) {
  5194. this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
  5195. } else {
  5196. this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5197. }
  5198. }
  5199. this.trigger('sort', this.options.sortName, this.options.sortOrder);
  5200. $this.add($this_).data('order', this.options.sortOrder);
  5201. // Assign the correct sortable arrow
  5202. this.getCaret();
  5203. if (this.options.sidePagination === 'server' && this.options.serverSort) {
  5204. this.options.pageNumber = 1;
  5205. this.initServer(this.options.silentSort);
  5206. return;
  5207. }
  5208. if (this.options.pagination && this.options.sortResetPage) {
  5209. this.options.pageNumber = 1;
  5210. this.initPagination();
  5211. }
  5212. this.initSort();
  5213. this.initBody();
  5214. }
  5215. }, {
  5216. key: "initToolbar",
  5217. value: function initToolbar() {
  5218. var _this4 = this;
  5219. var opts = this.options;
  5220. var html = [];
  5221. var timeoutId = 0;
  5222. var $keepOpen;
  5223. var switchableCount = 0;
  5224. if (this.$toolbar.find('.bs-bars').children().length) {
  5225. $__default["default"]('body').append($__default["default"](opts.toolbar));
  5226. }
  5227. this.$toolbar.html('');
  5228. if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
  5229. $__default["default"](Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($__default["default"](opts.toolbar));
  5230. }
  5231. // showColumns, showToggle, showRefresh
  5232. html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
  5233. if (typeof opts.buttonsOrder === 'string') {
  5234. opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
  5235. }
  5236. this.buttons = Object.assign(this.buttons, {
  5237. paginationSwitch: {
  5238. text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
  5239. icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
  5240. render: false,
  5241. event: this.togglePagination,
  5242. attributes: {
  5243. 'aria-label': opts.formatPaginationSwitch(),
  5244. title: opts.formatPaginationSwitch()
  5245. }
  5246. },
  5247. refresh: {
  5248. text: opts.formatRefresh(),
  5249. icon: opts.icons.refresh,
  5250. render: false,
  5251. event: this.refresh,
  5252. attributes: {
  5253. 'aria-label': opts.formatRefresh(),
  5254. title: opts.formatRefresh()
  5255. }
  5256. },
  5257. toggle: {
  5258. text: opts.formatToggleOn(),
  5259. icon: opts.icons.toggleOff,
  5260. render: false,
  5261. event: this.toggleView,
  5262. attributes: {
  5263. 'aria-label': opts.formatToggleOn(),
  5264. title: opts.formatToggleOn()
  5265. }
  5266. },
  5267. fullscreen: {
  5268. text: opts.formatFullscreen(),
  5269. icon: opts.icons.fullscreen,
  5270. render: false,
  5271. event: this.toggleFullscreen,
  5272. attributes: {
  5273. 'aria-label': opts.formatFullscreen(),
  5274. title: opts.formatFullscreen()
  5275. }
  5276. },
  5277. columns: {
  5278. render: false,
  5279. html: function html() {
  5280. var html = [];
  5281. html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(_this4.constants.dataToggle, "=\"dropdown\"\n aria-label=\"").concat(opts.formatColumns(), "\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
  5282. if (opts.showColumnsSearch) {
  5283. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
  5284. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5285. }
  5286. if (opts.showColumnsToggleAll) {
  5287. var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
  5288. return !_this4.isSelectionColumn(column);
  5289. }).length;
  5290. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
  5291. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5292. }
  5293. var visibleColumns = 0;
  5294. _this4.columns.forEach(function (column) {
  5295. if (column.visible) {
  5296. visibleColumns++;
  5297. }
  5298. });
  5299. _this4.columns.forEach(function (column, i) {
  5300. if (_this4.isSelectionColumn(column)) {
  5301. return;
  5302. }
  5303. if (opts.cardView && !column.cardVisible) {
  5304. return;
  5305. }
  5306. var checked = column.visible ? ' checked="checked"' : '';
  5307. var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
  5308. if (column.switchable) {
  5309. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
  5310. switchableCount++;
  5311. }
  5312. });
  5313. html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
  5314. return html.join('');
  5315. }
  5316. }
  5317. });
  5318. var buttonsHtml = {};
  5319. for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
  5320. var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
  5321. buttonName = _Object$entries3$_i[0],
  5322. buttonConfig = _Object$entries3$_i[1];
  5323. var buttonHtml = void 0;
  5324. if (buttonConfig.hasOwnProperty('html')) {
  5325. if (typeof buttonConfig.html === 'function') {
  5326. buttonHtml = buttonConfig.html();
  5327. } else if (typeof buttonConfig.html === 'string') {
  5328. buttonHtml = buttonConfig.html;
  5329. }
  5330. } else {
  5331. buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
  5332. if (buttonConfig.hasOwnProperty('attributes')) {
  5333. for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
  5334. var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
  5335. attributeName = _Object$entries4$_i[0],
  5336. value = _Object$entries4$_i[1];
  5337. buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
  5338. }
  5339. }
  5340. buttonHtml += '>';
  5341. if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
  5342. buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
  5343. }
  5344. if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
  5345. buttonHtml += buttonConfig.text;
  5346. }
  5347. buttonHtml += '</button>';
  5348. }
  5349. buttonsHtml[buttonName] = buttonHtml;
  5350. var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
  5351. var showOption = opts[optionName];
  5352. if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
  5353. opts[optionName] = true;
  5354. }
  5355. if (!opts.buttonsOrder.includes(buttonName)) {
  5356. opts.buttonsOrder.push(buttonName);
  5357. }
  5358. }
  5359. // Adding the button html to the final toolbar html when the showOption is true
  5360. var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
  5361. _step;
  5362. try {
  5363. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5364. var button = _step.value;
  5365. var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
  5366. if (_showOption) {
  5367. html.push(buttonsHtml[button]);
  5368. }
  5369. }
  5370. } catch (err) {
  5371. _iterator.e(err);
  5372. } finally {
  5373. _iterator.f();
  5374. }
  5375. html.push('</div>');
  5376. // Fix #188: this.showToolbar is for extensions
  5377. if (this.showToolbar || html.length > 2) {
  5378. this.$toolbar.append(html.join(''));
  5379. }
  5380. for (var _i5 = 0, _Object$entries5 = Object.entries(this.buttons); _i5 < _Object$entries5.length; _i5++) {
  5381. var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
  5382. _buttonName = _Object$entries5$_i[0],
  5383. _buttonConfig = _Object$entries5$_i[1];
  5384. if (_buttonConfig.hasOwnProperty('event')) {
  5385. if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
  5386. var _ret = function () {
  5387. var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
  5388. _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
  5389. return event.call(_this4);
  5390. });
  5391. return "continue";
  5392. }();
  5393. if (_ret === "continue") continue;
  5394. }
  5395. var _loop = function _loop() {
  5396. var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
  5397. eventType = _Object$entries6$_i[0],
  5398. eventFunction = _Object$entries6$_i[1];
  5399. var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
  5400. _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
  5401. return event.call(_this4);
  5402. });
  5403. };
  5404. for (var _i6 = 0, _Object$entries6 = Object.entries(_buttonConfig.event); _i6 < _Object$entries6.length; _i6++) {
  5405. _loop();
  5406. }
  5407. }
  5408. }
  5409. if (opts.showColumns) {
  5410. $keepOpen = this.$toolbar.find('.keep-open');
  5411. var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
  5412. var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
  5413. if (switchableCount <= opts.minimumCountColumns) {
  5414. $keepOpen.find('input').prop('disabled', true);
  5415. }
  5416. $keepOpen.find('li, label').off('click').on('click', function (e) {
  5417. e.stopImmediatePropagation();
  5418. });
  5419. $checkboxes.off('click').on('click', function (_ref2) {
  5420. var currentTarget = _ref2.currentTarget;
  5421. var $this = $__default["default"](currentTarget);
  5422. _this4._toggleColumn($this.val(), $this.prop('checked'), false);
  5423. _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
  5424. $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
  5425. return !_this4.isSelectionColumn(column);
  5426. }).length);
  5427. });
  5428. $toggleAll.off('click').on('click', function (_ref3) {
  5429. var currentTarget = _ref3.currentTarget;
  5430. _this4._toggleAllColumns($__default["default"](currentTarget).prop('checked'));
  5431. _this4.trigger('column-switch-all', $__default["default"](currentTarget).prop('checked'));
  5432. });
  5433. if (opts.showColumnsSearch) {
  5434. var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
  5435. var $listItems = $keepOpen.find('.dropdown-item-marker');
  5436. $columnsSearch.on('keyup paste change', function (_ref4) {
  5437. var currentTarget = _ref4.currentTarget;
  5438. var $this = $__default["default"](currentTarget);
  5439. var searchValue = $this.val().toLowerCase();
  5440. $listItems.show();
  5441. $checkboxes.each(function (i, el) {
  5442. var $checkbox = $__default["default"](el);
  5443. var $listItem = $checkbox.parents('.dropdown-item-marker');
  5444. var text = $listItem.text().toLowerCase();
  5445. if (!text.includes(searchValue)) {
  5446. $listItem.hide();
  5447. }
  5448. });
  5449. });
  5450. }
  5451. }
  5452. var handleInputEvent = function handleInputEvent($searchInput) {
  5453. var eventTriggers = 'keyup drop blur mouseup';
  5454. $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
  5455. if (opts.searchOnEnterKey && event.keyCode !== 13) {
  5456. return;
  5457. }
  5458. if ([37, 38, 39, 40].includes(event.keyCode)) {
  5459. return;
  5460. }
  5461. clearTimeout(timeoutId); // doesn't matter if it's 0
  5462. timeoutId = setTimeout(function () {
  5463. _this4.onSearch({
  5464. currentTarget: event.currentTarget
  5465. });
  5466. }, opts.searchTimeOut);
  5467. });
  5468. };
  5469. // Fix #4516: this.showSearchClearButton is for extensions
  5470. if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
  5471. html = [];
  5472. var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
  5473. var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
  5474. var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
  5475. var searchInputFinalHtml = searchInputHtml;
  5476. if (opts.showSearchButton || opts.showSearchClearButton) {
  5477. var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
  5478. searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
  5479. }
  5480. html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
  5481. this.$toolbar.append(html.join(''));
  5482. var $searchInput = Utils.getSearchInput(this);
  5483. if (opts.showSearchButton) {
  5484. this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
  5485. clearTimeout(timeoutId); // doesn't matter if it's 0
  5486. timeoutId = setTimeout(function () {
  5487. _this4.onSearch({
  5488. currentTarget: $searchInput
  5489. });
  5490. }, opts.searchTimeOut);
  5491. });
  5492. if (opts.searchOnEnterKey) {
  5493. handleInputEvent($searchInput);
  5494. }
  5495. } else {
  5496. handleInputEvent($searchInput);
  5497. }
  5498. if (opts.showSearchClearButton) {
  5499. this.$toolbar.find('.search button[name=clearSearch]').click(function () {
  5500. _this4.resetSearch();
  5501. });
  5502. }
  5503. } else if (typeof opts.searchSelector === 'string') {
  5504. var _$searchInput = Utils.getSearchInput(this);
  5505. handleInputEvent(_$searchInput);
  5506. }
  5507. }
  5508. }, {
  5509. key: "onSearch",
  5510. value: function onSearch() {
  5511. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5512. currentTarget = _ref5.currentTarget,
  5513. firedByInitSearchText = _ref5.firedByInitSearchText;
  5514. var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5515. if (currentTarget !== undefined && $__default["default"](currentTarget).length && overwriteSearchText) {
  5516. var text = $__default["default"](currentTarget).val().trim();
  5517. if (this.options.trimOnSearch && $__default["default"](currentTarget).val() !== text) {
  5518. $__default["default"](currentTarget).val(text);
  5519. }
  5520. if (this.searchText === text) {
  5521. return;
  5522. }
  5523. var $searchInput = Utils.getSearchInput(this);
  5524. var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $__default["default"](currentTarget);
  5525. if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
  5526. this.searchText = text;
  5527. this.options.searchText = text;
  5528. }
  5529. }
  5530. if (!firedByInitSearchText && !this.options.cookie) {
  5531. this.options.pageNumber = 1;
  5532. }
  5533. this.initSearch();
  5534. if (firedByInitSearchText) {
  5535. if (this.options.sidePagination === 'client') {
  5536. this.updatePagination();
  5537. }
  5538. } else {
  5539. this.updatePagination();
  5540. }
  5541. this.trigger('search', this.searchText);
  5542. }
  5543. }, {
  5544. key: "initSearch",
  5545. value: function initSearch() {
  5546. var _this5 = this;
  5547. this.filterOptions = this.filterOptions || this.options.filterOptions;
  5548. if (this.options.sidePagination !== 'server') {
  5549. if (this.options.customSearch) {
  5550. this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
  5551. if (this.options.sortReset) {
  5552. this.unsortedData = _toConsumableArray(this.data);
  5553. }
  5554. this.initSort();
  5555. return;
  5556. }
  5557. var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
  5558. var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
  5559. var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
  5560. if (this.options.searchAccentNeutralise) {
  5561. searchText = Utils.normalizeAccent(searchText);
  5562. }
  5563. // Check filter
  5564. if (typeof this.filterOptions.filterAlgorithm === 'function') {
  5565. this.data = this.options.data.filter(function (item) {
  5566. return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
  5567. });
  5568. } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
  5569. this.data = f ? this.options.data.filter(function (item) {
  5570. var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
  5571. if (filterAlgorithm === 'and') {
  5572. for (var key in f) {
  5573. if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
  5574. return false;
  5575. }
  5576. }
  5577. } else if (filterAlgorithm === 'or') {
  5578. var match = false;
  5579. for (var _key in f) {
  5580. if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
  5581. match = true;
  5582. }
  5583. }
  5584. return match;
  5585. }
  5586. return true;
  5587. }) : _toConsumableArray(this.options.data);
  5588. }
  5589. var visibleFields = this.getVisibleFields();
  5590. this.data = searchText ? this.data.filter(function (item, i) {
  5591. for (var j = 0; j < _this5.header.fields.length; j++) {
  5592. if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
  5593. continue;
  5594. }
  5595. var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
  5596. var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
  5597. var value = void 0;
  5598. if (typeof key === 'string') {
  5599. value = item;
  5600. var props = key.split('.');
  5601. for (var _i7 = 0; _i7 < props.length; _i7++) {
  5602. if (value[props[_i7]] !== null) {
  5603. value = value[props[_i7]];
  5604. } else {
  5605. value = null;
  5606. break;
  5607. }
  5608. }
  5609. } else {
  5610. value = item[key];
  5611. }
  5612. if (_this5.options.searchAccentNeutralise) {
  5613. value = Utils.normalizeAccent(value);
  5614. }
  5615. // Fix #142: respect searchFormatter boolean
  5616. if (column && column.searchFormatter) {
  5617. value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
  5618. }
  5619. if (typeof value === 'string' || typeof value === 'number') {
  5620. if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
  5621. return true;
  5622. }
  5623. var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
  5624. var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
  5625. var comparisonCheck = false;
  5626. if (matches) {
  5627. var operator = matches[1] || "".concat(matches[5], "l");
  5628. var comparisonValue = matches[2] || matches[3];
  5629. var int = parseInt(value, 10);
  5630. var comparisonInt = parseInt(comparisonValue, 10);
  5631. switch (operator) {
  5632. case '>':
  5633. case '<l':
  5634. comparisonCheck = int > comparisonInt;
  5635. break;
  5636. case '<':
  5637. case '>l':
  5638. comparisonCheck = int < comparisonInt;
  5639. break;
  5640. case '<=':
  5641. case '=<':
  5642. case '>=l':
  5643. case '=>l':
  5644. comparisonCheck = int <= comparisonInt;
  5645. break;
  5646. case '>=':
  5647. case '=>':
  5648. case '<=l':
  5649. case '=<l':
  5650. comparisonCheck = int >= comparisonInt;
  5651. break;
  5652. }
  5653. }
  5654. if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
  5655. return true;
  5656. }
  5657. }
  5658. }
  5659. return false;
  5660. }) : this.data;
  5661. if (this.options.sortReset) {
  5662. this.unsortedData = _toConsumableArray(this.data);
  5663. }
  5664. this.initSort();
  5665. }
  5666. }
  5667. }, {
  5668. key: "initPagination",
  5669. value: function initPagination() {
  5670. var _this6 = this;
  5671. var opts = this.options;
  5672. if (!opts.pagination) {
  5673. this.$pagination.hide();
  5674. return;
  5675. }
  5676. this.$pagination.show();
  5677. var html = [];
  5678. var allSelected = false;
  5679. var i;
  5680. var from;
  5681. var to;
  5682. var $pageList;
  5683. var $pre;
  5684. var $next;
  5685. var $number;
  5686. var data = this.getData({
  5687. includeHiddenRows: false
  5688. });
  5689. var pageList = opts.pageList;
  5690. if (typeof pageList === 'string') {
  5691. pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
  5692. }
  5693. pageList = pageList.map(function (value) {
  5694. if (typeof value === 'string') {
  5695. return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
  5696. }
  5697. return value;
  5698. });
  5699. this.paginationParts = opts.paginationParts;
  5700. if (typeof this.paginationParts === 'string') {
  5701. this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
  5702. }
  5703. if (opts.sidePagination !== 'server') {
  5704. opts.totalRows = data.length;
  5705. }
  5706. this.totalPages = 0;
  5707. if (opts.totalRows) {
  5708. if (opts.pageSize === opts.formatAllRows()) {
  5709. opts.pageSize = opts.totalRows;
  5710. allSelected = true;
  5711. }
  5712. this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
  5713. opts.totalPages = this.totalPages;
  5714. }
  5715. if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
  5716. opts.pageNumber = this.totalPages;
  5717. }
  5718. this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
  5719. this.pageTo = opts.pageNumber * opts.pageSize;
  5720. if (this.pageTo > opts.totalRows) {
  5721. this.pageTo = opts.totalRows;
  5722. }
  5723. if (this.options.pagination && this.options.sidePagination !== 'server') {
  5724. this.options.totalNotFiltered = this.options.data.length;
  5725. }
  5726. if (!this.options.showExtendedPagination) {
  5727. this.options.totalNotFiltered = undefined;
  5728. }
  5729. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5730. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
  5731. }
  5732. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
  5733. var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
  5734. html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
  5735. }
  5736. if (this.paginationParts.includes('pageSize')) {
  5737. html.push('<div class="page-list">');
  5738. var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
  5739. pageList.forEach(function (page, i) {
  5740. if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
  5741. var active;
  5742. if (allSelected) {
  5743. active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
  5744. } else {
  5745. active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
  5746. }
  5747. pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
  5748. }
  5749. });
  5750. pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
  5751. html.push(opts.formatRecordsPerPage(pageNumber.join('')));
  5752. }
  5753. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5754. html.push('</div></div>');
  5755. }
  5756. if (this.paginationParts.includes('pageList')) {
  5757. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
  5758. if (this.totalPages < opts.paginationSuccessivelySize) {
  5759. from = 1;
  5760. to = this.totalPages;
  5761. } else {
  5762. from = opts.pageNumber - opts.paginationPagesBySide;
  5763. to = from + opts.paginationPagesBySide * 2;
  5764. }
  5765. if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
  5766. to = opts.paginationSuccessivelySize;
  5767. }
  5768. if (opts.paginationSuccessivelySize > this.totalPages - from) {
  5769. from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
  5770. }
  5771. if (from < 1) {
  5772. from = 1;
  5773. }
  5774. if (to > this.totalPages) {
  5775. to = this.totalPages;
  5776. }
  5777. var middleSize = Math.round(opts.paginationPagesBySide / 2);
  5778. var pageItem = function pageItem(i) {
  5779. var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  5780. return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
  5781. };
  5782. if (from > 1) {
  5783. var max = opts.paginationPagesBySide;
  5784. if (max >= from) max = from - 1;
  5785. for (i = 1; i <= max; i++) {
  5786. html.push(pageItem(i));
  5787. }
  5788. if (from - 1 === max + 1) {
  5789. i = from - 1;
  5790. html.push(pageItem(i));
  5791. } else if (from - 1 > max) {
  5792. if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
  5793. i = Math.round((from - middleSize) / 2 + middleSize);
  5794. html.push(pageItem(i, ' page-intermediate'));
  5795. } else {
  5796. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
  5797. }
  5798. }
  5799. }
  5800. for (i = from; i <= to; i++) {
  5801. html.push(pageItem(i));
  5802. }
  5803. if (this.totalPages > to) {
  5804. var min = this.totalPages - (opts.paginationPagesBySide - 1);
  5805. if (to >= min) min = to + 1;
  5806. if (to + 1 === min - 1) {
  5807. i = to + 1;
  5808. html.push(pageItem(i));
  5809. } else if (min > to + 1) {
  5810. if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
  5811. i = Math.round((this.totalPages - middleSize - to) / 2 + to);
  5812. html.push(pageItem(i, ' page-intermediate'));
  5813. } else {
  5814. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
  5815. }
  5816. }
  5817. for (i = min; i <= this.totalPages; i++) {
  5818. html.push(pageItem(i));
  5819. }
  5820. }
  5821. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
  5822. html.push(this.constants.html.pagination[1], '</div>');
  5823. }
  5824. this.$pagination.html(html.join(''));
  5825. var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
  5826. this.$pagination.last().find('.page-list > div').addClass(dropupClass);
  5827. if (!opts.onlyInfoPagination) {
  5828. $pageList = this.$pagination.find('.page-list a');
  5829. $pre = this.$pagination.find('.page-pre');
  5830. $next = this.$pagination.find('.page-next');
  5831. $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
  5832. if (this.totalPages <= 1) {
  5833. this.$pagination.find('div.pagination').hide();
  5834. }
  5835. if (opts.smartDisplay) {
  5836. if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
  5837. this.$pagination.find('div.page-list').hide();
  5838. }
  5839. }
  5840. // when data is empty, hide the pagination
  5841. this.$pagination[this.getData().length ? 'show' : 'hide']();
  5842. if (!opts.paginationLoop) {
  5843. if (opts.pageNumber === 1) {
  5844. $pre.addClass('disabled');
  5845. }
  5846. if (opts.pageNumber === this.totalPages) {
  5847. $next.addClass('disabled');
  5848. }
  5849. }
  5850. if (allSelected) {
  5851. opts.pageSize = opts.formatAllRows();
  5852. }
  5853. // removed the events for last and first, onPageNumber executeds the same logic
  5854. $pageList.off('click').on('click', function (e) {
  5855. return _this6.onPageListChange(e);
  5856. });
  5857. $pre.off('click').on('click', function (e) {
  5858. return _this6.onPagePre(e);
  5859. });
  5860. $next.off('click').on('click', function (e) {
  5861. return _this6.onPageNext(e);
  5862. });
  5863. $number.off('click').on('click', function (e) {
  5864. return _this6.onPageNumber(e);
  5865. });
  5866. }
  5867. }
  5868. }, {
  5869. key: "updatePagination",
  5870. value: function updatePagination(event) {
  5871. // Fix #171: IE disabled button can be clicked bug.
  5872. if (event && $__default["default"](event.currentTarget).hasClass('disabled')) {
  5873. return;
  5874. }
  5875. if (!this.options.maintainMetaData) {
  5876. this.resetRows();
  5877. }
  5878. this.initPagination();
  5879. this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
  5880. if (this.options.sidePagination === 'server') {
  5881. this.initServer();
  5882. } else {
  5883. this.initBody();
  5884. }
  5885. }
  5886. }, {
  5887. key: "onPageListChange",
  5888. value: function onPageListChange(event) {
  5889. event.preventDefault();
  5890. var $this = $__default["default"](event.currentTarget);
  5891. $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
  5892. this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
  5893. this.$toolbar.find('.page-size').text(this.options.pageSize);
  5894. this.updatePagination(event);
  5895. return false;
  5896. }
  5897. }, {
  5898. key: "onPagePre",
  5899. value: function onPagePre(event) {
  5900. if ($__default["default"](event.target).hasClass('disabled')) {
  5901. return;
  5902. }
  5903. event.preventDefault();
  5904. if (this.options.pageNumber - 1 === 0) {
  5905. this.options.pageNumber = this.options.totalPages;
  5906. } else {
  5907. this.options.pageNumber--;
  5908. }
  5909. this.updatePagination(event);
  5910. return false;
  5911. }
  5912. }, {
  5913. key: "onPageNext",
  5914. value: function onPageNext(event) {
  5915. if ($__default["default"](event.target).hasClass('disabled')) {
  5916. return;
  5917. }
  5918. event.preventDefault();
  5919. if (this.options.pageNumber + 1 > this.options.totalPages) {
  5920. this.options.pageNumber = 1;
  5921. } else {
  5922. this.options.pageNumber++;
  5923. }
  5924. this.updatePagination(event);
  5925. return false;
  5926. }
  5927. }, {
  5928. key: "onPageNumber",
  5929. value: function onPageNumber(event) {
  5930. event.preventDefault();
  5931. if (this.options.pageNumber === +$__default["default"](event.currentTarget).text()) {
  5932. return;
  5933. }
  5934. this.options.pageNumber = +$__default["default"](event.currentTarget).text();
  5935. this.updatePagination(event);
  5936. return false;
  5937. }
  5938. // eslint-disable-next-line no-unused-vars
  5939. }, {
  5940. key: "initRow",
  5941. value: function initRow(item, i, data, trFragments) {
  5942. var _this7 = this;
  5943. var html = [];
  5944. var style = {};
  5945. var csses = [];
  5946. var data_ = '';
  5947. var attributes = {};
  5948. var htmlAttributes = [];
  5949. if (Utils.findIndex(this.hiddenRows, item) > -1) {
  5950. return;
  5951. }
  5952. style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
  5953. if (style && style.css) {
  5954. for (var _i8 = 0, _Object$entries7 = Object.entries(style.css); _i8 < _Object$entries7.length; _i8++) {
  5955. var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
  5956. key = _Object$entries7$_i[0],
  5957. value = _Object$entries7$_i[1];
  5958. csses.push("".concat(key, ": ").concat(value));
  5959. }
  5960. }
  5961. attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
  5962. if (attributes) {
  5963. for (var _i9 = 0, _Object$entries8 = Object.entries(attributes); _i9 < _Object$entries8.length; _i9++) {
  5964. var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
  5965. _key2 = _Object$entries8$_i[0],
  5966. _value = _Object$entries8$_i[1];
  5967. htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
  5968. }
  5969. }
  5970. if (item._data && !Utils.isEmptyObject(item._data)) {
  5971. for (var _i10 = 0, _Object$entries9 = Object.entries(item._data); _i10 < _Object$entries9.length; _i10++) {
  5972. var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
  5973. k = _Object$entries9$_i[0],
  5974. v = _Object$entries9$_i[1];
  5975. // ignore data-index
  5976. if (k === 'index') {
  5977. return;
  5978. }
  5979. data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
  5980. }
  5981. }
  5982. html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
  5983. if (this.options.cardView) {
  5984. html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
  5985. }
  5986. var detailViewTemplate = '';
  5987. if (Utils.hasDetailViewIcon(this.options)) {
  5988. detailViewTemplate = '<td>';
  5989. if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
  5990. detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
  5991. }
  5992. detailViewTemplate += '</td>';
  5993. }
  5994. if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
  5995. html.push(detailViewTemplate);
  5996. }
  5997. this.header.fields.forEach(function (field, j) {
  5998. var column = _this7.columns[j];
  5999. var text = '';
  6000. var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
  6001. var value = '';
  6002. var type = '';
  6003. var cellStyle = {};
  6004. var id_ = '';
  6005. var class_ = _this7.header.classes[j];
  6006. var style_ = '';
  6007. var styleToAdd_ = '';
  6008. var data_ = '';
  6009. var rowspan_ = '';
  6010. var colspan_ = '';
  6011. var title_ = '';
  6012. if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
  6013. if (!column.checkbox && !column.radio) {
  6014. return;
  6015. }
  6016. }
  6017. if (!column.visible) {
  6018. return;
  6019. }
  6020. if (_this7.options.cardView && !column.cardVisible) {
  6021. return;
  6022. }
  6023. // Style concat
  6024. if (csses.concat([_this7.header.styles[j]]).length) {
  6025. styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
  6026. }
  6027. if (item["_".concat(field, "_style")]) {
  6028. styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
  6029. }
  6030. if (styleToAdd_) {
  6031. style_ = " style=\"".concat(styleToAdd_, "\"");
  6032. }
  6033. // Style concat
  6034. // handle id and class of td
  6035. if (item["_".concat(field, "_id")]) {
  6036. id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
  6037. }
  6038. if (item["_".concat(field, "_class")]) {
  6039. class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
  6040. }
  6041. if (item["_".concat(field, "_rowspan")]) {
  6042. rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
  6043. }
  6044. if (item["_".concat(field, "_colspan")]) {
  6045. colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
  6046. }
  6047. if (item["_".concat(field, "_title")]) {
  6048. title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
  6049. }
  6050. cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
  6051. if (cellStyle.classes) {
  6052. class_ = " class=\"".concat(cellStyle.classes, "\"");
  6053. }
  6054. if (cellStyle.css) {
  6055. var csses_ = [];
  6056. for (var _i11 = 0, _Object$entries10 = Object.entries(cellStyle.css); _i11 < _Object$entries10.length; _i11++) {
  6057. var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
  6058. _key3 = _Object$entries10$_i[0],
  6059. _value2 = _Object$entries10$_i[1];
  6060. csses_.push("".concat(_key3, ": ").concat(_value2));
  6061. }
  6062. style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
  6063. }
  6064. value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
  6065. if (!(column.checkbox || column.radio)) {
  6066. value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
  6067. }
  6068. if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
  6069. var defValue = '';
  6070. var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6071. if (_this7.options.searchAccentNeutralise) {
  6072. var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
  6073. var match = indexRegex.exec(Utils.normalizeAccent(value));
  6074. if (match) {
  6075. searchText = value.substring(match.index, match.index + searchText.length);
  6076. }
  6077. }
  6078. var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
  6079. var marker = '<mark>$1</mark>';
  6080. var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
  6081. if (isHTML) {
  6082. // value can contains a HTML tags
  6083. var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
  6084. var textReplaced = textContent.replace(regExp, marker);
  6085. textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6086. defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
  6087. } else {
  6088. // but usually not
  6089. defValue = value.toString().replace(regExp, marker);
  6090. }
  6091. value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
  6092. }
  6093. if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
  6094. for (var _i12 = 0, _Object$entries11 = Object.entries(item["_".concat(field, "_data")]); _i12 < _Object$entries11.length; _i12++) {
  6095. var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
  6096. _k = _Object$entries11$_i[0],
  6097. _v = _Object$entries11$_i[1];
  6098. // ignore data-index
  6099. if (_k === 'index') {
  6100. return;
  6101. }
  6102. data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
  6103. }
  6104. }
  6105. if (column.checkbox || column.radio) {
  6106. type = column.checkbox ? 'checkbox' : type;
  6107. type = column.radio ? 'radio' : type;
  6108. var c = column['class'] || '';
  6109. var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
  6110. var isDisabled = !column.checkboxEnabled || value && value.disabled;
  6111. text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
  6112. item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
  6113. } else if (_this7.options.cardView) {
  6114. var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
  6115. text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
  6116. if (_this7.options.smartDisplay && value === '') {
  6117. text = '<div class="card-view"></div>';
  6118. }
  6119. } else {
  6120. text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
  6121. }
  6122. html.push(text);
  6123. });
  6124. if (detailViewTemplate && this.options.detailViewAlign === 'right') {
  6125. html.push(detailViewTemplate);
  6126. }
  6127. if (this.options.cardView) {
  6128. html.push('</div></td>');
  6129. }
  6130. html.push('</tr>');
  6131. return html.join('');
  6132. }
  6133. }, {
  6134. key: "initBody",
  6135. value: function initBody(fixedScroll, updatedUid) {
  6136. var _this8 = this;
  6137. var data = this.getData();
  6138. this.trigger('pre-body', data);
  6139. this.$body = this.$el.find('>tbody');
  6140. if (!this.$body.length) {
  6141. this.$body = $__default["default"]('<tbody></tbody>').appendTo(this.$el);
  6142. }
  6143. // Fix #389 Bootstrap-table-flatJSON is not working
  6144. if (!this.options.pagination || this.options.sidePagination === 'server') {
  6145. this.pageFrom = 1;
  6146. this.pageTo = data.length;
  6147. }
  6148. var rows = [];
  6149. var trFragments = $__default["default"](document.createDocumentFragment());
  6150. var hasTr = false;
  6151. var toExpand = [];
  6152. this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
  6153. for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
  6154. var item = data[i];
  6155. var tr = this.initRow(item, i, data, trFragments);
  6156. hasTr = hasTr || !!tr;
  6157. if (tr && typeof tr === 'string') {
  6158. var uniqueId = this.options.uniqueId;
  6159. if (uniqueId && item.hasOwnProperty(uniqueId)) {
  6160. var itemUniqueId = item[uniqueId];
  6161. var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
  6162. var oldTrNext = oldTr.next();
  6163. if (oldTrNext.is('tr.detail-view')) {
  6164. toExpand.push(i);
  6165. if (!updatedUid || itemUniqueId !== updatedUid) {
  6166. tr += oldTrNext[0].outerHTML;
  6167. }
  6168. }
  6169. }
  6170. if (!this.options.virtualScroll) {
  6171. trFragments.append(tr);
  6172. } else {
  6173. rows.push(tr);
  6174. }
  6175. }
  6176. }
  6177. // show no records
  6178. if (!hasTr) {
  6179. this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
  6180. } else if (!this.options.virtualScroll) {
  6181. this.$body.html(trFragments);
  6182. } else {
  6183. if (this.virtualScroll) {
  6184. this.virtualScroll.destroy();
  6185. }
  6186. this.virtualScroll = new VirtualScroll({
  6187. rows: rows,
  6188. fixedScroll: fixedScroll,
  6189. scrollEl: this.$tableBody[0],
  6190. contentEl: this.$body[0],
  6191. itemHeight: this.options.virtualScrollItemHeight,
  6192. callback: function callback(startIndex, endIndex) {
  6193. _this8.fitHeader();
  6194. _this8.initBodyEvent();
  6195. _this8.trigger('virtual-scroll', startIndex, endIndex);
  6196. }
  6197. });
  6198. }
  6199. toExpand.forEach(function (index) {
  6200. _this8.expandRow(index);
  6201. });
  6202. if (!fixedScroll) {
  6203. this.scrollTo(0);
  6204. }
  6205. this.initBodyEvent();
  6206. this.initFooter();
  6207. this.resetView();
  6208. this.updateSelected();
  6209. if (this.options.sidePagination !== 'server') {
  6210. this.options.totalRows = data.length;
  6211. }
  6212. this.trigger('post-body', data);
  6213. }
  6214. }, {
  6215. key: "initBodyEvent",
  6216. value: function initBodyEvent() {
  6217. var _this9 = this;
  6218. // click to select by column
  6219. this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
  6220. var $td = $__default["default"](e.currentTarget);
  6221. if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) {
  6222. return;
  6223. }
  6224. var $tr = $td.parent();
  6225. var $cardViewArr = $__default["default"](e.target).parents('.card-views').children();
  6226. var $cardViewTarget = $__default["default"](e.target).parents('.card-view');
  6227. var rowIndex = $tr.data('index');
  6228. var item = _this9.data[rowIndex];
  6229. var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
  6230. var fields = _this9.getVisibleFields();
  6231. var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
  6232. var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
  6233. var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
  6234. _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
  6235. _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field);
  6236. // if click to select - then trigger the checkbox/radio click
  6237. if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
  6238. var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
  6239. if ($selectItem.length) {
  6240. $selectItem[0].click();
  6241. }
  6242. }
  6243. if (e.type === 'click' && _this9.options.detailViewByClick) {
  6244. _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
  6245. }
  6246. }).off('mousedown').on('mousedown', function (e) {
  6247. // https://github.com/jquery/jquery/issues/1741
  6248. _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
  6249. _this9.multipleSelectRowShiftKey = e.shiftKey;
  6250. });
  6251. this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
  6252. e.preventDefault();
  6253. _this9.toggleDetailView($__default["default"](e.currentTarget).parent().parent().data('index'));
  6254. return false;
  6255. });
  6256. this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
  6257. this.$selectItem.off('click').on('click', function (e) {
  6258. e.stopImmediatePropagation();
  6259. var $this = $__default["default"](e.currentTarget);
  6260. _this9._toggleCheck($this.prop('checked'), $this.data('index'));
  6261. });
  6262. this.header.events.forEach(function (_events, i) {
  6263. var events = _events;
  6264. if (!events) {
  6265. return;
  6266. }
  6267. // fix bug, if events is defined with namespace
  6268. if (typeof events === 'string') {
  6269. events = Utils.calculateObjectValue(null, events);
  6270. }
  6271. if (!events) {
  6272. throw new Error("Unknown event in the scope: ".concat(_events));
  6273. }
  6274. var field = _this9.header.fields[i];
  6275. var fieldIndex = _this9.getVisibleFields().indexOf(field);
  6276. if (fieldIndex === -1) {
  6277. return;
  6278. }
  6279. fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
  6280. var _loop2 = function _loop2(key) {
  6281. if (!events.hasOwnProperty(key)) {
  6282. return "continue";
  6283. }
  6284. var event = events[key];
  6285. _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
  6286. var $tr = $__default["default"](tr);
  6287. var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
  6288. var index = key.indexOf(' ');
  6289. var name = key.substring(0, index);
  6290. var el = key.substring(index + 1);
  6291. $td.find(el).off(name).on(name, function (e) {
  6292. var index = $tr.data('index');
  6293. var row = _this9.data[index];
  6294. var value = row[field];
  6295. event.apply(_this9, [e, value, row, index]);
  6296. });
  6297. });
  6298. };
  6299. for (var key in events) {
  6300. var _ret2 = _loop2(key);
  6301. if (_ret2 === "continue") continue;
  6302. }
  6303. });
  6304. }
  6305. }, {
  6306. key: "initServer",
  6307. value: function initServer(silent, query, url) {
  6308. var _this10 = this;
  6309. var data = {};
  6310. var index = this.header.fields.indexOf(this.options.sortName);
  6311. var params = {
  6312. searchText: this.searchText,
  6313. sortName: this.options.sortName,
  6314. sortOrder: this.options.sortOrder
  6315. };
  6316. if (this.header.sortNames[index]) {
  6317. params.sortName = this.header.sortNames[index];
  6318. }
  6319. if (this.options.pagination && this.options.sidePagination === 'server') {
  6320. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  6321. params.pageNumber = this.options.pageNumber;
  6322. }
  6323. if (!(url || this.options.url) && !this.options.ajax) {
  6324. return;
  6325. }
  6326. if (this.options.queryParamsType === 'limit') {
  6327. params = {
  6328. search: params.searchText,
  6329. sort: params.sortName,
  6330. order: params.sortOrder
  6331. };
  6332. if (this.options.pagination && this.options.sidePagination === 'server') {
  6333. params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
  6334. params.limit = this.options.pageSize;
  6335. if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
  6336. delete params.limit;
  6337. }
  6338. }
  6339. }
  6340. if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
  6341. return !column.searchable;
  6342. }).length) {
  6343. params.searchable = [];
  6344. var _iterator2 = _createForOfIteratorHelper(this.columns),
  6345. _step2;
  6346. try {
  6347. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  6348. var column = _step2.value;
  6349. if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
  6350. params.searchable.push(column.field);
  6351. }
  6352. }
  6353. } catch (err) {
  6354. _iterator2.e(err);
  6355. } finally {
  6356. _iterator2.f();
  6357. }
  6358. }
  6359. if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
  6360. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  6361. }
  6362. $__default["default"].extend(params, query || {});
  6363. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  6364. // false to stop request
  6365. if (data === false) {
  6366. return;
  6367. }
  6368. if (!silent) {
  6369. this.showLoading();
  6370. }
  6371. var request = $__default["default"].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  6372. type: this.options.method,
  6373. url: url || this.options.url,
  6374. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  6375. cache: this.options.cache,
  6376. contentType: this.options.contentType,
  6377. dataType: this.options.dataType,
  6378. success: function success(_res, textStatus, jqXHR) {
  6379. var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
  6380. _this10.load(res);
  6381. _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
  6382. if (!silent) {
  6383. _this10.hideLoading();
  6384. }
  6385. if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
  6386. _this10.updatePagination();
  6387. }
  6388. },
  6389. error: function error(jqXHR) {
  6390. // abort ajax by multiple request
  6391. if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
  6392. _this10._xhrAbort = false;
  6393. return;
  6394. }
  6395. var data = [];
  6396. if (_this10.options.sidePagination === 'server') {
  6397. data = {};
  6398. data[_this10.options.totalField] = 0;
  6399. data[_this10.options.dataField] = [];
  6400. }
  6401. _this10.load(data);
  6402. _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
  6403. if (!silent) {
  6404. _this10.hideLoading();
  6405. }
  6406. }
  6407. });
  6408. if (this.options.ajax) {
  6409. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  6410. } else {
  6411. if (this._xhr && this._xhr.readyState !== 4) {
  6412. this._xhrAbort = true;
  6413. this._xhr.abort();
  6414. }
  6415. this._xhr = $__default["default"].ajax(request);
  6416. }
  6417. return data;
  6418. }
  6419. }, {
  6420. key: "initSearchText",
  6421. value: function initSearchText() {
  6422. if (this.options.search) {
  6423. this.searchText = '';
  6424. if (this.options.searchText !== '') {
  6425. var $search = Utils.getSearchInput(this);
  6426. $search.val(this.options.searchText);
  6427. this.onSearch({
  6428. currentTarget: $search,
  6429. firedByInitSearchText: true
  6430. });
  6431. }
  6432. }
  6433. }
  6434. }, {
  6435. key: "getCaret",
  6436. value: function getCaret() {
  6437. var _this11 = this;
  6438. this.$header.find('th').each(function (i, th) {
  6439. $__default["default"](th).find('.sortable').removeClass('desc asc').addClass($__default["default"](th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
  6440. });
  6441. }
  6442. }, {
  6443. key: "updateSelected",
  6444. value: function updateSelected() {
  6445. var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
  6446. this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
  6447. this.$selectItem.each(function (i, el) {
  6448. $__default["default"](el).closest('tr')[$__default["default"](el).prop('checked') ? 'addClass' : 'removeClass']('selected');
  6449. });
  6450. }
  6451. }, {
  6452. key: "updateRows",
  6453. value: function updateRows() {
  6454. var _this12 = this;
  6455. this.$selectItem.each(function (i, el) {
  6456. _this12.data[$__default["default"](el).data('index')][_this12.header.stateField] = $__default["default"](el).prop('checked');
  6457. });
  6458. }
  6459. }, {
  6460. key: "resetRows",
  6461. value: function resetRows() {
  6462. var _iterator3 = _createForOfIteratorHelper(this.data),
  6463. _step3;
  6464. try {
  6465. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  6466. var row = _step3.value;
  6467. this.$selectAll.prop('checked', false);
  6468. this.$selectItem.prop('checked', false);
  6469. if (this.header.stateField) {
  6470. row[this.header.stateField] = false;
  6471. }
  6472. }
  6473. } catch (err) {
  6474. _iterator3.e(err);
  6475. } finally {
  6476. _iterator3.f();
  6477. }
  6478. this.initHiddenRows();
  6479. }
  6480. }, {
  6481. key: "trigger",
  6482. value: function trigger(_name) {
  6483. var _this$options, _this$options2;
  6484. var name = "".concat(_name, ".bs.table");
  6485. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
  6486. args[_key4 - 1] = arguments[_key4];
  6487. }
  6488. (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
  6489. this.$el.trigger($__default["default"].Event(name, {
  6490. sender: this
  6491. }), args);
  6492. (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
  6493. this.$el.trigger($__default["default"].Event('all.bs.table', {
  6494. sender: this
  6495. }), [name, args]);
  6496. }
  6497. }, {
  6498. key: "resetHeader",
  6499. value: function resetHeader() {
  6500. var _this13 = this;
  6501. // fix #61: the hidden table reset header bug.
  6502. // fix bug: get $el.css('width') error sometime (height = 500)
  6503. clearTimeout(this.timeoutId_);
  6504. this.timeoutId_ = setTimeout(function () {
  6505. return _this13.fitHeader();
  6506. }, this.$el.is(':hidden') ? 100 : 0);
  6507. }
  6508. }, {
  6509. key: "fitHeader",
  6510. value: function fitHeader() {
  6511. var _this14 = this;
  6512. if (this.$el.is(':hidden')) {
  6513. this.timeoutId_ = setTimeout(function () {
  6514. return _this14.fitHeader();
  6515. }, 100);
  6516. return;
  6517. }
  6518. var fixedBody = this.$tableBody.get(0);
  6519. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6520. this.$el.css('margin-top', -this.$header.outerHeight());
  6521. var focused = $__default["default"](':focus');
  6522. if (focused.length > 0) {
  6523. var $th = focused.parents('th');
  6524. if ($th.length > 0) {
  6525. var dataField = $th.attr('data-field');
  6526. if (dataField !== undefined) {
  6527. var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
  6528. if ($headerTh.length > 0) {
  6529. $headerTh.find(':input').addClass('focus-temp');
  6530. }
  6531. }
  6532. }
  6533. }
  6534. this.$header_ = this.$header.clone(true, true);
  6535. this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
  6536. this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
  6537. this.$tableLoading.css('width', this.$el.outerWidth());
  6538. var focusedTemp = $__default["default"]('.focus-temp:visible:eq(0)');
  6539. if (focusedTemp.length > 0) {
  6540. focusedTemp.focus();
  6541. this.$header.find('.focus-temp').removeClass('focus-temp');
  6542. }
  6543. // fix bug: $.data() is not working as expected after $.append()
  6544. this.$header.find('th[data-field]').each(function (i, el) {
  6545. _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $__default["default"](el).data('field'))).data($__default["default"](el).data());
  6546. });
  6547. var visibleFields = this.getVisibleFields();
  6548. var $ths = this.$header_.find('th');
  6549. var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
  6550. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6551. $tr = $tr.next();
  6552. }
  6553. var trLength = $tr.find('> *').length;
  6554. $tr.find('> *').each(function (i, el) {
  6555. var $this = $__default["default"](el);
  6556. if (Utils.hasDetailViewIcon(_this14.options)) {
  6557. if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
  6558. var $thDetail = $ths.filter('.detail');
  6559. var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6560. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
  6561. return;
  6562. }
  6563. }
  6564. var index = i - Utils.getDetailViewIndexOffset(_this14.options);
  6565. var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
  6566. if ($th.length > 1) {
  6567. $th = $__default["default"]($ths[$this[0].cellIndex]);
  6568. }
  6569. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6570. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6571. });
  6572. this.horizontalScroll();
  6573. this.trigger('post-header');
  6574. }
  6575. }, {
  6576. key: "initFooter",
  6577. value: function initFooter() {
  6578. if (!this.options.showFooter || this.options.cardView) {
  6579. // do nothing
  6580. return;
  6581. }
  6582. var data = this.getData();
  6583. var html = [];
  6584. var detailTemplate = '';
  6585. if (Utils.hasDetailViewIcon(this.options)) {
  6586. detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
  6587. }
  6588. if (detailTemplate && this.options.detailViewAlign !== 'right') {
  6589. html.push(detailTemplate);
  6590. }
  6591. var _iterator4 = _createForOfIteratorHelper(this.columns),
  6592. _step4;
  6593. try {
  6594. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  6595. var column = _step4.value;
  6596. var falign = '';
  6597. var valign = '';
  6598. var csses = [];
  6599. var style = {};
  6600. var class_ = Utils.sprintf(' class="%s"', column['class']);
  6601. if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
  6602. continue;
  6603. }
  6604. if (this.options.cardView && !column.cardVisible) {
  6605. return;
  6606. }
  6607. falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
  6608. valign = Utils.sprintf('vertical-align: %s; ', column.valign);
  6609. style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
  6610. if (style && style.css) {
  6611. for (var _i13 = 0, _Object$entries12 = Object.entries(style.css); _i13 < _Object$entries12.length; _i13++) {
  6612. var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
  6613. key = _Object$entries12$_i[0],
  6614. _value3 = _Object$entries12$_i[1];
  6615. csses.push("".concat(key, ": ").concat(_value3));
  6616. }
  6617. }
  6618. if (style && style.classes) {
  6619. class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
  6620. }
  6621. html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
  6622. var colspan = 0;
  6623. if (this.footerData && this.footerData.length > 0) {
  6624. colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
  6625. }
  6626. if (colspan) {
  6627. html.push(" colspan=\"".concat(colspan, "\" "));
  6628. }
  6629. html.push('>');
  6630. html.push('<div class="th-inner">');
  6631. var value = '';
  6632. if (this.footerData && this.footerData.length > 0) {
  6633. value = this.footerData[0][column.field] || '';
  6634. }
  6635. html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
  6636. html.push('</div>');
  6637. html.push('<div class="fht-cell"></div>');
  6638. html.push('</div>');
  6639. html.push('</th>');
  6640. }
  6641. } catch (err) {
  6642. _iterator4.e(err);
  6643. } finally {
  6644. _iterator4.f();
  6645. }
  6646. if (detailTemplate && this.options.detailViewAlign === 'right') {
  6647. html.push(detailTemplate);
  6648. }
  6649. if (!this.options.height && !this.$tableFooter.length) {
  6650. this.$el.append('<tfoot><tr></tr></tfoot>');
  6651. this.$tableFooter = this.$el.find('tfoot');
  6652. }
  6653. if (!this.$tableFooter.find('tr').length) {
  6654. this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
  6655. }
  6656. this.$tableFooter.find('tr').html(html.join(''));
  6657. this.trigger('post-footer', this.$tableFooter);
  6658. }
  6659. }, {
  6660. key: "fitFooter",
  6661. value: function fitFooter() {
  6662. var _this15 = this;
  6663. if (this.$el.is(':hidden')) {
  6664. setTimeout(function () {
  6665. return _this15.fitFooter();
  6666. }, 100);
  6667. return;
  6668. }
  6669. var fixedBody = this.$tableBody.get(0);
  6670. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6671. this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
  6672. var $ths = this.$tableFooter.find('th');
  6673. var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
  6674. $ths.find('.fht-cell').width('auto');
  6675. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6676. $tr = $tr.next();
  6677. }
  6678. var trLength = $tr.find('> *').length;
  6679. $tr.find('> *').each(function (i, el) {
  6680. var $this = $__default["default"](el);
  6681. if (Utils.hasDetailViewIcon(_this15.options)) {
  6682. if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
  6683. var $thDetail = $ths.filter('.detail');
  6684. var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6685. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
  6686. return;
  6687. }
  6688. }
  6689. var $th = $ths.eq(i);
  6690. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6691. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6692. });
  6693. this.horizontalScroll();
  6694. }
  6695. }, {
  6696. key: "horizontalScroll",
  6697. value: function horizontalScroll() {
  6698. var _this16 = this;
  6699. // horizontal scroll event
  6700. // TODO: it's probably better improving the layout than binding to scroll event
  6701. this.$tableBody.off('scroll').on('scroll', function () {
  6702. var scrollLeft = _this16.$tableBody.scrollLeft();
  6703. if (_this16.options.showHeader && _this16.options.height) {
  6704. _this16.$tableHeader.scrollLeft(scrollLeft);
  6705. }
  6706. if (_this16.options.showFooter && !_this16.options.cardView) {
  6707. _this16.$tableFooter.scrollLeft(scrollLeft);
  6708. }
  6709. _this16.trigger('scroll-body', _this16.$tableBody);
  6710. });
  6711. }
  6712. }, {
  6713. key: "getVisibleFields",
  6714. value: function getVisibleFields() {
  6715. var visibleFields = [];
  6716. var _iterator5 = _createForOfIteratorHelper(this.header.fields),
  6717. _step5;
  6718. try {
  6719. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  6720. var field = _step5.value;
  6721. var column = this.columns[this.fieldsColumnsIndex[field]];
  6722. if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
  6723. continue;
  6724. }
  6725. visibleFields.push(field);
  6726. }
  6727. } catch (err) {
  6728. _iterator5.e(err);
  6729. } finally {
  6730. _iterator5.f();
  6731. }
  6732. return visibleFields;
  6733. }
  6734. }, {
  6735. key: "initHiddenRows",
  6736. value: function initHiddenRows() {
  6737. this.hiddenRows = [];
  6738. }
  6739. // PUBLIC FUNCTION DEFINITION
  6740. // =======================
  6741. }, {
  6742. key: "getOptions",
  6743. value: function getOptions() {
  6744. // deep copy and remove data
  6745. var options = $__default["default"].extend({}, this.options);
  6746. delete options.data;
  6747. return $__default["default"].extend(true, {}, options);
  6748. }
  6749. }, {
  6750. key: "refreshOptions",
  6751. value: function refreshOptions(options) {
  6752. // If the objects are equivalent then avoid the call of destroy / init methods
  6753. if (Utils.compareObjects(this.options, options, true)) {
  6754. return;
  6755. }
  6756. this.options = $__default["default"].extend(this.options, options);
  6757. this.trigger('refresh-options', this.options);
  6758. this.destroy();
  6759. this.init();
  6760. }
  6761. }, {
  6762. key: "getData",
  6763. value: function getData(params) {
  6764. var _this17 = this;
  6765. var data = this.options.data;
  6766. if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort ||
  6767. // Fix #4616: this.enableCustomSort is for extensions
  6768. !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
  6769. data = this.data;
  6770. }
  6771. if (params && params.useCurrentPage) {
  6772. data = data.slice(this.pageFrom - 1, this.pageTo);
  6773. }
  6774. if (params && !params.includeHiddenRows) {
  6775. var hiddenRows = this.getHiddenRows();
  6776. data = data.filter(function (row) {
  6777. return Utils.findIndex(hiddenRows, row) === -1;
  6778. });
  6779. }
  6780. if (params && params.formatted) {
  6781. data.forEach(function (row) {
  6782. for (var _i14 = 0, _Object$entries13 = Object.entries(row); _i14 < _Object$entries13.length; _i14++) {
  6783. var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
  6784. key = _Object$entries13$_i[0],
  6785. value = _Object$entries13$_i[1];
  6786. var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
  6787. if (!column) {
  6788. return;
  6789. }
  6790. row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
  6791. }
  6792. });
  6793. }
  6794. return data;
  6795. }
  6796. }, {
  6797. key: "getSelections",
  6798. value: function getSelections() {
  6799. var _this18 = this;
  6800. return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
  6801. return row[_this18.header.stateField] === true;
  6802. });
  6803. }
  6804. }, {
  6805. key: "load",
  6806. value: function load(_data) {
  6807. var fixedScroll = false;
  6808. var data = _data;
  6809. // #431: support pagination
  6810. if (this.options.pagination && this.options.sidePagination === 'server') {
  6811. this.options.totalRows = data[this.options.totalField];
  6812. this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
  6813. this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
  6814. }
  6815. fixedScroll = data.fixedScroll;
  6816. data = Array.isArray(data) ? data : data[this.options.dataField];
  6817. this.initData(data);
  6818. this.initSearch();
  6819. this.initPagination();
  6820. this.initBody(fixedScroll);
  6821. }
  6822. }, {
  6823. key: "append",
  6824. value: function append(data) {
  6825. this.initData(data, 'append');
  6826. this.initSearch();
  6827. this.initPagination();
  6828. this.initSort();
  6829. this.initBody(true);
  6830. }
  6831. }, {
  6832. key: "prepend",
  6833. value: function prepend(data) {
  6834. this.initData(data, 'prepend');
  6835. this.initSearch();
  6836. this.initPagination();
  6837. this.initSort();
  6838. this.initBody(true);
  6839. }
  6840. }, {
  6841. key: "remove",
  6842. value: function remove(params) {
  6843. var removed = 0;
  6844. for (var i = this.options.data.length - 1; i >= 0; i--) {
  6845. var row = this.options.data[i];
  6846. var value = Utils.getItemField(row, params.field, this.options.escape, row.escape);
  6847. if (value === undefined && params.field !== '$index') {
  6848. continue;
  6849. }
  6850. if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(value)) {
  6851. removed++;
  6852. this.options.data.splice(i, 1);
  6853. }
  6854. }
  6855. if (!removed) {
  6856. return;
  6857. }
  6858. if (this.options.sidePagination === 'server') {
  6859. this.options.totalRows -= removed;
  6860. this.data = _toConsumableArray(this.options.data);
  6861. }
  6862. this.initSearch();
  6863. this.initPagination();
  6864. this.initSort();
  6865. this.initBody(true);
  6866. }
  6867. }, {
  6868. key: "removeAll",
  6869. value: function removeAll() {
  6870. if (this.options.data.length > 0) {
  6871. this.options.data.splice(0, this.options.data.length);
  6872. this.initSearch();
  6873. this.initPagination();
  6874. this.initBody(true);
  6875. }
  6876. }
  6877. }, {
  6878. key: "insertRow",
  6879. value: function insertRow(params) {
  6880. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
  6881. return;
  6882. }
  6883. this.options.data.splice(params.index, 0, params.row);
  6884. this.initSearch();
  6885. this.initPagination();
  6886. this.initSort();
  6887. this.initBody(true);
  6888. }
  6889. }, {
  6890. key: "updateRow",
  6891. value: function updateRow(params) {
  6892. var allParams = Array.isArray(params) ? params : [params];
  6893. var _iterator6 = _createForOfIteratorHelper(allParams),
  6894. _step6;
  6895. try {
  6896. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  6897. var _params = _step6.value;
  6898. if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
  6899. continue;
  6900. }
  6901. if (_params.hasOwnProperty('replace') && _params.replace) {
  6902. this.options.data[_params.index] = _params.row;
  6903. } else {
  6904. $__default["default"].extend(this.options.data[_params.index], _params.row);
  6905. }
  6906. }
  6907. } catch (err) {
  6908. _iterator6.e(err);
  6909. } finally {
  6910. _iterator6.f();
  6911. }
  6912. this.initSearch();
  6913. this.initPagination();
  6914. this.initSort();
  6915. this.initBody(true);
  6916. }
  6917. }, {
  6918. key: "getRowByUniqueId",
  6919. value: function getRowByUniqueId(_id) {
  6920. var uniqueId = this.options.uniqueId;
  6921. var len = this.options.data.length;
  6922. var id = _id;
  6923. var dataRow = null;
  6924. var i;
  6925. var row;
  6926. for (i = len - 1; i >= 0; i--) {
  6927. row = this.options.data[i];
  6928. var rowUniqueId = Utils.getItemField(row, uniqueId, this.options.escape, row.escape);
  6929. if (rowUniqueId === undefined) {
  6930. continue;
  6931. }
  6932. if (typeof rowUniqueId === 'string') {
  6933. id = id.toString();
  6934. } else if (typeof rowUniqueId === 'number') {
  6935. if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
  6936. id = parseInt(id, 10);
  6937. } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
  6938. id = parseFloat(id);
  6939. }
  6940. }
  6941. if (rowUniqueId === id) {
  6942. dataRow = row;
  6943. break;
  6944. }
  6945. }
  6946. return dataRow;
  6947. }
  6948. }, {
  6949. key: "updateByUniqueId",
  6950. value: function updateByUniqueId(params) {
  6951. var allParams = Array.isArray(params) ? params : [params];
  6952. var updatedUid = null;
  6953. var _iterator7 = _createForOfIteratorHelper(allParams),
  6954. _step7;
  6955. try {
  6956. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  6957. var _params2 = _step7.value;
  6958. if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
  6959. continue;
  6960. }
  6961. var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
  6962. if (rowId === -1) {
  6963. continue;
  6964. }
  6965. if (_params2.hasOwnProperty('replace') && _params2.replace) {
  6966. this.options.data[rowId] = _params2.row;
  6967. } else {
  6968. $__default["default"].extend(this.options.data[rowId], _params2.row);
  6969. }
  6970. updatedUid = _params2.id;
  6971. }
  6972. } catch (err) {
  6973. _iterator7.e(err);
  6974. } finally {
  6975. _iterator7.f();
  6976. }
  6977. this.initSearch();
  6978. this.initPagination();
  6979. this.initSort();
  6980. this.initBody(true, updatedUid);
  6981. }
  6982. }, {
  6983. key: "removeByUniqueId",
  6984. value: function removeByUniqueId(id) {
  6985. var len = this.options.data.length;
  6986. var row = this.getRowByUniqueId(id);
  6987. if (row) {
  6988. this.options.data.splice(this.options.data.indexOf(row), 1);
  6989. }
  6990. if (len === this.options.data.length) {
  6991. return;
  6992. }
  6993. if (this.options.sidePagination === 'server') {
  6994. this.options.totalRows -= 1;
  6995. this.data = _toConsumableArray(this.options.data);
  6996. }
  6997. this.initSearch();
  6998. this.initPagination();
  6999. this.initBody(true);
  7000. }
  7001. }, {
  7002. key: "_updateCellOnly",
  7003. value: function _updateCellOnly(field, index) {
  7004. var rowHtml = this.initRow(this.options.data[index], index);
  7005. var fieldIndex = this.getVisibleFields().indexOf(field);
  7006. if (fieldIndex === -1) {
  7007. return;
  7008. }
  7009. fieldIndex += Utils.getDetailViewIndexOffset(this.options);
  7010. this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($__default["default"](rowHtml).find(">td:eq(".concat(fieldIndex, ")")));
  7011. this.initBodyEvent();
  7012. this.initFooter();
  7013. this.resetView();
  7014. this.updateSelected();
  7015. }
  7016. }, {
  7017. key: "updateCell",
  7018. value: function updateCell(params) {
  7019. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
  7020. return;
  7021. }
  7022. this.options.data[params.index][params.field] = params.value;
  7023. if (params.reinit === false) {
  7024. this._updateCellOnly(params.field, params.index);
  7025. return;
  7026. }
  7027. this.initSort();
  7028. this.initBody(true);
  7029. }
  7030. }, {
  7031. key: "updateCellByUniqueId",
  7032. value: function updateCellByUniqueId(params) {
  7033. var _this19 = this;
  7034. var allParams = Array.isArray(params) ? params : [params];
  7035. allParams.forEach(function (_ref6) {
  7036. var id = _ref6.id,
  7037. field = _ref6.field,
  7038. value = _ref6.value;
  7039. var index = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
  7040. if (index === -1) {
  7041. return;
  7042. }
  7043. _this19.options.data[index][field] = value;
  7044. });
  7045. if (params.reinit === false) {
  7046. this._updateCellOnly(params.field, this.options.data.indexOf(this.getRowByUniqueId(params.id)));
  7047. return;
  7048. }
  7049. this.initSort();
  7050. this.initBody(true);
  7051. }
  7052. }, {
  7053. key: "showRow",
  7054. value: function showRow(params) {
  7055. this._toggleRow(params, true);
  7056. }
  7057. }, {
  7058. key: "hideRow",
  7059. value: function hideRow(params) {
  7060. this._toggleRow(params, false);
  7061. }
  7062. }, {
  7063. key: "_toggleRow",
  7064. value: function _toggleRow(params, visible) {
  7065. var row;
  7066. if (params.hasOwnProperty('index')) {
  7067. row = this.getData()[params.index];
  7068. } else if (params.hasOwnProperty('uniqueId')) {
  7069. row = this.getRowByUniqueId(params.uniqueId);
  7070. }
  7071. if (!row) {
  7072. return;
  7073. }
  7074. var index = Utils.findIndex(this.hiddenRows, row);
  7075. if (!visible && index === -1) {
  7076. this.hiddenRows.push(row);
  7077. } else if (visible && index > -1) {
  7078. this.hiddenRows.splice(index, 1);
  7079. }
  7080. this.initBody(true);
  7081. this.initPagination();
  7082. }
  7083. }, {
  7084. key: "getHiddenRows",
  7085. value: function getHiddenRows(show) {
  7086. if (show) {
  7087. this.initHiddenRows();
  7088. this.initBody(true);
  7089. this.initPagination();
  7090. return;
  7091. }
  7092. var data = this.getData();
  7093. var rows = [];
  7094. var _iterator8 = _createForOfIteratorHelper(data),
  7095. _step8;
  7096. try {
  7097. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  7098. var row = _step8.value;
  7099. if (this.hiddenRows.includes(row)) {
  7100. rows.push(row);
  7101. }
  7102. }
  7103. } catch (err) {
  7104. _iterator8.e(err);
  7105. } finally {
  7106. _iterator8.f();
  7107. }
  7108. this.hiddenRows = rows;
  7109. return rows;
  7110. }
  7111. }, {
  7112. key: "showColumn",
  7113. value: function showColumn(field) {
  7114. var _this20 = this;
  7115. var fields = Array.isArray(field) ? field : [field];
  7116. fields.forEach(function (field) {
  7117. _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
  7118. });
  7119. }
  7120. }, {
  7121. key: "hideColumn",
  7122. value: function hideColumn(field) {
  7123. var _this21 = this;
  7124. var fields = Array.isArray(field) ? field : [field];
  7125. fields.forEach(function (field) {
  7126. _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
  7127. });
  7128. }
  7129. }, {
  7130. key: "_toggleColumn",
  7131. value: function _toggleColumn(index, checked, needUpdate) {
  7132. if (index === -1 || this.columns[index].visible === checked) {
  7133. return;
  7134. }
  7135. this.columns[index].visible = checked;
  7136. this.initHeader();
  7137. this.initSearch();
  7138. this.initPagination();
  7139. this.initBody();
  7140. if (this.options.showColumns) {
  7141. var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
  7142. if (needUpdate) {
  7143. $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
  7144. }
  7145. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7146. $items.filter(':checked').prop('disabled', true);
  7147. }
  7148. }
  7149. }
  7150. }, {
  7151. key: "getVisibleColumns",
  7152. value: function getVisibleColumns() {
  7153. var _this22 = this;
  7154. return this.columns.filter(function (column) {
  7155. return column.visible && !_this22.isSelectionColumn(column);
  7156. });
  7157. }
  7158. }, {
  7159. key: "getHiddenColumns",
  7160. value: function getHiddenColumns() {
  7161. return this.columns.filter(function (_ref7) {
  7162. var visible = _ref7.visible;
  7163. return !visible;
  7164. });
  7165. }
  7166. }, {
  7167. key: "isSelectionColumn",
  7168. value: function isSelectionColumn(column) {
  7169. return column.radio || column.checkbox;
  7170. }
  7171. }, {
  7172. key: "showAllColumns",
  7173. value: function showAllColumns() {
  7174. this._toggleAllColumns(true);
  7175. }
  7176. }, {
  7177. key: "hideAllColumns",
  7178. value: function hideAllColumns() {
  7179. this._toggleAllColumns(false);
  7180. }
  7181. }, {
  7182. key: "_toggleAllColumns",
  7183. value: function _toggleAllColumns(visible) {
  7184. var _this23 = this;
  7185. var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
  7186. _step9;
  7187. try {
  7188. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  7189. var column = _step9.value;
  7190. if (column.switchable) {
  7191. if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
  7192. return it.switchable;
  7193. }).length === this.options.minimumCountColumns) {
  7194. continue;
  7195. }
  7196. column.visible = visible;
  7197. }
  7198. }
  7199. } catch (err) {
  7200. _iterator9.e(err);
  7201. } finally {
  7202. _iterator9.f();
  7203. }
  7204. this.initHeader();
  7205. this.initSearch();
  7206. this.initPagination();
  7207. this.initBody();
  7208. if (this.options.showColumns) {
  7209. var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
  7210. if (visible) {
  7211. $items.prop('checked', visible);
  7212. } else {
  7213. $items.get().reverse().forEach(function (item) {
  7214. if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
  7215. $__default["default"](item).prop('checked', visible);
  7216. }
  7217. });
  7218. }
  7219. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7220. $items.filter(':checked').prop('disabled', true);
  7221. }
  7222. }
  7223. }
  7224. }, {
  7225. key: "mergeCells",
  7226. value: function mergeCells(options) {
  7227. var row = options.index;
  7228. var col = this.getVisibleFields().indexOf(options.field);
  7229. var rowspan = options.rowspan || 1;
  7230. var colspan = options.colspan || 1;
  7231. var i;
  7232. var j;
  7233. var $tr = this.$body.find('>tr[data-index]');
  7234. col += Utils.getDetailViewIndexOffset(this.options);
  7235. var $td = $tr.eq(row).find('>td').eq(col);
  7236. if (row < 0 || col < 0 || row >= this.data.length) {
  7237. return;
  7238. }
  7239. for (i = row; i < row + rowspan; i++) {
  7240. for (j = col; j < col + colspan; j++) {
  7241. $tr.eq(i).find('>td').eq(j).hide();
  7242. }
  7243. }
  7244. $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
  7245. }
  7246. }, {
  7247. key: "checkAll",
  7248. value: function checkAll() {
  7249. this._toggleCheckAll(true);
  7250. }
  7251. }, {
  7252. key: "uncheckAll",
  7253. value: function uncheckAll() {
  7254. this._toggleCheckAll(false);
  7255. }
  7256. }, {
  7257. key: "_toggleCheckAll",
  7258. value: function _toggleCheckAll(checked) {
  7259. var rowsBefore = this.getSelections();
  7260. this.$selectAll.add(this.$selectAll_).prop('checked', checked);
  7261. this.$selectItem.filter(':enabled').prop('checked', checked);
  7262. this.updateRows();
  7263. this.updateSelected();
  7264. var rowsAfter = this.getSelections();
  7265. if (checked) {
  7266. this.trigger('check-all', rowsAfter, rowsBefore);
  7267. return;
  7268. }
  7269. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  7270. }
  7271. }, {
  7272. key: "checkInvert",
  7273. value: function checkInvert() {
  7274. var $items = this.$selectItem.filter(':enabled');
  7275. var checked = $items.filter(':checked');
  7276. $items.each(function (i, el) {
  7277. $__default["default"](el).prop('checked', !$__default["default"](el).prop('checked'));
  7278. });
  7279. this.updateRows();
  7280. this.updateSelected();
  7281. this.trigger('uncheck-some', checked);
  7282. checked = this.getSelections();
  7283. this.trigger('check-some', checked);
  7284. }
  7285. }, {
  7286. key: "check",
  7287. value: function check(index) {
  7288. this._toggleCheck(true, index);
  7289. }
  7290. }, {
  7291. key: "uncheck",
  7292. value: function uncheck(index) {
  7293. this._toggleCheck(false, index);
  7294. }
  7295. }, {
  7296. key: "_toggleCheck",
  7297. value: function _toggleCheck(checked, index) {
  7298. var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
  7299. var row = this.data[index];
  7300. if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
  7301. var _iterator10 = _createForOfIteratorHelper(this.options.data),
  7302. _step10;
  7303. try {
  7304. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  7305. var r = _step10.value;
  7306. r[this.header.stateField] = false;
  7307. }
  7308. } catch (err) {
  7309. _iterator10.e(err);
  7310. } finally {
  7311. _iterator10.f();
  7312. }
  7313. this.$selectItem.filter(':checked').not($el).prop('checked', false);
  7314. }
  7315. row[this.header.stateField] = checked;
  7316. if (this.options.multipleSelectRow) {
  7317. if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
  7318. var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
  7319. _ref9 = _slicedToArray(_ref8, 2),
  7320. fromIndex = _ref9[0],
  7321. toIndex = _ref9[1];
  7322. for (var i = fromIndex + 1; i < toIndex; i++) {
  7323. this.data[i][this.header.stateField] = true;
  7324. this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
  7325. }
  7326. }
  7327. this.multipleSelectRowCtrlKey = false;
  7328. this.multipleSelectRowShiftKey = false;
  7329. this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
  7330. }
  7331. $el.prop('checked', checked);
  7332. this.updateSelected();
  7333. this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
  7334. }
  7335. }, {
  7336. key: "checkBy",
  7337. value: function checkBy(obj) {
  7338. this._toggleCheckBy(true, obj);
  7339. }
  7340. }, {
  7341. key: "uncheckBy",
  7342. value: function uncheckBy(obj) {
  7343. this._toggleCheckBy(false, obj);
  7344. }
  7345. }, {
  7346. key: "_toggleCheckBy",
  7347. value: function _toggleCheckBy(checked, obj) {
  7348. var _this24 = this;
  7349. if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
  7350. return;
  7351. }
  7352. var rows = [];
  7353. this.data.forEach(function (row, i) {
  7354. if (!row.hasOwnProperty(obj.field)) {
  7355. return false;
  7356. }
  7357. if (obj.values.includes(row[obj.field])) {
  7358. var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
  7359. var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
  7360. $el = checked ? $el.not(':checked') : $el.filter(':checked');
  7361. if (!$el.length && onlyCurrentPage) {
  7362. return;
  7363. }
  7364. $el.prop('checked', checked);
  7365. row[_this24.header.stateField] = checked;
  7366. rows.push(row);
  7367. _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
  7368. }
  7369. });
  7370. this.updateSelected();
  7371. this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
  7372. }
  7373. }, {
  7374. key: "refresh",
  7375. value: function refresh(params) {
  7376. if (params && params.url) {
  7377. this.options.url = params.url;
  7378. }
  7379. if (params && params.pageNumber) {
  7380. this.options.pageNumber = params.pageNumber;
  7381. }
  7382. if (params && params.pageSize) {
  7383. this.options.pageSize = params.pageSize;
  7384. }
  7385. this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
  7386. }
  7387. }, {
  7388. key: "destroy",
  7389. value: function destroy() {
  7390. this.$el.insertBefore(this.$container);
  7391. $__default["default"](this.options.toolbar).insertBefore(this.$el);
  7392. this.$container.next().remove();
  7393. this.$container.remove();
  7394. this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class
  7395. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  7396. $__default["default"](window).off(resizeEvent);
  7397. }
  7398. }, {
  7399. key: "resetView",
  7400. value: function resetView(params) {
  7401. var padding = 0;
  7402. if (params && params.height) {
  7403. this.options.height = params.height;
  7404. }
  7405. this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
  7406. if (this.options.height) {
  7407. var fixedBody = this.$tableBody.get(0);
  7408. this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
  7409. }
  7410. if (!this.options.cardView && this.options.showHeader && this.options.height) {
  7411. this.$tableHeader.show();
  7412. this.resetHeader();
  7413. padding += this.$header.outerHeight(true) + 1;
  7414. } else {
  7415. this.$tableHeader.hide();
  7416. this.trigger('post-header');
  7417. }
  7418. if (!this.options.cardView && this.options.showFooter) {
  7419. this.$tableFooter.show();
  7420. this.fitFooter();
  7421. if (this.options.height) {
  7422. padding += this.$tableFooter.outerHeight(true);
  7423. }
  7424. }
  7425. if (this.$container.hasClass('fullscreen')) {
  7426. this.$tableContainer.css('height', '');
  7427. this.$tableContainer.css('width', '');
  7428. } else if (this.options.height) {
  7429. if (this.$tableBorder) {
  7430. this.$tableBorder.css('width', '');
  7431. this.$tableBorder.css('height', '');
  7432. }
  7433. var toolbarHeight = this.$toolbar.outerHeight(true);
  7434. var paginationHeight = this.$pagination.outerHeight(true);
  7435. var height = this.options.height - toolbarHeight - paginationHeight;
  7436. var $bodyTable = this.$tableBody.find('>table');
  7437. var tableHeight = $bodyTable.outerHeight();
  7438. this.$tableContainer.css('height', "".concat(height, "px"));
  7439. if (this.$tableBorder && $bodyTable.is(':visible')) {
  7440. var tableBorderHeight = height - tableHeight - 2;
  7441. if (this.hasScrollBar) {
  7442. tableBorderHeight -= Utils.getScrollBarWidth();
  7443. }
  7444. this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
  7445. this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
  7446. }
  7447. }
  7448. if (this.options.cardView) {
  7449. // remove the element css
  7450. this.$el.css('margin-top', '0');
  7451. this.$tableContainer.css('padding-bottom', '0');
  7452. this.$tableFooter.hide();
  7453. } else {
  7454. // Assign the correct sortable arrow
  7455. this.getCaret();
  7456. this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
  7457. }
  7458. this.trigger('reset-view');
  7459. }
  7460. }, {
  7461. key: "showLoading",
  7462. value: function showLoading() {
  7463. this.$tableLoading.toggleClass('open', true);
  7464. var fontSize = this.options.loadingFontSize;
  7465. if (this.options.loadingFontSize === 'auto') {
  7466. fontSize = this.$tableLoading.width() * 0.04;
  7467. fontSize = Math.max(12, fontSize);
  7468. fontSize = Math.min(32, fontSize);
  7469. fontSize = "".concat(fontSize, "px");
  7470. }
  7471. this.$tableLoading.find('.loading-text').css('font-size', fontSize);
  7472. }
  7473. }, {
  7474. key: "hideLoading",
  7475. value: function hideLoading() {
  7476. this.$tableLoading.toggleClass('open', false);
  7477. }
  7478. }, {
  7479. key: "togglePagination",
  7480. value: function togglePagination() {
  7481. this.options.pagination = !this.options.pagination;
  7482. var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
  7483. var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
  7484. this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
  7485. this.updatePagination();
  7486. this.trigger('toggle-pagination', this.options.pagination);
  7487. }
  7488. }, {
  7489. key: "toggleFullscreen",
  7490. value: function toggleFullscreen() {
  7491. this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
  7492. this.resetView();
  7493. }
  7494. }, {
  7495. key: "toggleView",
  7496. value: function toggleView() {
  7497. this.options.cardView = !this.options.cardView;
  7498. this.initHeader();
  7499. var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
  7500. var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
  7501. this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
  7502. this.initBody();
  7503. this.trigger('toggle', this.options.cardView);
  7504. }
  7505. }, {
  7506. key: "resetSearch",
  7507. value: function resetSearch(text) {
  7508. var $search = Utils.getSearchInput(this);
  7509. var textToUse = text || '';
  7510. $search.val(textToUse);
  7511. this.searchText = textToUse;
  7512. this.onSearch({
  7513. currentTarget: $search
  7514. }, false);
  7515. }
  7516. }, {
  7517. key: "filterBy",
  7518. value: function filterBy(columns, options) {
  7519. this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : $__default["default"].extend(this.options.filterOptions, options);
  7520. this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
  7521. this.options.pageNumber = 1;
  7522. this.initSearch();
  7523. this.updatePagination();
  7524. }
  7525. }, {
  7526. key: "scrollTo",
  7527. value: function scrollTo(params) {
  7528. var options = {
  7529. unit: 'px',
  7530. value: 0
  7531. };
  7532. if (_typeof(params) === 'object') {
  7533. options = Object.assign(options, params);
  7534. } else if (typeof params === 'string' && params === 'bottom') {
  7535. options.value = this.$tableBody[0].scrollHeight;
  7536. } else if (typeof params === 'string' || typeof params === 'number') {
  7537. options.value = params;
  7538. }
  7539. var scrollTo = options.value;
  7540. if (options.unit === 'rows') {
  7541. scrollTo = 0;
  7542. this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
  7543. scrollTo += $__default["default"](el).outerHeight(true);
  7544. });
  7545. }
  7546. this.$tableBody.scrollTop(scrollTo);
  7547. }
  7548. }, {
  7549. key: "getScrollPosition",
  7550. value: function getScrollPosition() {
  7551. return this.$tableBody.scrollTop();
  7552. }
  7553. }, {
  7554. key: "selectPage",
  7555. value: function selectPage(page) {
  7556. if (page > 0 && page <= this.options.totalPages) {
  7557. this.options.pageNumber = page;
  7558. this.updatePagination();
  7559. }
  7560. }
  7561. }, {
  7562. key: "prevPage",
  7563. value: function prevPage() {
  7564. if (this.options.pageNumber > 1) {
  7565. this.options.pageNumber--;
  7566. this.updatePagination();
  7567. }
  7568. }
  7569. }, {
  7570. key: "nextPage",
  7571. value: function nextPage() {
  7572. if (this.options.pageNumber < this.options.totalPages) {
  7573. this.options.pageNumber++;
  7574. this.updatePagination();
  7575. }
  7576. }
  7577. }, {
  7578. key: "toggleDetailView",
  7579. value: function toggleDetailView(index, _columnDetailFormatter) {
  7580. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
  7581. if ($tr.next().is('tr.detail-view')) {
  7582. this.collapseRow(index);
  7583. } else {
  7584. this.expandRow(index, _columnDetailFormatter);
  7585. }
  7586. this.resetView();
  7587. }
  7588. }, {
  7589. key: "expandRow",
  7590. value: function expandRow(index, _columnDetailFormatter) {
  7591. var row = this.data[index];
  7592. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7593. if (this.options.detailViewIcon) {
  7594. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
  7595. }
  7596. if ($tr.next().is('tr.detail-view')) {
  7597. return;
  7598. }
  7599. $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
  7600. var $element = $tr.next().find('td');
  7601. var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
  7602. var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
  7603. if ($element.length === 1) {
  7604. $element.append(content);
  7605. }
  7606. this.trigger('expand-row', index, row, $element);
  7607. }
  7608. }, {
  7609. key: "expandRowByUniqueId",
  7610. value: function expandRowByUniqueId(uniqueId) {
  7611. var row = this.getRowByUniqueId(uniqueId);
  7612. if (!row) {
  7613. return;
  7614. }
  7615. this.expandRow(this.data.indexOf(row));
  7616. }
  7617. }, {
  7618. key: "collapseRow",
  7619. value: function collapseRow(index) {
  7620. var row = this.data[index];
  7621. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7622. if (!$tr.next().is('tr.detail-view')) {
  7623. return;
  7624. }
  7625. if (this.options.detailViewIcon) {
  7626. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
  7627. }
  7628. this.trigger('collapse-row', index, row, $tr.next());
  7629. $tr.next().remove();
  7630. }
  7631. }, {
  7632. key: "collapseRowByUniqueId",
  7633. value: function collapseRowByUniqueId(uniqueId) {
  7634. var row = this.getRowByUniqueId(uniqueId);
  7635. if (!row) {
  7636. return;
  7637. }
  7638. this.collapseRow(this.data.indexOf(row));
  7639. }
  7640. }, {
  7641. key: "expandAllRows",
  7642. value: function expandAllRows() {
  7643. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7644. for (var i = 0; i < trs.length; i++) {
  7645. this.expandRow($__default["default"](trs[i]).data('index'));
  7646. }
  7647. }
  7648. }, {
  7649. key: "collapseAllRows",
  7650. value: function collapseAllRows() {
  7651. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7652. for (var i = 0; i < trs.length; i++) {
  7653. this.collapseRow($__default["default"](trs[i]).data('index'));
  7654. }
  7655. }
  7656. }, {
  7657. key: "updateColumnTitle",
  7658. value: function updateColumnTitle(params) {
  7659. if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
  7660. return;
  7661. }
  7662. this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape ? Utils.escapeHTML(params.title) : params.title;
  7663. if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
  7664. this.$header.find('th[data-field]').each(function (i, el) {
  7665. if ($__default["default"](el).data('field') === params.field) {
  7666. $__default["default"]($__default["default"](el).find('.th-inner')[0]).text(params.title);
  7667. return false;
  7668. }
  7669. });
  7670. this.resetView();
  7671. }
  7672. }
  7673. }, {
  7674. key: "updateFormatText",
  7675. value: function updateFormatText(formatName, text) {
  7676. if (!/^format/.test(formatName) || !this.options[formatName]) {
  7677. return;
  7678. }
  7679. if (typeof text === 'string') {
  7680. this.options[formatName] = function () {
  7681. return text;
  7682. };
  7683. } else if (typeof text === 'function') {
  7684. this.options[formatName] = text;
  7685. }
  7686. this.initToolbar();
  7687. this.initPagination();
  7688. this.initBody();
  7689. }
  7690. }]);
  7691. return BootstrapTable;
  7692. }();
  7693. BootstrapTable.VERSION = Constants.VERSION;
  7694. BootstrapTable.DEFAULTS = Constants.DEFAULTS;
  7695. BootstrapTable.LOCALES = Constants.LOCALES;
  7696. BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
  7697. BootstrapTable.METHODS = Constants.METHODS;
  7698. BootstrapTable.EVENTS = Constants.EVENTS;
  7699. // BOOTSTRAP TABLE PLUGIN DEFINITION
  7700. // =======================
  7701. $__default["default"].BootstrapTable = BootstrapTable;
  7702. $__default["default"].fn.bootstrapTable = function (option) {
  7703. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
  7704. args[_key5 - 1] = arguments[_key5];
  7705. }
  7706. var value;
  7707. this.each(function (i, el) {
  7708. var data = $__default["default"](el).data('bootstrap.table');
  7709. var options = $__default["default"].extend(true, {}, BootstrapTable.DEFAULTS, $__default["default"](el).data(), _typeof(option) === 'object' && option);
  7710. if (typeof option === 'string') {
  7711. var _data2;
  7712. if (!Constants.METHODS.includes(option)) {
  7713. throw new Error("Unknown method: ".concat(option));
  7714. }
  7715. if (!data) {
  7716. return;
  7717. }
  7718. value = (_data2 = data)[option].apply(_data2, args);
  7719. if (option === 'destroy') {
  7720. $__default["default"](el).removeData('bootstrap.table');
  7721. }
  7722. }
  7723. if (!data) {
  7724. data = new $__default["default"].BootstrapTable(el, options);
  7725. $__default["default"](el).data('bootstrap.table', data);
  7726. data.init();
  7727. }
  7728. });
  7729. return typeof value === 'undefined' ? this : value;
  7730. };
  7731. $__default["default"].fn.bootstrapTable.Constructor = BootstrapTable;
  7732. $__default["default"].fn.bootstrapTable.theme = Constants.THEME;
  7733. $__default["default"].fn.bootstrapTable.VERSION = Constants.VERSION;
  7734. $__default["default"].fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
  7735. $__default["default"].fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
  7736. $__default["default"].fn.bootstrapTable.events = BootstrapTable.EVENTS;
  7737. $__default["default"].fn.bootstrapTable.locales = BootstrapTable.LOCALES;
  7738. $__default["default"].fn.bootstrapTable.methods = BootstrapTable.METHODS;
  7739. $__default["default"].fn.bootstrapTable.utils = Utils;
  7740. // BOOTSTRAP TABLE INIT
  7741. // =======================
  7742. $__default["default"](function () {
  7743. $__default["default"]('[data-toggle="table"]').bootstrapTable();
  7744. });
  7745. return BootstrapTable;
  7746. }));