bootstrap-table.js 313 KB

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