resources_js_pages_expense_Index_vue.js 703KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_expense_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!*************************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \*************************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/expense/tableHeader.js");
  274. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. expenses: Object,
  281. initialDateRange: Array
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter)(props),
  288. dates = _useDateRangeFilter.dates,
  289. startDate = _useDateRangeFilter.startDate,
  290. endDate = _useDateRangeFilter.endDate;
  291. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)(dates, function () {
  292. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/expenses', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  293. startDate: startDate.value,
  294. endDate: endDate.value
  295. }), {
  296. preserveState: true
  297. });
  298. });
  299. var filterReset = function filterReset() {
  300. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/expenses');
  301. };
  302. var __returned__ = {
  303. props: props,
  304. dates: dates,
  305. startDate: startDate,
  306. endDate: endDate,
  307. filterReset: filterReset,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  309. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  310. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  311. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  312. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter,
  314. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  316. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  317. };
  318. Object.defineProperty(__returned__, '__isScriptSetup', {
  319. enumerable: false,
  320. value: true
  321. });
  322. return __returned__;
  323. }
  324. });
  325. /***/ }),
  326. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  327. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  328. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  329. \***********************************************************************************************************************************************************************************************************************************************************************************/
  330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  331. "use strict";
  332. __webpack_require__.r(__webpack_exports__);
  333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  334. /* harmony export */ "render": () => (/* binding */ render)
  335. /* harmony export */ });
  336. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  337. var _hoisted_1 = {
  338. key: 1,
  339. "class": "p-button-label"
  340. };
  341. var _hoisted_2 = {
  342. key: 1,
  343. "class": "p-button-label"
  344. };
  345. function render(_ctx, _cache, $props, $setup, $data, $options) {
  346. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  347. key: 0,
  348. "class": "p-button p-component",
  349. as: "button",
  350. type: "button"
  351. }, {
  352. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  353. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  354. key: 0,
  355. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  356. }, null, 2
  357. /* CLASS */
  358. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  359. /* TEXT */
  360. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  361. }),
  362. _: 1
  363. /* STABLE */
  364. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  365. key: 1,
  366. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  367. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  368. key: 0,
  369. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  370. }, null, 2
  371. /* CLASS */
  372. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  373. /* TEXT */
  374. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  375. /* CLASS */
  376. ));
  377. }
  378. /***/ }),
  379. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  380. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  381. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  382. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  383. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  384. "use strict";
  385. __webpack_require__.r(__webpack_exports__);
  386. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  387. /* harmony export */ "render": () => (/* binding */ render)
  388. /* harmony export */ });
  389. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  390. var _withScopeId = function _withScopeId(n) {
  391. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  392. };
  393. var _hoisted_1 = {
  394. "class": "layout-footer"
  395. };
  396. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  397. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  398. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  399. href: "https://dijitalcode.com",
  400. target: "_blank",
  401. "class": "font-medium ml-2"
  402. }, "DijitalCODE", -1
  403. /* HOISTED */
  404. );
  405. });
  406. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  407. function render(_ctx, _cache) {
  408. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  409. }
  410. /***/ }),
  411. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  412. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  413. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  414. \********************************************************************************************************************************************************************************************************************************************************************************/
  415. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  416. "use strict";
  417. __webpack_require__.r(__webpack_exports__);
  418. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  419. /* harmony export */ "render": () => (/* binding */ render)
  420. /* harmony export */ });
  421. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  422. var _hoisted_1 = {
  423. key: 0
  424. };
  425. var _hoisted_2 = {
  426. key: 1
  427. };
  428. function render(_ctx, _cache, $props, $setup, $data, $options) {
  429. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  430. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  431. key: 0,
  432. severity: "success",
  433. onClose: $setup.onClose
  434. }, {
  435. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  436. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  437. /* TEXT */
  438. )];
  439. }),
  440. _: 1
  441. /* STABLE */
  442. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  443. key: 1,
  444. severity: "error",
  445. onClose: $setup.onClose
  446. }, {
  447. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  448. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  449. /* TEXT */
  450. )];
  451. }),
  452. _: 1
  453. /* STABLE */
  454. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  455. key: 2,
  456. severity: "error",
  457. onClose: $setup.onClose
  458. }, {
  459. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  460. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  461. /* TEXT */
  462. ))];
  463. }),
  464. _: 1
  465. /* STABLE */
  466. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  467. /* STABLE_FRAGMENT */
  468. );
  469. }
  470. /***/ }),
  471. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  472. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  473. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  474. \***********************************************************************************************************************************************************************************************************************************************************************************/
  475. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  476. "use strict";
  477. __webpack_require__.r(__webpack_exports__);
  478. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  479. /* harmony export */ "render": () => (/* binding */ render)
  480. /* harmony export */ });
  481. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  482. var _hoisted_1 = {
  483. key: 0,
  484. "class": "p-paginator p-component flex justify-content-start"
  485. };
  486. var _hoisted_2 = {
  487. "class": "p-paginator-pages"
  488. };
  489. var _hoisted_3 = ["innerHTML"];
  490. function render(_ctx, _cache, $props, $setup, $data, $options) {
  491. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  492. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  493. key: "link-".concat(key),
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  495. 'p-disabled': link
  496. }]),
  497. innerHTML: link.label
  498. }, null, 10
  499. /* CLASS, PROPS */
  500. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  501. key: "link-".concat(key),
  502. href: link.url,
  503. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  504. 'p-highlight': link.active
  505. }, "p-paginator-page p-paginator-element p-link"]),
  506. innerHTML: link.label
  507. }, null, 8
  508. /* PROPS */
  509. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  510. /* STABLE_FRAGMENT */
  511. );
  512. }), 256
  513. /* UNKEYED_FRAGMENT */
  514. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  515. }
  516. /***/ }),
  517. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  518. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  519. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  520. \********************************************************************************************************************************************************************************************************************************************************************************************/
  521. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  522. "use strict";
  523. __webpack_require__.r(__webpack_exports__);
  524. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  525. /* harmony export */ "render": () => (/* binding */ render)
  526. /* harmony export */ });
  527. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  528. function render(_ctx, _cache, $props, $setup, $data, $options) {
  529. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  530. "class": "layout-menu",
  531. items: $props.menu,
  532. root: true
  533. }, null, 8
  534. /* PROPS */
  535. , ["items"])]);
  536. }
  537. /***/ }),
  538. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  539. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  540. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  541. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  542. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  543. "use strict";
  544. __webpack_require__.r(__webpack_exports__);
  545. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  546. /* harmony export */ "render": () => (/* binding */ render)
  547. /* harmony export */ });
  548. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  549. var _withScopeId = function _withScopeId(n) {
  550. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  551. };
  552. var _hoisted_1 = {
  553. key: 0
  554. };
  555. var _hoisted_2 = ["aria-label"];
  556. var _hoisted_3 = ["aria-label"];
  557. function render(_ctx, _cache, $props, $setup, $data, $options) {
  558. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  559. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  560. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  561. key: i,
  562. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  563. 'layout-menuitem-category': $props.root
  564. }]),
  565. role: "none"
  566. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  567. key: 0
  568. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  569. "class": "layout-menuitem-root-text",
  570. "aria-label": item.label
  571. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  572. /* TEXT, PROPS */
  573. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  574. items: item.items
  575. }, null, 8
  576. /* PROPS */
  577. , ["items"])], 64
  578. /* STABLE_FRAGMENT */
  579. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  580. key: 1
  581. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  582. key: 0,
  583. role: "menuitem",
  584. href: item.to,
  585. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  586. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  587. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  588. }]),
  589. "aria-label": item.label
  590. }, {
  591. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  592. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  593. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  594. }, null, 2
  595. /* CLASS */
  596. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  597. /* TEXT */
  598. )];
  599. }),
  600. _: 2
  601. /* DYNAMIC */
  602. }, 1032
  603. /* PROPS, DYNAMIC_SLOTS */
  604. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  605. key: 1,
  606. href: "#",
  607. role: "menuitem",
  608. "aria-label": item.label
  609. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  610. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  611. }, null, 2
  612. /* CLASS */
  613. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  614. /* TEXT */
  615. )], 8
  616. /* PROPS */
  617. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  618. items: item.items
  619. }, null, 8
  620. /* PROPS */
  621. , ["items"])], 64
  622. /* STABLE_FRAGMENT */
  623. ))], 2
  624. /* CLASS */
  625. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  626. /* STABLE_FRAGMENT */
  627. );
  628. }), 256
  629. /* UNKEYED_FRAGMENT */
  630. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  631. }
  632. /***/ }),
  633. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  634. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  635. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  636. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  637. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  638. "use strict";
  639. __webpack_require__.r(__webpack_exports__);
  640. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  641. /* harmony export */ "render": () => (/* binding */ render)
  642. /* harmony export */ });
  643. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  644. var _withScopeId = function _withScopeId(n) {
  645. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  646. };
  647. var _hoisted_1 = {
  648. "class": "layout-topbar"
  649. };
  650. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  652. alt: "Logo",
  653. src: "/images/logo.svg",
  654. "class": "md:mr-3"
  655. }, null, -1
  656. /* HOISTED */
  657. );
  658. });
  659. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  660. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  661. /* HOISTED */
  662. );
  663. });
  664. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  665. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  666. "class": "pi pi-bars"
  667. }, null, -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_5 = [_hoisted_4];
  672. var _hoisted_6 = {
  673. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  674. };
  675. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  676. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  677. "class": "pi pi-ellipsis-v"
  678. }, null, -1
  679. /* HOISTED */
  680. );
  681. });
  682. var _hoisted_8 = [_hoisted_7];
  683. var _hoisted_9 = {
  684. "class": "layout-topbar-menu hidden lg:flex origin-top"
  685. };
  686. var _hoisted_10 = {
  687. "class": "align-self-center"
  688. };
  689. var _hoisted_11 = {
  690. "class": "hidden lg:inline"
  691. };
  692. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  693. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  694. "class": "pi pi-user"
  695. }, null, -1
  696. /* HOISTED */
  697. );
  698. });
  699. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  701. /* HOISTED */
  702. );
  703. });
  704. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  705. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  706. "class": "pi pi-sign-out"
  707. }, null, -1
  708. /* HOISTED */
  709. );
  710. });
  711. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  712. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  713. /* HOISTED */
  714. );
  715. });
  716. function render(_ctx, _cache, $props, $setup, $data, $options) {
  717. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  718. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  719. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  720. href: "/",
  721. "class": "layout-topbar-logo"
  722. }, {
  723. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  724. return [_hoisted_2, _hoisted_3];
  725. }),
  726. _: 1
  727. /* STABLE */
  728. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  729. "class": "p-link layout-menu-button layout-topbar-button",
  730. onClick: _cache[0] || (_cache[0] = function ($event) {
  731. return _ctx.$emit('menu-toggle', $event);
  732. })
  733. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  734. selector: '@next',
  735. enterClass: 'hidden',
  736. enterActiveClass: 'scalein',
  737. leaveToClass: 'hidden',
  738. leaveActiveClass: 'fadeout',
  739. hideOnOutsideClick: true
  740. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  741. /* TEXT */
  742. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  743. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  744. "class": "p-link layout-topbar-button"
  745. }, {
  746. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  747. return [_hoisted_12, _hoisted_13];
  748. }),
  749. _: 1
  750. /* STABLE */
  751. }, 8
  752. /* PROPS */
  753. , ["href"])), [[_directive_tooltip, {
  754. value: 'Ubah Profil',
  755. "class": 'layout-topbar-menu-tooltip'
  756. }, void 0, {
  757. bottom: true
  758. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  759. href: _ctx.route('logout'),
  760. as: "button",
  761. method: "post",
  762. "class": "p-link layout-topbar-button"
  763. }, {
  764. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  765. return [_hoisted_14, _hoisted_15];
  766. }),
  767. _: 1
  768. /* STABLE */
  769. }, 8
  770. /* PROPS */
  771. , ["href"])), [[_directive_tooltip, {
  772. value: 'Keluar',
  773. "class": 'layout-topbar-menu-tooltip'
  774. }, void 0, {
  775. bottom: true
  776. }]])])])]);
  777. }
  778. /***/ }),
  779. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  780. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  781. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  782. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  784. "use strict";
  785. __webpack_require__.r(__webpack_exports__);
  786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  787. /* harmony export */ "render": () => (/* binding */ render)
  788. /* harmony export */ });
  789. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  790. var _withScopeId = function _withScopeId(n) {
  791. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  792. };
  793. var _hoisted_1 = {
  794. "class": "layout-sidebar"
  795. };
  796. var _hoisted_2 = {
  797. "class": "layout-main-container"
  798. };
  799. var _hoisted_3 = {
  800. "class": "layout-main"
  801. };
  802. var _hoisted_4 = {
  803. key: 0,
  804. "class": "layout-mask p-component-overlay"
  805. };
  806. function render(_ctx, _cache, $props, $setup, $data, $options) {
  807. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  808. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  809. onClick: $setup.onWrapperClick
  810. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  811. onMenuToggle: $setup.onMenuToggle
  812. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  813. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  814. }, null, 8
  815. /* PROPS */
  816. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  817. name: "layout-mask"
  818. }, {
  819. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  820. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  821. }),
  822. _: 1
  823. /* STABLE */
  824. })], 2
  825. /* CLASS */
  826. );
  827. }
  828. /***/ }),
  829. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  830. /*!******************************************************************************************************************************************************************************************************************************************************************************!*\
  831. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  832. \******************************************************************************************************************************************************************************************************************************************************************************/
  833. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  834. "use strict";
  835. __webpack_require__.r(__webpack_exports__);
  836. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  837. /* harmony export */ "render": () => (/* binding */ render)
  838. /* harmony export */ });
  839. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  840. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pengeluaran", -1
  841. /* HOISTED */
  842. );
  843. var _hoisted_2 = {
  844. "class": "grid"
  845. };
  846. var _hoisted_3 = {
  847. "class": "col-12 md:col-8"
  848. };
  849. var _hoisted_4 = {
  850. "class": "grid"
  851. };
  852. var _hoisted_5 = {
  853. "class": "col-12 md:col-4"
  854. };
  855. var _hoisted_6 = {
  856. "class": "col-auto mt-2 ml-2"
  857. };
  858. var _hoisted_7 = {
  859. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  860. };
  861. function render(_ctx, _cache, $props, $setup, $data, $options) {
  862. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  863. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  864. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  865. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  867. title: "Pengeluaran"
  868. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  871. "responsive-layout": "scroll",
  872. "column-resize-mode": "expand",
  873. value: $props.expenses.data,
  874. "row-hover": true,
  875. "striped-rows": true
  876. }, {
  877. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  879. "touch-u-i": "",
  880. "class": "w-full",
  881. modelValue: $setup.dates,
  882. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  883. return $setup.dates = $event;
  884. }),
  885. "selection-mode": "range",
  886. placeholder: "filter waktu...",
  887. "date-format": "dd/mm/yy",
  888. "manual-input": false
  889. }, null, 8
  890. /* PROPS */
  891. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  892. label: "reset",
  893. "class": "p-button-link",
  894. onClick: $setup.filterReset
  895. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  896. label: "Tambah Pengeluaran",
  897. "class": "p-button-outlined",
  898. icon: "pi pi-pencil",
  899. href: _ctx.route('expenses.create')
  900. }, null, 8
  901. /* PROPS */
  902. , ["href"])])])];
  903. }),
  904. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  905. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  906. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  907. field: value.field,
  908. header: value.header,
  909. key: value.field
  910. }, null, 8
  911. /* PROPS */
  912. , ["field", "header"]);
  913. }), 128
  914. /* KEYED_FRAGMENT */
  915. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  916. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  917. var data = _ref.data;
  918. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  919. icon: "pi pi-eye",
  920. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  921. href: _ctx.route('expenses.show', data.id)
  922. }, null, 8
  923. /* PROPS */
  924. , ["href"])];
  925. }),
  926. _: 1
  927. /* STABLE */
  928. })];
  929. }),
  930. _: 1
  931. /* STABLE */
  932. }, 8
  933. /* PROPS */
  934. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  935. links: $props.expenses.links
  936. }, null, 8
  937. /* PROPS */
  938. , ["links"])];
  939. }),
  940. _: 1
  941. /* STABLE */
  942. })], 64
  943. /* STABLE_FRAGMENT */
  944. );
  945. }
  946. /***/ }),
  947. /***/ "./resources/js/components/useDateRangeFilter.js":
  948. /*!*******************************************************!*\
  949. !*** ./resources/js/components/useDateRangeFilter.js ***!
  950. \*******************************************************/
  951. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  952. "use strict";
  953. __webpack_require__.r(__webpack_exports__);
  954. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  955. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  956. /* harmony export */ });
  957. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  958. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  959. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  960. function useDateRangeFilter(props) {
  961. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  962. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  963. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  964. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  965. if (!props.initialDateRange) {
  966. return;
  967. }
  968. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  969. if (props.initialDateRange[1]) {
  970. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  971. } else {
  972. dates.value = [new Date(props.props.initialDateRange[1]), null];
  973. }
  974. }
  975. });
  976. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  977. if (dates.value[1]) {
  978. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  979. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  980. } else if (dates.value[0]) {
  981. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  982. endDate.value = null;
  983. }
  984. });
  985. return {
  986. dates: dates,
  987. startDate: startDate,
  988. endDate: endDate
  989. };
  990. }
  991. /***/ }),
  992. /***/ "./resources/js/pages/expense/tableHeader.js":
  993. /*!***************************************************!*\
  994. !*** ./resources/js/pages/expense/tableHeader.js ***!
  995. \***************************************************/
  996. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  997. "use strict";
  998. __webpack_require__.r(__webpack_exports__);
  999. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1000. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1001. /* harmony export */ });
  1002. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1003. field: 'createdAt',
  1004. header: 'Tanggal'
  1005. }, {
  1006. field: 'amount',
  1007. header: 'Pengeluaran'
  1008. }, {
  1009. field: 'user',
  1010. header: 'User'
  1011. }]);
  1012. /***/ }),
  1013. /***/ "./resources/js/utils/menu.js":
  1014. /*!************************************!*\
  1015. !*** ./resources/js/utils/menu.js ***!
  1016. \************************************/
  1017. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1018. "use strict";
  1019. __webpack_require__.r(__webpack_exports__);
  1020. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1021. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1022. /* harmony export */ });
  1023. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1024. // Admin
  1025. 1: [{
  1026. label: 'Home',
  1027. items: [{
  1028. label: 'Dashboard',
  1029. icon: 'pi pi-home',
  1030. to: '/dashboards',
  1031. component: 'home/Index'
  1032. }]
  1033. }, {
  1034. label: 'Master',
  1035. items: [{
  1036. label: 'User',
  1037. icon: 'pi pi-user',
  1038. to: '/users',
  1039. component: 'user/Index'
  1040. }]
  1041. }],
  1042. // Supervisor
  1043. 2: [{
  1044. label: 'Home',
  1045. items: [{
  1046. label: 'Dashboard',
  1047. icon: 'pi pi-home',
  1048. to: '/dashboards',
  1049. component: 'home/Index'
  1050. }]
  1051. }, {
  1052. label: 'Menu',
  1053. items: [{
  1054. label: 'Pengeluaran',
  1055. icon: 'pi pi-wallet',
  1056. to: '/expenses',
  1057. component: 'expense/Index'
  1058. }, {
  1059. label: 'Laporan',
  1060. icon: 'pi pi-book',
  1061. items: [{
  1062. label: 'Mutasi',
  1063. icon: 'pi pi-circle',
  1064. to: '/reports/mutations',
  1065. component: 'mutation/Report'
  1066. }]
  1067. }]
  1068. }, {
  1069. label: 'Master',
  1070. items: [{
  1071. label: 'Jenis Kendaraan',
  1072. icon: 'pi pi-car',
  1073. to: '/type-vehicles',
  1074. component: 'typevehicle/Index'
  1075. }, {
  1076. label: 'Jenis Member',
  1077. icon: 'pi pi-id-card',
  1078. to: '/type-members',
  1079. component: 'typemember/Index'
  1080. }]
  1081. }, {
  1082. label: 'Pengaturan',
  1083. items: [{
  1084. label: 'Tarif Parkir',
  1085. icon: 'pi pi-car',
  1086. to: '/parking-fees/create',
  1087. component: 'parkingfee/Create'
  1088. }]
  1089. }],
  1090. // Operator
  1091. 3: [{
  1092. label: 'Home',
  1093. items: [{
  1094. label: 'Dashboard',
  1095. icon: 'pi pi-home',
  1096. to: '/dashboards',
  1097. component: 'home/Index'
  1098. }]
  1099. }, {
  1100. label: 'Transaksi',
  1101. items: [{
  1102. label: 'Transaksi masuk dan keluar',
  1103. icon: 'pi pi-car',
  1104. to: '/transactions/create',
  1105. component: 'transaction/Create'
  1106. }]
  1107. }, {
  1108. label: 'Menu',
  1109. items: [{
  1110. label: 'Pengeluaran',
  1111. icon: 'pi pi-wallet',
  1112. to: '/expenses',
  1113. component: 'expense/Index'
  1114. }, {
  1115. label: 'Member',
  1116. icon: 'pi pi-id-card',
  1117. to: '/members',
  1118. component: 'member/Index'
  1119. }, {
  1120. label: 'Top Up',
  1121. icon: 'pi pi-car',
  1122. to: '/top-ups',
  1123. component: 'topup/Index'
  1124. }]
  1125. }, {
  1126. label: 'Not Production',
  1127. items: [{
  1128. label: 'Test Transactions',
  1129. icon: 'pi pi-car',
  1130. to: '/test-transactions/create',
  1131. component: 'test-transaction/Create'
  1132. }]
  1133. }]
  1134. });
  1135. /***/ }),
  1136. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1137. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1138. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1139. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1140. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1141. "use strict";
  1142. __webpack_require__.r(__webpack_exports__);
  1143. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1144. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1145. /* harmony export */ });
  1146. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1147. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1148. // Imports
  1149. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1150. // Module
  1151. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1152. // Exports
  1153. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1154. /***/ }),
  1155. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1156. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1157. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1158. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1159. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1160. "use strict";
  1161. __webpack_require__.r(__webpack_exports__);
  1162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1164. /* harmony export */ });
  1165. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1166. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1167. // Imports
  1168. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1169. // Module
  1170. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1171. // Exports
  1172. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1173. /***/ }),
  1174. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1175. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1176. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1177. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1178. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1179. "use strict";
  1180. __webpack_require__.r(__webpack_exports__);
  1181. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1182. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1183. /* harmony export */ });
  1184. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1185. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1186. // Imports
  1187. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1188. // Module
  1189. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1190. // Exports
  1191. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1192. /***/ }),
  1193. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1194. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1195. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1196. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1197. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1198. "use strict";
  1199. __webpack_require__.r(__webpack_exports__);
  1200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1202. /* harmony export */ });
  1203. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1204. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1205. // Imports
  1206. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1207. // Module
  1208. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1209. // Exports
  1210. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1211. /***/ }),
  1212. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1213. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1214. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1215. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1216. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1217. "use strict";
  1218. __webpack_require__.r(__webpack_exports__);
  1219. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1220. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1221. /* harmony export */ });
  1222. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1223. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1224. // Imports
  1225. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1226. // Module
  1227. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1228. // Exports
  1229. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1230. /***/ }),
  1231. /***/ "./node_modules/dayjs/dayjs.min.js":
  1232. /*!*****************************************!*\
  1233. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1234. \*****************************************/
  1235. /***/ (function(module) {
  1236. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1237. /***/ }),
  1238. /***/ "./node_modules/lodash/lodash.js":
  1239. /*!***************************************!*\
  1240. !*** ./node_modules/lodash/lodash.js ***!
  1241. \***************************************/
  1242. /***/ (function(module, exports, __webpack_require__) {
  1243. /* module decorator */ module = __webpack_require__.nmd(module);
  1244. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1245. * @license
  1246. * Lodash <https://lodash.com/>
  1247. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1248. * Released under MIT license <https://lodash.com/license>
  1249. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1250. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1251. */
  1252. ;(function() {
  1253. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1254. var undefined;
  1255. /** Used as the semantic version number. */
  1256. var VERSION = '4.17.21';
  1257. /** Used as the size to enable large array optimizations. */
  1258. var LARGE_ARRAY_SIZE = 200;
  1259. /** Error message constants. */
  1260. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1261. FUNC_ERROR_TEXT = 'Expected a function',
  1262. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1263. /** Used to stand-in for `undefined` hash values. */
  1264. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1265. /** Used as the maximum memoize cache size. */
  1266. var MAX_MEMOIZE_SIZE = 500;
  1267. /** Used as the internal argument placeholder. */
  1268. var PLACEHOLDER = '__lodash_placeholder__';
  1269. /** Used to compose bitmasks for cloning. */
  1270. var CLONE_DEEP_FLAG = 1,
  1271. CLONE_FLAT_FLAG = 2,
  1272. CLONE_SYMBOLS_FLAG = 4;
  1273. /** Used to compose bitmasks for value comparisons. */
  1274. var COMPARE_PARTIAL_FLAG = 1,
  1275. COMPARE_UNORDERED_FLAG = 2;
  1276. /** Used to compose bitmasks for function metadata. */
  1277. var WRAP_BIND_FLAG = 1,
  1278. WRAP_BIND_KEY_FLAG = 2,
  1279. WRAP_CURRY_BOUND_FLAG = 4,
  1280. WRAP_CURRY_FLAG = 8,
  1281. WRAP_CURRY_RIGHT_FLAG = 16,
  1282. WRAP_PARTIAL_FLAG = 32,
  1283. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1284. WRAP_ARY_FLAG = 128,
  1285. WRAP_REARG_FLAG = 256,
  1286. WRAP_FLIP_FLAG = 512;
  1287. /** Used as default options for `_.truncate`. */
  1288. var DEFAULT_TRUNC_LENGTH = 30,
  1289. DEFAULT_TRUNC_OMISSION = '...';
  1290. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1291. var HOT_COUNT = 800,
  1292. HOT_SPAN = 16;
  1293. /** Used to indicate the type of lazy iteratees. */
  1294. var LAZY_FILTER_FLAG = 1,
  1295. LAZY_MAP_FLAG = 2,
  1296. LAZY_WHILE_FLAG = 3;
  1297. /** Used as references for various `Number` constants. */
  1298. var INFINITY = 1 / 0,
  1299. MAX_SAFE_INTEGER = 9007199254740991,
  1300. MAX_INTEGER = 1.7976931348623157e+308,
  1301. NAN = 0 / 0;
  1302. /** Used as references for the maximum length and index of an array. */
  1303. var MAX_ARRAY_LENGTH = 4294967295,
  1304. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1305. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1306. /** Used to associate wrap methods with their bit flags. */
  1307. var wrapFlags = [
  1308. ['ary', WRAP_ARY_FLAG],
  1309. ['bind', WRAP_BIND_FLAG],
  1310. ['bindKey', WRAP_BIND_KEY_FLAG],
  1311. ['curry', WRAP_CURRY_FLAG],
  1312. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1313. ['flip', WRAP_FLIP_FLAG],
  1314. ['partial', WRAP_PARTIAL_FLAG],
  1315. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1316. ['rearg', WRAP_REARG_FLAG]
  1317. ];
  1318. /** `Object#toString` result references. */
  1319. var argsTag = '[object Arguments]',
  1320. arrayTag = '[object Array]',
  1321. asyncTag = '[object AsyncFunction]',
  1322. boolTag = '[object Boolean]',
  1323. dateTag = '[object Date]',
  1324. domExcTag = '[object DOMException]',
  1325. errorTag = '[object Error]',
  1326. funcTag = '[object Function]',
  1327. genTag = '[object GeneratorFunction]',
  1328. mapTag = '[object Map]',
  1329. numberTag = '[object Number]',
  1330. nullTag = '[object Null]',
  1331. objectTag = '[object Object]',
  1332. promiseTag = '[object Promise]',
  1333. proxyTag = '[object Proxy]',
  1334. regexpTag = '[object RegExp]',
  1335. setTag = '[object Set]',
  1336. stringTag = '[object String]',
  1337. symbolTag = '[object Symbol]',
  1338. undefinedTag = '[object Undefined]',
  1339. weakMapTag = '[object WeakMap]',
  1340. weakSetTag = '[object WeakSet]';
  1341. var arrayBufferTag = '[object ArrayBuffer]',
  1342. dataViewTag = '[object DataView]',
  1343. float32Tag = '[object Float32Array]',
  1344. float64Tag = '[object Float64Array]',
  1345. int8Tag = '[object Int8Array]',
  1346. int16Tag = '[object Int16Array]',
  1347. int32Tag = '[object Int32Array]',
  1348. uint8Tag = '[object Uint8Array]',
  1349. uint8ClampedTag = '[object Uint8ClampedArray]',
  1350. uint16Tag = '[object Uint16Array]',
  1351. uint32Tag = '[object Uint32Array]';
  1352. /** Used to match empty string literals in compiled template source. */
  1353. var reEmptyStringLeading = /\b__p \+= '';/g,
  1354. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1355. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1356. /** Used to match HTML entities and HTML characters. */
  1357. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1358. reUnescapedHtml = /[&<>"']/g,
  1359. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1360. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1361. /** Used to match template delimiters. */
  1362. var reEscape = /<%-([\s\S]+?)%>/g,
  1363. reEvaluate = /<%([\s\S]+?)%>/g,
  1364. reInterpolate = /<%=([\s\S]+?)%>/g;
  1365. /** Used to match property names within property paths. */
  1366. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1367. reIsPlainProp = /^\w*$/,
  1368. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1369. /**
  1370. * Used to match `RegExp`
  1371. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1372. */
  1373. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1374. reHasRegExpChar = RegExp(reRegExpChar.source);
  1375. /** Used to match leading whitespace. */
  1376. var reTrimStart = /^\s+/;
  1377. /** Used to match a single whitespace character. */
  1378. var reWhitespace = /\s/;
  1379. /** Used to match wrap detail comments. */
  1380. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1381. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1382. reSplitDetails = /,? & /;
  1383. /** Used to match words composed of alphanumeric characters. */
  1384. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1385. /**
  1386. * Used to validate the `validate` option in `_.template` variable.
  1387. *
  1388. * Forbids characters which could potentially change the meaning of the function argument definition:
  1389. * - "()," (modification of function parameters)
  1390. * - "=" (default value)
  1391. * - "[]{}" (destructuring of function parameters)
  1392. * - "/" (beginning of a comment)
  1393. * - whitespace
  1394. */
  1395. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1396. /** Used to match backslashes in property paths. */
  1397. var reEscapeChar = /\\(\\)?/g;
  1398. /**
  1399. * Used to match
  1400. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1401. */
  1402. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1403. /** Used to match `RegExp` flags from their coerced string values. */
  1404. var reFlags = /\w*$/;
  1405. /** Used to detect bad signed hexadecimal string values. */
  1406. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1407. /** Used to detect binary string values. */
  1408. var reIsBinary = /^0b[01]+$/i;
  1409. /** Used to detect host constructors (Safari). */
  1410. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1411. /** Used to detect octal string values. */
  1412. var reIsOctal = /^0o[0-7]+$/i;
  1413. /** Used to detect unsigned integer values. */
  1414. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1415. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1416. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1417. /** Used to ensure capturing order of template delimiters. */
  1418. var reNoMatch = /($^)/;
  1419. /** Used to match unescaped characters in compiled string literals. */
  1420. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1421. /** Used to compose unicode character classes. */
  1422. var rsAstralRange = '\\ud800-\\udfff',
  1423. rsComboMarksRange = '\\u0300-\\u036f',
  1424. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1425. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1426. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1427. rsDingbatRange = '\\u2700-\\u27bf',
  1428. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1429. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1430. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1431. rsPunctuationRange = '\\u2000-\\u206f',
  1432. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  1433. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1434. rsVarRange = '\\ufe0e\\ufe0f',
  1435. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1436. /** Used to compose unicode capture groups. */
  1437. var rsApos = "['\u2019]",
  1438. rsAstral = '[' + rsAstralRange + ']',
  1439. rsBreak = '[' + rsBreakRange + ']',
  1440. rsCombo = '[' + rsComboRange + ']',
  1441. rsDigits = '\\d+',
  1442. rsDingbat = '[' + rsDingbatRange + ']',
  1443. rsLower = '[' + rsLowerRange + ']',
  1444. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1445. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1446. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1447. rsNonAstral = '[^' + rsAstralRange + ']',
  1448. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1449. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1450. rsUpper = '[' + rsUpperRange + ']',
  1451. rsZWJ = '\\u200d';
  1452. /** Used to compose unicode regexes. */
  1453. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1454. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1455. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1456. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1457. reOptMod = rsModifier + '?',
  1458. rsOptVar = '[' + rsVarRange + ']?',
  1459. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1460. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1461. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1462. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1463. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1464. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1465. /** Used to match apostrophes. */
  1466. var reApos = RegExp(rsApos, 'g');
  1467. /**
  1468. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1469. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1470. */
  1471. var reComboMark = RegExp(rsCombo, 'g');
  1472. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1473. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1474. /** Used to match complex or compound words. */
  1475. var reUnicodeWord = RegExp([
  1476. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1477. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1478. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1479. rsUpper + '+' + rsOptContrUpper,
  1480. rsOrdUpper,
  1481. rsOrdLower,
  1482. rsDigits,
  1483. rsEmoji
  1484. ].join('|'), 'g');
  1485. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  1486. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1487. /** Used to detect strings that need a more robust regexp to match words. */
  1488. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  1489. /** Used to assign default `context` object properties. */
  1490. var contextProps = [
  1491. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1492. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1493. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1494. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1495. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1496. ];
  1497. /** Used to make template sourceURLs easier to identify. */
  1498. var templateCounter = -1;
  1499. /** Used to identify `toStringTag` values of typed arrays. */
  1500. var typedArrayTags = {};
  1501. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1502. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1503. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1504. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1505. typedArrayTags[uint32Tag] = true;
  1506. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1507. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1508. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1509. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1510. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1511. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1512. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1513. typedArrayTags[weakMapTag] = false;
  1514. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1515. var cloneableTags = {};
  1516. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1517. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1518. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1519. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1520. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1521. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1522. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1523. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1524. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1525. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1526. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1527. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1528. cloneableTags[weakMapTag] = false;
  1529. /** Used to map Latin Unicode letters to basic Latin letters. */
  1530. var deburredLetters = {
  1531. // Latin-1 Supplement block.
  1532. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1533. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1534. '\xc7': 'C', '\xe7': 'c',
  1535. '\xd0': 'D', '\xf0': 'd',
  1536. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1537. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1538. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1539. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1540. '\xd1': 'N', '\xf1': 'n',
  1541. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1542. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1543. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1544. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1545. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1546. '\xc6': 'Ae', '\xe6': 'ae',
  1547. '\xde': 'Th', '\xfe': 'th',
  1548. '\xdf': 'ss',
  1549. // Latin Extended-A block.
  1550. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1551. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1552. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1553. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1554. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1555. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1556. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1557. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1558. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1559. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1560. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1561. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1562. '\u0134': 'J', '\u0135': 'j',
  1563. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1564. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1565. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1566. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1567. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1568. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1569. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1570. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1571. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1572. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1573. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1574. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1575. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1576. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1577. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1578. '\u0174': 'W', '\u0175': 'w',
  1579. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1580. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1581. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1582. '\u0132': 'IJ', '\u0133': 'ij',
  1583. '\u0152': 'Oe', '\u0153': 'oe',
  1584. '\u0149': "'n", '\u017f': 's'
  1585. };
  1586. /** Used to map characters to HTML entities. */
  1587. var htmlEscapes = {
  1588. '&': '&amp;',
  1589. '<': '&lt;',
  1590. '>': '&gt;',
  1591. '"': '&quot;',
  1592. "'": '&#39;'
  1593. };
  1594. /** Used to map HTML entities to characters. */
  1595. var htmlUnescapes = {
  1596. '&amp;': '&',
  1597. '&lt;': '<',
  1598. '&gt;': '>',
  1599. '&quot;': '"',
  1600. '&#39;': "'"
  1601. };
  1602. /** Used to escape characters for inclusion in compiled string literals. */
  1603. var stringEscapes = {
  1604. '\\': '\\',
  1605. "'": "'",
  1606. '\n': 'n',
  1607. '\r': 'r',
  1608. '\u2028': 'u2028',
  1609. '\u2029': 'u2029'
  1610. };
  1611. /** Built-in method references without a dependency on `root`. */
  1612. var freeParseFloat = parseFloat,
  1613. freeParseInt = parseInt;
  1614. /** Detect free variable `global` from Node.js. */
  1615. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1616. /** Detect free variable `self`. */
  1617. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1618. /** Used as a reference to the global object. */
  1619. var root = freeGlobal || freeSelf || Function('return this')();
  1620. /** Detect free variable `exports`. */
  1621. var freeExports = true && exports && !exports.nodeType && exports;
  1622. /** Detect free variable `module`. */
  1623. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1624. /** Detect the popular CommonJS extension `module.exports`. */
  1625. var moduleExports = freeModule && freeModule.exports === freeExports;
  1626. /** Detect free variable `process` from Node.js. */
  1627. var freeProcess = moduleExports && freeGlobal.process;
  1628. /** Used to access faster Node.js helpers. */
  1629. var nodeUtil = (function() {
  1630. try {
  1631. // Use `util.types` for Node.js 10+.
  1632. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1633. if (types) {
  1634. return types;
  1635. }
  1636. // Legacy `process.binding('util')` for Node.js < 10.
  1637. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1638. } catch (e) {}
  1639. }());
  1640. /* Node.js helper references. */
  1641. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1642. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1643. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1644. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1645. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1646. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1647. /*--------------------------------------------------------------------------*/
  1648. /**
  1649. * A faster alternative to `Function#apply`, this function invokes `func`
  1650. * with the `this` binding of `thisArg` and the arguments of `args`.
  1651. *
  1652. * @private
  1653. * @param {Function} func The function to invoke.
  1654. * @param {*} thisArg The `this` binding of `func`.
  1655. * @param {Array} args The arguments to invoke `func` with.
  1656. * @returns {*} Returns the result of `func`.
  1657. */
  1658. function apply(func, thisArg, args) {
  1659. switch (args.length) {
  1660. case 0: return func.call(thisArg);
  1661. case 1: return func.call(thisArg, args[0]);
  1662. case 2: return func.call(thisArg, args[0], args[1]);
  1663. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1664. }
  1665. return func.apply(thisArg, args);
  1666. }
  1667. /**
  1668. * A specialized version of `baseAggregator` for arrays.
  1669. *
  1670. * @private
  1671. * @param {Array} [array] The array to iterate over.
  1672. * @param {Function} setter The function to set `accumulator` values.
  1673. * @param {Function} iteratee The iteratee to transform keys.
  1674. * @param {Object} accumulator The initial aggregated object.
  1675. * @returns {Function} Returns `accumulator`.
  1676. */
  1677. function arrayAggregator(array, setter, iteratee, accumulator) {
  1678. var index = -1,
  1679. length = array == null ? 0 : array.length;
  1680. while (++index < length) {
  1681. var value = array[index];
  1682. setter(accumulator, value, iteratee(value), array);
  1683. }
  1684. return accumulator;
  1685. }
  1686. /**
  1687. * A specialized version of `_.forEach` for arrays without support for
  1688. * iteratee shorthands.
  1689. *
  1690. * @private
  1691. * @param {Array} [array] The array to iterate over.
  1692. * @param {Function} iteratee The function invoked per iteration.
  1693. * @returns {Array} Returns `array`.
  1694. */
  1695. function arrayEach(array, iteratee) {
  1696. var index = -1,
  1697. length = array == null ? 0 : array.length;
  1698. while (++index < length) {
  1699. if (iteratee(array[index], index, array) === false) {
  1700. break;
  1701. }
  1702. }
  1703. return array;
  1704. }
  1705. /**
  1706. * A specialized version of `_.forEachRight` for arrays without support for
  1707. * iteratee shorthands.
  1708. *
  1709. * @private
  1710. * @param {Array} [array] The array to iterate over.
  1711. * @param {Function} iteratee The function invoked per iteration.
  1712. * @returns {Array} Returns `array`.
  1713. */
  1714. function arrayEachRight(array, iteratee) {
  1715. var length = array == null ? 0 : array.length;
  1716. while (length--) {
  1717. if (iteratee(array[length], length, array) === false) {
  1718. break;
  1719. }
  1720. }
  1721. return array;
  1722. }
  1723. /**
  1724. * A specialized version of `_.every` for arrays without support for
  1725. * iteratee shorthands.
  1726. *
  1727. * @private
  1728. * @param {Array} [array] The array to iterate over.
  1729. * @param {Function} predicate The function invoked per iteration.
  1730. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1731. * else `false`.
  1732. */
  1733. function arrayEvery(array, predicate) {
  1734. var index = -1,
  1735. length = array == null ? 0 : array.length;
  1736. while (++index < length) {
  1737. if (!predicate(array[index], index, array)) {
  1738. return false;
  1739. }
  1740. }
  1741. return true;
  1742. }
  1743. /**
  1744. * A specialized version of `_.filter` for arrays without support for
  1745. * iteratee shorthands.
  1746. *
  1747. * @private
  1748. * @param {Array} [array] The array to iterate over.
  1749. * @param {Function} predicate The function invoked per iteration.
  1750. * @returns {Array} Returns the new filtered array.
  1751. */
  1752. function arrayFilter(array, predicate) {
  1753. var index = -1,
  1754. length = array == null ? 0 : array.length,
  1755. resIndex = 0,
  1756. result = [];
  1757. while (++index < length) {
  1758. var value = array[index];
  1759. if (predicate(value, index, array)) {
  1760. result[resIndex++] = value;
  1761. }
  1762. }
  1763. return result;
  1764. }
  1765. /**
  1766. * A specialized version of `_.includes` for arrays without support for
  1767. * specifying an index to search from.
  1768. *
  1769. * @private
  1770. * @param {Array} [array] The array to inspect.
  1771. * @param {*} target The value to search for.
  1772. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1773. */
  1774. function arrayIncludes(array, value) {
  1775. var length = array == null ? 0 : array.length;
  1776. return !!length && baseIndexOf(array, value, 0) > -1;
  1777. }
  1778. /**
  1779. * This function is like `arrayIncludes` except that it accepts a comparator.
  1780. *
  1781. * @private
  1782. * @param {Array} [array] The array to inspect.
  1783. * @param {*} target The value to search for.
  1784. * @param {Function} comparator The comparator invoked per element.
  1785. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1786. */
  1787. function arrayIncludesWith(array, value, comparator) {
  1788. var index = -1,
  1789. length = array == null ? 0 : array.length;
  1790. while (++index < length) {
  1791. if (comparator(value, array[index])) {
  1792. return true;
  1793. }
  1794. }
  1795. return false;
  1796. }
  1797. /**
  1798. * A specialized version of `_.map` for arrays without support for iteratee
  1799. * shorthands.
  1800. *
  1801. * @private
  1802. * @param {Array} [array] The array to iterate over.
  1803. * @param {Function} iteratee The function invoked per iteration.
  1804. * @returns {Array} Returns the new mapped array.
  1805. */
  1806. function arrayMap(array, iteratee) {
  1807. var index = -1,
  1808. length = array == null ? 0 : array.length,
  1809. result = Array(length);
  1810. while (++index < length) {
  1811. result[index] = iteratee(array[index], index, array);
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Appends the elements of `values` to `array`.
  1817. *
  1818. * @private
  1819. * @param {Array} array The array to modify.
  1820. * @param {Array} values The values to append.
  1821. * @returns {Array} Returns `array`.
  1822. */
  1823. function arrayPush(array, values) {
  1824. var index = -1,
  1825. length = values.length,
  1826. offset = array.length;
  1827. while (++index < length) {
  1828. array[offset + index] = values[index];
  1829. }
  1830. return array;
  1831. }
  1832. /**
  1833. * A specialized version of `_.reduce` for arrays without support for
  1834. * iteratee shorthands.
  1835. *
  1836. * @private
  1837. * @param {Array} [array] The array to iterate over.
  1838. * @param {Function} iteratee The function invoked per iteration.
  1839. * @param {*} [accumulator] The initial value.
  1840. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1841. * the initial value.
  1842. * @returns {*} Returns the accumulated value.
  1843. */
  1844. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1845. var index = -1,
  1846. length = array == null ? 0 : array.length;
  1847. if (initAccum && length) {
  1848. accumulator = array[++index];
  1849. }
  1850. while (++index < length) {
  1851. accumulator = iteratee(accumulator, array[index], index, array);
  1852. }
  1853. return accumulator;
  1854. }
  1855. /**
  1856. * A specialized version of `_.reduceRight` for arrays without support for
  1857. * iteratee shorthands.
  1858. *
  1859. * @private
  1860. * @param {Array} [array] The array to iterate over.
  1861. * @param {Function} iteratee The function invoked per iteration.
  1862. * @param {*} [accumulator] The initial value.
  1863. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1864. * the initial value.
  1865. * @returns {*} Returns the accumulated value.
  1866. */
  1867. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1868. var length = array == null ? 0 : array.length;
  1869. if (initAccum && length) {
  1870. accumulator = array[--length];
  1871. }
  1872. while (length--) {
  1873. accumulator = iteratee(accumulator, array[length], length, array);
  1874. }
  1875. return accumulator;
  1876. }
  1877. /**
  1878. * A specialized version of `_.some` for arrays without support for iteratee
  1879. * shorthands.
  1880. *
  1881. * @private
  1882. * @param {Array} [array] The array to iterate over.
  1883. * @param {Function} predicate The function invoked per iteration.
  1884. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1885. * else `false`.
  1886. */
  1887. function arraySome(array, predicate) {
  1888. var index = -1,
  1889. length = array == null ? 0 : array.length;
  1890. while (++index < length) {
  1891. if (predicate(array[index], index, array)) {
  1892. return true;
  1893. }
  1894. }
  1895. return false;
  1896. }
  1897. /**
  1898. * Gets the size of an ASCII `string`.
  1899. *
  1900. * @private
  1901. * @param {string} string The string inspect.
  1902. * @returns {number} Returns the string size.
  1903. */
  1904. var asciiSize = baseProperty('length');
  1905. /**
  1906. * Converts an ASCII `string` to an array.
  1907. *
  1908. * @private
  1909. * @param {string} string The string to convert.
  1910. * @returns {Array} Returns the converted array.
  1911. */
  1912. function asciiToArray(string) {
  1913. return string.split('');
  1914. }
  1915. /**
  1916. * Splits an ASCII `string` into an array of its words.
  1917. *
  1918. * @private
  1919. * @param {string} The string to inspect.
  1920. * @returns {Array} Returns the words of `string`.
  1921. */
  1922. function asciiWords(string) {
  1923. return string.match(reAsciiWord) || [];
  1924. }
  1925. /**
  1926. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1927. * without support for iteratee shorthands, which iterates over `collection`
  1928. * using `eachFunc`.
  1929. *
  1930. * @private
  1931. * @param {Array|Object} collection The collection to inspect.
  1932. * @param {Function} predicate The function invoked per iteration.
  1933. * @param {Function} eachFunc The function to iterate over `collection`.
  1934. * @returns {*} Returns the found element or its key, else `undefined`.
  1935. */
  1936. function baseFindKey(collection, predicate, eachFunc) {
  1937. var result;
  1938. eachFunc(collection, function(value, key, collection) {
  1939. if (predicate(value, key, collection)) {
  1940. result = key;
  1941. return false;
  1942. }
  1943. });
  1944. return result;
  1945. }
  1946. /**
  1947. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1948. * support for iteratee shorthands.
  1949. *
  1950. * @private
  1951. * @param {Array} array The array to inspect.
  1952. * @param {Function} predicate The function invoked per iteration.
  1953. * @param {number} fromIndex The index to search from.
  1954. * @param {boolean} [fromRight] Specify iterating from right to left.
  1955. * @returns {number} Returns the index of the matched value, else `-1`.
  1956. */
  1957. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1958. var length = array.length,
  1959. index = fromIndex + (fromRight ? 1 : -1);
  1960. while ((fromRight ? index-- : ++index < length)) {
  1961. if (predicate(array[index], index, array)) {
  1962. return index;
  1963. }
  1964. }
  1965. return -1;
  1966. }
  1967. /**
  1968. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1969. *
  1970. * @private
  1971. * @param {Array} array The array to inspect.
  1972. * @param {*} value The value to search for.
  1973. * @param {number} fromIndex The index to search from.
  1974. * @returns {number} Returns the index of the matched value, else `-1`.
  1975. */
  1976. function baseIndexOf(array, value, fromIndex) {
  1977. return value === value
  1978. ? strictIndexOf(array, value, fromIndex)
  1979. : baseFindIndex(array, baseIsNaN, fromIndex);
  1980. }
  1981. /**
  1982. * This function is like `baseIndexOf` except that it accepts a comparator.
  1983. *
  1984. * @private
  1985. * @param {Array} array The array to inspect.
  1986. * @param {*} value The value to search for.
  1987. * @param {number} fromIndex The index to search from.
  1988. * @param {Function} comparator The comparator invoked per element.
  1989. * @returns {number} Returns the index of the matched value, else `-1`.
  1990. */
  1991. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1992. var index = fromIndex - 1,
  1993. length = array.length;
  1994. while (++index < length) {
  1995. if (comparator(array[index], value)) {
  1996. return index;
  1997. }
  1998. }
  1999. return -1;
  2000. }
  2001. /**
  2002. * The base implementation of `_.isNaN` without support for number objects.
  2003. *
  2004. * @private
  2005. * @param {*} value The value to check.
  2006. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2007. */
  2008. function baseIsNaN(value) {
  2009. return value !== value;
  2010. }
  2011. /**
  2012. * The base implementation of `_.mean` and `_.meanBy` without support for
  2013. * iteratee shorthands.
  2014. *
  2015. * @private
  2016. * @param {Array} array The array to iterate over.
  2017. * @param {Function} iteratee The function invoked per iteration.
  2018. * @returns {number} Returns the mean.
  2019. */
  2020. function baseMean(array, iteratee) {
  2021. var length = array == null ? 0 : array.length;
  2022. return length ? (baseSum(array, iteratee) / length) : NAN;
  2023. }
  2024. /**
  2025. * The base implementation of `_.property` without support for deep paths.
  2026. *
  2027. * @private
  2028. * @param {string} key The key of the property to get.
  2029. * @returns {Function} Returns the new accessor function.
  2030. */
  2031. function baseProperty(key) {
  2032. return function(object) {
  2033. return object == null ? undefined : object[key];
  2034. };
  2035. }
  2036. /**
  2037. * The base implementation of `_.propertyOf` without support for deep paths.
  2038. *
  2039. * @private
  2040. * @param {Object} object The object to query.
  2041. * @returns {Function} Returns the new accessor function.
  2042. */
  2043. function basePropertyOf(object) {
  2044. return function(key) {
  2045. return object == null ? undefined : object[key];
  2046. };
  2047. }
  2048. /**
  2049. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2050. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2051. *
  2052. * @private
  2053. * @param {Array|Object} collection The collection to iterate over.
  2054. * @param {Function} iteratee The function invoked per iteration.
  2055. * @param {*} accumulator The initial value.
  2056. * @param {boolean} initAccum Specify using the first or last element of
  2057. * `collection` as the initial value.
  2058. * @param {Function} eachFunc The function to iterate over `collection`.
  2059. * @returns {*} Returns the accumulated value.
  2060. */
  2061. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2062. eachFunc(collection, function(value, index, collection) {
  2063. accumulator = initAccum
  2064. ? (initAccum = false, value)
  2065. : iteratee(accumulator, value, index, collection);
  2066. });
  2067. return accumulator;
  2068. }
  2069. /**
  2070. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2071. * sort order of `array` and replaces criteria objects with their corresponding
  2072. * values.
  2073. *
  2074. * @private
  2075. * @param {Array} array The array to sort.
  2076. * @param {Function} comparer The function to define sort order.
  2077. * @returns {Array} Returns `array`.
  2078. */
  2079. function baseSortBy(array, comparer) {
  2080. var length = array.length;
  2081. array.sort(comparer);
  2082. while (length--) {
  2083. array[length] = array[length].value;
  2084. }
  2085. return array;
  2086. }
  2087. /**
  2088. * The base implementation of `_.sum` and `_.sumBy` without support for
  2089. * iteratee shorthands.
  2090. *
  2091. * @private
  2092. * @param {Array} array The array to iterate over.
  2093. * @param {Function} iteratee The function invoked per iteration.
  2094. * @returns {number} Returns the sum.
  2095. */
  2096. function baseSum(array, iteratee) {
  2097. var result,
  2098. index = -1,
  2099. length = array.length;
  2100. while (++index < length) {
  2101. var current = iteratee(array[index]);
  2102. if (current !== undefined) {
  2103. result = result === undefined ? current : (result + current);
  2104. }
  2105. }
  2106. return result;
  2107. }
  2108. /**
  2109. * The base implementation of `_.times` without support for iteratee shorthands
  2110. * or max array length checks.
  2111. *
  2112. * @private
  2113. * @param {number} n The number of times to invoke `iteratee`.
  2114. * @param {Function} iteratee The function invoked per iteration.
  2115. * @returns {Array} Returns the array of results.
  2116. */
  2117. function baseTimes(n, iteratee) {
  2118. var index = -1,
  2119. result = Array(n);
  2120. while (++index < n) {
  2121. result[index] = iteratee(index);
  2122. }
  2123. return result;
  2124. }
  2125. /**
  2126. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2127. * of key-value pairs for `object` corresponding to the property names of `props`.
  2128. *
  2129. * @private
  2130. * @param {Object} object The object to query.
  2131. * @param {Array} props The property names to get values for.
  2132. * @returns {Object} Returns the key-value pairs.
  2133. */
  2134. function baseToPairs(object, props) {
  2135. return arrayMap(props, function(key) {
  2136. return [key, object[key]];
  2137. });
  2138. }
  2139. /**
  2140. * The base implementation of `_.trim`.
  2141. *
  2142. * @private
  2143. * @param {string} string The string to trim.
  2144. * @returns {string} Returns the trimmed string.
  2145. */
  2146. function baseTrim(string) {
  2147. return string
  2148. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2149. : string;
  2150. }
  2151. /**
  2152. * The base implementation of `_.unary` without support for storing metadata.
  2153. *
  2154. * @private
  2155. * @param {Function} func The function to cap arguments for.
  2156. * @returns {Function} Returns the new capped function.
  2157. */
  2158. function baseUnary(func) {
  2159. return function(value) {
  2160. return func(value);
  2161. };
  2162. }
  2163. /**
  2164. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2165. * array of `object` property values corresponding to the property names
  2166. * of `props`.
  2167. *
  2168. * @private
  2169. * @param {Object} object The object to query.
  2170. * @param {Array} props The property names to get values for.
  2171. * @returns {Object} Returns the array of property values.
  2172. */
  2173. function baseValues(object, props) {
  2174. return arrayMap(props, function(key) {
  2175. return object[key];
  2176. });
  2177. }
  2178. /**
  2179. * Checks if a `cache` value for `key` exists.
  2180. *
  2181. * @private
  2182. * @param {Object} cache The cache to query.
  2183. * @param {string} key The key of the entry to check.
  2184. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2185. */
  2186. function cacheHas(cache, key) {
  2187. return cache.has(key);
  2188. }
  2189. /**
  2190. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2191. * that is not found in the character symbols.
  2192. *
  2193. * @private
  2194. * @param {Array} strSymbols The string symbols to inspect.
  2195. * @param {Array} chrSymbols The character symbols to find.
  2196. * @returns {number} Returns the index of the first unmatched string symbol.
  2197. */
  2198. function charsStartIndex(strSymbols, chrSymbols) {
  2199. var index = -1,
  2200. length = strSymbols.length;
  2201. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2202. return index;
  2203. }
  2204. /**
  2205. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2206. * that is not found in the character symbols.
  2207. *
  2208. * @private
  2209. * @param {Array} strSymbols The string symbols to inspect.
  2210. * @param {Array} chrSymbols The character symbols to find.
  2211. * @returns {number} Returns the index of the last unmatched string symbol.
  2212. */
  2213. function charsEndIndex(strSymbols, chrSymbols) {
  2214. var index = strSymbols.length;
  2215. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2216. return index;
  2217. }
  2218. /**
  2219. * Gets the number of `placeholder` occurrences in `array`.
  2220. *
  2221. * @private
  2222. * @param {Array} array The array to inspect.
  2223. * @param {*} placeholder The placeholder to search for.
  2224. * @returns {number} Returns the placeholder count.
  2225. */
  2226. function countHolders(array, placeholder) {
  2227. var length = array.length,
  2228. result = 0;
  2229. while (length--) {
  2230. if (array[length] === placeholder) {
  2231. ++result;
  2232. }
  2233. }
  2234. return result;
  2235. }
  2236. /**
  2237. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2238. * letters to basic Latin letters.
  2239. *
  2240. * @private
  2241. * @param {string} letter The matched letter to deburr.
  2242. * @returns {string} Returns the deburred letter.
  2243. */
  2244. var deburrLetter = basePropertyOf(deburredLetters);
  2245. /**
  2246. * Used by `_.escape` to convert characters to HTML entities.
  2247. *
  2248. * @private
  2249. * @param {string} chr The matched character to escape.
  2250. * @returns {string} Returns the escaped character.
  2251. */
  2252. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2253. /**
  2254. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2255. *
  2256. * @private
  2257. * @param {string} chr The matched character to escape.
  2258. * @returns {string} Returns the escaped character.
  2259. */
  2260. function escapeStringChar(chr) {
  2261. return '\\' + stringEscapes[chr];
  2262. }
  2263. /**
  2264. * Gets the value at `key` of `object`.
  2265. *
  2266. * @private
  2267. * @param {Object} [object] The object to query.
  2268. * @param {string} key The key of the property to get.
  2269. * @returns {*} Returns the property value.
  2270. */
  2271. function getValue(object, key) {
  2272. return object == null ? undefined : object[key];
  2273. }
  2274. /**
  2275. * Checks if `string` contains Unicode symbols.
  2276. *
  2277. * @private
  2278. * @param {string} string The string to inspect.
  2279. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2280. */
  2281. function hasUnicode(string) {
  2282. return reHasUnicode.test(string);
  2283. }
  2284. /**
  2285. * Checks if `string` contains a word composed of Unicode symbols.
  2286. *
  2287. * @private
  2288. * @param {string} string The string to inspect.
  2289. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2290. */
  2291. function hasUnicodeWord(string) {
  2292. return reHasUnicodeWord.test(string);
  2293. }
  2294. /**
  2295. * Converts `iterator` to an array.
  2296. *
  2297. * @private
  2298. * @param {Object} iterator The iterator to convert.
  2299. * @returns {Array} Returns the converted array.
  2300. */
  2301. function iteratorToArray(iterator) {
  2302. var data,
  2303. result = [];
  2304. while (!(data = iterator.next()).done) {
  2305. result.push(data.value);
  2306. }
  2307. return result;
  2308. }
  2309. /**
  2310. * Converts `map` to its key-value pairs.
  2311. *
  2312. * @private
  2313. * @param {Object} map The map to convert.
  2314. * @returns {Array} Returns the key-value pairs.
  2315. */
  2316. function mapToArray(map) {
  2317. var index = -1,
  2318. result = Array(map.size);
  2319. map.forEach(function(value, key) {
  2320. result[++index] = [key, value];
  2321. });
  2322. return result;
  2323. }
  2324. /**
  2325. * Creates a unary function that invokes `func` with its argument transformed.
  2326. *
  2327. * @private
  2328. * @param {Function} func The function to wrap.
  2329. * @param {Function} transform The argument transform.
  2330. * @returns {Function} Returns the new function.
  2331. */
  2332. function overArg(func, transform) {
  2333. return function(arg) {
  2334. return func(transform(arg));
  2335. };
  2336. }
  2337. /**
  2338. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2339. * and returns an array of their indexes.
  2340. *
  2341. * @private
  2342. * @param {Array} array The array to modify.
  2343. * @param {*} placeholder The placeholder to replace.
  2344. * @returns {Array} Returns the new array of placeholder indexes.
  2345. */
  2346. function replaceHolders(array, placeholder) {
  2347. var index = -1,
  2348. length = array.length,
  2349. resIndex = 0,
  2350. result = [];
  2351. while (++index < length) {
  2352. var value = array[index];
  2353. if (value === placeholder || value === PLACEHOLDER) {
  2354. array[index] = PLACEHOLDER;
  2355. result[resIndex++] = index;
  2356. }
  2357. }
  2358. return result;
  2359. }
  2360. /**
  2361. * Converts `set` to an array of its values.
  2362. *
  2363. * @private
  2364. * @param {Object} set The set to convert.
  2365. * @returns {Array} Returns the values.
  2366. */
  2367. function setToArray(set) {
  2368. var index = -1,
  2369. result = Array(set.size);
  2370. set.forEach(function(value) {
  2371. result[++index] = value;
  2372. });
  2373. return result;
  2374. }
  2375. /**
  2376. * Converts `set` to its value-value pairs.
  2377. *
  2378. * @private
  2379. * @param {Object} set The set to convert.
  2380. * @returns {Array} Returns the value-value pairs.
  2381. */
  2382. function setToPairs(set) {
  2383. var index = -1,
  2384. result = Array(set.size);
  2385. set.forEach(function(value) {
  2386. result[++index] = [value, value];
  2387. });
  2388. return result;
  2389. }
  2390. /**
  2391. * A specialized version of `_.indexOf` which performs strict equality
  2392. * comparisons of values, i.e. `===`.
  2393. *
  2394. * @private
  2395. * @param {Array} array The array to inspect.
  2396. * @param {*} value The value to search for.
  2397. * @param {number} fromIndex The index to search from.
  2398. * @returns {number} Returns the index of the matched value, else `-1`.
  2399. */
  2400. function strictIndexOf(array, value, fromIndex) {
  2401. var index = fromIndex - 1,
  2402. length = array.length;
  2403. while (++index < length) {
  2404. if (array[index] === value) {
  2405. return index;
  2406. }
  2407. }
  2408. return -1;
  2409. }
  2410. /**
  2411. * A specialized version of `_.lastIndexOf` which performs strict equality
  2412. * comparisons of values, i.e. `===`.
  2413. *
  2414. * @private
  2415. * @param {Array} array The array to inspect.
  2416. * @param {*} value The value to search for.
  2417. * @param {number} fromIndex The index to search from.
  2418. * @returns {number} Returns the index of the matched value, else `-1`.
  2419. */
  2420. function strictLastIndexOf(array, value, fromIndex) {
  2421. var index = fromIndex + 1;
  2422. while (index--) {
  2423. if (array[index] === value) {
  2424. return index;
  2425. }
  2426. }
  2427. return index;
  2428. }
  2429. /**
  2430. * Gets the number of symbols in `string`.
  2431. *
  2432. * @private
  2433. * @param {string} string The string to inspect.
  2434. * @returns {number} Returns the string size.
  2435. */
  2436. function stringSize(string) {
  2437. return hasUnicode(string)
  2438. ? unicodeSize(string)
  2439. : asciiSize(string);
  2440. }
  2441. /**
  2442. * Converts `string` to an array.
  2443. *
  2444. * @private
  2445. * @param {string} string The string to convert.
  2446. * @returns {Array} Returns the converted array.
  2447. */
  2448. function stringToArray(string) {
  2449. return hasUnicode(string)
  2450. ? unicodeToArray(string)
  2451. : asciiToArray(string);
  2452. }
  2453. /**
  2454. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2455. * character of `string`.
  2456. *
  2457. * @private
  2458. * @param {string} string The string to inspect.
  2459. * @returns {number} Returns the index of the last non-whitespace character.
  2460. */
  2461. function trimmedEndIndex(string) {
  2462. var index = string.length;
  2463. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2464. return index;
  2465. }
  2466. /**
  2467. * Used by `_.unescape` to convert HTML entities to characters.
  2468. *
  2469. * @private
  2470. * @param {string} chr The matched character to unescape.
  2471. * @returns {string} Returns the unescaped character.
  2472. */
  2473. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2474. /**
  2475. * Gets the size of a Unicode `string`.
  2476. *
  2477. * @private
  2478. * @param {string} string The string inspect.
  2479. * @returns {number} Returns the string size.
  2480. */
  2481. function unicodeSize(string) {
  2482. var result = reUnicode.lastIndex = 0;
  2483. while (reUnicode.test(string)) {
  2484. ++result;
  2485. }
  2486. return result;
  2487. }
  2488. /**
  2489. * Converts a Unicode `string` to an array.
  2490. *
  2491. * @private
  2492. * @param {string} string The string to convert.
  2493. * @returns {Array} Returns the converted array.
  2494. */
  2495. function unicodeToArray(string) {
  2496. return string.match(reUnicode) || [];
  2497. }
  2498. /**
  2499. * Splits a Unicode `string` into an array of its words.
  2500. *
  2501. * @private
  2502. * @param {string} The string to inspect.
  2503. * @returns {Array} Returns the words of `string`.
  2504. */
  2505. function unicodeWords(string) {
  2506. return string.match(reUnicodeWord) || [];
  2507. }
  2508. /*--------------------------------------------------------------------------*/
  2509. /**
  2510. * Create a new pristine `lodash` function using the `context` object.
  2511. *
  2512. * @static
  2513. * @memberOf _
  2514. * @since 1.1.0
  2515. * @category Util
  2516. * @param {Object} [context=root] The context object.
  2517. * @returns {Function} Returns a new `lodash` function.
  2518. * @example
  2519. *
  2520. * _.mixin({ 'foo': _.constant('foo') });
  2521. *
  2522. * var lodash = _.runInContext();
  2523. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2524. *
  2525. * _.isFunction(_.foo);
  2526. * // => true
  2527. * _.isFunction(_.bar);
  2528. * // => false
  2529. *
  2530. * lodash.isFunction(lodash.foo);
  2531. * // => false
  2532. * lodash.isFunction(lodash.bar);
  2533. * // => true
  2534. *
  2535. * // Create a suped-up `defer` in Node.js.
  2536. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2537. */
  2538. var runInContext = (function runInContext(context) {
  2539. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2540. /** Built-in constructor references. */
  2541. var Array = context.Array,
  2542. Date = context.Date,
  2543. Error = context.Error,
  2544. Function = context.Function,
  2545. Math = context.Math,
  2546. Object = context.Object,
  2547. RegExp = context.RegExp,
  2548. String = context.String,
  2549. TypeError = context.TypeError;
  2550. /** Used for built-in method references. */
  2551. var arrayProto = Array.prototype,
  2552. funcProto = Function.prototype,
  2553. objectProto = Object.prototype;
  2554. /** Used to detect overreaching core-js shims. */
  2555. var coreJsData = context['__core-js_shared__'];
  2556. /** Used to resolve the decompiled source of functions. */
  2557. var funcToString = funcProto.toString;
  2558. /** Used to check objects for own properties. */
  2559. var hasOwnProperty = objectProto.hasOwnProperty;
  2560. /** Used to generate unique IDs. */
  2561. var idCounter = 0;
  2562. /** Used to detect methods masquerading as native. */
  2563. var maskSrcKey = (function() {
  2564. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2565. return uid ? ('Symbol(src)_1.' + uid) : '';
  2566. }());
  2567. /**
  2568. * Used to resolve the
  2569. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2570. * of values.
  2571. */
  2572. var nativeObjectToString = objectProto.toString;
  2573. /** Used to infer the `Object` constructor. */
  2574. var objectCtorString = funcToString.call(Object);
  2575. /** Used to restore the original `_` reference in `_.noConflict`. */
  2576. var oldDash = root._;
  2577. /** Used to detect if a method is native. */
  2578. var reIsNative = RegExp('^' +
  2579. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2580. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2581. );
  2582. /** Built-in value references. */
  2583. var Buffer = moduleExports ? context.Buffer : undefined,
  2584. Symbol = context.Symbol,
  2585. Uint8Array = context.Uint8Array,
  2586. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2587. getPrototype = overArg(Object.getPrototypeOf, Object),
  2588. objectCreate = Object.create,
  2589. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2590. splice = arrayProto.splice,
  2591. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2592. symIterator = Symbol ? Symbol.iterator : undefined,
  2593. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2594. var defineProperty = (function() {
  2595. try {
  2596. var func = getNative(Object, 'defineProperty');
  2597. func({}, '', {});
  2598. return func;
  2599. } catch (e) {}
  2600. }());
  2601. /** Mocked built-ins. */
  2602. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2603. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2604. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2605. /* Built-in method references for those with the same name as other `lodash` methods. */
  2606. var nativeCeil = Math.ceil,
  2607. nativeFloor = Math.floor,
  2608. nativeGetSymbols = Object.getOwnPropertySymbols,
  2609. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2610. nativeIsFinite = context.isFinite,
  2611. nativeJoin = arrayProto.join,
  2612. nativeKeys = overArg(Object.keys, Object),
  2613. nativeMax = Math.max,
  2614. nativeMin = Math.min,
  2615. nativeNow = Date.now,
  2616. nativeParseInt = context.parseInt,
  2617. nativeRandom = Math.random,
  2618. nativeReverse = arrayProto.reverse;
  2619. /* Built-in method references that are verified to be native. */
  2620. var DataView = getNative(context, 'DataView'),
  2621. Map = getNative(context, 'Map'),
  2622. Promise = getNative(context, 'Promise'),
  2623. Set = getNative(context, 'Set'),
  2624. WeakMap = getNative(context, 'WeakMap'),
  2625. nativeCreate = getNative(Object, 'create');
  2626. /** Used to store function metadata. */
  2627. var metaMap = WeakMap && new WeakMap;
  2628. /** Used to lookup unminified function names. */
  2629. var realNames = {};
  2630. /** Used to detect maps, sets, and weakmaps. */
  2631. var dataViewCtorString = toSource(DataView),
  2632. mapCtorString = toSource(Map),
  2633. promiseCtorString = toSource(Promise),
  2634. setCtorString = toSource(Set),
  2635. weakMapCtorString = toSource(WeakMap);
  2636. /** Used to convert symbols to primitives and strings. */
  2637. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2638. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2639. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2640. /*------------------------------------------------------------------------*/
  2641. /**
  2642. * Creates a `lodash` object which wraps `value` to enable implicit method
  2643. * chain sequences. Methods that operate on and return arrays, collections,
  2644. * and functions can be chained together. Methods that retrieve a single value
  2645. * or may return a primitive value will automatically end the chain sequence
  2646. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2647. * with `_#value`.
  2648. *
  2649. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2650. * enabled using `_.chain`.
  2651. *
  2652. * The execution of chained methods is lazy, that is, it's deferred until
  2653. * `_#value` is implicitly or explicitly called.
  2654. *
  2655. * Lazy evaluation allows several methods to support shortcut fusion.
  2656. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2657. * the creation of intermediate arrays and can greatly reduce the number of
  2658. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2659. * fusion if the section is applied to an array and iteratees accept only
  2660. * one argument. The heuristic for whether a section qualifies for shortcut
  2661. * fusion is subject to change.
  2662. *
  2663. * Chaining is supported in custom builds as long as the `_#value` method is
  2664. * directly or indirectly included in the build.
  2665. *
  2666. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2667. *
  2668. * The wrapper `Array` methods are:
  2669. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2670. *
  2671. * The wrapper `String` methods are:
  2672. * `replace` and `split`
  2673. *
  2674. * The wrapper methods that support shortcut fusion are:
  2675. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2676. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2677. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2678. *
  2679. * The chainable wrapper methods are:
  2680. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2681. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2682. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2683. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2684. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2685. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2686. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2687. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2688. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2689. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2690. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2691. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2692. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2693. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2694. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2695. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2696. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2697. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2698. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2699. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2700. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2701. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2702. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2703. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2704. *
  2705. * The wrapper methods that are **not** chainable by default are:
  2706. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2707. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2708. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2709. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2710. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2711. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2712. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2713. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2714. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2715. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2716. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2717. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2718. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2719. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2720. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2721. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2722. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2723. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2724. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2725. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2726. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2727. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2728. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2729. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2730. * `upperFirst`, `value`, and `words`
  2731. *
  2732. * @name _
  2733. * @constructor
  2734. * @category Seq
  2735. * @param {*} value The value to wrap in a `lodash` instance.
  2736. * @returns {Object} Returns the new `lodash` wrapper instance.
  2737. * @example
  2738. *
  2739. * function square(n) {
  2740. * return n * n;
  2741. * }
  2742. *
  2743. * var wrapped = _([1, 2, 3]);
  2744. *
  2745. * // Returns an unwrapped value.
  2746. * wrapped.reduce(_.add);
  2747. * // => 6
  2748. *
  2749. * // Returns a wrapped value.
  2750. * var squares = wrapped.map(square);
  2751. *
  2752. * _.isArray(squares);
  2753. * // => false
  2754. *
  2755. * _.isArray(squares.value());
  2756. * // => true
  2757. */
  2758. function lodash(value) {
  2759. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2760. if (value instanceof LodashWrapper) {
  2761. return value;
  2762. }
  2763. if (hasOwnProperty.call(value, '__wrapped__')) {
  2764. return wrapperClone(value);
  2765. }
  2766. }
  2767. return new LodashWrapper(value);
  2768. }
  2769. /**
  2770. * The base implementation of `_.create` without support for assigning
  2771. * properties to the created object.
  2772. *
  2773. * @private
  2774. * @param {Object} proto The object to inherit from.
  2775. * @returns {Object} Returns the new object.
  2776. */
  2777. var baseCreate = (function() {
  2778. function object() {}
  2779. return function(proto) {
  2780. if (!isObject(proto)) {
  2781. return {};
  2782. }
  2783. if (objectCreate) {
  2784. return objectCreate(proto);
  2785. }
  2786. object.prototype = proto;
  2787. var result = new object;
  2788. object.prototype = undefined;
  2789. return result;
  2790. };
  2791. }());
  2792. /**
  2793. * The function whose prototype chain sequence wrappers inherit from.
  2794. *
  2795. * @private
  2796. */
  2797. function baseLodash() {
  2798. // No operation performed.
  2799. }
  2800. /**
  2801. * The base constructor for creating `lodash` wrapper objects.
  2802. *
  2803. * @private
  2804. * @param {*} value The value to wrap.
  2805. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2806. */
  2807. function LodashWrapper(value, chainAll) {
  2808. this.__wrapped__ = value;
  2809. this.__actions__ = [];
  2810. this.__chain__ = !!chainAll;
  2811. this.__index__ = 0;
  2812. this.__values__ = undefined;
  2813. }
  2814. /**
  2815. * By default, the template delimiters used by lodash are like those in
  2816. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2817. * following template settings to use alternative delimiters.
  2818. *
  2819. * @static
  2820. * @memberOf _
  2821. * @type {Object}
  2822. */
  2823. lodash.templateSettings = {
  2824. /**
  2825. * Used to detect `data` property values to be HTML-escaped.
  2826. *
  2827. * @memberOf _.templateSettings
  2828. * @type {RegExp}
  2829. */
  2830. 'escape': reEscape,
  2831. /**
  2832. * Used to detect code to be evaluated.
  2833. *
  2834. * @memberOf _.templateSettings
  2835. * @type {RegExp}
  2836. */
  2837. 'evaluate': reEvaluate,
  2838. /**
  2839. * Used to detect `data` property values to inject.
  2840. *
  2841. * @memberOf _.templateSettings
  2842. * @type {RegExp}
  2843. */
  2844. 'interpolate': reInterpolate,
  2845. /**
  2846. * Used to reference the data object in the template text.
  2847. *
  2848. * @memberOf _.templateSettings
  2849. * @type {string}
  2850. */
  2851. 'variable': '',
  2852. /**
  2853. * Used to import variables into the compiled template.
  2854. *
  2855. * @memberOf _.templateSettings
  2856. * @type {Object}
  2857. */
  2858. 'imports': {
  2859. /**
  2860. * A reference to the `lodash` function.
  2861. *
  2862. * @memberOf _.templateSettings.imports
  2863. * @type {Function}
  2864. */
  2865. '_': lodash
  2866. }
  2867. };
  2868. // Ensure wrappers are instances of `baseLodash`.
  2869. lodash.prototype = baseLodash.prototype;
  2870. lodash.prototype.constructor = lodash;
  2871. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2872. LodashWrapper.prototype.constructor = LodashWrapper;
  2873. /*------------------------------------------------------------------------*/
  2874. /**
  2875. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2876. *
  2877. * @private
  2878. * @constructor
  2879. * @param {*} value The value to wrap.
  2880. */
  2881. function LazyWrapper(value) {
  2882. this.__wrapped__ = value;
  2883. this.__actions__ = [];
  2884. this.__dir__ = 1;
  2885. this.__filtered__ = false;
  2886. this.__iteratees__ = [];
  2887. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2888. this.__views__ = [];
  2889. }
  2890. /**
  2891. * Creates a clone of the lazy wrapper object.
  2892. *
  2893. * @private
  2894. * @name clone
  2895. * @memberOf LazyWrapper
  2896. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2897. */
  2898. function lazyClone() {
  2899. var result = new LazyWrapper(this.__wrapped__);
  2900. result.__actions__ = copyArray(this.__actions__);
  2901. result.__dir__ = this.__dir__;
  2902. result.__filtered__ = this.__filtered__;
  2903. result.__iteratees__ = copyArray(this.__iteratees__);
  2904. result.__takeCount__ = this.__takeCount__;
  2905. result.__views__ = copyArray(this.__views__);
  2906. return result;
  2907. }
  2908. /**
  2909. * Reverses the direction of lazy iteration.
  2910. *
  2911. * @private
  2912. * @name reverse
  2913. * @memberOf LazyWrapper
  2914. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2915. */
  2916. function lazyReverse() {
  2917. if (this.__filtered__) {
  2918. var result = new LazyWrapper(this);
  2919. result.__dir__ = -1;
  2920. result.__filtered__ = true;
  2921. } else {
  2922. result = this.clone();
  2923. result.__dir__ *= -1;
  2924. }
  2925. return result;
  2926. }
  2927. /**
  2928. * Extracts the unwrapped value from its lazy wrapper.
  2929. *
  2930. * @private
  2931. * @name value
  2932. * @memberOf LazyWrapper
  2933. * @returns {*} Returns the unwrapped value.
  2934. */
  2935. function lazyValue() {
  2936. var array = this.__wrapped__.value(),
  2937. dir = this.__dir__,
  2938. isArr = isArray(array),
  2939. isRight = dir < 0,
  2940. arrLength = isArr ? array.length : 0,
  2941. view = getView(0, arrLength, this.__views__),
  2942. start = view.start,
  2943. end = view.end,
  2944. length = end - start,
  2945. index = isRight ? end : (start - 1),
  2946. iteratees = this.__iteratees__,
  2947. iterLength = iteratees.length,
  2948. resIndex = 0,
  2949. takeCount = nativeMin(length, this.__takeCount__);
  2950. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2951. return baseWrapperValue(array, this.__actions__);
  2952. }
  2953. var result = [];
  2954. outer:
  2955. while (length-- && resIndex < takeCount) {
  2956. index += dir;
  2957. var iterIndex = -1,
  2958. value = array[index];
  2959. while (++iterIndex < iterLength) {
  2960. var data = iteratees[iterIndex],
  2961. iteratee = data.iteratee,
  2962. type = data.type,
  2963. computed = iteratee(value);
  2964. if (type == LAZY_MAP_FLAG) {
  2965. value = computed;
  2966. } else if (!computed) {
  2967. if (type == LAZY_FILTER_FLAG) {
  2968. continue outer;
  2969. } else {
  2970. break outer;
  2971. }
  2972. }
  2973. }
  2974. result[resIndex++] = value;
  2975. }
  2976. return result;
  2977. }
  2978. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2979. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2980. LazyWrapper.prototype.constructor = LazyWrapper;
  2981. /*------------------------------------------------------------------------*/
  2982. /**
  2983. * Creates a hash object.
  2984. *
  2985. * @private
  2986. * @constructor
  2987. * @param {Array} [entries] The key-value pairs to cache.
  2988. */
  2989. function Hash(entries) {
  2990. var index = -1,
  2991. length = entries == null ? 0 : entries.length;
  2992. this.clear();
  2993. while (++index < length) {
  2994. var entry = entries[index];
  2995. this.set(entry[0], entry[1]);
  2996. }
  2997. }
  2998. /**
  2999. * Removes all key-value entries from the hash.
  3000. *
  3001. * @private
  3002. * @name clear
  3003. * @memberOf Hash
  3004. */
  3005. function hashClear() {
  3006. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3007. this.size = 0;
  3008. }
  3009. /**
  3010. * Removes `key` and its value from the hash.
  3011. *
  3012. * @private
  3013. * @name delete
  3014. * @memberOf Hash
  3015. * @param {Object} hash The hash to modify.
  3016. * @param {string} key The key of the value to remove.
  3017. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3018. */
  3019. function hashDelete(key) {
  3020. var result = this.has(key) && delete this.__data__[key];
  3021. this.size -= result ? 1 : 0;
  3022. return result;
  3023. }
  3024. /**
  3025. * Gets the hash value for `key`.
  3026. *
  3027. * @private
  3028. * @name get
  3029. * @memberOf Hash
  3030. * @param {string} key The key of the value to get.
  3031. * @returns {*} Returns the entry value.
  3032. */
  3033. function hashGet(key) {
  3034. var data = this.__data__;
  3035. if (nativeCreate) {
  3036. var result = data[key];
  3037. return result === HASH_UNDEFINED ? undefined : result;
  3038. }
  3039. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3040. }
  3041. /**
  3042. * Checks if a hash value for `key` exists.
  3043. *
  3044. * @private
  3045. * @name has
  3046. * @memberOf Hash
  3047. * @param {string} key The key of the entry to check.
  3048. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3049. */
  3050. function hashHas(key) {
  3051. var data = this.__data__;
  3052. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3053. }
  3054. /**
  3055. * Sets the hash `key` to `value`.
  3056. *
  3057. * @private
  3058. * @name set
  3059. * @memberOf Hash
  3060. * @param {string} key The key of the value to set.
  3061. * @param {*} value The value to set.
  3062. * @returns {Object} Returns the hash instance.
  3063. */
  3064. function hashSet(key, value) {
  3065. var data = this.__data__;
  3066. this.size += this.has(key) ? 0 : 1;
  3067. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3068. return this;
  3069. }
  3070. // Add methods to `Hash`.
  3071. Hash.prototype.clear = hashClear;
  3072. Hash.prototype['delete'] = hashDelete;
  3073. Hash.prototype.get = hashGet;
  3074. Hash.prototype.has = hashHas;
  3075. Hash.prototype.set = hashSet;
  3076. /*------------------------------------------------------------------------*/
  3077. /**
  3078. * Creates an list cache object.
  3079. *
  3080. * @private
  3081. * @constructor
  3082. * @param {Array} [entries] The key-value pairs to cache.
  3083. */
  3084. function ListCache(entries) {
  3085. var index = -1,
  3086. length = entries == null ? 0 : entries.length;
  3087. this.clear();
  3088. while (++index < length) {
  3089. var entry = entries[index];
  3090. this.set(entry[0], entry[1]);
  3091. }
  3092. }
  3093. /**
  3094. * Removes all key-value entries from the list cache.
  3095. *
  3096. * @private
  3097. * @name clear
  3098. * @memberOf ListCache
  3099. */
  3100. function listCacheClear() {
  3101. this.__data__ = [];
  3102. this.size = 0;
  3103. }
  3104. /**
  3105. * Removes `key` and its value from the list cache.
  3106. *
  3107. * @private
  3108. * @name delete
  3109. * @memberOf ListCache
  3110. * @param {string} key The key of the value to remove.
  3111. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3112. */
  3113. function listCacheDelete(key) {
  3114. var data = this.__data__,
  3115. index = assocIndexOf(data, key);
  3116. if (index < 0) {
  3117. return false;
  3118. }
  3119. var lastIndex = data.length - 1;
  3120. if (index == lastIndex) {
  3121. data.pop();
  3122. } else {
  3123. splice.call(data, index, 1);
  3124. }
  3125. --this.size;
  3126. return true;
  3127. }
  3128. /**
  3129. * Gets the list cache value for `key`.
  3130. *
  3131. * @private
  3132. * @name get
  3133. * @memberOf ListCache
  3134. * @param {string} key The key of the value to get.
  3135. * @returns {*} Returns the entry value.
  3136. */
  3137. function listCacheGet(key) {
  3138. var data = this.__data__,
  3139. index = assocIndexOf(data, key);
  3140. return index < 0 ? undefined : data[index][1];
  3141. }
  3142. /**
  3143. * Checks if a list cache value for `key` exists.
  3144. *
  3145. * @private
  3146. * @name has
  3147. * @memberOf ListCache
  3148. * @param {string} key The key of the entry to check.
  3149. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3150. */
  3151. function listCacheHas(key) {
  3152. return assocIndexOf(this.__data__, key) > -1;
  3153. }
  3154. /**
  3155. * Sets the list cache `key` to `value`.
  3156. *
  3157. * @private
  3158. * @name set
  3159. * @memberOf ListCache
  3160. * @param {string} key The key of the value to set.
  3161. * @param {*} value The value to set.
  3162. * @returns {Object} Returns the list cache instance.
  3163. */
  3164. function listCacheSet(key, value) {
  3165. var data = this.__data__,
  3166. index = assocIndexOf(data, key);
  3167. if (index < 0) {
  3168. ++this.size;
  3169. data.push([key, value]);
  3170. } else {
  3171. data[index][1] = value;
  3172. }
  3173. return this;
  3174. }
  3175. // Add methods to `ListCache`.
  3176. ListCache.prototype.clear = listCacheClear;
  3177. ListCache.prototype['delete'] = listCacheDelete;
  3178. ListCache.prototype.get = listCacheGet;
  3179. ListCache.prototype.has = listCacheHas;
  3180. ListCache.prototype.set = listCacheSet;
  3181. /*------------------------------------------------------------------------*/
  3182. /**
  3183. * Creates a map cache object to store key-value pairs.
  3184. *
  3185. * @private
  3186. * @constructor
  3187. * @param {Array} [entries] The key-value pairs to cache.
  3188. */
  3189. function MapCache(entries) {
  3190. var index = -1,
  3191. length = entries == null ? 0 : entries.length;
  3192. this.clear();
  3193. while (++index < length) {
  3194. var entry = entries[index];
  3195. this.set(entry[0], entry[1]);
  3196. }
  3197. }
  3198. /**
  3199. * Removes all key-value entries from the map.
  3200. *
  3201. * @private
  3202. * @name clear
  3203. * @memberOf MapCache
  3204. */
  3205. function mapCacheClear() {
  3206. this.size = 0;
  3207. this.__data__ = {
  3208. 'hash': new Hash,
  3209. 'map': new (Map || ListCache),
  3210. 'string': new Hash
  3211. };
  3212. }
  3213. /**
  3214. * Removes `key` and its value from the map.
  3215. *
  3216. * @private
  3217. * @name delete
  3218. * @memberOf MapCache
  3219. * @param {string} key The key of the value to remove.
  3220. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3221. */
  3222. function mapCacheDelete(key) {
  3223. var result = getMapData(this, key)['delete'](key);
  3224. this.size -= result ? 1 : 0;
  3225. return result;
  3226. }
  3227. /**
  3228. * Gets the map value for `key`.
  3229. *
  3230. * @private
  3231. * @name get
  3232. * @memberOf MapCache
  3233. * @param {string} key The key of the value to get.
  3234. * @returns {*} Returns the entry value.
  3235. */
  3236. function mapCacheGet(key) {
  3237. return getMapData(this, key).get(key);
  3238. }
  3239. /**
  3240. * Checks if a map value for `key` exists.
  3241. *
  3242. * @private
  3243. * @name has
  3244. * @memberOf MapCache
  3245. * @param {string} key The key of the entry to check.
  3246. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3247. */
  3248. function mapCacheHas(key) {
  3249. return getMapData(this, key).has(key);
  3250. }
  3251. /**
  3252. * Sets the map `key` to `value`.
  3253. *
  3254. * @private
  3255. * @name set
  3256. * @memberOf MapCache
  3257. * @param {string} key The key of the value to set.
  3258. * @param {*} value The value to set.
  3259. * @returns {Object} Returns the map cache instance.
  3260. */
  3261. function mapCacheSet(key, value) {
  3262. var data = getMapData(this, key),
  3263. size = data.size;
  3264. data.set(key, value);
  3265. this.size += data.size == size ? 0 : 1;
  3266. return this;
  3267. }
  3268. // Add methods to `MapCache`.
  3269. MapCache.prototype.clear = mapCacheClear;
  3270. MapCache.prototype['delete'] = mapCacheDelete;
  3271. MapCache.prototype.get = mapCacheGet;
  3272. MapCache.prototype.has = mapCacheHas;
  3273. MapCache.prototype.set = mapCacheSet;
  3274. /*------------------------------------------------------------------------*/
  3275. /**
  3276. *
  3277. * Creates an array cache object to store unique values.
  3278. *
  3279. * @private
  3280. * @constructor
  3281. * @param {Array} [values] The values to cache.
  3282. */
  3283. function SetCache(values) {
  3284. var index = -1,
  3285. length = values == null ? 0 : values.length;
  3286. this.__data__ = new MapCache;
  3287. while (++index < length) {
  3288. this.add(values[index]);
  3289. }
  3290. }
  3291. /**
  3292. * Adds `value` to the array cache.
  3293. *
  3294. * @private
  3295. * @name add
  3296. * @memberOf SetCache
  3297. * @alias push
  3298. * @param {*} value The value to cache.
  3299. * @returns {Object} Returns the cache instance.
  3300. */
  3301. function setCacheAdd(value) {
  3302. this.__data__.set(value, HASH_UNDEFINED);
  3303. return this;
  3304. }
  3305. /**
  3306. * Checks if `value` is in the array cache.
  3307. *
  3308. * @private
  3309. * @name has
  3310. * @memberOf SetCache
  3311. * @param {*} value The value to search for.
  3312. * @returns {number} Returns `true` if `value` is found, else `false`.
  3313. */
  3314. function setCacheHas(value) {
  3315. return this.__data__.has(value);
  3316. }
  3317. // Add methods to `SetCache`.
  3318. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3319. SetCache.prototype.has = setCacheHas;
  3320. /*------------------------------------------------------------------------*/
  3321. /**
  3322. * Creates a stack cache object to store key-value pairs.
  3323. *
  3324. * @private
  3325. * @constructor
  3326. * @param {Array} [entries] The key-value pairs to cache.
  3327. */
  3328. function Stack(entries) {
  3329. var data = this.__data__ = new ListCache(entries);
  3330. this.size = data.size;
  3331. }
  3332. /**
  3333. * Removes all key-value entries from the stack.
  3334. *
  3335. * @private
  3336. * @name clear
  3337. * @memberOf Stack
  3338. */
  3339. function stackClear() {
  3340. this.__data__ = new ListCache;
  3341. this.size = 0;
  3342. }
  3343. /**
  3344. * Removes `key` and its value from the stack.
  3345. *
  3346. * @private
  3347. * @name delete
  3348. * @memberOf Stack
  3349. * @param {string} key The key of the value to remove.
  3350. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3351. */
  3352. function stackDelete(key) {
  3353. var data = this.__data__,
  3354. result = data['delete'](key);
  3355. this.size = data.size;
  3356. return result;
  3357. }
  3358. /**
  3359. * Gets the stack value for `key`.
  3360. *
  3361. * @private
  3362. * @name get
  3363. * @memberOf Stack
  3364. * @param {string} key The key of the value to get.
  3365. * @returns {*} Returns the entry value.
  3366. */
  3367. function stackGet(key) {
  3368. return this.__data__.get(key);
  3369. }
  3370. /**
  3371. * Checks if a stack value for `key` exists.
  3372. *
  3373. * @private
  3374. * @name has
  3375. * @memberOf Stack
  3376. * @param {string} key The key of the entry to check.
  3377. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3378. */
  3379. function stackHas(key) {
  3380. return this.__data__.has(key);
  3381. }
  3382. /**
  3383. * Sets the stack `key` to `value`.
  3384. *
  3385. * @private
  3386. * @name set
  3387. * @memberOf Stack
  3388. * @param {string} key The key of the value to set.
  3389. * @param {*} value The value to set.
  3390. * @returns {Object} Returns the stack cache instance.
  3391. */
  3392. function stackSet(key, value) {
  3393. var data = this.__data__;
  3394. if (data instanceof ListCache) {
  3395. var pairs = data.__data__;
  3396. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3397. pairs.push([key, value]);
  3398. this.size = ++data.size;
  3399. return this;
  3400. }
  3401. data = this.__data__ = new MapCache(pairs);
  3402. }
  3403. data.set(key, value);
  3404. this.size = data.size;
  3405. return this;
  3406. }
  3407. // Add methods to `Stack`.
  3408. Stack.prototype.clear = stackClear;
  3409. Stack.prototype['delete'] = stackDelete;
  3410. Stack.prototype.get = stackGet;
  3411. Stack.prototype.has = stackHas;
  3412. Stack.prototype.set = stackSet;
  3413. /*------------------------------------------------------------------------*/
  3414. /**
  3415. * Creates an array of the enumerable property names of the array-like `value`.
  3416. *
  3417. * @private
  3418. * @param {*} value The value to query.
  3419. * @param {boolean} inherited Specify returning inherited property names.
  3420. * @returns {Array} Returns the array of property names.
  3421. */
  3422. function arrayLikeKeys(value, inherited) {
  3423. var isArr = isArray(value),
  3424. isArg = !isArr && isArguments(value),
  3425. isBuff = !isArr && !isArg && isBuffer(value),
  3426. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3427. skipIndexes = isArr || isArg || isBuff || isType,
  3428. result = skipIndexes ? baseTimes(value.length, String) : [],
  3429. length = result.length;
  3430. for (var key in value) {
  3431. if ((inherited || hasOwnProperty.call(value, key)) &&
  3432. !(skipIndexes && (
  3433. // Safari 9 has enumerable `arguments.length` in strict mode.
  3434. key == 'length' ||
  3435. // Node.js 0.10 has enumerable non-index properties on buffers.
  3436. (isBuff && (key == 'offset' || key == 'parent')) ||
  3437. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3438. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3439. // Skip index properties.
  3440. isIndex(key, length)
  3441. ))) {
  3442. result.push(key);
  3443. }
  3444. }
  3445. return result;
  3446. }
  3447. /**
  3448. * A specialized version of `_.sample` for arrays.
  3449. *
  3450. * @private
  3451. * @param {Array} array The array to sample.
  3452. * @returns {*} Returns the random element.
  3453. */
  3454. function arraySample(array) {
  3455. var length = array.length;
  3456. return length ? array[baseRandom(0, length - 1)] : undefined;
  3457. }
  3458. /**
  3459. * A specialized version of `_.sampleSize` for arrays.
  3460. *
  3461. * @private
  3462. * @param {Array} array The array to sample.
  3463. * @param {number} n The number of elements to sample.
  3464. * @returns {Array} Returns the random elements.
  3465. */
  3466. function arraySampleSize(array, n) {
  3467. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3468. }
  3469. /**
  3470. * A specialized version of `_.shuffle` for arrays.
  3471. *
  3472. * @private
  3473. * @param {Array} array The array to shuffle.
  3474. * @returns {Array} Returns the new shuffled array.
  3475. */
  3476. function arrayShuffle(array) {
  3477. return shuffleSelf(copyArray(array));
  3478. }
  3479. /**
  3480. * This function is like `assignValue` except that it doesn't assign
  3481. * `undefined` values.
  3482. *
  3483. * @private
  3484. * @param {Object} object The object to modify.
  3485. * @param {string} key The key of the property to assign.
  3486. * @param {*} value The value to assign.
  3487. */
  3488. function assignMergeValue(object, key, value) {
  3489. if ((value !== undefined && !eq(object[key], value)) ||
  3490. (value === undefined && !(key in object))) {
  3491. baseAssignValue(object, key, value);
  3492. }
  3493. }
  3494. /**
  3495. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3496. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3497. * for equality comparisons.
  3498. *
  3499. * @private
  3500. * @param {Object} object The object to modify.
  3501. * @param {string} key The key of the property to assign.
  3502. * @param {*} value The value to assign.
  3503. */
  3504. function assignValue(object, key, value) {
  3505. var objValue = object[key];
  3506. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3507. (value === undefined && !(key in object))) {
  3508. baseAssignValue(object, key, value);
  3509. }
  3510. }
  3511. /**
  3512. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3513. *
  3514. * @private
  3515. * @param {Array} array The array to inspect.
  3516. * @param {*} key The key to search for.
  3517. * @returns {number} Returns the index of the matched value, else `-1`.
  3518. */
  3519. function assocIndexOf(array, key) {
  3520. var length = array.length;
  3521. while (length--) {
  3522. if (eq(array[length][0], key)) {
  3523. return length;
  3524. }
  3525. }
  3526. return -1;
  3527. }
  3528. /**
  3529. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3530. * by `iteratee` and values set by `setter`.
  3531. *
  3532. * @private
  3533. * @param {Array|Object} collection The collection to iterate over.
  3534. * @param {Function} setter The function to set `accumulator` values.
  3535. * @param {Function} iteratee The iteratee to transform keys.
  3536. * @param {Object} accumulator The initial aggregated object.
  3537. * @returns {Function} Returns `accumulator`.
  3538. */
  3539. function baseAggregator(collection, setter, iteratee, accumulator) {
  3540. baseEach(collection, function(value, key, collection) {
  3541. setter(accumulator, value, iteratee(value), collection);
  3542. });
  3543. return accumulator;
  3544. }
  3545. /**
  3546. * The base implementation of `_.assign` without support for multiple sources
  3547. * or `customizer` functions.
  3548. *
  3549. * @private
  3550. * @param {Object} object The destination object.
  3551. * @param {Object} source The source object.
  3552. * @returns {Object} Returns `object`.
  3553. */
  3554. function baseAssign(object, source) {
  3555. return object && copyObject(source, keys(source), object);
  3556. }
  3557. /**
  3558. * The base implementation of `_.assignIn` without support for multiple sources
  3559. * or `customizer` functions.
  3560. *
  3561. * @private
  3562. * @param {Object} object The destination object.
  3563. * @param {Object} source The source object.
  3564. * @returns {Object} Returns `object`.
  3565. */
  3566. function baseAssignIn(object, source) {
  3567. return object && copyObject(source, keysIn(source), object);
  3568. }
  3569. /**
  3570. * The base implementation of `assignValue` and `assignMergeValue` without
  3571. * value checks.
  3572. *
  3573. * @private
  3574. * @param {Object} object The object to modify.
  3575. * @param {string} key The key of the property to assign.
  3576. * @param {*} value The value to assign.
  3577. */
  3578. function baseAssignValue(object, key, value) {
  3579. if (key == '__proto__' && defineProperty) {
  3580. defineProperty(object, key, {
  3581. 'configurable': true,
  3582. 'enumerable': true,
  3583. 'value': value,
  3584. 'writable': true
  3585. });
  3586. } else {
  3587. object[key] = value;
  3588. }
  3589. }
  3590. /**
  3591. * The base implementation of `_.at` without support for individual paths.
  3592. *
  3593. * @private
  3594. * @param {Object} object The object to iterate over.
  3595. * @param {string[]} paths The property paths to pick.
  3596. * @returns {Array} Returns the picked elements.
  3597. */
  3598. function baseAt(object, paths) {
  3599. var index = -1,
  3600. length = paths.length,
  3601. result = Array(length),
  3602. skip = object == null;
  3603. while (++index < length) {
  3604. result[index] = skip ? undefined : get(object, paths[index]);
  3605. }
  3606. return result;
  3607. }
  3608. /**
  3609. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3610. *
  3611. * @private
  3612. * @param {number} number The number to clamp.
  3613. * @param {number} [lower] The lower bound.
  3614. * @param {number} upper The upper bound.
  3615. * @returns {number} Returns the clamped number.
  3616. */
  3617. function baseClamp(number, lower, upper) {
  3618. if (number === number) {
  3619. if (upper !== undefined) {
  3620. number = number <= upper ? number : upper;
  3621. }
  3622. if (lower !== undefined) {
  3623. number = number >= lower ? number : lower;
  3624. }
  3625. }
  3626. return number;
  3627. }
  3628. /**
  3629. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3630. * traversed objects.
  3631. *
  3632. * @private
  3633. * @param {*} value The value to clone.
  3634. * @param {boolean} bitmask The bitmask flags.
  3635. * 1 - Deep clone
  3636. * 2 - Flatten inherited properties
  3637. * 4 - Clone symbols
  3638. * @param {Function} [customizer] The function to customize cloning.
  3639. * @param {string} [key] The key of `value`.
  3640. * @param {Object} [object] The parent object of `value`.
  3641. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3642. * @returns {*} Returns the cloned value.
  3643. */
  3644. function baseClone(value, bitmask, customizer, key, object, stack) {
  3645. var result,
  3646. isDeep = bitmask & CLONE_DEEP_FLAG,
  3647. isFlat = bitmask & CLONE_FLAT_FLAG,
  3648. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3649. if (customizer) {
  3650. result = object ? customizer(value, key, object, stack) : customizer(value);
  3651. }
  3652. if (result !== undefined) {
  3653. return result;
  3654. }
  3655. if (!isObject(value)) {
  3656. return value;
  3657. }
  3658. var isArr = isArray(value);
  3659. if (isArr) {
  3660. result = initCloneArray(value);
  3661. if (!isDeep) {
  3662. return copyArray(value, result);
  3663. }
  3664. } else {
  3665. var tag = getTag(value),
  3666. isFunc = tag == funcTag || tag == genTag;
  3667. if (isBuffer(value)) {
  3668. return cloneBuffer(value, isDeep);
  3669. }
  3670. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3671. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3672. if (!isDeep) {
  3673. return isFlat
  3674. ? copySymbolsIn(value, baseAssignIn(result, value))
  3675. : copySymbols(value, baseAssign(result, value));
  3676. }
  3677. } else {
  3678. if (!cloneableTags[tag]) {
  3679. return object ? value : {};
  3680. }
  3681. result = initCloneByTag(value, tag, isDeep);
  3682. }
  3683. }
  3684. // Check for circular references and return its corresponding clone.
  3685. stack || (stack = new Stack);
  3686. var stacked = stack.get(value);
  3687. if (stacked) {
  3688. return stacked;
  3689. }
  3690. stack.set(value, result);
  3691. if (isSet(value)) {
  3692. value.forEach(function(subValue) {
  3693. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3694. });
  3695. } else if (isMap(value)) {
  3696. value.forEach(function(subValue, key) {
  3697. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3698. });
  3699. }
  3700. var keysFunc = isFull
  3701. ? (isFlat ? getAllKeysIn : getAllKeys)
  3702. : (isFlat ? keysIn : keys);
  3703. var props = isArr ? undefined : keysFunc(value);
  3704. arrayEach(props || value, function(subValue, key) {
  3705. if (props) {
  3706. key = subValue;
  3707. subValue = value[key];
  3708. }
  3709. // Recursively populate clone (susceptible to call stack limits).
  3710. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3711. });
  3712. return result;
  3713. }
  3714. /**
  3715. * The base implementation of `_.conforms` which doesn't clone `source`.
  3716. *
  3717. * @private
  3718. * @param {Object} source The object of property predicates to conform to.
  3719. * @returns {Function} Returns the new spec function.
  3720. */
  3721. function baseConforms(source) {
  3722. var props = keys(source);
  3723. return function(object) {
  3724. return baseConformsTo(object, source, props);
  3725. };
  3726. }
  3727. /**
  3728. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3729. *
  3730. * @private
  3731. * @param {Object} object The object to inspect.
  3732. * @param {Object} source The object of property predicates to conform to.
  3733. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3734. */
  3735. function baseConformsTo(object, source, props) {
  3736. var length = props.length;
  3737. if (object == null) {
  3738. return !length;
  3739. }
  3740. object = Object(object);
  3741. while (length--) {
  3742. var key = props[length],
  3743. predicate = source[key],
  3744. value = object[key];
  3745. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3746. return false;
  3747. }
  3748. }
  3749. return true;
  3750. }
  3751. /**
  3752. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3753. * to provide to `func`.
  3754. *
  3755. * @private
  3756. * @param {Function} func The function to delay.
  3757. * @param {number} wait The number of milliseconds to delay invocation.
  3758. * @param {Array} args The arguments to provide to `func`.
  3759. * @returns {number|Object} Returns the timer id or timeout object.
  3760. */
  3761. function baseDelay(func, wait, args) {
  3762. if (typeof func != 'function') {
  3763. throw new TypeError(FUNC_ERROR_TEXT);
  3764. }
  3765. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3766. }
  3767. /**
  3768. * The base implementation of methods like `_.difference` without support
  3769. * for excluding multiple arrays or iteratee shorthands.
  3770. *
  3771. * @private
  3772. * @param {Array} array The array to inspect.
  3773. * @param {Array} values The values to exclude.
  3774. * @param {Function} [iteratee] The iteratee invoked per element.
  3775. * @param {Function} [comparator] The comparator invoked per element.
  3776. * @returns {Array} Returns the new array of filtered values.
  3777. */
  3778. function baseDifference(array, values, iteratee, comparator) {
  3779. var index = -1,
  3780. includes = arrayIncludes,
  3781. isCommon = true,
  3782. length = array.length,
  3783. result = [],
  3784. valuesLength = values.length;
  3785. if (!length) {
  3786. return result;
  3787. }
  3788. if (iteratee) {
  3789. values = arrayMap(values, baseUnary(iteratee));
  3790. }
  3791. if (comparator) {
  3792. includes = arrayIncludesWith;
  3793. isCommon = false;
  3794. }
  3795. else if (values.length >= LARGE_ARRAY_SIZE) {
  3796. includes = cacheHas;
  3797. isCommon = false;
  3798. values = new SetCache(values);
  3799. }
  3800. outer:
  3801. while (++index < length) {
  3802. var value = array[index],
  3803. computed = iteratee == null ? value : iteratee(value);
  3804. value = (comparator || value !== 0) ? value : 0;
  3805. if (isCommon && computed === computed) {
  3806. var valuesIndex = valuesLength;
  3807. while (valuesIndex--) {
  3808. if (values[valuesIndex] === computed) {
  3809. continue outer;
  3810. }
  3811. }
  3812. result.push(value);
  3813. }
  3814. else if (!includes(values, computed, comparator)) {
  3815. result.push(value);
  3816. }
  3817. }
  3818. return result;
  3819. }
  3820. /**
  3821. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3822. *
  3823. * @private
  3824. * @param {Array|Object} collection The collection to iterate over.
  3825. * @param {Function} iteratee The function invoked per iteration.
  3826. * @returns {Array|Object} Returns `collection`.
  3827. */
  3828. var baseEach = createBaseEach(baseForOwn);
  3829. /**
  3830. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3831. *
  3832. * @private
  3833. * @param {Array|Object} collection The collection to iterate over.
  3834. * @param {Function} iteratee The function invoked per iteration.
  3835. * @returns {Array|Object} Returns `collection`.
  3836. */
  3837. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3838. /**
  3839. * The base implementation of `_.every` without support for iteratee shorthands.
  3840. *
  3841. * @private
  3842. * @param {Array|Object} collection The collection to iterate over.
  3843. * @param {Function} predicate The function invoked per iteration.
  3844. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3845. * else `false`
  3846. */
  3847. function baseEvery(collection, predicate) {
  3848. var result = true;
  3849. baseEach(collection, function(value, index, collection) {
  3850. result = !!predicate(value, index, collection);
  3851. return result;
  3852. });
  3853. return result;
  3854. }
  3855. /**
  3856. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3857. * `comparator` to determine the extremum value.
  3858. *
  3859. * @private
  3860. * @param {Array} array The array to iterate over.
  3861. * @param {Function} iteratee The iteratee invoked per iteration.
  3862. * @param {Function} comparator The comparator used to compare values.
  3863. * @returns {*} Returns the extremum value.
  3864. */
  3865. function baseExtremum(array, iteratee, comparator) {
  3866. var index = -1,
  3867. length = array.length;
  3868. while (++index < length) {
  3869. var value = array[index],
  3870. current = iteratee(value);
  3871. if (current != null && (computed === undefined
  3872. ? (current === current && !isSymbol(current))
  3873. : comparator(current, computed)
  3874. )) {
  3875. var computed = current,
  3876. result = value;
  3877. }
  3878. }
  3879. return result;
  3880. }
  3881. /**
  3882. * The base implementation of `_.fill` without an iteratee call guard.
  3883. *
  3884. * @private
  3885. * @param {Array} array The array to fill.
  3886. * @param {*} value The value to fill `array` with.
  3887. * @param {number} [start=0] The start position.
  3888. * @param {number} [end=array.length] The end position.
  3889. * @returns {Array} Returns `array`.
  3890. */
  3891. function baseFill(array, value, start, end) {
  3892. var length = array.length;
  3893. start = toInteger(start);
  3894. if (start < 0) {
  3895. start = -start > length ? 0 : (length + start);
  3896. }
  3897. end = (end === undefined || end > length) ? length : toInteger(end);
  3898. if (end < 0) {
  3899. end += length;
  3900. }
  3901. end = start > end ? 0 : toLength(end);
  3902. while (start < end) {
  3903. array[start++] = value;
  3904. }
  3905. return array;
  3906. }
  3907. /**
  3908. * The base implementation of `_.filter` without support for iteratee shorthands.
  3909. *
  3910. * @private
  3911. * @param {Array|Object} collection The collection to iterate over.
  3912. * @param {Function} predicate The function invoked per iteration.
  3913. * @returns {Array} Returns the new filtered array.
  3914. */
  3915. function baseFilter(collection, predicate) {
  3916. var result = [];
  3917. baseEach(collection, function(value, index, collection) {
  3918. if (predicate(value, index, collection)) {
  3919. result.push(value);
  3920. }
  3921. });
  3922. return result;
  3923. }
  3924. /**
  3925. * The base implementation of `_.flatten` with support for restricting flattening.
  3926. *
  3927. * @private
  3928. * @param {Array} array The array to flatten.
  3929. * @param {number} depth The maximum recursion depth.
  3930. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3931. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3932. * @param {Array} [result=[]] The initial result value.
  3933. * @returns {Array} Returns the new flattened array.
  3934. */
  3935. function baseFlatten(array, depth, predicate, isStrict, result) {
  3936. var index = -1,
  3937. length = array.length;
  3938. predicate || (predicate = isFlattenable);
  3939. result || (result = []);
  3940. while (++index < length) {
  3941. var value = array[index];
  3942. if (depth > 0 && predicate(value)) {
  3943. if (depth > 1) {
  3944. // Recursively flatten arrays (susceptible to call stack limits).
  3945. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3946. } else {
  3947. arrayPush(result, value);
  3948. }
  3949. } else if (!isStrict) {
  3950. result[result.length] = value;
  3951. }
  3952. }
  3953. return result;
  3954. }
  3955. /**
  3956. * The base implementation of `baseForOwn` which iterates over `object`
  3957. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3958. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3959. *
  3960. * @private
  3961. * @param {Object} object The object to iterate over.
  3962. * @param {Function} iteratee The function invoked per iteration.
  3963. * @param {Function} keysFunc The function to get the keys of `object`.
  3964. * @returns {Object} Returns `object`.
  3965. */
  3966. var baseFor = createBaseFor();
  3967. /**
  3968. * This function is like `baseFor` except that it iterates over properties
  3969. * in the opposite order.
  3970. *
  3971. * @private
  3972. * @param {Object} object The object to iterate over.
  3973. * @param {Function} iteratee The function invoked per iteration.
  3974. * @param {Function} keysFunc The function to get the keys of `object`.
  3975. * @returns {Object} Returns `object`.
  3976. */
  3977. var baseForRight = createBaseFor(true);
  3978. /**
  3979. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3980. *
  3981. * @private
  3982. * @param {Object} object The object to iterate over.
  3983. * @param {Function} iteratee The function invoked per iteration.
  3984. * @returns {Object} Returns `object`.
  3985. */
  3986. function baseForOwn(object, iteratee) {
  3987. return object && baseFor(object, iteratee, keys);
  3988. }
  3989. /**
  3990. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3991. *
  3992. * @private
  3993. * @param {Object} object The object to iterate over.
  3994. * @param {Function} iteratee The function invoked per iteration.
  3995. * @returns {Object} Returns `object`.
  3996. */
  3997. function baseForOwnRight(object, iteratee) {
  3998. return object && baseForRight(object, iteratee, keys);
  3999. }
  4000. /**
  4001. * The base implementation of `_.functions` which creates an array of
  4002. * `object` function property names filtered from `props`.
  4003. *
  4004. * @private
  4005. * @param {Object} object The object to inspect.
  4006. * @param {Array} props The property names to filter.
  4007. * @returns {Array} Returns the function names.
  4008. */
  4009. function baseFunctions(object, props) {
  4010. return arrayFilter(props, function(key) {
  4011. return isFunction(object[key]);
  4012. });
  4013. }
  4014. /**
  4015. * The base implementation of `_.get` without support for default values.
  4016. *
  4017. * @private
  4018. * @param {Object} object The object to query.
  4019. * @param {Array|string} path The path of the property to get.
  4020. * @returns {*} Returns the resolved value.
  4021. */
  4022. function baseGet(object, path) {
  4023. path = castPath(path, object);
  4024. var index = 0,
  4025. length = path.length;
  4026. while (object != null && index < length) {
  4027. object = object[toKey(path[index++])];
  4028. }
  4029. return (index && index == length) ? object : undefined;
  4030. }
  4031. /**
  4032. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4033. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4034. * symbols of `object`.
  4035. *
  4036. * @private
  4037. * @param {Object} object The object to query.
  4038. * @param {Function} keysFunc The function to get the keys of `object`.
  4039. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4040. * @returns {Array} Returns the array of property names and symbols.
  4041. */
  4042. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4043. var result = keysFunc(object);
  4044. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4045. }
  4046. /**
  4047. * The base implementation of `getTag` without fallbacks for buggy environments.
  4048. *
  4049. * @private
  4050. * @param {*} value The value to query.
  4051. * @returns {string} Returns the `toStringTag`.
  4052. */
  4053. function baseGetTag(value) {
  4054. if (value == null) {
  4055. return value === undefined ? undefinedTag : nullTag;
  4056. }
  4057. return (symToStringTag && symToStringTag in Object(value))
  4058. ? getRawTag(value)
  4059. : objectToString(value);
  4060. }
  4061. /**
  4062. * The base implementation of `_.gt` which doesn't coerce arguments.
  4063. *
  4064. * @private
  4065. * @param {*} value The value to compare.
  4066. * @param {*} other The other value to compare.
  4067. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4068. * else `false`.
  4069. */
  4070. function baseGt(value, other) {
  4071. return value > other;
  4072. }
  4073. /**
  4074. * The base implementation of `_.has` without support for deep paths.
  4075. *
  4076. * @private
  4077. * @param {Object} [object] The object to query.
  4078. * @param {Array|string} key The key to check.
  4079. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4080. */
  4081. function baseHas(object, key) {
  4082. return object != null && hasOwnProperty.call(object, key);
  4083. }
  4084. /**
  4085. * The base implementation of `_.hasIn` without support for deep paths.
  4086. *
  4087. * @private
  4088. * @param {Object} [object] The object to query.
  4089. * @param {Array|string} key The key to check.
  4090. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4091. */
  4092. function baseHasIn(object, key) {
  4093. return object != null && key in Object(object);
  4094. }
  4095. /**
  4096. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4097. *
  4098. * @private
  4099. * @param {number} number The number to check.
  4100. * @param {number} start The start of the range.
  4101. * @param {number} end The end of the range.
  4102. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4103. */
  4104. function baseInRange(number, start, end) {
  4105. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4106. }
  4107. /**
  4108. * The base implementation of methods like `_.intersection`, without support
  4109. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4110. *
  4111. * @private
  4112. * @param {Array} arrays The arrays to inspect.
  4113. * @param {Function} [iteratee] The iteratee invoked per element.
  4114. * @param {Function} [comparator] The comparator invoked per element.
  4115. * @returns {Array} Returns the new array of shared values.
  4116. */
  4117. function baseIntersection(arrays, iteratee, comparator) {
  4118. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4119. length = arrays[0].length,
  4120. othLength = arrays.length,
  4121. othIndex = othLength,
  4122. caches = Array(othLength),
  4123. maxLength = Infinity,
  4124. result = [];
  4125. while (othIndex--) {
  4126. var array = arrays[othIndex];
  4127. if (othIndex && iteratee) {
  4128. array = arrayMap(array, baseUnary(iteratee));
  4129. }
  4130. maxLength = nativeMin(array.length, maxLength);
  4131. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4132. ? new SetCache(othIndex && array)
  4133. : undefined;
  4134. }
  4135. array = arrays[0];
  4136. var index = -1,
  4137. seen = caches[0];
  4138. outer:
  4139. while (++index < length && result.length < maxLength) {
  4140. var value = array[index],
  4141. computed = iteratee ? iteratee(value) : value;
  4142. value = (comparator || value !== 0) ? value : 0;
  4143. if (!(seen
  4144. ? cacheHas(seen, computed)
  4145. : includes(result, computed, comparator)
  4146. )) {
  4147. othIndex = othLength;
  4148. while (--othIndex) {
  4149. var cache = caches[othIndex];
  4150. if (!(cache
  4151. ? cacheHas(cache, computed)
  4152. : includes(arrays[othIndex], computed, comparator))
  4153. ) {
  4154. continue outer;
  4155. }
  4156. }
  4157. if (seen) {
  4158. seen.push(computed);
  4159. }
  4160. result.push(value);
  4161. }
  4162. }
  4163. return result;
  4164. }
  4165. /**
  4166. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4167. * `object` with values transformed by `iteratee` and set by `setter`.
  4168. *
  4169. * @private
  4170. * @param {Object} object The object to iterate over.
  4171. * @param {Function} setter The function to set `accumulator` values.
  4172. * @param {Function} iteratee The iteratee to transform values.
  4173. * @param {Object} accumulator The initial inverted object.
  4174. * @returns {Function} Returns `accumulator`.
  4175. */
  4176. function baseInverter(object, setter, iteratee, accumulator) {
  4177. baseForOwn(object, function(value, key, object) {
  4178. setter(accumulator, iteratee(value), key, object);
  4179. });
  4180. return accumulator;
  4181. }
  4182. /**
  4183. * The base implementation of `_.invoke` without support for individual
  4184. * method arguments.
  4185. *
  4186. * @private
  4187. * @param {Object} object The object to query.
  4188. * @param {Array|string} path The path of the method to invoke.
  4189. * @param {Array} args The arguments to invoke the method with.
  4190. * @returns {*} Returns the result of the invoked method.
  4191. */
  4192. function baseInvoke(object, path, args) {
  4193. path = castPath(path, object);
  4194. object = parent(object, path);
  4195. var func = object == null ? object : object[toKey(last(path))];
  4196. return func == null ? undefined : apply(func, object, args);
  4197. }
  4198. /**
  4199. * The base implementation of `_.isArguments`.
  4200. *
  4201. * @private
  4202. * @param {*} value The value to check.
  4203. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4204. */
  4205. function baseIsArguments(value) {
  4206. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4207. }
  4208. /**
  4209. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4210. *
  4211. * @private
  4212. * @param {*} value The value to check.
  4213. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4214. */
  4215. function baseIsArrayBuffer(value) {
  4216. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4217. }
  4218. /**
  4219. * The base implementation of `_.isDate` without Node.js optimizations.
  4220. *
  4221. * @private
  4222. * @param {*} value The value to check.
  4223. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4224. */
  4225. function baseIsDate(value) {
  4226. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4227. }
  4228. /**
  4229. * The base implementation of `_.isEqual` which supports partial comparisons
  4230. * and tracks traversed objects.
  4231. *
  4232. * @private
  4233. * @param {*} value The value to compare.
  4234. * @param {*} other The other value to compare.
  4235. * @param {boolean} bitmask The bitmask flags.
  4236. * 1 - Unordered comparison
  4237. * 2 - Partial comparison
  4238. * @param {Function} [customizer] The function to customize comparisons.
  4239. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4240. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4241. */
  4242. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4243. if (value === other) {
  4244. return true;
  4245. }
  4246. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4247. return value !== value && other !== other;
  4248. }
  4249. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4250. }
  4251. /**
  4252. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4253. * deep comparisons and tracks traversed objects enabling objects with circular
  4254. * references to be compared.
  4255. *
  4256. * @private
  4257. * @param {Object} object The object to compare.
  4258. * @param {Object} other The other object to compare.
  4259. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4260. * @param {Function} customizer The function to customize comparisons.
  4261. * @param {Function} equalFunc The function to determine equivalents of values.
  4262. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4263. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4264. */
  4265. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4266. var objIsArr = isArray(object),
  4267. othIsArr = isArray(other),
  4268. objTag = objIsArr ? arrayTag : getTag(object),
  4269. othTag = othIsArr ? arrayTag : getTag(other);
  4270. objTag = objTag == argsTag ? objectTag : objTag;
  4271. othTag = othTag == argsTag ? objectTag : othTag;
  4272. var objIsObj = objTag == objectTag,
  4273. othIsObj = othTag == objectTag,
  4274. isSameTag = objTag == othTag;
  4275. if (isSameTag && isBuffer(object)) {
  4276. if (!isBuffer(other)) {
  4277. return false;
  4278. }
  4279. objIsArr = true;
  4280. objIsObj = false;
  4281. }
  4282. if (isSameTag && !objIsObj) {
  4283. stack || (stack = new Stack);
  4284. return (objIsArr || isTypedArray(object))
  4285. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4286. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4287. }
  4288. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4289. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4290. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4291. if (objIsWrapped || othIsWrapped) {
  4292. var objUnwrapped = objIsWrapped ? object.value() : object,
  4293. othUnwrapped = othIsWrapped ? other.value() : other;
  4294. stack || (stack = new Stack);
  4295. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4296. }
  4297. }
  4298. if (!isSameTag) {
  4299. return false;
  4300. }
  4301. stack || (stack = new Stack);
  4302. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4303. }
  4304. /**
  4305. * The base implementation of `_.isMap` without Node.js optimizations.
  4306. *
  4307. * @private
  4308. * @param {*} value The value to check.
  4309. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4310. */
  4311. function baseIsMap(value) {
  4312. return isObjectLike(value) && getTag(value) == mapTag;
  4313. }
  4314. /**
  4315. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4316. *
  4317. * @private
  4318. * @param {Object} object The object to inspect.
  4319. * @param {Object} source The object of property values to match.
  4320. * @param {Array} matchData The property names, values, and compare flags to match.
  4321. * @param {Function} [customizer] The function to customize comparisons.
  4322. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4323. */
  4324. function baseIsMatch(object, source, matchData, customizer) {
  4325. var index = matchData.length,
  4326. length = index,
  4327. noCustomizer = !customizer;
  4328. if (object == null) {
  4329. return !length;
  4330. }
  4331. object = Object(object);
  4332. while (index--) {
  4333. var data = matchData[index];
  4334. if ((noCustomizer && data[2])
  4335. ? data[1] !== object[data[0]]
  4336. : !(data[0] in object)
  4337. ) {
  4338. return false;
  4339. }
  4340. }
  4341. while (++index < length) {
  4342. data = matchData[index];
  4343. var key = data[0],
  4344. objValue = object[key],
  4345. srcValue = data[1];
  4346. if (noCustomizer && data[2]) {
  4347. if (objValue === undefined && !(key in object)) {
  4348. return false;
  4349. }
  4350. } else {
  4351. var stack = new Stack;
  4352. if (customizer) {
  4353. var result = customizer(objValue, srcValue, key, object, source, stack);
  4354. }
  4355. if (!(result === undefined
  4356. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4357. : result
  4358. )) {
  4359. return false;
  4360. }
  4361. }
  4362. }
  4363. return true;
  4364. }
  4365. /**
  4366. * The base implementation of `_.isNative` without bad shim checks.
  4367. *
  4368. * @private
  4369. * @param {*} value The value to check.
  4370. * @returns {boolean} Returns `true` if `value` is a native function,
  4371. * else `false`.
  4372. */
  4373. function baseIsNative(value) {
  4374. if (!isObject(value) || isMasked(value)) {
  4375. return false;
  4376. }
  4377. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4378. return pattern.test(toSource(value));
  4379. }
  4380. /**
  4381. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4382. *
  4383. * @private
  4384. * @param {*} value The value to check.
  4385. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4386. */
  4387. function baseIsRegExp(value) {
  4388. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4389. }
  4390. /**
  4391. * The base implementation of `_.isSet` without Node.js optimizations.
  4392. *
  4393. * @private
  4394. * @param {*} value The value to check.
  4395. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4396. */
  4397. function baseIsSet(value) {
  4398. return isObjectLike(value) && getTag(value) == setTag;
  4399. }
  4400. /**
  4401. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4402. *
  4403. * @private
  4404. * @param {*} value The value to check.
  4405. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4406. */
  4407. function baseIsTypedArray(value) {
  4408. return isObjectLike(value) &&
  4409. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4410. }
  4411. /**
  4412. * The base implementation of `_.iteratee`.
  4413. *
  4414. * @private
  4415. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4416. * @returns {Function} Returns the iteratee.
  4417. */
  4418. function baseIteratee(value) {
  4419. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4420. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4421. if (typeof value == 'function') {
  4422. return value;
  4423. }
  4424. if (value == null) {
  4425. return identity;
  4426. }
  4427. if (typeof value == 'object') {
  4428. return isArray(value)
  4429. ? baseMatchesProperty(value[0], value[1])
  4430. : baseMatches(value);
  4431. }
  4432. return property(value);
  4433. }
  4434. /**
  4435. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4436. *
  4437. * @private
  4438. * @param {Object} object The object to query.
  4439. * @returns {Array} Returns the array of property names.
  4440. */
  4441. function baseKeys(object) {
  4442. if (!isPrototype(object)) {
  4443. return nativeKeys(object);
  4444. }
  4445. var result = [];
  4446. for (var key in Object(object)) {
  4447. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4448. result.push(key);
  4449. }
  4450. }
  4451. return result;
  4452. }
  4453. /**
  4454. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4455. *
  4456. * @private
  4457. * @param {Object} object The object to query.
  4458. * @returns {Array} Returns the array of property names.
  4459. */
  4460. function baseKeysIn(object) {
  4461. if (!isObject(object)) {
  4462. return nativeKeysIn(object);
  4463. }
  4464. var isProto = isPrototype(object),
  4465. result = [];
  4466. for (var key in object) {
  4467. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4468. result.push(key);
  4469. }
  4470. }
  4471. return result;
  4472. }
  4473. /**
  4474. * The base implementation of `_.lt` which doesn't coerce arguments.
  4475. *
  4476. * @private
  4477. * @param {*} value The value to compare.
  4478. * @param {*} other The other value to compare.
  4479. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4480. * else `false`.
  4481. */
  4482. function baseLt(value, other) {
  4483. return value < other;
  4484. }
  4485. /**
  4486. * The base implementation of `_.map` without support for iteratee shorthands.
  4487. *
  4488. * @private
  4489. * @param {Array|Object} collection The collection to iterate over.
  4490. * @param {Function} iteratee The function invoked per iteration.
  4491. * @returns {Array} Returns the new mapped array.
  4492. */
  4493. function baseMap(collection, iteratee) {
  4494. var index = -1,
  4495. result = isArrayLike(collection) ? Array(collection.length) : [];
  4496. baseEach(collection, function(value, key, collection) {
  4497. result[++index] = iteratee(value, key, collection);
  4498. });
  4499. return result;
  4500. }
  4501. /**
  4502. * The base implementation of `_.matches` which doesn't clone `source`.
  4503. *
  4504. * @private
  4505. * @param {Object} source The object of property values to match.
  4506. * @returns {Function} Returns the new spec function.
  4507. */
  4508. function baseMatches(source) {
  4509. var matchData = getMatchData(source);
  4510. if (matchData.length == 1 && matchData[0][2]) {
  4511. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4512. }
  4513. return function(object) {
  4514. return object === source || baseIsMatch(object, source, matchData);
  4515. };
  4516. }
  4517. /**
  4518. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4519. *
  4520. * @private
  4521. * @param {string} path The path of the property to get.
  4522. * @param {*} srcValue The value to match.
  4523. * @returns {Function} Returns the new spec function.
  4524. */
  4525. function baseMatchesProperty(path, srcValue) {
  4526. if (isKey(path) && isStrictComparable(srcValue)) {
  4527. return matchesStrictComparable(toKey(path), srcValue);
  4528. }
  4529. return function(object) {
  4530. var objValue = get(object, path);
  4531. return (objValue === undefined && objValue === srcValue)
  4532. ? hasIn(object, path)
  4533. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4534. };
  4535. }
  4536. /**
  4537. * The base implementation of `_.merge` without support for multiple sources.
  4538. *
  4539. * @private
  4540. * @param {Object} object The destination object.
  4541. * @param {Object} source The source object.
  4542. * @param {number} srcIndex The index of `source`.
  4543. * @param {Function} [customizer] The function to customize merged values.
  4544. * @param {Object} [stack] Tracks traversed source values and their merged
  4545. * counterparts.
  4546. */
  4547. function baseMerge(object, source, srcIndex, customizer, stack) {
  4548. if (object === source) {
  4549. return;
  4550. }
  4551. baseFor(source, function(srcValue, key) {
  4552. stack || (stack = new Stack);
  4553. if (isObject(srcValue)) {
  4554. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4555. }
  4556. else {
  4557. var newValue = customizer
  4558. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4559. : undefined;
  4560. if (newValue === undefined) {
  4561. newValue = srcValue;
  4562. }
  4563. assignMergeValue(object, key, newValue);
  4564. }
  4565. }, keysIn);
  4566. }
  4567. /**
  4568. * A specialized version of `baseMerge` for arrays and objects which performs
  4569. * deep merges and tracks traversed objects enabling objects with circular
  4570. * references to be merged.
  4571. *
  4572. * @private
  4573. * @param {Object} object The destination object.
  4574. * @param {Object} source The source object.
  4575. * @param {string} key The key of the value to merge.
  4576. * @param {number} srcIndex The index of `source`.
  4577. * @param {Function} mergeFunc The function to merge values.
  4578. * @param {Function} [customizer] The function to customize assigned values.
  4579. * @param {Object} [stack] Tracks traversed source values and their merged
  4580. * counterparts.
  4581. */
  4582. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4583. var objValue = safeGet(object, key),
  4584. srcValue = safeGet(source, key),
  4585. stacked = stack.get(srcValue);
  4586. if (stacked) {
  4587. assignMergeValue(object, key, stacked);
  4588. return;
  4589. }
  4590. var newValue = customizer
  4591. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4592. : undefined;
  4593. var isCommon = newValue === undefined;
  4594. if (isCommon) {
  4595. var isArr = isArray(srcValue),
  4596. isBuff = !isArr && isBuffer(srcValue),
  4597. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4598. newValue = srcValue;
  4599. if (isArr || isBuff || isTyped) {
  4600. if (isArray(objValue)) {
  4601. newValue = objValue;
  4602. }
  4603. else if (isArrayLikeObject(objValue)) {
  4604. newValue = copyArray(objValue);
  4605. }
  4606. else if (isBuff) {
  4607. isCommon = false;
  4608. newValue = cloneBuffer(srcValue, true);
  4609. }
  4610. else if (isTyped) {
  4611. isCommon = false;
  4612. newValue = cloneTypedArray(srcValue, true);
  4613. }
  4614. else {
  4615. newValue = [];
  4616. }
  4617. }
  4618. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4619. newValue = objValue;
  4620. if (isArguments(objValue)) {
  4621. newValue = toPlainObject(objValue);
  4622. }
  4623. else if (!isObject(objValue) || isFunction(objValue)) {
  4624. newValue = initCloneObject(srcValue);
  4625. }
  4626. }
  4627. else {
  4628. isCommon = false;
  4629. }
  4630. }
  4631. if (isCommon) {
  4632. // Recursively merge objects and arrays (susceptible to call stack limits).
  4633. stack.set(srcValue, newValue);
  4634. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4635. stack['delete'](srcValue);
  4636. }
  4637. assignMergeValue(object, key, newValue);
  4638. }
  4639. /**
  4640. * The base implementation of `_.nth` which doesn't coerce arguments.
  4641. *
  4642. * @private
  4643. * @param {Array} array The array to query.
  4644. * @param {number} n The index of the element to return.
  4645. * @returns {*} Returns the nth element of `array`.
  4646. */
  4647. function baseNth(array, n) {
  4648. var length = array.length;
  4649. if (!length) {
  4650. return;
  4651. }
  4652. n += n < 0 ? length : 0;
  4653. return isIndex(n, length) ? array[n] : undefined;
  4654. }
  4655. /**
  4656. * The base implementation of `_.orderBy` without param guards.
  4657. *
  4658. * @private
  4659. * @param {Array|Object} collection The collection to iterate over.
  4660. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4661. * @param {string[]} orders The sort orders of `iteratees`.
  4662. * @returns {Array} Returns the new sorted array.
  4663. */
  4664. function baseOrderBy(collection, iteratees, orders) {
  4665. if (iteratees.length) {
  4666. iteratees = arrayMap(iteratees, function(iteratee) {
  4667. if (isArray(iteratee)) {
  4668. return function(value) {
  4669. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4670. }
  4671. }
  4672. return iteratee;
  4673. });
  4674. } else {
  4675. iteratees = [identity];
  4676. }
  4677. var index = -1;
  4678. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4679. var result = baseMap(collection, function(value, key, collection) {
  4680. var criteria = arrayMap(iteratees, function(iteratee) {
  4681. return iteratee(value);
  4682. });
  4683. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4684. });
  4685. return baseSortBy(result, function(object, other) {
  4686. return compareMultiple(object, other, orders);
  4687. });
  4688. }
  4689. /**
  4690. * The base implementation of `_.pick` without support for individual
  4691. * property identifiers.
  4692. *
  4693. * @private
  4694. * @param {Object} object The source object.
  4695. * @param {string[]} paths The property paths to pick.
  4696. * @returns {Object} Returns the new object.
  4697. */
  4698. function basePick(object, paths) {
  4699. return basePickBy(object, paths, function(value, path) {
  4700. return hasIn(object, path);
  4701. });
  4702. }
  4703. /**
  4704. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4705. *
  4706. * @private
  4707. * @param {Object} object The source object.
  4708. * @param {string[]} paths The property paths to pick.
  4709. * @param {Function} predicate The function invoked per property.
  4710. * @returns {Object} Returns the new object.
  4711. */
  4712. function basePickBy(object, paths, predicate) {
  4713. var index = -1,
  4714. length = paths.length,
  4715. result = {};
  4716. while (++index < length) {
  4717. var path = paths[index],
  4718. value = baseGet(object, path);
  4719. if (predicate(value, path)) {
  4720. baseSet(result, castPath(path, object), value);
  4721. }
  4722. }
  4723. return result;
  4724. }
  4725. /**
  4726. * A specialized version of `baseProperty` which supports deep paths.
  4727. *
  4728. * @private
  4729. * @param {Array|string} path The path of the property to get.
  4730. * @returns {Function} Returns the new accessor function.
  4731. */
  4732. function basePropertyDeep(path) {
  4733. return function(object) {
  4734. return baseGet(object, path);
  4735. };
  4736. }
  4737. /**
  4738. * The base implementation of `_.pullAllBy` without support for iteratee
  4739. * shorthands.
  4740. *
  4741. * @private
  4742. * @param {Array} array The array to modify.
  4743. * @param {Array} values The values to remove.
  4744. * @param {Function} [iteratee] The iteratee invoked per element.
  4745. * @param {Function} [comparator] The comparator invoked per element.
  4746. * @returns {Array} Returns `array`.
  4747. */
  4748. function basePullAll(array, values, iteratee, comparator) {
  4749. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4750. index = -1,
  4751. length = values.length,
  4752. seen = array;
  4753. if (array === values) {
  4754. values = copyArray(values);
  4755. }
  4756. if (iteratee) {
  4757. seen = arrayMap(array, baseUnary(iteratee));
  4758. }
  4759. while (++index < length) {
  4760. var fromIndex = 0,
  4761. value = values[index],
  4762. computed = iteratee ? iteratee(value) : value;
  4763. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4764. if (seen !== array) {
  4765. splice.call(seen, fromIndex, 1);
  4766. }
  4767. splice.call(array, fromIndex, 1);
  4768. }
  4769. }
  4770. return array;
  4771. }
  4772. /**
  4773. * The base implementation of `_.pullAt` without support for individual
  4774. * indexes or capturing the removed elements.
  4775. *
  4776. * @private
  4777. * @param {Array} array The array to modify.
  4778. * @param {number[]} indexes The indexes of elements to remove.
  4779. * @returns {Array} Returns `array`.
  4780. */
  4781. function basePullAt(array, indexes) {
  4782. var length = array ? indexes.length : 0,
  4783. lastIndex = length - 1;
  4784. while (length--) {
  4785. var index = indexes[length];
  4786. if (length == lastIndex || index !== previous) {
  4787. var previous = index;
  4788. if (isIndex(index)) {
  4789. splice.call(array, index, 1);
  4790. } else {
  4791. baseUnset(array, index);
  4792. }
  4793. }
  4794. }
  4795. return array;
  4796. }
  4797. /**
  4798. * The base implementation of `_.random` without support for returning
  4799. * floating-point numbers.
  4800. *
  4801. * @private
  4802. * @param {number} lower The lower bound.
  4803. * @param {number} upper The upper bound.
  4804. * @returns {number} Returns the random number.
  4805. */
  4806. function baseRandom(lower, upper) {
  4807. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4808. }
  4809. /**
  4810. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4811. * coerce arguments.
  4812. *
  4813. * @private
  4814. * @param {number} start The start of the range.
  4815. * @param {number} end The end of the range.
  4816. * @param {number} step The value to increment or decrement by.
  4817. * @param {boolean} [fromRight] Specify iterating from right to left.
  4818. * @returns {Array} Returns the range of numbers.
  4819. */
  4820. function baseRange(start, end, step, fromRight) {
  4821. var index = -1,
  4822. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4823. result = Array(length);
  4824. while (length--) {
  4825. result[fromRight ? length : ++index] = start;
  4826. start += step;
  4827. }
  4828. return result;
  4829. }
  4830. /**
  4831. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4832. *
  4833. * @private
  4834. * @param {string} string The string to repeat.
  4835. * @param {number} n The number of times to repeat the string.
  4836. * @returns {string} Returns the repeated string.
  4837. */
  4838. function baseRepeat(string, n) {
  4839. var result = '';
  4840. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4841. return result;
  4842. }
  4843. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4844. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4845. do {
  4846. if (n % 2) {
  4847. result += string;
  4848. }
  4849. n = nativeFloor(n / 2);
  4850. if (n) {
  4851. string += string;
  4852. }
  4853. } while (n);
  4854. return result;
  4855. }
  4856. /**
  4857. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4858. *
  4859. * @private
  4860. * @param {Function} func The function to apply a rest parameter to.
  4861. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4862. * @returns {Function} Returns the new function.
  4863. */
  4864. function baseRest(func, start) {
  4865. return setToString(overRest(func, start, identity), func + '');
  4866. }
  4867. /**
  4868. * The base implementation of `_.sample`.
  4869. *
  4870. * @private
  4871. * @param {Array|Object} collection The collection to sample.
  4872. * @returns {*} Returns the random element.
  4873. */
  4874. function baseSample(collection) {
  4875. return arraySample(values(collection));
  4876. }
  4877. /**
  4878. * The base implementation of `_.sampleSize` without param guards.
  4879. *
  4880. * @private
  4881. * @param {Array|Object} collection The collection to sample.
  4882. * @param {number} n The number of elements to sample.
  4883. * @returns {Array} Returns the random elements.
  4884. */
  4885. function baseSampleSize(collection, n) {
  4886. var array = values(collection);
  4887. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4888. }
  4889. /**
  4890. * The base implementation of `_.set`.
  4891. *
  4892. * @private
  4893. * @param {Object} object The object to modify.
  4894. * @param {Array|string} path The path of the property to set.
  4895. * @param {*} value The value to set.
  4896. * @param {Function} [customizer] The function to customize path creation.
  4897. * @returns {Object} Returns `object`.
  4898. */
  4899. function baseSet(object, path, value, customizer) {
  4900. if (!isObject(object)) {
  4901. return object;
  4902. }
  4903. path = castPath(path, object);
  4904. var index = -1,
  4905. length = path.length,
  4906. lastIndex = length - 1,
  4907. nested = object;
  4908. while (nested != null && ++index < length) {
  4909. var key = toKey(path[index]),
  4910. newValue = value;
  4911. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4912. return object;
  4913. }
  4914. if (index != lastIndex) {
  4915. var objValue = nested[key];
  4916. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4917. if (newValue === undefined) {
  4918. newValue = isObject(objValue)
  4919. ? objValue
  4920. : (isIndex(path[index + 1]) ? [] : {});
  4921. }
  4922. }
  4923. assignValue(nested, key, newValue);
  4924. nested = nested[key];
  4925. }
  4926. return object;
  4927. }
  4928. /**
  4929. * The base implementation of `setData` without support for hot loop shorting.
  4930. *
  4931. * @private
  4932. * @param {Function} func The function to associate metadata with.
  4933. * @param {*} data The metadata.
  4934. * @returns {Function} Returns `func`.
  4935. */
  4936. var baseSetData = !metaMap ? identity : function(func, data) {
  4937. metaMap.set(func, data);
  4938. return func;
  4939. };
  4940. /**
  4941. * The base implementation of `setToString` without support for hot loop shorting.
  4942. *
  4943. * @private
  4944. * @param {Function} func The function to modify.
  4945. * @param {Function} string The `toString` result.
  4946. * @returns {Function} Returns `func`.
  4947. */
  4948. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4949. return defineProperty(func, 'toString', {
  4950. 'configurable': true,
  4951. 'enumerable': false,
  4952. 'value': constant(string),
  4953. 'writable': true
  4954. });
  4955. };
  4956. /**
  4957. * The base implementation of `_.shuffle`.
  4958. *
  4959. * @private
  4960. * @param {Array|Object} collection The collection to shuffle.
  4961. * @returns {Array} Returns the new shuffled array.
  4962. */
  4963. function baseShuffle(collection) {
  4964. return shuffleSelf(values(collection));
  4965. }
  4966. /**
  4967. * The base implementation of `_.slice` without an iteratee call guard.
  4968. *
  4969. * @private
  4970. * @param {Array} array The array to slice.
  4971. * @param {number} [start=0] The start position.
  4972. * @param {number} [end=array.length] The end position.
  4973. * @returns {Array} Returns the slice of `array`.
  4974. */
  4975. function baseSlice(array, start, end) {
  4976. var index = -1,
  4977. length = array.length;
  4978. if (start < 0) {
  4979. start = -start > length ? 0 : (length + start);
  4980. }
  4981. end = end > length ? length : end;
  4982. if (end < 0) {
  4983. end += length;
  4984. }
  4985. length = start > end ? 0 : ((end - start) >>> 0);
  4986. start >>>= 0;
  4987. var result = Array(length);
  4988. while (++index < length) {
  4989. result[index] = array[index + start];
  4990. }
  4991. return result;
  4992. }
  4993. /**
  4994. * The base implementation of `_.some` without support for iteratee shorthands.
  4995. *
  4996. * @private
  4997. * @param {Array|Object} collection The collection to iterate over.
  4998. * @param {Function} predicate The function invoked per iteration.
  4999. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5000. * else `false`.
  5001. */
  5002. function baseSome(collection, predicate) {
  5003. var result;
  5004. baseEach(collection, function(value, index, collection) {
  5005. result = predicate(value, index, collection);
  5006. return !result;
  5007. });
  5008. return !!result;
  5009. }
  5010. /**
  5011. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5012. * performs a binary search of `array` to determine the index at which `value`
  5013. * should be inserted into `array` in order to maintain its sort order.
  5014. *
  5015. * @private
  5016. * @param {Array} array The sorted array to inspect.
  5017. * @param {*} value The value to evaluate.
  5018. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5019. * @returns {number} Returns the index at which `value` should be inserted
  5020. * into `array`.
  5021. */
  5022. function baseSortedIndex(array, value, retHighest) {
  5023. var low = 0,
  5024. high = array == null ? low : array.length;
  5025. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5026. while (low < high) {
  5027. var mid = (low + high) >>> 1,
  5028. computed = array[mid];
  5029. if (computed !== null && !isSymbol(computed) &&
  5030. (retHighest ? (computed <= value) : (computed < value))) {
  5031. low = mid + 1;
  5032. } else {
  5033. high = mid;
  5034. }
  5035. }
  5036. return high;
  5037. }
  5038. return baseSortedIndexBy(array, value, identity, retHighest);
  5039. }
  5040. /**
  5041. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5042. * which invokes `iteratee` for `value` and each element of `array` to compute
  5043. * their sort ranking. The iteratee is invoked with one argument; (value).
  5044. *
  5045. * @private
  5046. * @param {Array} array The sorted array to inspect.
  5047. * @param {*} value The value to evaluate.
  5048. * @param {Function} iteratee The iteratee invoked per element.
  5049. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5050. * @returns {number} Returns the index at which `value` should be inserted
  5051. * into `array`.
  5052. */
  5053. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5054. var low = 0,
  5055. high = array == null ? 0 : array.length;
  5056. if (high === 0) {
  5057. return 0;
  5058. }
  5059. value = iteratee(value);
  5060. var valIsNaN = value !== value,
  5061. valIsNull = value === null,
  5062. valIsSymbol = isSymbol(value),
  5063. valIsUndefined = value === undefined;
  5064. while (low < high) {
  5065. var mid = nativeFloor((low + high) / 2),
  5066. computed = iteratee(array[mid]),
  5067. othIsDefined = computed !== undefined,
  5068. othIsNull = computed === null,
  5069. othIsReflexive = computed === computed,
  5070. othIsSymbol = isSymbol(computed);
  5071. if (valIsNaN) {
  5072. var setLow = retHighest || othIsReflexive;
  5073. } else if (valIsUndefined) {
  5074. setLow = othIsReflexive && (retHighest || othIsDefined);
  5075. } else if (valIsNull) {
  5076. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5077. } else if (valIsSymbol) {
  5078. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5079. } else if (othIsNull || othIsSymbol) {
  5080. setLow = false;
  5081. } else {
  5082. setLow = retHighest ? (computed <= value) : (computed < value);
  5083. }
  5084. if (setLow) {
  5085. low = mid + 1;
  5086. } else {
  5087. high = mid;
  5088. }
  5089. }
  5090. return nativeMin(high, MAX_ARRAY_INDEX);
  5091. }
  5092. /**
  5093. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5094. * support for iteratee shorthands.
  5095. *
  5096. * @private
  5097. * @param {Array} array The array to inspect.
  5098. * @param {Function} [iteratee] The iteratee invoked per element.
  5099. * @returns {Array} Returns the new duplicate free array.
  5100. */
  5101. function baseSortedUniq(array, iteratee) {
  5102. var index = -1,
  5103. length = array.length,
  5104. resIndex = 0,
  5105. result = [];
  5106. while (++index < length) {
  5107. var value = array[index],
  5108. computed = iteratee ? iteratee(value) : value;
  5109. if (!index || !eq(computed, seen)) {
  5110. var seen = computed;
  5111. result[resIndex++] = value === 0 ? 0 : value;
  5112. }
  5113. }
  5114. return result;
  5115. }
  5116. /**
  5117. * The base implementation of `_.toNumber` which doesn't ensure correct
  5118. * conversions of binary, hexadecimal, or octal string values.
  5119. *
  5120. * @private
  5121. * @param {*} value The value to process.
  5122. * @returns {number} Returns the number.
  5123. */
  5124. function baseToNumber(value) {
  5125. if (typeof value == 'number') {
  5126. return value;
  5127. }
  5128. if (isSymbol(value)) {
  5129. return NAN;
  5130. }
  5131. return +value;
  5132. }
  5133. /**
  5134. * The base implementation of `_.toString` which doesn't convert nullish
  5135. * values to empty strings.
  5136. *
  5137. * @private
  5138. * @param {*} value The value to process.
  5139. * @returns {string} Returns the string.
  5140. */
  5141. function baseToString(value) {
  5142. // Exit early for strings to avoid a performance hit in some environments.
  5143. if (typeof value == 'string') {
  5144. return value;
  5145. }
  5146. if (isArray(value)) {
  5147. // Recursively convert values (susceptible to call stack limits).
  5148. return arrayMap(value, baseToString) + '';
  5149. }
  5150. if (isSymbol(value)) {
  5151. return symbolToString ? symbolToString.call(value) : '';
  5152. }
  5153. var result = (value + '');
  5154. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5155. }
  5156. /**
  5157. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5158. *
  5159. * @private
  5160. * @param {Array} array The array to inspect.
  5161. * @param {Function} [iteratee] The iteratee invoked per element.
  5162. * @param {Function} [comparator] The comparator invoked per element.
  5163. * @returns {Array} Returns the new duplicate free array.
  5164. */
  5165. function baseUniq(array, iteratee, comparator) {
  5166. var index = -1,
  5167. includes = arrayIncludes,
  5168. length = array.length,
  5169. isCommon = true,
  5170. result = [],
  5171. seen = result;
  5172. if (comparator) {
  5173. isCommon = false;
  5174. includes = arrayIncludesWith;
  5175. }
  5176. else if (length >= LARGE_ARRAY_SIZE) {
  5177. var set = iteratee ? null : createSet(array);
  5178. if (set) {
  5179. return setToArray(set);
  5180. }
  5181. isCommon = false;
  5182. includes = cacheHas;
  5183. seen = new SetCache;
  5184. }
  5185. else {
  5186. seen = iteratee ? [] : result;
  5187. }
  5188. outer:
  5189. while (++index < length) {
  5190. var value = array[index],
  5191. computed = iteratee ? iteratee(value) : value;
  5192. value = (comparator || value !== 0) ? value : 0;
  5193. if (isCommon && computed === computed) {
  5194. var seenIndex = seen.length;
  5195. while (seenIndex--) {
  5196. if (seen[seenIndex] === computed) {
  5197. continue outer;
  5198. }
  5199. }
  5200. if (iteratee) {
  5201. seen.push(computed);
  5202. }
  5203. result.push(value);
  5204. }
  5205. else if (!includes(seen, computed, comparator)) {
  5206. if (seen !== result) {
  5207. seen.push(computed);
  5208. }
  5209. result.push(value);
  5210. }
  5211. }
  5212. return result;
  5213. }
  5214. /**
  5215. * The base implementation of `_.unset`.
  5216. *
  5217. * @private
  5218. * @param {Object} object The object to modify.
  5219. * @param {Array|string} path The property path to unset.
  5220. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5221. */
  5222. function baseUnset(object, path) {
  5223. path = castPath(path, object);
  5224. object = parent(object, path);
  5225. return object == null || delete object[toKey(last(path))];
  5226. }
  5227. /**
  5228. * The base implementation of `_.update`.
  5229. *
  5230. * @private
  5231. * @param {Object} object The object to modify.
  5232. * @param {Array|string} path The path of the property to update.
  5233. * @param {Function} updater The function to produce the updated value.
  5234. * @param {Function} [customizer] The function to customize path creation.
  5235. * @returns {Object} Returns `object`.
  5236. */
  5237. function baseUpdate(object, path, updater, customizer) {
  5238. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5239. }
  5240. /**
  5241. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5242. * without support for iteratee shorthands.
  5243. *
  5244. * @private
  5245. * @param {Array} array The array to query.
  5246. * @param {Function} predicate The function invoked per iteration.
  5247. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5248. * @param {boolean} [fromRight] Specify iterating from right to left.
  5249. * @returns {Array} Returns the slice of `array`.
  5250. */
  5251. function baseWhile(array, predicate, isDrop, fromRight) {
  5252. var length = array.length,
  5253. index = fromRight ? length : -1;
  5254. while ((fromRight ? index-- : ++index < length) &&
  5255. predicate(array[index], index, array)) {}
  5256. return isDrop
  5257. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5258. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5259. }
  5260. /**
  5261. * The base implementation of `wrapperValue` which returns the result of
  5262. * performing a sequence of actions on the unwrapped `value`, where each
  5263. * successive action is supplied the return value of the previous.
  5264. *
  5265. * @private
  5266. * @param {*} value The unwrapped value.
  5267. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5268. * @returns {*} Returns the resolved value.
  5269. */
  5270. function baseWrapperValue(value, actions) {
  5271. var result = value;
  5272. if (result instanceof LazyWrapper) {
  5273. result = result.value();
  5274. }
  5275. return arrayReduce(actions, function(result, action) {
  5276. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5277. }, result);
  5278. }
  5279. /**
  5280. * The base implementation of methods like `_.xor`, without support for
  5281. * iteratee shorthands, that accepts an array of arrays to inspect.
  5282. *
  5283. * @private
  5284. * @param {Array} arrays The arrays to inspect.
  5285. * @param {Function} [iteratee] The iteratee invoked per element.
  5286. * @param {Function} [comparator] The comparator invoked per element.
  5287. * @returns {Array} Returns the new array of values.
  5288. */
  5289. function baseXor(arrays, iteratee, comparator) {
  5290. var length = arrays.length;
  5291. if (length < 2) {
  5292. return length ? baseUniq(arrays[0]) : [];
  5293. }
  5294. var index = -1,
  5295. result = Array(length);
  5296. while (++index < length) {
  5297. var array = arrays[index],
  5298. othIndex = -1;
  5299. while (++othIndex < length) {
  5300. if (othIndex != index) {
  5301. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5302. }
  5303. }
  5304. }
  5305. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5306. }
  5307. /**
  5308. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5309. *
  5310. * @private
  5311. * @param {Array} props The property identifiers.
  5312. * @param {Array} values The property values.
  5313. * @param {Function} assignFunc The function to assign values.
  5314. * @returns {Object} Returns the new object.
  5315. */
  5316. function baseZipObject(props, values, assignFunc) {
  5317. var index = -1,
  5318. length = props.length,
  5319. valsLength = values.length,
  5320. result = {};
  5321. while (++index < length) {
  5322. var value = index < valsLength ? values[index] : undefined;
  5323. assignFunc(result, props[index], value);
  5324. }
  5325. return result;
  5326. }
  5327. /**
  5328. * Casts `value` to an empty array if it's not an array like object.
  5329. *
  5330. * @private
  5331. * @param {*} value The value to inspect.
  5332. * @returns {Array|Object} Returns the cast array-like object.
  5333. */
  5334. function castArrayLikeObject(value) {
  5335. return isArrayLikeObject(value) ? value : [];
  5336. }
  5337. /**
  5338. * Casts `value` to `identity` if it's not a function.
  5339. *
  5340. * @private
  5341. * @param {*} value The value to inspect.
  5342. * @returns {Function} Returns cast function.
  5343. */
  5344. function castFunction(value) {
  5345. return typeof value == 'function' ? value : identity;
  5346. }
  5347. /**
  5348. * Casts `value` to a path array if it's not one.
  5349. *
  5350. * @private
  5351. * @param {*} value The value to inspect.
  5352. * @param {Object} [object] The object to query keys on.
  5353. * @returns {Array} Returns the cast property path array.
  5354. */
  5355. function castPath(value, object) {
  5356. if (isArray(value)) {
  5357. return value;
  5358. }
  5359. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5360. }
  5361. /**
  5362. * A `baseRest` alias which can be replaced with `identity` by module
  5363. * replacement plugins.
  5364. *
  5365. * @private
  5366. * @type {Function}
  5367. * @param {Function} func The function to apply a rest parameter to.
  5368. * @returns {Function} Returns the new function.
  5369. */
  5370. var castRest = baseRest;
  5371. /**
  5372. * Casts `array` to a slice if it's needed.
  5373. *
  5374. * @private
  5375. * @param {Array} array The array to inspect.
  5376. * @param {number} start The start position.
  5377. * @param {number} [end=array.length] The end position.
  5378. * @returns {Array} Returns the cast slice.
  5379. */
  5380. function castSlice(array, start, end) {
  5381. var length = array.length;
  5382. end = end === undefined ? length : end;
  5383. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5384. }
  5385. /**
  5386. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5387. *
  5388. * @private
  5389. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5390. */
  5391. var clearTimeout = ctxClearTimeout || function(id) {
  5392. return root.clearTimeout(id);
  5393. };
  5394. /**
  5395. * Creates a clone of `buffer`.
  5396. *
  5397. * @private
  5398. * @param {Buffer} buffer The buffer to clone.
  5399. * @param {boolean} [isDeep] Specify a deep clone.
  5400. * @returns {Buffer} Returns the cloned buffer.
  5401. */
  5402. function cloneBuffer(buffer, isDeep) {
  5403. if (isDeep) {
  5404. return buffer.slice();
  5405. }
  5406. var length = buffer.length,
  5407. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5408. buffer.copy(result);
  5409. return result;
  5410. }
  5411. /**
  5412. * Creates a clone of `arrayBuffer`.
  5413. *
  5414. * @private
  5415. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5416. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5417. */
  5418. function cloneArrayBuffer(arrayBuffer) {
  5419. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5420. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5421. return result;
  5422. }
  5423. /**
  5424. * Creates a clone of `dataView`.
  5425. *
  5426. * @private
  5427. * @param {Object} dataView The data view to clone.
  5428. * @param {boolean} [isDeep] Specify a deep clone.
  5429. * @returns {Object} Returns the cloned data view.
  5430. */
  5431. function cloneDataView(dataView, isDeep) {
  5432. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5433. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5434. }
  5435. /**
  5436. * Creates a clone of `regexp`.
  5437. *
  5438. * @private
  5439. * @param {Object} regexp The regexp to clone.
  5440. * @returns {Object} Returns the cloned regexp.
  5441. */
  5442. function cloneRegExp(regexp) {
  5443. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5444. result.lastIndex = regexp.lastIndex;
  5445. return result;
  5446. }
  5447. /**
  5448. * Creates a clone of the `symbol` object.
  5449. *
  5450. * @private
  5451. * @param {Object} symbol The symbol object to clone.
  5452. * @returns {Object} Returns the cloned symbol object.
  5453. */
  5454. function cloneSymbol(symbol) {
  5455. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5456. }
  5457. /**
  5458. * Creates a clone of `typedArray`.
  5459. *
  5460. * @private
  5461. * @param {Object} typedArray The typed array to clone.
  5462. * @param {boolean} [isDeep] Specify a deep clone.
  5463. * @returns {Object} Returns the cloned typed array.
  5464. */
  5465. function cloneTypedArray(typedArray, isDeep) {
  5466. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5467. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5468. }
  5469. /**
  5470. * Compares values to sort them in ascending order.
  5471. *
  5472. * @private
  5473. * @param {*} value The value to compare.
  5474. * @param {*} other The other value to compare.
  5475. * @returns {number} Returns the sort order indicator for `value`.
  5476. */
  5477. function compareAscending(value, other) {
  5478. if (value !== other) {
  5479. var valIsDefined = value !== undefined,
  5480. valIsNull = value === null,
  5481. valIsReflexive = value === value,
  5482. valIsSymbol = isSymbol(value);
  5483. var othIsDefined = other !== undefined,
  5484. othIsNull = other === null,
  5485. othIsReflexive = other === other,
  5486. othIsSymbol = isSymbol(other);
  5487. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5488. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5489. (valIsNull && othIsDefined && othIsReflexive) ||
  5490. (!valIsDefined && othIsReflexive) ||
  5491. !valIsReflexive) {
  5492. return 1;
  5493. }
  5494. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5495. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5496. (othIsNull && valIsDefined && valIsReflexive) ||
  5497. (!othIsDefined && valIsReflexive) ||
  5498. !othIsReflexive) {
  5499. return -1;
  5500. }
  5501. }
  5502. return 0;
  5503. }
  5504. /**
  5505. * Used by `_.orderBy` to compare multiple properties of a value to another
  5506. * and stable sort them.
  5507. *
  5508. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5509. * specify an order of "desc" for descending or "asc" for ascending sort order
  5510. * of corresponding values.
  5511. *
  5512. * @private
  5513. * @param {Object} object The object to compare.
  5514. * @param {Object} other The other object to compare.
  5515. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5516. * @returns {number} Returns the sort order indicator for `object`.
  5517. */
  5518. function compareMultiple(object, other, orders) {
  5519. var index = -1,
  5520. objCriteria = object.criteria,
  5521. othCriteria = other.criteria,
  5522. length = objCriteria.length,
  5523. ordersLength = orders.length;
  5524. while (++index < length) {
  5525. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5526. if (result) {
  5527. if (index >= ordersLength) {
  5528. return result;
  5529. }
  5530. var order = orders[index];
  5531. return result * (order == 'desc' ? -1 : 1);
  5532. }
  5533. }
  5534. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5535. // that causes it, under certain circumstances, to provide the same value for
  5536. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5537. // for more details.
  5538. //
  5539. // This also ensures a stable sort in V8 and other engines.
  5540. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5541. return object.index - other.index;
  5542. }
  5543. /**
  5544. * Creates an array that is the composition of partially applied arguments,
  5545. * placeholders, and provided arguments into a single array of arguments.
  5546. *
  5547. * @private
  5548. * @param {Array} args The provided arguments.
  5549. * @param {Array} partials The arguments to prepend to those provided.
  5550. * @param {Array} holders The `partials` placeholder indexes.
  5551. * @params {boolean} [isCurried] Specify composing for a curried function.
  5552. * @returns {Array} Returns the new array of composed arguments.
  5553. */
  5554. function composeArgs(args, partials, holders, isCurried) {
  5555. var argsIndex = -1,
  5556. argsLength = args.length,
  5557. holdersLength = holders.length,
  5558. leftIndex = -1,
  5559. leftLength = partials.length,
  5560. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5561. result = Array(leftLength + rangeLength),
  5562. isUncurried = !isCurried;
  5563. while (++leftIndex < leftLength) {
  5564. result[leftIndex] = partials[leftIndex];
  5565. }
  5566. while (++argsIndex < holdersLength) {
  5567. if (isUncurried || argsIndex < argsLength) {
  5568. result[holders[argsIndex]] = args[argsIndex];
  5569. }
  5570. }
  5571. while (rangeLength--) {
  5572. result[leftIndex++] = args[argsIndex++];
  5573. }
  5574. return result;
  5575. }
  5576. /**
  5577. * This function is like `composeArgs` except that the arguments composition
  5578. * is tailored for `_.partialRight`.
  5579. *
  5580. * @private
  5581. * @param {Array} args The provided arguments.
  5582. * @param {Array} partials The arguments to append to those provided.
  5583. * @param {Array} holders The `partials` placeholder indexes.
  5584. * @params {boolean} [isCurried] Specify composing for a curried function.
  5585. * @returns {Array} Returns the new array of composed arguments.
  5586. */
  5587. function composeArgsRight(args, partials, holders, isCurried) {
  5588. var argsIndex = -1,
  5589. argsLength = args.length,
  5590. holdersIndex = -1,
  5591. holdersLength = holders.length,
  5592. rightIndex = -1,
  5593. rightLength = partials.length,
  5594. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5595. result = Array(rangeLength + rightLength),
  5596. isUncurried = !isCurried;
  5597. while (++argsIndex < rangeLength) {
  5598. result[argsIndex] = args[argsIndex];
  5599. }
  5600. var offset = argsIndex;
  5601. while (++rightIndex < rightLength) {
  5602. result[offset + rightIndex] = partials[rightIndex];
  5603. }
  5604. while (++holdersIndex < holdersLength) {
  5605. if (isUncurried || argsIndex < argsLength) {
  5606. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5607. }
  5608. }
  5609. return result;
  5610. }
  5611. /**
  5612. * Copies the values of `source` to `array`.
  5613. *
  5614. * @private
  5615. * @param {Array} source The array to copy values from.
  5616. * @param {Array} [array=[]] The array to copy values to.
  5617. * @returns {Array} Returns `array`.
  5618. */
  5619. function copyArray(source, array) {
  5620. var index = -1,
  5621. length = source.length;
  5622. array || (array = Array(length));
  5623. while (++index < length) {
  5624. array[index] = source[index];
  5625. }
  5626. return array;
  5627. }
  5628. /**
  5629. * Copies properties of `source` to `object`.
  5630. *
  5631. * @private
  5632. * @param {Object} source The object to copy properties from.
  5633. * @param {Array} props The property identifiers to copy.
  5634. * @param {Object} [object={}] The object to copy properties to.
  5635. * @param {Function} [customizer] The function to customize copied values.
  5636. * @returns {Object} Returns `object`.
  5637. */
  5638. function copyObject(source, props, object, customizer) {
  5639. var isNew = !object;
  5640. object || (object = {});
  5641. var index = -1,
  5642. length = props.length;
  5643. while (++index < length) {
  5644. var key = props[index];
  5645. var newValue = customizer
  5646. ? customizer(object[key], source[key], key, object, source)
  5647. : undefined;
  5648. if (newValue === undefined) {
  5649. newValue = source[key];
  5650. }
  5651. if (isNew) {
  5652. baseAssignValue(object, key, newValue);
  5653. } else {
  5654. assignValue(object, key, newValue);
  5655. }
  5656. }
  5657. return object;
  5658. }
  5659. /**
  5660. * Copies own symbols of `source` to `object`.
  5661. *
  5662. * @private
  5663. * @param {Object} source The object to copy symbols from.
  5664. * @param {Object} [object={}] The object to copy symbols to.
  5665. * @returns {Object} Returns `object`.
  5666. */
  5667. function copySymbols(source, object) {
  5668. return copyObject(source, getSymbols(source), object);
  5669. }
  5670. /**
  5671. * Copies own and inherited symbols of `source` to `object`.
  5672. *
  5673. * @private
  5674. * @param {Object} source The object to copy symbols from.
  5675. * @param {Object} [object={}] The object to copy symbols to.
  5676. * @returns {Object} Returns `object`.
  5677. */
  5678. function copySymbolsIn(source, object) {
  5679. return copyObject(source, getSymbolsIn(source), object);
  5680. }
  5681. /**
  5682. * Creates a function like `_.groupBy`.
  5683. *
  5684. * @private
  5685. * @param {Function} setter The function to set accumulator values.
  5686. * @param {Function} [initializer] The accumulator object initializer.
  5687. * @returns {Function} Returns the new aggregator function.
  5688. */
  5689. function createAggregator(setter, initializer) {
  5690. return function(collection, iteratee) {
  5691. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5692. accumulator = initializer ? initializer() : {};
  5693. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5694. };
  5695. }
  5696. /**
  5697. * Creates a function like `_.assign`.
  5698. *
  5699. * @private
  5700. * @param {Function} assigner The function to assign values.
  5701. * @returns {Function} Returns the new assigner function.
  5702. */
  5703. function createAssigner(assigner) {
  5704. return baseRest(function(object, sources) {
  5705. var index = -1,
  5706. length = sources.length,
  5707. customizer = length > 1 ? sources[length - 1] : undefined,
  5708. guard = length > 2 ? sources[2] : undefined;
  5709. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5710. ? (length--, customizer)
  5711. : undefined;
  5712. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5713. customizer = length < 3 ? undefined : customizer;
  5714. length = 1;
  5715. }
  5716. object = Object(object);
  5717. while (++index < length) {
  5718. var source = sources[index];
  5719. if (source) {
  5720. assigner(object, source, index, customizer);
  5721. }
  5722. }
  5723. return object;
  5724. });
  5725. }
  5726. /**
  5727. * Creates a `baseEach` or `baseEachRight` function.
  5728. *
  5729. * @private
  5730. * @param {Function} eachFunc The function to iterate over a collection.
  5731. * @param {boolean} [fromRight] Specify iterating from right to left.
  5732. * @returns {Function} Returns the new base function.
  5733. */
  5734. function createBaseEach(eachFunc, fromRight) {
  5735. return function(collection, iteratee) {
  5736. if (collection == null) {
  5737. return collection;
  5738. }
  5739. if (!isArrayLike(collection)) {
  5740. return eachFunc(collection, iteratee);
  5741. }
  5742. var length = collection.length,
  5743. index = fromRight ? length : -1,
  5744. iterable = Object(collection);
  5745. while ((fromRight ? index-- : ++index < length)) {
  5746. if (iteratee(iterable[index], index, iterable) === false) {
  5747. break;
  5748. }
  5749. }
  5750. return collection;
  5751. };
  5752. }
  5753. /**
  5754. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5755. *
  5756. * @private
  5757. * @param {boolean} [fromRight] Specify iterating from right to left.
  5758. * @returns {Function} Returns the new base function.
  5759. */
  5760. function createBaseFor(fromRight) {
  5761. return function(object, iteratee, keysFunc) {
  5762. var index = -1,
  5763. iterable = Object(object),
  5764. props = keysFunc(object),
  5765. length = props.length;
  5766. while (length--) {
  5767. var key = props[fromRight ? length : ++index];
  5768. if (iteratee(iterable[key], key, iterable) === false) {
  5769. break;
  5770. }
  5771. }
  5772. return object;
  5773. };
  5774. }
  5775. /**
  5776. * Creates a function that wraps `func` to invoke it with the optional `this`
  5777. * binding of `thisArg`.
  5778. *
  5779. * @private
  5780. * @param {Function} func The function to wrap.
  5781. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5782. * @param {*} [thisArg] The `this` binding of `func`.
  5783. * @returns {Function} Returns the new wrapped function.
  5784. */
  5785. function createBind(func, bitmask, thisArg) {
  5786. var isBind = bitmask & WRAP_BIND_FLAG,
  5787. Ctor = createCtor(func);
  5788. function wrapper() {
  5789. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5790. return fn.apply(isBind ? thisArg : this, arguments);
  5791. }
  5792. return wrapper;
  5793. }
  5794. /**
  5795. * Creates a function like `_.lowerFirst`.
  5796. *
  5797. * @private
  5798. * @param {string} methodName The name of the `String` case method to use.
  5799. * @returns {Function} Returns the new case function.
  5800. */
  5801. function createCaseFirst(methodName) {
  5802. return function(string) {
  5803. string = toString(string);
  5804. var strSymbols = hasUnicode(string)
  5805. ? stringToArray(string)
  5806. : undefined;
  5807. var chr = strSymbols
  5808. ? strSymbols[0]
  5809. : string.charAt(0);
  5810. var trailing = strSymbols
  5811. ? castSlice(strSymbols, 1).join('')
  5812. : string.slice(1);
  5813. return chr[methodName]() + trailing;
  5814. };
  5815. }
  5816. /**
  5817. * Creates a function like `_.camelCase`.
  5818. *
  5819. * @private
  5820. * @param {Function} callback The function to combine each word.
  5821. * @returns {Function} Returns the new compounder function.
  5822. */
  5823. function createCompounder(callback) {
  5824. return function(string) {
  5825. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5826. };
  5827. }
  5828. /**
  5829. * Creates a function that produces an instance of `Ctor` regardless of
  5830. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5831. *
  5832. * @private
  5833. * @param {Function} Ctor The constructor to wrap.
  5834. * @returns {Function} Returns the new wrapped function.
  5835. */
  5836. function createCtor(Ctor) {
  5837. return function() {
  5838. // Use a `switch` statement to work with class constructors. See
  5839. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5840. // for more details.
  5841. var args = arguments;
  5842. switch (args.length) {
  5843. case 0: return new Ctor;
  5844. case 1: return new Ctor(args[0]);
  5845. case 2: return new Ctor(args[0], args[1]);
  5846. case 3: return new Ctor(args[0], args[1], args[2]);
  5847. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5848. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5849. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5850. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5851. }
  5852. var thisBinding = baseCreate(Ctor.prototype),
  5853. result = Ctor.apply(thisBinding, args);
  5854. // Mimic the constructor's `return` behavior.
  5855. // See https://es5.github.io/#x13.2.2 for more details.
  5856. return isObject(result) ? result : thisBinding;
  5857. };
  5858. }
  5859. /**
  5860. * Creates a function that wraps `func` to enable currying.
  5861. *
  5862. * @private
  5863. * @param {Function} func The function to wrap.
  5864. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5865. * @param {number} arity The arity of `func`.
  5866. * @returns {Function} Returns the new wrapped function.
  5867. */
  5868. function createCurry(func, bitmask, arity) {
  5869. var Ctor = createCtor(func);
  5870. function wrapper() {
  5871. var length = arguments.length,
  5872. args = Array(length),
  5873. index = length,
  5874. placeholder = getHolder(wrapper);
  5875. while (index--) {
  5876. args[index] = arguments[index];
  5877. }
  5878. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5879. ? []
  5880. : replaceHolders(args, placeholder);
  5881. length -= holders.length;
  5882. if (length < arity) {
  5883. return createRecurry(
  5884. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5885. args, holders, undefined, undefined, arity - length);
  5886. }
  5887. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5888. return apply(fn, this, args);
  5889. }
  5890. return wrapper;
  5891. }
  5892. /**
  5893. * Creates a `_.find` or `_.findLast` function.
  5894. *
  5895. * @private
  5896. * @param {Function} findIndexFunc The function to find the collection index.
  5897. * @returns {Function} Returns the new find function.
  5898. */
  5899. function createFind(findIndexFunc) {
  5900. return function(collection, predicate, fromIndex) {
  5901. var iterable = Object(collection);
  5902. if (!isArrayLike(collection)) {
  5903. var iteratee = getIteratee(predicate, 3);
  5904. collection = keys(collection);
  5905. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5906. }
  5907. var index = findIndexFunc(collection, predicate, fromIndex);
  5908. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5909. };
  5910. }
  5911. /**
  5912. * Creates a `_.flow` or `_.flowRight` function.
  5913. *
  5914. * @private
  5915. * @param {boolean} [fromRight] Specify iterating from right to left.
  5916. * @returns {Function} Returns the new flow function.
  5917. */
  5918. function createFlow(fromRight) {
  5919. return flatRest(function(funcs) {
  5920. var length = funcs.length,
  5921. index = length,
  5922. prereq = LodashWrapper.prototype.thru;
  5923. if (fromRight) {
  5924. funcs.reverse();
  5925. }
  5926. while (index--) {
  5927. var func = funcs[index];
  5928. if (typeof func != 'function') {
  5929. throw new TypeError(FUNC_ERROR_TEXT);
  5930. }
  5931. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5932. var wrapper = new LodashWrapper([], true);
  5933. }
  5934. }
  5935. index = wrapper ? index : length;
  5936. while (++index < length) {
  5937. func = funcs[index];
  5938. var funcName = getFuncName(func),
  5939. data = funcName == 'wrapper' ? getData(func) : undefined;
  5940. if (data && isLaziable(data[0]) &&
  5941. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5942. !data[4].length && data[9] == 1
  5943. ) {
  5944. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5945. } else {
  5946. wrapper = (func.length == 1 && isLaziable(func))
  5947. ? wrapper[funcName]()
  5948. : wrapper.thru(func);
  5949. }
  5950. }
  5951. return function() {
  5952. var args = arguments,
  5953. value = args[0];
  5954. if (wrapper && args.length == 1 && isArray(value)) {
  5955. return wrapper.plant(value).value();
  5956. }
  5957. var index = 0,
  5958. result = length ? funcs[index].apply(this, args) : value;
  5959. while (++index < length) {
  5960. result = funcs[index].call(this, result);
  5961. }
  5962. return result;
  5963. };
  5964. });
  5965. }
  5966. /**
  5967. * Creates a function that wraps `func` to invoke it with optional `this`
  5968. * binding of `thisArg`, partial application, and currying.
  5969. *
  5970. * @private
  5971. * @param {Function|string} func The function or method name to wrap.
  5972. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5973. * @param {*} [thisArg] The `this` binding of `func`.
  5974. * @param {Array} [partials] The arguments to prepend to those provided to
  5975. * the new function.
  5976. * @param {Array} [holders] The `partials` placeholder indexes.
  5977. * @param {Array} [partialsRight] The arguments to append to those provided
  5978. * to the new function.
  5979. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5980. * @param {Array} [argPos] The argument positions of the new function.
  5981. * @param {number} [ary] The arity cap of `func`.
  5982. * @param {number} [arity] The arity of `func`.
  5983. * @returns {Function} Returns the new wrapped function.
  5984. */
  5985. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5986. var isAry = bitmask & WRAP_ARY_FLAG,
  5987. isBind = bitmask & WRAP_BIND_FLAG,
  5988. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5989. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5990. isFlip = bitmask & WRAP_FLIP_FLAG,
  5991. Ctor = isBindKey ? undefined : createCtor(func);
  5992. function wrapper() {
  5993. var length = arguments.length,
  5994. args = Array(length),
  5995. index = length;
  5996. while (index--) {
  5997. args[index] = arguments[index];
  5998. }
  5999. if (isCurried) {
  6000. var placeholder = getHolder(wrapper),
  6001. holdersCount = countHolders(args, placeholder);
  6002. }
  6003. if (partials) {
  6004. args = composeArgs(args, partials, holders, isCurried);
  6005. }
  6006. if (partialsRight) {
  6007. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6008. }
  6009. length -= holdersCount;
  6010. if (isCurried && length < arity) {
  6011. var newHolders = replaceHolders(args, placeholder);
  6012. return createRecurry(
  6013. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6014. args, newHolders, argPos, ary, arity - length
  6015. );
  6016. }
  6017. var thisBinding = isBind ? thisArg : this,
  6018. fn = isBindKey ? thisBinding[func] : func;
  6019. length = args.length;
  6020. if (argPos) {
  6021. args = reorder(args, argPos);
  6022. } else if (isFlip && length > 1) {
  6023. args.reverse();
  6024. }
  6025. if (isAry && ary < length) {
  6026. args.length = ary;
  6027. }
  6028. if (this && this !== root && this instanceof wrapper) {
  6029. fn = Ctor || createCtor(fn);
  6030. }
  6031. return fn.apply(thisBinding, args);
  6032. }
  6033. return wrapper;
  6034. }
  6035. /**
  6036. * Creates a function like `_.invertBy`.
  6037. *
  6038. * @private
  6039. * @param {Function} setter The function to set accumulator values.
  6040. * @param {Function} toIteratee The function to resolve iteratees.
  6041. * @returns {Function} Returns the new inverter function.
  6042. */
  6043. function createInverter(setter, toIteratee) {
  6044. return function(object, iteratee) {
  6045. return baseInverter(object, setter, toIteratee(iteratee), {});
  6046. };
  6047. }
  6048. /**
  6049. * Creates a function that performs a mathematical operation on two values.
  6050. *
  6051. * @private
  6052. * @param {Function} operator The function to perform the operation.
  6053. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6054. * @returns {Function} Returns the new mathematical operation function.
  6055. */
  6056. function createMathOperation(operator, defaultValue) {
  6057. return function(value, other) {
  6058. var result;
  6059. if (value === undefined && other === undefined) {
  6060. return defaultValue;
  6061. }
  6062. if (value !== undefined) {
  6063. result = value;
  6064. }
  6065. if (other !== undefined) {
  6066. if (result === undefined) {
  6067. return other;
  6068. }
  6069. if (typeof value == 'string' || typeof other == 'string') {
  6070. value = baseToString(value);
  6071. other = baseToString(other);
  6072. } else {
  6073. value = baseToNumber(value);
  6074. other = baseToNumber(other);
  6075. }
  6076. result = operator(value, other);
  6077. }
  6078. return result;
  6079. };
  6080. }
  6081. /**
  6082. * Creates a function like `_.over`.
  6083. *
  6084. * @private
  6085. * @param {Function} arrayFunc The function to iterate over iteratees.
  6086. * @returns {Function} Returns the new over function.
  6087. */
  6088. function createOver(arrayFunc) {
  6089. return flatRest(function(iteratees) {
  6090. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6091. return baseRest(function(args) {
  6092. var thisArg = this;
  6093. return arrayFunc(iteratees, function(iteratee) {
  6094. return apply(iteratee, thisArg, args);
  6095. });
  6096. });
  6097. });
  6098. }
  6099. /**
  6100. * Creates the padding for `string` based on `length`. The `chars` string
  6101. * is truncated if the number of characters exceeds `length`.
  6102. *
  6103. * @private
  6104. * @param {number} length The padding length.
  6105. * @param {string} [chars=' '] The string used as padding.
  6106. * @returns {string} Returns the padding for `string`.
  6107. */
  6108. function createPadding(length, chars) {
  6109. chars = chars === undefined ? ' ' : baseToString(chars);
  6110. var charsLength = chars.length;
  6111. if (charsLength < 2) {
  6112. return charsLength ? baseRepeat(chars, length) : chars;
  6113. }
  6114. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6115. return hasUnicode(chars)
  6116. ? castSlice(stringToArray(result), 0, length).join('')
  6117. : result.slice(0, length);
  6118. }
  6119. /**
  6120. * Creates a function that wraps `func` to invoke it with the `this` binding
  6121. * of `thisArg` and `partials` prepended to the arguments it receives.
  6122. *
  6123. * @private
  6124. * @param {Function} func The function to wrap.
  6125. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6126. * @param {*} thisArg The `this` binding of `func`.
  6127. * @param {Array} partials The arguments to prepend to those provided to
  6128. * the new function.
  6129. * @returns {Function} Returns the new wrapped function.
  6130. */
  6131. function createPartial(func, bitmask, thisArg, partials) {
  6132. var isBind = bitmask & WRAP_BIND_FLAG,
  6133. Ctor = createCtor(func);
  6134. function wrapper() {
  6135. var argsIndex = -1,
  6136. argsLength = arguments.length,
  6137. leftIndex = -1,
  6138. leftLength = partials.length,
  6139. args = Array(leftLength + argsLength),
  6140. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6141. while (++leftIndex < leftLength) {
  6142. args[leftIndex] = partials[leftIndex];
  6143. }
  6144. while (argsLength--) {
  6145. args[leftIndex++] = arguments[++argsIndex];
  6146. }
  6147. return apply(fn, isBind ? thisArg : this, args);
  6148. }
  6149. return wrapper;
  6150. }
  6151. /**
  6152. * Creates a `_.range` or `_.rangeRight` function.
  6153. *
  6154. * @private
  6155. * @param {boolean} [fromRight] Specify iterating from right to left.
  6156. * @returns {Function} Returns the new range function.
  6157. */
  6158. function createRange(fromRight) {
  6159. return function(start, end, step) {
  6160. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6161. end = step = undefined;
  6162. }
  6163. // Ensure the sign of `-0` is preserved.
  6164. start = toFinite(start);
  6165. if (end === undefined) {
  6166. end = start;
  6167. start = 0;
  6168. } else {
  6169. end = toFinite(end);
  6170. }
  6171. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6172. return baseRange(start, end, step, fromRight);
  6173. };
  6174. }
  6175. /**
  6176. * Creates a function that performs a relational operation on two values.
  6177. *
  6178. * @private
  6179. * @param {Function} operator The function to perform the operation.
  6180. * @returns {Function} Returns the new relational operation function.
  6181. */
  6182. function createRelationalOperation(operator) {
  6183. return function(value, other) {
  6184. if (!(typeof value == 'string' && typeof other == 'string')) {
  6185. value = toNumber(value);
  6186. other = toNumber(other);
  6187. }
  6188. return operator(value, other);
  6189. };
  6190. }
  6191. /**
  6192. * Creates a function that wraps `func` to continue currying.
  6193. *
  6194. * @private
  6195. * @param {Function} func The function to wrap.
  6196. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6197. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6198. * @param {*} placeholder The placeholder value.
  6199. * @param {*} [thisArg] The `this` binding of `func`.
  6200. * @param {Array} [partials] The arguments to prepend to those provided to
  6201. * the new function.
  6202. * @param {Array} [holders] The `partials` placeholder indexes.
  6203. * @param {Array} [argPos] The argument positions of the new function.
  6204. * @param {number} [ary] The arity cap of `func`.
  6205. * @param {number} [arity] The arity of `func`.
  6206. * @returns {Function} Returns the new wrapped function.
  6207. */
  6208. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6209. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6210. newHolders = isCurry ? holders : undefined,
  6211. newHoldersRight = isCurry ? undefined : holders,
  6212. newPartials = isCurry ? partials : undefined,
  6213. newPartialsRight = isCurry ? undefined : partials;
  6214. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6215. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6216. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6217. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6218. }
  6219. var newData = [
  6220. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6221. newHoldersRight, argPos, ary, arity
  6222. ];
  6223. var result = wrapFunc.apply(undefined, newData);
  6224. if (isLaziable(func)) {
  6225. setData(result, newData);
  6226. }
  6227. result.placeholder = placeholder;
  6228. return setWrapToString(result, func, bitmask);
  6229. }
  6230. /**
  6231. * Creates a function like `_.round`.
  6232. *
  6233. * @private
  6234. * @param {string} methodName The name of the `Math` method to use when rounding.
  6235. * @returns {Function} Returns the new round function.
  6236. */
  6237. function createRound(methodName) {
  6238. var func = Math[methodName];
  6239. return function(number, precision) {
  6240. number = toNumber(number);
  6241. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6242. if (precision && nativeIsFinite(number)) {
  6243. // Shift with exponential notation to avoid floating-point issues.
  6244. // See [MDN](https://mdn.io/round#Examples) for more details.
  6245. var pair = (toString(number) + 'e').split('e'),
  6246. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6247. pair = (toString(value) + 'e').split('e');
  6248. return +(pair[0] + 'e' + (+pair[1] - precision));
  6249. }
  6250. return func(number);
  6251. };
  6252. }
  6253. /**
  6254. * Creates a set object of `values`.
  6255. *
  6256. * @private
  6257. * @param {Array} values The values to add to the set.
  6258. * @returns {Object} Returns the new set.
  6259. */
  6260. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6261. return new Set(values);
  6262. };
  6263. /**
  6264. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6265. *
  6266. * @private
  6267. * @param {Function} keysFunc The function to get the keys of a given object.
  6268. * @returns {Function} Returns the new pairs function.
  6269. */
  6270. function createToPairs(keysFunc) {
  6271. return function(object) {
  6272. var tag = getTag(object);
  6273. if (tag == mapTag) {
  6274. return mapToArray(object);
  6275. }
  6276. if (tag == setTag) {
  6277. return setToPairs(object);
  6278. }
  6279. return baseToPairs(object, keysFunc(object));
  6280. };
  6281. }
  6282. /**
  6283. * Creates a function that either curries or invokes `func` with optional
  6284. * `this` binding and partially applied arguments.
  6285. *
  6286. * @private
  6287. * @param {Function|string} func The function or method name to wrap.
  6288. * @param {number} bitmask The bitmask flags.
  6289. * 1 - `_.bind`
  6290. * 2 - `_.bindKey`
  6291. * 4 - `_.curry` or `_.curryRight` of a bound function
  6292. * 8 - `_.curry`
  6293. * 16 - `_.curryRight`
  6294. * 32 - `_.partial`
  6295. * 64 - `_.partialRight`
  6296. * 128 - `_.rearg`
  6297. * 256 - `_.ary`
  6298. * 512 - `_.flip`
  6299. * @param {*} [thisArg] The `this` binding of `func`.
  6300. * @param {Array} [partials] The arguments to be partially applied.
  6301. * @param {Array} [holders] The `partials` placeholder indexes.
  6302. * @param {Array} [argPos] The argument positions of the new function.
  6303. * @param {number} [ary] The arity cap of `func`.
  6304. * @param {number} [arity] The arity of `func`.
  6305. * @returns {Function} Returns the new wrapped function.
  6306. */
  6307. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6308. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6309. if (!isBindKey && typeof func != 'function') {
  6310. throw new TypeError(FUNC_ERROR_TEXT);
  6311. }
  6312. var length = partials ? partials.length : 0;
  6313. if (!length) {
  6314. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6315. partials = holders = undefined;
  6316. }
  6317. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6318. arity = arity === undefined ? arity : toInteger(arity);
  6319. length -= holders ? holders.length : 0;
  6320. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6321. var partialsRight = partials,
  6322. holdersRight = holders;
  6323. partials = holders = undefined;
  6324. }
  6325. var data = isBindKey ? undefined : getData(func);
  6326. var newData = [
  6327. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6328. argPos, ary, arity
  6329. ];
  6330. if (data) {
  6331. mergeData(newData, data);
  6332. }
  6333. func = newData[0];
  6334. bitmask = newData[1];
  6335. thisArg = newData[2];
  6336. partials = newData[3];
  6337. holders = newData[4];
  6338. arity = newData[9] = newData[9] === undefined
  6339. ? (isBindKey ? 0 : func.length)
  6340. : nativeMax(newData[9] - length, 0);
  6341. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6342. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6343. }
  6344. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6345. var result = createBind(func, bitmask, thisArg);
  6346. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6347. result = createCurry(func, bitmask, arity);
  6348. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6349. result = createPartial(func, bitmask, thisArg, partials);
  6350. } else {
  6351. result = createHybrid.apply(undefined, newData);
  6352. }
  6353. var setter = data ? baseSetData : setData;
  6354. return setWrapToString(setter(result, newData), func, bitmask);
  6355. }
  6356. /**
  6357. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6358. * of source objects to the destination object for all destination properties
  6359. * that resolve to `undefined`.
  6360. *
  6361. * @private
  6362. * @param {*} objValue The destination value.
  6363. * @param {*} srcValue The source value.
  6364. * @param {string} key The key of the property to assign.
  6365. * @param {Object} object The parent object of `objValue`.
  6366. * @returns {*} Returns the value to assign.
  6367. */
  6368. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6369. if (objValue === undefined ||
  6370. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6371. return srcValue;
  6372. }
  6373. return objValue;
  6374. }
  6375. /**
  6376. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6377. * objects into destination objects that are passed thru.
  6378. *
  6379. * @private
  6380. * @param {*} objValue The destination value.
  6381. * @param {*} srcValue The source value.
  6382. * @param {string} key The key of the property to merge.
  6383. * @param {Object} object The parent object of `objValue`.
  6384. * @param {Object} source The parent object of `srcValue`.
  6385. * @param {Object} [stack] Tracks traversed source values and their merged
  6386. * counterparts.
  6387. * @returns {*} Returns the value to assign.
  6388. */
  6389. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6390. if (isObject(objValue) && isObject(srcValue)) {
  6391. // Recursively merge objects and arrays (susceptible to call stack limits).
  6392. stack.set(srcValue, objValue);
  6393. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6394. stack['delete'](srcValue);
  6395. }
  6396. return objValue;
  6397. }
  6398. /**
  6399. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6400. * objects.
  6401. *
  6402. * @private
  6403. * @param {*} value The value to inspect.
  6404. * @param {string} key The key of the property to inspect.
  6405. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6406. */
  6407. function customOmitClone(value) {
  6408. return isPlainObject(value) ? undefined : value;
  6409. }
  6410. /**
  6411. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6412. * partial deep comparisons.
  6413. *
  6414. * @private
  6415. * @param {Array} array The array to compare.
  6416. * @param {Array} other The other array to compare.
  6417. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6418. * @param {Function} customizer The function to customize comparisons.
  6419. * @param {Function} equalFunc The function to determine equivalents of values.
  6420. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6421. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6422. */
  6423. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6424. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6425. arrLength = array.length,
  6426. othLength = other.length;
  6427. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6428. return false;
  6429. }
  6430. // Check that cyclic values are equal.
  6431. var arrStacked = stack.get(array);
  6432. var othStacked = stack.get(other);
  6433. if (arrStacked && othStacked) {
  6434. return arrStacked == other && othStacked == array;
  6435. }
  6436. var index = -1,
  6437. result = true,
  6438. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6439. stack.set(array, other);
  6440. stack.set(other, array);
  6441. // Ignore non-index properties.
  6442. while (++index < arrLength) {
  6443. var arrValue = array[index],
  6444. othValue = other[index];
  6445. if (customizer) {
  6446. var compared = isPartial
  6447. ? customizer(othValue, arrValue, index, other, array, stack)
  6448. : customizer(arrValue, othValue, index, array, other, stack);
  6449. }
  6450. if (compared !== undefined) {
  6451. if (compared) {
  6452. continue;
  6453. }
  6454. result = false;
  6455. break;
  6456. }
  6457. // Recursively compare arrays (susceptible to call stack limits).
  6458. if (seen) {
  6459. if (!arraySome(other, function(othValue, othIndex) {
  6460. if (!cacheHas(seen, othIndex) &&
  6461. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6462. return seen.push(othIndex);
  6463. }
  6464. })) {
  6465. result = false;
  6466. break;
  6467. }
  6468. } else if (!(
  6469. arrValue === othValue ||
  6470. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6471. )) {
  6472. result = false;
  6473. break;
  6474. }
  6475. }
  6476. stack['delete'](array);
  6477. stack['delete'](other);
  6478. return result;
  6479. }
  6480. /**
  6481. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6482. * the same `toStringTag`.
  6483. *
  6484. * **Note:** This function only supports comparing values with tags of
  6485. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6486. *
  6487. * @private
  6488. * @param {Object} object The object to compare.
  6489. * @param {Object} other The other object to compare.
  6490. * @param {string} tag The `toStringTag` of the objects to compare.
  6491. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6492. * @param {Function} customizer The function to customize comparisons.
  6493. * @param {Function} equalFunc The function to determine equivalents of values.
  6494. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6495. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6496. */
  6497. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6498. switch (tag) {
  6499. case dataViewTag:
  6500. if ((object.byteLength != other.byteLength) ||
  6501. (object.byteOffset != other.byteOffset)) {
  6502. return false;
  6503. }
  6504. object = object.buffer;
  6505. other = other.buffer;
  6506. case arrayBufferTag:
  6507. if ((object.byteLength != other.byteLength) ||
  6508. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6509. return false;
  6510. }
  6511. return true;
  6512. case boolTag:
  6513. case dateTag:
  6514. case numberTag:
  6515. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6516. // Invalid dates are coerced to `NaN`.
  6517. return eq(+object, +other);
  6518. case errorTag:
  6519. return object.name == other.name && object.message == other.message;
  6520. case regexpTag:
  6521. case stringTag:
  6522. // Coerce regexes to strings and treat strings, primitives and objects,
  6523. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6524. // for more details.
  6525. return object == (other + '');
  6526. case mapTag:
  6527. var convert = mapToArray;
  6528. case setTag:
  6529. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6530. convert || (convert = setToArray);
  6531. if (object.size != other.size && !isPartial) {
  6532. return false;
  6533. }
  6534. // Assume cyclic values are equal.
  6535. var stacked = stack.get(object);
  6536. if (stacked) {
  6537. return stacked == other;
  6538. }
  6539. bitmask |= COMPARE_UNORDERED_FLAG;
  6540. // Recursively compare objects (susceptible to call stack limits).
  6541. stack.set(object, other);
  6542. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6543. stack['delete'](object);
  6544. return result;
  6545. case symbolTag:
  6546. if (symbolValueOf) {
  6547. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6548. }
  6549. }
  6550. return false;
  6551. }
  6552. /**
  6553. * A specialized version of `baseIsEqualDeep` for objects with support for
  6554. * partial deep comparisons.
  6555. *
  6556. * @private
  6557. * @param {Object} object The object to compare.
  6558. * @param {Object} other The other object to compare.
  6559. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6560. * @param {Function} customizer The function to customize comparisons.
  6561. * @param {Function} equalFunc The function to determine equivalents of values.
  6562. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6563. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6564. */
  6565. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6566. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6567. objProps = getAllKeys(object),
  6568. objLength = objProps.length,
  6569. othProps = getAllKeys(other),
  6570. othLength = othProps.length;
  6571. if (objLength != othLength && !isPartial) {
  6572. return false;
  6573. }
  6574. var index = objLength;
  6575. while (index--) {
  6576. var key = objProps[index];
  6577. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6578. return false;
  6579. }
  6580. }
  6581. // Check that cyclic values are equal.
  6582. var objStacked = stack.get(object);
  6583. var othStacked = stack.get(other);
  6584. if (objStacked && othStacked) {
  6585. return objStacked == other && othStacked == object;
  6586. }
  6587. var result = true;
  6588. stack.set(object, other);
  6589. stack.set(other, object);
  6590. var skipCtor = isPartial;
  6591. while (++index < objLength) {
  6592. key = objProps[index];
  6593. var objValue = object[key],
  6594. othValue = other[key];
  6595. if (customizer) {
  6596. var compared = isPartial
  6597. ? customizer(othValue, objValue, key, other, object, stack)
  6598. : customizer(objValue, othValue, key, object, other, stack);
  6599. }
  6600. // Recursively compare objects (susceptible to call stack limits).
  6601. if (!(compared === undefined
  6602. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6603. : compared
  6604. )) {
  6605. result = false;
  6606. break;
  6607. }
  6608. skipCtor || (skipCtor = key == 'constructor');
  6609. }
  6610. if (result && !skipCtor) {
  6611. var objCtor = object.constructor,
  6612. othCtor = other.constructor;
  6613. // Non `Object` object instances with different constructors are not equal.
  6614. if (objCtor != othCtor &&
  6615. ('constructor' in object && 'constructor' in other) &&
  6616. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6617. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6618. result = false;
  6619. }
  6620. }
  6621. stack['delete'](object);
  6622. stack['delete'](other);
  6623. return result;
  6624. }
  6625. /**
  6626. * A specialized version of `baseRest` which flattens the rest array.
  6627. *
  6628. * @private
  6629. * @param {Function} func The function to apply a rest parameter to.
  6630. * @returns {Function} Returns the new function.
  6631. */
  6632. function flatRest(func) {
  6633. return setToString(overRest(func, undefined, flatten), func + '');
  6634. }
  6635. /**
  6636. * Creates an array of own enumerable property names and symbols of `object`.
  6637. *
  6638. * @private
  6639. * @param {Object} object The object to query.
  6640. * @returns {Array} Returns the array of property names and symbols.
  6641. */
  6642. function getAllKeys(object) {
  6643. return baseGetAllKeys(object, keys, getSymbols);
  6644. }
  6645. /**
  6646. * Creates an array of own and inherited enumerable property names and
  6647. * symbols of `object`.
  6648. *
  6649. * @private
  6650. * @param {Object} object The object to query.
  6651. * @returns {Array} Returns the array of property names and symbols.
  6652. */
  6653. function getAllKeysIn(object) {
  6654. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6655. }
  6656. /**
  6657. * Gets metadata for `func`.
  6658. *
  6659. * @private
  6660. * @param {Function} func The function to query.
  6661. * @returns {*} Returns the metadata for `func`.
  6662. */
  6663. var getData = !metaMap ? noop : function(func) {
  6664. return metaMap.get(func);
  6665. };
  6666. /**
  6667. * Gets the name of `func`.
  6668. *
  6669. * @private
  6670. * @param {Function} func The function to query.
  6671. * @returns {string} Returns the function name.
  6672. */
  6673. function getFuncName(func) {
  6674. var result = (func.name + ''),
  6675. array = realNames[result],
  6676. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6677. while (length--) {
  6678. var data = array[length],
  6679. otherFunc = data.func;
  6680. if (otherFunc == null || otherFunc == func) {
  6681. return data.name;
  6682. }
  6683. }
  6684. return result;
  6685. }
  6686. /**
  6687. * Gets the argument placeholder value for `func`.
  6688. *
  6689. * @private
  6690. * @param {Function} func The function to inspect.
  6691. * @returns {*} Returns the placeholder value.
  6692. */
  6693. function getHolder(func) {
  6694. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6695. return object.placeholder;
  6696. }
  6697. /**
  6698. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6699. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6700. * If arguments are provided, the chosen function is invoked with them and
  6701. * its result is returned.
  6702. *
  6703. * @private
  6704. * @param {*} [value] The value to convert to an iteratee.
  6705. * @param {number} [arity] The arity of the created iteratee.
  6706. * @returns {Function} Returns the chosen function or its result.
  6707. */
  6708. function getIteratee() {
  6709. var result = lodash.iteratee || iteratee;
  6710. result = result === iteratee ? baseIteratee : result;
  6711. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6712. }
  6713. /**
  6714. * Gets the data for `map`.
  6715. *
  6716. * @private
  6717. * @param {Object} map The map to query.
  6718. * @param {string} key The reference key.
  6719. * @returns {*} Returns the map data.
  6720. */
  6721. function getMapData(map, key) {
  6722. var data = map.__data__;
  6723. return isKeyable(key)
  6724. ? data[typeof key == 'string' ? 'string' : 'hash']
  6725. : data.map;
  6726. }
  6727. /**
  6728. * Gets the property names, values, and compare flags of `object`.
  6729. *
  6730. * @private
  6731. * @param {Object} object The object to query.
  6732. * @returns {Array} Returns the match data of `object`.
  6733. */
  6734. function getMatchData(object) {
  6735. var result = keys(object),
  6736. length = result.length;
  6737. while (length--) {
  6738. var key = result[length],
  6739. value = object[key];
  6740. result[length] = [key, value, isStrictComparable(value)];
  6741. }
  6742. return result;
  6743. }
  6744. /**
  6745. * Gets the native function at `key` of `object`.
  6746. *
  6747. * @private
  6748. * @param {Object} object The object to query.
  6749. * @param {string} key The key of the method to get.
  6750. * @returns {*} Returns the function if it's native, else `undefined`.
  6751. */
  6752. function getNative(object, key) {
  6753. var value = getValue(object, key);
  6754. return baseIsNative(value) ? value : undefined;
  6755. }
  6756. /**
  6757. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6758. *
  6759. * @private
  6760. * @param {*} value The value to query.
  6761. * @returns {string} Returns the raw `toStringTag`.
  6762. */
  6763. function getRawTag(value) {
  6764. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6765. tag = value[symToStringTag];
  6766. try {
  6767. value[symToStringTag] = undefined;
  6768. var unmasked = true;
  6769. } catch (e) {}
  6770. var result = nativeObjectToString.call(value);
  6771. if (unmasked) {
  6772. if (isOwn) {
  6773. value[symToStringTag] = tag;
  6774. } else {
  6775. delete value[symToStringTag];
  6776. }
  6777. }
  6778. return result;
  6779. }
  6780. /**
  6781. * Creates an array of the own enumerable symbols of `object`.
  6782. *
  6783. * @private
  6784. * @param {Object} object The object to query.
  6785. * @returns {Array} Returns the array of symbols.
  6786. */
  6787. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6788. if (object == null) {
  6789. return [];
  6790. }
  6791. object = Object(object);
  6792. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6793. return propertyIsEnumerable.call(object, symbol);
  6794. });
  6795. };
  6796. /**
  6797. * Creates an array of the own and inherited enumerable symbols of `object`.
  6798. *
  6799. * @private
  6800. * @param {Object} object The object to query.
  6801. * @returns {Array} Returns the array of symbols.
  6802. */
  6803. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6804. var result = [];
  6805. while (object) {
  6806. arrayPush(result, getSymbols(object));
  6807. object = getPrototype(object);
  6808. }
  6809. return result;
  6810. };
  6811. /**
  6812. * Gets the `toStringTag` of `value`.
  6813. *
  6814. * @private
  6815. * @param {*} value The value to query.
  6816. * @returns {string} Returns the `toStringTag`.
  6817. */
  6818. var getTag = baseGetTag;
  6819. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6820. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6821. (Map && getTag(new Map) != mapTag) ||
  6822. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6823. (Set && getTag(new Set) != setTag) ||
  6824. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6825. getTag = function(value) {
  6826. var result = baseGetTag(value),
  6827. Ctor = result == objectTag ? value.constructor : undefined,
  6828. ctorString = Ctor ? toSource(Ctor) : '';
  6829. if (ctorString) {
  6830. switch (ctorString) {
  6831. case dataViewCtorString: return dataViewTag;
  6832. case mapCtorString: return mapTag;
  6833. case promiseCtorString: return promiseTag;
  6834. case setCtorString: return setTag;
  6835. case weakMapCtorString: return weakMapTag;
  6836. }
  6837. }
  6838. return result;
  6839. };
  6840. }
  6841. /**
  6842. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6843. *
  6844. * @private
  6845. * @param {number} start The start of the view.
  6846. * @param {number} end The end of the view.
  6847. * @param {Array} transforms The transformations to apply to the view.
  6848. * @returns {Object} Returns an object containing the `start` and `end`
  6849. * positions of the view.
  6850. */
  6851. function getView(start, end, transforms) {
  6852. var index = -1,
  6853. length = transforms.length;
  6854. while (++index < length) {
  6855. var data = transforms[index],
  6856. size = data.size;
  6857. switch (data.type) {
  6858. case 'drop': start += size; break;
  6859. case 'dropRight': end -= size; break;
  6860. case 'take': end = nativeMin(end, start + size); break;
  6861. case 'takeRight': start = nativeMax(start, end - size); break;
  6862. }
  6863. }
  6864. return { 'start': start, 'end': end };
  6865. }
  6866. /**
  6867. * Extracts wrapper details from the `source` body comment.
  6868. *
  6869. * @private
  6870. * @param {string} source The source to inspect.
  6871. * @returns {Array} Returns the wrapper details.
  6872. */
  6873. function getWrapDetails(source) {
  6874. var match = source.match(reWrapDetails);
  6875. return match ? match[1].split(reSplitDetails) : [];
  6876. }
  6877. /**
  6878. * Checks if `path` exists on `object`.
  6879. *
  6880. * @private
  6881. * @param {Object} object The object to query.
  6882. * @param {Array|string} path The path to check.
  6883. * @param {Function} hasFunc The function to check properties.
  6884. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6885. */
  6886. function hasPath(object, path, hasFunc) {
  6887. path = castPath(path, object);
  6888. var index = -1,
  6889. length = path.length,
  6890. result = false;
  6891. while (++index < length) {
  6892. var key = toKey(path[index]);
  6893. if (!(result = object != null && hasFunc(object, key))) {
  6894. break;
  6895. }
  6896. object = object[key];
  6897. }
  6898. if (result || ++index != length) {
  6899. return result;
  6900. }
  6901. length = object == null ? 0 : object.length;
  6902. return !!length && isLength(length) && isIndex(key, length) &&
  6903. (isArray(object) || isArguments(object));
  6904. }
  6905. /**
  6906. * Initializes an array clone.
  6907. *
  6908. * @private
  6909. * @param {Array} array The array to clone.
  6910. * @returns {Array} Returns the initialized clone.
  6911. */
  6912. function initCloneArray(array) {
  6913. var length = array.length,
  6914. result = new array.constructor(length);
  6915. // Add properties assigned by `RegExp#exec`.
  6916. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6917. result.index = array.index;
  6918. result.input = array.input;
  6919. }
  6920. return result;
  6921. }
  6922. /**
  6923. * Initializes an object clone.
  6924. *
  6925. * @private
  6926. * @param {Object} object The object to clone.
  6927. * @returns {Object} Returns the initialized clone.
  6928. */
  6929. function initCloneObject(object) {
  6930. return (typeof object.constructor == 'function' && !isPrototype(object))
  6931. ? baseCreate(getPrototype(object))
  6932. : {};
  6933. }
  6934. /**
  6935. * Initializes an object clone based on its `toStringTag`.
  6936. *
  6937. * **Note:** This function only supports cloning values with tags of
  6938. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6939. *
  6940. * @private
  6941. * @param {Object} object The object to clone.
  6942. * @param {string} tag The `toStringTag` of the object to clone.
  6943. * @param {boolean} [isDeep] Specify a deep clone.
  6944. * @returns {Object} Returns the initialized clone.
  6945. */
  6946. function initCloneByTag(object, tag, isDeep) {
  6947. var Ctor = object.constructor;
  6948. switch (tag) {
  6949. case arrayBufferTag:
  6950. return cloneArrayBuffer(object);
  6951. case boolTag:
  6952. case dateTag:
  6953. return new Ctor(+object);
  6954. case dataViewTag:
  6955. return cloneDataView(object, isDeep);
  6956. case float32Tag: case float64Tag:
  6957. case int8Tag: case int16Tag: case int32Tag:
  6958. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6959. return cloneTypedArray(object, isDeep);
  6960. case mapTag:
  6961. return new Ctor;
  6962. case numberTag:
  6963. case stringTag:
  6964. return new Ctor(object);
  6965. case regexpTag:
  6966. return cloneRegExp(object);
  6967. case setTag:
  6968. return new Ctor;
  6969. case symbolTag:
  6970. return cloneSymbol(object);
  6971. }
  6972. }
  6973. /**
  6974. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6975. *
  6976. * @private
  6977. * @param {string} source The source to modify.
  6978. * @returns {Array} details The details to insert.
  6979. * @returns {string} Returns the modified source.
  6980. */
  6981. function insertWrapDetails(source, details) {
  6982. var length = details.length;
  6983. if (!length) {
  6984. return source;
  6985. }
  6986. var lastIndex = length - 1;
  6987. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6988. details = details.join(length > 2 ? ', ' : ' ');
  6989. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6990. }
  6991. /**
  6992. * Checks if `value` is a flattenable `arguments` object or array.
  6993. *
  6994. * @private
  6995. * @param {*} value The value to check.
  6996. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6997. */
  6998. function isFlattenable(value) {
  6999. return isArray(value) || isArguments(value) ||
  7000. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7001. }
  7002. /**
  7003. * Checks if `value` is a valid array-like index.
  7004. *
  7005. * @private
  7006. * @param {*} value The value to check.
  7007. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7008. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7009. */
  7010. function isIndex(value, length) {
  7011. var type = typeof value;
  7012. length = length == null ? MAX_SAFE_INTEGER : length;
  7013. return !!length &&
  7014. (type == 'number' ||
  7015. (type != 'symbol' && reIsUint.test(value))) &&
  7016. (value > -1 && value % 1 == 0 && value < length);
  7017. }
  7018. /**
  7019. * Checks if the given arguments are from an iteratee call.
  7020. *
  7021. * @private
  7022. * @param {*} value The potential iteratee value argument.
  7023. * @param {*} index The potential iteratee index or key argument.
  7024. * @param {*} object The potential iteratee object argument.
  7025. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7026. * else `false`.
  7027. */
  7028. function isIterateeCall(value, index, object) {
  7029. if (!isObject(object)) {
  7030. return false;
  7031. }
  7032. var type = typeof index;
  7033. if (type == 'number'
  7034. ? (isArrayLike(object) && isIndex(index, object.length))
  7035. : (type == 'string' && index in object)
  7036. ) {
  7037. return eq(object[index], value);
  7038. }
  7039. return false;
  7040. }
  7041. /**
  7042. * Checks if `value` is a property name and not a property path.
  7043. *
  7044. * @private
  7045. * @param {*} value The value to check.
  7046. * @param {Object} [object] The object to query keys on.
  7047. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7048. */
  7049. function isKey(value, object) {
  7050. if (isArray(value)) {
  7051. return false;
  7052. }
  7053. var type = typeof value;
  7054. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7055. value == null || isSymbol(value)) {
  7056. return true;
  7057. }
  7058. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7059. (object != null && value in Object(object));
  7060. }
  7061. /**
  7062. * Checks if `value` is suitable for use as unique object key.
  7063. *
  7064. * @private
  7065. * @param {*} value The value to check.
  7066. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7067. */
  7068. function isKeyable(value) {
  7069. var type = typeof value;
  7070. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7071. ? (value !== '__proto__')
  7072. : (value === null);
  7073. }
  7074. /**
  7075. * Checks if `func` has a lazy counterpart.
  7076. *
  7077. * @private
  7078. * @param {Function} func The function to check.
  7079. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7080. * else `false`.
  7081. */
  7082. function isLaziable(func) {
  7083. var funcName = getFuncName(func),
  7084. other = lodash[funcName];
  7085. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7086. return false;
  7087. }
  7088. if (func === other) {
  7089. return true;
  7090. }
  7091. var data = getData(other);
  7092. return !!data && func === data[0];
  7093. }
  7094. /**
  7095. * Checks if `func` has its source masked.
  7096. *
  7097. * @private
  7098. * @param {Function} func The function to check.
  7099. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7100. */
  7101. function isMasked(func) {
  7102. return !!maskSrcKey && (maskSrcKey in func);
  7103. }
  7104. /**
  7105. * Checks if `func` is capable of being masked.
  7106. *
  7107. * @private
  7108. * @param {*} value The value to check.
  7109. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7110. */
  7111. var isMaskable = coreJsData ? isFunction : stubFalse;
  7112. /**
  7113. * Checks if `value` is likely a prototype object.
  7114. *
  7115. * @private
  7116. * @param {*} value The value to check.
  7117. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7118. */
  7119. function isPrototype(value) {
  7120. var Ctor = value && value.constructor,
  7121. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7122. return value === proto;
  7123. }
  7124. /**
  7125. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7126. *
  7127. * @private
  7128. * @param {*} value The value to check.
  7129. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7130. * equality comparisons, else `false`.
  7131. */
  7132. function isStrictComparable(value) {
  7133. return value === value && !isObject(value);
  7134. }
  7135. /**
  7136. * A specialized version of `matchesProperty` for source values suitable
  7137. * for strict equality comparisons, i.e. `===`.
  7138. *
  7139. * @private
  7140. * @param {string} key The key of the property to get.
  7141. * @param {*} srcValue The value to match.
  7142. * @returns {Function} Returns the new spec function.
  7143. */
  7144. function matchesStrictComparable(key, srcValue) {
  7145. return function(object) {
  7146. if (object == null) {
  7147. return false;
  7148. }
  7149. return object[key] === srcValue &&
  7150. (srcValue !== undefined || (key in Object(object)));
  7151. };
  7152. }
  7153. /**
  7154. * A specialized version of `_.memoize` which clears the memoized function's
  7155. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7156. *
  7157. * @private
  7158. * @param {Function} func The function to have its output memoized.
  7159. * @returns {Function} Returns the new memoized function.
  7160. */
  7161. function memoizeCapped(func) {
  7162. var result = memoize(func, function(key) {
  7163. if (cache.size === MAX_MEMOIZE_SIZE) {
  7164. cache.clear();
  7165. }
  7166. return key;
  7167. });
  7168. var cache = result.cache;
  7169. return result;
  7170. }
  7171. /**
  7172. * Merges the function metadata of `source` into `data`.
  7173. *
  7174. * Merging metadata reduces the number of wrappers used to invoke a function.
  7175. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7176. * may be applied regardless of execution order. Methods like `_.ary` and
  7177. * `_.rearg` modify function arguments, making the order in which they are
  7178. * executed important, preventing the merging of metadata. However, we make
  7179. * an exception for a safe combined case where curried functions have `_.ary`
  7180. * and or `_.rearg` applied.
  7181. *
  7182. * @private
  7183. * @param {Array} data The destination metadata.
  7184. * @param {Array} source The source metadata.
  7185. * @returns {Array} Returns `data`.
  7186. */
  7187. function mergeData(data, source) {
  7188. var bitmask = data[1],
  7189. srcBitmask = source[1],
  7190. newBitmask = bitmask | srcBitmask,
  7191. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7192. var isCombo =
  7193. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7194. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7195. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7196. // Exit early if metadata can't be merged.
  7197. if (!(isCommon || isCombo)) {
  7198. return data;
  7199. }
  7200. // Use source `thisArg` if available.
  7201. if (srcBitmask & WRAP_BIND_FLAG) {
  7202. data[2] = source[2];
  7203. // Set when currying a bound function.
  7204. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7205. }
  7206. // Compose partial arguments.
  7207. var value = source[3];
  7208. if (value) {
  7209. var partials = data[3];
  7210. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7211. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7212. }
  7213. // Compose partial right arguments.
  7214. value = source[5];
  7215. if (value) {
  7216. partials = data[5];
  7217. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7218. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7219. }
  7220. // Use source `argPos` if available.
  7221. value = source[7];
  7222. if (value) {
  7223. data[7] = value;
  7224. }
  7225. // Use source `ary` if it's smaller.
  7226. if (srcBitmask & WRAP_ARY_FLAG) {
  7227. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7228. }
  7229. // Use source `arity` if one is not provided.
  7230. if (data[9] == null) {
  7231. data[9] = source[9];
  7232. }
  7233. // Use source `func` and merge bitmasks.
  7234. data[0] = source[0];
  7235. data[1] = newBitmask;
  7236. return data;
  7237. }
  7238. /**
  7239. * This function is like
  7240. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7241. * except that it includes inherited enumerable properties.
  7242. *
  7243. * @private
  7244. * @param {Object} object The object to query.
  7245. * @returns {Array} Returns the array of property names.
  7246. */
  7247. function nativeKeysIn(object) {
  7248. var result = [];
  7249. if (object != null) {
  7250. for (var key in Object(object)) {
  7251. result.push(key);
  7252. }
  7253. }
  7254. return result;
  7255. }
  7256. /**
  7257. * Converts `value` to a string using `Object.prototype.toString`.
  7258. *
  7259. * @private
  7260. * @param {*} value The value to convert.
  7261. * @returns {string} Returns the converted string.
  7262. */
  7263. function objectToString(value) {
  7264. return nativeObjectToString.call(value);
  7265. }
  7266. /**
  7267. * A specialized version of `baseRest` which transforms the rest array.
  7268. *
  7269. * @private
  7270. * @param {Function} func The function to apply a rest parameter to.
  7271. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7272. * @param {Function} transform The rest array transform.
  7273. * @returns {Function} Returns the new function.
  7274. */
  7275. function overRest(func, start, transform) {
  7276. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7277. return function() {
  7278. var args = arguments,
  7279. index = -1,
  7280. length = nativeMax(args.length - start, 0),
  7281. array = Array(length);
  7282. while (++index < length) {
  7283. array[index] = args[start + index];
  7284. }
  7285. index = -1;
  7286. var otherArgs = Array(start + 1);
  7287. while (++index < start) {
  7288. otherArgs[index] = args[index];
  7289. }
  7290. otherArgs[start] = transform(array);
  7291. return apply(func, this, otherArgs);
  7292. };
  7293. }
  7294. /**
  7295. * Gets the parent value at `path` of `object`.
  7296. *
  7297. * @private
  7298. * @param {Object} object The object to query.
  7299. * @param {Array} path The path to get the parent value of.
  7300. * @returns {*} Returns the parent value.
  7301. */
  7302. function parent(object, path) {
  7303. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7304. }
  7305. /**
  7306. * Reorder `array` according to the specified indexes where the element at
  7307. * the first index is assigned as the first element, the element at
  7308. * the second index is assigned as the second element, and so on.
  7309. *
  7310. * @private
  7311. * @param {Array} array The array to reorder.
  7312. * @param {Array} indexes The arranged array indexes.
  7313. * @returns {Array} Returns `array`.
  7314. */
  7315. function reorder(array, indexes) {
  7316. var arrLength = array.length,
  7317. length = nativeMin(indexes.length, arrLength),
  7318. oldArray = copyArray(array);
  7319. while (length--) {
  7320. var index = indexes[length];
  7321. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7322. }
  7323. return array;
  7324. }
  7325. /**
  7326. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7327. *
  7328. * @private
  7329. * @param {Object} object The object to query.
  7330. * @param {string} key The key of the property to get.
  7331. * @returns {*} Returns the property value.
  7332. */
  7333. function safeGet(object, key) {
  7334. if (key === 'constructor' && typeof object[key] === 'function') {
  7335. return;
  7336. }
  7337. if (key == '__proto__') {
  7338. return;
  7339. }
  7340. return object[key];
  7341. }
  7342. /**
  7343. * Sets metadata for `func`.
  7344. *
  7345. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7346. * period of time, it will trip its breaker and transition to an identity
  7347. * function to avoid garbage collection pauses in V8. See
  7348. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7349. * for more details.
  7350. *
  7351. * @private
  7352. * @param {Function} func The function to associate metadata with.
  7353. * @param {*} data The metadata.
  7354. * @returns {Function} Returns `func`.
  7355. */
  7356. var setData = shortOut(baseSetData);
  7357. /**
  7358. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7359. *
  7360. * @private
  7361. * @param {Function} func The function to delay.
  7362. * @param {number} wait The number of milliseconds to delay invocation.
  7363. * @returns {number|Object} Returns the timer id or timeout object.
  7364. */
  7365. var setTimeout = ctxSetTimeout || function(func, wait) {
  7366. return root.setTimeout(func, wait);
  7367. };
  7368. /**
  7369. * Sets the `toString` method of `func` to return `string`.
  7370. *
  7371. * @private
  7372. * @param {Function} func The function to modify.
  7373. * @param {Function} string The `toString` result.
  7374. * @returns {Function} Returns `func`.
  7375. */
  7376. var setToString = shortOut(baseSetToString);
  7377. /**
  7378. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7379. * with wrapper details in a comment at the top of the source body.
  7380. *
  7381. * @private
  7382. * @param {Function} wrapper The function to modify.
  7383. * @param {Function} reference The reference function.
  7384. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7385. * @returns {Function} Returns `wrapper`.
  7386. */
  7387. function setWrapToString(wrapper, reference, bitmask) {
  7388. var source = (reference + '');
  7389. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7390. }
  7391. /**
  7392. * Creates a function that'll short out and invoke `identity` instead
  7393. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7394. * milliseconds.
  7395. *
  7396. * @private
  7397. * @param {Function} func The function to restrict.
  7398. * @returns {Function} Returns the new shortable function.
  7399. */
  7400. function shortOut(func) {
  7401. var count = 0,
  7402. lastCalled = 0;
  7403. return function() {
  7404. var stamp = nativeNow(),
  7405. remaining = HOT_SPAN - (stamp - lastCalled);
  7406. lastCalled = stamp;
  7407. if (remaining > 0) {
  7408. if (++count >= HOT_COUNT) {
  7409. return arguments[0];
  7410. }
  7411. } else {
  7412. count = 0;
  7413. }
  7414. return func.apply(undefined, arguments);
  7415. };
  7416. }
  7417. /**
  7418. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7419. *
  7420. * @private
  7421. * @param {Array} array The array to shuffle.
  7422. * @param {number} [size=array.length] The size of `array`.
  7423. * @returns {Array} Returns `array`.
  7424. */
  7425. function shuffleSelf(array, size) {
  7426. var index = -1,
  7427. length = array.length,
  7428. lastIndex = length - 1;
  7429. size = size === undefined ? length : size;
  7430. while (++index < size) {
  7431. var rand = baseRandom(index, lastIndex),
  7432. value = array[rand];
  7433. array[rand] = array[index];
  7434. array[index] = value;
  7435. }
  7436. array.length = size;
  7437. return array;
  7438. }
  7439. /**
  7440. * Converts `string` to a property path array.
  7441. *
  7442. * @private
  7443. * @param {string} string The string to convert.
  7444. * @returns {Array} Returns the property path array.
  7445. */
  7446. var stringToPath = memoizeCapped(function(string) {
  7447. var result = [];
  7448. if (string.charCodeAt(0) === 46 /* . */) {
  7449. result.push('');
  7450. }
  7451. string.replace(rePropName, function(match, number, quote, subString) {
  7452. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7453. });
  7454. return result;
  7455. });
  7456. /**
  7457. * Converts `value` to a string key if it's not a string or symbol.
  7458. *
  7459. * @private
  7460. * @param {*} value The value to inspect.
  7461. * @returns {string|symbol} Returns the key.
  7462. */
  7463. function toKey(value) {
  7464. if (typeof value == 'string' || isSymbol(value)) {
  7465. return value;
  7466. }
  7467. var result = (value + '');
  7468. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7469. }
  7470. /**
  7471. * Converts `func` to its source code.
  7472. *
  7473. * @private
  7474. * @param {Function} func The function to convert.
  7475. * @returns {string} Returns the source code.
  7476. */
  7477. function toSource(func) {
  7478. if (func != null) {
  7479. try {
  7480. return funcToString.call(func);
  7481. } catch (e) {}
  7482. try {
  7483. return (func + '');
  7484. } catch (e) {}
  7485. }
  7486. return '';
  7487. }
  7488. /**
  7489. * Updates wrapper `details` based on `bitmask` flags.
  7490. *
  7491. * @private
  7492. * @returns {Array} details The details to modify.
  7493. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7494. * @returns {Array} Returns `details`.
  7495. */
  7496. function updateWrapDetails(details, bitmask) {
  7497. arrayEach(wrapFlags, function(pair) {
  7498. var value = '_.' + pair[0];
  7499. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7500. details.push(value);
  7501. }
  7502. });
  7503. return details.sort();
  7504. }
  7505. /**
  7506. * Creates a clone of `wrapper`.
  7507. *
  7508. * @private
  7509. * @param {Object} wrapper The wrapper to clone.
  7510. * @returns {Object} Returns the cloned wrapper.
  7511. */
  7512. function wrapperClone(wrapper) {
  7513. if (wrapper instanceof LazyWrapper) {
  7514. return wrapper.clone();
  7515. }
  7516. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7517. result.__actions__ = copyArray(wrapper.__actions__);
  7518. result.__index__ = wrapper.__index__;
  7519. result.__values__ = wrapper.__values__;
  7520. return result;
  7521. }
  7522. /*------------------------------------------------------------------------*/
  7523. /**
  7524. * Creates an array of elements split into groups the length of `size`.
  7525. * If `array` can't be split evenly, the final chunk will be the remaining
  7526. * elements.
  7527. *
  7528. * @static
  7529. * @memberOf _
  7530. * @since 3.0.0
  7531. * @category Array
  7532. * @param {Array} array The array to process.
  7533. * @param {number} [size=1] The length of each chunk
  7534. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7535. * @returns {Array} Returns the new array of chunks.
  7536. * @example
  7537. *
  7538. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7539. * // => [['a', 'b'], ['c', 'd']]
  7540. *
  7541. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7542. * // => [['a', 'b', 'c'], ['d']]
  7543. */
  7544. function chunk(array, size, guard) {
  7545. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7546. size = 1;
  7547. } else {
  7548. size = nativeMax(toInteger(size), 0);
  7549. }
  7550. var length = array == null ? 0 : array.length;
  7551. if (!length || size < 1) {
  7552. return [];
  7553. }
  7554. var index = 0,
  7555. resIndex = 0,
  7556. result = Array(nativeCeil(length / size));
  7557. while (index < length) {
  7558. result[resIndex++] = baseSlice(array, index, (index += size));
  7559. }
  7560. return result;
  7561. }
  7562. /**
  7563. * Creates an array with all falsey values removed. The values `false`, `null`,
  7564. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7565. *
  7566. * @static
  7567. * @memberOf _
  7568. * @since 0.1.0
  7569. * @category Array
  7570. * @param {Array} array The array to compact.
  7571. * @returns {Array} Returns the new array of filtered values.
  7572. * @example
  7573. *
  7574. * _.compact([0, 1, false, 2, '', 3]);
  7575. * // => [1, 2, 3]
  7576. */
  7577. function compact(array) {
  7578. var index = -1,
  7579. length = array == null ? 0 : array.length,
  7580. resIndex = 0,
  7581. result = [];
  7582. while (++index < length) {
  7583. var value = array[index];
  7584. if (value) {
  7585. result[resIndex++] = value;
  7586. }
  7587. }
  7588. return result;
  7589. }
  7590. /**
  7591. * Creates a new array concatenating `array` with any additional arrays
  7592. * and/or values.
  7593. *
  7594. * @static
  7595. * @memberOf _
  7596. * @since 4.0.0
  7597. * @category Array
  7598. * @param {Array} array The array to concatenate.
  7599. * @param {...*} [values] The values to concatenate.
  7600. * @returns {Array} Returns the new concatenated array.
  7601. * @example
  7602. *
  7603. * var array = [1];
  7604. * var other = _.concat(array, 2, [3], [[4]]);
  7605. *
  7606. * console.log(other);
  7607. * // => [1, 2, 3, [4]]
  7608. *
  7609. * console.log(array);
  7610. * // => [1]
  7611. */
  7612. function concat() {
  7613. var length = arguments.length;
  7614. if (!length) {
  7615. return [];
  7616. }
  7617. var args = Array(length - 1),
  7618. array = arguments[0],
  7619. index = length;
  7620. while (index--) {
  7621. args[index - 1] = arguments[index];
  7622. }
  7623. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7624. }
  7625. /**
  7626. * Creates an array of `array` values not included in the other given arrays
  7627. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7628. * for equality comparisons. The order and references of result values are
  7629. * determined by the first array.
  7630. *
  7631. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7632. *
  7633. * @static
  7634. * @memberOf _
  7635. * @since 0.1.0
  7636. * @category Array
  7637. * @param {Array} array The array to inspect.
  7638. * @param {...Array} [values] The values to exclude.
  7639. * @returns {Array} Returns the new array of filtered values.
  7640. * @see _.without, _.xor
  7641. * @example
  7642. *
  7643. * _.difference([2, 1], [2, 3]);
  7644. * // => [1]
  7645. */
  7646. var difference = baseRest(function(array, values) {
  7647. return isArrayLikeObject(array)
  7648. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7649. : [];
  7650. });
  7651. /**
  7652. * This method is like `_.difference` except that it accepts `iteratee` which
  7653. * is invoked for each element of `array` and `values` to generate the criterion
  7654. * by which they're compared. The order and references of result values are
  7655. * determined by the first array. The iteratee is invoked with one argument:
  7656. * (value).
  7657. *
  7658. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7659. *
  7660. * @static
  7661. * @memberOf _
  7662. * @since 4.0.0
  7663. * @category Array
  7664. * @param {Array} array The array to inspect.
  7665. * @param {...Array} [values] The values to exclude.
  7666. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7667. * @returns {Array} Returns the new array of filtered values.
  7668. * @example
  7669. *
  7670. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7671. * // => [1.2]
  7672. *
  7673. * // The `_.property` iteratee shorthand.
  7674. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7675. * // => [{ 'x': 2 }]
  7676. */
  7677. var differenceBy = baseRest(function(array, values) {
  7678. var iteratee = last(values);
  7679. if (isArrayLikeObject(iteratee)) {
  7680. iteratee = undefined;
  7681. }
  7682. return isArrayLikeObject(array)
  7683. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7684. : [];
  7685. });
  7686. /**
  7687. * This method is like `_.difference` except that it accepts `comparator`
  7688. * which is invoked to compare elements of `array` to `values`. The order and
  7689. * references of result values are determined by the first array. The comparator
  7690. * is invoked with two arguments: (arrVal, othVal).
  7691. *
  7692. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7693. *
  7694. * @static
  7695. * @memberOf _
  7696. * @since 4.0.0
  7697. * @category Array
  7698. * @param {Array} array The array to inspect.
  7699. * @param {...Array} [values] The values to exclude.
  7700. * @param {Function} [comparator] The comparator invoked per element.
  7701. * @returns {Array} Returns the new array of filtered values.
  7702. * @example
  7703. *
  7704. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7705. *
  7706. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7707. * // => [{ 'x': 2, 'y': 1 }]
  7708. */
  7709. var differenceWith = baseRest(function(array, values) {
  7710. var comparator = last(values);
  7711. if (isArrayLikeObject(comparator)) {
  7712. comparator = undefined;
  7713. }
  7714. return isArrayLikeObject(array)
  7715. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7716. : [];
  7717. });
  7718. /**
  7719. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7720. *
  7721. * @static
  7722. * @memberOf _
  7723. * @since 0.5.0
  7724. * @category Array
  7725. * @param {Array} array The array to query.
  7726. * @param {number} [n=1] The number of elements to drop.
  7727. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7728. * @returns {Array} Returns the slice of `array`.
  7729. * @example
  7730. *
  7731. * _.drop([1, 2, 3]);
  7732. * // => [2, 3]
  7733. *
  7734. * _.drop([1, 2, 3], 2);
  7735. * // => [3]
  7736. *
  7737. * _.drop([1, 2, 3], 5);
  7738. * // => []
  7739. *
  7740. * _.drop([1, 2, 3], 0);
  7741. * // => [1, 2, 3]
  7742. */
  7743. function drop(array, n, guard) {
  7744. var length = array == null ? 0 : array.length;
  7745. if (!length) {
  7746. return [];
  7747. }
  7748. n = (guard || n === undefined) ? 1 : toInteger(n);
  7749. return baseSlice(array, n < 0 ? 0 : n, length);
  7750. }
  7751. /**
  7752. * Creates a slice of `array` with `n` elements dropped from the end.
  7753. *
  7754. * @static
  7755. * @memberOf _
  7756. * @since 3.0.0
  7757. * @category Array
  7758. * @param {Array} array The array to query.
  7759. * @param {number} [n=1] The number of elements to drop.
  7760. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7761. * @returns {Array} Returns the slice of `array`.
  7762. * @example
  7763. *
  7764. * _.dropRight([1, 2, 3]);
  7765. * // => [1, 2]
  7766. *
  7767. * _.dropRight([1, 2, 3], 2);
  7768. * // => [1]
  7769. *
  7770. * _.dropRight([1, 2, 3], 5);
  7771. * // => []
  7772. *
  7773. * _.dropRight([1, 2, 3], 0);
  7774. * // => [1, 2, 3]
  7775. */
  7776. function dropRight(array, n, guard) {
  7777. var length = array == null ? 0 : array.length;
  7778. if (!length) {
  7779. return [];
  7780. }
  7781. n = (guard || n === undefined) ? 1 : toInteger(n);
  7782. n = length - n;
  7783. return baseSlice(array, 0, n < 0 ? 0 : n);
  7784. }
  7785. /**
  7786. * Creates a slice of `array` excluding elements dropped from the end.
  7787. * Elements are dropped until `predicate` returns falsey. The predicate is
  7788. * invoked with three arguments: (value, index, array).
  7789. *
  7790. * @static
  7791. * @memberOf _
  7792. * @since 3.0.0
  7793. * @category Array
  7794. * @param {Array} array The array to query.
  7795. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7796. * @returns {Array} Returns the slice of `array`.
  7797. * @example
  7798. *
  7799. * var users = [
  7800. * { 'user': 'barney', 'active': true },
  7801. * { 'user': 'fred', 'active': false },
  7802. * { 'user': 'pebbles', 'active': false }
  7803. * ];
  7804. *
  7805. * _.dropRightWhile(users, function(o) { return !o.active; });
  7806. * // => objects for ['barney']
  7807. *
  7808. * // The `_.matches` iteratee shorthand.
  7809. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7810. * // => objects for ['barney', 'fred']
  7811. *
  7812. * // The `_.matchesProperty` iteratee shorthand.
  7813. * _.dropRightWhile(users, ['active', false]);
  7814. * // => objects for ['barney']
  7815. *
  7816. * // The `_.property` iteratee shorthand.
  7817. * _.dropRightWhile(users, 'active');
  7818. * // => objects for ['barney', 'fred', 'pebbles']
  7819. */
  7820. function dropRightWhile(array, predicate) {
  7821. return (array && array.length)
  7822. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7823. : [];
  7824. }
  7825. /**
  7826. * Creates a slice of `array` excluding elements dropped from the beginning.
  7827. * Elements are dropped until `predicate` returns falsey. The predicate is
  7828. * invoked with three arguments: (value, index, array).
  7829. *
  7830. * @static
  7831. * @memberOf _
  7832. * @since 3.0.0
  7833. * @category Array
  7834. * @param {Array} array The array to query.
  7835. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7836. * @returns {Array} Returns the slice of `array`.
  7837. * @example
  7838. *
  7839. * var users = [
  7840. * { 'user': 'barney', 'active': false },
  7841. * { 'user': 'fred', 'active': false },
  7842. * { 'user': 'pebbles', 'active': true }
  7843. * ];
  7844. *
  7845. * _.dropWhile(users, function(o) { return !o.active; });
  7846. * // => objects for ['pebbles']
  7847. *
  7848. * // The `_.matches` iteratee shorthand.
  7849. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7850. * // => objects for ['fred', 'pebbles']
  7851. *
  7852. * // The `_.matchesProperty` iteratee shorthand.
  7853. * _.dropWhile(users, ['active', false]);
  7854. * // => objects for ['pebbles']
  7855. *
  7856. * // The `_.property` iteratee shorthand.
  7857. * _.dropWhile(users, 'active');
  7858. * // => objects for ['barney', 'fred', 'pebbles']
  7859. */
  7860. function dropWhile(array, predicate) {
  7861. return (array && array.length)
  7862. ? baseWhile(array, getIteratee(predicate, 3), true)
  7863. : [];
  7864. }
  7865. /**
  7866. * Fills elements of `array` with `value` from `start` up to, but not
  7867. * including, `end`.
  7868. *
  7869. * **Note:** This method mutates `array`.
  7870. *
  7871. * @static
  7872. * @memberOf _
  7873. * @since 3.2.0
  7874. * @category Array
  7875. * @param {Array} array The array to fill.
  7876. * @param {*} value The value to fill `array` with.
  7877. * @param {number} [start=0] The start position.
  7878. * @param {number} [end=array.length] The end position.
  7879. * @returns {Array} Returns `array`.
  7880. * @example
  7881. *
  7882. * var array = [1, 2, 3];
  7883. *
  7884. * _.fill(array, 'a');
  7885. * console.log(array);
  7886. * // => ['a', 'a', 'a']
  7887. *
  7888. * _.fill(Array(3), 2);
  7889. * // => [2, 2, 2]
  7890. *
  7891. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7892. * // => [4, '*', '*', 10]
  7893. */
  7894. function fill(array, value, start, end) {
  7895. var length = array == null ? 0 : array.length;
  7896. if (!length) {
  7897. return [];
  7898. }
  7899. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7900. start = 0;
  7901. end = length;
  7902. }
  7903. return baseFill(array, value, start, end);
  7904. }
  7905. /**
  7906. * This method is like `_.find` except that it returns the index of the first
  7907. * element `predicate` returns truthy for instead of the element itself.
  7908. *
  7909. * @static
  7910. * @memberOf _
  7911. * @since 1.1.0
  7912. * @category Array
  7913. * @param {Array} array The array to inspect.
  7914. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7915. * @param {number} [fromIndex=0] The index to search from.
  7916. * @returns {number} Returns the index of the found element, else `-1`.
  7917. * @example
  7918. *
  7919. * var users = [
  7920. * { 'user': 'barney', 'active': false },
  7921. * { 'user': 'fred', 'active': false },
  7922. * { 'user': 'pebbles', 'active': true }
  7923. * ];
  7924. *
  7925. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7926. * // => 0
  7927. *
  7928. * // The `_.matches` iteratee shorthand.
  7929. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7930. * // => 1
  7931. *
  7932. * // The `_.matchesProperty` iteratee shorthand.
  7933. * _.findIndex(users, ['active', false]);
  7934. * // => 0
  7935. *
  7936. * // The `_.property` iteratee shorthand.
  7937. * _.findIndex(users, 'active');
  7938. * // => 2
  7939. */
  7940. function findIndex(array, predicate, fromIndex) {
  7941. var length = array == null ? 0 : array.length;
  7942. if (!length) {
  7943. return -1;
  7944. }
  7945. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7946. if (index < 0) {
  7947. index = nativeMax(length + index, 0);
  7948. }
  7949. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7950. }
  7951. /**
  7952. * This method is like `_.findIndex` except that it iterates over elements
  7953. * of `collection` from right to left.
  7954. *
  7955. * @static
  7956. * @memberOf _
  7957. * @since 2.0.0
  7958. * @category Array
  7959. * @param {Array} array The array to inspect.
  7960. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7961. * @param {number} [fromIndex=array.length-1] The index to search from.
  7962. * @returns {number} Returns the index of the found element, else `-1`.
  7963. * @example
  7964. *
  7965. * var users = [
  7966. * { 'user': 'barney', 'active': true },
  7967. * { 'user': 'fred', 'active': false },
  7968. * { 'user': 'pebbles', 'active': false }
  7969. * ];
  7970. *
  7971. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7972. * // => 2
  7973. *
  7974. * // The `_.matches` iteratee shorthand.
  7975. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7976. * // => 0
  7977. *
  7978. * // The `_.matchesProperty` iteratee shorthand.
  7979. * _.findLastIndex(users, ['active', false]);
  7980. * // => 2
  7981. *
  7982. * // The `_.property` iteratee shorthand.
  7983. * _.findLastIndex(users, 'active');
  7984. * // => 0
  7985. */
  7986. function findLastIndex(array, predicate, fromIndex) {
  7987. var length = array == null ? 0 : array.length;
  7988. if (!length) {
  7989. return -1;
  7990. }
  7991. var index = length - 1;
  7992. if (fromIndex !== undefined) {
  7993. index = toInteger(fromIndex);
  7994. index = fromIndex < 0
  7995. ? nativeMax(length + index, 0)
  7996. : nativeMin(index, length - 1);
  7997. }
  7998. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7999. }
  8000. /**
  8001. * Flattens `array` a single level deep.
  8002. *
  8003. * @static
  8004. * @memberOf _
  8005. * @since 0.1.0
  8006. * @category Array
  8007. * @param {Array} array The array to flatten.
  8008. * @returns {Array} Returns the new flattened array.
  8009. * @example
  8010. *
  8011. * _.flatten([1, [2, [3, [4]], 5]]);
  8012. * // => [1, 2, [3, [4]], 5]
  8013. */
  8014. function flatten(array) {
  8015. var length = array == null ? 0 : array.length;
  8016. return length ? baseFlatten(array, 1) : [];
  8017. }
  8018. /**
  8019. * Recursively flattens `array`.
  8020. *
  8021. * @static
  8022. * @memberOf _
  8023. * @since 3.0.0
  8024. * @category Array
  8025. * @param {Array} array The array to flatten.
  8026. * @returns {Array} Returns the new flattened array.
  8027. * @example
  8028. *
  8029. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8030. * // => [1, 2, 3, 4, 5]
  8031. */
  8032. function flattenDeep(array) {
  8033. var length = array == null ? 0 : array.length;
  8034. return length ? baseFlatten(array, INFINITY) : [];
  8035. }
  8036. /**
  8037. * Recursively flatten `array` up to `depth` times.
  8038. *
  8039. * @static
  8040. * @memberOf _
  8041. * @since 4.4.0
  8042. * @category Array
  8043. * @param {Array} array The array to flatten.
  8044. * @param {number} [depth=1] The maximum recursion depth.
  8045. * @returns {Array} Returns the new flattened array.
  8046. * @example
  8047. *
  8048. * var array = [1, [2, [3, [4]], 5]];
  8049. *
  8050. * _.flattenDepth(array, 1);
  8051. * // => [1, 2, [3, [4]], 5]
  8052. *
  8053. * _.flattenDepth(array, 2);
  8054. * // => [1, 2, 3, [4], 5]
  8055. */
  8056. function flattenDepth(array, depth) {
  8057. var length = array == null ? 0 : array.length;
  8058. if (!length) {
  8059. return [];
  8060. }
  8061. depth = depth === undefined ? 1 : toInteger(depth);
  8062. return baseFlatten(array, depth);
  8063. }
  8064. /**
  8065. * The inverse of `_.toPairs`; this method returns an object composed
  8066. * from key-value `pairs`.
  8067. *
  8068. * @static
  8069. * @memberOf _
  8070. * @since 4.0.0
  8071. * @category Array
  8072. * @param {Array} pairs The key-value pairs.
  8073. * @returns {Object} Returns the new object.
  8074. * @example
  8075. *
  8076. * _.fromPairs([['a', 1], ['b', 2]]);
  8077. * // => { 'a': 1, 'b': 2 }
  8078. */
  8079. function fromPairs(pairs) {
  8080. var index = -1,
  8081. length = pairs == null ? 0 : pairs.length,
  8082. result = {};
  8083. while (++index < length) {
  8084. var pair = pairs[index];
  8085. result[pair[0]] = pair[1];
  8086. }
  8087. return result;
  8088. }
  8089. /**
  8090. * Gets the first element of `array`.
  8091. *
  8092. * @static
  8093. * @memberOf _
  8094. * @since 0.1.0
  8095. * @alias first
  8096. * @category Array
  8097. * @param {Array} array The array to query.
  8098. * @returns {*} Returns the first element of `array`.
  8099. * @example
  8100. *
  8101. * _.head([1, 2, 3]);
  8102. * // => 1
  8103. *
  8104. * _.head([]);
  8105. * // => undefined
  8106. */
  8107. function head(array) {
  8108. return (array && array.length) ? array[0] : undefined;
  8109. }
  8110. /**
  8111. * Gets the index at which the first occurrence of `value` is found in `array`
  8112. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8113. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8114. * offset from the end of `array`.
  8115. *
  8116. * @static
  8117. * @memberOf _
  8118. * @since 0.1.0
  8119. * @category Array
  8120. * @param {Array} array The array to inspect.
  8121. * @param {*} value The value to search for.
  8122. * @param {number} [fromIndex=0] The index to search from.
  8123. * @returns {number} Returns the index of the matched value, else `-1`.
  8124. * @example
  8125. *
  8126. * _.indexOf([1, 2, 1, 2], 2);
  8127. * // => 1
  8128. *
  8129. * // Search from the `fromIndex`.
  8130. * _.indexOf([1, 2, 1, 2], 2, 2);
  8131. * // => 3
  8132. */
  8133. function indexOf(array, value, fromIndex) {
  8134. var length = array == null ? 0 : array.length;
  8135. if (!length) {
  8136. return -1;
  8137. }
  8138. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8139. if (index < 0) {
  8140. index = nativeMax(length + index, 0);
  8141. }
  8142. return baseIndexOf(array, value, index);
  8143. }
  8144. /**
  8145. * Gets all but the last element of `array`.
  8146. *
  8147. * @static
  8148. * @memberOf _
  8149. * @since 0.1.0
  8150. * @category Array
  8151. * @param {Array} array The array to query.
  8152. * @returns {Array} Returns the slice of `array`.
  8153. * @example
  8154. *
  8155. * _.initial([1, 2, 3]);
  8156. * // => [1, 2]
  8157. */
  8158. function initial(array) {
  8159. var length = array == null ? 0 : array.length;
  8160. return length ? baseSlice(array, 0, -1) : [];
  8161. }
  8162. /**
  8163. * Creates an array of unique values that are included in all given arrays
  8164. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8165. * for equality comparisons. The order and references of result values are
  8166. * determined by the first array.
  8167. *
  8168. * @static
  8169. * @memberOf _
  8170. * @since 0.1.0
  8171. * @category Array
  8172. * @param {...Array} [arrays] The arrays to inspect.
  8173. * @returns {Array} Returns the new array of intersecting values.
  8174. * @example
  8175. *
  8176. * _.intersection([2, 1], [2, 3]);
  8177. * // => [2]
  8178. */
  8179. var intersection = baseRest(function(arrays) {
  8180. var mapped = arrayMap(arrays, castArrayLikeObject);
  8181. return (mapped.length && mapped[0] === arrays[0])
  8182. ? baseIntersection(mapped)
  8183. : [];
  8184. });
  8185. /**
  8186. * This method is like `_.intersection` except that it accepts `iteratee`
  8187. * which is invoked for each element of each `arrays` to generate the criterion
  8188. * by which they're compared. The order and references of result values are
  8189. * determined by the first array. The iteratee is invoked with one argument:
  8190. * (value).
  8191. *
  8192. * @static
  8193. * @memberOf _
  8194. * @since 4.0.0
  8195. * @category Array
  8196. * @param {...Array} [arrays] The arrays to inspect.
  8197. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8198. * @returns {Array} Returns the new array of intersecting values.
  8199. * @example
  8200. *
  8201. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8202. * // => [2.1]
  8203. *
  8204. * // The `_.property` iteratee shorthand.
  8205. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8206. * // => [{ 'x': 1 }]
  8207. */
  8208. var intersectionBy = baseRest(function(arrays) {
  8209. var iteratee = last(arrays),
  8210. mapped = arrayMap(arrays, castArrayLikeObject);
  8211. if (iteratee === last(mapped)) {
  8212. iteratee = undefined;
  8213. } else {
  8214. mapped.pop();
  8215. }
  8216. return (mapped.length && mapped[0] === arrays[0])
  8217. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8218. : [];
  8219. });
  8220. /**
  8221. * This method is like `_.intersection` except that it accepts `comparator`
  8222. * which is invoked to compare elements of `arrays`. The order and references
  8223. * of result values are determined by the first array. The comparator is
  8224. * invoked with two arguments: (arrVal, othVal).
  8225. *
  8226. * @static
  8227. * @memberOf _
  8228. * @since 4.0.0
  8229. * @category Array
  8230. * @param {...Array} [arrays] The arrays to inspect.
  8231. * @param {Function} [comparator] The comparator invoked per element.
  8232. * @returns {Array} Returns the new array of intersecting values.
  8233. * @example
  8234. *
  8235. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8236. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8237. *
  8238. * _.intersectionWith(objects, others, _.isEqual);
  8239. * // => [{ 'x': 1, 'y': 2 }]
  8240. */
  8241. var intersectionWith = baseRest(function(arrays) {
  8242. var comparator = last(arrays),
  8243. mapped = arrayMap(arrays, castArrayLikeObject);
  8244. comparator = typeof comparator == 'function' ? comparator : undefined;
  8245. if (comparator) {
  8246. mapped.pop();
  8247. }
  8248. return (mapped.length && mapped[0] === arrays[0])
  8249. ? baseIntersection(mapped, undefined, comparator)
  8250. : [];
  8251. });
  8252. /**
  8253. * Converts all elements in `array` into a string separated by `separator`.
  8254. *
  8255. * @static
  8256. * @memberOf _
  8257. * @since 4.0.0
  8258. * @category Array
  8259. * @param {Array} array The array to convert.
  8260. * @param {string} [separator=','] The element separator.
  8261. * @returns {string} Returns the joined string.
  8262. * @example
  8263. *
  8264. * _.join(['a', 'b', 'c'], '~');
  8265. * // => 'a~b~c'
  8266. */
  8267. function join(array, separator) {
  8268. return array == null ? '' : nativeJoin.call(array, separator);
  8269. }
  8270. /**
  8271. * Gets the last element of `array`.
  8272. *
  8273. * @static
  8274. * @memberOf _
  8275. * @since 0.1.0
  8276. * @category Array
  8277. * @param {Array} array The array to query.
  8278. * @returns {*} Returns the last element of `array`.
  8279. * @example
  8280. *
  8281. * _.last([1, 2, 3]);
  8282. * // => 3
  8283. */
  8284. function last(array) {
  8285. var length = array == null ? 0 : array.length;
  8286. return length ? array[length - 1] : undefined;
  8287. }
  8288. /**
  8289. * This method is like `_.indexOf` except that it iterates over elements of
  8290. * `array` from right to left.
  8291. *
  8292. * @static
  8293. * @memberOf _
  8294. * @since 0.1.0
  8295. * @category Array
  8296. * @param {Array} array The array to inspect.
  8297. * @param {*} value The value to search for.
  8298. * @param {number} [fromIndex=array.length-1] The index to search from.
  8299. * @returns {number} Returns the index of the matched value, else `-1`.
  8300. * @example
  8301. *
  8302. * _.lastIndexOf([1, 2, 1, 2], 2);
  8303. * // => 3
  8304. *
  8305. * // Search from the `fromIndex`.
  8306. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8307. * // => 1
  8308. */
  8309. function lastIndexOf(array, value, fromIndex) {
  8310. var length = array == null ? 0 : array.length;
  8311. if (!length) {
  8312. return -1;
  8313. }
  8314. var index = length;
  8315. if (fromIndex !== undefined) {
  8316. index = toInteger(fromIndex);
  8317. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8318. }
  8319. return value === value
  8320. ? strictLastIndexOf(array, value, index)
  8321. : baseFindIndex(array, baseIsNaN, index, true);
  8322. }
  8323. /**
  8324. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8325. * element from the end is returned.
  8326. *
  8327. * @static
  8328. * @memberOf _
  8329. * @since 4.11.0
  8330. * @category Array
  8331. * @param {Array} array The array to query.
  8332. * @param {number} [n=0] The index of the element to return.
  8333. * @returns {*} Returns the nth element of `array`.
  8334. * @example
  8335. *
  8336. * var array = ['a', 'b', 'c', 'd'];
  8337. *
  8338. * _.nth(array, 1);
  8339. * // => 'b'
  8340. *
  8341. * _.nth(array, -2);
  8342. * // => 'c';
  8343. */
  8344. function nth(array, n) {
  8345. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8346. }
  8347. /**
  8348. * Removes all given values from `array` using
  8349. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8350. * for equality comparisons.
  8351. *
  8352. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8353. * to remove elements from an array by predicate.
  8354. *
  8355. * @static
  8356. * @memberOf _
  8357. * @since 2.0.0
  8358. * @category Array
  8359. * @param {Array} array The array to modify.
  8360. * @param {...*} [values] The values to remove.
  8361. * @returns {Array} Returns `array`.
  8362. * @example
  8363. *
  8364. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8365. *
  8366. * _.pull(array, 'a', 'c');
  8367. * console.log(array);
  8368. * // => ['b', 'b']
  8369. */
  8370. var pull = baseRest(pullAll);
  8371. /**
  8372. * This method is like `_.pull` except that it accepts an array of values to remove.
  8373. *
  8374. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8375. *
  8376. * @static
  8377. * @memberOf _
  8378. * @since 4.0.0
  8379. * @category Array
  8380. * @param {Array} array The array to modify.
  8381. * @param {Array} values The values to remove.
  8382. * @returns {Array} Returns `array`.
  8383. * @example
  8384. *
  8385. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8386. *
  8387. * _.pullAll(array, ['a', 'c']);
  8388. * console.log(array);
  8389. * // => ['b', 'b']
  8390. */
  8391. function pullAll(array, values) {
  8392. return (array && array.length && values && values.length)
  8393. ? basePullAll(array, values)
  8394. : array;
  8395. }
  8396. /**
  8397. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8398. * invoked for each element of `array` and `values` to generate the criterion
  8399. * by which they're compared. The iteratee is invoked with one argument: (value).
  8400. *
  8401. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8402. *
  8403. * @static
  8404. * @memberOf _
  8405. * @since 4.0.0
  8406. * @category Array
  8407. * @param {Array} array The array to modify.
  8408. * @param {Array} values The values to remove.
  8409. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8410. * @returns {Array} Returns `array`.
  8411. * @example
  8412. *
  8413. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8414. *
  8415. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8416. * console.log(array);
  8417. * // => [{ 'x': 2 }]
  8418. */
  8419. function pullAllBy(array, values, iteratee) {
  8420. return (array && array.length && values && values.length)
  8421. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8422. : array;
  8423. }
  8424. /**
  8425. * This method is like `_.pullAll` except that it accepts `comparator` which
  8426. * is invoked to compare elements of `array` to `values`. The comparator is
  8427. * invoked with two arguments: (arrVal, othVal).
  8428. *
  8429. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8430. *
  8431. * @static
  8432. * @memberOf _
  8433. * @since 4.6.0
  8434. * @category Array
  8435. * @param {Array} array The array to modify.
  8436. * @param {Array} values The values to remove.
  8437. * @param {Function} [comparator] The comparator invoked per element.
  8438. * @returns {Array} Returns `array`.
  8439. * @example
  8440. *
  8441. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8442. *
  8443. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8444. * console.log(array);
  8445. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8446. */
  8447. function pullAllWith(array, values, comparator) {
  8448. return (array && array.length && values && values.length)
  8449. ? basePullAll(array, values, undefined, comparator)
  8450. : array;
  8451. }
  8452. /**
  8453. * Removes elements from `array` corresponding to `indexes` and returns an
  8454. * array of removed elements.
  8455. *
  8456. * **Note:** Unlike `_.at`, this method mutates `array`.
  8457. *
  8458. * @static
  8459. * @memberOf _
  8460. * @since 3.0.0
  8461. * @category Array
  8462. * @param {Array} array The array to modify.
  8463. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8464. * @returns {Array} Returns the new array of removed elements.
  8465. * @example
  8466. *
  8467. * var array = ['a', 'b', 'c', 'd'];
  8468. * var pulled = _.pullAt(array, [1, 3]);
  8469. *
  8470. * console.log(array);
  8471. * // => ['a', 'c']
  8472. *
  8473. * console.log(pulled);
  8474. * // => ['b', 'd']
  8475. */
  8476. var pullAt = flatRest(function(array, indexes) {
  8477. var length = array == null ? 0 : array.length,
  8478. result = baseAt(array, indexes);
  8479. basePullAt(array, arrayMap(indexes, function(index) {
  8480. return isIndex(index, length) ? +index : index;
  8481. }).sort(compareAscending));
  8482. return result;
  8483. });
  8484. /**
  8485. * Removes all elements from `array` that `predicate` returns truthy for
  8486. * and returns an array of the removed elements. The predicate is invoked
  8487. * with three arguments: (value, index, array).
  8488. *
  8489. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8490. * to pull elements from an array by value.
  8491. *
  8492. * @static
  8493. * @memberOf _
  8494. * @since 2.0.0
  8495. * @category Array
  8496. * @param {Array} array The array to modify.
  8497. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8498. * @returns {Array} Returns the new array of removed elements.
  8499. * @example
  8500. *
  8501. * var array = [1, 2, 3, 4];
  8502. * var evens = _.remove(array, function(n) {
  8503. * return n % 2 == 0;
  8504. * });
  8505. *
  8506. * console.log(array);
  8507. * // => [1, 3]
  8508. *
  8509. * console.log(evens);
  8510. * // => [2, 4]
  8511. */
  8512. function remove(array, predicate) {
  8513. var result = [];
  8514. if (!(array && array.length)) {
  8515. return result;
  8516. }
  8517. var index = -1,
  8518. indexes = [],
  8519. length = array.length;
  8520. predicate = getIteratee(predicate, 3);
  8521. while (++index < length) {
  8522. var value = array[index];
  8523. if (predicate(value, index, array)) {
  8524. result.push(value);
  8525. indexes.push(index);
  8526. }
  8527. }
  8528. basePullAt(array, indexes);
  8529. return result;
  8530. }
  8531. /**
  8532. * Reverses `array` so that the first element becomes the last, the second
  8533. * element becomes the second to last, and so on.
  8534. *
  8535. * **Note:** This method mutates `array` and is based on
  8536. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8537. *
  8538. * @static
  8539. * @memberOf _
  8540. * @since 4.0.0
  8541. * @category Array
  8542. * @param {Array} array The array to modify.
  8543. * @returns {Array} Returns `array`.
  8544. * @example
  8545. *
  8546. * var array = [1, 2, 3];
  8547. *
  8548. * _.reverse(array);
  8549. * // => [3, 2, 1]
  8550. *
  8551. * console.log(array);
  8552. * // => [3, 2, 1]
  8553. */
  8554. function reverse(array) {
  8555. return array == null ? array : nativeReverse.call(array);
  8556. }
  8557. /**
  8558. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8559. *
  8560. * **Note:** This method is used instead of
  8561. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8562. * returned.
  8563. *
  8564. * @static
  8565. * @memberOf _
  8566. * @since 3.0.0
  8567. * @category Array
  8568. * @param {Array} array The array to slice.
  8569. * @param {number} [start=0] The start position.
  8570. * @param {number} [end=array.length] The end position.
  8571. * @returns {Array} Returns the slice of `array`.
  8572. */
  8573. function slice(array, start, end) {
  8574. var length = array == null ? 0 : array.length;
  8575. if (!length) {
  8576. return [];
  8577. }
  8578. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8579. start = 0;
  8580. end = length;
  8581. }
  8582. else {
  8583. start = start == null ? 0 : toInteger(start);
  8584. end = end === undefined ? length : toInteger(end);
  8585. }
  8586. return baseSlice(array, start, end);
  8587. }
  8588. /**
  8589. * Uses a binary search to determine the lowest index at which `value`
  8590. * should be inserted into `array` in order to maintain its sort order.
  8591. *
  8592. * @static
  8593. * @memberOf _
  8594. * @since 0.1.0
  8595. * @category Array
  8596. * @param {Array} array The sorted array to inspect.
  8597. * @param {*} value The value to evaluate.
  8598. * @returns {number} Returns the index at which `value` should be inserted
  8599. * into `array`.
  8600. * @example
  8601. *
  8602. * _.sortedIndex([30, 50], 40);
  8603. * // => 1
  8604. */
  8605. function sortedIndex(array, value) {
  8606. return baseSortedIndex(array, value);
  8607. }
  8608. /**
  8609. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8610. * which is invoked for `value` and each element of `array` to compute their
  8611. * sort ranking. The iteratee is invoked with one argument: (value).
  8612. *
  8613. * @static
  8614. * @memberOf _
  8615. * @since 4.0.0
  8616. * @category Array
  8617. * @param {Array} array The sorted array to inspect.
  8618. * @param {*} value The value to evaluate.
  8619. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8620. * @returns {number} Returns the index at which `value` should be inserted
  8621. * into `array`.
  8622. * @example
  8623. *
  8624. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8625. *
  8626. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8627. * // => 0
  8628. *
  8629. * // The `_.property` iteratee shorthand.
  8630. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8631. * // => 0
  8632. */
  8633. function sortedIndexBy(array, value, iteratee) {
  8634. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8635. }
  8636. /**
  8637. * This method is like `_.indexOf` except that it performs a binary
  8638. * search on a sorted `array`.
  8639. *
  8640. * @static
  8641. * @memberOf _
  8642. * @since 4.0.0
  8643. * @category Array
  8644. * @param {Array} array The array to inspect.
  8645. * @param {*} value The value to search for.
  8646. * @returns {number} Returns the index of the matched value, else `-1`.
  8647. * @example
  8648. *
  8649. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8650. * // => 1
  8651. */
  8652. function sortedIndexOf(array, value) {
  8653. var length = array == null ? 0 : array.length;
  8654. if (length) {
  8655. var index = baseSortedIndex(array, value);
  8656. if (index < length && eq(array[index], value)) {
  8657. return index;
  8658. }
  8659. }
  8660. return -1;
  8661. }
  8662. /**
  8663. * This method is like `_.sortedIndex` except that it returns the highest
  8664. * index at which `value` should be inserted into `array` in order to
  8665. * maintain its sort order.
  8666. *
  8667. * @static
  8668. * @memberOf _
  8669. * @since 3.0.0
  8670. * @category Array
  8671. * @param {Array} array The sorted array to inspect.
  8672. * @param {*} value The value to evaluate.
  8673. * @returns {number} Returns the index at which `value` should be inserted
  8674. * into `array`.
  8675. * @example
  8676. *
  8677. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8678. * // => 4
  8679. */
  8680. function sortedLastIndex(array, value) {
  8681. return baseSortedIndex(array, value, true);
  8682. }
  8683. /**
  8684. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8685. * which is invoked for `value` and each element of `array` to compute their
  8686. * sort ranking. The iteratee is invoked with one argument: (value).
  8687. *
  8688. * @static
  8689. * @memberOf _
  8690. * @since 4.0.0
  8691. * @category Array
  8692. * @param {Array} array The sorted array to inspect.
  8693. * @param {*} value The value to evaluate.
  8694. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8695. * @returns {number} Returns the index at which `value` should be inserted
  8696. * into `array`.
  8697. * @example
  8698. *
  8699. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8700. *
  8701. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8702. * // => 1
  8703. *
  8704. * // The `_.property` iteratee shorthand.
  8705. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8706. * // => 1
  8707. */
  8708. function sortedLastIndexBy(array, value, iteratee) {
  8709. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8710. }
  8711. /**
  8712. * This method is like `_.lastIndexOf` except that it performs a binary
  8713. * search on a sorted `array`.
  8714. *
  8715. * @static
  8716. * @memberOf _
  8717. * @since 4.0.0
  8718. * @category Array
  8719. * @param {Array} array The array to inspect.
  8720. * @param {*} value The value to search for.
  8721. * @returns {number} Returns the index of the matched value, else `-1`.
  8722. * @example
  8723. *
  8724. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8725. * // => 3
  8726. */
  8727. function sortedLastIndexOf(array, value) {
  8728. var length = array == null ? 0 : array.length;
  8729. if (length) {
  8730. var index = baseSortedIndex(array, value, true) - 1;
  8731. if (eq(array[index], value)) {
  8732. return index;
  8733. }
  8734. }
  8735. return -1;
  8736. }
  8737. /**
  8738. * This method is like `_.uniq` except that it's designed and optimized
  8739. * for sorted arrays.
  8740. *
  8741. * @static
  8742. * @memberOf _
  8743. * @since 4.0.0
  8744. * @category Array
  8745. * @param {Array} array The array to inspect.
  8746. * @returns {Array} Returns the new duplicate free array.
  8747. * @example
  8748. *
  8749. * _.sortedUniq([1, 1, 2]);
  8750. * // => [1, 2]
  8751. */
  8752. function sortedUniq(array) {
  8753. return (array && array.length)
  8754. ? baseSortedUniq(array)
  8755. : [];
  8756. }
  8757. /**
  8758. * This method is like `_.uniqBy` except that it's designed and optimized
  8759. * for sorted arrays.
  8760. *
  8761. * @static
  8762. * @memberOf _
  8763. * @since 4.0.0
  8764. * @category Array
  8765. * @param {Array} array The array to inspect.
  8766. * @param {Function} [iteratee] The iteratee invoked per element.
  8767. * @returns {Array} Returns the new duplicate free array.
  8768. * @example
  8769. *
  8770. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8771. * // => [1.1, 2.3]
  8772. */
  8773. function sortedUniqBy(array, iteratee) {
  8774. return (array && array.length)
  8775. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8776. : [];
  8777. }
  8778. /**
  8779. * Gets all but the first element of `array`.
  8780. *
  8781. * @static
  8782. * @memberOf _
  8783. * @since 4.0.0
  8784. * @category Array
  8785. * @param {Array} array The array to query.
  8786. * @returns {Array} Returns the slice of `array`.
  8787. * @example
  8788. *
  8789. * _.tail([1, 2, 3]);
  8790. * // => [2, 3]
  8791. */
  8792. function tail(array) {
  8793. var length = array == null ? 0 : array.length;
  8794. return length ? baseSlice(array, 1, length) : [];
  8795. }
  8796. /**
  8797. * Creates a slice of `array` with `n` elements taken from the beginning.
  8798. *
  8799. * @static
  8800. * @memberOf _
  8801. * @since 0.1.0
  8802. * @category Array
  8803. * @param {Array} array The array to query.
  8804. * @param {number} [n=1] The number of elements to take.
  8805. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8806. * @returns {Array} Returns the slice of `array`.
  8807. * @example
  8808. *
  8809. * _.take([1, 2, 3]);
  8810. * // => [1]
  8811. *
  8812. * _.take([1, 2, 3], 2);
  8813. * // => [1, 2]
  8814. *
  8815. * _.take([1, 2, 3], 5);
  8816. * // => [1, 2, 3]
  8817. *
  8818. * _.take([1, 2, 3], 0);
  8819. * // => []
  8820. */
  8821. function take(array, n, guard) {
  8822. if (!(array && array.length)) {
  8823. return [];
  8824. }
  8825. n = (guard || n === undefined) ? 1 : toInteger(n);
  8826. return baseSlice(array, 0, n < 0 ? 0 : n);
  8827. }
  8828. /**
  8829. * Creates a slice of `array` with `n` elements taken from the end.
  8830. *
  8831. * @static
  8832. * @memberOf _
  8833. * @since 3.0.0
  8834. * @category Array
  8835. * @param {Array} array The array to query.
  8836. * @param {number} [n=1] The number of elements to take.
  8837. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8838. * @returns {Array} Returns the slice of `array`.
  8839. * @example
  8840. *
  8841. * _.takeRight([1, 2, 3]);
  8842. * // => [3]
  8843. *
  8844. * _.takeRight([1, 2, 3], 2);
  8845. * // => [2, 3]
  8846. *
  8847. * _.takeRight([1, 2, 3], 5);
  8848. * // => [1, 2, 3]
  8849. *
  8850. * _.takeRight([1, 2, 3], 0);
  8851. * // => []
  8852. */
  8853. function takeRight(array, n, guard) {
  8854. var length = array == null ? 0 : array.length;
  8855. if (!length) {
  8856. return [];
  8857. }
  8858. n = (guard || n === undefined) ? 1 : toInteger(n);
  8859. n = length - n;
  8860. return baseSlice(array, n < 0 ? 0 : n, length);
  8861. }
  8862. /**
  8863. * Creates a slice of `array` with elements taken from the end. Elements are
  8864. * taken until `predicate` returns falsey. The predicate is invoked with
  8865. * three arguments: (value, index, array).
  8866. *
  8867. * @static
  8868. * @memberOf _
  8869. * @since 3.0.0
  8870. * @category Array
  8871. * @param {Array} array The array to query.
  8872. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8873. * @returns {Array} Returns the slice of `array`.
  8874. * @example
  8875. *
  8876. * var users = [
  8877. * { 'user': 'barney', 'active': true },
  8878. * { 'user': 'fred', 'active': false },
  8879. * { 'user': 'pebbles', 'active': false }
  8880. * ];
  8881. *
  8882. * _.takeRightWhile(users, function(o) { return !o.active; });
  8883. * // => objects for ['fred', 'pebbles']
  8884. *
  8885. * // The `_.matches` iteratee shorthand.
  8886. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8887. * // => objects for ['pebbles']
  8888. *
  8889. * // The `_.matchesProperty` iteratee shorthand.
  8890. * _.takeRightWhile(users, ['active', false]);
  8891. * // => objects for ['fred', 'pebbles']
  8892. *
  8893. * // The `_.property` iteratee shorthand.
  8894. * _.takeRightWhile(users, 'active');
  8895. * // => []
  8896. */
  8897. function takeRightWhile(array, predicate) {
  8898. return (array && array.length)
  8899. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8900. : [];
  8901. }
  8902. /**
  8903. * Creates a slice of `array` with elements taken from the beginning. Elements
  8904. * are taken until `predicate` returns falsey. The predicate is invoked with
  8905. * three arguments: (value, index, array).
  8906. *
  8907. * @static
  8908. * @memberOf _
  8909. * @since 3.0.0
  8910. * @category Array
  8911. * @param {Array} array The array to query.
  8912. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8913. * @returns {Array} Returns the slice of `array`.
  8914. * @example
  8915. *
  8916. * var users = [
  8917. * { 'user': 'barney', 'active': false },
  8918. * { 'user': 'fred', 'active': false },
  8919. * { 'user': 'pebbles', 'active': true }
  8920. * ];
  8921. *
  8922. * _.takeWhile(users, function(o) { return !o.active; });
  8923. * // => objects for ['barney', 'fred']
  8924. *
  8925. * // The `_.matches` iteratee shorthand.
  8926. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8927. * // => objects for ['barney']
  8928. *
  8929. * // The `_.matchesProperty` iteratee shorthand.
  8930. * _.takeWhile(users, ['active', false]);
  8931. * // => objects for ['barney', 'fred']
  8932. *
  8933. * // The `_.property` iteratee shorthand.
  8934. * _.takeWhile(users, 'active');
  8935. * // => []
  8936. */
  8937. function takeWhile(array, predicate) {
  8938. return (array && array.length)
  8939. ? baseWhile(array, getIteratee(predicate, 3))
  8940. : [];
  8941. }
  8942. /**
  8943. * Creates an array of unique values, in order, from all given arrays using
  8944. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8945. * for equality comparisons.
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 0.1.0
  8950. * @category Array
  8951. * @param {...Array} [arrays] The arrays to inspect.
  8952. * @returns {Array} Returns the new array of combined values.
  8953. * @example
  8954. *
  8955. * _.union([2], [1, 2]);
  8956. * // => [2, 1]
  8957. */
  8958. var union = baseRest(function(arrays) {
  8959. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8960. });
  8961. /**
  8962. * This method is like `_.union` except that it accepts `iteratee` which is
  8963. * invoked for each element of each `arrays` to generate the criterion by
  8964. * which uniqueness is computed. Result values are chosen from the first
  8965. * array in which the value occurs. The iteratee is invoked with one argument:
  8966. * (value).
  8967. *
  8968. * @static
  8969. * @memberOf _
  8970. * @since 4.0.0
  8971. * @category Array
  8972. * @param {...Array} [arrays] The arrays to inspect.
  8973. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8974. * @returns {Array} Returns the new array of combined values.
  8975. * @example
  8976. *
  8977. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8978. * // => [2.1, 1.2]
  8979. *
  8980. * // The `_.property` iteratee shorthand.
  8981. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8982. * // => [{ 'x': 1 }, { 'x': 2 }]
  8983. */
  8984. var unionBy = baseRest(function(arrays) {
  8985. var iteratee = last(arrays);
  8986. if (isArrayLikeObject(iteratee)) {
  8987. iteratee = undefined;
  8988. }
  8989. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8990. });
  8991. /**
  8992. * This method is like `_.union` except that it accepts `comparator` which
  8993. * is invoked to compare elements of `arrays`. Result values are chosen from
  8994. * the first array in which the value occurs. The comparator is invoked
  8995. * with two arguments: (arrVal, othVal).
  8996. *
  8997. * @static
  8998. * @memberOf _
  8999. * @since 4.0.0
  9000. * @category Array
  9001. * @param {...Array} [arrays] The arrays to inspect.
  9002. * @param {Function} [comparator] The comparator invoked per element.
  9003. * @returns {Array} Returns the new array of combined values.
  9004. * @example
  9005. *
  9006. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9007. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9008. *
  9009. * _.unionWith(objects, others, _.isEqual);
  9010. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9011. */
  9012. var unionWith = baseRest(function(arrays) {
  9013. var comparator = last(arrays);
  9014. comparator = typeof comparator == 'function' ? comparator : undefined;
  9015. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9016. });
  9017. /**
  9018. * Creates a duplicate-free version of an array, using
  9019. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9020. * for equality comparisons, in which only the first occurrence of each element
  9021. * is kept. The order of result values is determined by the order they occur
  9022. * in the array.
  9023. *
  9024. * @static
  9025. * @memberOf _
  9026. * @since 0.1.0
  9027. * @category Array
  9028. * @param {Array} array The array to inspect.
  9029. * @returns {Array} Returns the new duplicate free array.
  9030. * @example
  9031. *
  9032. * _.uniq([2, 1, 2]);
  9033. * // => [2, 1]
  9034. */
  9035. function uniq(array) {
  9036. return (array && array.length) ? baseUniq(array) : [];
  9037. }
  9038. /**
  9039. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9040. * invoked for each element in `array` to generate the criterion by which
  9041. * uniqueness is computed. The order of result values is determined by the
  9042. * order they occur in the array. The iteratee is invoked with one argument:
  9043. * (value).
  9044. *
  9045. * @static
  9046. * @memberOf _
  9047. * @since 4.0.0
  9048. * @category Array
  9049. * @param {Array} array The array to inspect.
  9050. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9051. * @returns {Array} Returns the new duplicate free array.
  9052. * @example
  9053. *
  9054. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9055. * // => [2.1, 1.2]
  9056. *
  9057. * // The `_.property` iteratee shorthand.
  9058. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9059. * // => [{ 'x': 1 }, { 'x': 2 }]
  9060. */
  9061. function uniqBy(array, iteratee) {
  9062. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9063. }
  9064. /**
  9065. * This method is like `_.uniq` except that it accepts `comparator` which
  9066. * is invoked to compare elements of `array`. The order of result values is
  9067. * determined by the order they occur in the array.The comparator is invoked
  9068. * with two arguments: (arrVal, othVal).
  9069. *
  9070. * @static
  9071. * @memberOf _
  9072. * @since 4.0.0
  9073. * @category Array
  9074. * @param {Array} array The array to inspect.
  9075. * @param {Function} [comparator] The comparator invoked per element.
  9076. * @returns {Array} Returns the new duplicate free array.
  9077. * @example
  9078. *
  9079. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9080. *
  9081. * _.uniqWith(objects, _.isEqual);
  9082. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9083. */
  9084. function uniqWith(array, comparator) {
  9085. comparator = typeof comparator == 'function' ? comparator : undefined;
  9086. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9087. }
  9088. /**
  9089. * This method is like `_.zip` except that it accepts an array of grouped
  9090. * elements and creates an array regrouping the elements to their pre-zip
  9091. * configuration.
  9092. *
  9093. * @static
  9094. * @memberOf _
  9095. * @since 1.2.0
  9096. * @category Array
  9097. * @param {Array} array The array of grouped elements to process.
  9098. * @returns {Array} Returns the new array of regrouped elements.
  9099. * @example
  9100. *
  9101. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9102. * // => [['a', 1, true], ['b', 2, false]]
  9103. *
  9104. * _.unzip(zipped);
  9105. * // => [['a', 'b'], [1, 2], [true, false]]
  9106. */
  9107. function unzip(array) {
  9108. if (!(array && array.length)) {
  9109. return [];
  9110. }
  9111. var length = 0;
  9112. array = arrayFilter(array, function(group) {
  9113. if (isArrayLikeObject(group)) {
  9114. length = nativeMax(group.length, length);
  9115. return true;
  9116. }
  9117. });
  9118. return baseTimes(length, function(index) {
  9119. return arrayMap(array, baseProperty(index));
  9120. });
  9121. }
  9122. /**
  9123. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9124. * how regrouped values should be combined. The iteratee is invoked with the
  9125. * elements of each group: (...group).
  9126. *
  9127. * @static
  9128. * @memberOf _
  9129. * @since 3.8.0
  9130. * @category Array
  9131. * @param {Array} array The array of grouped elements to process.
  9132. * @param {Function} [iteratee=_.identity] The function to combine
  9133. * regrouped values.
  9134. * @returns {Array} Returns the new array of regrouped elements.
  9135. * @example
  9136. *
  9137. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9138. * // => [[1, 10, 100], [2, 20, 200]]
  9139. *
  9140. * _.unzipWith(zipped, _.add);
  9141. * // => [3, 30, 300]
  9142. */
  9143. function unzipWith(array, iteratee) {
  9144. if (!(array && array.length)) {
  9145. return [];
  9146. }
  9147. var result = unzip(array);
  9148. if (iteratee == null) {
  9149. return result;
  9150. }
  9151. return arrayMap(result, function(group) {
  9152. return apply(iteratee, undefined, group);
  9153. });
  9154. }
  9155. /**
  9156. * Creates an array excluding all given values using
  9157. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9158. * for equality comparisons.
  9159. *
  9160. * **Note:** Unlike `_.pull`, this method returns a new array.
  9161. *
  9162. * @static
  9163. * @memberOf _
  9164. * @since 0.1.0
  9165. * @category Array
  9166. * @param {Array} array The array to inspect.
  9167. * @param {...*} [values] The values to exclude.
  9168. * @returns {Array} Returns the new array of filtered values.
  9169. * @see _.difference, _.xor
  9170. * @example
  9171. *
  9172. * _.without([2, 1, 2, 3], 1, 2);
  9173. * // => [3]
  9174. */
  9175. var without = baseRest(function(array, values) {
  9176. return isArrayLikeObject(array)
  9177. ? baseDifference(array, values)
  9178. : [];
  9179. });
  9180. /**
  9181. * Creates an array of unique values that is the
  9182. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9183. * of the given arrays. The order of result values is determined by the order
  9184. * they occur in the arrays.
  9185. *
  9186. * @static
  9187. * @memberOf _
  9188. * @since 2.4.0
  9189. * @category Array
  9190. * @param {...Array} [arrays] The arrays to inspect.
  9191. * @returns {Array} Returns the new array of filtered values.
  9192. * @see _.difference, _.without
  9193. * @example
  9194. *
  9195. * _.xor([2, 1], [2, 3]);
  9196. * // => [1, 3]
  9197. */
  9198. var xor = baseRest(function(arrays) {
  9199. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9200. });
  9201. /**
  9202. * This method is like `_.xor` except that it accepts `iteratee` which is
  9203. * invoked for each element of each `arrays` to generate the criterion by
  9204. * which by which they're compared. The order of result values is determined
  9205. * by the order they occur in the arrays. The iteratee is invoked with one
  9206. * argument: (value).
  9207. *
  9208. * @static
  9209. * @memberOf _
  9210. * @since 4.0.0
  9211. * @category Array
  9212. * @param {...Array} [arrays] The arrays to inspect.
  9213. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9214. * @returns {Array} Returns the new array of filtered values.
  9215. * @example
  9216. *
  9217. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9218. * // => [1.2, 3.4]
  9219. *
  9220. * // The `_.property` iteratee shorthand.
  9221. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9222. * // => [{ 'x': 2 }]
  9223. */
  9224. var xorBy = baseRest(function(arrays) {
  9225. var iteratee = last(arrays);
  9226. if (isArrayLikeObject(iteratee)) {
  9227. iteratee = undefined;
  9228. }
  9229. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9230. });
  9231. /**
  9232. * This method is like `_.xor` except that it accepts `comparator` which is
  9233. * invoked to compare elements of `arrays`. The order of result values is
  9234. * determined by the order they occur in the arrays. The comparator is invoked
  9235. * with two arguments: (arrVal, othVal).
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 4.0.0
  9240. * @category Array
  9241. * @param {...Array} [arrays] The arrays to inspect.
  9242. * @param {Function} [comparator] The comparator invoked per element.
  9243. * @returns {Array} Returns the new array of filtered values.
  9244. * @example
  9245. *
  9246. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9247. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9248. *
  9249. * _.xorWith(objects, others, _.isEqual);
  9250. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9251. */
  9252. var xorWith = baseRest(function(arrays) {
  9253. var comparator = last(arrays);
  9254. comparator = typeof comparator == 'function' ? comparator : undefined;
  9255. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9256. });
  9257. /**
  9258. * Creates an array of grouped elements, the first of which contains the
  9259. * first elements of the given arrays, the second of which contains the
  9260. * second elements of the given arrays, and so on.
  9261. *
  9262. * @static
  9263. * @memberOf _
  9264. * @since 0.1.0
  9265. * @category Array
  9266. * @param {...Array} [arrays] The arrays to process.
  9267. * @returns {Array} Returns the new array of grouped elements.
  9268. * @example
  9269. *
  9270. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9271. * // => [['a', 1, true], ['b', 2, false]]
  9272. */
  9273. var zip = baseRest(unzip);
  9274. /**
  9275. * This method is like `_.fromPairs` except that it accepts two arrays,
  9276. * one of property identifiers and one of corresponding values.
  9277. *
  9278. * @static
  9279. * @memberOf _
  9280. * @since 0.4.0
  9281. * @category Array
  9282. * @param {Array} [props=[]] The property identifiers.
  9283. * @param {Array} [values=[]] The property values.
  9284. * @returns {Object} Returns the new object.
  9285. * @example
  9286. *
  9287. * _.zipObject(['a', 'b'], [1, 2]);
  9288. * // => { 'a': 1, 'b': 2 }
  9289. */
  9290. function zipObject(props, values) {
  9291. return baseZipObject(props || [], values || [], assignValue);
  9292. }
  9293. /**
  9294. * This method is like `_.zipObject` except that it supports property paths.
  9295. *
  9296. * @static
  9297. * @memberOf _
  9298. * @since 4.1.0
  9299. * @category Array
  9300. * @param {Array} [props=[]] The property identifiers.
  9301. * @param {Array} [values=[]] The property values.
  9302. * @returns {Object} Returns the new object.
  9303. * @example
  9304. *
  9305. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9306. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9307. */
  9308. function zipObjectDeep(props, values) {
  9309. return baseZipObject(props || [], values || [], baseSet);
  9310. }
  9311. /**
  9312. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9313. * how grouped values should be combined. The iteratee is invoked with the
  9314. * elements of each group: (...group).
  9315. *
  9316. * @static
  9317. * @memberOf _
  9318. * @since 3.8.0
  9319. * @category Array
  9320. * @param {...Array} [arrays] The arrays to process.
  9321. * @param {Function} [iteratee=_.identity] The function to combine
  9322. * grouped values.
  9323. * @returns {Array} Returns the new array of grouped elements.
  9324. * @example
  9325. *
  9326. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9327. * return a + b + c;
  9328. * });
  9329. * // => [111, 222]
  9330. */
  9331. var zipWith = baseRest(function(arrays) {
  9332. var length = arrays.length,
  9333. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9334. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9335. return unzipWith(arrays, iteratee);
  9336. });
  9337. /*------------------------------------------------------------------------*/
  9338. /**
  9339. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9340. * chain sequences enabled. The result of such sequences must be unwrapped
  9341. * with `_#value`.
  9342. *
  9343. * @static
  9344. * @memberOf _
  9345. * @since 1.3.0
  9346. * @category Seq
  9347. * @param {*} value The value to wrap.
  9348. * @returns {Object} Returns the new `lodash` wrapper instance.
  9349. * @example
  9350. *
  9351. * var users = [
  9352. * { 'user': 'barney', 'age': 36 },
  9353. * { 'user': 'fred', 'age': 40 },
  9354. * { 'user': 'pebbles', 'age': 1 }
  9355. * ];
  9356. *
  9357. * var youngest = _
  9358. * .chain(users)
  9359. * .sortBy('age')
  9360. * .map(function(o) {
  9361. * return o.user + ' is ' + o.age;
  9362. * })
  9363. * .head()
  9364. * .value();
  9365. * // => 'pebbles is 1'
  9366. */
  9367. function chain(value) {
  9368. var result = lodash(value);
  9369. result.__chain__ = true;
  9370. return result;
  9371. }
  9372. /**
  9373. * This method invokes `interceptor` and returns `value`. The interceptor
  9374. * is invoked with one argument; (value). The purpose of this method is to
  9375. * "tap into" a method chain sequence in order to modify intermediate results.
  9376. *
  9377. * @static
  9378. * @memberOf _
  9379. * @since 0.1.0
  9380. * @category Seq
  9381. * @param {*} value The value to provide to `interceptor`.
  9382. * @param {Function} interceptor The function to invoke.
  9383. * @returns {*} Returns `value`.
  9384. * @example
  9385. *
  9386. * _([1, 2, 3])
  9387. * .tap(function(array) {
  9388. * // Mutate input array.
  9389. * array.pop();
  9390. * })
  9391. * .reverse()
  9392. * .value();
  9393. * // => [2, 1]
  9394. */
  9395. function tap(value, interceptor) {
  9396. interceptor(value);
  9397. return value;
  9398. }
  9399. /**
  9400. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9401. * The purpose of this method is to "pass thru" values replacing intermediate
  9402. * results in a method chain sequence.
  9403. *
  9404. * @static
  9405. * @memberOf _
  9406. * @since 3.0.0
  9407. * @category Seq
  9408. * @param {*} value The value to provide to `interceptor`.
  9409. * @param {Function} interceptor The function to invoke.
  9410. * @returns {*} Returns the result of `interceptor`.
  9411. * @example
  9412. *
  9413. * _(' abc ')
  9414. * .chain()
  9415. * .trim()
  9416. * .thru(function(value) {
  9417. * return [value];
  9418. * })
  9419. * .value();
  9420. * // => ['abc']
  9421. */
  9422. function thru(value, interceptor) {
  9423. return interceptor(value);
  9424. }
  9425. /**
  9426. * This method is the wrapper version of `_.at`.
  9427. *
  9428. * @name at
  9429. * @memberOf _
  9430. * @since 1.0.0
  9431. * @category Seq
  9432. * @param {...(string|string[])} [paths] The property paths to pick.
  9433. * @returns {Object} Returns the new `lodash` wrapper instance.
  9434. * @example
  9435. *
  9436. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9437. *
  9438. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9439. * // => [3, 4]
  9440. */
  9441. var wrapperAt = flatRest(function(paths) {
  9442. var length = paths.length,
  9443. start = length ? paths[0] : 0,
  9444. value = this.__wrapped__,
  9445. interceptor = function(object) { return baseAt(object, paths); };
  9446. if (length > 1 || this.__actions__.length ||
  9447. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9448. return this.thru(interceptor);
  9449. }
  9450. value = value.slice(start, +start + (length ? 1 : 0));
  9451. value.__actions__.push({
  9452. 'func': thru,
  9453. 'args': [interceptor],
  9454. 'thisArg': undefined
  9455. });
  9456. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9457. if (length && !array.length) {
  9458. array.push(undefined);
  9459. }
  9460. return array;
  9461. });
  9462. });
  9463. /**
  9464. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9465. *
  9466. * @name chain
  9467. * @memberOf _
  9468. * @since 0.1.0
  9469. * @category Seq
  9470. * @returns {Object} Returns the new `lodash` wrapper instance.
  9471. * @example
  9472. *
  9473. * var users = [
  9474. * { 'user': 'barney', 'age': 36 },
  9475. * { 'user': 'fred', 'age': 40 }
  9476. * ];
  9477. *
  9478. * // A sequence without explicit chaining.
  9479. * _(users).head();
  9480. * // => { 'user': 'barney', 'age': 36 }
  9481. *
  9482. * // A sequence with explicit chaining.
  9483. * _(users)
  9484. * .chain()
  9485. * .head()
  9486. * .pick('user')
  9487. * .value();
  9488. * // => { 'user': 'barney' }
  9489. */
  9490. function wrapperChain() {
  9491. return chain(this);
  9492. }
  9493. /**
  9494. * Executes the chain sequence and returns the wrapped result.
  9495. *
  9496. * @name commit
  9497. * @memberOf _
  9498. * @since 3.2.0
  9499. * @category Seq
  9500. * @returns {Object} Returns the new `lodash` wrapper instance.
  9501. * @example
  9502. *
  9503. * var array = [1, 2];
  9504. * var wrapped = _(array).push(3);
  9505. *
  9506. * console.log(array);
  9507. * // => [1, 2]
  9508. *
  9509. * wrapped = wrapped.commit();
  9510. * console.log(array);
  9511. * // => [1, 2, 3]
  9512. *
  9513. * wrapped.last();
  9514. * // => 3
  9515. *
  9516. * console.log(array);
  9517. * // => [1, 2, 3]
  9518. */
  9519. function wrapperCommit() {
  9520. return new LodashWrapper(this.value(), this.__chain__);
  9521. }
  9522. /**
  9523. * Gets the next value on a wrapped object following the
  9524. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9525. *
  9526. * @name next
  9527. * @memberOf _
  9528. * @since 4.0.0
  9529. * @category Seq
  9530. * @returns {Object} Returns the next iterator value.
  9531. * @example
  9532. *
  9533. * var wrapped = _([1, 2]);
  9534. *
  9535. * wrapped.next();
  9536. * // => { 'done': false, 'value': 1 }
  9537. *
  9538. * wrapped.next();
  9539. * // => { 'done': false, 'value': 2 }
  9540. *
  9541. * wrapped.next();
  9542. * // => { 'done': true, 'value': undefined }
  9543. */
  9544. function wrapperNext() {
  9545. if (this.__values__ === undefined) {
  9546. this.__values__ = toArray(this.value());
  9547. }
  9548. var done = this.__index__ >= this.__values__.length,
  9549. value = done ? undefined : this.__values__[this.__index__++];
  9550. return { 'done': done, 'value': value };
  9551. }
  9552. /**
  9553. * Enables the wrapper to be iterable.
  9554. *
  9555. * @name Symbol.iterator
  9556. * @memberOf _
  9557. * @since 4.0.0
  9558. * @category Seq
  9559. * @returns {Object} Returns the wrapper object.
  9560. * @example
  9561. *
  9562. * var wrapped = _([1, 2]);
  9563. *
  9564. * wrapped[Symbol.iterator]() === wrapped;
  9565. * // => true
  9566. *
  9567. * Array.from(wrapped);
  9568. * // => [1, 2]
  9569. */
  9570. function wrapperToIterator() {
  9571. return this;
  9572. }
  9573. /**
  9574. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9575. *
  9576. * @name plant
  9577. * @memberOf _
  9578. * @since 3.2.0
  9579. * @category Seq
  9580. * @param {*} value The value to plant.
  9581. * @returns {Object} Returns the new `lodash` wrapper instance.
  9582. * @example
  9583. *
  9584. * function square(n) {
  9585. * return n * n;
  9586. * }
  9587. *
  9588. * var wrapped = _([1, 2]).map(square);
  9589. * var other = wrapped.plant([3, 4]);
  9590. *
  9591. * other.value();
  9592. * // => [9, 16]
  9593. *
  9594. * wrapped.value();
  9595. * // => [1, 4]
  9596. */
  9597. function wrapperPlant(value) {
  9598. var result,
  9599. parent = this;
  9600. while (parent instanceof baseLodash) {
  9601. var clone = wrapperClone(parent);
  9602. clone.__index__ = 0;
  9603. clone.__values__ = undefined;
  9604. if (result) {
  9605. previous.__wrapped__ = clone;
  9606. } else {
  9607. result = clone;
  9608. }
  9609. var previous = clone;
  9610. parent = parent.__wrapped__;
  9611. }
  9612. previous.__wrapped__ = value;
  9613. return result;
  9614. }
  9615. /**
  9616. * This method is the wrapper version of `_.reverse`.
  9617. *
  9618. * **Note:** This method mutates the wrapped array.
  9619. *
  9620. * @name reverse
  9621. * @memberOf _
  9622. * @since 0.1.0
  9623. * @category Seq
  9624. * @returns {Object} Returns the new `lodash` wrapper instance.
  9625. * @example
  9626. *
  9627. * var array = [1, 2, 3];
  9628. *
  9629. * _(array).reverse().value()
  9630. * // => [3, 2, 1]
  9631. *
  9632. * console.log(array);
  9633. * // => [3, 2, 1]
  9634. */
  9635. function wrapperReverse() {
  9636. var value = this.__wrapped__;
  9637. if (value instanceof LazyWrapper) {
  9638. var wrapped = value;
  9639. if (this.__actions__.length) {
  9640. wrapped = new LazyWrapper(this);
  9641. }
  9642. wrapped = wrapped.reverse();
  9643. wrapped.__actions__.push({
  9644. 'func': thru,
  9645. 'args': [reverse],
  9646. 'thisArg': undefined
  9647. });
  9648. return new LodashWrapper(wrapped, this.__chain__);
  9649. }
  9650. return this.thru(reverse);
  9651. }
  9652. /**
  9653. * Executes the chain sequence to resolve the unwrapped value.
  9654. *
  9655. * @name value
  9656. * @memberOf _
  9657. * @since 0.1.0
  9658. * @alias toJSON, valueOf
  9659. * @category Seq
  9660. * @returns {*} Returns the resolved unwrapped value.
  9661. * @example
  9662. *
  9663. * _([1, 2, 3]).value();
  9664. * // => [1, 2, 3]
  9665. */
  9666. function wrapperValue() {
  9667. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9668. }
  9669. /*------------------------------------------------------------------------*/
  9670. /**
  9671. * Creates an object composed of keys generated from the results of running
  9672. * each element of `collection` thru `iteratee`. The corresponding value of
  9673. * each key is the number of times the key was returned by `iteratee`. The
  9674. * iteratee is invoked with one argument: (value).
  9675. *
  9676. * @static
  9677. * @memberOf _
  9678. * @since 0.5.0
  9679. * @category Collection
  9680. * @param {Array|Object} collection The collection to iterate over.
  9681. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9682. * @returns {Object} Returns the composed aggregate object.
  9683. * @example
  9684. *
  9685. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9686. * // => { '4': 1, '6': 2 }
  9687. *
  9688. * // The `_.property` iteratee shorthand.
  9689. * _.countBy(['one', 'two', 'three'], 'length');
  9690. * // => { '3': 2, '5': 1 }
  9691. */
  9692. var countBy = createAggregator(function(result, value, key) {
  9693. if (hasOwnProperty.call(result, key)) {
  9694. ++result[key];
  9695. } else {
  9696. baseAssignValue(result, key, 1);
  9697. }
  9698. });
  9699. /**
  9700. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9701. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9702. * invoked with three arguments: (value, index|key, collection).
  9703. *
  9704. * **Note:** This method returns `true` for
  9705. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9706. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9707. * elements of empty collections.
  9708. *
  9709. * @static
  9710. * @memberOf _
  9711. * @since 0.1.0
  9712. * @category Collection
  9713. * @param {Array|Object} collection The collection to iterate over.
  9714. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9715. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9716. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9717. * else `false`.
  9718. * @example
  9719. *
  9720. * _.every([true, 1, null, 'yes'], Boolean);
  9721. * // => false
  9722. *
  9723. * var users = [
  9724. * { 'user': 'barney', 'age': 36, 'active': false },
  9725. * { 'user': 'fred', 'age': 40, 'active': false }
  9726. * ];
  9727. *
  9728. * // The `_.matches` iteratee shorthand.
  9729. * _.every(users, { 'user': 'barney', 'active': false });
  9730. * // => false
  9731. *
  9732. * // The `_.matchesProperty` iteratee shorthand.
  9733. * _.every(users, ['active', false]);
  9734. * // => true
  9735. *
  9736. * // The `_.property` iteratee shorthand.
  9737. * _.every(users, 'active');
  9738. * // => false
  9739. */
  9740. function every(collection, predicate, guard) {
  9741. var func = isArray(collection) ? arrayEvery : baseEvery;
  9742. if (guard && isIterateeCall(collection, predicate, guard)) {
  9743. predicate = undefined;
  9744. }
  9745. return func(collection, getIteratee(predicate, 3));
  9746. }
  9747. /**
  9748. * Iterates over elements of `collection`, returning an array of all elements
  9749. * `predicate` returns truthy for. The predicate is invoked with three
  9750. * arguments: (value, index|key, collection).
  9751. *
  9752. * **Note:** Unlike `_.remove`, this method returns a new array.
  9753. *
  9754. * @static
  9755. * @memberOf _
  9756. * @since 0.1.0
  9757. * @category Collection
  9758. * @param {Array|Object} collection The collection to iterate over.
  9759. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9760. * @returns {Array} Returns the new filtered array.
  9761. * @see _.reject
  9762. * @example
  9763. *
  9764. * var users = [
  9765. * { 'user': 'barney', 'age': 36, 'active': true },
  9766. * { 'user': 'fred', 'age': 40, 'active': false }
  9767. * ];
  9768. *
  9769. * _.filter(users, function(o) { return !o.active; });
  9770. * // => objects for ['fred']
  9771. *
  9772. * // The `_.matches` iteratee shorthand.
  9773. * _.filter(users, { 'age': 36, 'active': true });
  9774. * // => objects for ['barney']
  9775. *
  9776. * // The `_.matchesProperty` iteratee shorthand.
  9777. * _.filter(users, ['active', false]);
  9778. * // => objects for ['fred']
  9779. *
  9780. * // The `_.property` iteratee shorthand.
  9781. * _.filter(users, 'active');
  9782. * // => objects for ['barney']
  9783. *
  9784. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9785. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9786. * // => objects for ['fred', 'barney']
  9787. */
  9788. function filter(collection, predicate) {
  9789. var func = isArray(collection) ? arrayFilter : baseFilter;
  9790. return func(collection, getIteratee(predicate, 3));
  9791. }
  9792. /**
  9793. * Iterates over elements of `collection`, returning the first element
  9794. * `predicate` returns truthy for. The predicate is invoked with three
  9795. * arguments: (value, index|key, collection).
  9796. *
  9797. * @static
  9798. * @memberOf _
  9799. * @since 0.1.0
  9800. * @category Collection
  9801. * @param {Array|Object} collection The collection to inspect.
  9802. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9803. * @param {number} [fromIndex=0] The index to search from.
  9804. * @returns {*} Returns the matched element, else `undefined`.
  9805. * @example
  9806. *
  9807. * var users = [
  9808. * { 'user': 'barney', 'age': 36, 'active': true },
  9809. * { 'user': 'fred', 'age': 40, 'active': false },
  9810. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9811. * ];
  9812. *
  9813. * _.find(users, function(o) { return o.age < 40; });
  9814. * // => object for 'barney'
  9815. *
  9816. * // The `_.matches` iteratee shorthand.
  9817. * _.find(users, { 'age': 1, 'active': true });
  9818. * // => object for 'pebbles'
  9819. *
  9820. * // The `_.matchesProperty` iteratee shorthand.
  9821. * _.find(users, ['active', false]);
  9822. * // => object for 'fred'
  9823. *
  9824. * // The `_.property` iteratee shorthand.
  9825. * _.find(users, 'active');
  9826. * // => object for 'barney'
  9827. */
  9828. var find = createFind(findIndex);
  9829. /**
  9830. * This method is like `_.find` except that it iterates over elements of
  9831. * `collection` from right to left.
  9832. *
  9833. * @static
  9834. * @memberOf _
  9835. * @since 2.0.0
  9836. * @category Collection
  9837. * @param {Array|Object} collection The collection to inspect.
  9838. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9839. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9840. * @returns {*} Returns the matched element, else `undefined`.
  9841. * @example
  9842. *
  9843. * _.findLast([1, 2, 3, 4], function(n) {
  9844. * return n % 2 == 1;
  9845. * });
  9846. * // => 3
  9847. */
  9848. var findLast = createFind(findLastIndex);
  9849. /**
  9850. * Creates a flattened array of values by running each element in `collection`
  9851. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9852. * with three arguments: (value, index|key, collection).
  9853. *
  9854. * @static
  9855. * @memberOf _
  9856. * @since 4.0.0
  9857. * @category Collection
  9858. * @param {Array|Object} collection The collection to iterate over.
  9859. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9860. * @returns {Array} Returns the new flattened array.
  9861. * @example
  9862. *
  9863. * function duplicate(n) {
  9864. * return [n, n];
  9865. * }
  9866. *
  9867. * _.flatMap([1, 2], duplicate);
  9868. * // => [1, 1, 2, 2]
  9869. */
  9870. function flatMap(collection, iteratee) {
  9871. return baseFlatten(map(collection, iteratee), 1);
  9872. }
  9873. /**
  9874. * This method is like `_.flatMap` except that it recursively flattens the
  9875. * mapped results.
  9876. *
  9877. * @static
  9878. * @memberOf _
  9879. * @since 4.7.0
  9880. * @category Collection
  9881. * @param {Array|Object} collection The collection to iterate over.
  9882. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9883. * @returns {Array} Returns the new flattened array.
  9884. * @example
  9885. *
  9886. * function duplicate(n) {
  9887. * return [[[n, n]]];
  9888. * }
  9889. *
  9890. * _.flatMapDeep([1, 2], duplicate);
  9891. * // => [1, 1, 2, 2]
  9892. */
  9893. function flatMapDeep(collection, iteratee) {
  9894. return baseFlatten(map(collection, iteratee), INFINITY);
  9895. }
  9896. /**
  9897. * This method is like `_.flatMap` except that it recursively flattens the
  9898. * mapped results up to `depth` times.
  9899. *
  9900. * @static
  9901. * @memberOf _
  9902. * @since 4.7.0
  9903. * @category Collection
  9904. * @param {Array|Object} collection The collection to iterate over.
  9905. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9906. * @param {number} [depth=1] The maximum recursion depth.
  9907. * @returns {Array} Returns the new flattened array.
  9908. * @example
  9909. *
  9910. * function duplicate(n) {
  9911. * return [[[n, n]]];
  9912. * }
  9913. *
  9914. * _.flatMapDepth([1, 2], duplicate, 2);
  9915. * // => [[1, 1], [2, 2]]
  9916. */
  9917. function flatMapDepth(collection, iteratee, depth) {
  9918. depth = depth === undefined ? 1 : toInteger(depth);
  9919. return baseFlatten(map(collection, iteratee), depth);
  9920. }
  9921. /**
  9922. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9923. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9924. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9925. *
  9926. * **Note:** As with other "Collections" methods, objects with a "length"
  9927. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9928. * or `_.forOwn` for object iteration.
  9929. *
  9930. * @static
  9931. * @memberOf _
  9932. * @since 0.1.0
  9933. * @alias each
  9934. * @category Collection
  9935. * @param {Array|Object} collection The collection to iterate over.
  9936. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9937. * @returns {Array|Object} Returns `collection`.
  9938. * @see _.forEachRight
  9939. * @example
  9940. *
  9941. * _.forEach([1, 2], function(value) {
  9942. * console.log(value);
  9943. * });
  9944. * // => Logs `1` then `2`.
  9945. *
  9946. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9947. * console.log(key);
  9948. * });
  9949. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9950. */
  9951. function forEach(collection, iteratee) {
  9952. var func = isArray(collection) ? arrayEach : baseEach;
  9953. return func(collection, getIteratee(iteratee, 3));
  9954. }
  9955. /**
  9956. * This method is like `_.forEach` except that it iterates over elements of
  9957. * `collection` from right to left.
  9958. *
  9959. * @static
  9960. * @memberOf _
  9961. * @since 2.0.0
  9962. * @alias eachRight
  9963. * @category Collection
  9964. * @param {Array|Object} collection The collection to iterate over.
  9965. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9966. * @returns {Array|Object} Returns `collection`.
  9967. * @see _.forEach
  9968. * @example
  9969. *
  9970. * _.forEachRight([1, 2], function(value) {
  9971. * console.log(value);
  9972. * });
  9973. * // => Logs `2` then `1`.
  9974. */
  9975. function forEachRight(collection, iteratee) {
  9976. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9977. return func(collection, getIteratee(iteratee, 3));
  9978. }
  9979. /**
  9980. * Creates an object composed of keys generated from the results of running
  9981. * each element of `collection` thru `iteratee`. The order of grouped values
  9982. * is determined by the order they occur in `collection`. The corresponding
  9983. * value of each key is an array of elements responsible for generating the
  9984. * key. The iteratee is invoked with one argument: (value).
  9985. *
  9986. * @static
  9987. * @memberOf _
  9988. * @since 0.1.0
  9989. * @category Collection
  9990. * @param {Array|Object} collection The collection to iterate over.
  9991. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9992. * @returns {Object} Returns the composed aggregate object.
  9993. * @example
  9994. *
  9995. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9996. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9997. *
  9998. * // The `_.property` iteratee shorthand.
  9999. * _.groupBy(['one', 'two', 'three'], 'length');
  10000. * // => { '3': ['one', 'two'], '5': ['three'] }
  10001. */
  10002. var groupBy = createAggregator(function(result, value, key) {
  10003. if (hasOwnProperty.call(result, key)) {
  10004. result[key].push(value);
  10005. } else {
  10006. baseAssignValue(result, key, [value]);
  10007. }
  10008. });
  10009. /**
  10010. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10011. * checked for a substring of `value`, otherwise
  10012. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10013. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10014. * the offset from the end of `collection`.
  10015. *
  10016. * @static
  10017. * @memberOf _
  10018. * @since 0.1.0
  10019. * @category Collection
  10020. * @param {Array|Object|string} collection The collection to inspect.
  10021. * @param {*} value The value to search for.
  10022. * @param {number} [fromIndex=0] The index to search from.
  10023. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10024. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10025. * @example
  10026. *
  10027. * _.includes([1, 2, 3], 1);
  10028. * // => true
  10029. *
  10030. * _.includes([1, 2, 3], 1, 2);
  10031. * // => false
  10032. *
  10033. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10034. * // => true
  10035. *
  10036. * _.includes('abcd', 'bc');
  10037. * // => true
  10038. */
  10039. function includes(collection, value, fromIndex, guard) {
  10040. collection = isArrayLike(collection) ? collection : values(collection);
  10041. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10042. var length = collection.length;
  10043. if (fromIndex < 0) {
  10044. fromIndex = nativeMax(length + fromIndex, 0);
  10045. }
  10046. return isString(collection)
  10047. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10048. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10049. }
  10050. /**
  10051. * Invokes the method at `path` of each element in `collection`, returning
  10052. * an array of the results of each invoked method. Any additional arguments
  10053. * are provided to each invoked method. If `path` is a function, it's invoked
  10054. * for, and `this` bound to, each element in `collection`.
  10055. *
  10056. * @static
  10057. * @memberOf _
  10058. * @since 4.0.0
  10059. * @category Collection
  10060. * @param {Array|Object} collection The collection to iterate over.
  10061. * @param {Array|Function|string} path The path of the method to invoke or
  10062. * the function invoked per iteration.
  10063. * @param {...*} [args] The arguments to invoke each method with.
  10064. * @returns {Array} Returns the array of results.
  10065. * @example
  10066. *
  10067. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10068. * // => [[1, 5, 7], [1, 2, 3]]
  10069. *
  10070. * _.invokeMap([123, 456], String.prototype.split, '');
  10071. * // => [['1', '2', '3'], ['4', '5', '6']]
  10072. */
  10073. var invokeMap = baseRest(function(collection, path, args) {
  10074. var index = -1,
  10075. isFunc = typeof path == 'function',
  10076. result = isArrayLike(collection) ? Array(collection.length) : [];
  10077. baseEach(collection, function(value) {
  10078. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10079. });
  10080. return result;
  10081. });
  10082. /**
  10083. * Creates an object composed of keys generated from the results of running
  10084. * each element of `collection` thru `iteratee`. The corresponding value of
  10085. * each key is the last element responsible for generating the key. The
  10086. * iteratee is invoked with one argument: (value).
  10087. *
  10088. * @static
  10089. * @memberOf _
  10090. * @since 4.0.0
  10091. * @category Collection
  10092. * @param {Array|Object} collection The collection to iterate over.
  10093. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10094. * @returns {Object} Returns the composed aggregate object.
  10095. * @example
  10096. *
  10097. * var array = [
  10098. * { 'dir': 'left', 'code': 97 },
  10099. * { 'dir': 'right', 'code': 100 }
  10100. * ];
  10101. *
  10102. * _.keyBy(array, function(o) {
  10103. * return String.fromCharCode(o.code);
  10104. * });
  10105. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10106. *
  10107. * _.keyBy(array, 'dir');
  10108. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10109. */
  10110. var keyBy = createAggregator(function(result, value, key) {
  10111. baseAssignValue(result, key, value);
  10112. });
  10113. /**
  10114. * Creates an array of values by running each element in `collection` thru
  10115. * `iteratee`. The iteratee is invoked with three arguments:
  10116. * (value, index|key, collection).
  10117. *
  10118. * Many lodash methods are guarded to work as iteratees for methods like
  10119. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10120. *
  10121. * The guarded methods are:
  10122. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10123. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10124. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10125. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10126. *
  10127. * @static
  10128. * @memberOf _
  10129. * @since 0.1.0
  10130. * @category Collection
  10131. * @param {Array|Object} collection The collection to iterate over.
  10132. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10133. * @returns {Array} Returns the new mapped array.
  10134. * @example
  10135. *
  10136. * function square(n) {
  10137. * return n * n;
  10138. * }
  10139. *
  10140. * _.map([4, 8], square);
  10141. * // => [16, 64]
  10142. *
  10143. * _.map({ 'a': 4, 'b': 8 }, square);
  10144. * // => [16, 64] (iteration order is not guaranteed)
  10145. *
  10146. * var users = [
  10147. * { 'user': 'barney' },
  10148. * { 'user': 'fred' }
  10149. * ];
  10150. *
  10151. * // The `_.property` iteratee shorthand.
  10152. * _.map(users, 'user');
  10153. * // => ['barney', 'fred']
  10154. */
  10155. function map(collection, iteratee) {
  10156. var func = isArray(collection) ? arrayMap : baseMap;
  10157. return func(collection, getIteratee(iteratee, 3));
  10158. }
  10159. /**
  10160. * This method is like `_.sortBy` except that it allows specifying the sort
  10161. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10162. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10163. * descending or "asc" for ascending sort order of corresponding values.
  10164. *
  10165. * @static
  10166. * @memberOf _
  10167. * @since 4.0.0
  10168. * @category Collection
  10169. * @param {Array|Object} collection The collection to iterate over.
  10170. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10171. * The iteratees to sort by.
  10172. * @param {string[]} [orders] The sort orders of `iteratees`.
  10173. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10174. * @returns {Array} Returns the new sorted array.
  10175. * @example
  10176. *
  10177. * var users = [
  10178. * { 'user': 'fred', 'age': 48 },
  10179. * { 'user': 'barney', 'age': 34 },
  10180. * { 'user': 'fred', 'age': 40 },
  10181. * { 'user': 'barney', 'age': 36 }
  10182. * ];
  10183. *
  10184. * // Sort by `user` in ascending order and by `age` in descending order.
  10185. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10186. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10187. */
  10188. function orderBy(collection, iteratees, orders, guard) {
  10189. if (collection == null) {
  10190. return [];
  10191. }
  10192. if (!isArray(iteratees)) {
  10193. iteratees = iteratees == null ? [] : [iteratees];
  10194. }
  10195. orders = guard ? undefined : orders;
  10196. if (!isArray(orders)) {
  10197. orders = orders == null ? [] : [orders];
  10198. }
  10199. return baseOrderBy(collection, iteratees, orders);
  10200. }
  10201. /**
  10202. * Creates an array of elements split into two groups, the first of which
  10203. * contains elements `predicate` returns truthy for, the second of which
  10204. * contains elements `predicate` returns falsey for. The predicate is
  10205. * invoked with one argument: (value).
  10206. *
  10207. * @static
  10208. * @memberOf _
  10209. * @since 3.0.0
  10210. * @category Collection
  10211. * @param {Array|Object} collection The collection to iterate over.
  10212. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10213. * @returns {Array} Returns the array of grouped elements.
  10214. * @example
  10215. *
  10216. * var users = [
  10217. * { 'user': 'barney', 'age': 36, 'active': false },
  10218. * { 'user': 'fred', 'age': 40, 'active': true },
  10219. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10220. * ];
  10221. *
  10222. * _.partition(users, function(o) { return o.active; });
  10223. * // => objects for [['fred'], ['barney', 'pebbles']]
  10224. *
  10225. * // The `_.matches` iteratee shorthand.
  10226. * _.partition(users, { 'age': 1, 'active': false });
  10227. * // => objects for [['pebbles'], ['barney', 'fred']]
  10228. *
  10229. * // The `_.matchesProperty` iteratee shorthand.
  10230. * _.partition(users, ['active', false]);
  10231. * // => objects for [['barney', 'pebbles'], ['fred']]
  10232. *
  10233. * // The `_.property` iteratee shorthand.
  10234. * _.partition(users, 'active');
  10235. * // => objects for [['fred'], ['barney', 'pebbles']]
  10236. */
  10237. var partition = createAggregator(function(result, value, key) {
  10238. result[key ? 0 : 1].push(value);
  10239. }, function() { return [[], []]; });
  10240. /**
  10241. * Reduces `collection` to a value which is the accumulated result of running
  10242. * each element in `collection` thru `iteratee`, where each successive
  10243. * invocation is supplied the return value of the previous. If `accumulator`
  10244. * is not given, the first element of `collection` is used as the initial
  10245. * value. The iteratee is invoked with four arguments:
  10246. * (accumulator, value, index|key, collection).
  10247. *
  10248. * Many lodash methods are guarded to work as iteratees for methods like
  10249. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10250. *
  10251. * The guarded methods are:
  10252. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10253. * and `sortBy`
  10254. *
  10255. * @static
  10256. * @memberOf _
  10257. * @since 0.1.0
  10258. * @category Collection
  10259. * @param {Array|Object} collection The collection to iterate over.
  10260. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10261. * @param {*} [accumulator] The initial value.
  10262. * @returns {*} Returns the accumulated value.
  10263. * @see _.reduceRight
  10264. * @example
  10265. *
  10266. * _.reduce([1, 2], function(sum, n) {
  10267. * return sum + n;
  10268. * }, 0);
  10269. * // => 3
  10270. *
  10271. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10272. * (result[value] || (result[value] = [])).push(key);
  10273. * return result;
  10274. * }, {});
  10275. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10276. */
  10277. function reduce(collection, iteratee, accumulator) {
  10278. var func = isArray(collection) ? arrayReduce : baseReduce,
  10279. initAccum = arguments.length < 3;
  10280. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10281. }
  10282. /**
  10283. * This method is like `_.reduce` except that it iterates over elements of
  10284. * `collection` from right to left.
  10285. *
  10286. * @static
  10287. * @memberOf _
  10288. * @since 0.1.0
  10289. * @category Collection
  10290. * @param {Array|Object} collection The collection to iterate over.
  10291. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10292. * @param {*} [accumulator] The initial value.
  10293. * @returns {*} Returns the accumulated value.
  10294. * @see _.reduce
  10295. * @example
  10296. *
  10297. * var array = [[0, 1], [2, 3], [4, 5]];
  10298. *
  10299. * _.reduceRight(array, function(flattened, other) {
  10300. * return flattened.concat(other);
  10301. * }, []);
  10302. * // => [4, 5, 2, 3, 0, 1]
  10303. */
  10304. function reduceRight(collection, iteratee, accumulator) {
  10305. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10306. initAccum = arguments.length < 3;
  10307. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10308. }
  10309. /**
  10310. * The opposite of `_.filter`; this method returns the elements of `collection`
  10311. * that `predicate` does **not** return truthy for.
  10312. *
  10313. * @static
  10314. * @memberOf _
  10315. * @since 0.1.0
  10316. * @category Collection
  10317. * @param {Array|Object} collection The collection to iterate over.
  10318. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10319. * @returns {Array} Returns the new filtered array.
  10320. * @see _.filter
  10321. * @example
  10322. *
  10323. * var users = [
  10324. * { 'user': 'barney', 'age': 36, 'active': false },
  10325. * { 'user': 'fred', 'age': 40, 'active': true }
  10326. * ];
  10327. *
  10328. * _.reject(users, function(o) { return !o.active; });
  10329. * // => objects for ['fred']
  10330. *
  10331. * // The `_.matches` iteratee shorthand.
  10332. * _.reject(users, { 'age': 40, 'active': true });
  10333. * // => objects for ['barney']
  10334. *
  10335. * // The `_.matchesProperty` iteratee shorthand.
  10336. * _.reject(users, ['active', false]);
  10337. * // => objects for ['fred']
  10338. *
  10339. * // The `_.property` iteratee shorthand.
  10340. * _.reject(users, 'active');
  10341. * // => objects for ['barney']
  10342. */
  10343. function reject(collection, predicate) {
  10344. var func = isArray(collection) ? arrayFilter : baseFilter;
  10345. return func(collection, negate(getIteratee(predicate, 3)));
  10346. }
  10347. /**
  10348. * Gets a random element from `collection`.
  10349. *
  10350. * @static
  10351. * @memberOf _
  10352. * @since 2.0.0
  10353. * @category Collection
  10354. * @param {Array|Object} collection The collection to sample.
  10355. * @returns {*} Returns the random element.
  10356. * @example
  10357. *
  10358. * _.sample([1, 2, 3, 4]);
  10359. * // => 2
  10360. */
  10361. function sample(collection) {
  10362. var func = isArray(collection) ? arraySample : baseSample;
  10363. return func(collection);
  10364. }
  10365. /**
  10366. * Gets `n` random elements at unique keys from `collection` up to the
  10367. * size of `collection`.
  10368. *
  10369. * @static
  10370. * @memberOf _
  10371. * @since 4.0.0
  10372. * @category Collection
  10373. * @param {Array|Object} collection The collection to sample.
  10374. * @param {number} [n=1] The number of elements to sample.
  10375. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10376. * @returns {Array} Returns the random elements.
  10377. * @example
  10378. *
  10379. * _.sampleSize([1, 2, 3], 2);
  10380. * // => [3, 1]
  10381. *
  10382. * _.sampleSize([1, 2, 3], 4);
  10383. * // => [2, 3, 1]
  10384. */
  10385. function sampleSize(collection, n, guard) {
  10386. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10387. n = 1;
  10388. } else {
  10389. n = toInteger(n);
  10390. }
  10391. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10392. return func(collection, n);
  10393. }
  10394. /**
  10395. * Creates an array of shuffled values, using a version of the
  10396. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10397. *
  10398. * @static
  10399. * @memberOf _
  10400. * @since 0.1.0
  10401. * @category Collection
  10402. * @param {Array|Object} collection The collection to shuffle.
  10403. * @returns {Array} Returns the new shuffled array.
  10404. * @example
  10405. *
  10406. * _.shuffle([1, 2, 3, 4]);
  10407. * // => [4, 1, 3, 2]
  10408. */
  10409. function shuffle(collection) {
  10410. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10411. return func(collection);
  10412. }
  10413. /**
  10414. * Gets the size of `collection` by returning its length for array-like
  10415. * values or the number of own enumerable string keyed properties for objects.
  10416. *
  10417. * @static
  10418. * @memberOf _
  10419. * @since 0.1.0
  10420. * @category Collection
  10421. * @param {Array|Object|string} collection The collection to inspect.
  10422. * @returns {number} Returns the collection size.
  10423. * @example
  10424. *
  10425. * _.size([1, 2, 3]);
  10426. * // => 3
  10427. *
  10428. * _.size({ 'a': 1, 'b': 2 });
  10429. * // => 2
  10430. *
  10431. * _.size('pebbles');
  10432. * // => 7
  10433. */
  10434. function size(collection) {
  10435. if (collection == null) {
  10436. return 0;
  10437. }
  10438. if (isArrayLike(collection)) {
  10439. return isString(collection) ? stringSize(collection) : collection.length;
  10440. }
  10441. var tag = getTag(collection);
  10442. if (tag == mapTag || tag == setTag) {
  10443. return collection.size;
  10444. }
  10445. return baseKeys(collection).length;
  10446. }
  10447. /**
  10448. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10449. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10450. * invoked with three arguments: (value, index|key, collection).
  10451. *
  10452. * @static
  10453. * @memberOf _
  10454. * @since 0.1.0
  10455. * @category Collection
  10456. * @param {Array|Object} collection The collection to iterate over.
  10457. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10458. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10459. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10460. * else `false`.
  10461. * @example
  10462. *
  10463. * _.some([null, 0, 'yes', false], Boolean);
  10464. * // => true
  10465. *
  10466. * var users = [
  10467. * { 'user': 'barney', 'active': true },
  10468. * { 'user': 'fred', 'active': false }
  10469. * ];
  10470. *
  10471. * // The `_.matches` iteratee shorthand.
  10472. * _.some(users, { 'user': 'barney', 'active': false });
  10473. * // => false
  10474. *
  10475. * // The `_.matchesProperty` iteratee shorthand.
  10476. * _.some(users, ['active', false]);
  10477. * // => true
  10478. *
  10479. * // The `_.property` iteratee shorthand.
  10480. * _.some(users, 'active');
  10481. * // => true
  10482. */
  10483. function some(collection, predicate, guard) {
  10484. var func = isArray(collection) ? arraySome : baseSome;
  10485. if (guard && isIterateeCall(collection, predicate, guard)) {
  10486. predicate = undefined;
  10487. }
  10488. return func(collection, getIteratee(predicate, 3));
  10489. }
  10490. /**
  10491. * Creates an array of elements, sorted in ascending order by the results of
  10492. * running each element in a collection thru each iteratee. This method
  10493. * performs a stable sort, that is, it preserves the original sort order of
  10494. * equal elements. The iteratees are invoked with one argument: (value).
  10495. *
  10496. * @static
  10497. * @memberOf _
  10498. * @since 0.1.0
  10499. * @category Collection
  10500. * @param {Array|Object} collection The collection to iterate over.
  10501. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10502. * The iteratees to sort by.
  10503. * @returns {Array} Returns the new sorted array.
  10504. * @example
  10505. *
  10506. * var users = [
  10507. * { 'user': 'fred', 'age': 48 },
  10508. * { 'user': 'barney', 'age': 36 },
  10509. * { 'user': 'fred', 'age': 30 },
  10510. * { 'user': 'barney', 'age': 34 }
  10511. * ];
  10512. *
  10513. * _.sortBy(users, [function(o) { return o.user; }]);
  10514. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10515. *
  10516. * _.sortBy(users, ['user', 'age']);
  10517. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10518. */
  10519. var sortBy = baseRest(function(collection, iteratees) {
  10520. if (collection == null) {
  10521. return [];
  10522. }
  10523. var length = iteratees.length;
  10524. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10525. iteratees = [];
  10526. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10527. iteratees = [iteratees[0]];
  10528. }
  10529. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10530. });
  10531. /*------------------------------------------------------------------------*/
  10532. /**
  10533. * Gets the timestamp of the number of milliseconds that have elapsed since
  10534. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10535. *
  10536. * @static
  10537. * @memberOf _
  10538. * @since 2.4.0
  10539. * @category Date
  10540. * @returns {number} Returns the timestamp.
  10541. * @example
  10542. *
  10543. * _.defer(function(stamp) {
  10544. * console.log(_.now() - stamp);
  10545. * }, _.now());
  10546. * // => Logs the number of milliseconds it took for the deferred invocation.
  10547. */
  10548. var now = ctxNow || function() {
  10549. return root.Date.now();
  10550. };
  10551. /*------------------------------------------------------------------------*/
  10552. /**
  10553. * The opposite of `_.before`; this method creates a function that invokes
  10554. * `func` once it's called `n` or more times.
  10555. *
  10556. * @static
  10557. * @memberOf _
  10558. * @since 0.1.0
  10559. * @category Function
  10560. * @param {number} n The number of calls before `func` is invoked.
  10561. * @param {Function} func The function to restrict.
  10562. * @returns {Function} Returns the new restricted function.
  10563. * @example
  10564. *
  10565. * var saves = ['profile', 'settings'];
  10566. *
  10567. * var done = _.after(saves.length, function() {
  10568. * console.log('done saving!');
  10569. * });
  10570. *
  10571. * _.forEach(saves, function(type) {
  10572. * asyncSave({ 'type': type, 'complete': done });
  10573. * });
  10574. * // => Logs 'done saving!' after the two async saves have completed.
  10575. */
  10576. function after(n, func) {
  10577. if (typeof func != 'function') {
  10578. throw new TypeError(FUNC_ERROR_TEXT);
  10579. }
  10580. n = toInteger(n);
  10581. return function() {
  10582. if (--n < 1) {
  10583. return func.apply(this, arguments);
  10584. }
  10585. };
  10586. }
  10587. /**
  10588. * Creates a function that invokes `func`, with up to `n` arguments,
  10589. * ignoring any additional arguments.
  10590. *
  10591. * @static
  10592. * @memberOf _
  10593. * @since 3.0.0
  10594. * @category Function
  10595. * @param {Function} func The function to cap arguments for.
  10596. * @param {number} [n=func.length] The arity cap.
  10597. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10598. * @returns {Function} Returns the new capped function.
  10599. * @example
  10600. *
  10601. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10602. * // => [6, 8, 10]
  10603. */
  10604. function ary(func, n, guard) {
  10605. n = guard ? undefined : n;
  10606. n = (func && n == null) ? func.length : n;
  10607. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10608. }
  10609. /**
  10610. * Creates a function that invokes `func`, with the `this` binding and arguments
  10611. * of the created function, while it's called less than `n` times. Subsequent
  10612. * calls to the created function return the result of the last `func` invocation.
  10613. *
  10614. * @static
  10615. * @memberOf _
  10616. * @since 3.0.0
  10617. * @category Function
  10618. * @param {number} n The number of calls at which `func` is no longer invoked.
  10619. * @param {Function} func The function to restrict.
  10620. * @returns {Function} Returns the new restricted function.
  10621. * @example
  10622. *
  10623. * jQuery(element).on('click', _.before(5, addContactToList));
  10624. * // => Allows adding up to 4 contacts to the list.
  10625. */
  10626. function before(n, func) {
  10627. var result;
  10628. if (typeof func != 'function') {
  10629. throw new TypeError(FUNC_ERROR_TEXT);
  10630. }
  10631. n = toInteger(n);
  10632. return function() {
  10633. if (--n > 0) {
  10634. result = func.apply(this, arguments);
  10635. }
  10636. if (n <= 1) {
  10637. func = undefined;
  10638. }
  10639. return result;
  10640. };
  10641. }
  10642. /**
  10643. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10644. * and `partials` prepended to the arguments it receives.
  10645. *
  10646. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10647. * may be used as a placeholder for partially applied arguments.
  10648. *
  10649. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10650. * property of bound functions.
  10651. *
  10652. * @static
  10653. * @memberOf _
  10654. * @since 0.1.0
  10655. * @category Function
  10656. * @param {Function} func The function to bind.
  10657. * @param {*} thisArg The `this` binding of `func`.
  10658. * @param {...*} [partials] The arguments to be partially applied.
  10659. * @returns {Function} Returns the new bound function.
  10660. * @example
  10661. *
  10662. * function greet(greeting, punctuation) {
  10663. * return greeting + ' ' + this.user + punctuation;
  10664. * }
  10665. *
  10666. * var object = { 'user': 'fred' };
  10667. *
  10668. * var bound = _.bind(greet, object, 'hi');
  10669. * bound('!');
  10670. * // => 'hi fred!'
  10671. *
  10672. * // Bound with placeholders.
  10673. * var bound = _.bind(greet, object, _, '!');
  10674. * bound('hi');
  10675. * // => 'hi fred!'
  10676. */
  10677. var bind = baseRest(function(func, thisArg, partials) {
  10678. var bitmask = WRAP_BIND_FLAG;
  10679. if (partials.length) {
  10680. var holders = replaceHolders(partials, getHolder(bind));
  10681. bitmask |= WRAP_PARTIAL_FLAG;
  10682. }
  10683. return createWrap(func, bitmask, thisArg, partials, holders);
  10684. });
  10685. /**
  10686. * Creates a function that invokes the method at `object[key]` with `partials`
  10687. * prepended to the arguments it receives.
  10688. *
  10689. * This method differs from `_.bind` by allowing bound functions to reference
  10690. * methods that may be redefined or don't yet exist. See
  10691. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10692. * for more details.
  10693. *
  10694. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10695. * builds, may be used as a placeholder for partially applied arguments.
  10696. *
  10697. * @static
  10698. * @memberOf _
  10699. * @since 0.10.0
  10700. * @category Function
  10701. * @param {Object} object The object to invoke the method on.
  10702. * @param {string} key The key of the method.
  10703. * @param {...*} [partials] The arguments to be partially applied.
  10704. * @returns {Function} Returns the new bound function.
  10705. * @example
  10706. *
  10707. * var object = {
  10708. * 'user': 'fred',
  10709. * 'greet': function(greeting, punctuation) {
  10710. * return greeting + ' ' + this.user + punctuation;
  10711. * }
  10712. * };
  10713. *
  10714. * var bound = _.bindKey(object, 'greet', 'hi');
  10715. * bound('!');
  10716. * // => 'hi fred!'
  10717. *
  10718. * object.greet = function(greeting, punctuation) {
  10719. * return greeting + 'ya ' + this.user + punctuation;
  10720. * };
  10721. *
  10722. * bound('!');
  10723. * // => 'hiya fred!'
  10724. *
  10725. * // Bound with placeholders.
  10726. * var bound = _.bindKey(object, 'greet', _, '!');
  10727. * bound('hi');
  10728. * // => 'hiya fred!'
  10729. */
  10730. var bindKey = baseRest(function(object, key, partials) {
  10731. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10732. if (partials.length) {
  10733. var holders = replaceHolders(partials, getHolder(bindKey));
  10734. bitmask |= WRAP_PARTIAL_FLAG;
  10735. }
  10736. return createWrap(key, bitmask, object, partials, holders);
  10737. });
  10738. /**
  10739. * Creates a function that accepts arguments of `func` and either invokes
  10740. * `func` returning its result, if at least `arity` number of arguments have
  10741. * been provided, or returns a function that accepts the remaining `func`
  10742. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10743. * is not sufficient.
  10744. *
  10745. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10746. * may be used as a placeholder for provided arguments.
  10747. *
  10748. * **Note:** This method doesn't set the "length" property of curried functions.
  10749. *
  10750. * @static
  10751. * @memberOf _
  10752. * @since 2.0.0
  10753. * @category Function
  10754. * @param {Function} func The function to curry.
  10755. * @param {number} [arity=func.length] The arity of `func`.
  10756. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10757. * @returns {Function} Returns the new curried function.
  10758. * @example
  10759. *
  10760. * var abc = function(a, b, c) {
  10761. * return [a, b, c];
  10762. * };
  10763. *
  10764. * var curried = _.curry(abc);
  10765. *
  10766. * curried(1)(2)(3);
  10767. * // => [1, 2, 3]
  10768. *
  10769. * curried(1, 2)(3);
  10770. * // => [1, 2, 3]
  10771. *
  10772. * curried(1, 2, 3);
  10773. * // => [1, 2, 3]
  10774. *
  10775. * // Curried with placeholders.
  10776. * curried(1)(_, 3)(2);
  10777. * // => [1, 2, 3]
  10778. */
  10779. function curry(func, arity, guard) {
  10780. arity = guard ? undefined : arity;
  10781. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10782. result.placeholder = curry.placeholder;
  10783. return result;
  10784. }
  10785. /**
  10786. * This method is like `_.curry` except that arguments are applied to `func`
  10787. * in the manner of `_.partialRight` instead of `_.partial`.
  10788. *
  10789. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10790. * builds, may be used as a placeholder for provided arguments.
  10791. *
  10792. * **Note:** This method doesn't set the "length" property of curried functions.
  10793. *
  10794. * @static
  10795. * @memberOf _
  10796. * @since 3.0.0
  10797. * @category Function
  10798. * @param {Function} func The function to curry.
  10799. * @param {number} [arity=func.length] The arity of `func`.
  10800. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10801. * @returns {Function} Returns the new curried function.
  10802. * @example
  10803. *
  10804. * var abc = function(a, b, c) {
  10805. * return [a, b, c];
  10806. * };
  10807. *
  10808. * var curried = _.curryRight(abc);
  10809. *
  10810. * curried(3)(2)(1);
  10811. * // => [1, 2, 3]
  10812. *
  10813. * curried(2, 3)(1);
  10814. * // => [1, 2, 3]
  10815. *
  10816. * curried(1, 2, 3);
  10817. * // => [1, 2, 3]
  10818. *
  10819. * // Curried with placeholders.
  10820. * curried(3)(1, _)(2);
  10821. * // => [1, 2, 3]
  10822. */
  10823. function curryRight(func, arity, guard) {
  10824. arity = guard ? undefined : arity;
  10825. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10826. result.placeholder = curryRight.placeholder;
  10827. return result;
  10828. }
  10829. /**
  10830. * Creates a debounced function that delays invoking `func` until after `wait`
  10831. * milliseconds have elapsed since the last time the debounced function was
  10832. * invoked. The debounced function comes with a `cancel` method to cancel
  10833. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10834. * Provide `options` to indicate whether `func` should be invoked on the
  10835. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10836. * with the last arguments provided to the debounced function. Subsequent
  10837. * calls to the debounced function return the result of the last `func`
  10838. * invocation.
  10839. *
  10840. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10841. * invoked on the trailing edge of the timeout only if the debounced function
  10842. * is invoked more than once during the `wait` timeout.
  10843. *
  10844. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10845. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10846. *
  10847. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10848. * for details over the differences between `_.debounce` and `_.throttle`.
  10849. *
  10850. * @static
  10851. * @memberOf _
  10852. * @since 0.1.0
  10853. * @category Function
  10854. * @param {Function} func The function to debounce.
  10855. * @param {number} [wait=0] The number of milliseconds to delay.
  10856. * @param {Object} [options={}] The options object.
  10857. * @param {boolean} [options.leading=false]
  10858. * Specify invoking on the leading edge of the timeout.
  10859. * @param {number} [options.maxWait]
  10860. * The maximum time `func` is allowed to be delayed before it's invoked.
  10861. * @param {boolean} [options.trailing=true]
  10862. * Specify invoking on the trailing edge of the timeout.
  10863. * @returns {Function} Returns the new debounced function.
  10864. * @example
  10865. *
  10866. * // Avoid costly calculations while the window size is in flux.
  10867. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10868. *
  10869. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10870. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10871. * 'leading': true,
  10872. * 'trailing': false
  10873. * }));
  10874. *
  10875. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10876. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10877. * var source = new EventSource('/stream');
  10878. * jQuery(source).on('message', debounced);
  10879. *
  10880. * // Cancel the trailing debounced invocation.
  10881. * jQuery(window).on('popstate', debounced.cancel);
  10882. */
  10883. function debounce(func, wait, options) {
  10884. var lastArgs,
  10885. lastThis,
  10886. maxWait,
  10887. result,
  10888. timerId,
  10889. lastCallTime,
  10890. lastInvokeTime = 0,
  10891. leading = false,
  10892. maxing = false,
  10893. trailing = true;
  10894. if (typeof func != 'function') {
  10895. throw new TypeError(FUNC_ERROR_TEXT);
  10896. }
  10897. wait = toNumber(wait) || 0;
  10898. if (isObject(options)) {
  10899. leading = !!options.leading;
  10900. maxing = 'maxWait' in options;
  10901. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10902. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10903. }
  10904. function invokeFunc(time) {
  10905. var args = lastArgs,
  10906. thisArg = lastThis;
  10907. lastArgs = lastThis = undefined;
  10908. lastInvokeTime = time;
  10909. result = func.apply(thisArg, args);
  10910. return result;
  10911. }
  10912. function leadingEdge(time) {
  10913. // Reset any `maxWait` timer.
  10914. lastInvokeTime = time;
  10915. // Start the timer for the trailing edge.
  10916. timerId = setTimeout(timerExpired, wait);
  10917. // Invoke the leading edge.
  10918. return leading ? invokeFunc(time) : result;
  10919. }
  10920. function remainingWait(time) {
  10921. var timeSinceLastCall = time - lastCallTime,
  10922. timeSinceLastInvoke = time - lastInvokeTime,
  10923. timeWaiting = wait - timeSinceLastCall;
  10924. return maxing
  10925. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10926. : timeWaiting;
  10927. }
  10928. function shouldInvoke(time) {
  10929. var timeSinceLastCall = time - lastCallTime,
  10930. timeSinceLastInvoke = time - lastInvokeTime;
  10931. // Either this is the first call, activity has stopped and we're at the
  10932. // trailing edge, the system time has gone backwards and we're treating
  10933. // it as the trailing edge, or we've hit the `maxWait` limit.
  10934. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10935. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10936. }
  10937. function timerExpired() {
  10938. var time = now();
  10939. if (shouldInvoke(time)) {
  10940. return trailingEdge(time);
  10941. }
  10942. // Restart the timer.
  10943. timerId = setTimeout(timerExpired, remainingWait(time));
  10944. }
  10945. function trailingEdge(time) {
  10946. timerId = undefined;
  10947. // Only invoke if we have `lastArgs` which means `func` has been
  10948. // debounced at least once.
  10949. if (trailing && lastArgs) {
  10950. return invokeFunc(time);
  10951. }
  10952. lastArgs = lastThis = undefined;
  10953. return result;
  10954. }
  10955. function cancel() {
  10956. if (timerId !== undefined) {
  10957. clearTimeout(timerId);
  10958. }
  10959. lastInvokeTime = 0;
  10960. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10961. }
  10962. function flush() {
  10963. return timerId === undefined ? result : trailingEdge(now());
  10964. }
  10965. function debounced() {
  10966. var time = now(),
  10967. isInvoking = shouldInvoke(time);
  10968. lastArgs = arguments;
  10969. lastThis = this;
  10970. lastCallTime = time;
  10971. if (isInvoking) {
  10972. if (timerId === undefined) {
  10973. return leadingEdge(lastCallTime);
  10974. }
  10975. if (maxing) {
  10976. // Handle invocations in a tight loop.
  10977. clearTimeout(timerId);
  10978. timerId = setTimeout(timerExpired, wait);
  10979. return invokeFunc(lastCallTime);
  10980. }
  10981. }
  10982. if (timerId === undefined) {
  10983. timerId = setTimeout(timerExpired, wait);
  10984. }
  10985. return result;
  10986. }
  10987. debounced.cancel = cancel;
  10988. debounced.flush = flush;
  10989. return debounced;
  10990. }
  10991. /**
  10992. * Defers invoking the `func` until the current call stack has cleared. Any
  10993. * additional arguments are provided to `func` when it's invoked.
  10994. *
  10995. * @static
  10996. * @memberOf _
  10997. * @since 0.1.0
  10998. * @category Function
  10999. * @param {Function} func The function to defer.
  11000. * @param {...*} [args] The arguments to invoke `func` with.
  11001. * @returns {number} Returns the timer id.
  11002. * @example
  11003. *
  11004. * _.defer(function(text) {
  11005. * console.log(text);
  11006. * }, 'deferred');
  11007. * // => Logs 'deferred' after one millisecond.
  11008. */
  11009. var defer = baseRest(function(func, args) {
  11010. return baseDelay(func, 1, args);
  11011. });
  11012. /**
  11013. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11014. * provided to `func` when it's invoked.
  11015. *
  11016. * @static
  11017. * @memberOf _
  11018. * @since 0.1.0
  11019. * @category Function
  11020. * @param {Function} func The function to delay.
  11021. * @param {number} wait The number of milliseconds to delay invocation.
  11022. * @param {...*} [args] The arguments to invoke `func` with.
  11023. * @returns {number} Returns the timer id.
  11024. * @example
  11025. *
  11026. * _.delay(function(text) {
  11027. * console.log(text);
  11028. * }, 1000, 'later');
  11029. * // => Logs 'later' after one second.
  11030. */
  11031. var delay = baseRest(function(func, wait, args) {
  11032. return baseDelay(func, toNumber(wait) || 0, args);
  11033. });
  11034. /**
  11035. * Creates a function that invokes `func` with arguments reversed.
  11036. *
  11037. * @static
  11038. * @memberOf _
  11039. * @since 4.0.0
  11040. * @category Function
  11041. * @param {Function} func The function to flip arguments for.
  11042. * @returns {Function} Returns the new flipped function.
  11043. * @example
  11044. *
  11045. * var flipped = _.flip(function() {
  11046. * return _.toArray(arguments);
  11047. * });
  11048. *
  11049. * flipped('a', 'b', 'c', 'd');
  11050. * // => ['d', 'c', 'b', 'a']
  11051. */
  11052. function flip(func) {
  11053. return createWrap(func, WRAP_FLIP_FLAG);
  11054. }
  11055. /**
  11056. * Creates a function that memoizes the result of `func`. If `resolver` is
  11057. * provided, it determines the cache key for storing the result based on the
  11058. * arguments provided to the memoized function. By default, the first argument
  11059. * provided to the memoized function is used as the map cache key. The `func`
  11060. * is invoked with the `this` binding of the memoized function.
  11061. *
  11062. * **Note:** The cache is exposed as the `cache` property on the memoized
  11063. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11064. * constructor with one whose instances implement the
  11065. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11066. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11067. *
  11068. * @static
  11069. * @memberOf _
  11070. * @since 0.1.0
  11071. * @category Function
  11072. * @param {Function} func The function to have its output memoized.
  11073. * @param {Function} [resolver] The function to resolve the cache key.
  11074. * @returns {Function} Returns the new memoized function.
  11075. * @example
  11076. *
  11077. * var object = { 'a': 1, 'b': 2 };
  11078. * var other = { 'c': 3, 'd': 4 };
  11079. *
  11080. * var values = _.memoize(_.values);
  11081. * values(object);
  11082. * // => [1, 2]
  11083. *
  11084. * values(other);
  11085. * // => [3, 4]
  11086. *
  11087. * object.a = 2;
  11088. * values(object);
  11089. * // => [1, 2]
  11090. *
  11091. * // Modify the result cache.
  11092. * values.cache.set(object, ['a', 'b']);
  11093. * values(object);
  11094. * // => ['a', 'b']
  11095. *
  11096. * // Replace `_.memoize.Cache`.
  11097. * _.memoize.Cache = WeakMap;
  11098. */
  11099. function memoize(func, resolver) {
  11100. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11101. throw new TypeError(FUNC_ERROR_TEXT);
  11102. }
  11103. var memoized = function() {
  11104. var args = arguments,
  11105. key = resolver ? resolver.apply(this, args) : args[0],
  11106. cache = memoized.cache;
  11107. if (cache.has(key)) {
  11108. return cache.get(key);
  11109. }
  11110. var result = func.apply(this, args);
  11111. memoized.cache = cache.set(key, result) || cache;
  11112. return result;
  11113. };
  11114. memoized.cache = new (memoize.Cache || MapCache);
  11115. return memoized;
  11116. }
  11117. // Expose `MapCache`.
  11118. memoize.Cache = MapCache;
  11119. /**
  11120. * Creates a function that negates the result of the predicate `func`. The
  11121. * `func` predicate is invoked with the `this` binding and arguments of the
  11122. * created function.
  11123. *
  11124. * @static
  11125. * @memberOf _
  11126. * @since 3.0.0
  11127. * @category Function
  11128. * @param {Function} predicate The predicate to negate.
  11129. * @returns {Function} Returns the new negated function.
  11130. * @example
  11131. *
  11132. * function isEven(n) {
  11133. * return n % 2 == 0;
  11134. * }
  11135. *
  11136. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11137. * // => [1, 3, 5]
  11138. */
  11139. function negate(predicate) {
  11140. if (typeof predicate != 'function') {
  11141. throw new TypeError(FUNC_ERROR_TEXT);
  11142. }
  11143. return function() {
  11144. var args = arguments;
  11145. switch (args.length) {
  11146. case 0: return !predicate.call(this);
  11147. case 1: return !predicate.call(this, args[0]);
  11148. case 2: return !predicate.call(this, args[0], args[1]);
  11149. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11150. }
  11151. return !predicate.apply(this, args);
  11152. };
  11153. }
  11154. /**
  11155. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11156. * to the function return the value of the first invocation. The `func` is
  11157. * invoked with the `this` binding and arguments of the created function.
  11158. *
  11159. * @static
  11160. * @memberOf _
  11161. * @since 0.1.0
  11162. * @category Function
  11163. * @param {Function} func The function to restrict.
  11164. * @returns {Function} Returns the new restricted function.
  11165. * @example
  11166. *
  11167. * var initialize = _.once(createApplication);
  11168. * initialize();
  11169. * initialize();
  11170. * // => `createApplication` is invoked once
  11171. */
  11172. function once(func) {
  11173. return before(2, func);
  11174. }
  11175. /**
  11176. * Creates a function that invokes `func` with its arguments transformed.
  11177. *
  11178. * @static
  11179. * @since 4.0.0
  11180. * @memberOf _
  11181. * @category Function
  11182. * @param {Function} func The function to wrap.
  11183. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11184. * The argument transforms.
  11185. * @returns {Function} Returns the new function.
  11186. * @example
  11187. *
  11188. * function doubled(n) {
  11189. * return n * 2;
  11190. * }
  11191. *
  11192. * function square(n) {
  11193. * return n * n;
  11194. * }
  11195. *
  11196. * var func = _.overArgs(function(x, y) {
  11197. * return [x, y];
  11198. * }, [square, doubled]);
  11199. *
  11200. * func(9, 3);
  11201. * // => [81, 6]
  11202. *
  11203. * func(10, 5);
  11204. * // => [100, 10]
  11205. */
  11206. var overArgs = castRest(function(func, transforms) {
  11207. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11208. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11209. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11210. var funcsLength = transforms.length;
  11211. return baseRest(function(args) {
  11212. var index = -1,
  11213. length = nativeMin(args.length, funcsLength);
  11214. while (++index < length) {
  11215. args[index] = transforms[index].call(this, args[index]);
  11216. }
  11217. return apply(func, this, args);
  11218. });
  11219. });
  11220. /**
  11221. * Creates a function that invokes `func` with `partials` prepended to the
  11222. * arguments it receives. This method is like `_.bind` except it does **not**
  11223. * alter the `this` binding.
  11224. *
  11225. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11226. * builds, may be used as a placeholder for partially applied arguments.
  11227. *
  11228. * **Note:** This method doesn't set the "length" property of partially
  11229. * applied functions.
  11230. *
  11231. * @static
  11232. * @memberOf _
  11233. * @since 0.2.0
  11234. * @category Function
  11235. * @param {Function} func The function to partially apply arguments to.
  11236. * @param {...*} [partials] The arguments to be partially applied.
  11237. * @returns {Function} Returns the new partially applied function.
  11238. * @example
  11239. *
  11240. * function greet(greeting, name) {
  11241. * return greeting + ' ' + name;
  11242. * }
  11243. *
  11244. * var sayHelloTo = _.partial(greet, 'hello');
  11245. * sayHelloTo('fred');
  11246. * // => 'hello fred'
  11247. *
  11248. * // Partially applied with placeholders.
  11249. * var greetFred = _.partial(greet, _, 'fred');
  11250. * greetFred('hi');
  11251. * // => 'hi fred'
  11252. */
  11253. var partial = baseRest(function(func, partials) {
  11254. var holders = replaceHolders(partials, getHolder(partial));
  11255. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11256. });
  11257. /**
  11258. * This method is like `_.partial` except that partially applied arguments
  11259. * are appended to the arguments it receives.
  11260. *
  11261. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11262. * builds, may be used as a placeholder for partially applied arguments.
  11263. *
  11264. * **Note:** This method doesn't set the "length" property of partially
  11265. * applied functions.
  11266. *
  11267. * @static
  11268. * @memberOf _
  11269. * @since 1.0.0
  11270. * @category Function
  11271. * @param {Function} func The function to partially apply arguments to.
  11272. * @param {...*} [partials] The arguments to be partially applied.
  11273. * @returns {Function} Returns the new partially applied function.
  11274. * @example
  11275. *
  11276. * function greet(greeting, name) {
  11277. * return greeting + ' ' + name;
  11278. * }
  11279. *
  11280. * var greetFred = _.partialRight(greet, 'fred');
  11281. * greetFred('hi');
  11282. * // => 'hi fred'
  11283. *
  11284. * // Partially applied with placeholders.
  11285. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11286. * sayHelloTo('fred');
  11287. * // => 'hello fred'
  11288. */
  11289. var partialRight = baseRest(function(func, partials) {
  11290. var holders = replaceHolders(partials, getHolder(partialRight));
  11291. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11292. });
  11293. /**
  11294. * Creates a function that invokes `func` with arguments arranged according
  11295. * to the specified `indexes` where the argument value at the first index is
  11296. * provided as the first argument, the argument value at the second index is
  11297. * provided as the second argument, and so on.
  11298. *
  11299. * @static
  11300. * @memberOf _
  11301. * @since 3.0.0
  11302. * @category Function
  11303. * @param {Function} func The function to rearrange arguments for.
  11304. * @param {...(number|number[])} indexes The arranged argument indexes.
  11305. * @returns {Function} Returns the new function.
  11306. * @example
  11307. *
  11308. * var rearged = _.rearg(function(a, b, c) {
  11309. * return [a, b, c];
  11310. * }, [2, 0, 1]);
  11311. *
  11312. * rearged('b', 'c', 'a')
  11313. * // => ['a', 'b', 'c']
  11314. */
  11315. var rearg = flatRest(function(func, indexes) {
  11316. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11317. });
  11318. /**
  11319. * Creates a function that invokes `func` with the `this` binding of the
  11320. * created function and arguments from `start` and beyond provided as
  11321. * an array.
  11322. *
  11323. * **Note:** This method is based on the
  11324. * [rest parameter](https://mdn.io/rest_parameters).
  11325. *
  11326. * @static
  11327. * @memberOf _
  11328. * @since 4.0.0
  11329. * @category Function
  11330. * @param {Function} func The function to apply a rest parameter to.
  11331. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11332. * @returns {Function} Returns the new function.
  11333. * @example
  11334. *
  11335. * var say = _.rest(function(what, names) {
  11336. * return what + ' ' + _.initial(names).join(', ') +
  11337. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11338. * });
  11339. *
  11340. * say('hello', 'fred', 'barney', 'pebbles');
  11341. * // => 'hello fred, barney, & pebbles'
  11342. */
  11343. function rest(func, start) {
  11344. if (typeof func != 'function') {
  11345. throw new TypeError(FUNC_ERROR_TEXT);
  11346. }
  11347. start = start === undefined ? start : toInteger(start);
  11348. return baseRest(func, start);
  11349. }
  11350. /**
  11351. * Creates a function that invokes `func` with the `this` binding of the
  11352. * create function and an array of arguments much like
  11353. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11354. *
  11355. * **Note:** This method is based on the
  11356. * [spread operator](https://mdn.io/spread_operator).
  11357. *
  11358. * @static
  11359. * @memberOf _
  11360. * @since 3.2.0
  11361. * @category Function
  11362. * @param {Function} func The function to spread arguments over.
  11363. * @param {number} [start=0] The start position of the spread.
  11364. * @returns {Function} Returns the new function.
  11365. * @example
  11366. *
  11367. * var say = _.spread(function(who, what) {
  11368. * return who + ' says ' + what;
  11369. * });
  11370. *
  11371. * say(['fred', 'hello']);
  11372. * // => 'fred says hello'
  11373. *
  11374. * var numbers = Promise.all([
  11375. * Promise.resolve(40),
  11376. * Promise.resolve(36)
  11377. * ]);
  11378. *
  11379. * numbers.then(_.spread(function(x, y) {
  11380. * return x + y;
  11381. * }));
  11382. * // => a Promise of 76
  11383. */
  11384. function spread(func, start) {
  11385. if (typeof func != 'function') {
  11386. throw new TypeError(FUNC_ERROR_TEXT);
  11387. }
  11388. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11389. return baseRest(function(args) {
  11390. var array = args[start],
  11391. otherArgs = castSlice(args, 0, start);
  11392. if (array) {
  11393. arrayPush(otherArgs, array);
  11394. }
  11395. return apply(func, this, otherArgs);
  11396. });
  11397. }
  11398. /**
  11399. * Creates a throttled function that only invokes `func` at most once per
  11400. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11401. * method to cancel delayed `func` invocations and a `flush` method to
  11402. * immediately invoke them. Provide `options` to indicate whether `func`
  11403. * should be invoked on the leading and/or trailing edge of the `wait`
  11404. * timeout. The `func` is invoked with the last arguments provided to the
  11405. * throttled function. Subsequent calls to the throttled function return the
  11406. * result of the last `func` invocation.
  11407. *
  11408. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11409. * invoked on the trailing edge of the timeout only if the throttled function
  11410. * is invoked more than once during the `wait` timeout.
  11411. *
  11412. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11413. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11414. *
  11415. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11416. * for details over the differences between `_.throttle` and `_.debounce`.
  11417. *
  11418. * @static
  11419. * @memberOf _
  11420. * @since 0.1.0
  11421. * @category Function
  11422. * @param {Function} func The function to throttle.
  11423. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11424. * @param {Object} [options={}] The options object.
  11425. * @param {boolean} [options.leading=true]
  11426. * Specify invoking on the leading edge of the timeout.
  11427. * @param {boolean} [options.trailing=true]
  11428. * Specify invoking on the trailing edge of the timeout.
  11429. * @returns {Function} Returns the new throttled function.
  11430. * @example
  11431. *
  11432. * // Avoid excessively updating the position while scrolling.
  11433. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11434. *
  11435. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11436. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11437. * jQuery(element).on('click', throttled);
  11438. *
  11439. * // Cancel the trailing throttled invocation.
  11440. * jQuery(window).on('popstate', throttled.cancel);
  11441. */
  11442. function throttle(func, wait, options) {
  11443. var leading = true,
  11444. trailing = true;
  11445. if (typeof func != 'function') {
  11446. throw new TypeError(FUNC_ERROR_TEXT);
  11447. }
  11448. if (isObject(options)) {
  11449. leading = 'leading' in options ? !!options.leading : leading;
  11450. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11451. }
  11452. return debounce(func, wait, {
  11453. 'leading': leading,
  11454. 'maxWait': wait,
  11455. 'trailing': trailing
  11456. });
  11457. }
  11458. /**
  11459. * Creates a function that accepts up to one argument, ignoring any
  11460. * additional arguments.
  11461. *
  11462. * @static
  11463. * @memberOf _
  11464. * @since 4.0.0
  11465. * @category Function
  11466. * @param {Function} func The function to cap arguments for.
  11467. * @returns {Function} Returns the new capped function.
  11468. * @example
  11469. *
  11470. * _.map(['6', '8', '10'], _.unary(parseInt));
  11471. * // => [6, 8, 10]
  11472. */
  11473. function unary(func) {
  11474. return ary(func, 1);
  11475. }
  11476. /**
  11477. * Creates a function that provides `value` to `wrapper` as its first
  11478. * argument. Any additional arguments provided to the function are appended
  11479. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11480. * binding of the created function.
  11481. *
  11482. * @static
  11483. * @memberOf _
  11484. * @since 0.1.0
  11485. * @category Function
  11486. * @param {*} value The value to wrap.
  11487. * @param {Function} [wrapper=identity] The wrapper function.
  11488. * @returns {Function} Returns the new function.
  11489. * @example
  11490. *
  11491. * var p = _.wrap(_.escape, function(func, text) {
  11492. * return '<p>' + func(text) + '</p>';
  11493. * });
  11494. *
  11495. * p('fred, barney, & pebbles');
  11496. * // => '<p>fred, barney, &amp; pebbles</p>'
  11497. */
  11498. function wrap(value, wrapper) {
  11499. return partial(castFunction(wrapper), value);
  11500. }
  11501. /*------------------------------------------------------------------------*/
  11502. /**
  11503. * Casts `value` as an array if it's not one.
  11504. *
  11505. * @static
  11506. * @memberOf _
  11507. * @since 4.4.0
  11508. * @category Lang
  11509. * @param {*} value The value to inspect.
  11510. * @returns {Array} Returns the cast array.
  11511. * @example
  11512. *
  11513. * _.castArray(1);
  11514. * // => [1]
  11515. *
  11516. * _.castArray({ 'a': 1 });
  11517. * // => [{ 'a': 1 }]
  11518. *
  11519. * _.castArray('abc');
  11520. * // => ['abc']
  11521. *
  11522. * _.castArray(null);
  11523. * // => [null]
  11524. *
  11525. * _.castArray(undefined);
  11526. * // => [undefined]
  11527. *
  11528. * _.castArray();
  11529. * // => []
  11530. *
  11531. * var array = [1, 2, 3];
  11532. * console.log(_.castArray(array) === array);
  11533. * // => true
  11534. */
  11535. function castArray() {
  11536. if (!arguments.length) {
  11537. return [];
  11538. }
  11539. var value = arguments[0];
  11540. return isArray(value) ? value : [value];
  11541. }
  11542. /**
  11543. * Creates a shallow clone of `value`.
  11544. *
  11545. * **Note:** This method is loosely based on the
  11546. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11547. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11548. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11549. * arrays. The own enumerable properties of `arguments` objects are cloned
  11550. * as plain objects. An empty object is returned for uncloneable values such
  11551. * as error objects, functions, DOM nodes, and WeakMaps.
  11552. *
  11553. * @static
  11554. * @memberOf _
  11555. * @since 0.1.0
  11556. * @category Lang
  11557. * @param {*} value The value to clone.
  11558. * @returns {*} Returns the cloned value.
  11559. * @see _.cloneDeep
  11560. * @example
  11561. *
  11562. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11563. *
  11564. * var shallow = _.clone(objects);
  11565. * console.log(shallow[0] === objects[0]);
  11566. * // => true
  11567. */
  11568. function clone(value) {
  11569. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11570. }
  11571. /**
  11572. * This method is like `_.clone` except that it accepts `customizer` which
  11573. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11574. * cloning is handled by the method instead. The `customizer` is invoked with
  11575. * up to four arguments; (value [, index|key, object, stack]).
  11576. *
  11577. * @static
  11578. * @memberOf _
  11579. * @since 4.0.0
  11580. * @category Lang
  11581. * @param {*} value The value to clone.
  11582. * @param {Function} [customizer] The function to customize cloning.
  11583. * @returns {*} Returns the cloned value.
  11584. * @see _.cloneDeepWith
  11585. * @example
  11586. *
  11587. * function customizer(value) {
  11588. * if (_.isElement(value)) {
  11589. * return value.cloneNode(false);
  11590. * }
  11591. * }
  11592. *
  11593. * var el = _.cloneWith(document.body, customizer);
  11594. *
  11595. * console.log(el === document.body);
  11596. * // => false
  11597. * console.log(el.nodeName);
  11598. * // => 'BODY'
  11599. * console.log(el.childNodes.length);
  11600. * // => 0
  11601. */
  11602. function cloneWith(value, customizer) {
  11603. customizer = typeof customizer == 'function' ? customizer : undefined;
  11604. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11605. }
  11606. /**
  11607. * This method is like `_.clone` except that it recursively clones `value`.
  11608. *
  11609. * @static
  11610. * @memberOf _
  11611. * @since 1.0.0
  11612. * @category Lang
  11613. * @param {*} value The value to recursively clone.
  11614. * @returns {*} Returns the deep cloned value.
  11615. * @see _.clone
  11616. * @example
  11617. *
  11618. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11619. *
  11620. * var deep = _.cloneDeep(objects);
  11621. * console.log(deep[0] === objects[0]);
  11622. * // => false
  11623. */
  11624. function cloneDeep(value) {
  11625. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11626. }
  11627. /**
  11628. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11629. *
  11630. * @static
  11631. * @memberOf _
  11632. * @since 4.0.0
  11633. * @category Lang
  11634. * @param {*} value The value to recursively clone.
  11635. * @param {Function} [customizer] The function to customize cloning.
  11636. * @returns {*} Returns the deep cloned value.
  11637. * @see _.cloneWith
  11638. * @example
  11639. *
  11640. * function customizer(value) {
  11641. * if (_.isElement(value)) {
  11642. * return value.cloneNode(true);
  11643. * }
  11644. * }
  11645. *
  11646. * var el = _.cloneDeepWith(document.body, customizer);
  11647. *
  11648. * console.log(el === document.body);
  11649. * // => false
  11650. * console.log(el.nodeName);
  11651. * // => 'BODY'
  11652. * console.log(el.childNodes.length);
  11653. * // => 20
  11654. */
  11655. function cloneDeepWith(value, customizer) {
  11656. customizer = typeof customizer == 'function' ? customizer : undefined;
  11657. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11658. }
  11659. /**
  11660. * Checks if `object` conforms to `source` by invoking the predicate
  11661. * properties of `source` with the corresponding property values of `object`.
  11662. *
  11663. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11664. * partially applied.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 4.14.0
  11669. * @category Lang
  11670. * @param {Object} object The object to inspect.
  11671. * @param {Object} source The object of property predicates to conform to.
  11672. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11673. * @example
  11674. *
  11675. * var object = { 'a': 1, 'b': 2 };
  11676. *
  11677. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11678. * // => true
  11679. *
  11680. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11681. * // => false
  11682. */
  11683. function conformsTo(object, source) {
  11684. return source == null || baseConformsTo(object, source, keys(source));
  11685. }
  11686. /**
  11687. * Performs a
  11688. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11689. * comparison between two values to determine if they are equivalent.
  11690. *
  11691. * @static
  11692. * @memberOf _
  11693. * @since 4.0.0
  11694. * @category Lang
  11695. * @param {*} value The value to compare.
  11696. * @param {*} other The other value to compare.
  11697. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11698. * @example
  11699. *
  11700. * var object = { 'a': 1 };
  11701. * var other = { 'a': 1 };
  11702. *
  11703. * _.eq(object, object);
  11704. * // => true
  11705. *
  11706. * _.eq(object, other);
  11707. * // => false
  11708. *
  11709. * _.eq('a', 'a');
  11710. * // => true
  11711. *
  11712. * _.eq('a', Object('a'));
  11713. * // => false
  11714. *
  11715. * _.eq(NaN, NaN);
  11716. * // => true
  11717. */
  11718. function eq(value, other) {
  11719. return value === other || (value !== value && other !== other);
  11720. }
  11721. /**
  11722. * Checks if `value` is greater than `other`.
  11723. *
  11724. * @static
  11725. * @memberOf _
  11726. * @since 3.9.0
  11727. * @category Lang
  11728. * @param {*} value The value to compare.
  11729. * @param {*} other The other value to compare.
  11730. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11731. * else `false`.
  11732. * @see _.lt
  11733. * @example
  11734. *
  11735. * _.gt(3, 1);
  11736. * // => true
  11737. *
  11738. * _.gt(3, 3);
  11739. * // => false
  11740. *
  11741. * _.gt(1, 3);
  11742. * // => false
  11743. */
  11744. var gt = createRelationalOperation(baseGt);
  11745. /**
  11746. * Checks if `value` is greater than or equal to `other`.
  11747. *
  11748. * @static
  11749. * @memberOf _
  11750. * @since 3.9.0
  11751. * @category Lang
  11752. * @param {*} value The value to compare.
  11753. * @param {*} other The other value to compare.
  11754. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11755. * `other`, else `false`.
  11756. * @see _.lte
  11757. * @example
  11758. *
  11759. * _.gte(3, 1);
  11760. * // => true
  11761. *
  11762. * _.gte(3, 3);
  11763. * // => true
  11764. *
  11765. * _.gte(1, 3);
  11766. * // => false
  11767. */
  11768. var gte = createRelationalOperation(function(value, other) {
  11769. return value >= other;
  11770. });
  11771. /**
  11772. * Checks if `value` is likely an `arguments` object.
  11773. *
  11774. * @static
  11775. * @memberOf _
  11776. * @since 0.1.0
  11777. * @category Lang
  11778. * @param {*} value The value to check.
  11779. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11780. * else `false`.
  11781. * @example
  11782. *
  11783. * _.isArguments(function() { return arguments; }());
  11784. * // => true
  11785. *
  11786. * _.isArguments([1, 2, 3]);
  11787. * // => false
  11788. */
  11789. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11790. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11791. !propertyIsEnumerable.call(value, 'callee');
  11792. };
  11793. /**
  11794. * Checks if `value` is classified as an `Array` object.
  11795. *
  11796. * @static
  11797. * @memberOf _
  11798. * @since 0.1.0
  11799. * @category Lang
  11800. * @param {*} value The value to check.
  11801. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11802. * @example
  11803. *
  11804. * _.isArray([1, 2, 3]);
  11805. * // => true
  11806. *
  11807. * _.isArray(document.body.children);
  11808. * // => false
  11809. *
  11810. * _.isArray('abc');
  11811. * // => false
  11812. *
  11813. * _.isArray(_.noop);
  11814. * // => false
  11815. */
  11816. var isArray = Array.isArray;
  11817. /**
  11818. * Checks if `value` is classified as an `ArrayBuffer` object.
  11819. *
  11820. * @static
  11821. * @memberOf _
  11822. * @since 4.3.0
  11823. * @category Lang
  11824. * @param {*} value The value to check.
  11825. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11826. * @example
  11827. *
  11828. * _.isArrayBuffer(new ArrayBuffer(2));
  11829. * // => true
  11830. *
  11831. * _.isArrayBuffer(new Array(2));
  11832. * // => false
  11833. */
  11834. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11835. /**
  11836. * Checks if `value` is array-like. A value is considered array-like if it's
  11837. * not a function and has a `value.length` that's an integer greater than or
  11838. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11839. *
  11840. * @static
  11841. * @memberOf _
  11842. * @since 4.0.0
  11843. * @category Lang
  11844. * @param {*} value The value to check.
  11845. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11846. * @example
  11847. *
  11848. * _.isArrayLike([1, 2, 3]);
  11849. * // => true
  11850. *
  11851. * _.isArrayLike(document.body.children);
  11852. * // => true
  11853. *
  11854. * _.isArrayLike('abc');
  11855. * // => true
  11856. *
  11857. * _.isArrayLike(_.noop);
  11858. * // => false
  11859. */
  11860. function isArrayLike(value) {
  11861. return value != null && isLength(value.length) && !isFunction(value);
  11862. }
  11863. /**
  11864. * This method is like `_.isArrayLike` except that it also checks if `value`
  11865. * is an object.
  11866. *
  11867. * @static
  11868. * @memberOf _
  11869. * @since 4.0.0
  11870. * @category Lang
  11871. * @param {*} value The value to check.
  11872. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11873. * else `false`.
  11874. * @example
  11875. *
  11876. * _.isArrayLikeObject([1, 2, 3]);
  11877. * // => true
  11878. *
  11879. * _.isArrayLikeObject(document.body.children);
  11880. * // => true
  11881. *
  11882. * _.isArrayLikeObject('abc');
  11883. * // => false
  11884. *
  11885. * _.isArrayLikeObject(_.noop);
  11886. * // => false
  11887. */
  11888. function isArrayLikeObject(value) {
  11889. return isObjectLike(value) && isArrayLike(value);
  11890. }
  11891. /**
  11892. * Checks if `value` is classified as a boolean primitive or object.
  11893. *
  11894. * @static
  11895. * @memberOf _
  11896. * @since 0.1.0
  11897. * @category Lang
  11898. * @param {*} value The value to check.
  11899. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11900. * @example
  11901. *
  11902. * _.isBoolean(false);
  11903. * // => true
  11904. *
  11905. * _.isBoolean(null);
  11906. * // => false
  11907. */
  11908. function isBoolean(value) {
  11909. return value === true || value === false ||
  11910. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11911. }
  11912. /**
  11913. * Checks if `value` is a buffer.
  11914. *
  11915. * @static
  11916. * @memberOf _
  11917. * @since 4.3.0
  11918. * @category Lang
  11919. * @param {*} value The value to check.
  11920. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11921. * @example
  11922. *
  11923. * _.isBuffer(new Buffer(2));
  11924. * // => true
  11925. *
  11926. * _.isBuffer(new Uint8Array(2));
  11927. * // => false
  11928. */
  11929. var isBuffer = nativeIsBuffer || stubFalse;
  11930. /**
  11931. * Checks if `value` is classified as a `Date` object.
  11932. *
  11933. * @static
  11934. * @memberOf _
  11935. * @since 0.1.0
  11936. * @category Lang
  11937. * @param {*} value The value to check.
  11938. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11939. * @example
  11940. *
  11941. * _.isDate(new Date);
  11942. * // => true
  11943. *
  11944. * _.isDate('Mon April 23 2012');
  11945. * // => false
  11946. */
  11947. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11948. /**
  11949. * Checks if `value` is likely a DOM element.
  11950. *
  11951. * @static
  11952. * @memberOf _
  11953. * @since 0.1.0
  11954. * @category Lang
  11955. * @param {*} value The value to check.
  11956. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11957. * @example
  11958. *
  11959. * _.isElement(document.body);
  11960. * // => true
  11961. *
  11962. * _.isElement('<body>');
  11963. * // => false
  11964. */
  11965. function isElement(value) {
  11966. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11967. }
  11968. /**
  11969. * Checks if `value` is an empty object, collection, map, or set.
  11970. *
  11971. * Objects are considered empty if they have no own enumerable string keyed
  11972. * properties.
  11973. *
  11974. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11975. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11976. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11977. *
  11978. * @static
  11979. * @memberOf _
  11980. * @since 0.1.0
  11981. * @category Lang
  11982. * @param {*} value The value to check.
  11983. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11984. * @example
  11985. *
  11986. * _.isEmpty(null);
  11987. * // => true
  11988. *
  11989. * _.isEmpty(true);
  11990. * // => true
  11991. *
  11992. * _.isEmpty(1);
  11993. * // => true
  11994. *
  11995. * _.isEmpty([1, 2, 3]);
  11996. * // => false
  11997. *
  11998. * _.isEmpty({ 'a': 1 });
  11999. * // => false
  12000. */
  12001. function isEmpty(value) {
  12002. if (value == null) {
  12003. return true;
  12004. }
  12005. if (isArrayLike(value) &&
  12006. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12007. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12008. return !value.length;
  12009. }
  12010. var tag = getTag(value);
  12011. if (tag == mapTag || tag == setTag) {
  12012. return !value.size;
  12013. }
  12014. if (isPrototype(value)) {
  12015. return !baseKeys(value).length;
  12016. }
  12017. for (var key in value) {
  12018. if (hasOwnProperty.call(value, key)) {
  12019. return false;
  12020. }
  12021. }
  12022. return true;
  12023. }
  12024. /**
  12025. * Performs a deep comparison between two values to determine if they are
  12026. * equivalent.
  12027. *
  12028. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12029. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12030. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12031. * by their own, not inherited, enumerable properties. Functions and DOM
  12032. * nodes are compared by strict equality, i.e. `===`.
  12033. *
  12034. * @static
  12035. * @memberOf _
  12036. * @since 0.1.0
  12037. * @category Lang
  12038. * @param {*} value The value to compare.
  12039. * @param {*} other The other value to compare.
  12040. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12041. * @example
  12042. *
  12043. * var object = { 'a': 1 };
  12044. * var other = { 'a': 1 };
  12045. *
  12046. * _.isEqual(object, other);
  12047. * // => true
  12048. *
  12049. * object === other;
  12050. * // => false
  12051. */
  12052. function isEqual(value, other) {
  12053. return baseIsEqual(value, other);
  12054. }
  12055. /**
  12056. * This method is like `_.isEqual` except that it accepts `customizer` which
  12057. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12058. * are handled by the method instead. The `customizer` is invoked with up to
  12059. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12060. *
  12061. * @static
  12062. * @memberOf _
  12063. * @since 4.0.0
  12064. * @category Lang
  12065. * @param {*} value The value to compare.
  12066. * @param {*} other The other value to compare.
  12067. * @param {Function} [customizer] The function to customize comparisons.
  12068. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12069. * @example
  12070. *
  12071. * function isGreeting(value) {
  12072. * return /^h(?:i|ello)$/.test(value);
  12073. * }
  12074. *
  12075. * function customizer(objValue, othValue) {
  12076. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12077. * return true;
  12078. * }
  12079. * }
  12080. *
  12081. * var array = ['hello', 'goodbye'];
  12082. * var other = ['hi', 'goodbye'];
  12083. *
  12084. * _.isEqualWith(array, other, customizer);
  12085. * // => true
  12086. */
  12087. function isEqualWith(value, other, customizer) {
  12088. customizer = typeof customizer == 'function' ? customizer : undefined;
  12089. var result = customizer ? customizer(value, other) : undefined;
  12090. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12091. }
  12092. /**
  12093. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12094. * `SyntaxError`, `TypeError`, or `URIError` object.
  12095. *
  12096. * @static
  12097. * @memberOf _
  12098. * @since 3.0.0
  12099. * @category Lang
  12100. * @param {*} value The value to check.
  12101. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12102. * @example
  12103. *
  12104. * _.isError(new Error);
  12105. * // => true
  12106. *
  12107. * _.isError(Error);
  12108. * // => false
  12109. */
  12110. function isError(value) {
  12111. if (!isObjectLike(value)) {
  12112. return false;
  12113. }
  12114. var tag = baseGetTag(value);
  12115. return tag == errorTag || tag == domExcTag ||
  12116. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12117. }
  12118. /**
  12119. * Checks if `value` is a finite primitive number.
  12120. *
  12121. * **Note:** This method is based on
  12122. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12123. *
  12124. * @static
  12125. * @memberOf _
  12126. * @since 0.1.0
  12127. * @category Lang
  12128. * @param {*} value The value to check.
  12129. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12130. * @example
  12131. *
  12132. * _.isFinite(3);
  12133. * // => true
  12134. *
  12135. * _.isFinite(Number.MIN_VALUE);
  12136. * // => true
  12137. *
  12138. * _.isFinite(Infinity);
  12139. * // => false
  12140. *
  12141. * _.isFinite('3');
  12142. * // => false
  12143. */
  12144. function isFinite(value) {
  12145. return typeof value == 'number' && nativeIsFinite(value);
  12146. }
  12147. /**
  12148. * Checks if `value` is classified as a `Function` object.
  12149. *
  12150. * @static
  12151. * @memberOf _
  12152. * @since 0.1.0
  12153. * @category Lang
  12154. * @param {*} value The value to check.
  12155. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12156. * @example
  12157. *
  12158. * _.isFunction(_);
  12159. * // => true
  12160. *
  12161. * _.isFunction(/abc/);
  12162. * // => false
  12163. */
  12164. function isFunction(value) {
  12165. if (!isObject(value)) {
  12166. return false;
  12167. }
  12168. // The use of `Object#toString` avoids issues with the `typeof` operator
  12169. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12170. var tag = baseGetTag(value);
  12171. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12172. }
  12173. /**
  12174. * Checks if `value` is an integer.
  12175. *
  12176. * **Note:** This method is based on
  12177. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 4.0.0
  12182. * @category Lang
  12183. * @param {*} value The value to check.
  12184. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12185. * @example
  12186. *
  12187. * _.isInteger(3);
  12188. * // => true
  12189. *
  12190. * _.isInteger(Number.MIN_VALUE);
  12191. * // => false
  12192. *
  12193. * _.isInteger(Infinity);
  12194. * // => false
  12195. *
  12196. * _.isInteger('3');
  12197. * // => false
  12198. */
  12199. function isInteger(value) {
  12200. return typeof value == 'number' && value == toInteger(value);
  12201. }
  12202. /**
  12203. * Checks if `value` is a valid array-like length.
  12204. *
  12205. * **Note:** This method is loosely based on
  12206. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12207. *
  12208. * @static
  12209. * @memberOf _
  12210. * @since 4.0.0
  12211. * @category Lang
  12212. * @param {*} value The value to check.
  12213. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12214. * @example
  12215. *
  12216. * _.isLength(3);
  12217. * // => true
  12218. *
  12219. * _.isLength(Number.MIN_VALUE);
  12220. * // => false
  12221. *
  12222. * _.isLength(Infinity);
  12223. * // => false
  12224. *
  12225. * _.isLength('3');
  12226. * // => false
  12227. */
  12228. function isLength(value) {
  12229. return typeof value == 'number' &&
  12230. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12231. }
  12232. /**
  12233. * Checks if `value` is the
  12234. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12235. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12236. *
  12237. * @static
  12238. * @memberOf _
  12239. * @since 0.1.0
  12240. * @category Lang
  12241. * @param {*} value The value to check.
  12242. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12243. * @example
  12244. *
  12245. * _.isObject({});
  12246. * // => true
  12247. *
  12248. * _.isObject([1, 2, 3]);
  12249. * // => true
  12250. *
  12251. * _.isObject(_.noop);
  12252. * // => true
  12253. *
  12254. * _.isObject(null);
  12255. * // => false
  12256. */
  12257. function isObject(value) {
  12258. var type = typeof value;
  12259. return value != null && (type == 'object' || type == 'function');
  12260. }
  12261. /**
  12262. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12263. * and has a `typeof` result of "object".
  12264. *
  12265. * @static
  12266. * @memberOf _
  12267. * @since 4.0.0
  12268. * @category Lang
  12269. * @param {*} value The value to check.
  12270. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12271. * @example
  12272. *
  12273. * _.isObjectLike({});
  12274. * // => true
  12275. *
  12276. * _.isObjectLike([1, 2, 3]);
  12277. * // => true
  12278. *
  12279. * _.isObjectLike(_.noop);
  12280. * // => false
  12281. *
  12282. * _.isObjectLike(null);
  12283. * // => false
  12284. */
  12285. function isObjectLike(value) {
  12286. return value != null && typeof value == 'object';
  12287. }
  12288. /**
  12289. * Checks if `value` is classified as a `Map` object.
  12290. *
  12291. * @static
  12292. * @memberOf _
  12293. * @since 4.3.0
  12294. * @category Lang
  12295. * @param {*} value The value to check.
  12296. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12297. * @example
  12298. *
  12299. * _.isMap(new Map);
  12300. * // => true
  12301. *
  12302. * _.isMap(new WeakMap);
  12303. * // => false
  12304. */
  12305. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12306. /**
  12307. * Performs a partial deep comparison between `object` and `source` to
  12308. * determine if `object` contains equivalent property values.
  12309. *
  12310. * **Note:** This method is equivalent to `_.matches` when `source` is
  12311. * partially applied.
  12312. *
  12313. * Partial comparisons will match empty array and empty object `source`
  12314. * values against any array or object value, respectively. See `_.isEqual`
  12315. * for a list of supported value comparisons.
  12316. *
  12317. * @static
  12318. * @memberOf _
  12319. * @since 3.0.0
  12320. * @category Lang
  12321. * @param {Object} object The object to inspect.
  12322. * @param {Object} source The object of property values to match.
  12323. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12324. * @example
  12325. *
  12326. * var object = { 'a': 1, 'b': 2 };
  12327. *
  12328. * _.isMatch(object, { 'b': 2 });
  12329. * // => true
  12330. *
  12331. * _.isMatch(object, { 'b': 1 });
  12332. * // => false
  12333. */
  12334. function isMatch(object, source) {
  12335. return object === source || baseIsMatch(object, source, getMatchData(source));
  12336. }
  12337. /**
  12338. * This method is like `_.isMatch` except that it accepts `customizer` which
  12339. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12340. * are handled by the method instead. The `customizer` is invoked with five
  12341. * arguments: (objValue, srcValue, index|key, object, source).
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 4.0.0
  12346. * @category Lang
  12347. * @param {Object} object The object to inspect.
  12348. * @param {Object} source The object of property values to match.
  12349. * @param {Function} [customizer] The function to customize comparisons.
  12350. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12351. * @example
  12352. *
  12353. * function isGreeting(value) {
  12354. * return /^h(?:i|ello)$/.test(value);
  12355. * }
  12356. *
  12357. * function customizer(objValue, srcValue) {
  12358. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12359. * return true;
  12360. * }
  12361. * }
  12362. *
  12363. * var object = { 'greeting': 'hello' };
  12364. * var source = { 'greeting': 'hi' };
  12365. *
  12366. * _.isMatchWith(object, source, customizer);
  12367. * // => true
  12368. */
  12369. function isMatchWith(object, source, customizer) {
  12370. customizer = typeof customizer == 'function' ? customizer : undefined;
  12371. return baseIsMatch(object, source, getMatchData(source), customizer);
  12372. }
  12373. /**
  12374. * Checks if `value` is `NaN`.
  12375. *
  12376. * **Note:** This method is based on
  12377. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12378. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12379. * `undefined` and other non-number values.
  12380. *
  12381. * @static
  12382. * @memberOf _
  12383. * @since 0.1.0
  12384. * @category Lang
  12385. * @param {*} value The value to check.
  12386. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12387. * @example
  12388. *
  12389. * _.isNaN(NaN);
  12390. * // => true
  12391. *
  12392. * _.isNaN(new Number(NaN));
  12393. * // => true
  12394. *
  12395. * isNaN(undefined);
  12396. * // => true
  12397. *
  12398. * _.isNaN(undefined);
  12399. * // => false
  12400. */
  12401. function isNaN(value) {
  12402. // An `NaN` primitive is the only value that is not equal to itself.
  12403. // Perform the `toStringTag` check first to avoid errors with some
  12404. // ActiveX objects in IE.
  12405. return isNumber(value) && value != +value;
  12406. }
  12407. /**
  12408. * Checks if `value` is a pristine native function.
  12409. *
  12410. * **Note:** This method can't reliably detect native functions in the presence
  12411. * of the core-js package because core-js circumvents this kind of detection.
  12412. * Despite multiple requests, the core-js maintainer has made it clear: any
  12413. * attempt to fix the detection will be obstructed. As a result, we're left
  12414. * with little choice but to throw an error. Unfortunately, this also affects
  12415. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12416. * which rely on core-js.
  12417. *
  12418. * @static
  12419. * @memberOf _
  12420. * @since 3.0.0
  12421. * @category Lang
  12422. * @param {*} value The value to check.
  12423. * @returns {boolean} Returns `true` if `value` is a native function,
  12424. * else `false`.
  12425. * @example
  12426. *
  12427. * _.isNative(Array.prototype.push);
  12428. * // => true
  12429. *
  12430. * _.isNative(_);
  12431. * // => false
  12432. */
  12433. function isNative(value) {
  12434. if (isMaskable(value)) {
  12435. throw new Error(CORE_ERROR_TEXT);
  12436. }
  12437. return baseIsNative(value);
  12438. }
  12439. /**
  12440. * Checks if `value` is `null`.
  12441. *
  12442. * @static
  12443. * @memberOf _
  12444. * @since 0.1.0
  12445. * @category Lang
  12446. * @param {*} value The value to check.
  12447. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12448. * @example
  12449. *
  12450. * _.isNull(null);
  12451. * // => true
  12452. *
  12453. * _.isNull(void 0);
  12454. * // => false
  12455. */
  12456. function isNull(value) {
  12457. return value === null;
  12458. }
  12459. /**
  12460. * Checks if `value` is `null` or `undefined`.
  12461. *
  12462. * @static
  12463. * @memberOf _
  12464. * @since 4.0.0
  12465. * @category Lang
  12466. * @param {*} value The value to check.
  12467. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12468. * @example
  12469. *
  12470. * _.isNil(null);
  12471. * // => true
  12472. *
  12473. * _.isNil(void 0);
  12474. * // => true
  12475. *
  12476. * _.isNil(NaN);
  12477. * // => false
  12478. */
  12479. function isNil(value) {
  12480. return value == null;
  12481. }
  12482. /**
  12483. * Checks if `value` is classified as a `Number` primitive or object.
  12484. *
  12485. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12486. * classified as numbers, use the `_.isFinite` method.
  12487. *
  12488. * @static
  12489. * @memberOf _
  12490. * @since 0.1.0
  12491. * @category Lang
  12492. * @param {*} value The value to check.
  12493. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12494. * @example
  12495. *
  12496. * _.isNumber(3);
  12497. * // => true
  12498. *
  12499. * _.isNumber(Number.MIN_VALUE);
  12500. * // => true
  12501. *
  12502. * _.isNumber(Infinity);
  12503. * // => true
  12504. *
  12505. * _.isNumber('3');
  12506. * // => false
  12507. */
  12508. function isNumber(value) {
  12509. return typeof value == 'number' ||
  12510. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12511. }
  12512. /**
  12513. * Checks if `value` is a plain object, that is, an object created by the
  12514. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12515. *
  12516. * @static
  12517. * @memberOf _
  12518. * @since 0.8.0
  12519. * @category Lang
  12520. * @param {*} value The value to check.
  12521. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12522. * @example
  12523. *
  12524. * function Foo() {
  12525. * this.a = 1;
  12526. * }
  12527. *
  12528. * _.isPlainObject(new Foo);
  12529. * // => false
  12530. *
  12531. * _.isPlainObject([1, 2, 3]);
  12532. * // => false
  12533. *
  12534. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12535. * // => true
  12536. *
  12537. * _.isPlainObject(Object.create(null));
  12538. * // => true
  12539. */
  12540. function isPlainObject(value) {
  12541. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12542. return false;
  12543. }
  12544. var proto = getPrototype(value);
  12545. if (proto === null) {
  12546. return true;
  12547. }
  12548. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12549. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12550. funcToString.call(Ctor) == objectCtorString;
  12551. }
  12552. /**
  12553. * Checks if `value` is classified as a `RegExp` object.
  12554. *
  12555. * @static
  12556. * @memberOf _
  12557. * @since 0.1.0
  12558. * @category Lang
  12559. * @param {*} value The value to check.
  12560. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12561. * @example
  12562. *
  12563. * _.isRegExp(/abc/);
  12564. * // => true
  12565. *
  12566. * _.isRegExp('/abc/');
  12567. * // => false
  12568. */
  12569. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12570. /**
  12571. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12572. * double precision number which isn't the result of a rounded unsafe integer.
  12573. *
  12574. * **Note:** This method is based on
  12575. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12576. *
  12577. * @static
  12578. * @memberOf _
  12579. * @since 4.0.0
  12580. * @category Lang
  12581. * @param {*} value The value to check.
  12582. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12583. * @example
  12584. *
  12585. * _.isSafeInteger(3);
  12586. * // => true
  12587. *
  12588. * _.isSafeInteger(Number.MIN_VALUE);
  12589. * // => false
  12590. *
  12591. * _.isSafeInteger(Infinity);
  12592. * // => false
  12593. *
  12594. * _.isSafeInteger('3');
  12595. * // => false
  12596. */
  12597. function isSafeInteger(value) {
  12598. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12599. }
  12600. /**
  12601. * Checks if `value` is classified as a `Set` object.
  12602. *
  12603. * @static
  12604. * @memberOf _
  12605. * @since 4.3.0
  12606. * @category Lang
  12607. * @param {*} value The value to check.
  12608. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12609. * @example
  12610. *
  12611. * _.isSet(new Set);
  12612. * // => true
  12613. *
  12614. * _.isSet(new WeakSet);
  12615. * // => false
  12616. */
  12617. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12618. /**
  12619. * Checks if `value` is classified as a `String` primitive or object.
  12620. *
  12621. * @static
  12622. * @since 0.1.0
  12623. * @memberOf _
  12624. * @category Lang
  12625. * @param {*} value The value to check.
  12626. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12627. * @example
  12628. *
  12629. * _.isString('abc');
  12630. * // => true
  12631. *
  12632. * _.isString(1);
  12633. * // => false
  12634. */
  12635. function isString(value) {
  12636. return typeof value == 'string' ||
  12637. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12638. }
  12639. /**
  12640. * Checks if `value` is classified as a `Symbol` primitive or object.
  12641. *
  12642. * @static
  12643. * @memberOf _
  12644. * @since 4.0.0
  12645. * @category Lang
  12646. * @param {*} value The value to check.
  12647. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12648. * @example
  12649. *
  12650. * _.isSymbol(Symbol.iterator);
  12651. * // => true
  12652. *
  12653. * _.isSymbol('abc');
  12654. * // => false
  12655. */
  12656. function isSymbol(value) {
  12657. return typeof value == 'symbol' ||
  12658. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12659. }
  12660. /**
  12661. * Checks if `value` is classified as a typed array.
  12662. *
  12663. * @static
  12664. * @memberOf _
  12665. * @since 3.0.0
  12666. * @category Lang
  12667. * @param {*} value The value to check.
  12668. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12669. * @example
  12670. *
  12671. * _.isTypedArray(new Uint8Array);
  12672. * // => true
  12673. *
  12674. * _.isTypedArray([]);
  12675. * // => false
  12676. */
  12677. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12678. /**
  12679. * Checks if `value` is `undefined`.
  12680. *
  12681. * @static
  12682. * @since 0.1.0
  12683. * @memberOf _
  12684. * @category Lang
  12685. * @param {*} value The value to check.
  12686. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12687. * @example
  12688. *
  12689. * _.isUndefined(void 0);
  12690. * // => true
  12691. *
  12692. * _.isUndefined(null);
  12693. * // => false
  12694. */
  12695. function isUndefined(value) {
  12696. return value === undefined;
  12697. }
  12698. /**
  12699. * Checks if `value` is classified as a `WeakMap` object.
  12700. *
  12701. * @static
  12702. * @memberOf _
  12703. * @since 4.3.0
  12704. * @category Lang
  12705. * @param {*} value The value to check.
  12706. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12707. * @example
  12708. *
  12709. * _.isWeakMap(new WeakMap);
  12710. * // => true
  12711. *
  12712. * _.isWeakMap(new Map);
  12713. * // => false
  12714. */
  12715. function isWeakMap(value) {
  12716. return isObjectLike(value) && getTag(value) == weakMapTag;
  12717. }
  12718. /**
  12719. * Checks if `value` is classified as a `WeakSet` object.
  12720. *
  12721. * @static
  12722. * @memberOf _
  12723. * @since 4.3.0
  12724. * @category Lang
  12725. * @param {*} value The value to check.
  12726. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12727. * @example
  12728. *
  12729. * _.isWeakSet(new WeakSet);
  12730. * // => true
  12731. *
  12732. * _.isWeakSet(new Set);
  12733. * // => false
  12734. */
  12735. function isWeakSet(value) {
  12736. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12737. }
  12738. /**
  12739. * Checks if `value` is less than `other`.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 3.9.0
  12744. * @category Lang
  12745. * @param {*} value The value to compare.
  12746. * @param {*} other The other value to compare.
  12747. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12748. * else `false`.
  12749. * @see _.gt
  12750. * @example
  12751. *
  12752. * _.lt(1, 3);
  12753. * // => true
  12754. *
  12755. * _.lt(3, 3);
  12756. * // => false
  12757. *
  12758. * _.lt(3, 1);
  12759. * // => false
  12760. */
  12761. var lt = createRelationalOperation(baseLt);
  12762. /**
  12763. * Checks if `value` is less than or equal to `other`.
  12764. *
  12765. * @static
  12766. * @memberOf _
  12767. * @since 3.9.0
  12768. * @category Lang
  12769. * @param {*} value The value to compare.
  12770. * @param {*} other The other value to compare.
  12771. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12772. * `other`, else `false`.
  12773. * @see _.gte
  12774. * @example
  12775. *
  12776. * _.lte(1, 3);
  12777. * // => true
  12778. *
  12779. * _.lte(3, 3);
  12780. * // => true
  12781. *
  12782. * _.lte(3, 1);
  12783. * // => false
  12784. */
  12785. var lte = createRelationalOperation(function(value, other) {
  12786. return value <= other;
  12787. });
  12788. /**
  12789. * Converts `value` to an array.
  12790. *
  12791. * @static
  12792. * @since 0.1.0
  12793. * @memberOf _
  12794. * @category Lang
  12795. * @param {*} value The value to convert.
  12796. * @returns {Array} Returns the converted array.
  12797. * @example
  12798. *
  12799. * _.toArray({ 'a': 1, 'b': 2 });
  12800. * // => [1, 2]
  12801. *
  12802. * _.toArray('abc');
  12803. * // => ['a', 'b', 'c']
  12804. *
  12805. * _.toArray(1);
  12806. * // => []
  12807. *
  12808. * _.toArray(null);
  12809. * // => []
  12810. */
  12811. function toArray(value) {
  12812. if (!value) {
  12813. return [];
  12814. }
  12815. if (isArrayLike(value)) {
  12816. return isString(value) ? stringToArray(value) : copyArray(value);
  12817. }
  12818. if (symIterator && value[symIterator]) {
  12819. return iteratorToArray(value[symIterator]());
  12820. }
  12821. var tag = getTag(value),
  12822. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12823. return func(value);
  12824. }
  12825. /**
  12826. * Converts `value` to a finite number.
  12827. *
  12828. * @static
  12829. * @memberOf _
  12830. * @since 4.12.0
  12831. * @category Lang
  12832. * @param {*} value The value to convert.
  12833. * @returns {number} Returns the converted number.
  12834. * @example
  12835. *
  12836. * _.toFinite(3.2);
  12837. * // => 3.2
  12838. *
  12839. * _.toFinite(Number.MIN_VALUE);
  12840. * // => 5e-324
  12841. *
  12842. * _.toFinite(Infinity);
  12843. * // => 1.7976931348623157e+308
  12844. *
  12845. * _.toFinite('3.2');
  12846. * // => 3.2
  12847. */
  12848. function toFinite(value) {
  12849. if (!value) {
  12850. return value === 0 ? value : 0;
  12851. }
  12852. value = toNumber(value);
  12853. if (value === INFINITY || value === -INFINITY) {
  12854. var sign = (value < 0 ? -1 : 1);
  12855. return sign * MAX_INTEGER;
  12856. }
  12857. return value === value ? value : 0;
  12858. }
  12859. /**
  12860. * Converts `value` to an integer.
  12861. *
  12862. * **Note:** This method is loosely based on
  12863. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12864. *
  12865. * @static
  12866. * @memberOf _
  12867. * @since 4.0.0
  12868. * @category Lang
  12869. * @param {*} value The value to convert.
  12870. * @returns {number} Returns the converted integer.
  12871. * @example
  12872. *
  12873. * _.toInteger(3.2);
  12874. * // => 3
  12875. *
  12876. * _.toInteger(Number.MIN_VALUE);
  12877. * // => 0
  12878. *
  12879. * _.toInteger(Infinity);
  12880. * // => 1.7976931348623157e+308
  12881. *
  12882. * _.toInteger('3.2');
  12883. * // => 3
  12884. */
  12885. function toInteger(value) {
  12886. var result = toFinite(value),
  12887. remainder = result % 1;
  12888. return result === result ? (remainder ? result - remainder : result) : 0;
  12889. }
  12890. /**
  12891. * Converts `value` to an integer suitable for use as the length of an
  12892. * array-like object.
  12893. *
  12894. * **Note:** This method is based on
  12895. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12896. *
  12897. * @static
  12898. * @memberOf _
  12899. * @since 4.0.0
  12900. * @category Lang
  12901. * @param {*} value The value to convert.
  12902. * @returns {number} Returns the converted integer.
  12903. * @example
  12904. *
  12905. * _.toLength(3.2);
  12906. * // => 3
  12907. *
  12908. * _.toLength(Number.MIN_VALUE);
  12909. * // => 0
  12910. *
  12911. * _.toLength(Infinity);
  12912. * // => 4294967295
  12913. *
  12914. * _.toLength('3.2');
  12915. * // => 3
  12916. */
  12917. function toLength(value) {
  12918. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12919. }
  12920. /**
  12921. * Converts `value` to a number.
  12922. *
  12923. * @static
  12924. * @memberOf _
  12925. * @since 4.0.0
  12926. * @category Lang
  12927. * @param {*} value The value to process.
  12928. * @returns {number} Returns the number.
  12929. * @example
  12930. *
  12931. * _.toNumber(3.2);
  12932. * // => 3.2
  12933. *
  12934. * _.toNumber(Number.MIN_VALUE);
  12935. * // => 5e-324
  12936. *
  12937. * _.toNumber(Infinity);
  12938. * // => Infinity
  12939. *
  12940. * _.toNumber('3.2');
  12941. * // => 3.2
  12942. */
  12943. function toNumber(value) {
  12944. if (typeof value == 'number') {
  12945. return value;
  12946. }
  12947. if (isSymbol(value)) {
  12948. return NAN;
  12949. }
  12950. if (isObject(value)) {
  12951. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12952. value = isObject(other) ? (other + '') : other;
  12953. }
  12954. if (typeof value != 'string') {
  12955. return value === 0 ? value : +value;
  12956. }
  12957. value = baseTrim(value);
  12958. var isBinary = reIsBinary.test(value);
  12959. return (isBinary || reIsOctal.test(value))
  12960. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12961. : (reIsBadHex.test(value) ? NAN : +value);
  12962. }
  12963. /**
  12964. * Converts `value` to a plain object flattening inherited enumerable string
  12965. * keyed properties of `value` to own properties of the plain object.
  12966. *
  12967. * @static
  12968. * @memberOf _
  12969. * @since 3.0.0
  12970. * @category Lang
  12971. * @param {*} value The value to convert.
  12972. * @returns {Object} Returns the converted plain object.
  12973. * @example
  12974. *
  12975. * function Foo() {
  12976. * this.b = 2;
  12977. * }
  12978. *
  12979. * Foo.prototype.c = 3;
  12980. *
  12981. * _.assign({ 'a': 1 }, new Foo);
  12982. * // => { 'a': 1, 'b': 2 }
  12983. *
  12984. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12985. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12986. */
  12987. function toPlainObject(value) {
  12988. return copyObject(value, keysIn(value));
  12989. }
  12990. /**
  12991. * Converts `value` to a safe integer. A safe integer can be compared and
  12992. * represented correctly.
  12993. *
  12994. * @static
  12995. * @memberOf _
  12996. * @since 4.0.0
  12997. * @category Lang
  12998. * @param {*} value The value to convert.
  12999. * @returns {number} Returns the converted integer.
  13000. * @example
  13001. *
  13002. * _.toSafeInteger(3.2);
  13003. * // => 3
  13004. *
  13005. * _.toSafeInteger(Number.MIN_VALUE);
  13006. * // => 0
  13007. *
  13008. * _.toSafeInteger(Infinity);
  13009. * // => 9007199254740991
  13010. *
  13011. * _.toSafeInteger('3.2');
  13012. * // => 3
  13013. */
  13014. function toSafeInteger(value) {
  13015. return value
  13016. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13017. : (value === 0 ? value : 0);
  13018. }
  13019. /**
  13020. * Converts `value` to a string. An empty string is returned for `null`
  13021. * and `undefined` values. The sign of `-0` is preserved.
  13022. *
  13023. * @static
  13024. * @memberOf _
  13025. * @since 4.0.0
  13026. * @category Lang
  13027. * @param {*} value The value to convert.
  13028. * @returns {string} Returns the converted string.
  13029. * @example
  13030. *
  13031. * _.toString(null);
  13032. * // => ''
  13033. *
  13034. * _.toString(-0);
  13035. * // => '-0'
  13036. *
  13037. * _.toString([1, 2, 3]);
  13038. * // => '1,2,3'
  13039. */
  13040. function toString(value) {
  13041. return value == null ? '' : baseToString(value);
  13042. }
  13043. /*------------------------------------------------------------------------*/
  13044. /**
  13045. * Assigns own enumerable string keyed properties of source objects to the
  13046. * destination object. Source objects are applied from left to right.
  13047. * Subsequent sources overwrite property assignments of previous sources.
  13048. *
  13049. * **Note:** This method mutates `object` and is loosely based on
  13050. * [`Object.assign`](https://mdn.io/Object/assign).
  13051. *
  13052. * @static
  13053. * @memberOf _
  13054. * @since 0.10.0
  13055. * @category Object
  13056. * @param {Object} object The destination object.
  13057. * @param {...Object} [sources] The source objects.
  13058. * @returns {Object} Returns `object`.
  13059. * @see _.assignIn
  13060. * @example
  13061. *
  13062. * function Foo() {
  13063. * this.a = 1;
  13064. * }
  13065. *
  13066. * function Bar() {
  13067. * this.c = 3;
  13068. * }
  13069. *
  13070. * Foo.prototype.b = 2;
  13071. * Bar.prototype.d = 4;
  13072. *
  13073. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13074. * // => { 'a': 1, 'c': 3 }
  13075. */
  13076. var assign = createAssigner(function(object, source) {
  13077. if (isPrototype(source) || isArrayLike(source)) {
  13078. copyObject(source, keys(source), object);
  13079. return;
  13080. }
  13081. for (var key in source) {
  13082. if (hasOwnProperty.call(source, key)) {
  13083. assignValue(object, key, source[key]);
  13084. }
  13085. }
  13086. });
  13087. /**
  13088. * This method is like `_.assign` except that it iterates over own and
  13089. * inherited source properties.
  13090. *
  13091. * **Note:** This method mutates `object`.
  13092. *
  13093. * @static
  13094. * @memberOf _
  13095. * @since 4.0.0
  13096. * @alias extend
  13097. * @category Object
  13098. * @param {Object} object The destination object.
  13099. * @param {...Object} [sources] The source objects.
  13100. * @returns {Object} Returns `object`.
  13101. * @see _.assign
  13102. * @example
  13103. *
  13104. * function Foo() {
  13105. * this.a = 1;
  13106. * }
  13107. *
  13108. * function Bar() {
  13109. * this.c = 3;
  13110. * }
  13111. *
  13112. * Foo.prototype.b = 2;
  13113. * Bar.prototype.d = 4;
  13114. *
  13115. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13116. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13117. */
  13118. var assignIn = createAssigner(function(object, source) {
  13119. copyObject(source, keysIn(source), object);
  13120. });
  13121. /**
  13122. * This method is like `_.assignIn` except that it accepts `customizer`
  13123. * which is invoked to produce the assigned values. If `customizer` returns
  13124. * `undefined`, assignment is handled by the method instead. The `customizer`
  13125. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13126. *
  13127. * **Note:** This method mutates `object`.
  13128. *
  13129. * @static
  13130. * @memberOf _
  13131. * @since 4.0.0
  13132. * @alias extendWith
  13133. * @category Object
  13134. * @param {Object} object The destination object.
  13135. * @param {...Object} sources The source objects.
  13136. * @param {Function} [customizer] The function to customize assigned values.
  13137. * @returns {Object} Returns `object`.
  13138. * @see _.assignWith
  13139. * @example
  13140. *
  13141. * function customizer(objValue, srcValue) {
  13142. * return _.isUndefined(objValue) ? srcValue : objValue;
  13143. * }
  13144. *
  13145. * var defaults = _.partialRight(_.assignInWith, customizer);
  13146. *
  13147. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13148. * // => { 'a': 1, 'b': 2 }
  13149. */
  13150. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13151. copyObject(source, keysIn(source), object, customizer);
  13152. });
  13153. /**
  13154. * This method is like `_.assign` except that it accepts `customizer`
  13155. * which is invoked to produce the assigned values. If `customizer` returns
  13156. * `undefined`, assignment is handled by the method instead. The `customizer`
  13157. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13158. *
  13159. * **Note:** This method mutates `object`.
  13160. *
  13161. * @static
  13162. * @memberOf _
  13163. * @since 4.0.0
  13164. * @category Object
  13165. * @param {Object} object The destination object.
  13166. * @param {...Object} sources The source objects.
  13167. * @param {Function} [customizer] The function to customize assigned values.
  13168. * @returns {Object} Returns `object`.
  13169. * @see _.assignInWith
  13170. * @example
  13171. *
  13172. * function customizer(objValue, srcValue) {
  13173. * return _.isUndefined(objValue) ? srcValue : objValue;
  13174. * }
  13175. *
  13176. * var defaults = _.partialRight(_.assignWith, customizer);
  13177. *
  13178. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13179. * // => { 'a': 1, 'b': 2 }
  13180. */
  13181. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13182. copyObject(source, keys(source), object, customizer);
  13183. });
  13184. /**
  13185. * Creates an array of values corresponding to `paths` of `object`.
  13186. *
  13187. * @static
  13188. * @memberOf _
  13189. * @since 1.0.0
  13190. * @category Object
  13191. * @param {Object} object The object to iterate over.
  13192. * @param {...(string|string[])} [paths] The property paths to pick.
  13193. * @returns {Array} Returns the picked values.
  13194. * @example
  13195. *
  13196. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13197. *
  13198. * _.at(object, ['a[0].b.c', 'a[1]']);
  13199. * // => [3, 4]
  13200. */
  13201. var at = flatRest(baseAt);
  13202. /**
  13203. * Creates an object that inherits from the `prototype` object. If a
  13204. * `properties` object is given, its own enumerable string keyed properties
  13205. * are assigned to the created object.
  13206. *
  13207. * @static
  13208. * @memberOf _
  13209. * @since 2.3.0
  13210. * @category Object
  13211. * @param {Object} prototype The object to inherit from.
  13212. * @param {Object} [properties] The properties to assign to the object.
  13213. * @returns {Object} Returns the new object.
  13214. * @example
  13215. *
  13216. * function Shape() {
  13217. * this.x = 0;
  13218. * this.y = 0;
  13219. * }
  13220. *
  13221. * function Circle() {
  13222. * Shape.call(this);
  13223. * }
  13224. *
  13225. * Circle.prototype = _.create(Shape.prototype, {
  13226. * 'constructor': Circle
  13227. * });
  13228. *
  13229. * var circle = new Circle;
  13230. * circle instanceof Circle;
  13231. * // => true
  13232. *
  13233. * circle instanceof Shape;
  13234. * // => true
  13235. */
  13236. function create(prototype, properties) {
  13237. var result = baseCreate(prototype);
  13238. return properties == null ? result : baseAssign(result, properties);
  13239. }
  13240. /**
  13241. * Assigns own and inherited enumerable string keyed properties of source
  13242. * objects to the destination object for all destination properties that
  13243. * resolve to `undefined`. Source objects are applied from left to right.
  13244. * Once a property is set, additional values of the same property are ignored.
  13245. *
  13246. * **Note:** This method mutates `object`.
  13247. *
  13248. * @static
  13249. * @since 0.1.0
  13250. * @memberOf _
  13251. * @category Object
  13252. * @param {Object} object The destination object.
  13253. * @param {...Object} [sources] The source objects.
  13254. * @returns {Object} Returns `object`.
  13255. * @see _.defaultsDeep
  13256. * @example
  13257. *
  13258. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13259. * // => { 'a': 1, 'b': 2 }
  13260. */
  13261. var defaults = baseRest(function(object, sources) {
  13262. object = Object(object);
  13263. var index = -1;
  13264. var length = sources.length;
  13265. var guard = length > 2 ? sources[2] : undefined;
  13266. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13267. length = 1;
  13268. }
  13269. while (++index < length) {
  13270. var source = sources[index];
  13271. var props = keysIn(source);
  13272. var propsIndex = -1;
  13273. var propsLength = props.length;
  13274. while (++propsIndex < propsLength) {
  13275. var key = props[propsIndex];
  13276. var value = object[key];
  13277. if (value === undefined ||
  13278. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13279. object[key] = source[key];
  13280. }
  13281. }
  13282. }
  13283. return object;
  13284. });
  13285. /**
  13286. * This method is like `_.defaults` except that it recursively assigns
  13287. * default properties.
  13288. *
  13289. * **Note:** This method mutates `object`.
  13290. *
  13291. * @static
  13292. * @memberOf _
  13293. * @since 3.10.0
  13294. * @category Object
  13295. * @param {Object} object The destination object.
  13296. * @param {...Object} [sources] The source objects.
  13297. * @returns {Object} Returns `object`.
  13298. * @see _.defaults
  13299. * @example
  13300. *
  13301. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13302. * // => { 'a': { 'b': 2, 'c': 3 } }
  13303. */
  13304. var defaultsDeep = baseRest(function(args) {
  13305. args.push(undefined, customDefaultsMerge);
  13306. return apply(mergeWith, undefined, args);
  13307. });
  13308. /**
  13309. * This method is like `_.find` except that it returns the key of the first
  13310. * element `predicate` returns truthy for instead of the element itself.
  13311. *
  13312. * @static
  13313. * @memberOf _
  13314. * @since 1.1.0
  13315. * @category Object
  13316. * @param {Object} object The object to inspect.
  13317. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13318. * @returns {string|undefined} Returns the key of the matched element,
  13319. * else `undefined`.
  13320. * @example
  13321. *
  13322. * var users = {
  13323. * 'barney': { 'age': 36, 'active': true },
  13324. * 'fred': { 'age': 40, 'active': false },
  13325. * 'pebbles': { 'age': 1, 'active': true }
  13326. * };
  13327. *
  13328. * _.findKey(users, function(o) { return o.age < 40; });
  13329. * // => 'barney' (iteration order is not guaranteed)
  13330. *
  13331. * // The `_.matches` iteratee shorthand.
  13332. * _.findKey(users, { 'age': 1, 'active': true });
  13333. * // => 'pebbles'
  13334. *
  13335. * // The `_.matchesProperty` iteratee shorthand.
  13336. * _.findKey(users, ['active', false]);
  13337. * // => 'fred'
  13338. *
  13339. * // The `_.property` iteratee shorthand.
  13340. * _.findKey(users, 'active');
  13341. * // => 'barney'
  13342. */
  13343. function findKey(object, predicate) {
  13344. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13345. }
  13346. /**
  13347. * This method is like `_.findKey` except that it iterates over elements of
  13348. * a collection in the opposite order.
  13349. *
  13350. * @static
  13351. * @memberOf _
  13352. * @since 2.0.0
  13353. * @category Object
  13354. * @param {Object} object The object to inspect.
  13355. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13356. * @returns {string|undefined} Returns the key of the matched element,
  13357. * else `undefined`.
  13358. * @example
  13359. *
  13360. * var users = {
  13361. * 'barney': { 'age': 36, 'active': true },
  13362. * 'fred': { 'age': 40, 'active': false },
  13363. * 'pebbles': { 'age': 1, 'active': true }
  13364. * };
  13365. *
  13366. * _.findLastKey(users, function(o) { return o.age < 40; });
  13367. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13368. *
  13369. * // The `_.matches` iteratee shorthand.
  13370. * _.findLastKey(users, { 'age': 36, 'active': true });
  13371. * // => 'barney'
  13372. *
  13373. * // The `_.matchesProperty` iteratee shorthand.
  13374. * _.findLastKey(users, ['active', false]);
  13375. * // => 'fred'
  13376. *
  13377. * // The `_.property` iteratee shorthand.
  13378. * _.findLastKey(users, 'active');
  13379. * // => 'pebbles'
  13380. */
  13381. function findLastKey(object, predicate) {
  13382. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13383. }
  13384. /**
  13385. * Iterates over own and inherited enumerable string keyed properties of an
  13386. * object and invokes `iteratee` for each property. The iteratee is invoked
  13387. * with three arguments: (value, key, object). Iteratee functions may exit
  13388. * iteration early by explicitly returning `false`.
  13389. *
  13390. * @static
  13391. * @memberOf _
  13392. * @since 0.3.0
  13393. * @category Object
  13394. * @param {Object} object The object to iterate over.
  13395. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13396. * @returns {Object} Returns `object`.
  13397. * @see _.forInRight
  13398. * @example
  13399. *
  13400. * function Foo() {
  13401. * this.a = 1;
  13402. * this.b = 2;
  13403. * }
  13404. *
  13405. * Foo.prototype.c = 3;
  13406. *
  13407. * _.forIn(new Foo, function(value, key) {
  13408. * console.log(key);
  13409. * });
  13410. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13411. */
  13412. function forIn(object, iteratee) {
  13413. return object == null
  13414. ? object
  13415. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13416. }
  13417. /**
  13418. * This method is like `_.forIn` except that it iterates over properties of
  13419. * `object` in the opposite order.
  13420. *
  13421. * @static
  13422. * @memberOf _
  13423. * @since 2.0.0
  13424. * @category Object
  13425. * @param {Object} object The object to iterate over.
  13426. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13427. * @returns {Object} Returns `object`.
  13428. * @see _.forIn
  13429. * @example
  13430. *
  13431. * function Foo() {
  13432. * this.a = 1;
  13433. * this.b = 2;
  13434. * }
  13435. *
  13436. * Foo.prototype.c = 3;
  13437. *
  13438. * _.forInRight(new Foo, function(value, key) {
  13439. * console.log(key);
  13440. * });
  13441. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13442. */
  13443. function forInRight(object, iteratee) {
  13444. return object == null
  13445. ? object
  13446. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13447. }
  13448. /**
  13449. * Iterates over own enumerable string keyed properties of an object and
  13450. * invokes `iteratee` for each property. The iteratee is invoked with three
  13451. * arguments: (value, key, object). Iteratee functions may exit iteration
  13452. * early by explicitly returning `false`.
  13453. *
  13454. * @static
  13455. * @memberOf _
  13456. * @since 0.3.0
  13457. * @category Object
  13458. * @param {Object} object The object to iterate over.
  13459. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13460. * @returns {Object} Returns `object`.
  13461. * @see _.forOwnRight
  13462. * @example
  13463. *
  13464. * function Foo() {
  13465. * this.a = 1;
  13466. * this.b = 2;
  13467. * }
  13468. *
  13469. * Foo.prototype.c = 3;
  13470. *
  13471. * _.forOwn(new Foo, function(value, key) {
  13472. * console.log(key);
  13473. * });
  13474. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13475. */
  13476. function forOwn(object, iteratee) {
  13477. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13478. }
  13479. /**
  13480. * This method is like `_.forOwn` except that it iterates over properties of
  13481. * `object` in the opposite order.
  13482. *
  13483. * @static
  13484. * @memberOf _
  13485. * @since 2.0.0
  13486. * @category Object
  13487. * @param {Object} object The object to iterate over.
  13488. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13489. * @returns {Object} Returns `object`.
  13490. * @see _.forOwn
  13491. * @example
  13492. *
  13493. * function Foo() {
  13494. * this.a = 1;
  13495. * this.b = 2;
  13496. * }
  13497. *
  13498. * Foo.prototype.c = 3;
  13499. *
  13500. * _.forOwnRight(new Foo, function(value, key) {
  13501. * console.log(key);
  13502. * });
  13503. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13504. */
  13505. function forOwnRight(object, iteratee) {
  13506. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13507. }
  13508. /**
  13509. * Creates an array of function property names from own enumerable properties
  13510. * of `object`.
  13511. *
  13512. * @static
  13513. * @since 0.1.0
  13514. * @memberOf _
  13515. * @category Object
  13516. * @param {Object} object The object to inspect.
  13517. * @returns {Array} Returns the function names.
  13518. * @see _.functionsIn
  13519. * @example
  13520. *
  13521. * function Foo() {
  13522. * this.a = _.constant('a');
  13523. * this.b = _.constant('b');
  13524. * }
  13525. *
  13526. * Foo.prototype.c = _.constant('c');
  13527. *
  13528. * _.functions(new Foo);
  13529. * // => ['a', 'b']
  13530. */
  13531. function functions(object) {
  13532. return object == null ? [] : baseFunctions(object, keys(object));
  13533. }
  13534. /**
  13535. * Creates an array of function property names from own and inherited
  13536. * enumerable properties of `object`.
  13537. *
  13538. * @static
  13539. * @memberOf _
  13540. * @since 4.0.0
  13541. * @category Object
  13542. * @param {Object} object The object to inspect.
  13543. * @returns {Array} Returns the function names.
  13544. * @see _.functions
  13545. * @example
  13546. *
  13547. * function Foo() {
  13548. * this.a = _.constant('a');
  13549. * this.b = _.constant('b');
  13550. * }
  13551. *
  13552. * Foo.prototype.c = _.constant('c');
  13553. *
  13554. * _.functionsIn(new Foo);
  13555. * // => ['a', 'b', 'c']
  13556. */
  13557. function functionsIn(object) {
  13558. return object == null ? [] : baseFunctions(object, keysIn(object));
  13559. }
  13560. /**
  13561. * Gets the value at `path` of `object`. If the resolved value is
  13562. * `undefined`, the `defaultValue` is returned in its place.
  13563. *
  13564. * @static
  13565. * @memberOf _
  13566. * @since 3.7.0
  13567. * @category Object
  13568. * @param {Object} object The object to query.
  13569. * @param {Array|string} path The path of the property to get.
  13570. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13571. * @returns {*} Returns the resolved value.
  13572. * @example
  13573. *
  13574. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13575. *
  13576. * _.get(object, 'a[0].b.c');
  13577. * // => 3
  13578. *
  13579. * _.get(object, ['a', '0', 'b', 'c']);
  13580. * // => 3
  13581. *
  13582. * _.get(object, 'a.b.c', 'default');
  13583. * // => 'default'
  13584. */
  13585. function get(object, path, defaultValue) {
  13586. var result = object == null ? undefined : baseGet(object, path);
  13587. return result === undefined ? defaultValue : result;
  13588. }
  13589. /**
  13590. * Checks if `path` is a direct property of `object`.
  13591. *
  13592. * @static
  13593. * @since 0.1.0
  13594. * @memberOf _
  13595. * @category Object
  13596. * @param {Object} object The object to query.
  13597. * @param {Array|string} path The path to check.
  13598. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13599. * @example
  13600. *
  13601. * var object = { 'a': { 'b': 2 } };
  13602. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13603. *
  13604. * _.has(object, 'a');
  13605. * // => true
  13606. *
  13607. * _.has(object, 'a.b');
  13608. * // => true
  13609. *
  13610. * _.has(object, ['a', 'b']);
  13611. * // => true
  13612. *
  13613. * _.has(other, 'a');
  13614. * // => false
  13615. */
  13616. function has(object, path) {
  13617. return object != null && hasPath(object, path, baseHas);
  13618. }
  13619. /**
  13620. * Checks if `path` is a direct or inherited property of `object`.
  13621. *
  13622. * @static
  13623. * @memberOf _
  13624. * @since 4.0.0
  13625. * @category Object
  13626. * @param {Object} object The object to query.
  13627. * @param {Array|string} path The path to check.
  13628. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13629. * @example
  13630. *
  13631. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13632. *
  13633. * _.hasIn(object, 'a');
  13634. * // => true
  13635. *
  13636. * _.hasIn(object, 'a.b');
  13637. * // => true
  13638. *
  13639. * _.hasIn(object, ['a', 'b']);
  13640. * // => true
  13641. *
  13642. * _.hasIn(object, 'b');
  13643. * // => false
  13644. */
  13645. function hasIn(object, path) {
  13646. return object != null && hasPath(object, path, baseHasIn);
  13647. }
  13648. /**
  13649. * Creates an object composed of the inverted keys and values of `object`.
  13650. * If `object` contains duplicate values, subsequent values overwrite
  13651. * property assignments of previous values.
  13652. *
  13653. * @static
  13654. * @memberOf _
  13655. * @since 0.7.0
  13656. * @category Object
  13657. * @param {Object} object The object to invert.
  13658. * @returns {Object} Returns the new inverted object.
  13659. * @example
  13660. *
  13661. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13662. *
  13663. * _.invert(object);
  13664. * // => { '1': 'c', '2': 'b' }
  13665. */
  13666. var invert = createInverter(function(result, value, key) {
  13667. if (value != null &&
  13668. typeof value.toString != 'function') {
  13669. value = nativeObjectToString.call(value);
  13670. }
  13671. result[value] = key;
  13672. }, constant(identity));
  13673. /**
  13674. * This method is like `_.invert` except that the inverted object is generated
  13675. * from the results of running each element of `object` thru `iteratee`. The
  13676. * corresponding inverted value of each inverted key is an array of keys
  13677. * responsible for generating the inverted value. The iteratee is invoked
  13678. * with one argument: (value).
  13679. *
  13680. * @static
  13681. * @memberOf _
  13682. * @since 4.1.0
  13683. * @category Object
  13684. * @param {Object} object The object to invert.
  13685. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13686. * @returns {Object} Returns the new inverted object.
  13687. * @example
  13688. *
  13689. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13690. *
  13691. * _.invertBy(object);
  13692. * // => { '1': ['a', 'c'], '2': ['b'] }
  13693. *
  13694. * _.invertBy(object, function(value) {
  13695. * return 'group' + value;
  13696. * });
  13697. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13698. */
  13699. var invertBy = createInverter(function(result, value, key) {
  13700. if (value != null &&
  13701. typeof value.toString != 'function') {
  13702. value = nativeObjectToString.call(value);
  13703. }
  13704. if (hasOwnProperty.call(result, value)) {
  13705. result[value].push(key);
  13706. } else {
  13707. result[value] = [key];
  13708. }
  13709. }, getIteratee);
  13710. /**
  13711. * Invokes the method at `path` of `object`.
  13712. *
  13713. * @static
  13714. * @memberOf _
  13715. * @since 4.0.0
  13716. * @category Object
  13717. * @param {Object} object The object to query.
  13718. * @param {Array|string} path The path of the method to invoke.
  13719. * @param {...*} [args] The arguments to invoke the method with.
  13720. * @returns {*} Returns the result of the invoked method.
  13721. * @example
  13722. *
  13723. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13724. *
  13725. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13726. * // => [2, 3]
  13727. */
  13728. var invoke = baseRest(baseInvoke);
  13729. /**
  13730. * Creates an array of the own enumerable property names of `object`.
  13731. *
  13732. * **Note:** Non-object values are coerced to objects. See the
  13733. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13734. * for more details.
  13735. *
  13736. * @static
  13737. * @since 0.1.0
  13738. * @memberOf _
  13739. * @category Object
  13740. * @param {Object} object The object to query.
  13741. * @returns {Array} Returns the array of property names.
  13742. * @example
  13743. *
  13744. * function Foo() {
  13745. * this.a = 1;
  13746. * this.b = 2;
  13747. * }
  13748. *
  13749. * Foo.prototype.c = 3;
  13750. *
  13751. * _.keys(new Foo);
  13752. * // => ['a', 'b'] (iteration order is not guaranteed)
  13753. *
  13754. * _.keys('hi');
  13755. * // => ['0', '1']
  13756. */
  13757. function keys(object) {
  13758. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13759. }
  13760. /**
  13761. * Creates an array of the own and inherited enumerable property names of `object`.
  13762. *
  13763. * **Note:** Non-object values are coerced to objects.
  13764. *
  13765. * @static
  13766. * @memberOf _
  13767. * @since 3.0.0
  13768. * @category Object
  13769. * @param {Object} object The object to query.
  13770. * @returns {Array} Returns the array of property names.
  13771. * @example
  13772. *
  13773. * function Foo() {
  13774. * this.a = 1;
  13775. * this.b = 2;
  13776. * }
  13777. *
  13778. * Foo.prototype.c = 3;
  13779. *
  13780. * _.keysIn(new Foo);
  13781. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13782. */
  13783. function keysIn(object) {
  13784. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13785. }
  13786. /**
  13787. * The opposite of `_.mapValues`; this method creates an object with the
  13788. * same values as `object` and keys generated by running each own enumerable
  13789. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13790. * with three arguments: (value, key, object).
  13791. *
  13792. * @static
  13793. * @memberOf _
  13794. * @since 3.8.0
  13795. * @category Object
  13796. * @param {Object} object The object to iterate over.
  13797. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13798. * @returns {Object} Returns the new mapped object.
  13799. * @see _.mapValues
  13800. * @example
  13801. *
  13802. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13803. * return key + value;
  13804. * });
  13805. * // => { 'a1': 1, 'b2': 2 }
  13806. */
  13807. function mapKeys(object, iteratee) {
  13808. var result = {};
  13809. iteratee = getIteratee(iteratee, 3);
  13810. baseForOwn(object, function(value, key, object) {
  13811. baseAssignValue(result, iteratee(value, key, object), value);
  13812. });
  13813. return result;
  13814. }
  13815. /**
  13816. * Creates an object with the same keys as `object` and values generated
  13817. * by running each own enumerable string keyed property of `object` thru
  13818. * `iteratee`. The iteratee is invoked with three arguments:
  13819. * (value, key, object).
  13820. *
  13821. * @static
  13822. * @memberOf _
  13823. * @since 2.4.0
  13824. * @category Object
  13825. * @param {Object} object The object to iterate over.
  13826. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13827. * @returns {Object} Returns the new mapped object.
  13828. * @see _.mapKeys
  13829. * @example
  13830. *
  13831. * var users = {
  13832. * 'fred': { 'user': 'fred', 'age': 40 },
  13833. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13834. * };
  13835. *
  13836. * _.mapValues(users, function(o) { return o.age; });
  13837. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13838. *
  13839. * // The `_.property` iteratee shorthand.
  13840. * _.mapValues(users, 'age');
  13841. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13842. */
  13843. function mapValues(object, iteratee) {
  13844. var result = {};
  13845. iteratee = getIteratee(iteratee, 3);
  13846. baseForOwn(object, function(value, key, object) {
  13847. baseAssignValue(result, key, iteratee(value, key, object));
  13848. });
  13849. return result;
  13850. }
  13851. /**
  13852. * This method is like `_.assign` except that it recursively merges own and
  13853. * inherited enumerable string keyed properties of source objects into the
  13854. * destination object. Source properties that resolve to `undefined` are
  13855. * skipped if a destination value exists. Array and plain object properties
  13856. * are merged recursively. Other objects and value types are overridden by
  13857. * assignment. Source objects are applied from left to right. Subsequent
  13858. * sources overwrite property assignments of previous sources.
  13859. *
  13860. * **Note:** This method mutates `object`.
  13861. *
  13862. * @static
  13863. * @memberOf _
  13864. * @since 0.5.0
  13865. * @category Object
  13866. * @param {Object} object The destination object.
  13867. * @param {...Object} [sources] The source objects.
  13868. * @returns {Object} Returns `object`.
  13869. * @example
  13870. *
  13871. * var object = {
  13872. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13873. * };
  13874. *
  13875. * var other = {
  13876. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13877. * };
  13878. *
  13879. * _.merge(object, other);
  13880. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13881. */
  13882. var merge = createAssigner(function(object, source, srcIndex) {
  13883. baseMerge(object, source, srcIndex);
  13884. });
  13885. /**
  13886. * This method is like `_.merge` except that it accepts `customizer` which
  13887. * is invoked to produce the merged values of the destination and source
  13888. * properties. If `customizer` returns `undefined`, merging is handled by the
  13889. * method instead. The `customizer` is invoked with six arguments:
  13890. * (objValue, srcValue, key, object, source, stack).
  13891. *
  13892. * **Note:** This method mutates `object`.
  13893. *
  13894. * @static
  13895. * @memberOf _
  13896. * @since 4.0.0
  13897. * @category Object
  13898. * @param {Object} object The destination object.
  13899. * @param {...Object} sources The source objects.
  13900. * @param {Function} customizer The function to customize assigned values.
  13901. * @returns {Object} Returns `object`.
  13902. * @example
  13903. *
  13904. * function customizer(objValue, srcValue) {
  13905. * if (_.isArray(objValue)) {
  13906. * return objValue.concat(srcValue);
  13907. * }
  13908. * }
  13909. *
  13910. * var object = { 'a': [1], 'b': [2] };
  13911. * var other = { 'a': [3], 'b': [4] };
  13912. *
  13913. * _.mergeWith(object, other, customizer);
  13914. * // => { 'a': [1, 3], 'b': [2, 4] }
  13915. */
  13916. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13917. baseMerge(object, source, srcIndex, customizer);
  13918. });
  13919. /**
  13920. * The opposite of `_.pick`; this method creates an object composed of the
  13921. * own and inherited enumerable property paths of `object` that are not omitted.
  13922. *
  13923. * **Note:** This method is considerably slower than `_.pick`.
  13924. *
  13925. * @static
  13926. * @since 0.1.0
  13927. * @memberOf _
  13928. * @category Object
  13929. * @param {Object} object The source object.
  13930. * @param {...(string|string[])} [paths] The property paths to omit.
  13931. * @returns {Object} Returns the new object.
  13932. * @example
  13933. *
  13934. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13935. *
  13936. * _.omit(object, ['a', 'c']);
  13937. * // => { 'b': '2' }
  13938. */
  13939. var omit = flatRest(function(object, paths) {
  13940. var result = {};
  13941. if (object == null) {
  13942. return result;
  13943. }
  13944. var isDeep = false;
  13945. paths = arrayMap(paths, function(path) {
  13946. path = castPath(path, object);
  13947. isDeep || (isDeep = path.length > 1);
  13948. return path;
  13949. });
  13950. copyObject(object, getAllKeysIn(object), result);
  13951. if (isDeep) {
  13952. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13953. }
  13954. var length = paths.length;
  13955. while (length--) {
  13956. baseUnset(result, paths[length]);
  13957. }
  13958. return result;
  13959. });
  13960. /**
  13961. * The opposite of `_.pickBy`; this method creates an object composed of
  13962. * the own and inherited enumerable string keyed properties of `object` that
  13963. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13964. * arguments: (value, key).
  13965. *
  13966. * @static
  13967. * @memberOf _
  13968. * @since 4.0.0
  13969. * @category Object
  13970. * @param {Object} object The source object.
  13971. * @param {Function} [predicate=_.identity] The function invoked per property.
  13972. * @returns {Object} Returns the new object.
  13973. * @example
  13974. *
  13975. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13976. *
  13977. * _.omitBy(object, _.isNumber);
  13978. * // => { 'b': '2' }
  13979. */
  13980. function omitBy(object, predicate) {
  13981. return pickBy(object, negate(getIteratee(predicate)));
  13982. }
  13983. /**
  13984. * Creates an object composed of the picked `object` properties.
  13985. *
  13986. * @static
  13987. * @since 0.1.0
  13988. * @memberOf _
  13989. * @category Object
  13990. * @param {Object} object The source object.
  13991. * @param {...(string|string[])} [paths] The property paths to pick.
  13992. * @returns {Object} Returns the new object.
  13993. * @example
  13994. *
  13995. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13996. *
  13997. * _.pick(object, ['a', 'c']);
  13998. * // => { 'a': 1, 'c': 3 }
  13999. */
  14000. var pick = flatRest(function(object, paths) {
  14001. return object == null ? {} : basePick(object, paths);
  14002. });
  14003. /**
  14004. * Creates an object composed of the `object` properties `predicate` returns
  14005. * truthy for. The predicate is invoked with two arguments: (value, key).
  14006. *
  14007. * @static
  14008. * @memberOf _
  14009. * @since 4.0.0
  14010. * @category Object
  14011. * @param {Object} object The source object.
  14012. * @param {Function} [predicate=_.identity] The function invoked per property.
  14013. * @returns {Object} Returns the new object.
  14014. * @example
  14015. *
  14016. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14017. *
  14018. * _.pickBy(object, _.isNumber);
  14019. * // => { 'a': 1, 'c': 3 }
  14020. */
  14021. function pickBy(object, predicate) {
  14022. if (object == null) {
  14023. return {};
  14024. }
  14025. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14026. return [prop];
  14027. });
  14028. predicate = getIteratee(predicate);
  14029. return basePickBy(object, props, function(value, path) {
  14030. return predicate(value, path[0]);
  14031. });
  14032. }
  14033. /**
  14034. * This method is like `_.get` except that if the resolved value is a
  14035. * function it's invoked with the `this` binding of its parent object and
  14036. * its result is returned.
  14037. *
  14038. * @static
  14039. * @since 0.1.0
  14040. * @memberOf _
  14041. * @category Object
  14042. * @param {Object} object The object to query.
  14043. * @param {Array|string} path The path of the property to resolve.
  14044. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14045. * @returns {*} Returns the resolved value.
  14046. * @example
  14047. *
  14048. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14049. *
  14050. * _.result(object, 'a[0].b.c1');
  14051. * // => 3
  14052. *
  14053. * _.result(object, 'a[0].b.c2');
  14054. * // => 4
  14055. *
  14056. * _.result(object, 'a[0].b.c3', 'default');
  14057. * // => 'default'
  14058. *
  14059. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14060. * // => 'default'
  14061. */
  14062. function result(object, path, defaultValue) {
  14063. path = castPath(path, object);
  14064. var index = -1,
  14065. length = path.length;
  14066. // Ensure the loop is entered when path is empty.
  14067. if (!length) {
  14068. length = 1;
  14069. object = undefined;
  14070. }
  14071. while (++index < length) {
  14072. var value = object == null ? undefined : object[toKey(path[index])];
  14073. if (value === undefined) {
  14074. index = length;
  14075. value = defaultValue;
  14076. }
  14077. object = isFunction(value) ? value.call(object) : value;
  14078. }
  14079. return object;
  14080. }
  14081. /**
  14082. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14083. * it's created. Arrays are created for missing index properties while objects
  14084. * are created for all other missing properties. Use `_.setWith` to customize
  14085. * `path` creation.
  14086. *
  14087. * **Note:** This method mutates `object`.
  14088. *
  14089. * @static
  14090. * @memberOf _
  14091. * @since 3.7.0
  14092. * @category Object
  14093. * @param {Object} object The object to modify.
  14094. * @param {Array|string} path The path of the property to set.
  14095. * @param {*} value The value to set.
  14096. * @returns {Object} Returns `object`.
  14097. * @example
  14098. *
  14099. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14100. *
  14101. * _.set(object, 'a[0].b.c', 4);
  14102. * console.log(object.a[0].b.c);
  14103. * // => 4
  14104. *
  14105. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14106. * console.log(object.x[0].y.z);
  14107. * // => 5
  14108. */
  14109. function set(object, path, value) {
  14110. return object == null ? object : baseSet(object, path, value);
  14111. }
  14112. /**
  14113. * This method is like `_.set` except that it accepts `customizer` which is
  14114. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14115. * path creation is handled by the method instead. The `customizer` is invoked
  14116. * with three arguments: (nsValue, key, nsObject).
  14117. *
  14118. * **Note:** This method mutates `object`.
  14119. *
  14120. * @static
  14121. * @memberOf _
  14122. * @since 4.0.0
  14123. * @category Object
  14124. * @param {Object} object The object to modify.
  14125. * @param {Array|string} path The path of the property to set.
  14126. * @param {*} value The value to set.
  14127. * @param {Function} [customizer] The function to customize assigned values.
  14128. * @returns {Object} Returns `object`.
  14129. * @example
  14130. *
  14131. * var object = {};
  14132. *
  14133. * _.setWith(object, '[0][1]', 'a', Object);
  14134. * // => { '0': { '1': 'a' } }
  14135. */
  14136. function setWith(object, path, value, customizer) {
  14137. customizer = typeof customizer == 'function' ? customizer : undefined;
  14138. return object == null ? object : baseSet(object, path, value, customizer);
  14139. }
  14140. /**
  14141. * Creates an array of own enumerable string keyed-value pairs for `object`
  14142. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14143. * entries are returned.
  14144. *
  14145. * @static
  14146. * @memberOf _
  14147. * @since 4.0.0
  14148. * @alias entries
  14149. * @category Object
  14150. * @param {Object} object The object to query.
  14151. * @returns {Array} Returns the key-value pairs.
  14152. * @example
  14153. *
  14154. * function Foo() {
  14155. * this.a = 1;
  14156. * this.b = 2;
  14157. * }
  14158. *
  14159. * Foo.prototype.c = 3;
  14160. *
  14161. * _.toPairs(new Foo);
  14162. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14163. */
  14164. var toPairs = createToPairs(keys);
  14165. /**
  14166. * Creates an array of own and inherited enumerable string keyed-value pairs
  14167. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14168. * or set, its entries are returned.
  14169. *
  14170. * @static
  14171. * @memberOf _
  14172. * @since 4.0.0
  14173. * @alias entriesIn
  14174. * @category Object
  14175. * @param {Object} object The object to query.
  14176. * @returns {Array} Returns the key-value pairs.
  14177. * @example
  14178. *
  14179. * function Foo() {
  14180. * this.a = 1;
  14181. * this.b = 2;
  14182. * }
  14183. *
  14184. * Foo.prototype.c = 3;
  14185. *
  14186. * _.toPairsIn(new Foo);
  14187. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14188. */
  14189. var toPairsIn = createToPairs(keysIn);
  14190. /**
  14191. * An alternative to `_.reduce`; this method transforms `object` to a new
  14192. * `accumulator` object which is the result of running each of its own
  14193. * enumerable string keyed properties thru `iteratee`, with each invocation
  14194. * potentially mutating the `accumulator` object. If `accumulator` is not
  14195. * provided, a new object with the same `[[Prototype]]` will be used. The
  14196. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14197. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14198. *
  14199. * @static
  14200. * @memberOf _
  14201. * @since 1.3.0
  14202. * @category Object
  14203. * @param {Object} object The object to iterate over.
  14204. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14205. * @param {*} [accumulator] The custom accumulator value.
  14206. * @returns {*} Returns the accumulated value.
  14207. * @example
  14208. *
  14209. * _.transform([2, 3, 4], function(result, n) {
  14210. * result.push(n *= n);
  14211. * return n % 2 == 0;
  14212. * }, []);
  14213. * // => [4, 9]
  14214. *
  14215. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14216. * (result[value] || (result[value] = [])).push(key);
  14217. * }, {});
  14218. * // => { '1': ['a', 'c'], '2': ['b'] }
  14219. */
  14220. function transform(object, iteratee, accumulator) {
  14221. var isArr = isArray(object),
  14222. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14223. iteratee = getIteratee(iteratee, 4);
  14224. if (accumulator == null) {
  14225. var Ctor = object && object.constructor;
  14226. if (isArrLike) {
  14227. accumulator = isArr ? new Ctor : [];
  14228. }
  14229. else if (isObject(object)) {
  14230. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14231. }
  14232. else {
  14233. accumulator = {};
  14234. }
  14235. }
  14236. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14237. return iteratee(accumulator, value, index, object);
  14238. });
  14239. return accumulator;
  14240. }
  14241. /**
  14242. * Removes the property at `path` of `object`.
  14243. *
  14244. * **Note:** This method mutates `object`.
  14245. *
  14246. * @static
  14247. * @memberOf _
  14248. * @since 4.0.0
  14249. * @category Object
  14250. * @param {Object} object The object to modify.
  14251. * @param {Array|string} path The path of the property to unset.
  14252. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14253. * @example
  14254. *
  14255. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14256. * _.unset(object, 'a[0].b.c');
  14257. * // => true
  14258. *
  14259. * console.log(object);
  14260. * // => { 'a': [{ 'b': {} }] };
  14261. *
  14262. * _.unset(object, ['a', '0', 'b', 'c']);
  14263. * // => true
  14264. *
  14265. * console.log(object);
  14266. * // => { 'a': [{ 'b': {} }] };
  14267. */
  14268. function unset(object, path) {
  14269. return object == null ? true : baseUnset(object, path);
  14270. }
  14271. /**
  14272. * This method is like `_.set` except that accepts `updater` to produce the
  14273. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14274. * is invoked with one argument: (value).
  14275. *
  14276. * **Note:** This method mutates `object`.
  14277. *
  14278. * @static
  14279. * @memberOf _
  14280. * @since 4.6.0
  14281. * @category Object
  14282. * @param {Object} object The object to modify.
  14283. * @param {Array|string} path The path of the property to set.
  14284. * @param {Function} updater The function to produce the updated value.
  14285. * @returns {Object} Returns `object`.
  14286. * @example
  14287. *
  14288. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14289. *
  14290. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14291. * console.log(object.a[0].b.c);
  14292. * // => 9
  14293. *
  14294. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14295. * console.log(object.x[0].y.z);
  14296. * // => 0
  14297. */
  14298. function update(object, path, updater) {
  14299. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14300. }
  14301. /**
  14302. * This method is like `_.update` except that it accepts `customizer` which is
  14303. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14304. * path creation is handled by the method instead. The `customizer` is invoked
  14305. * with three arguments: (nsValue, key, nsObject).
  14306. *
  14307. * **Note:** This method mutates `object`.
  14308. *
  14309. * @static
  14310. * @memberOf _
  14311. * @since 4.6.0
  14312. * @category Object
  14313. * @param {Object} object The object to modify.
  14314. * @param {Array|string} path The path of the property to set.
  14315. * @param {Function} updater The function to produce the updated value.
  14316. * @param {Function} [customizer] The function to customize assigned values.
  14317. * @returns {Object} Returns `object`.
  14318. * @example
  14319. *
  14320. * var object = {};
  14321. *
  14322. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14323. * // => { '0': { '1': 'a' } }
  14324. */
  14325. function updateWith(object, path, updater, customizer) {
  14326. customizer = typeof customizer == 'function' ? customizer : undefined;
  14327. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14328. }
  14329. /**
  14330. * Creates an array of the own enumerable string keyed property values of `object`.
  14331. *
  14332. * **Note:** Non-object values are coerced to objects.
  14333. *
  14334. * @static
  14335. * @since 0.1.0
  14336. * @memberOf _
  14337. * @category Object
  14338. * @param {Object} object The object to query.
  14339. * @returns {Array} Returns the array of property values.
  14340. * @example
  14341. *
  14342. * function Foo() {
  14343. * this.a = 1;
  14344. * this.b = 2;
  14345. * }
  14346. *
  14347. * Foo.prototype.c = 3;
  14348. *
  14349. * _.values(new Foo);
  14350. * // => [1, 2] (iteration order is not guaranteed)
  14351. *
  14352. * _.values('hi');
  14353. * // => ['h', 'i']
  14354. */
  14355. function values(object) {
  14356. return object == null ? [] : baseValues(object, keys(object));
  14357. }
  14358. /**
  14359. * Creates an array of the own and inherited enumerable string keyed property
  14360. * values of `object`.
  14361. *
  14362. * **Note:** Non-object values are coerced to objects.
  14363. *
  14364. * @static
  14365. * @memberOf _
  14366. * @since 3.0.0
  14367. * @category Object
  14368. * @param {Object} object The object to query.
  14369. * @returns {Array} Returns the array of property values.
  14370. * @example
  14371. *
  14372. * function Foo() {
  14373. * this.a = 1;
  14374. * this.b = 2;
  14375. * }
  14376. *
  14377. * Foo.prototype.c = 3;
  14378. *
  14379. * _.valuesIn(new Foo);
  14380. * // => [1, 2, 3] (iteration order is not guaranteed)
  14381. */
  14382. function valuesIn(object) {
  14383. return object == null ? [] : baseValues(object, keysIn(object));
  14384. }
  14385. /*------------------------------------------------------------------------*/
  14386. /**
  14387. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14388. *
  14389. * @static
  14390. * @memberOf _
  14391. * @since 4.0.0
  14392. * @category Number
  14393. * @param {number} number The number to clamp.
  14394. * @param {number} [lower] The lower bound.
  14395. * @param {number} upper The upper bound.
  14396. * @returns {number} Returns the clamped number.
  14397. * @example
  14398. *
  14399. * _.clamp(-10, -5, 5);
  14400. * // => -5
  14401. *
  14402. * _.clamp(10, -5, 5);
  14403. * // => 5
  14404. */
  14405. function clamp(number, lower, upper) {
  14406. if (upper === undefined) {
  14407. upper = lower;
  14408. lower = undefined;
  14409. }
  14410. if (upper !== undefined) {
  14411. upper = toNumber(upper);
  14412. upper = upper === upper ? upper : 0;
  14413. }
  14414. if (lower !== undefined) {
  14415. lower = toNumber(lower);
  14416. lower = lower === lower ? lower : 0;
  14417. }
  14418. return baseClamp(toNumber(number), lower, upper);
  14419. }
  14420. /**
  14421. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14422. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14423. * If `start` is greater than `end` the params are swapped to support
  14424. * negative ranges.
  14425. *
  14426. * @static
  14427. * @memberOf _
  14428. * @since 3.3.0
  14429. * @category Number
  14430. * @param {number} number The number to check.
  14431. * @param {number} [start=0] The start of the range.
  14432. * @param {number} end The end of the range.
  14433. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14434. * @see _.range, _.rangeRight
  14435. * @example
  14436. *
  14437. * _.inRange(3, 2, 4);
  14438. * // => true
  14439. *
  14440. * _.inRange(4, 8);
  14441. * // => true
  14442. *
  14443. * _.inRange(4, 2);
  14444. * // => false
  14445. *
  14446. * _.inRange(2, 2);
  14447. * // => false
  14448. *
  14449. * _.inRange(1.2, 2);
  14450. * // => true
  14451. *
  14452. * _.inRange(5.2, 4);
  14453. * // => false
  14454. *
  14455. * _.inRange(-3, -2, -6);
  14456. * // => true
  14457. */
  14458. function inRange(number, start, end) {
  14459. start = toFinite(start);
  14460. if (end === undefined) {
  14461. end = start;
  14462. start = 0;
  14463. } else {
  14464. end = toFinite(end);
  14465. }
  14466. number = toNumber(number);
  14467. return baseInRange(number, start, end);
  14468. }
  14469. /**
  14470. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14471. * If only one argument is provided a number between `0` and the given number
  14472. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14473. * floats, a floating-point number is returned instead of an integer.
  14474. *
  14475. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14476. * floating-point values which can produce unexpected results.
  14477. *
  14478. * @static
  14479. * @memberOf _
  14480. * @since 0.7.0
  14481. * @category Number
  14482. * @param {number} [lower=0] The lower bound.
  14483. * @param {number} [upper=1] The upper bound.
  14484. * @param {boolean} [floating] Specify returning a floating-point number.
  14485. * @returns {number} Returns the random number.
  14486. * @example
  14487. *
  14488. * _.random(0, 5);
  14489. * // => an integer between 0 and 5
  14490. *
  14491. * _.random(5);
  14492. * // => also an integer between 0 and 5
  14493. *
  14494. * _.random(5, true);
  14495. * // => a floating-point number between 0 and 5
  14496. *
  14497. * _.random(1.2, 5.2);
  14498. * // => a floating-point number between 1.2 and 5.2
  14499. */
  14500. function random(lower, upper, floating) {
  14501. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14502. upper = floating = undefined;
  14503. }
  14504. if (floating === undefined) {
  14505. if (typeof upper == 'boolean') {
  14506. floating = upper;
  14507. upper = undefined;
  14508. }
  14509. else if (typeof lower == 'boolean') {
  14510. floating = lower;
  14511. lower = undefined;
  14512. }
  14513. }
  14514. if (lower === undefined && upper === undefined) {
  14515. lower = 0;
  14516. upper = 1;
  14517. }
  14518. else {
  14519. lower = toFinite(lower);
  14520. if (upper === undefined) {
  14521. upper = lower;
  14522. lower = 0;
  14523. } else {
  14524. upper = toFinite(upper);
  14525. }
  14526. }
  14527. if (lower > upper) {
  14528. var temp = lower;
  14529. lower = upper;
  14530. upper = temp;
  14531. }
  14532. if (floating || lower % 1 || upper % 1) {
  14533. var rand = nativeRandom();
  14534. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14535. }
  14536. return baseRandom(lower, upper);
  14537. }
  14538. /*------------------------------------------------------------------------*/
  14539. /**
  14540. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14541. *
  14542. * @static
  14543. * @memberOf _
  14544. * @since 3.0.0
  14545. * @category String
  14546. * @param {string} [string=''] The string to convert.
  14547. * @returns {string} Returns the camel cased string.
  14548. * @example
  14549. *
  14550. * _.camelCase('Foo Bar');
  14551. * // => 'fooBar'
  14552. *
  14553. * _.camelCase('--foo-bar--');
  14554. * // => 'fooBar'
  14555. *
  14556. * _.camelCase('__FOO_BAR__');
  14557. * // => 'fooBar'
  14558. */
  14559. var camelCase = createCompounder(function(result, word, index) {
  14560. word = word.toLowerCase();
  14561. return result + (index ? capitalize(word) : word);
  14562. });
  14563. /**
  14564. * Converts the first character of `string` to upper case and the remaining
  14565. * to lower case.
  14566. *
  14567. * @static
  14568. * @memberOf _
  14569. * @since 3.0.0
  14570. * @category String
  14571. * @param {string} [string=''] The string to capitalize.
  14572. * @returns {string} Returns the capitalized string.
  14573. * @example
  14574. *
  14575. * _.capitalize('FRED');
  14576. * // => 'Fred'
  14577. */
  14578. function capitalize(string) {
  14579. return upperFirst(toString(string).toLowerCase());
  14580. }
  14581. /**
  14582. * Deburrs `string` by converting
  14583. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14584. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14585. * letters to basic Latin letters and removing
  14586. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14587. *
  14588. * @static
  14589. * @memberOf _
  14590. * @since 3.0.0
  14591. * @category String
  14592. * @param {string} [string=''] The string to deburr.
  14593. * @returns {string} Returns the deburred string.
  14594. * @example
  14595. *
  14596. * _.deburr('déjà vu');
  14597. * // => 'deja vu'
  14598. */
  14599. function deburr(string) {
  14600. string = toString(string);
  14601. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14602. }
  14603. /**
  14604. * Checks if `string` ends with the given target string.
  14605. *
  14606. * @static
  14607. * @memberOf _
  14608. * @since 3.0.0
  14609. * @category String
  14610. * @param {string} [string=''] The string to inspect.
  14611. * @param {string} [target] The string to search for.
  14612. * @param {number} [position=string.length] The position to search up to.
  14613. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14614. * else `false`.
  14615. * @example
  14616. *
  14617. * _.endsWith('abc', 'c');
  14618. * // => true
  14619. *
  14620. * _.endsWith('abc', 'b');
  14621. * // => false
  14622. *
  14623. * _.endsWith('abc', 'b', 2);
  14624. * // => true
  14625. */
  14626. function endsWith(string, target, position) {
  14627. string = toString(string);
  14628. target = baseToString(target);
  14629. var length = string.length;
  14630. position = position === undefined
  14631. ? length
  14632. : baseClamp(toInteger(position), 0, length);
  14633. var end = position;
  14634. position -= target.length;
  14635. return position >= 0 && string.slice(position, end) == target;
  14636. }
  14637. /**
  14638. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14639. * corresponding HTML entities.
  14640. *
  14641. * **Note:** No other characters are escaped. To escape additional
  14642. * characters use a third-party library like [_he_](https://mths.be/he).
  14643. *
  14644. * Though the ">" character is escaped for symmetry, characters like
  14645. * ">" and "/" don't need escaping in HTML and have no special meaning
  14646. * unless they're part of a tag or unquoted attribute value. See
  14647. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14648. * (under "semi-related fun fact") for more details.
  14649. *
  14650. * When working with HTML you should always
  14651. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14652. * XSS vectors.
  14653. *
  14654. * @static
  14655. * @since 0.1.0
  14656. * @memberOf _
  14657. * @category String
  14658. * @param {string} [string=''] The string to escape.
  14659. * @returns {string} Returns the escaped string.
  14660. * @example
  14661. *
  14662. * _.escape('fred, barney, & pebbles');
  14663. * // => 'fred, barney, &amp; pebbles'
  14664. */
  14665. function escape(string) {
  14666. string = toString(string);
  14667. return (string && reHasUnescapedHtml.test(string))
  14668. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14669. : string;
  14670. }
  14671. /**
  14672. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14673. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14674. *
  14675. * @static
  14676. * @memberOf _
  14677. * @since 3.0.0
  14678. * @category String
  14679. * @param {string} [string=''] The string to escape.
  14680. * @returns {string} Returns the escaped string.
  14681. * @example
  14682. *
  14683. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14684. * // => '\[lodash\]\(https://lodash\.com/\)'
  14685. */
  14686. function escapeRegExp(string) {
  14687. string = toString(string);
  14688. return (string && reHasRegExpChar.test(string))
  14689. ? string.replace(reRegExpChar, '\\$&')
  14690. : string;
  14691. }
  14692. /**
  14693. * Converts `string` to
  14694. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14695. *
  14696. * @static
  14697. * @memberOf _
  14698. * @since 3.0.0
  14699. * @category String
  14700. * @param {string} [string=''] The string to convert.
  14701. * @returns {string} Returns the kebab cased string.
  14702. * @example
  14703. *
  14704. * _.kebabCase('Foo Bar');
  14705. * // => 'foo-bar'
  14706. *
  14707. * _.kebabCase('fooBar');
  14708. * // => 'foo-bar'
  14709. *
  14710. * _.kebabCase('__FOO_BAR__');
  14711. * // => 'foo-bar'
  14712. */
  14713. var kebabCase = createCompounder(function(result, word, index) {
  14714. return result + (index ? '-' : '') + word.toLowerCase();
  14715. });
  14716. /**
  14717. * Converts `string`, as space separated words, to lower case.
  14718. *
  14719. * @static
  14720. * @memberOf _
  14721. * @since 4.0.0
  14722. * @category String
  14723. * @param {string} [string=''] The string to convert.
  14724. * @returns {string} Returns the lower cased string.
  14725. * @example
  14726. *
  14727. * _.lowerCase('--Foo-Bar--');
  14728. * // => 'foo bar'
  14729. *
  14730. * _.lowerCase('fooBar');
  14731. * // => 'foo bar'
  14732. *
  14733. * _.lowerCase('__FOO_BAR__');
  14734. * // => 'foo bar'
  14735. */
  14736. var lowerCase = createCompounder(function(result, word, index) {
  14737. return result + (index ? ' ' : '') + word.toLowerCase();
  14738. });
  14739. /**
  14740. * Converts the first character of `string` to lower case.
  14741. *
  14742. * @static
  14743. * @memberOf _
  14744. * @since 4.0.0
  14745. * @category String
  14746. * @param {string} [string=''] The string to convert.
  14747. * @returns {string} Returns the converted string.
  14748. * @example
  14749. *
  14750. * _.lowerFirst('Fred');
  14751. * // => 'fred'
  14752. *
  14753. * _.lowerFirst('FRED');
  14754. * // => 'fRED'
  14755. */
  14756. var lowerFirst = createCaseFirst('toLowerCase');
  14757. /**
  14758. * Pads `string` on the left and right sides if it's shorter than `length`.
  14759. * Padding characters are truncated if they can't be evenly divided by `length`.
  14760. *
  14761. * @static
  14762. * @memberOf _
  14763. * @since 3.0.0
  14764. * @category String
  14765. * @param {string} [string=''] The string to pad.
  14766. * @param {number} [length=0] The padding length.
  14767. * @param {string} [chars=' '] The string used as padding.
  14768. * @returns {string} Returns the padded string.
  14769. * @example
  14770. *
  14771. * _.pad('abc', 8);
  14772. * // => ' abc '
  14773. *
  14774. * _.pad('abc', 8, '_-');
  14775. * // => '_-abc_-_'
  14776. *
  14777. * _.pad('abc', 3);
  14778. * // => 'abc'
  14779. */
  14780. function pad(string, length, chars) {
  14781. string = toString(string);
  14782. length = toInteger(length);
  14783. var strLength = length ? stringSize(string) : 0;
  14784. if (!length || strLength >= length) {
  14785. return string;
  14786. }
  14787. var mid = (length - strLength) / 2;
  14788. return (
  14789. createPadding(nativeFloor(mid), chars) +
  14790. string +
  14791. createPadding(nativeCeil(mid), chars)
  14792. );
  14793. }
  14794. /**
  14795. * Pads `string` on the right side if it's shorter than `length`. Padding
  14796. * characters are truncated if they exceed `length`.
  14797. *
  14798. * @static
  14799. * @memberOf _
  14800. * @since 4.0.0
  14801. * @category String
  14802. * @param {string} [string=''] The string to pad.
  14803. * @param {number} [length=0] The padding length.
  14804. * @param {string} [chars=' '] The string used as padding.
  14805. * @returns {string} Returns the padded string.
  14806. * @example
  14807. *
  14808. * _.padEnd('abc', 6);
  14809. * // => 'abc '
  14810. *
  14811. * _.padEnd('abc', 6, '_-');
  14812. * // => 'abc_-_'
  14813. *
  14814. * _.padEnd('abc', 3);
  14815. * // => 'abc'
  14816. */
  14817. function padEnd(string, length, chars) {
  14818. string = toString(string);
  14819. length = toInteger(length);
  14820. var strLength = length ? stringSize(string) : 0;
  14821. return (length && strLength < length)
  14822. ? (string + createPadding(length - strLength, chars))
  14823. : string;
  14824. }
  14825. /**
  14826. * Pads `string` on the left side if it's shorter than `length`. Padding
  14827. * characters are truncated if they exceed `length`.
  14828. *
  14829. * @static
  14830. * @memberOf _
  14831. * @since 4.0.0
  14832. * @category String
  14833. * @param {string} [string=''] The string to pad.
  14834. * @param {number} [length=0] The padding length.
  14835. * @param {string} [chars=' '] The string used as padding.
  14836. * @returns {string} Returns the padded string.
  14837. * @example
  14838. *
  14839. * _.padStart('abc', 6);
  14840. * // => ' abc'
  14841. *
  14842. * _.padStart('abc', 6, '_-');
  14843. * // => '_-_abc'
  14844. *
  14845. * _.padStart('abc', 3);
  14846. * // => 'abc'
  14847. */
  14848. function padStart(string, length, chars) {
  14849. string = toString(string);
  14850. length = toInteger(length);
  14851. var strLength = length ? stringSize(string) : 0;
  14852. return (length && strLength < length)
  14853. ? (createPadding(length - strLength, chars) + string)
  14854. : string;
  14855. }
  14856. /**
  14857. * Converts `string` to an integer of the specified radix. If `radix` is
  14858. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14859. * hexadecimal, in which case a `radix` of `16` is used.
  14860. *
  14861. * **Note:** This method aligns with the
  14862. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14863. *
  14864. * @static
  14865. * @memberOf _
  14866. * @since 1.1.0
  14867. * @category String
  14868. * @param {string} string The string to convert.
  14869. * @param {number} [radix=10] The radix to interpret `value` by.
  14870. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14871. * @returns {number} Returns the converted integer.
  14872. * @example
  14873. *
  14874. * _.parseInt('08');
  14875. * // => 8
  14876. *
  14877. * _.map(['6', '08', '10'], _.parseInt);
  14878. * // => [6, 8, 10]
  14879. */
  14880. function parseInt(string, radix, guard) {
  14881. if (guard || radix == null) {
  14882. radix = 0;
  14883. } else if (radix) {
  14884. radix = +radix;
  14885. }
  14886. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14887. }
  14888. /**
  14889. * Repeats the given string `n` times.
  14890. *
  14891. * @static
  14892. * @memberOf _
  14893. * @since 3.0.0
  14894. * @category String
  14895. * @param {string} [string=''] The string to repeat.
  14896. * @param {number} [n=1] The number of times to repeat the string.
  14897. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14898. * @returns {string} Returns the repeated string.
  14899. * @example
  14900. *
  14901. * _.repeat('*', 3);
  14902. * // => '***'
  14903. *
  14904. * _.repeat('abc', 2);
  14905. * // => 'abcabc'
  14906. *
  14907. * _.repeat('abc', 0);
  14908. * // => ''
  14909. */
  14910. function repeat(string, n, guard) {
  14911. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14912. n = 1;
  14913. } else {
  14914. n = toInteger(n);
  14915. }
  14916. return baseRepeat(toString(string), n);
  14917. }
  14918. /**
  14919. * Replaces matches for `pattern` in `string` with `replacement`.
  14920. *
  14921. * **Note:** This method is based on
  14922. * [`String#replace`](https://mdn.io/String/replace).
  14923. *
  14924. * @static
  14925. * @memberOf _
  14926. * @since 4.0.0
  14927. * @category String
  14928. * @param {string} [string=''] The string to modify.
  14929. * @param {RegExp|string} pattern The pattern to replace.
  14930. * @param {Function|string} replacement The match replacement.
  14931. * @returns {string} Returns the modified string.
  14932. * @example
  14933. *
  14934. * _.replace('Hi Fred', 'Fred', 'Barney');
  14935. * // => 'Hi Barney'
  14936. */
  14937. function replace() {
  14938. var args = arguments,
  14939. string = toString(args[0]);
  14940. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14941. }
  14942. /**
  14943. * Converts `string` to
  14944. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14945. *
  14946. * @static
  14947. * @memberOf _
  14948. * @since 3.0.0
  14949. * @category String
  14950. * @param {string} [string=''] The string to convert.
  14951. * @returns {string} Returns the snake cased string.
  14952. * @example
  14953. *
  14954. * _.snakeCase('Foo Bar');
  14955. * // => 'foo_bar'
  14956. *
  14957. * _.snakeCase('fooBar');
  14958. * // => 'foo_bar'
  14959. *
  14960. * _.snakeCase('--FOO-BAR--');
  14961. * // => 'foo_bar'
  14962. */
  14963. var snakeCase = createCompounder(function(result, word, index) {
  14964. return result + (index ? '_' : '') + word.toLowerCase();
  14965. });
  14966. /**
  14967. * Splits `string` by `separator`.
  14968. *
  14969. * **Note:** This method is based on
  14970. * [`String#split`](https://mdn.io/String/split).
  14971. *
  14972. * @static
  14973. * @memberOf _
  14974. * @since 4.0.0
  14975. * @category String
  14976. * @param {string} [string=''] The string to split.
  14977. * @param {RegExp|string} separator The separator pattern to split by.
  14978. * @param {number} [limit] The length to truncate results to.
  14979. * @returns {Array} Returns the string segments.
  14980. * @example
  14981. *
  14982. * _.split('a-b-c', '-', 2);
  14983. * // => ['a', 'b']
  14984. */
  14985. function split(string, separator, limit) {
  14986. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14987. separator = limit = undefined;
  14988. }
  14989. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14990. if (!limit) {
  14991. return [];
  14992. }
  14993. string = toString(string);
  14994. if (string && (
  14995. typeof separator == 'string' ||
  14996. (separator != null && !isRegExp(separator))
  14997. )) {
  14998. separator = baseToString(separator);
  14999. if (!separator && hasUnicode(string)) {
  15000. return castSlice(stringToArray(string), 0, limit);
  15001. }
  15002. }
  15003. return string.split(separator, limit);
  15004. }
  15005. /**
  15006. * Converts `string` to
  15007. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15008. *
  15009. * @static
  15010. * @memberOf _
  15011. * @since 3.1.0
  15012. * @category String
  15013. * @param {string} [string=''] The string to convert.
  15014. * @returns {string} Returns the start cased string.
  15015. * @example
  15016. *
  15017. * _.startCase('--foo-bar--');
  15018. * // => 'Foo Bar'
  15019. *
  15020. * _.startCase('fooBar');
  15021. * // => 'Foo Bar'
  15022. *
  15023. * _.startCase('__FOO_BAR__');
  15024. * // => 'FOO BAR'
  15025. */
  15026. var startCase = createCompounder(function(result, word, index) {
  15027. return result + (index ? ' ' : '') + upperFirst(word);
  15028. });
  15029. /**
  15030. * Checks if `string` starts with the given target string.
  15031. *
  15032. * @static
  15033. * @memberOf _
  15034. * @since 3.0.0
  15035. * @category String
  15036. * @param {string} [string=''] The string to inspect.
  15037. * @param {string} [target] The string to search for.
  15038. * @param {number} [position=0] The position to search from.
  15039. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15040. * else `false`.
  15041. * @example
  15042. *
  15043. * _.startsWith('abc', 'a');
  15044. * // => true
  15045. *
  15046. * _.startsWith('abc', 'b');
  15047. * // => false
  15048. *
  15049. * _.startsWith('abc', 'b', 1);
  15050. * // => true
  15051. */
  15052. function startsWith(string, target, position) {
  15053. string = toString(string);
  15054. position = position == null
  15055. ? 0
  15056. : baseClamp(toInteger(position), 0, string.length);
  15057. target = baseToString(target);
  15058. return string.slice(position, position + target.length) == target;
  15059. }
  15060. /**
  15061. * Creates a compiled template function that can interpolate data properties
  15062. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15063. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15064. * properties may be accessed as free variables in the template. If a setting
  15065. * object is given, it takes precedence over `_.templateSettings` values.
  15066. *
  15067. * **Note:** In the development build `_.template` utilizes
  15068. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15069. * for easier debugging.
  15070. *
  15071. * For more information on precompiling templates see
  15072. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15073. *
  15074. * For more information on Chrome extension sandboxes see
  15075. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15076. *
  15077. * @static
  15078. * @since 0.1.0
  15079. * @memberOf _
  15080. * @category String
  15081. * @param {string} [string=''] The template string.
  15082. * @param {Object} [options={}] The options object.
  15083. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15084. * The HTML "escape" delimiter.
  15085. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15086. * The "evaluate" delimiter.
  15087. * @param {Object} [options.imports=_.templateSettings.imports]
  15088. * An object to import into the template as free variables.
  15089. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15090. * The "interpolate" delimiter.
  15091. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15092. * The sourceURL of the compiled template.
  15093. * @param {string} [options.variable='obj']
  15094. * The data object variable name.
  15095. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15096. * @returns {Function} Returns the compiled template function.
  15097. * @example
  15098. *
  15099. * // Use the "interpolate" delimiter to create a compiled template.
  15100. * var compiled = _.template('hello <%= user %>!');
  15101. * compiled({ 'user': 'fred' });
  15102. * // => 'hello fred!'
  15103. *
  15104. * // Use the HTML "escape" delimiter to escape data property values.
  15105. * var compiled = _.template('<b><%- value %></b>');
  15106. * compiled({ 'value': '<script>' });
  15107. * // => '<b>&lt;script&gt;</b>'
  15108. *
  15109. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15110. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15111. * compiled({ 'users': ['fred', 'barney'] });
  15112. * // => '<li>fred</li><li>barney</li>'
  15113. *
  15114. * // Use the internal `print` function in "evaluate" delimiters.
  15115. * var compiled = _.template('<% print("hello " + user); %>!');
  15116. * compiled({ 'user': 'barney' });
  15117. * // => 'hello barney!'
  15118. *
  15119. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15120. * // Disable support by replacing the "interpolate" delimiter.
  15121. * var compiled = _.template('hello ${ user }!');
  15122. * compiled({ 'user': 'pebbles' });
  15123. * // => 'hello pebbles!'
  15124. *
  15125. * // Use backslashes to treat delimiters as plain text.
  15126. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15127. * compiled({ 'value': 'ignored' });
  15128. * // => '<%- value %>'
  15129. *
  15130. * // Use the `imports` option to import `jQuery` as `jq`.
  15131. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15132. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15133. * compiled({ 'users': ['fred', 'barney'] });
  15134. * // => '<li>fred</li><li>barney</li>'
  15135. *
  15136. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15137. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15138. * compiled(data);
  15139. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15140. *
  15141. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15142. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15143. * compiled.source;
  15144. * // => function(data) {
  15145. * // var __t, __p = '';
  15146. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15147. * // return __p;
  15148. * // }
  15149. *
  15150. * // Use custom template delimiters.
  15151. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15152. * var compiled = _.template('hello {{ user }}!');
  15153. * compiled({ 'user': 'mustache' });
  15154. * // => 'hello mustache!'
  15155. *
  15156. * // Use the `source` property to inline compiled templates for meaningful
  15157. * // line numbers in error messages and stack traces.
  15158. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15159. * var JST = {\
  15160. * "main": ' + _.template(mainText).source + '\
  15161. * };\
  15162. * ');
  15163. */
  15164. function template(string, options, guard) {
  15165. // Based on John Resig's `tmpl` implementation
  15166. // (http://ejohn.org/blog/javascript-micro-templating/)
  15167. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15168. var settings = lodash.templateSettings;
  15169. if (guard && isIterateeCall(string, options, guard)) {
  15170. options = undefined;
  15171. }
  15172. string = toString(string);
  15173. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15174. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15175. importsKeys = keys(imports),
  15176. importsValues = baseValues(imports, importsKeys);
  15177. var isEscaping,
  15178. isEvaluating,
  15179. index = 0,
  15180. interpolate = options.interpolate || reNoMatch,
  15181. source = "__p += '";
  15182. // Compile the regexp to match each delimiter.
  15183. var reDelimiters = RegExp(
  15184. (options.escape || reNoMatch).source + '|' +
  15185. interpolate.source + '|' +
  15186. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15187. (options.evaluate || reNoMatch).source + '|$'
  15188. , 'g');
  15189. // Use a sourceURL for easier debugging.
  15190. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15191. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15192. // and escape the comment, thus injecting code that gets evaled.
  15193. var sourceURL = '//# sourceURL=' +
  15194. (hasOwnProperty.call(options, 'sourceURL')
  15195. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15196. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15197. ) + '\n';
  15198. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15199. interpolateValue || (interpolateValue = esTemplateValue);
  15200. // Escape characters that can't be included in string literals.
  15201. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15202. // Replace delimiters with snippets.
  15203. if (escapeValue) {
  15204. isEscaping = true;
  15205. source += "' +\n__e(" + escapeValue + ") +\n'";
  15206. }
  15207. if (evaluateValue) {
  15208. isEvaluating = true;
  15209. source += "';\n" + evaluateValue + ";\n__p += '";
  15210. }
  15211. if (interpolateValue) {
  15212. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15213. }
  15214. index = offset + match.length;
  15215. // The JS engine embedded in Adobe products needs `match` returned in
  15216. // order to produce the correct `offset` value.
  15217. return match;
  15218. });
  15219. source += "';\n";
  15220. // If `variable` is not specified wrap a with-statement around the generated
  15221. // code to add the data object to the top of the scope chain.
  15222. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15223. if (!variable) {
  15224. source = 'with (obj) {\n' + source + '\n}\n';
  15225. }
  15226. // Throw an error if a forbidden character was found in `variable`, to prevent
  15227. // potential command injection attacks.
  15228. else if (reForbiddenIdentifierChars.test(variable)) {
  15229. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15230. }
  15231. // Cleanup code by stripping empty strings.
  15232. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15233. .replace(reEmptyStringMiddle, '$1')
  15234. .replace(reEmptyStringTrailing, '$1;');
  15235. // Frame code as the function body.
  15236. source = 'function(' + (variable || 'obj') + ') {\n' +
  15237. (variable
  15238. ? ''
  15239. : 'obj || (obj = {});\n'
  15240. ) +
  15241. "var __t, __p = ''" +
  15242. (isEscaping
  15243. ? ', __e = _.escape'
  15244. : ''
  15245. ) +
  15246. (isEvaluating
  15247. ? ', __j = Array.prototype.join;\n' +
  15248. "function print() { __p += __j.call(arguments, '') }\n"
  15249. : ';\n'
  15250. ) +
  15251. source +
  15252. 'return __p\n}';
  15253. var result = attempt(function() {
  15254. return Function(importsKeys, sourceURL + 'return ' + source)
  15255. .apply(undefined, importsValues);
  15256. });
  15257. // Provide the compiled function's source by its `toString` method or
  15258. // the `source` property as a convenience for inlining compiled templates.
  15259. result.source = source;
  15260. if (isError(result)) {
  15261. throw result;
  15262. }
  15263. return result;
  15264. }
  15265. /**
  15266. * Converts `string`, as a whole, to lower case just like
  15267. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15268. *
  15269. * @static
  15270. * @memberOf _
  15271. * @since 4.0.0
  15272. * @category String
  15273. * @param {string} [string=''] The string to convert.
  15274. * @returns {string} Returns the lower cased string.
  15275. * @example
  15276. *
  15277. * _.toLower('--Foo-Bar--');
  15278. * // => '--foo-bar--'
  15279. *
  15280. * _.toLower('fooBar');
  15281. * // => 'foobar'
  15282. *
  15283. * _.toLower('__FOO_BAR__');
  15284. * // => '__foo_bar__'
  15285. */
  15286. function toLower(value) {
  15287. return toString(value).toLowerCase();
  15288. }
  15289. /**
  15290. * Converts `string`, as a whole, to upper case just like
  15291. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15292. *
  15293. * @static
  15294. * @memberOf _
  15295. * @since 4.0.0
  15296. * @category String
  15297. * @param {string} [string=''] The string to convert.
  15298. * @returns {string} Returns the upper cased string.
  15299. * @example
  15300. *
  15301. * _.toUpper('--foo-bar--');
  15302. * // => '--FOO-BAR--'
  15303. *
  15304. * _.toUpper('fooBar');
  15305. * // => 'FOOBAR'
  15306. *
  15307. * _.toUpper('__foo_bar__');
  15308. * // => '__FOO_BAR__'
  15309. */
  15310. function toUpper(value) {
  15311. return toString(value).toUpperCase();
  15312. }
  15313. /**
  15314. * Removes leading and trailing whitespace or specified characters from `string`.
  15315. *
  15316. * @static
  15317. * @memberOf _
  15318. * @since 3.0.0
  15319. * @category String
  15320. * @param {string} [string=''] The string to trim.
  15321. * @param {string} [chars=whitespace] The characters to trim.
  15322. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15323. * @returns {string} Returns the trimmed string.
  15324. * @example
  15325. *
  15326. * _.trim(' abc ');
  15327. * // => 'abc'
  15328. *
  15329. * _.trim('-_-abc-_-', '_-');
  15330. * // => 'abc'
  15331. *
  15332. * _.map([' foo ', ' bar '], _.trim);
  15333. * // => ['foo', 'bar']
  15334. */
  15335. function trim(string, chars, guard) {
  15336. string = toString(string);
  15337. if (string && (guard || chars === undefined)) {
  15338. return baseTrim(string);
  15339. }
  15340. if (!string || !(chars = baseToString(chars))) {
  15341. return string;
  15342. }
  15343. var strSymbols = stringToArray(string),
  15344. chrSymbols = stringToArray(chars),
  15345. start = charsStartIndex(strSymbols, chrSymbols),
  15346. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15347. return castSlice(strSymbols, start, end).join('');
  15348. }
  15349. /**
  15350. * Removes trailing whitespace or specified characters from `string`.
  15351. *
  15352. * @static
  15353. * @memberOf _
  15354. * @since 4.0.0
  15355. * @category String
  15356. * @param {string} [string=''] The string to trim.
  15357. * @param {string} [chars=whitespace] The characters to trim.
  15358. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15359. * @returns {string} Returns the trimmed string.
  15360. * @example
  15361. *
  15362. * _.trimEnd(' abc ');
  15363. * // => ' abc'
  15364. *
  15365. * _.trimEnd('-_-abc-_-', '_-');
  15366. * // => '-_-abc'
  15367. */
  15368. function trimEnd(string, chars, guard) {
  15369. string = toString(string);
  15370. if (string && (guard || chars === undefined)) {
  15371. return string.slice(0, trimmedEndIndex(string) + 1);
  15372. }
  15373. if (!string || !(chars = baseToString(chars))) {
  15374. return string;
  15375. }
  15376. var strSymbols = stringToArray(string),
  15377. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15378. return castSlice(strSymbols, 0, end).join('');
  15379. }
  15380. /**
  15381. * Removes leading whitespace or specified characters from `string`.
  15382. *
  15383. * @static
  15384. * @memberOf _
  15385. * @since 4.0.0
  15386. * @category String
  15387. * @param {string} [string=''] The string to trim.
  15388. * @param {string} [chars=whitespace] The characters to trim.
  15389. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15390. * @returns {string} Returns the trimmed string.
  15391. * @example
  15392. *
  15393. * _.trimStart(' abc ');
  15394. * // => 'abc '
  15395. *
  15396. * _.trimStart('-_-abc-_-', '_-');
  15397. * // => 'abc-_-'
  15398. */
  15399. function trimStart(string, chars, guard) {
  15400. string = toString(string);
  15401. if (string && (guard || chars === undefined)) {
  15402. return string.replace(reTrimStart, '');
  15403. }
  15404. if (!string || !(chars = baseToString(chars))) {
  15405. return string;
  15406. }
  15407. var strSymbols = stringToArray(string),
  15408. start = charsStartIndex(strSymbols, stringToArray(chars));
  15409. return castSlice(strSymbols, start).join('');
  15410. }
  15411. /**
  15412. * Truncates `string` if it's longer than the given maximum string length.
  15413. * The last characters of the truncated string are replaced with the omission
  15414. * string which defaults to "...".
  15415. *
  15416. * @static
  15417. * @memberOf _
  15418. * @since 4.0.0
  15419. * @category String
  15420. * @param {string} [string=''] The string to truncate.
  15421. * @param {Object} [options={}] The options object.
  15422. * @param {number} [options.length=30] The maximum string length.
  15423. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15424. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15425. * @returns {string} Returns the truncated string.
  15426. * @example
  15427. *
  15428. * _.truncate('hi-diddly-ho there, neighborino');
  15429. * // => 'hi-diddly-ho there, neighbo...'
  15430. *
  15431. * _.truncate('hi-diddly-ho there, neighborino', {
  15432. * 'length': 24,
  15433. * 'separator': ' '
  15434. * });
  15435. * // => 'hi-diddly-ho there,...'
  15436. *
  15437. * _.truncate('hi-diddly-ho there, neighborino', {
  15438. * 'length': 24,
  15439. * 'separator': /,? +/
  15440. * });
  15441. * // => 'hi-diddly-ho there...'
  15442. *
  15443. * _.truncate('hi-diddly-ho there, neighborino', {
  15444. * 'omission': ' [...]'
  15445. * });
  15446. * // => 'hi-diddly-ho there, neig [...]'
  15447. */
  15448. function truncate(string, options) {
  15449. var length = DEFAULT_TRUNC_LENGTH,
  15450. omission = DEFAULT_TRUNC_OMISSION;
  15451. if (isObject(options)) {
  15452. var separator = 'separator' in options ? options.separator : separator;
  15453. length = 'length' in options ? toInteger(options.length) : length;
  15454. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15455. }
  15456. string = toString(string);
  15457. var strLength = string.length;
  15458. if (hasUnicode(string)) {
  15459. var strSymbols = stringToArray(string);
  15460. strLength = strSymbols.length;
  15461. }
  15462. if (length >= strLength) {
  15463. return string;
  15464. }
  15465. var end = length - stringSize(omission);
  15466. if (end < 1) {
  15467. return omission;
  15468. }
  15469. var result = strSymbols
  15470. ? castSlice(strSymbols, 0, end).join('')
  15471. : string.slice(0, end);
  15472. if (separator === undefined) {
  15473. return result + omission;
  15474. }
  15475. if (strSymbols) {
  15476. end += (result.length - end);
  15477. }
  15478. if (isRegExp(separator)) {
  15479. if (string.slice(end).search(separator)) {
  15480. var match,
  15481. substring = result;
  15482. if (!separator.global) {
  15483. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15484. }
  15485. separator.lastIndex = 0;
  15486. while ((match = separator.exec(substring))) {
  15487. var newEnd = match.index;
  15488. }
  15489. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15490. }
  15491. } else if (string.indexOf(baseToString(separator), end) != end) {
  15492. var index = result.lastIndexOf(separator);
  15493. if (index > -1) {
  15494. result = result.slice(0, index);
  15495. }
  15496. }
  15497. return result + omission;
  15498. }
  15499. /**
  15500. * The inverse of `_.escape`; this method converts the HTML entities
  15501. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15502. * their corresponding characters.
  15503. *
  15504. * **Note:** No other HTML entities are unescaped. To unescape additional
  15505. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15506. *
  15507. * @static
  15508. * @memberOf _
  15509. * @since 0.6.0
  15510. * @category String
  15511. * @param {string} [string=''] The string to unescape.
  15512. * @returns {string} Returns the unescaped string.
  15513. * @example
  15514. *
  15515. * _.unescape('fred, barney, &amp; pebbles');
  15516. * // => 'fred, barney, & pebbles'
  15517. */
  15518. function unescape(string) {
  15519. string = toString(string);
  15520. return (string && reHasEscapedHtml.test(string))
  15521. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15522. : string;
  15523. }
  15524. /**
  15525. * Converts `string`, as space separated words, to upper case.
  15526. *
  15527. * @static
  15528. * @memberOf _
  15529. * @since 4.0.0
  15530. * @category String
  15531. * @param {string} [string=''] The string to convert.
  15532. * @returns {string} Returns the upper cased string.
  15533. * @example
  15534. *
  15535. * _.upperCase('--foo-bar');
  15536. * // => 'FOO BAR'
  15537. *
  15538. * _.upperCase('fooBar');
  15539. * // => 'FOO BAR'
  15540. *
  15541. * _.upperCase('__foo_bar__');
  15542. * // => 'FOO BAR'
  15543. */
  15544. var upperCase = createCompounder(function(result, word, index) {
  15545. return result + (index ? ' ' : '') + word.toUpperCase();
  15546. });
  15547. /**
  15548. * Converts the first character of `string` to upper case.
  15549. *
  15550. * @static
  15551. * @memberOf _
  15552. * @since 4.0.0
  15553. * @category String
  15554. * @param {string} [string=''] The string to convert.
  15555. * @returns {string} Returns the converted string.
  15556. * @example
  15557. *
  15558. * _.upperFirst('fred');
  15559. * // => 'Fred'
  15560. *
  15561. * _.upperFirst('FRED');
  15562. * // => 'FRED'
  15563. */
  15564. var upperFirst = createCaseFirst('toUpperCase');
  15565. /**
  15566. * Splits `string` into an array of its words.
  15567. *
  15568. * @static
  15569. * @memberOf _
  15570. * @since 3.0.0
  15571. * @category String
  15572. * @param {string} [string=''] The string to inspect.
  15573. * @param {RegExp|string} [pattern] The pattern to match words.
  15574. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15575. * @returns {Array} Returns the words of `string`.
  15576. * @example
  15577. *
  15578. * _.words('fred, barney, & pebbles');
  15579. * // => ['fred', 'barney', 'pebbles']
  15580. *
  15581. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15582. * // => ['fred', 'barney', '&', 'pebbles']
  15583. */
  15584. function words(string, pattern, guard) {
  15585. string = toString(string);
  15586. pattern = guard ? undefined : pattern;
  15587. if (pattern === undefined) {
  15588. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15589. }
  15590. return string.match(pattern) || [];
  15591. }
  15592. /*------------------------------------------------------------------------*/
  15593. /**
  15594. * Attempts to invoke `func`, returning either the result or the caught error
  15595. * object. Any additional arguments are provided to `func` when it's invoked.
  15596. *
  15597. * @static
  15598. * @memberOf _
  15599. * @since 3.0.0
  15600. * @category Util
  15601. * @param {Function} func The function to attempt.
  15602. * @param {...*} [args] The arguments to invoke `func` with.
  15603. * @returns {*} Returns the `func` result or error object.
  15604. * @example
  15605. *
  15606. * // Avoid throwing errors for invalid selectors.
  15607. * var elements = _.attempt(function(selector) {
  15608. * return document.querySelectorAll(selector);
  15609. * }, '>_>');
  15610. *
  15611. * if (_.isError(elements)) {
  15612. * elements = [];
  15613. * }
  15614. */
  15615. var attempt = baseRest(function(func, args) {
  15616. try {
  15617. return apply(func, undefined, args);
  15618. } catch (e) {
  15619. return isError(e) ? e : new Error(e);
  15620. }
  15621. });
  15622. /**
  15623. * Binds methods of an object to the object itself, overwriting the existing
  15624. * method.
  15625. *
  15626. * **Note:** This method doesn't set the "length" property of bound functions.
  15627. *
  15628. * @static
  15629. * @since 0.1.0
  15630. * @memberOf _
  15631. * @category Util
  15632. * @param {Object} object The object to bind and assign the bound methods to.
  15633. * @param {...(string|string[])} methodNames The object method names to bind.
  15634. * @returns {Object} Returns `object`.
  15635. * @example
  15636. *
  15637. * var view = {
  15638. * 'label': 'docs',
  15639. * 'click': function() {
  15640. * console.log('clicked ' + this.label);
  15641. * }
  15642. * };
  15643. *
  15644. * _.bindAll(view, ['click']);
  15645. * jQuery(element).on('click', view.click);
  15646. * // => Logs 'clicked docs' when clicked.
  15647. */
  15648. var bindAll = flatRest(function(object, methodNames) {
  15649. arrayEach(methodNames, function(key) {
  15650. key = toKey(key);
  15651. baseAssignValue(object, key, bind(object[key], object));
  15652. });
  15653. return object;
  15654. });
  15655. /**
  15656. * Creates a function that iterates over `pairs` and invokes the corresponding
  15657. * function of the first predicate to return truthy. The predicate-function
  15658. * pairs are invoked with the `this` binding and arguments of the created
  15659. * function.
  15660. *
  15661. * @static
  15662. * @memberOf _
  15663. * @since 4.0.0
  15664. * @category Util
  15665. * @param {Array} pairs The predicate-function pairs.
  15666. * @returns {Function} Returns the new composite function.
  15667. * @example
  15668. *
  15669. * var func = _.cond([
  15670. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15671. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15672. * [_.stubTrue, _.constant('no match')]
  15673. * ]);
  15674. *
  15675. * func({ 'a': 1, 'b': 2 });
  15676. * // => 'matches A'
  15677. *
  15678. * func({ 'a': 0, 'b': 1 });
  15679. * // => 'matches B'
  15680. *
  15681. * func({ 'a': '1', 'b': '2' });
  15682. * // => 'no match'
  15683. */
  15684. function cond(pairs) {
  15685. var length = pairs == null ? 0 : pairs.length,
  15686. toIteratee = getIteratee();
  15687. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15688. if (typeof pair[1] != 'function') {
  15689. throw new TypeError(FUNC_ERROR_TEXT);
  15690. }
  15691. return [toIteratee(pair[0]), pair[1]];
  15692. });
  15693. return baseRest(function(args) {
  15694. var index = -1;
  15695. while (++index < length) {
  15696. var pair = pairs[index];
  15697. if (apply(pair[0], this, args)) {
  15698. return apply(pair[1], this, args);
  15699. }
  15700. }
  15701. });
  15702. }
  15703. /**
  15704. * Creates a function that invokes the predicate properties of `source` with
  15705. * the corresponding property values of a given object, returning `true` if
  15706. * all predicates return truthy, else `false`.
  15707. *
  15708. * **Note:** The created function is equivalent to `_.conformsTo` with
  15709. * `source` partially applied.
  15710. *
  15711. * @static
  15712. * @memberOf _
  15713. * @since 4.0.0
  15714. * @category Util
  15715. * @param {Object} source The object of property predicates to conform to.
  15716. * @returns {Function} Returns the new spec function.
  15717. * @example
  15718. *
  15719. * var objects = [
  15720. * { 'a': 2, 'b': 1 },
  15721. * { 'a': 1, 'b': 2 }
  15722. * ];
  15723. *
  15724. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15725. * // => [{ 'a': 1, 'b': 2 }]
  15726. */
  15727. function conforms(source) {
  15728. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15729. }
  15730. /**
  15731. * Creates a function that returns `value`.
  15732. *
  15733. * @static
  15734. * @memberOf _
  15735. * @since 2.4.0
  15736. * @category Util
  15737. * @param {*} value The value to return from the new function.
  15738. * @returns {Function} Returns the new constant function.
  15739. * @example
  15740. *
  15741. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15742. *
  15743. * console.log(objects);
  15744. * // => [{ 'a': 1 }, { 'a': 1 }]
  15745. *
  15746. * console.log(objects[0] === objects[1]);
  15747. * // => true
  15748. */
  15749. function constant(value) {
  15750. return function() {
  15751. return value;
  15752. };
  15753. }
  15754. /**
  15755. * Checks `value` to determine whether a default value should be returned in
  15756. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15757. * or `undefined`.
  15758. *
  15759. * @static
  15760. * @memberOf _
  15761. * @since 4.14.0
  15762. * @category Util
  15763. * @param {*} value The value to check.
  15764. * @param {*} defaultValue The default value.
  15765. * @returns {*} Returns the resolved value.
  15766. * @example
  15767. *
  15768. * _.defaultTo(1, 10);
  15769. * // => 1
  15770. *
  15771. * _.defaultTo(undefined, 10);
  15772. * // => 10
  15773. */
  15774. function defaultTo(value, defaultValue) {
  15775. return (value == null || value !== value) ? defaultValue : value;
  15776. }
  15777. /**
  15778. * Creates a function that returns the result of invoking the given functions
  15779. * with the `this` binding of the created function, where each successive
  15780. * invocation is supplied the return value of the previous.
  15781. *
  15782. * @static
  15783. * @memberOf _
  15784. * @since 3.0.0
  15785. * @category Util
  15786. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15787. * @returns {Function} Returns the new composite function.
  15788. * @see _.flowRight
  15789. * @example
  15790. *
  15791. * function square(n) {
  15792. * return n * n;
  15793. * }
  15794. *
  15795. * var addSquare = _.flow([_.add, square]);
  15796. * addSquare(1, 2);
  15797. * // => 9
  15798. */
  15799. var flow = createFlow();
  15800. /**
  15801. * This method is like `_.flow` except that it creates a function that
  15802. * invokes the given functions from right to left.
  15803. *
  15804. * @static
  15805. * @since 3.0.0
  15806. * @memberOf _
  15807. * @category Util
  15808. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15809. * @returns {Function} Returns the new composite function.
  15810. * @see _.flow
  15811. * @example
  15812. *
  15813. * function square(n) {
  15814. * return n * n;
  15815. * }
  15816. *
  15817. * var addSquare = _.flowRight([square, _.add]);
  15818. * addSquare(1, 2);
  15819. * // => 9
  15820. */
  15821. var flowRight = createFlow(true);
  15822. /**
  15823. * This method returns the first argument it receives.
  15824. *
  15825. * @static
  15826. * @since 0.1.0
  15827. * @memberOf _
  15828. * @category Util
  15829. * @param {*} value Any value.
  15830. * @returns {*} Returns `value`.
  15831. * @example
  15832. *
  15833. * var object = { 'a': 1 };
  15834. *
  15835. * console.log(_.identity(object) === object);
  15836. * // => true
  15837. */
  15838. function identity(value) {
  15839. return value;
  15840. }
  15841. /**
  15842. * Creates a function that invokes `func` with the arguments of the created
  15843. * function. If `func` is a property name, the created function returns the
  15844. * property value for a given element. If `func` is an array or object, the
  15845. * created function returns `true` for elements that contain the equivalent
  15846. * source properties, otherwise it returns `false`.
  15847. *
  15848. * @static
  15849. * @since 4.0.0
  15850. * @memberOf _
  15851. * @category Util
  15852. * @param {*} [func=_.identity] The value to convert to a callback.
  15853. * @returns {Function} Returns the callback.
  15854. * @example
  15855. *
  15856. * var users = [
  15857. * { 'user': 'barney', 'age': 36, 'active': true },
  15858. * { 'user': 'fred', 'age': 40, 'active': false }
  15859. * ];
  15860. *
  15861. * // The `_.matches` iteratee shorthand.
  15862. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15863. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15864. *
  15865. * // The `_.matchesProperty` iteratee shorthand.
  15866. * _.filter(users, _.iteratee(['user', 'fred']));
  15867. * // => [{ 'user': 'fred', 'age': 40 }]
  15868. *
  15869. * // The `_.property` iteratee shorthand.
  15870. * _.map(users, _.iteratee('user'));
  15871. * // => ['barney', 'fred']
  15872. *
  15873. * // Create custom iteratee shorthands.
  15874. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15875. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15876. * return func.test(string);
  15877. * };
  15878. * });
  15879. *
  15880. * _.filter(['abc', 'def'], /ef/);
  15881. * // => ['def']
  15882. */
  15883. function iteratee(func) {
  15884. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15885. }
  15886. /**
  15887. * Creates a function that performs a partial deep comparison between a given
  15888. * object and `source`, returning `true` if the given object has equivalent
  15889. * property values, else `false`.
  15890. *
  15891. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15892. * partially applied.
  15893. *
  15894. * Partial comparisons will match empty array and empty object `source`
  15895. * values against any array or object value, respectively. See `_.isEqual`
  15896. * for a list of supported value comparisons.
  15897. *
  15898. * **Note:** Multiple values can be checked by combining several matchers
  15899. * using `_.overSome`
  15900. *
  15901. * @static
  15902. * @memberOf _
  15903. * @since 3.0.0
  15904. * @category Util
  15905. * @param {Object} source The object of property values to match.
  15906. * @returns {Function} Returns the new spec function.
  15907. * @example
  15908. *
  15909. * var objects = [
  15910. * { 'a': 1, 'b': 2, 'c': 3 },
  15911. * { 'a': 4, 'b': 5, 'c': 6 }
  15912. * ];
  15913. *
  15914. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15915. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15916. *
  15917. * // Checking for several possible values
  15918. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15919. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15920. */
  15921. function matches(source) {
  15922. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15923. }
  15924. /**
  15925. * Creates a function that performs a partial deep comparison between the
  15926. * value at `path` of a given object to `srcValue`, returning `true` if the
  15927. * object value is equivalent, else `false`.
  15928. *
  15929. * **Note:** Partial comparisons will match empty array and empty object
  15930. * `srcValue` values against any array or object value, respectively. See
  15931. * `_.isEqual` for a list of supported value comparisons.
  15932. *
  15933. * **Note:** Multiple values can be checked by combining several matchers
  15934. * using `_.overSome`
  15935. *
  15936. * @static
  15937. * @memberOf _
  15938. * @since 3.2.0
  15939. * @category Util
  15940. * @param {Array|string} path The path of the property to get.
  15941. * @param {*} srcValue The value to match.
  15942. * @returns {Function} Returns the new spec function.
  15943. * @example
  15944. *
  15945. * var objects = [
  15946. * { 'a': 1, 'b': 2, 'c': 3 },
  15947. * { 'a': 4, 'b': 5, 'c': 6 }
  15948. * ];
  15949. *
  15950. * _.find(objects, _.matchesProperty('a', 4));
  15951. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15952. *
  15953. * // Checking for several possible values
  15954. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15955. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15956. */
  15957. function matchesProperty(path, srcValue) {
  15958. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15959. }
  15960. /**
  15961. * Creates a function that invokes the method at `path` of a given object.
  15962. * Any additional arguments are provided to the invoked method.
  15963. *
  15964. * @static
  15965. * @memberOf _
  15966. * @since 3.7.0
  15967. * @category Util
  15968. * @param {Array|string} path The path of the method to invoke.
  15969. * @param {...*} [args] The arguments to invoke the method with.
  15970. * @returns {Function} Returns the new invoker function.
  15971. * @example
  15972. *
  15973. * var objects = [
  15974. * { 'a': { 'b': _.constant(2) } },
  15975. * { 'a': { 'b': _.constant(1) } }
  15976. * ];
  15977. *
  15978. * _.map(objects, _.method('a.b'));
  15979. * // => [2, 1]
  15980. *
  15981. * _.map(objects, _.method(['a', 'b']));
  15982. * // => [2, 1]
  15983. */
  15984. var method = baseRest(function(path, args) {
  15985. return function(object) {
  15986. return baseInvoke(object, path, args);
  15987. };
  15988. });
  15989. /**
  15990. * The opposite of `_.method`; this method creates a function that invokes
  15991. * the method at a given path of `object`. Any additional arguments are
  15992. * provided to the invoked method.
  15993. *
  15994. * @static
  15995. * @memberOf _
  15996. * @since 3.7.0
  15997. * @category Util
  15998. * @param {Object} object The object to query.
  15999. * @param {...*} [args] The arguments to invoke the method with.
  16000. * @returns {Function} Returns the new invoker function.
  16001. * @example
  16002. *
  16003. * var array = _.times(3, _.constant),
  16004. * object = { 'a': array, 'b': array, 'c': array };
  16005. *
  16006. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16007. * // => [2, 0]
  16008. *
  16009. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16010. * // => [2, 0]
  16011. */
  16012. var methodOf = baseRest(function(object, args) {
  16013. return function(path) {
  16014. return baseInvoke(object, path, args);
  16015. };
  16016. });
  16017. /**
  16018. * Adds all own enumerable string keyed function properties of a source
  16019. * object to the destination object. If `object` is a function, then methods
  16020. * are added to its prototype as well.
  16021. *
  16022. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16023. * avoid conflicts caused by modifying the original.
  16024. *
  16025. * @static
  16026. * @since 0.1.0
  16027. * @memberOf _
  16028. * @category Util
  16029. * @param {Function|Object} [object=lodash] The destination object.
  16030. * @param {Object} source The object of functions to add.
  16031. * @param {Object} [options={}] The options object.
  16032. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16033. * @returns {Function|Object} Returns `object`.
  16034. * @example
  16035. *
  16036. * function vowels(string) {
  16037. * return _.filter(string, function(v) {
  16038. * return /[aeiou]/i.test(v);
  16039. * });
  16040. * }
  16041. *
  16042. * _.mixin({ 'vowels': vowels });
  16043. * _.vowels('fred');
  16044. * // => ['e']
  16045. *
  16046. * _('fred').vowels().value();
  16047. * // => ['e']
  16048. *
  16049. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16050. * _('fred').vowels();
  16051. * // => ['e']
  16052. */
  16053. function mixin(object, source, options) {
  16054. var props = keys(source),
  16055. methodNames = baseFunctions(source, props);
  16056. if (options == null &&
  16057. !(isObject(source) && (methodNames.length || !props.length))) {
  16058. options = source;
  16059. source = object;
  16060. object = this;
  16061. methodNames = baseFunctions(source, keys(source));
  16062. }
  16063. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16064. isFunc = isFunction(object);
  16065. arrayEach(methodNames, function(methodName) {
  16066. var func = source[methodName];
  16067. object[methodName] = func;
  16068. if (isFunc) {
  16069. object.prototype[methodName] = function() {
  16070. var chainAll = this.__chain__;
  16071. if (chain || chainAll) {
  16072. var result = object(this.__wrapped__),
  16073. actions = result.__actions__ = copyArray(this.__actions__);
  16074. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16075. result.__chain__ = chainAll;
  16076. return result;
  16077. }
  16078. return func.apply(object, arrayPush([this.value()], arguments));
  16079. };
  16080. }
  16081. });
  16082. return object;
  16083. }
  16084. /**
  16085. * Reverts the `_` variable to its previous value and returns a reference to
  16086. * the `lodash` function.
  16087. *
  16088. * @static
  16089. * @since 0.1.0
  16090. * @memberOf _
  16091. * @category Util
  16092. * @returns {Function} Returns the `lodash` function.
  16093. * @example
  16094. *
  16095. * var lodash = _.noConflict();
  16096. */
  16097. function noConflict() {
  16098. if (root._ === this) {
  16099. root._ = oldDash;
  16100. }
  16101. return this;
  16102. }
  16103. /**
  16104. * This method returns `undefined`.
  16105. *
  16106. * @static
  16107. * @memberOf _
  16108. * @since 2.3.0
  16109. * @category Util
  16110. * @example
  16111. *
  16112. * _.times(2, _.noop);
  16113. * // => [undefined, undefined]
  16114. */
  16115. function noop() {
  16116. // No operation performed.
  16117. }
  16118. /**
  16119. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16120. * the nth argument from the end is returned.
  16121. *
  16122. * @static
  16123. * @memberOf _
  16124. * @since 4.0.0
  16125. * @category Util
  16126. * @param {number} [n=0] The index of the argument to return.
  16127. * @returns {Function} Returns the new pass-thru function.
  16128. * @example
  16129. *
  16130. * var func = _.nthArg(1);
  16131. * func('a', 'b', 'c', 'd');
  16132. * // => 'b'
  16133. *
  16134. * var func = _.nthArg(-2);
  16135. * func('a', 'b', 'c', 'd');
  16136. * // => 'c'
  16137. */
  16138. function nthArg(n) {
  16139. n = toInteger(n);
  16140. return baseRest(function(args) {
  16141. return baseNth(args, n);
  16142. });
  16143. }
  16144. /**
  16145. * Creates a function that invokes `iteratees` with the arguments it receives
  16146. * and returns their results.
  16147. *
  16148. * @static
  16149. * @memberOf _
  16150. * @since 4.0.0
  16151. * @category Util
  16152. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16153. * The iteratees to invoke.
  16154. * @returns {Function} Returns the new function.
  16155. * @example
  16156. *
  16157. * var func = _.over([Math.max, Math.min]);
  16158. *
  16159. * func(1, 2, 3, 4);
  16160. * // => [4, 1]
  16161. */
  16162. var over = createOver(arrayMap);
  16163. /**
  16164. * Creates a function that checks if **all** of the `predicates` return
  16165. * truthy when invoked with the arguments it receives.
  16166. *
  16167. * Following shorthands are possible for providing predicates.
  16168. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16169. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16170. *
  16171. * @static
  16172. * @memberOf _
  16173. * @since 4.0.0
  16174. * @category Util
  16175. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16176. * The predicates to check.
  16177. * @returns {Function} Returns the new function.
  16178. * @example
  16179. *
  16180. * var func = _.overEvery([Boolean, isFinite]);
  16181. *
  16182. * func('1');
  16183. * // => true
  16184. *
  16185. * func(null);
  16186. * // => false
  16187. *
  16188. * func(NaN);
  16189. * // => false
  16190. */
  16191. var overEvery = createOver(arrayEvery);
  16192. /**
  16193. * Creates a function that checks if **any** of the `predicates` return
  16194. * truthy when invoked with the arguments it receives.
  16195. *
  16196. * Following shorthands are possible for providing predicates.
  16197. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16198. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16199. *
  16200. * @static
  16201. * @memberOf _
  16202. * @since 4.0.0
  16203. * @category Util
  16204. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16205. * The predicates to check.
  16206. * @returns {Function} Returns the new function.
  16207. * @example
  16208. *
  16209. * var func = _.overSome([Boolean, isFinite]);
  16210. *
  16211. * func('1');
  16212. * // => true
  16213. *
  16214. * func(null);
  16215. * // => true
  16216. *
  16217. * func(NaN);
  16218. * // => false
  16219. *
  16220. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16221. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16222. */
  16223. var overSome = createOver(arraySome);
  16224. /**
  16225. * Creates a function that returns the value at `path` of a given object.
  16226. *
  16227. * @static
  16228. * @memberOf _
  16229. * @since 2.4.0
  16230. * @category Util
  16231. * @param {Array|string} path The path of the property to get.
  16232. * @returns {Function} Returns the new accessor function.
  16233. * @example
  16234. *
  16235. * var objects = [
  16236. * { 'a': { 'b': 2 } },
  16237. * { 'a': { 'b': 1 } }
  16238. * ];
  16239. *
  16240. * _.map(objects, _.property('a.b'));
  16241. * // => [2, 1]
  16242. *
  16243. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16244. * // => [1, 2]
  16245. */
  16246. function property(path) {
  16247. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16248. }
  16249. /**
  16250. * The opposite of `_.property`; this method creates a function that returns
  16251. * the value at a given path of `object`.
  16252. *
  16253. * @static
  16254. * @memberOf _
  16255. * @since 3.0.0
  16256. * @category Util
  16257. * @param {Object} object The object to query.
  16258. * @returns {Function} Returns the new accessor function.
  16259. * @example
  16260. *
  16261. * var array = [0, 1, 2],
  16262. * object = { 'a': array, 'b': array, 'c': array };
  16263. *
  16264. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16265. * // => [2, 0]
  16266. *
  16267. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16268. * // => [2, 0]
  16269. */
  16270. function propertyOf(object) {
  16271. return function(path) {
  16272. return object == null ? undefined : baseGet(object, path);
  16273. };
  16274. }
  16275. /**
  16276. * Creates an array of numbers (positive and/or negative) progressing from
  16277. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16278. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16279. * it's set to `start` with `start` then set to `0`.
  16280. *
  16281. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16282. * floating-point values which can produce unexpected results.
  16283. *
  16284. * @static
  16285. * @since 0.1.0
  16286. * @memberOf _
  16287. * @category Util
  16288. * @param {number} [start=0] The start of the range.
  16289. * @param {number} end The end of the range.
  16290. * @param {number} [step=1] The value to increment or decrement by.
  16291. * @returns {Array} Returns the range of numbers.
  16292. * @see _.inRange, _.rangeRight
  16293. * @example
  16294. *
  16295. * _.range(4);
  16296. * // => [0, 1, 2, 3]
  16297. *
  16298. * _.range(-4);
  16299. * // => [0, -1, -2, -3]
  16300. *
  16301. * _.range(1, 5);
  16302. * // => [1, 2, 3, 4]
  16303. *
  16304. * _.range(0, 20, 5);
  16305. * // => [0, 5, 10, 15]
  16306. *
  16307. * _.range(0, -4, -1);
  16308. * // => [0, -1, -2, -3]
  16309. *
  16310. * _.range(1, 4, 0);
  16311. * // => [1, 1, 1]
  16312. *
  16313. * _.range(0);
  16314. * // => []
  16315. */
  16316. var range = createRange();
  16317. /**
  16318. * This method is like `_.range` except that it populates values in
  16319. * descending order.
  16320. *
  16321. * @static
  16322. * @memberOf _
  16323. * @since 4.0.0
  16324. * @category Util
  16325. * @param {number} [start=0] The start of the range.
  16326. * @param {number} end The end of the range.
  16327. * @param {number} [step=1] The value to increment or decrement by.
  16328. * @returns {Array} Returns the range of numbers.
  16329. * @see _.inRange, _.range
  16330. * @example
  16331. *
  16332. * _.rangeRight(4);
  16333. * // => [3, 2, 1, 0]
  16334. *
  16335. * _.rangeRight(-4);
  16336. * // => [-3, -2, -1, 0]
  16337. *
  16338. * _.rangeRight(1, 5);
  16339. * // => [4, 3, 2, 1]
  16340. *
  16341. * _.rangeRight(0, 20, 5);
  16342. * // => [15, 10, 5, 0]
  16343. *
  16344. * _.rangeRight(0, -4, -1);
  16345. * // => [-3, -2, -1, 0]
  16346. *
  16347. * _.rangeRight(1, 4, 0);
  16348. * // => [1, 1, 1]
  16349. *
  16350. * _.rangeRight(0);
  16351. * // => []
  16352. */
  16353. var rangeRight = createRange(true);
  16354. /**
  16355. * This method returns a new empty array.
  16356. *
  16357. * @static
  16358. * @memberOf _
  16359. * @since 4.13.0
  16360. * @category Util
  16361. * @returns {Array} Returns the new empty array.
  16362. * @example
  16363. *
  16364. * var arrays = _.times(2, _.stubArray);
  16365. *
  16366. * console.log(arrays);
  16367. * // => [[], []]
  16368. *
  16369. * console.log(arrays[0] === arrays[1]);
  16370. * // => false
  16371. */
  16372. function stubArray() {
  16373. return [];
  16374. }
  16375. /**
  16376. * This method returns `false`.
  16377. *
  16378. * @static
  16379. * @memberOf _
  16380. * @since 4.13.0
  16381. * @category Util
  16382. * @returns {boolean} Returns `false`.
  16383. * @example
  16384. *
  16385. * _.times(2, _.stubFalse);
  16386. * // => [false, false]
  16387. */
  16388. function stubFalse() {
  16389. return false;
  16390. }
  16391. /**
  16392. * This method returns a new empty object.
  16393. *
  16394. * @static
  16395. * @memberOf _
  16396. * @since 4.13.0
  16397. * @category Util
  16398. * @returns {Object} Returns the new empty object.
  16399. * @example
  16400. *
  16401. * var objects = _.times(2, _.stubObject);
  16402. *
  16403. * console.log(objects);
  16404. * // => [{}, {}]
  16405. *
  16406. * console.log(objects[0] === objects[1]);
  16407. * // => false
  16408. */
  16409. function stubObject() {
  16410. return {};
  16411. }
  16412. /**
  16413. * This method returns an empty string.
  16414. *
  16415. * @static
  16416. * @memberOf _
  16417. * @since 4.13.0
  16418. * @category Util
  16419. * @returns {string} Returns the empty string.
  16420. * @example
  16421. *
  16422. * _.times(2, _.stubString);
  16423. * // => ['', '']
  16424. */
  16425. function stubString() {
  16426. return '';
  16427. }
  16428. /**
  16429. * This method returns `true`.
  16430. *
  16431. * @static
  16432. * @memberOf _
  16433. * @since 4.13.0
  16434. * @category Util
  16435. * @returns {boolean} Returns `true`.
  16436. * @example
  16437. *
  16438. * _.times(2, _.stubTrue);
  16439. * // => [true, true]
  16440. */
  16441. function stubTrue() {
  16442. return true;
  16443. }
  16444. /**
  16445. * Invokes the iteratee `n` times, returning an array of the results of
  16446. * each invocation. The iteratee is invoked with one argument; (index).
  16447. *
  16448. * @static
  16449. * @since 0.1.0
  16450. * @memberOf _
  16451. * @category Util
  16452. * @param {number} n The number of times to invoke `iteratee`.
  16453. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16454. * @returns {Array} Returns the array of results.
  16455. * @example
  16456. *
  16457. * _.times(3, String);
  16458. * // => ['0', '1', '2']
  16459. *
  16460. * _.times(4, _.constant(0));
  16461. * // => [0, 0, 0, 0]
  16462. */
  16463. function times(n, iteratee) {
  16464. n = toInteger(n);
  16465. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16466. return [];
  16467. }
  16468. var index = MAX_ARRAY_LENGTH,
  16469. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16470. iteratee = getIteratee(iteratee);
  16471. n -= MAX_ARRAY_LENGTH;
  16472. var result = baseTimes(length, iteratee);
  16473. while (++index < n) {
  16474. iteratee(index);
  16475. }
  16476. return result;
  16477. }
  16478. /**
  16479. * Converts `value` to a property path array.
  16480. *
  16481. * @static
  16482. * @memberOf _
  16483. * @since 4.0.0
  16484. * @category Util
  16485. * @param {*} value The value to convert.
  16486. * @returns {Array} Returns the new property path array.
  16487. * @example
  16488. *
  16489. * _.toPath('a.b.c');
  16490. * // => ['a', 'b', 'c']
  16491. *
  16492. * _.toPath('a[0].b.c');
  16493. * // => ['a', '0', 'b', 'c']
  16494. */
  16495. function toPath(value) {
  16496. if (isArray(value)) {
  16497. return arrayMap(value, toKey);
  16498. }
  16499. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16500. }
  16501. /**
  16502. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16503. *
  16504. * @static
  16505. * @since 0.1.0
  16506. * @memberOf _
  16507. * @category Util
  16508. * @param {string} [prefix=''] The value to prefix the ID with.
  16509. * @returns {string} Returns the unique ID.
  16510. * @example
  16511. *
  16512. * _.uniqueId('contact_');
  16513. * // => 'contact_104'
  16514. *
  16515. * _.uniqueId();
  16516. * // => '105'
  16517. */
  16518. function uniqueId(prefix) {
  16519. var id = ++idCounter;
  16520. return toString(prefix) + id;
  16521. }
  16522. /*------------------------------------------------------------------------*/
  16523. /**
  16524. * Adds two numbers.
  16525. *
  16526. * @static
  16527. * @memberOf _
  16528. * @since 3.4.0
  16529. * @category Math
  16530. * @param {number} augend The first number in an addition.
  16531. * @param {number} addend The second number in an addition.
  16532. * @returns {number} Returns the total.
  16533. * @example
  16534. *
  16535. * _.add(6, 4);
  16536. * // => 10
  16537. */
  16538. var add = createMathOperation(function(augend, addend) {
  16539. return augend + addend;
  16540. }, 0);
  16541. /**
  16542. * Computes `number` rounded up to `precision`.
  16543. *
  16544. * @static
  16545. * @memberOf _
  16546. * @since 3.10.0
  16547. * @category Math
  16548. * @param {number} number The number to round up.
  16549. * @param {number} [precision=0] The precision to round up to.
  16550. * @returns {number} Returns the rounded up number.
  16551. * @example
  16552. *
  16553. * _.ceil(4.006);
  16554. * // => 5
  16555. *
  16556. * _.ceil(6.004, 2);
  16557. * // => 6.01
  16558. *
  16559. * _.ceil(6040, -2);
  16560. * // => 6100
  16561. */
  16562. var ceil = createRound('ceil');
  16563. /**
  16564. * Divide two numbers.
  16565. *
  16566. * @static
  16567. * @memberOf _
  16568. * @since 4.7.0
  16569. * @category Math
  16570. * @param {number} dividend The first number in a division.
  16571. * @param {number} divisor The second number in a division.
  16572. * @returns {number} Returns the quotient.
  16573. * @example
  16574. *
  16575. * _.divide(6, 4);
  16576. * // => 1.5
  16577. */
  16578. var divide = createMathOperation(function(dividend, divisor) {
  16579. return dividend / divisor;
  16580. }, 1);
  16581. /**
  16582. * Computes `number` rounded down to `precision`.
  16583. *
  16584. * @static
  16585. * @memberOf _
  16586. * @since 3.10.0
  16587. * @category Math
  16588. * @param {number} number The number to round down.
  16589. * @param {number} [precision=0] The precision to round down to.
  16590. * @returns {number} Returns the rounded down number.
  16591. * @example
  16592. *
  16593. * _.floor(4.006);
  16594. * // => 4
  16595. *
  16596. * _.floor(0.046, 2);
  16597. * // => 0.04
  16598. *
  16599. * _.floor(4060, -2);
  16600. * // => 4000
  16601. */
  16602. var floor = createRound('floor');
  16603. /**
  16604. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16605. * `undefined` is returned.
  16606. *
  16607. * @static
  16608. * @since 0.1.0
  16609. * @memberOf _
  16610. * @category Math
  16611. * @param {Array} array The array to iterate over.
  16612. * @returns {*} Returns the maximum value.
  16613. * @example
  16614. *
  16615. * _.max([4, 2, 8, 6]);
  16616. * // => 8
  16617. *
  16618. * _.max([]);
  16619. * // => undefined
  16620. */
  16621. function max(array) {
  16622. return (array && array.length)
  16623. ? baseExtremum(array, identity, baseGt)
  16624. : undefined;
  16625. }
  16626. /**
  16627. * This method is like `_.max` except that it accepts `iteratee` which is
  16628. * invoked for each element in `array` to generate the criterion by which
  16629. * the value is ranked. The iteratee is invoked with one argument: (value).
  16630. *
  16631. * @static
  16632. * @memberOf _
  16633. * @since 4.0.0
  16634. * @category Math
  16635. * @param {Array} array The array to iterate over.
  16636. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16637. * @returns {*} Returns the maximum value.
  16638. * @example
  16639. *
  16640. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16641. *
  16642. * _.maxBy(objects, function(o) { return o.n; });
  16643. * // => { 'n': 2 }
  16644. *
  16645. * // The `_.property` iteratee shorthand.
  16646. * _.maxBy(objects, 'n');
  16647. * // => { 'n': 2 }
  16648. */
  16649. function maxBy(array, iteratee) {
  16650. return (array && array.length)
  16651. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16652. : undefined;
  16653. }
  16654. /**
  16655. * Computes the mean of the values in `array`.
  16656. *
  16657. * @static
  16658. * @memberOf _
  16659. * @since 4.0.0
  16660. * @category Math
  16661. * @param {Array} array The array to iterate over.
  16662. * @returns {number} Returns the mean.
  16663. * @example
  16664. *
  16665. * _.mean([4, 2, 8, 6]);
  16666. * // => 5
  16667. */
  16668. function mean(array) {
  16669. return baseMean(array, identity);
  16670. }
  16671. /**
  16672. * This method is like `_.mean` except that it accepts `iteratee` which is
  16673. * invoked for each element in `array` to generate the value to be averaged.
  16674. * The iteratee is invoked with one argument: (value).
  16675. *
  16676. * @static
  16677. * @memberOf _
  16678. * @since 4.7.0
  16679. * @category Math
  16680. * @param {Array} array The array to iterate over.
  16681. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16682. * @returns {number} Returns the mean.
  16683. * @example
  16684. *
  16685. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16686. *
  16687. * _.meanBy(objects, function(o) { return o.n; });
  16688. * // => 5
  16689. *
  16690. * // The `_.property` iteratee shorthand.
  16691. * _.meanBy(objects, 'n');
  16692. * // => 5
  16693. */
  16694. function meanBy(array, iteratee) {
  16695. return baseMean(array, getIteratee(iteratee, 2));
  16696. }
  16697. /**
  16698. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16699. * `undefined` is returned.
  16700. *
  16701. * @static
  16702. * @since 0.1.0
  16703. * @memberOf _
  16704. * @category Math
  16705. * @param {Array} array The array to iterate over.
  16706. * @returns {*} Returns the minimum value.
  16707. * @example
  16708. *
  16709. * _.min([4, 2, 8, 6]);
  16710. * // => 2
  16711. *
  16712. * _.min([]);
  16713. * // => undefined
  16714. */
  16715. function min(array) {
  16716. return (array && array.length)
  16717. ? baseExtremum(array, identity, baseLt)
  16718. : undefined;
  16719. }
  16720. /**
  16721. * This method is like `_.min` except that it accepts `iteratee` which is
  16722. * invoked for each element in `array` to generate the criterion by which
  16723. * the value is ranked. The iteratee is invoked with one argument: (value).
  16724. *
  16725. * @static
  16726. * @memberOf _
  16727. * @since 4.0.0
  16728. * @category Math
  16729. * @param {Array} array The array to iterate over.
  16730. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16731. * @returns {*} Returns the minimum value.
  16732. * @example
  16733. *
  16734. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16735. *
  16736. * _.minBy(objects, function(o) { return o.n; });
  16737. * // => { 'n': 1 }
  16738. *
  16739. * // The `_.property` iteratee shorthand.
  16740. * _.minBy(objects, 'n');
  16741. * // => { 'n': 1 }
  16742. */
  16743. function minBy(array, iteratee) {
  16744. return (array && array.length)
  16745. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16746. : undefined;
  16747. }
  16748. /**
  16749. * Multiply two numbers.
  16750. *
  16751. * @static
  16752. * @memberOf _
  16753. * @since 4.7.0
  16754. * @category Math
  16755. * @param {number} multiplier The first number in a multiplication.
  16756. * @param {number} multiplicand The second number in a multiplication.
  16757. * @returns {number} Returns the product.
  16758. * @example
  16759. *
  16760. * _.multiply(6, 4);
  16761. * // => 24
  16762. */
  16763. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16764. return multiplier * multiplicand;
  16765. }, 1);
  16766. /**
  16767. * Computes `number` rounded to `precision`.
  16768. *
  16769. * @static
  16770. * @memberOf _
  16771. * @since 3.10.0
  16772. * @category Math
  16773. * @param {number} number The number to round.
  16774. * @param {number} [precision=0] The precision to round to.
  16775. * @returns {number} Returns the rounded number.
  16776. * @example
  16777. *
  16778. * _.round(4.006);
  16779. * // => 4
  16780. *
  16781. * _.round(4.006, 2);
  16782. * // => 4.01
  16783. *
  16784. * _.round(4060, -2);
  16785. * // => 4100
  16786. */
  16787. var round = createRound('round');
  16788. /**
  16789. * Subtract two numbers.
  16790. *
  16791. * @static
  16792. * @memberOf _
  16793. * @since 4.0.0
  16794. * @category Math
  16795. * @param {number} minuend The first number in a subtraction.
  16796. * @param {number} subtrahend The second number in a subtraction.
  16797. * @returns {number} Returns the difference.
  16798. * @example
  16799. *
  16800. * _.subtract(6, 4);
  16801. * // => 2
  16802. */
  16803. var subtract = createMathOperation(function(minuend, subtrahend) {
  16804. return minuend - subtrahend;
  16805. }, 0);
  16806. /**
  16807. * Computes the sum of the values in `array`.
  16808. *
  16809. * @static
  16810. * @memberOf _
  16811. * @since 3.4.0
  16812. * @category Math
  16813. * @param {Array} array The array to iterate over.
  16814. * @returns {number} Returns the sum.
  16815. * @example
  16816. *
  16817. * _.sum([4, 2, 8, 6]);
  16818. * // => 20
  16819. */
  16820. function sum(array) {
  16821. return (array && array.length)
  16822. ? baseSum(array, identity)
  16823. : 0;
  16824. }
  16825. /**
  16826. * This method is like `_.sum` except that it accepts `iteratee` which is
  16827. * invoked for each element in `array` to generate the value to be summed.
  16828. * The iteratee is invoked with one argument: (value).
  16829. *
  16830. * @static
  16831. * @memberOf _
  16832. * @since 4.0.0
  16833. * @category Math
  16834. * @param {Array} array The array to iterate over.
  16835. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16836. * @returns {number} Returns the sum.
  16837. * @example
  16838. *
  16839. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16840. *
  16841. * _.sumBy(objects, function(o) { return o.n; });
  16842. * // => 20
  16843. *
  16844. * // The `_.property` iteratee shorthand.
  16845. * _.sumBy(objects, 'n');
  16846. * // => 20
  16847. */
  16848. function sumBy(array, iteratee) {
  16849. return (array && array.length)
  16850. ? baseSum(array, getIteratee(iteratee, 2))
  16851. : 0;
  16852. }
  16853. /*------------------------------------------------------------------------*/
  16854. // Add methods that return wrapped values in chain sequences.
  16855. lodash.after = after;
  16856. lodash.ary = ary;
  16857. lodash.assign = assign;
  16858. lodash.assignIn = assignIn;
  16859. lodash.assignInWith = assignInWith;
  16860. lodash.assignWith = assignWith;
  16861. lodash.at = at;
  16862. lodash.before = before;
  16863. lodash.bind = bind;
  16864. lodash.bindAll = bindAll;
  16865. lodash.bindKey = bindKey;
  16866. lodash.castArray = castArray;
  16867. lodash.chain = chain;
  16868. lodash.chunk = chunk;
  16869. lodash.compact = compact;
  16870. lodash.concat = concat;
  16871. lodash.cond = cond;
  16872. lodash.conforms = conforms;
  16873. lodash.constant = constant;
  16874. lodash.countBy = countBy;
  16875. lodash.create = create;
  16876. lodash.curry = curry;
  16877. lodash.curryRight = curryRight;
  16878. lodash.debounce = debounce;
  16879. lodash.defaults = defaults;
  16880. lodash.defaultsDeep = defaultsDeep;
  16881. lodash.defer = defer;
  16882. lodash.delay = delay;
  16883. lodash.difference = difference;
  16884. lodash.differenceBy = differenceBy;
  16885. lodash.differenceWith = differenceWith;
  16886. lodash.drop = drop;
  16887. lodash.dropRight = dropRight;
  16888. lodash.dropRightWhile = dropRightWhile;
  16889. lodash.dropWhile = dropWhile;
  16890. lodash.fill = fill;
  16891. lodash.filter = filter;
  16892. lodash.flatMap = flatMap;
  16893. lodash.flatMapDeep = flatMapDeep;
  16894. lodash.flatMapDepth = flatMapDepth;
  16895. lodash.flatten = flatten;
  16896. lodash.flattenDeep = flattenDeep;
  16897. lodash.flattenDepth = flattenDepth;
  16898. lodash.flip = flip;
  16899. lodash.flow = flow;
  16900. lodash.flowRight = flowRight;
  16901. lodash.fromPairs = fromPairs;
  16902. lodash.functions = functions;
  16903. lodash.functionsIn = functionsIn;
  16904. lodash.groupBy = groupBy;
  16905. lodash.initial = initial;
  16906. lodash.intersection = intersection;
  16907. lodash.intersectionBy = intersectionBy;
  16908. lodash.intersectionWith = intersectionWith;
  16909. lodash.invert = invert;
  16910. lodash.invertBy = invertBy;
  16911. lodash.invokeMap = invokeMap;
  16912. lodash.iteratee = iteratee;
  16913. lodash.keyBy = keyBy;
  16914. lodash.keys = keys;
  16915. lodash.keysIn = keysIn;
  16916. lodash.map = map;
  16917. lodash.mapKeys = mapKeys;
  16918. lodash.mapValues = mapValues;
  16919. lodash.matches = matches;
  16920. lodash.matchesProperty = matchesProperty;
  16921. lodash.memoize = memoize;
  16922. lodash.merge = merge;
  16923. lodash.mergeWith = mergeWith;
  16924. lodash.method = method;
  16925. lodash.methodOf = methodOf;
  16926. lodash.mixin = mixin;
  16927. lodash.negate = negate;
  16928. lodash.nthArg = nthArg;
  16929. lodash.omit = omit;
  16930. lodash.omitBy = omitBy;
  16931. lodash.once = once;
  16932. lodash.orderBy = orderBy;
  16933. lodash.over = over;
  16934. lodash.overArgs = overArgs;
  16935. lodash.overEvery = overEvery;
  16936. lodash.overSome = overSome;
  16937. lodash.partial = partial;
  16938. lodash.partialRight = partialRight;
  16939. lodash.partition = partition;
  16940. lodash.pick = pick;
  16941. lodash.pickBy = pickBy;
  16942. lodash.property = property;
  16943. lodash.propertyOf = propertyOf;
  16944. lodash.pull = pull;
  16945. lodash.pullAll = pullAll;
  16946. lodash.pullAllBy = pullAllBy;
  16947. lodash.pullAllWith = pullAllWith;
  16948. lodash.pullAt = pullAt;
  16949. lodash.range = range;
  16950. lodash.rangeRight = rangeRight;
  16951. lodash.rearg = rearg;
  16952. lodash.reject = reject;
  16953. lodash.remove = remove;
  16954. lodash.rest = rest;
  16955. lodash.reverse = reverse;
  16956. lodash.sampleSize = sampleSize;
  16957. lodash.set = set;
  16958. lodash.setWith = setWith;
  16959. lodash.shuffle = shuffle;
  16960. lodash.slice = slice;
  16961. lodash.sortBy = sortBy;
  16962. lodash.sortedUniq = sortedUniq;
  16963. lodash.sortedUniqBy = sortedUniqBy;
  16964. lodash.split = split;
  16965. lodash.spread = spread;
  16966. lodash.tail = tail;
  16967. lodash.take = take;
  16968. lodash.takeRight = takeRight;
  16969. lodash.takeRightWhile = takeRightWhile;
  16970. lodash.takeWhile = takeWhile;
  16971. lodash.tap = tap;
  16972. lodash.throttle = throttle;
  16973. lodash.thru = thru;
  16974. lodash.toArray = toArray;
  16975. lodash.toPairs = toPairs;
  16976. lodash.toPairsIn = toPairsIn;
  16977. lodash.toPath = toPath;
  16978. lodash.toPlainObject = toPlainObject;
  16979. lodash.transform = transform;
  16980. lodash.unary = unary;
  16981. lodash.union = union;
  16982. lodash.unionBy = unionBy;
  16983. lodash.unionWith = unionWith;
  16984. lodash.uniq = uniq;
  16985. lodash.uniqBy = uniqBy;
  16986. lodash.uniqWith = uniqWith;
  16987. lodash.unset = unset;
  16988. lodash.unzip = unzip;
  16989. lodash.unzipWith = unzipWith;
  16990. lodash.update = update;
  16991. lodash.updateWith = updateWith;
  16992. lodash.values = values;
  16993. lodash.valuesIn = valuesIn;
  16994. lodash.without = without;
  16995. lodash.words = words;
  16996. lodash.wrap = wrap;
  16997. lodash.xor = xor;
  16998. lodash.xorBy = xorBy;
  16999. lodash.xorWith = xorWith;
  17000. lodash.zip = zip;
  17001. lodash.zipObject = zipObject;
  17002. lodash.zipObjectDeep = zipObjectDeep;
  17003. lodash.zipWith = zipWith;
  17004. // Add aliases.
  17005. lodash.entries = toPairs;
  17006. lodash.entriesIn = toPairsIn;
  17007. lodash.extend = assignIn;
  17008. lodash.extendWith = assignInWith;
  17009. // Add methods to `lodash.prototype`.
  17010. mixin(lodash, lodash);
  17011. /*------------------------------------------------------------------------*/
  17012. // Add methods that return unwrapped values in chain sequences.
  17013. lodash.add = add;
  17014. lodash.attempt = attempt;
  17015. lodash.camelCase = camelCase;
  17016. lodash.capitalize = capitalize;
  17017. lodash.ceil = ceil;
  17018. lodash.clamp = clamp;
  17019. lodash.clone = clone;
  17020. lodash.cloneDeep = cloneDeep;
  17021. lodash.cloneDeepWith = cloneDeepWith;
  17022. lodash.cloneWith = cloneWith;
  17023. lodash.conformsTo = conformsTo;
  17024. lodash.deburr = deburr;
  17025. lodash.defaultTo = defaultTo;
  17026. lodash.divide = divide;
  17027. lodash.endsWith = endsWith;
  17028. lodash.eq = eq;
  17029. lodash.escape = escape;
  17030. lodash.escapeRegExp = escapeRegExp;
  17031. lodash.every = every;
  17032. lodash.find = find;
  17033. lodash.findIndex = findIndex;
  17034. lodash.findKey = findKey;
  17035. lodash.findLast = findLast;
  17036. lodash.findLastIndex = findLastIndex;
  17037. lodash.findLastKey = findLastKey;
  17038. lodash.floor = floor;
  17039. lodash.forEach = forEach;
  17040. lodash.forEachRight = forEachRight;
  17041. lodash.forIn = forIn;
  17042. lodash.forInRight = forInRight;
  17043. lodash.forOwn = forOwn;
  17044. lodash.forOwnRight = forOwnRight;
  17045. lodash.get = get;
  17046. lodash.gt = gt;
  17047. lodash.gte = gte;
  17048. lodash.has = has;
  17049. lodash.hasIn = hasIn;
  17050. lodash.head = head;
  17051. lodash.identity = identity;
  17052. lodash.includes = includes;
  17053. lodash.indexOf = indexOf;
  17054. lodash.inRange = inRange;
  17055. lodash.invoke = invoke;
  17056. lodash.isArguments = isArguments;
  17057. lodash.isArray = isArray;
  17058. lodash.isArrayBuffer = isArrayBuffer;
  17059. lodash.isArrayLike = isArrayLike;
  17060. lodash.isArrayLikeObject = isArrayLikeObject;
  17061. lodash.isBoolean = isBoolean;
  17062. lodash.isBuffer = isBuffer;
  17063. lodash.isDate = isDate;
  17064. lodash.isElement = isElement;
  17065. lodash.isEmpty = isEmpty;
  17066. lodash.isEqual = isEqual;
  17067. lodash.isEqualWith = isEqualWith;
  17068. lodash.isError = isError;
  17069. lodash.isFinite = isFinite;
  17070. lodash.isFunction = isFunction;
  17071. lodash.isInteger = isInteger;
  17072. lodash.isLength = isLength;
  17073. lodash.isMap = isMap;
  17074. lodash.isMatch = isMatch;
  17075. lodash.isMatchWith = isMatchWith;
  17076. lodash.isNaN = isNaN;
  17077. lodash.isNative = isNative;
  17078. lodash.isNil = isNil;
  17079. lodash.isNull = isNull;
  17080. lodash.isNumber = isNumber;
  17081. lodash.isObject = isObject;
  17082. lodash.isObjectLike = isObjectLike;
  17083. lodash.isPlainObject = isPlainObject;
  17084. lodash.isRegExp = isRegExp;
  17085. lodash.isSafeInteger = isSafeInteger;
  17086. lodash.isSet = isSet;
  17087. lodash.isString = isString;
  17088. lodash.isSymbol = isSymbol;
  17089. lodash.isTypedArray = isTypedArray;
  17090. lodash.isUndefined = isUndefined;
  17091. lodash.isWeakMap = isWeakMap;
  17092. lodash.isWeakSet = isWeakSet;
  17093. lodash.join = join;
  17094. lodash.kebabCase = kebabCase;
  17095. lodash.last = last;
  17096. lodash.lastIndexOf = lastIndexOf;
  17097. lodash.lowerCase = lowerCase;
  17098. lodash.lowerFirst = lowerFirst;
  17099. lodash.lt = lt;
  17100. lodash.lte = lte;
  17101. lodash.max = max;
  17102. lodash.maxBy = maxBy;
  17103. lodash.mean = mean;
  17104. lodash.meanBy = meanBy;
  17105. lodash.min = min;
  17106. lodash.minBy = minBy;
  17107. lodash.stubArray = stubArray;
  17108. lodash.stubFalse = stubFalse;
  17109. lodash.stubObject = stubObject;
  17110. lodash.stubString = stubString;
  17111. lodash.stubTrue = stubTrue;
  17112. lodash.multiply = multiply;
  17113. lodash.nth = nth;
  17114. lodash.noConflict = noConflict;
  17115. lodash.noop = noop;
  17116. lodash.now = now;
  17117. lodash.pad = pad;
  17118. lodash.padEnd = padEnd;
  17119. lodash.padStart = padStart;
  17120. lodash.parseInt = parseInt;
  17121. lodash.random = random;
  17122. lodash.reduce = reduce;
  17123. lodash.reduceRight = reduceRight;
  17124. lodash.repeat = repeat;
  17125. lodash.replace = replace;
  17126. lodash.result = result;
  17127. lodash.round = round;
  17128. lodash.runInContext = runInContext;
  17129. lodash.sample = sample;
  17130. lodash.size = size;
  17131. lodash.snakeCase = snakeCase;
  17132. lodash.some = some;
  17133. lodash.sortedIndex = sortedIndex;
  17134. lodash.sortedIndexBy = sortedIndexBy;
  17135. lodash.sortedIndexOf = sortedIndexOf;
  17136. lodash.sortedLastIndex = sortedLastIndex;
  17137. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17138. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17139. lodash.startCase = startCase;
  17140. lodash.startsWith = startsWith;
  17141. lodash.subtract = subtract;
  17142. lodash.sum = sum;
  17143. lodash.sumBy = sumBy;
  17144. lodash.template = template;
  17145. lodash.times = times;
  17146. lodash.toFinite = toFinite;
  17147. lodash.toInteger = toInteger;
  17148. lodash.toLength = toLength;
  17149. lodash.toLower = toLower;
  17150. lodash.toNumber = toNumber;
  17151. lodash.toSafeInteger = toSafeInteger;
  17152. lodash.toString = toString;
  17153. lodash.toUpper = toUpper;
  17154. lodash.trim = trim;
  17155. lodash.trimEnd = trimEnd;
  17156. lodash.trimStart = trimStart;
  17157. lodash.truncate = truncate;
  17158. lodash.unescape = unescape;
  17159. lodash.uniqueId = uniqueId;
  17160. lodash.upperCase = upperCase;
  17161. lodash.upperFirst = upperFirst;
  17162. // Add aliases.
  17163. lodash.each = forEach;
  17164. lodash.eachRight = forEachRight;
  17165. lodash.first = head;
  17166. mixin(lodash, (function() {
  17167. var source = {};
  17168. baseForOwn(lodash, function(func, methodName) {
  17169. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17170. source[methodName] = func;
  17171. }
  17172. });
  17173. return source;
  17174. }()), { 'chain': false });
  17175. /*------------------------------------------------------------------------*/
  17176. /**
  17177. * The semantic version number.
  17178. *
  17179. * @static
  17180. * @memberOf _
  17181. * @type {string}
  17182. */
  17183. lodash.VERSION = VERSION;
  17184. // Assign default placeholders.
  17185. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17186. lodash[methodName].placeholder = lodash;
  17187. });
  17188. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17189. arrayEach(['drop', 'take'], function(methodName, index) {
  17190. LazyWrapper.prototype[methodName] = function(n) {
  17191. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17192. var result = (this.__filtered__ && !index)
  17193. ? new LazyWrapper(this)
  17194. : this.clone();
  17195. if (result.__filtered__) {
  17196. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17197. } else {
  17198. result.__views__.push({
  17199. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17200. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17201. });
  17202. }
  17203. return result;
  17204. };
  17205. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17206. return this.reverse()[methodName](n).reverse();
  17207. };
  17208. });
  17209. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17210. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17211. var type = index + 1,
  17212. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17213. LazyWrapper.prototype[methodName] = function(iteratee) {
  17214. var result = this.clone();
  17215. result.__iteratees__.push({
  17216. 'iteratee': getIteratee(iteratee, 3),
  17217. 'type': type
  17218. });
  17219. result.__filtered__ = result.__filtered__ || isFilter;
  17220. return result;
  17221. };
  17222. });
  17223. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17224. arrayEach(['head', 'last'], function(methodName, index) {
  17225. var takeName = 'take' + (index ? 'Right' : '');
  17226. LazyWrapper.prototype[methodName] = function() {
  17227. return this[takeName](1).value()[0];
  17228. };
  17229. });
  17230. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17231. arrayEach(['initial', 'tail'], function(methodName, index) {
  17232. var dropName = 'drop' + (index ? '' : 'Right');
  17233. LazyWrapper.prototype[methodName] = function() {
  17234. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17235. };
  17236. });
  17237. LazyWrapper.prototype.compact = function() {
  17238. return this.filter(identity);
  17239. };
  17240. LazyWrapper.prototype.find = function(predicate) {
  17241. return this.filter(predicate).head();
  17242. };
  17243. LazyWrapper.prototype.findLast = function(predicate) {
  17244. return this.reverse().find(predicate);
  17245. };
  17246. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17247. if (typeof path == 'function') {
  17248. return new LazyWrapper(this);
  17249. }
  17250. return this.map(function(value) {
  17251. return baseInvoke(value, path, args);
  17252. });
  17253. });
  17254. LazyWrapper.prototype.reject = function(predicate) {
  17255. return this.filter(negate(getIteratee(predicate)));
  17256. };
  17257. LazyWrapper.prototype.slice = function(start, end) {
  17258. start = toInteger(start);
  17259. var result = this;
  17260. if (result.__filtered__ && (start > 0 || end < 0)) {
  17261. return new LazyWrapper(result);
  17262. }
  17263. if (start < 0) {
  17264. result = result.takeRight(-start);
  17265. } else if (start) {
  17266. result = result.drop(start);
  17267. }
  17268. if (end !== undefined) {
  17269. end = toInteger(end);
  17270. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17271. }
  17272. return result;
  17273. };
  17274. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17275. return this.reverse().takeWhile(predicate).reverse();
  17276. };
  17277. LazyWrapper.prototype.toArray = function() {
  17278. return this.take(MAX_ARRAY_LENGTH);
  17279. };
  17280. // Add `LazyWrapper` methods to `lodash.prototype`.
  17281. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17282. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17283. isTaker = /^(?:head|last)$/.test(methodName),
  17284. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17285. retUnwrapped = isTaker || /^find/.test(methodName);
  17286. if (!lodashFunc) {
  17287. return;
  17288. }
  17289. lodash.prototype[methodName] = function() {
  17290. var value = this.__wrapped__,
  17291. args = isTaker ? [1] : arguments,
  17292. isLazy = value instanceof LazyWrapper,
  17293. iteratee = args[0],
  17294. useLazy = isLazy || isArray(value);
  17295. var interceptor = function(value) {
  17296. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17297. return (isTaker && chainAll) ? result[0] : result;
  17298. };
  17299. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17300. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17301. isLazy = useLazy = false;
  17302. }
  17303. var chainAll = this.__chain__,
  17304. isHybrid = !!this.__actions__.length,
  17305. isUnwrapped = retUnwrapped && !chainAll,
  17306. onlyLazy = isLazy && !isHybrid;
  17307. if (!retUnwrapped && useLazy) {
  17308. value = onlyLazy ? value : new LazyWrapper(this);
  17309. var result = func.apply(value, args);
  17310. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17311. return new LodashWrapper(result, chainAll);
  17312. }
  17313. if (isUnwrapped && onlyLazy) {
  17314. return func.apply(this, args);
  17315. }
  17316. result = this.thru(interceptor);
  17317. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17318. };
  17319. });
  17320. // Add `Array` methods to `lodash.prototype`.
  17321. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17322. var func = arrayProto[methodName],
  17323. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17324. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17325. lodash.prototype[methodName] = function() {
  17326. var args = arguments;
  17327. if (retUnwrapped && !this.__chain__) {
  17328. var value = this.value();
  17329. return func.apply(isArray(value) ? value : [], args);
  17330. }
  17331. return this[chainName](function(value) {
  17332. return func.apply(isArray(value) ? value : [], args);
  17333. });
  17334. };
  17335. });
  17336. // Map minified method names to their real names.
  17337. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17338. var lodashFunc = lodash[methodName];
  17339. if (lodashFunc) {
  17340. var key = lodashFunc.name + '';
  17341. if (!hasOwnProperty.call(realNames, key)) {
  17342. realNames[key] = [];
  17343. }
  17344. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17345. }
  17346. });
  17347. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17348. 'name': 'wrapper',
  17349. 'func': undefined
  17350. }];
  17351. // Add methods to `LazyWrapper`.
  17352. LazyWrapper.prototype.clone = lazyClone;
  17353. LazyWrapper.prototype.reverse = lazyReverse;
  17354. LazyWrapper.prototype.value = lazyValue;
  17355. // Add chain sequence methods to the `lodash` wrapper.
  17356. lodash.prototype.at = wrapperAt;
  17357. lodash.prototype.chain = wrapperChain;
  17358. lodash.prototype.commit = wrapperCommit;
  17359. lodash.prototype.next = wrapperNext;
  17360. lodash.prototype.plant = wrapperPlant;
  17361. lodash.prototype.reverse = wrapperReverse;
  17362. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17363. // Add lazy aliases.
  17364. lodash.prototype.first = lodash.prototype.head;
  17365. if (symIterator) {
  17366. lodash.prototype[symIterator] = wrapperToIterator;
  17367. }
  17368. return lodash;
  17369. });
  17370. /*--------------------------------------------------------------------------*/
  17371. // Export lodash.
  17372. var _ = runInContext();
  17373. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17374. if (true) {
  17375. // Expose Lodash on the global object to prevent errors when Lodash is
  17376. // loaded by a script tag in the presence of an AMD loader.
  17377. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17378. // Use `_.noConflict` to remove Lodash from the global object.
  17379. root._ = _;
  17380. // Define as an anonymous module so, through path mapping, it can be
  17381. // referenced as the "underscore" module.
  17382. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17383. return _;
  17384. }).call(exports, __webpack_require__, exports, module),
  17385. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17386. }
  17387. // Check for `exports` after `define` in case a build optimizer adds it.
  17388. else {}
  17389. }.call(this));
  17390. /***/ }),
  17391. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17392. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17393. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17394. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17395. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17396. "use strict";
  17397. __webpack_require__.r(__webpack_exports__);
  17398. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17399. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17400. /* harmony export */ });
  17401. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17402. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17403. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17404. var options = {};
  17405. options.insert = "head";
  17406. options.singleton = false;
  17407. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17408. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17409. /***/ }),
  17410. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17411. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17412. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17413. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17415. "use strict";
  17416. __webpack_require__.r(__webpack_exports__);
  17417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17418. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17419. /* harmony export */ });
  17420. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17421. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17422. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17423. var options = {};
  17424. options.insert = "head";
  17425. options.singleton = false;
  17426. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17427. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17428. /***/ }),
  17429. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17430. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17431. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17432. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17433. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17434. "use strict";
  17435. __webpack_require__.r(__webpack_exports__);
  17436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17437. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17438. /* harmony export */ });
  17439. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17440. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17441. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17442. var options = {};
  17443. options.insert = "head";
  17444. options.singleton = false;
  17445. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17446. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17447. /***/ }),
  17448. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17449. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17450. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17451. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17452. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17453. "use strict";
  17454. __webpack_require__.r(__webpack_exports__);
  17455. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17456. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17457. /* harmony export */ });
  17458. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17459. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17460. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17461. var options = {};
  17462. options.insert = "head";
  17463. options.singleton = false;
  17464. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17465. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17466. /***/ }),
  17467. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17468. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17469. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17470. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17471. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17472. "use strict";
  17473. __webpack_require__.r(__webpack_exports__);
  17474. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17475. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17476. /* harmony export */ });
  17477. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17478. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17479. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17480. var options = {};
  17481. options.insert = "head";
  17482. options.singleton = false;
  17483. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17484. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17485. /***/ }),
  17486. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17487. /*!******************************************************!*\
  17488. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17489. \******************************************************/
  17490. /***/ ((__unused_webpack_module, exports) => {
  17491. "use strict";
  17492. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17493. // runtime helper for setting properties on components
  17494. // in a tree-shakable way
  17495. exports["default"] = (sfc, props) => {
  17496. const target = sfc.__vccOpts || sfc;
  17497. for (const [key, val] of props) {
  17498. target[key] = val;
  17499. }
  17500. return target;
  17501. };
  17502. /***/ }),
  17503. /***/ "./resources/js/components/AppButtonLink.vue":
  17504. /*!***************************************************!*\
  17505. !*** ./resources/js/components/AppButtonLink.vue ***!
  17506. \***************************************************/
  17507. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17508. "use strict";
  17509. __webpack_require__.r(__webpack_exports__);
  17510. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17511. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17512. /* harmony export */ });
  17513. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17514. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17515. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17516. ;
  17517. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17518. /* hot reload */
  17519. if (false) {}
  17520. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17521. /***/ }),
  17522. /***/ "./resources/js/components/AppFooter.vue":
  17523. /*!***********************************************!*\
  17524. !*** ./resources/js/components/AppFooter.vue ***!
  17525. \***********************************************/
  17526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17527. "use strict";
  17528. __webpack_require__.r(__webpack_exports__);
  17529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17530. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17531. /* harmony export */ });
  17532. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17533. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17534. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17535. const script = {}
  17536. ;
  17537. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17538. /* hot reload */
  17539. if (false) {}
  17540. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17541. /***/ }),
  17542. /***/ "./resources/js/components/AppMessage.vue":
  17543. /*!************************************************!*\
  17544. !*** ./resources/js/components/AppMessage.vue ***!
  17545. \************************************************/
  17546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17547. "use strict";
  17548. __webpack_require__.r(__webpack_exports__);
  17549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17550. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17551. /* harmony export */ });
  17552. /* harmony import */ var _AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=template&id=07159051 */ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17553. /* harmony import */ var _AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17554. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17555. ;
  17556. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17557. /* hot reload */
  17558. if (false) {}
  17559. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17560. /***/ }),
  17561. /***/ "./resources/js/components/AppPagination.vue":
  17562. /*!***************************************************!*\
  17563. !*** ./resources/js/components/AppPagination.vue ***!
  17564. \***************************************************/
  17565. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17566. "use strict";
  17567. __webpack_require__.r(__webpack_exports__);
  17568. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17569. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17570. /* harmony export */ });
  17571. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17572. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17573. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17574. ;
  17575. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17576. /* hot reload */
  17577. if (false) {}
  17578. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17579. /***/ }),
  17580. /***/ "./resources/js/components/AppSidebar.vue":
  17581. /*!************************************************!*\
  17582. !*** ./resources/js/components/AppSidebar.vue ***!
  17583. \************************************************/
  17584. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17585. "use strict";
  17586. __webpack_require__.r(__webpack_exports__);
  17587. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17588. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17589. /* harmony export */ });
  17590. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17591. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17592. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17593. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17594. ;
  17595. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/components/AppSubSidebar.vue":
  17601. /*!***************************************************!*\
  17602. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17603. \***************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17611. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17612. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17613. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17614. ;
  17615. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/components/AppTopBar.vue":
  17621. /*!***********************************************!*\
  17622. !*** ./resources/js/components/AppTopBar.vue ***!
  17623. \***********************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17631. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17632. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17633. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17634. ;
  17635. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17636. /* hot reload */
  17637. if (false) {}
  17638. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17639. /***/ }),
  17640. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17641. /*!**************************************************!*\
  17642. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17643. \**************************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17649. /* harmony export */ });
  17650. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17651. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17652. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17653. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17654. ;
  17655. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17656. /* hot reload */
  17657. if (false) {}
  17658. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17659. /***/ }),
  17660. /***/ "./resources/js/pages/expense/Index.vue":
  17661. /*!**********************************************!*\
  17662. !*** ./resources/js/pages/expense/Index.vue ***!
  17663. \**********************************************/
  17664. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17665. "use strict";
  17666. __webpack_require__.r(__webpack_exports__);
  17667. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17668. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17669. /* harmony export */ });
  17670. /* harmony import */ var _Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2507f822 */ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822");
  17671. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js");
  17672. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17673. ;
  17674. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/expense/Index.vue"]])
  17675. /* hot reload */
  17676. if (false) {}
  17677. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17680. /*!**************************************************************************************!*\
  17681. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17682. \**************************************************************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17688. /* harmony export */ });
  17689. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17690. /***/ }),
  17691. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17692. /*!***********************************************************************************!*\
  17693. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17694. \***********************************************************************************/
  17695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17696. "use strict";
  17697. __webpack_require__.r(__webpack_exports__);
  17698. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17699. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17700. /* harmony export */ });
  17701. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17702. /***/ }),
  17703. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17704. /*!**************************************************************************************!*\
  17705. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17706. \**************************************************************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17712. /* harmony export */ });
  17713. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17714. /***/ }),
  17715. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17716. /*!***********************************************************************************!*\
  17717. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17718. \***********************************************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17724. /* harmony export */ });
  17725. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17726. /***/ }),
  17727. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17728. /*!**************************************************************************************!*\
  17729. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17730. \**************************************************************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17736. /* harmony export */ });
  17737. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17738. /***/ }),
  17739. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17740. /*!**********************************************************************************!*\
  17741. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17742. \**********************************************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17748. /* harmony export */ });
  17749. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17750. /***/ }),
  17751. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17752. /*!*************************************************************************************!*\
  17753. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17754. \*************************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17759. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17760. /* harmony export */ });
  17761. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17762. /***/ }),
  17763. /***/ "./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js":
  17764. /*!*********************************************************************************!*\
  17765. !*** ./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js ***!
  17766. \*********************************************************************************/
  17767. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17768. "use strict";
  17769. __webpack_require__.r(__webpack_exports__);
  17770. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17771. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17772. /* harmony export */ });
  17773. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=script&setup=true&lang=js");
  17774. /***/ }),
  17775. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17776. /*!*********************************************************************************!*\
  17777. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17778. \*********************************************************************************/
  17779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17780. "use strict";
  17781. __webpack_require__.r(__webpack_exports__);
  17782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17783. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17784. /* harmony export */ });
  17785. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17786. /***/ }),
  17787. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17788. /*!*****************************************************************************************!*\
  17789. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17790. \*****************************************************************************************/
  17791. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17792. "use strict";
  17793. __webpack_require__.r(__webpack_exports__);
  17794. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17795. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17796. /* harmony export */ });
  17797. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17798. /***/ }),
  17799. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17800. /*!******************************************************************************!*\
  17801. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17802. \******************************************************************************/
  17803. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17804. "use strict";
  17805. __webpack_require__.r(__webpack_exports__);
  17806. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17807. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17808. /* harmony export */ });
  17809. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=template&id=07159051 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17810. /***/ }),
  17811. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17812. /*!*********************************************************************************!*\
  17813. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17814. \*********************************************************************************/
  17815. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17816. "use strict";
  17817. __webpack_require__.r(__webpack_exports__);
  17818. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17819. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17820. /* harmony export */ });
  17821. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17822. /***/ }),
  17823. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17824. /*!******************************************************************************************!*\
  17825. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17826. \******************************************************************************************/
  17827. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17828. "use strict";
  17829. __webpack_require__.r(__webpack_exports__);
  17830. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17831. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17832. /* harmony export */ });
  17833. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17834. /***/ }),
  17835. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17836. /*!*********************************************************************************************!*\
  17837. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17838. \*********************************************************************************************/
  17839. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17840. "use strict";
  17841. __webpack_require__.r(__webpack_exports__);
  17842. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17843. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17844. /* harmony export */ });
  17845. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17846. /***/ }),
  17847. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17848. /*!*****************************************************************************************!*\
  17849. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17850. \*****************************************************************************************/
  17851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17852. "use strict";
  17853. __webpack_require__.r(__webpack_exports__);
  17854. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17855. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17856. /* harmony export */ });
  17857. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17858. /***/ }),
  17859. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17860. /*!********************************************************************************************!*\
  17861. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17862. \********************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17867. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17868. /* harmony export */ });
  17869. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17870. /***/ }),
  17871. /***/ "./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822":
  17872. /*!****************************************************************************!*\
  17873. !*** ./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822 ***!
  17874. \****************************************************************************/
  17875. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17876. "use strict";
  17877. __webpack_require__.r(__webpack_exports__);
  17878. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17879. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__.render)
  17880. /* harmony export */ });
  17881. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_2507f822__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=2507f822 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/expense/Index.vue?vue&type=template&id=2507f822");
  17882. /***/ }),
  17883. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17884. /*!********************************************************************************************************!*\
  17885. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17886. \********************************************************************************************************/
  17887. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17888. "use strict";
  17889. __webpack_require__.r(__webpack_exports__);
  17890. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17891. /***/ }),
  17892. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17893. /*!*********************************************************************************************************!*\
  17894. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17895. \*********************************************************************************************************/
  17896. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17897. "use strict";
  17898. __webpack_require__.r(__webpack_exports__);
  17899. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17900. /***/ }),
  17901. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17902. /*!************************************************************************************************************!*\
  17903. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17904. \************************************************************************************************************/
  17905. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17906. "use strict";
  17907. __webpack_require__.r(__webpack_exports__);
  17908. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17909. /***/ }),
  17910. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17911. /*!********************************************************************************************************!*\
  17912. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17913. \********************************************************************************************************/
  17914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17915. "use strict";
  17916. __webpack_require__.r(__webpack_exports__);
  17917. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17918. /***/ }),
  17919. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17920. /*!***********************************************************************************************************!*\
  17921. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17922. \***********************************************************************************************************/
  17923. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17924. "use strict";
  17925. __webpack_require__.r(__webpack_exports__);
  17926. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17927. /***/ })
  17928. }]);