resources_js_pages_home_Index_vue.js 677KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_home_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/AppMessage.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/AppMessage.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. setup: function setup(__props, _ref) {
  15. var expose = _ref.expose;
  16. expose();
  17. var onClose = function onClose() {
  18. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  19. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  20. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  21. };
  22. var __returned__ = {
  23. onClose: onClose,
  24. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  25. };
  26. Object.defineProperty(__returned__, '__isScriptSetup', {
  27. enumerable: false,
  28. value: true
  29. });
  30. return __returned__;
  31. }
  32. });
  33. /***/ }),
  34. /***/ "./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":
  35. /*!***************************************************************************************************************************************************************************************************************!*\
  36. !*** ./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 ***!
  37. \***************************************************************************************************************************************************************************************************************/
  38. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  39. "use strict";
  40. __webpack_require__.r(__webpack_exports__);
  41. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  42. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  43. /* harmony export */ });
  44. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  45. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  46. props: {
  47. menu: Array
  48. },
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var __returned__ = {
  53. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  54. };
  55. Object.defineProperty(__returned__, '__isScriptSetup', {
  56. enumerable: false,
  57. value: true
  58. });
  59. return __returned__;
  60. }
  61. });
  62. /***/ }),
  63. /***/ "./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":
  64. /*!******************************************************************************************************************************************************************************************************************!*\
  65. !*** ./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 ***!
  66. \******************************************************************************************************************************************************************************************************************/
  67. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  68. "use strict";
  69. __webpack_require__.r(__webpack_exports__);
  70. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  71. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  72. /* harmony export */ });
  73. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  74. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  75. props: {
  76. items: Array,
  77. root: {
  78. type: Boolean,
  79. "default": false
  80. }
  81. },
  82. setup: function setup(__props, _ref) {
  83. var expose = _ref.expose;
  84. expose();
  85. var __returned__ = {
  86. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  87. };
  88. Object.defineProperty(__returned__, '__isScriptSetup', {
  89. enumerable: false,
  90. value: true
  91. });
  92. return __returned__;
  93. }
  94. });
  95. /***/ }),
  96. /***/ "./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":
  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/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  99. \**************************************************************************************************************************************************************************************************************/
  100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  101. "use strict";
  102. __webpack_require__.r(__webpack_exports__);
  103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  105. /* harmony export */ });
  106. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  107. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  108. emits: ['menu-toggle'],
  109. setup: function setup(__props, _ref) {
  110. var expose = _ref.expose;
  111. expose();
  112. var __returned__ = {
  113. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  114. };
  115. Object.defineProperty(__returned__, '__isScriptSetup', {
  116. enumerable: false,
  117. value: true
  118. });
  119. return __returned__;
  120. }
  121. });
  122. /***/ }),
  123. /***/ "./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":
  124. /*!*****************************************************************************************************************************************************************************************************************!*\
  125. !*** ./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 ***!
  126. \*****************************************************************************************************************************************************************************************************************/
  127. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  128. "use strict";
  129. __webpack_require__.r(__webpack_exports__);
  130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  132. /* harmony export */ });
  133. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  134. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  135. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  136. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  137. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  138. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  139. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  140. setup: function setup(__props, _ref) {
  141. var expose = _ref.expose;
  142. expose();
  143. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  144. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  145. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  146. var isDesktop = function isDesktop() {
  147. return window.innerWidth >= 992;
  148. };
  149. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  150. return ['layout-wrapper', {
  151. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  152. 'layout-mobile-sidebar-active': mobileMenuActive.value
  153. }];
  154. });
  155. var onWrapperClick = function onWrapperClick() {
  156. if (!menuClick.value) {
  157. mobileMenuActive.value = false;
  158. }
  159. menuClick.value = false;
  160. };
  161. var onMenuToggle = function onMenuToggle(event) {
  162. menuClick.value = true;
  163. if (isDesktop()) {
  164. staticMenuInactive.value = !staticMenuInactive.value;
  165. } else {
  166. mobileMenuActive.value = !mobileMenuActive.value;
  167. }
  168. event.preventDefault();
  169. };
  170. var __returned__ = {
  171. mobileMenuActive: mobileMenuActive,
  172. staticMenuInactive: staticMenuInactive,
  173. menuClick: menuClick,
  174. isDesktop: isDesktop,
  175. containerClass: containerClass,
  176. onWrapperClick: onWrapperClick,
  177. onMenuToggle: onMenuToggle,
  178. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  179. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  180. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  181. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  182. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  183. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  184. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  185. };
  186. Object.defineProperty(__returned__, '__isScriptSetup', {
  187. enumerable: false,
  188. value: true
  189. });
  190. return __returned__;
  191. }
  192. });
  193. /***/ }),
  194. /***/ "./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/home/Index.vue?vue&type=script&setup=true&lang=js":
  195. /*!**********************************************************************************************************************************************************************************************************!*\
  196. !*** ./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/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  197. \**********************************************************************************************************************************************************************************************************/
  198. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  199. "use strict";
  200. __webpack_require__.r(__webpack_exports__);
  201. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  202. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  203. /* harmony export */ });
  204. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  205. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  206. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  207. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  208. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  209. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  210. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  211. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  212. props: {
  213. cardStatistics: Array,
  214. barStatistics: Array,
  215. barHorizontalStatistics: Array
  216. },
  217. setup: function setup(__props, _ref) {
  218. var expose = _ref.expose;
  219. expose();
  220. var colors = ['#349dcf', '#00b2da', '#00c7dd', '#1fdbdb', '#57eed3', '#88ffc9', '#96ed9a', '#a8d96c', '#bbc242', '#cda91d'];
  221. var barChart = function barChart(chartData) {
  222. var colors = ['#349dcf', '#a8d96c'];
  223. var data = {
  224. datasets: []
  225. };
  226. var id = 0;
  227. for (var key in chartData) {
  228. data.datasets.push({
  229. label: key,
  230. backgroundColor: colors[id],
  231. data: chartData[key]
  232. });
  233. id++;
  234. }
  235. return data;
  236. };
  237. var barChartOption = {
  238. maintainAspectRatio: false,
  239. datasetFill: false
  240. };
  241. var barHorizontalChart = function barHorizontalChart(chartData) {
  242. var labels = [];
  243. var data = [];
  244. var _iterator = _createForOfIteratorHelper(chartData),
  245. _step;
  246. try {
  247. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  248. var obj = _step.value;
  249. labels.push([obj.label1, obj.label2]);
  250. data.push(obj.data);
  251. }
  252. } catch (err) {
  253. _iterator.e(err);
  254. } finally {
  255. _iterator.f();
  256. }
  257. return {
  258. labels: labels,
  259. datasets: [{
  260. data: data,
  261. backgroundColor: colors
  262. }]
  263. };
  264. };
  265. var barHorizontalChartOption = {
  266. maintainAspectRatio: false,
  267. datasetFill: false,
  268. indexAxis: 'y',
  269. plugins: {
  270. legend: {
  271. display: false
  272. }
  273. }
  274. };
  275. var pieChart = function pieChart(chartData) {
  276. var labels = [];
  277. var data = [];
  278. for (var key in chartData) {
  279. labels.push(key);
  280. data.push(chartData[key]);
  281. }
  282. return {
  283. labels: labels,
  284. datasets: [{
  285. data: data,
  286. backgroundColor: colors
  287. }]
  288. };
  289. };
  290. var pieChartOption = {
  291. maintainAspectRatio: false,
  292. datasetFill: false
  293. };
  294. var __returned__ = {
  295. colors: colors,
  296. barChart: barChart,
  297. barChartOption: barChartOption,
  298. barHorizontalChart: barHorizontalChart,
  299. barHorizontalChartOption: barHorizontalChartOption,
  300. pieChart: pieChart,
  301. pieChartOption: pieChartOption,
  302. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Head,
  303. includes: lodash__WEBPACK_IMPORTED_MODULE_1__.includes,
  304. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
  305. };
  306. Object.defineProperty(__returned__, '__isScriptSetup', {
  307. enumerable: false,
  308. value: true
  309. });
  310. return __returned__;
  311. }
  312. });
  313. /***/ }),
  314. /***/ "./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":
  315. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  316. !*** ./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 ***!
  317. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  319. "use strict";
  320. __webpack_require__.r(__webpack_exports__);
  321. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  322. /* harmony export */ "render": () => (/* binding */ render)
  323. /* harmony export */ });
  324. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  325. var _withScopeId = function _withScopeId(n) {
  326. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  327. };
  328. var _hoisted_1 = {
  329. "class": "layout-footer"
  330. };
  331. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  332. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  333. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  334. href: "https://dijitalcode.com",
  335. target: "_blank",
  336. "class": "font-medium ml-2"
  337. }, "DijitalCODE", -1
  338. /* HOISTED */
  339. );
  340. });
  341. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  342. function render(_ctx, _cache) {
  343. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  344. }
  345. /***/ }),
  346. /***/ "./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":
  347. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  348. !*** ./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 ***!
  349. \********************************************************************************************************************************************************************************************************************************************************************************/
  350. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  351. "use strict";
  352. __webpack_require__.r(__webpack_exports__);
  353. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  354. /* harmony export */ "render": () => (/* binding */ render)
  355. /* harmony export */ });
  356. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  357. var _hoisted_1 = {
  358. key: 0
  359. };
  360. var _hoisted_2 = {
  361. key: 1
  362. };
  363. function render(_ctx, _cache, $props, $setup, $data, $options) {
  364. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  365. 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, {
  366. key: 0,
  367. severity: "success",
  368. onClose: $setup.onClose
  369. }, {
  370. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  371. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  372. /* TEXT */
  373. )];
  374. }),
  375. _: 1
  376. /* STABLE */
  377. })) : (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, {
  378. key: 1,
  379. severity: "error",
  380. onClose: $setup.onClose
  381. }, {
  382. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  383. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  384. /* TEXT */
  385. )];
  386. }),
  387. _: 1
  388. /* STABLE */
  389. })) : (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, {
  390. key: 2,
  391. severity: "error",
  392. onClose: $setup.onClose
  393. }, {
  394. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  395. 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
  396. /* TEXT */
  397. ))];
  398. }),
  399. _: 1
  400. /* STABLE */
  401. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  402. /* STABLE_FRAGMENT */
  403. );
  404. }
  405. /***/ }),
  406. /***/ "./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":
  407. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  408. !*** ./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 ***!
  409. \********************************************************************************************************************************************************************************************************************************************************************************************/
  410. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  411. "use strict";
  412. __webpack_require__.r(__webpack_exports__);
  413. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  414. /* harmony export */ "render": () => (/* binding */ render)
  415. /* harmony export */ });
  416. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  417. function render(_ctx, _cache, $props, $setup, $data, $options) {
  418. 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"], {
  419. "class": "layout-menu",
  420. items: $props.menu,
  421. root: true
  422. }, null, 8
  423. /* PROPS */
  424. , ["items"])]);
  425. }
  426. /***/ }),
  427. /***/ "./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":
  428. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  429. !*** ./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 ***!
  430. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  431. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  432. "use strict";
  433. __webpack_require__.r(__webpack_exports__);
  434. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  435. /* harmony export */ "render": () => (/* binding */ render)
  436. /* harmony export */ });
  437. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  438. var _withScopeId = function _withScopeId(n) {
  439. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  440. };
  441. var _hoisted_1 = {
  442. key: 0
  443. };
  444. var _hoisted_2 = ["aria-label"];
  445. var _hoisted_3 = ["aria-label"];
  446. function render(_ctx, _cache, $props, $setup, $data, $options) {
  447. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  448. 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) {
  449. 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", {
  450. key: i,
  451. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  452. 'layout-menuitem-category': $props.root
  453. }]),
  454. role: "none"
  455. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  456. key: 0
  457. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  458. "class": "layout-menuitem-root-text",
  459. "aria-label": item.label
  460. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  461. /* TEXT, PROPS */
  462. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  463. items: item.items
  464. }, null, 8
  465. /* PROPS */
  466. , ["items"])], 64
  467. /* STABLE_FRAGMENT */
  468. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  469. key: 1
  470. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  471. key: 0,
  472. role: "menuitem",
  473. href: item.to,
  474. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  475. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  476. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  477. }]),
  478. "aria-label": item.label
  479. }, {
  480. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  481. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  482. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  483. }, null, 2
  484. /* CLASS */
  485. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  486. /* TEXT */
  487. )];
  488. }),
  489. _: 2
  490. /* DYNAMIC */
  491. }, 1032
  492. /* PROPS, DYNAMIC_SLOTS */
  493. , ["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", {
  494. key: 1,
  495. href: "#",
  496. role: "menuitem",
  497. "aria-label": item.label
  498. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  499. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  500. }, null, 2
  501. /* CLASS */
  502. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  503. /* TEXT */
  504. )], 8
  505. /* PROPS */
  506. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  507. items: item.items
  508. }, null, 8
  509. /* PROPS */
  510. , ["items"])], 64
  511. /* STABLE_FRAGMENT */
  512. ))], 2
  513. /* CLASS */
  514. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  515. /* STABLE_FRAGMENT */
  516. );
  517. }), 256
  518. /* UNKEYED_FRAGMENT */
  519. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  520. }
  521. /***/ }),
  522. /***/ "./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":
  523. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  524. !*** ./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 ***!
  525. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  527. "use strict";
  528. __webpack_require__.r(__webpack_exports__);
  529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  530. /* harmony export */ "render": () => (/* binding */ render)
  531. /* harmony export */ });
  532. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  533. var _withScopeId = function _withScopeId(n) {
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  535. };
  536. var _hoisted_1 = {
  537. "class": "layout-topbar"
  538. };
  539. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  540. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  541. alt: "Logo",
  542. src: "/images/logo.svg",
  543. "class": "md:mr-3"
  544. }, null, -1
  545. /* HOISTED */
  546. );
  547. });
  548. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  549. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  550. /* HOISTED */
  551. );
  552. });
  553. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  554. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  555. "class": "pi pi-bars"
  556. }, null, -1
  557. /* HOISTED */
  558. );
  559. });
  560. var _hoisted_5 = [_hoisted_4];
  561. var _hoisted_6 = {
  562. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  563. };
  564. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  565. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  566. "class": "pi pi-ellipsis-v"
  567. }, null, -1
  568. /* HOISTED */
  569. );
  570. });
  571. var _hoisted_8 = [_hoisted_7];
  572. var _hoisted_9 = {
  573. "class": "layout-topbar-menu hidden lg:flex origin-top"
  574. };
  575. var _hoisted_10 = {
  576. "class": "align-self-center"
  577. };
  578. var _hoisted_11 = {
  579. "class": "hidden lg:inline"
  580. };
  581. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  582. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  583. "class": "pi pi-user"
  584. }, null, -1
  585. /* HOISTED */
  586. );
  587. });
  588. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  589. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  590. /* HOISTED */
  591. );
  592. });
  593. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  594. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  595. "class": "pi pi-sign-out"
  596. }, null, -1
  597. /* HOISTED */
  598. );
  599. });
  600. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  601. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  602. /* HOISTED */
  603. );
  604. });
  605. function render(_ctx, _cache, $props, $setup, $data, $options) {
  606. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  607. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  608. 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"], {
  609. href: "/",
  610. "class": "layout-topbar-logo"
  611. }, {
  612. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  613. return [_hoisted_2, _hoisted_3];
  614. }),
  615. _: 1
  616. /* STABLE */
  617. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  618. "class": "p-link layout-menu-button layout-topbar-button",
  619. onClick: _cache[0] || (_cache[0] = function ($event) {
  620. return _ctx.$emit('menu-toggle', $event);
  621. })
  622. }, _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, {
  623. selector: '@next',
  624. enterClass: 'hidden',
  625. enterActiveClass: 'scalein',
  626. leaveToClass: 'hidden',
  627. leaveActiveClass: 'fadeout',
  628. hideOnOutsideClick: true
  629. }]]), (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
  630. /* TEXT */
  631. )]), (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"], {
  632. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  633. "class": "p-link layout-topbar-button"
  634. }, {
  635. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  636. return [_hoisted_12, _hoisted_13];
  637. }),
  638. _: 1
  639. /* STABLE */
  640. }, 8
  641. /* PROPS */
  642. , ["href"])), [[_directive_tooltip, {
  643. value: 'Ubah Profil',
  644. "class": 'layout-topbar-menu-tooltip'
  645. }, void 0, {
  646. bottom: true
  647. }]])]), (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"], {
  648. href: _ctx.route('logout'),
  649. as: "button",
  650. method: "post",
  651. "class": "p-link layout-topbar-button"
  652. }, {
  653. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  654. return [_hoisted_14, _hoisted_15];
  655. }),
  656. _: 1
  657. /* STABLE */
  658. }, 8
  659. /* PROPS */
  660. , ["href"])), [[_directive_tooltip, {
  661. value: 'Keluar',
  662. "class": 'layout-topbar-menu-tooltip'
  663. }, void 0, {
  664. bottom: true
  665. }]])])])]);
  666. }
  667. /***/ }),
  668. /***/ "./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":
  669. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  670. !*** ./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 ***!
  671. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  672. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  673. "use strict";
  674. __webpack_require__.r(__webpack_exports__);
  675. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  676. /* harmony export */ "render": () => (/* binding */ render)
  677. /* harmony export */ });
  678. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  679. var _withScopeId = function _withScopeId(n) {
  680. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  681. };
  682. var _hoisted_1 = {
  683. "class": "layout-sidebar"
  684. };
  685. var _hoisted_2 = {
  686. "class": "layout-main-container"
  687. };
  688. var _hoisted_3 = {
  689. "class": "layout-main"
  690. };
  691. var _hoisted_4 = {
  692. key: 0,
  693. "class": "layout-mask p-component-overlay"
  694. };
  695. function render(_ctx, _cache, $props, $setup, $data, $options) {
  696. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  697. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  698. onClick: $setup.onWrapperClick
  699. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  700. onMenuToggle: $setup.onMenuToggle
  701. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  702. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  703. }, null, 8
  704. /* PROPS */
  705. , ["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, {
  706. name: "layout-mask"
  707. }, {
  708. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  709. 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)];
  710. }),
  711. _: 1
  712. /* STABLE */
  713. })], 2
  714. /* CLASS */
  715. );
  716. }
  717. /***/ }),
  718. /***/ "./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/home/Index.vue?vue&type=template&id=9329f6aa":
  719. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  720. !*** ./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/home/Index.vue?vue&type=template&id=9329f6aa ***!
  721. \***************************************************************************************************************************************************************************************************************************************************************************/
  722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  726. /* harmony export */ "render": () => (/* binding */ render)
  727. /* harmony export */ });
  728. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  729. var _hoisted_1 = {
  730. "class": "grid"
  731. };
  732. var _hoisted_2 = {
  733. key: 0,
  734. "class": "col-12 md:col-4 xl:col-3"
  735. };
  736. var _hoisted_3 = {
  737. "class": "flex justify-content-between mb-3"
  738. };
  739. var _hoisted_4 = {
  740. "class": "block text-500 font-medium mb-3"
  741. };
  742. var _hoisted_5 = {
  743. key: 0,
  744. "class": "text-900 font-medium text-xl"
  745. };
  746. var _hoisted_6 = {
  747. "class": "flex align-items-center justify-content-center bg-orange-100 border-round",
  748. style: {
  749. "width": "2.5rem",
  750. "height": "2.5rem"
  751. }
  752. };
  753. var _hoisted_7 = {
  754. "class": "text-green-500 font-medium"
  755. };
  756. var _hoisted_8 = {
  757. "class": "text-500"
  758. };
  759. var _hoisted_9 = {
  760. "class": "grid"
  761. };
  762. var _hoisted_10 = {
  763. key: 0,
  764. "class": "col-12 md:col-6"
  765. };
  766. var _hoisted_11 = {
  767. "class": "flex flex-column"
  768. };
  769. var _hoisted_12 = {
  770. key: 0,
  771. "class": "text-base font-normal"
  772. };
  773. function render(_ctx, _cache, $props, $setup, $data, $options) {
  774. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  775. var _component_Chart = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Chart");
  776. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  777. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  779. title: "Dashboard"
  780. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _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.cardStatistics, function (cardStatistic) {
  781. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(cardStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  782. "class": "h-full"
  783. }, {
  784. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  785. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.title), 1
  786. /* TEXT */
  787. ), cardStatistic.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.value), 1
  788. /* TEXT */
  789. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  790. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["text-orange-500 text-xl", cardStatistic.icon])
  791. }, null, 2
  792. /* CLASS */
  793. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.amount), 1
  794. /* TEXT */
  795. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(' ' + cardStatistic.amountLabel), 1
  796. /* TEXT */
  797. )];
  798. }),
  799. _: 2
  800. /* DYNAMIC */
  801. }, 1024
  802. /* DYNAMIC_SLOTS */
  803. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  804. /* STABLE_FRAGMENT */
  805. );
  806. }), 256
  807. /* UNKEYED_FRAGMENT */
  808. ))]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [((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.barStatistics, function (barStatistic) {
  809. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(barStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  810. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.title), 1
  812. /* TEXT */
  813. ), barStatistic.description ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.description), 1
  814. /* TEXT */
  815. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  816. }),
  817. _: 2
  818. /* DYNAMIC */
  819. }, [Object.keys(barStatistic.data).length ? {
  820. name: "content",
  821. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  823. type: "bar",
  824. width: 600,
  825. height: 300,
  826. data: $setup.barChart(barStatistic.data),
  827. options: $setup.barChartOption
  828. }, null, 8
  829. /* PROPS */
  830. , ["data"])];
  831. })
  832. } : undefined]), 1024
  833. /* DYNAMIC_SLOTS */
  834. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  835. /* STABLE_FRAGMENT */
  836. );
  837. }), 256
  838. /* UNKEYED_FRAGMENT */
  839. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"barHorizontalStatistic in barHorizontalStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ barHorizontalStatistic.title }}</span>\n <span v-if=\"barHorizontalStatistic.description\" class=\"text-base font-normal\">{{\n barHorizontalStatistic.description\n }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"bar\"\n :width=\"600\"\n :height=\"300\"\n :data=\"barHorizontalChart(barHorizontalStatistic.data)\"\n :options=\"barHorizontalChartOption\"\n />\n </template>\n </Card>\n </div> "), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"pieStatistic in pieStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ pieStatistic.title }}</span>\n <span v-if=\"pieStatistic.description\" class=\"text-base font-normal\">{{ pieStatistic.description }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"pie\"\n :width=\"600\"\n :height=\"300\"\n :data=\"pieChart(pieStatistic.data)\"\n :options=\"pieChartOption\"\n />\n </template>\n </Card>\n </div> ")])];
  840. }),
  841. _: 1
  842. /* STABLE */
  843. });
  844. }
  845. /***/ }),
  846. /***/ "./resources/js/utils/menu.js":
  847. /*!************************************!*\
  848. !*** ./resources/js/utils/menu.js ***!
  849. \************************************/
  850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  851. "use strict";
  852. __webpack_require__.r(__webpack_exports__);
  853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  854. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  855. /* harmony export */ });
  856. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  857. // Admin
  858. 1: [{
  859. label: 'Home',
  860. items: [{
  861. label: 'Dashboard',
  862. icon: 'pi pi-home',
  863. to: '/dashboards',
  864. component: 'home/Index'
  865. }]
  866. }, {
  867. label: 'Master',
  868. items: [{
  869. label: 'User',
  870. icon: 'pi pi-user',
  871. to: '/users',
  872. component: 'user/Index'
  873. }]
  874. }],
  875. // Supervisor
  876. 2: [{
  877. label: 'Home',
  878. items: [{
  879. label: 'Dashboard',
  880. icon: 'pi pi-home',
  881. to: '/dashboards',
  882. component: 'home/Index'
  883. }]
  884. }, {
  885. label: 'Menu',
  886. items: [{
  887. label: 'Pengeluaran',
  888. icon: 'pi pi-wallet',
  889. to: '/expenses',
  890. component: 'expense/Index'
  891. }, {
  892. label: 'Laporan',
  893. icon: 'pi pi-book',
  894. items: [{
  895. label: 'Mutasi',
  896. icon: 'pi pi-circle',
  897. to: '/reports/mutations',
  898. component: 'mutation/Report'
  899. }]
  900. }]
  901. }, {
  902. label: 'Master',
  903. items: [{
  904. label: 'Jenis Kendaraan',
  905. icon: 'pi pi-car',
  906. to: '/type-vehicles',
  907. component: 'typevehicle/Index'
  908. }, {
  909. label: 'Jenis Member',
  910. icon: 'pi pi-id-card',
  911. to: '/type-members',
  912. component: 'typemember/Index'
  913. }]
  914. }, {
  915. label: 'Pengaturan',
  916. items: [{
  917. label: 'Tarif Parkir',
  918. icon: 'pi pi-car',
  919. to: '/parking-fees/create',
  920. component: 'parkingfee/Create'
  921. }]
  922. }],
  923. // Operator
  924. 3: [{
  925. label: 'Home',
  926. items: [{
  927. label: 'Dashboard',
  928. icon: 'pi pi-home',
  929. to: '/dashboards',
  930. component: 'home/Index'
  931. }]
  932. }, {
  933. label: 'Transaksi',
  934. items: [{
  935. label: 'Transaksi masuk dan keluar',
  936. icon: 'pi pi-car',
  937. to: '/transactions/create',
  938. component: 'transaction/Create'
  939. }]
  940. }, {
  941. label: 'Menu',
  942. items: [{
  943. label: 'Pengeluaran',
  944. icon: 'pi pi-wallet',
  945. to: '/expenses',
  946. component: 'expense/Index'
  947. }, {
  948. label: 'Member',
  949. icon: 'pi pi-id-card',
  950. to: '/members',
  951. component: 'member/Index'
  952. }, {
  953. label: 'Top Up',
  954. icon: 'pi pi-car',
  955. to: '/top-ups',
  956. component: 'topup/Index'
  957. }]
  958. }, {
  959. label: 'Not Production',
  960. items: [{
  961. label: 'Test Transactions',
  962. icon: 'pi pi-car',
  963. to: '/test-transactions/create',
  964. component: 'test-transaction/Create'
  965. }]
  966. }]
  967. });
  968. /***/ }),
  969. /***/ "./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":
  970. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  971. !*** ./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 ***!
  972. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  973. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  974. "use strict";
  975. __webpack_require__.r(__webpack_exports__);
  976. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  977. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  978. /* harmony export */ });
  979. /* 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");
  980. /* 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__);
  981. // Imports
  982. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  983. // Module
  984. ___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}", ""]);
  985. // Exports
  986. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  987. /***/ }),
  988. /***/ "./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":
  989. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  990. !*** ./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 ***!
  991. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  992. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  993. "use strict";
  994. __webpack_require__.r(__webpack_exports__);
  995. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  996. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  997. /* harmony export */ });
  998. /* 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");
  999. /* 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__);
  1000. // Imports
  1001. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1002. // Module
  1003. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1004. // Exports
  1005. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1006. /***/ }),
  1007. /***/ "./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":
  1008. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1009. !*** ./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 ***!
  1010. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1011. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1012. "use strict";
  1013. __webpack_require__.r(__webpack_exports__);
  1014. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1015. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1016. /* harmony export */ });
  1017. /* 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");
  1018. /* 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__);
  1019. // Imports
  1020. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1021. // Module
  1022. ___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}", ""]);
  1023. // Exports
  1024. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1025. /***/ }),
  1026. /***/ "./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":
  1027. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1028. !*** ./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 ***!
  1029. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1030. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1031. "use strict";
  1032. __webpack_require__.r(__webpack_exports__);
  1033. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1034. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1035. /* harmony export */ });
  1036. /* 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");
  1037. /* 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__);
  1038. // Imports
  1039. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1040. // Module
  1041. ___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}", ""]);
  1042. // Exports
  1043. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1044. /***/ }),
  1045. /***/ "./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":
  1046. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1047. !*** ./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 ***!
  1048. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1049. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1050. "use strict";
  1051. __webpack_require__.r(__webpack_exports__);
  1052. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1053. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1054. /* harmony export */ });
  1055. /* 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");
  1056. /* 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__);
  1057. // Imports
  1058. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1059. // Module
  1060. ___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}", ""]);
  1061. // Exports
  1062. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1063. /***/ }),
  1064. /***/ "./node_modules/lodash/lodash.js":
  1065. /*!***************************************!*\
  1066. !*** ./node_modules/lodash/lodash.js ***!
  1067. \***************************************/
  1068. /***/ (function(module, exports, __webpack_require__) {
  1069. /* module decorator */ module = __webpack_require__.nmd(module);
  1070. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1071. * @license
  1072. * Lodash <https://lodash.com/>
  1073. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1074. * Released under MIT license <https://lodash.com/license>
  1075. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1076. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1077. */
  1078. ;(function() {
  1079. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1080. var undefined;
  1081. /** Used as the semantic version number. */
  1082. var VERSION = '4.17.21';
  1083. /** Used as the size to enable large array optimizations. */
  1084. var LARGE_ARRAY_SIZE = 200;
  1085. /** Error message constants. */
  1086. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1087. FUNC_ERROR_TEXT = 'Expected a function',
  1088. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1089. /** Used to stand-in for `undefined` hash values. */
  1090. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1091. /** Used as the maximum memoize cache size. */
  1092. var MAX_MEMOIZE_SIZE = 500;
  1093. /** Used as the internal argument placeholder. */
  1094. var PLACEHOLDER = '__lodash_placeholder__';
  1095. /** Used to compose bitmasks for cloning. */
  1096. var CLONE_DEEP_FLAG = 1,
  1097. CLONE_FLAT_FLAG = 2,
  1098. CLONE_SYMBOLS_FLAG = 4;
  1099. /** Used to compose bitmasks for value comparisons. */
  1100. var COMPARE_PARTIAL_FLAG = 1,
  1101. COMPARE_UNORDERED_FLAG = 2;
  1102. /** Used to compose bitmasks for function metadata. */
  1103. var WRAP_BIND_FLAG = 1,
  1104. WRAP_BIND_KEY_FLAG = 2,
  1105. WRAP_CURRY_BOUND_FLAG = 4,
  1106. WRAP_CURRY_FLAG = 8,
  1107. WRAP_CURRY_RIGHT_FLAG = 16,
  1108. WRAP_PARTIAL_FLAG = 32,
  1109. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1110. WRAP_ARY_FLAG = 128,
  1111. WRAP_REARG_FLAG = 256,
  1112. WRAP_FLIP_FLAG = 512;
  1113. /** Used as default options for `_.truncate`. */
  1114. var DEFAULT_TRUNC_LENGTH = 30,
  1115. DEFAULT_TRUNC_OMISSION = '...';
  1116. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1117. var HOT_COUNT = 800,
  1118. HOT_SPAN = 16;
  1119. /** Used to indicate the type of lazy iteratees. */
  1120. var LAZY_FILTER_FLAG = 1,
  1121. LAZY_MAP_FLAG = 2,
  1122. LAZY_WHILE_FLAG = 3;
  1123. /** Used as references for various `Number` constants. */
  1124. var INFINITY = 1 / 0,
  1125. MAX_SAFE_INTEGER = 9007199254740991,
  1126. MAX_INTEGER = 1.7976931348623157e+308,
  1127. NAN = 0 / 0;
  1128. /** Used as references for the maximum length and index of an array. */
  1129. var MAX_ARRAY_LENGTH = 4294967295,
  1130. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1131. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1132. /** Used to associate wrap methods with their bit flags. */
  1133. var wrapFlags = [
  1134. ['ary', WRAP_ARY_FLAG],
  1135. ['bind', WRAP_BIND_FLAG],
  1136. ['bindKey', WRAP_BIND_KEY_FLAG],
  1137. ['curry', WRAP_CURRY_FLAG],
  1138. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1139. ['flip', WRAP_FLIP_FLAG],
  1140. ['partial', WRAP_PARTIAL_FLAG],
  1141. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1142. ['rearg', WRAP_REARG_FLAG]
  1143. ];
  1144. /** `Object#toString` result references. */
  1145. var argsTag = '[object Arguments]',
  1146. arrayTag = '[object Array]',
  1147. asyncTag = '[object AsyncFunction]',
  1148. boolTag = '[object Boolean]',
  1149. dateTag = '[object Date]',
  1150. domExcTag = '[object DOMException]',
  1151. errorTag = '[object Error]',
  1152. funcTag = '[object Function]',
  1153. genTag = '[object GeneratorFunction]',
  1154. mapTag = '[object Map]',
  1155. numberTag = '[object Number]',
  1156. nullTag = '[object Null]',
  1157. objectTag = '[object Object]',
  1158. promiseTag = '[object Promise]',
  1159. proxyTag = '[object Proxy]',
  1160. regexpTag = '[object RegExp]',
  1161. setTag = '[object Set]',
  1162. stringTag = '[object String]',
  1163. symbolTag = '[object Symbol]',
  1164. undefinedTag = '[object Undefined]',
  1165. weakMapTag = '[object WeakMap]',
  1166. weakSetTag = '[object WeakSet]';
  1167. var arrayBufferTag = '[object ArrayBuffer]',
  1168. dataViewTag = '[object DataView]',
  1169. float32Tag = '[object Float32Array]',
  1170. float64Tag = '[object Float64Array]',
  1171. int8Tag = '[object Int8Array]',
  1172. int16Tag = '[object Int16Array]',
  1173. int32Tag = '[object Int32Array]',
  1174. uint8Tag = '[object Uint8Array]',
  1175. uint8ClampedTag = '[object Uint8ClampedArray]',
  1176. uint16Tag = '[object Uint16Array]',
  1177. uint32Tag = '[object Uint32Array]';
  1178. /** Used to match empty string literals in compiled template source. */
  1179. var reEmptyStringLeading = /\b__p \+= '';/g,
  1180. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1181. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1182. /** Used to match HTML entities and HTML characters. */
  1183. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1184. reUnescapedHtml = /[&<>"']/g,
  1185. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1186. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1187. /** Used to match template delimiters. */
  1188. var reEscape = /<%-([\s\S]+?)%>/g,
  1189. reEvaluate = /<%([\s\S]+?)%>/g,
  1190. reInterpolate = /<%=([\s\S]+?)%>/g;
  1191. /** Used to match property names within property paths. */
  1192. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1193. reIsPlainProp = /^\w*$/,
  1194. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1195. /**
  1196. * Used to match `RegExp`
  1197. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1198. */
  1199. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1200. reHasRegExpChar = RegExp(reRegExpChar.source);
  1201. /** Used to match leading whitespace. */
  1202. var reTrimStart = /^\s+/;
  1203. /** Used to match a single whitespace character. */
  1204. var reWhitespace = /\s/;
  1205. /** Used to match wrap detail comments. */
  1206. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1207. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1208. reSplitDetails = /,? & /;
  1209. /** Used to match words composed of alphanumeric characters. */
  1210. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1211. /**
  1212. * Used to validate the `validate` option in `_.template` variable.
  1213. *
  1214. * Forbids characters which could potentially change the meaning of the function argument definition:
  1215. * - "()," (modification of function parameters)
  1216. * - "=" (default value)
  1217. * - "[]{}" (destructuring of function parameters)
  1218. * - "/" (beginning of a comment)
  1219. * - whitespace
  1220. */
  1221. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1222. /** Used to match backslashes in property paths. */
  1223. var reEscapeChar = /\\(\\)?/g;
  1224. /**
  1225. * Used to match
  1226. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1227. */
  1228. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1229. /** Used to match `RegExp` flags from their coerced string values. */
  1230. var reFlags = /\w*$/;
  1231. /** Used to detect bad signed hexadecimal string values. */
  1232. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1233. /** Used to detect binary string values. */
  1234. var reIsBinary = /^0b[01]+$/i;
  1235. /** Used to detect host constructors (Safari). */
  1236. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1237. /** Used to detect octal string values. */
  1238. var reIsOctal = /^0o[0-7]+$/i;
  1239. /** Used to detect unsigned integer values. */
  1240. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1241. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1242. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1243. /** Used to ensure capturing order of template delimiters. */
  1244. var reNoMatch = /($^)/;
  1245. /** Used to match unescaped characters in compiled string literals. */
  1246. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1247. /** Used to compose unicode character classes. */
  1248. var rsAstralRange = '\\ud800-\\udfff',
  1249. rsComboMarksRange = '\\u0300-\\u036f',
  1250. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1251. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1252. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1253. rsDingbatRange = '\\u2700-\\u27bf',
  1254. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1255. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1256. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1257. rsPunctuationRange = '\\u2000-\\u206f',
  1258. 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',
  1259. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1260. rsVarRange = '\\ufe0e\\ufe0f',
  1261. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1262. /** Used to compose unicode capture groups. */
  1263. var rsApos = "['\u2019]",
  1264. rsAstral = '[' + rsAstralRange + ']',
  1265. rsBreak = '[' + rsBreakRange + ']',
  1266. rsCombo = '[' + rsComboRange + ']',
  1267. rsDigits = '\\d+',
  1268. rsDingbat = '[' + rsDingbatRange + ']',
  1269. rsLower = '[' + rsLowerRange + ']',
  1270. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1271. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1272. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1273. rsNonAstral = '[^' + rsAstralRange + ']',
  1274. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1275. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1276. rsUpper = '[' + rsUpperRange + ']',
  1277. rsZWJ = '\\u200d';
  1278. /** Used to compose unicode regexes. */
  1279. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1280. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1281. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1282. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1283. reOptMod = rsModifier + '?',
  1284. rsOptVar = '[' + rsVarRange + ']?',
  1285. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1286. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1287. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1288. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1289. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1290. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1291. /** Used to match apostrophes. */
  1292. var reApos = RegExp(rsApos, 'g');
  1293. /**
  1294. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1295. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1296. */
  1297. var reComboMark = RegExp(rsCombo, 'g');
  1298. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1299. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1300. /** Used to match complex or compound words. */
  1301. var reUnicodeWord = RegExp([
  1302. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1303. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1304. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1305. rsUpper + '+' + rsOptContrUpper,
  1306. rsOrdUpper,
  1307. rsOrdLower,
  1308. rsDigits,
  1309. rsEmoji
  1310. ].join('|'), 'g');
  1311. /** 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/). */
  1312. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1313. /** Used to detect strings that need a more robust regexp to match words. */
  1314. 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 ]/;
  1315. /** Used to assign default `context` object properties. */
  1316. var contextProps = [
  1317. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1318. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1319. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1320. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1321. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1322. ];
  1323. /** Used to make template sourceURLs easier to identify. */
  1324. var templateCounter = -1;
  1325. /** Used to identify `toStringTag` values of typed arrays. */
  1326. var typedArrayTags = {};
  1327. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1328. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1329. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1330. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1331. typedArrayTags[uint32Tag] = true;
  1332. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1333. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1334. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1335. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1336. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1337. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1338. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1339. typedArrayTags[weakMapTag] = false;
  1340. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1341. var cloneableTags = {};
  1342. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1343. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1344. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1345. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1346. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1347. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1348. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1349. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1350. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1351. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1352. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1353. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1354. cloneableTags[weakMapTag] = false;
  1355. /** Used to map Latin Unicode letters to basic Latin letters. */
  1356. var deburredLetters = {
  1357. // Latin-1 Supplement block.
  1358. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1359. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1360. '\xc7': 'C', '\xe7': 'c',
  1361. '\xd0': 'D', '\xf0': 'd',
  1362. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1363. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1364. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1365. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1366. '\xd1': 'N', '\xf1': 'n',
  1367. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1368. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1369. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1370. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1371. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1372. '\xc6': 'Ae', '\xe6': 'ae',
  1373. '\xde': 'Th', '\xfe': 'th',
  1374. '\xdf': 'ss',
  1375. // Latin Extended-A block.
  1376. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1377. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1378. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1379. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1380. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1381. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1382. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1383. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1384. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1385. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1386. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1387. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1388. '\u0134': 'J', '\u0135': 'j',
  1389. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1390. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1391. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1392. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1393. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1394. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1395. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1396. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1397. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1398. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1399. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1400. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1401. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1402. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1403. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1404. '\u0174': 'W', '\u0175': 'w',
  1405. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1406. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1407. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1408. '\u0132': 'IJ', '\u0133': 'ij',
  1409. '\u0152': 'Oe', '\u0153': 'oe',
  1410. '\u0149': "'n", '\u017f': 's'
  1411. };
  1412. /** Used to map characters to HTML entities. */
  1413. var htmlEscapes = {
  1414. '&': '&amp;',
  1415. '<': '&lt;',
  1416. '>': '&gt;',
  1417. '"': '&quot;',
  1418. "'": '&#39;'
  1419. };
  1420. /** Used to map HTML entities to characters. */
  1421. var htmlUnescapes = {
  1422. '&amp;': '&',
  1423. '&lt;': '<',
  1424. '&gt;': '>',
  1425. '&quot;': '"',
  1426. '&#39;': "'"
  1427. };
  1428. /** Used to escape characters for inclusion in compiled string literals. */
  1429. var stringEscapes = {
  1430. '\\': '\\',
  1431. "'": "'",
  1432. '\n': 'n',
  1433. '\r': 'r',
  1434. '\u2028': 'u2028',
  1435. '\u2029': 'u2029'
  1436. };
  1437. /** Built-in method references without a dependency on `root`. */
  1438. var freeParseFloat = parseFloat,
  1439. freeParseInt = parseInt;
  1440. /** Detect free variable `global` from Node.js. */
  1441. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1442. /** Detect free variable `self`. */
  1443. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1444. /** Used as a reference to the global object. */
  1445. var root = freeGlobal || freeSelf || Function('return this')();
  1446. /** Detect free variable `exports`. */
  1447. var freeExports = true && exports && !exports.nodeType && exports;
  1448. /** Detect free variable `module`. */
  1449. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1450. /** Detect the popular CommonJS extension `module.exports`. */
  1451. var moduleExports = freeModule && freeModule.exports === freeExports;
  1452. /** Detect free variable `process` from Node.js. */
  1453. var freeProcess = moduleExports && freeGlobal.process;
  1454. /** Used to access faster Node.js helpers. */
  1455. var nodeUtil = (function() {
  1456. try {
  1457. // Use `util.types` for Node.js 10+.
  1458. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1459. if (types) {
  1460. return types;
  1461. }
  1462. // Legacy `process.binding('util')` for Node.js < 10.
  1463. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1464. } catch (e) {}
  1465. }());
  1466. /* Node.js helper references. */
  1467. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1468. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1469. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1470. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1471. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1472. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1473. /*--------------------------------------------------------------------------*/
  1474. /**
  1475. * A faster alternative to `Function#apply`, this function invokes `func`
  1476. * with the `this` binding of `thisArg` and the arguments of `args`.
  1477. *
  1478. * @private
  1479. * @param {Function} func The function to invoke.
  1480. * @param {*} thisArg The `this` binding of `func`.
  1481. * @param {Array} args The arguments to invoke `func` with.
  1482. * @returns {*} Returns the result of `func`.
  1483. */
  1484. function apply(func, thisArg, args) {
  1485. switch (args.length) {
  1486. case 0: return func.call(thisArg);
  1487. case 1: return func.call(thisArg, args[0]);
  1488. case 2: return func.call(thisArg, args[0], args[1]);
  1489. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1490. }
  1491. return func.apply(thisArg, args);
  1492. }
  1493. /**
  1494. * A specialized version of `baseAggregator` for arrays.
  1495. *
  1496. * @private
  1497. * @param {Array} [array] The array to iterate over.
  1498. * @param {Function} setter The function to set `accumulator` values.
  1499. * @param {Function} iteratee The iteratee to transform keys.
  1500. * @param {Object} accumulator The initial aggregated object.
  1501. * @returns {Function} Returns `accumulator`.
  1502. */
  1503. function arrayAggregator(array, setter, iteratee, accumulator) {
  1504. var index = -1,
  1505. length = array == null ? 0 : array.length;
  1506. while (++index < length) {
  1507. var value = array[index];
  1508. setter(accumulator, value, iteratee(value), array);
  1509. }
  1510. return accumulator;
  1511. }
  1512. /**
  1513. * A specialized version of `_.forEach` for arrays without support for
  1514. * iteratee shorthands.
  1515. *
  1516. * @private
  1517. * @param {Array} [array] The array to iterate over.
  1518. * @param {Function} iteratee The function invoked per iteration.
  1519. * @returns {Array} Returns `array`.
  1520. */
  1521. function arrayEach(array, iteratee) {
  1522. var index = -1,
  1523. length = array == null ? 0 : array.length;
  1524. while (++index < length) {
  1525. if (iteratee(array[index], index, array) === false) {
  1526. break;
  1527. }
  1528. }
  1529. return array;
  1530. }
  1531. /**
  1532. * A specialized version of `_.forEachRight` for arrays without support for
  1533. * iteratee shorthands.
  1534. *
  1535. * @private
  1536. * @param {Array} [array] The array to iterate over.
  1537. * @param {Function} iteratee The function invoked per iteration.
  1538. * @returns {Array} Returns `array`.
  1539. */
  1540. function arrayEachRight(array, iteratee) {
  1541. var length = array == null ? 0 : array.length;
  1542. while (length--) {
  1543. if (iteratee(array[length], length, array) === false) {
  1544. break;
  1545. }
  1546. }
  1547. return array;
  1548. }
  1549. /**
  1550. * A specialized version of `_.every` for arrays without support for
  1551. * iteratee shorthands.
  1552. *
  1553. * @private
  1554. * @param {Array} [array] The array to iterate over.
  1555. * @param {Function} predicate The function invoked per iteration.
  1556. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1557. * else `false`.
  1558. */
  1559. function arrayEvery(array, predicate) {
  1560. var index = -1,
  1561. length = array == null ? 0 : array.length;
  1562. while (++index < length) {
  1563. if (!predicate(array[index], index, array)) {
  1564. return false;
  1565. }
  1566. }
  1567. return true;
  1568. }
  1569. /**
  1570. * A specialized version of `_.filter` for arrays without support for
  1571. * iteratee shorthands.
  1572. *
  1573. * @private
  1574. * @param {Array} [array] The array to iterate over.
  1575. * @param {Function} predicate The function invoked per iteration.
  1576. * @returns {Array} Returns the new filtered array.
  1577. */
  1578. function arrayFilter(array, predicate) {
  1579. var index = -1,
  1580. length = array == null ? 0 : array.length,
  1581. resIndex = 0,
  1582. result = [];
  1583. while (++index < length) {
  1584. var value = array[index];
  1585. if (predicate(value, index, array)) {
  1586. result[resIndex++] = value;
  1587. }
  1588. }
  1589. return result;
  1590. }
  1591. /**
  1592. * A specialized version of `_.includes` for arrays without support for
  1593. * specifying an index to search from.
  1594. *
  1595. * @private
  1596. * @param {Array} [array] The array to inspect.
  1597. * @param {*} target The value to search for.
  1598. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1599. */
  1600. function arrayIncludes(array, value) {
  1601. var length = array == null ? 0 : array.length;
  1602. return !!length && baseIndexOf(array, value, 0) > -1;
  1603. }
  1604. /**
  1605. * This function is like `arrayIncludes` except that it accepts a comparator.
  1606. *
  1607. * @private
  1608. * @param {Array} [array] The array to inspect.
  1609. * @param {*} target The value to search for.
  1610. * @param {Function} comparator The comparator invoked per element.
  1611. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1612. */
  1613. function arrayIncludesWith(array, value, comparator) {
  1614. var index = -1,
  1615. length = array == null ? 0 : array.length;
  1616. while (++index < length) {
  1617. if (comparator(value, array[index])) {
  1618. return true;
  1619. }
  1620. }
  1621. return false;
  1622. }
  1623. /**
  1624. * A specialized version of `_.map` for arrays without support for iteratee
  1625. * shorthands.
  1626. *
  1627. * @private
  1628. * @param {Array} [array] The array to iterate over.
  1629. * @param {Function} iteratee The function invoked per iteration.
  1630. * @returns {Array} Returns the new mapped array.
  1631. */
  1632. function arrayMap(array, iteratee) {
  1633. var index = -1,
  1634. length = array == null ? 0 : array.length,
  1635. result = Array(length);
  1636. while (++index < length) {
  1637. result[index] = iteratee(array[index], index, array);
  1638. }
  1639. return result;
  1640. }
  1641. /**
  1642. * Appends the elements of `values` to `array`.
  1643. *
  1644. * @private
  1645. * @param {Array} array The array to modify.
  1646. * @param {Array} values The values to append.
  1647. * @returns {Array} Returns `array`.
  1648. */
  1649. function arrayPush(array, values) {
  1650. var index = -1,
  1651. length = values.length,
  1652. offset = array.length;
  1653. while (++index < length) {
  1654. array[offset + index] = values[index];
  1655. }
  1656. return array;
  1657. }
  1658. /**
  1659. * A specialized version of `_.reduce` for arrays without support for
  1660. * iteratee shorthands.
  1661. *
  1662. * @private
  1663. * @param {Array} [array] The array to iterate over.
  1664. * @param {Function} iteratee The function invoked per iteration.
  1665. * @param {*} [accumulator] The initial value.
  1666. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1667. * the initial value.
  1668. * @returns {*} Returns the accumulated value.
  1669. */
  1670. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1671. var index = -1,
  1672. length = array == null ? 0 : array.length;
  1673. if (initAccum && length) {
  1674. accumulator = array[++index];
  1675. }
  1676. while (++index < length) {
  1677. accumulator = iteratee(accumulator, array[index], index, array);
  1678. }
  1679. return accumulator;
  1680. }
  1681. /**
  1682. * A specialized version of `_.reduceRight` for arrays without support for
  1683. * iteratee shorthands.
  1684. *
  1685. * @private
  1686. * @param {Array} [array] The array to iterate over.
  1687. * @param {Function} iteratee The function invoked per iteration.
  1688. * @param {*} [accumulator] The initial value.
  1689. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1690. * the initial value.
  1691. * @returns {*} Returns the accumulated value.
  1692. */
  1693. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1694. var length = array == null ? 0 : array.length;
  1695. if (initAccum && length) {
  1696. accumulator = array[--length];
  1697. }
  1698. while (length--) {
  1699. accumulator = iteratee(accumulator, array[length], length, array);
  1700. }
  1701. return accumulator;
  1702. }
  1703. /**
  1704. * A specialized version of `_.some` for arrays without support for iteratee
  1705. * shorthands.
  1706. *
  1707. * @private
  1708. * @param {Array} [array] The array to iterate over.
  1709. * @param {Function} predicate The function invoked per iteration.
  1710. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1711. * else `false`.
  1712. */
  1713. function arraySome(array, predicate) {
  1714. var index = -1,
  1715. length = array == null ? 0 : array.length;
  1716. while (++index < length) {
  1717. if (predicate(array[index], index, array)) {
  1718. return true;
  1719. }
  1720. }
  1721. return false;
  1722. }
  1723. /**
  1724. * Gets the size of an ASCII `string`.
  1725. *
  1726. * @private
  1727. * @param {string} string The string inspect.
  1728. * @returns {number} Returns the string size.
  1729. */
  1730. var asciiSize = baseProperty('length');
  1731. /**
  1732. * Converts an ASCII `string` to an array.
  1733. *
  1734. * @private
  1735. * @param {string} string The string to convert.
  1736. * @returns {Array} Returns the converted array.
  1737. */
  1738. function asciiToArray(string) {
  1739. return string.split('');
  1740. }
  1741. /**
  1742. * Splits an ASCII `string` into an array of its words.
  1743. *
  1744. * @private
  1745. * @param {string} The string to inspect.
  1746. * @returns {Array} Returns the words of `string`.
  1747. */
  1748. function asciiWords(string) {
  1749. return string.match(reAsciiWord) || [];
  1750. }
  1751. /**
  1752. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1753. * without support for iteratee shorthands, which iterates over `collection`
  1754. * using `eachFunc`.
  1755. *
  1756. * @private
  1757. * @param {Array|Object} collection The collection to inspect.
  1758. * @param {Function} predicate The function invoked per iteration.
  1759. * @param {Function} eachFunc The function to iterate over `collection`.
  1760. * @returns {*} Returns the found element or its key, else `undefined`.
  1761. */
  1762. function baseFindKey(collection, predicate, eachFunc) {
  1763. var result;
  1764. eachFunc(collection, function(value, key, collection) {
  1765. if (predicate(value, key, collection)) {
  1766. result = key;
  1767. return false;
  1768. }
  1769. });
  1770. return result;
  1771. }
  1772. /**
  1773. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1774. * support for iteratee shorthands.
  1775. *
  1776. * @private
  1777. * @param {Array} array The array to inspect.
  1778. * @param {Function} predicate The function invoked per iteration.
  1779. * @param {number} fromIndex The index to search from.
  1780. * @param {boolean} [fromRight] Specify iterating from right to left.
  1781. * @returns {number} Returns the index of the matched value, else `-1`.
  1782. */
  1783. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1784. var length = array.length,
  1785. index = fromIndex + (fromRight ? 1 : -1);
  1786. while ((fromRight ? index-- : ++index < length)) {
  1787. if (predicate(array[index], index, array)) {
  1788. return index;
  1789. }
  1790. }
  1791. return -1;
  1792. }
  1793. /**
  1794. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1795. *
  1796. * @private
  1797. * @param {Array} array The array to inspect.
  1798. * @param {*} value The value to search for.
  1799. * @param {number} fromIndex The index to search from.
  1800. * @returns {number} Returns the index of the matched value, else `-1`.
  1801. */
  1802. function baseIndexOf(array, value, fromIndex) {
  1803. return value === value
  1804. ? strictIndexOf(array, value, fromIndex)
  1805. : baseFindIndex(array, baseIsNaN, fromIndex);
  1806. }
  1807. /**
  1808. * This function is like `baseIndexOf` except that it accepts a comparator.
  1809. *
  1810. * @private
  1811. * @param {Array} array The array to inspect.
  1812. * @param {*} value The value to search for.
  1813. * @param {number} fromIndex The index to search from.
  1814. * @param {Function} comparator The comparator invoked per element.
  1815. * @returns {number} Returns the index of the matched value, else `-1`.
  1816. */
  1817. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1818. var index = fromIndex - 1,
  1819. length = array.length;
  1820. while (++index < length) {
  1821. if (comparator(array[index], value)) {
  1822. return index;
  1823. }
  1824. }
  1825. return -1;
  1826. }
  1827. /**
  1828. * The base implementation of `_.isNaN` without support for number objects.
  1829. *
  1830. * @private
  1831. * @param {*} value The value to check.
  1832. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1833. */
  1834. function baseIsNaN(value) {
  1835. return value !== value;
  1836. }
  1837. /**
  1838. * The base implementation of `_.mean` and `_.meanBy` without support for
  1839. * iteratee shorthands.
  1840. *
  1841. * @private
  1842. * @param {Array} array The array to iterate over.
  1843. * @param {Function} iteratee The function invoked per iteration.
  1844. * @returns {number} Returns the mean.
  1845. */
  1846. function baseMean(array, iteratee) {
  1847. var length = array == null ? 0 : array.length;
  1848. return length ? (baseSum(array, iteratee) / length) : NAN;
  1849. }
  1850. /**
  1851. * The base implementation of `_.property` without support for deep paths.
  1852. *
  1853. * @private
  1854. * @param {string} key The key of the property to get.
  1855. * @returns {Function} Returns the new accessor function.
  1856. */
  1857. function baseProperty(key) {
  1858. return function(object) {
  1859. return object == null ? undefined : object[key];
  1860. };
  1861. }
  1862. /**
  1863. * The base implementation of `_.propertyOf` without support for deep paths.
  1864. *
  1865. * @private
  1866. * @param {Object} object The object to query.
  1867. * @returns {Function} Returns the new accessor function.
  1868. */
  1869. function basePropertyOf(object) {
  1870. return function(key) {
  1871. return object == null ? undefined : object[key];
  1872. };
  1873. }
  1874. /**
  1875. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1876. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1877. *
  1878. * @private
  1879. * @param {Array|Object} collection The collection to iterate over.
  1880. * @param {Function} iteratee The function invoked per iteration.
  1881. * @param {*} accumulator The initial value.
  1882. * @param {boolean} initAccum Specify using the first or last element of
  1883. * `collection` as the initial value.
  1884. * @param {Function} eachFunc The function to iterate over `collection`.
  1885. * @returns {*} Returns the accumulated value.
  1886. */
  1887. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1888. eachFunc(collection, function(value, index, collection) {
  1889. accumulator = initAccum
  1890. ? (initAccum = false, value)
  1891. : iteratee(accumulator, value, index, collection);
  1892. });
  1893. return accumulator;
  1894. }
  1895. /**
  1896. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1897. * sort order of `array` and replaces criteria objects with their corresponding
  1898. * values.
  1899. *
  1900. * @private
  1901. * @param {Array} array The array to sort.
  1902. * @param {Function} comparer The function to define sort order.
  1903. * @returns {Array} Returns `array`.
  1904. */
  1905. function baseSortBy(array, comparer) {
  1906. var length = array.length;
  1907. array.sort(comparer);
  1908. while (length--) {
  1909. array[length] = array[length].value;
  1910. }
  1911. return array;
  1912. }
  1913. /**
  1914. * The base implementation of `_.sum` and `_.sumBy` without support for
  1915. * iteratee shorthands.
  1916. *
  1917. * @private
  1918. * @param {Array} array The array to iterate over.
  1919. * @param {Function} iteratee The function invoked per iteration.
  1920. * @returns {number} Returns the sum.
  1921. */
  1922. function baseSum(array, iteratee) {
  1923. var result,
  1924. index = -1,
  1925. length = array.length;
  1926. while (++index < length) {
  1927. var current = iteratee(array[index]);
  1928. if (current !== undefined) {
  1929. result = result === undefined ? current : (result + current);
  1930. }
  1931. }
  1932. return result;
  1933. }
  1934. /**
  1935. * The base implementation of `_.times` without support for iteratee shorthands
  1936. * or max array length checks.
  1937. *
  1938. * @private
  1939. * @param {number} n The number of times to invoke `iteratee`.
  1940. * @param {Function} iteratee The function invoked per iteration.
  1941. * @returns {Array} Returns the array of results.
  1942. */
  1943. function baseTimes(n, iteratee) {
  1944. var index = -1,
  1945. result = Array(n);
  1946. while (++index < n) {
  1947. result[index] = iteratee(index);
  1948. }
  1949. return result;
  1950. }
  1951. /**
  1952. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  1953. * of key-value pairs for `object` corresponding to the property names of `props`.
  1954. *
  1955. * @private
  1956. * @param {Object} object The object to query.
  1957. * @param {Array} props The property names to get values for.
  1958. * @returns {Object} Returns the key-value pairs.
  1959. */
  1960. function baseToPairs(object, props) {
  1961. return arrayMap(props, function(key) {
  1962. return [key, object[key]];
  1963. });
  1964. }
  1965. /**
  1966. * The base implementation of `_.trim`.
  1967. *
  1968. * @private
  1969. * @param {string} string The string to trim.
  1970. * @returns {string} Returns the trimmed string.
  1971. */
  1972. function baseTrim(string) {
  1973. return string
  1974. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  1975. : string;
  1976. }
  1977. /**
  1978. * The base implementation of `_.unary` without support for storing metadata.
  1979. *
  1980. * @private
  1981. * @param {Function} func The function to cap arguments for.
  1982. * @returns {Function} Returns the new capped function.
  1983. */
  1984. function baseUnary(func) {
  1985. return function(value) {
  1986. return func(value);
  1987. };
  1988. }
  1989. /**
  1990. * The base implementation of `_.values` and `_.valuesIn` which creates an
  1991. * array of `object` property values corresponding to the property names
  1992. * of `props`.
  1993. *
  1994. * @private
  1995. * @param {Object} object The object to query.
  1996. * @param {Array} props The property names to get values for.
  1997. * @returns {Object} Returns the array of property values.
  1998. */
  1999. function baseValues(object, props) {
  2000. return arrayMap(props, function(key) {
  2001. return object[key];
  2002. });
  2003. }
  2004. /**
  2005. * Checks if a `cache` value for `key` exists.
  2006. *
  2007. * @private
  2008. * @param {Object} cache The cache to query.
  2009. * @param {string} key The key of the entry to check.
  2010. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2011. */
  2012. function cacheHas(cache, key) {
  2013. return cache.has(key);
  2014. }
  2015. /**
  2016. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2017. * that is not found in the character symbols.
  2018. *
  2019. * @private
  2020. * @param {Array} strSymbols The string symbols to inspect.
  2021. * @param {Array} chrSymbols The character symbols to find.
  2022. * @returns {number} Returns the index of the first unmatched string symbol.
  2023. */
  2024. function charsStartIndex(strSymbols, chrSymbols) {
  2025. var index = -1,
  2026. length = strSymbols.length;
  2027. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2028. return index;
  2029. }
  2030. /**
  2031. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2032. * that is not found in the character symbols.
  2033. *
  2034. * @private
  2035. * @param {Array} strSymbols The string symbols to inspect.
  2036. * @param {Array} chrSymbols The character symbols to find.
  2037. * @returns {number} Returns the index of the last unmatched string symbol.
  2038. */
  2039. function charsEndIndex(strSymbols, chrSymbols) {
  2040. var index = strSymbols.length;
  2041. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2042. return index;
  2043. }
  2044. /**
  2045. * Gets the number of `placeholder` occurrences in `array`.
  2046. *
  2047. * @private
  2048. * @param {Array} array The array to inspect.
  2049. * @param {*} placeholder The placeholder to search for.
  2050. * @returns {number} Returns the placeholder count.
  2051. */
  2052. function countHolders(array, placeholder) {
  2053. var length = array.length,
  2054. result = 0;
  2055. while (length--) {
  2056. if (array[length] === placeholder) {
  2057. ++result;
  2058. }
  2059. }
  2060. return result;
  2061. }
  2062. /**
  2063. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2064. * letters to basic Latin letters.
  2065. *
  2066. * @private
  2067. * @param {string} letter The matched letter to deburr.
  2068. * @returns {string} Returns the deburred letter.
  2069. */
  2070. var deburrLetter = basePropertyOf(deburredLetters);
  2071. /**
  2072. * Used by `_.escape` to convert characters to HTML entities.
  2073. *
  2074. * @private
  2075. * @param {string} chr The matched character to escape.
  2076. * @returns {string} Returns the escaped character.
  2077. */
  2078. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2079. /**
  2080. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2081. *
  2082. * @private
  2083. * @param {string} chr The matched character to escape.
  2084. * @returns {string} Returns the escaped character.
  2085. */
  2086. function escapeStringChar(chr) {
  2087. return '\\' + stringEscapes[chr];
  2088. }
  2089. /**
  2090. * Gets the value at `key` of `object`.
  2091. *
  2092. * @private
  2093. * @param {Object} [object] The object to query.
  2094. * @param {string} key The key of the property to get.
  2095. * @returns {*} Returns the property value.
  2096. */
  2097. function getValue(object, key) {
  2098. return object == null ? undefined : object[key];
  2099. }
  2100. /**
  2101. * Checks if `string` contains Unicode symbols.
  2102. *
  2103. * @private
  2104. * @param {string} string The string to inspect.
  2105. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2106. */
  2107. function hasUnicode(string) {
  2108. return reHasUnicode.test(string);
  2109. }
  2110. /**
  2111. * Checks if `string` contains a word composed of Unicode symbols.
  2112. *
  2113. * @private
  2114. * @param {string} string The string to inspect.
  2115. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2116. */
  2117. function hasUnicodeWord(string) {
  2118. return reHasUnicodeWord.test(string);
  2119. }
  2120. /**
  2121. * Converts `iterator` to an array.
  2122. *
  2123. * @private
  2124. * @param {Object} iterator The iterator to convert.
  2125. * @returns {Array} Returns the converted array.
  2126. */
  2127. function iteratorToArray(iterator) {
  2128. var data,
  2129. result = [];
  2130. while (!(data = iterator.next()).done) {
  2131. result.push(data.value);
  2132. }
  2133. return result;
  2134. }
  2135. /**
  2136. * Converts `map` to its key-value pairs.
  2137. *
  2138. * @private
  2139. * @param {Object} map The map to convert.
  2140. * @returns {Array} Returns the key-value pairs.
  2141. */
  2142. function mapToArray(map) {
  2143. var index = -1,
  2144. result = Array(map.size);
  2145. map.forEach(function(value, key) {
  2146. result[++index] = [key, value];
  2147. });
  2148. return result;
  2149. }
  2150. /**
  2151. * Creates a unary function that invokes `func` with its argument transformed.
  2152. *
  2153. * @private
  2154. * @param {Function} func The function to wrap.
  2155. * @param {Function} transform The argument transform.
  2156. * @returns {Function} Returns the new function.
  2157. */
  2158. function overArg(func, transform) {
  2159. return function(arg) {
  2160. return func(transform(arg));
  2161. };
  2162. }
  2163. /**
  2164. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2165. * and returns an array of their indexes.
  2166. *
  2167. * @private
  2168. * @param {Array} array The array to modify.
  2169. * @param {*} placeholder The placeholder to replace.
  2170. * @returns {Array} Returns the new array of placeholder indexes.
  2171. */
  2172. function replaceHolders(array, placeholder) {
  2173. var index = -1,
  2174. length = array.length,
  2175. resIndex = 0,
  2176. result = [];
  2177. while (++index < length) {
  2178. var value = array[index];
  2179. if (value === placeholder || value === PLACEHOLDER) {
  2180. array[index] = PLACEHOLDER;
  2181. result[resIndex++] = index;
  2182. }
  2183. }
  2184. return result;
  2185. }
  2186. /**
  2187. * Converts `set` to an array of its values.
  2188. *
  2189. * @private
  2190. * @param {Object} set The set to convert.
  2191. * @returns {Array} Returns the values.
  2192. */
  2193. function setToArray(set) {
  2194. var index = -1,
  2195. result = Array(set.size);
  2196. set.forEach(function(value) {
  2197. result[++index] = value;
  2198. });
  2199. return result;
  2200. }
  2201. /**
  2202. * Converts `set` to its value-value pairs.
  2203. *
  2204. * @private
  2205. * @param {Object} set The set to convert.
  2206. * @returns {Array} Returns the value-value pairs.
  2207. */
  2208. function setToPairs(set) {
  2209. var index = -1,
  2210. result = Array(set.size);
  2211. set.forEach(function(value) {
  2212. result[++index] = [value, value];
  2213. });
  2214. return result;
  2215. }
  2216. /**
  2217. * A specialized version of `_.indexOf` which performs strict equality
  2218. * comparisons of values, i.e. `===`.
  2219. *
  2220. * @private
  2221. * @param {Array} array The array to inspect.
  2222. * @param {*} value The value to search for.
  2223. * @param {number} fromIndex The index to search from.
  2224. * @returns {number} Returns the index of the matched value, else `-1`.
  2225. */
  2226. function strictIndexOf(array, value, fromIndex) {
  2227. var index = fromIndex - 1,
  2228. length = array.length;
  2229. while (++index < length) {
  2230. if (array[index] === value) {
  2231. return index;
  2232. }
  2233. }
  2234. return -1;
  2235. }
  2236. /**
  2237. * A specialized version of `_.lastIndexOf` which performs strict equality
  2238. * comparisons of values, i.e. `===`.
  2239. *
  2240. * @private
  2241. * @param {Array} array The array to inspect.
  2242. * @param {*} value The value to search for.
  2243. * @param {number} fromIndex The index to search from.
  2244. * @returns {number} Returns the index of the matched value, else `-1`.
  2245. */
  2246. function strictLastIndexOf(array, value, fromIndex) {
  2247. var index = fromIndex + 1;
  2248. while (index--) {
  2249. if (array[index] === value) {
  2250. return index;
  2251. }
  2252. }
  2253. return index;
  2254. }
  2255. /**
  2256. * Gets the number of symbols in `string`.
  2257. *
  2258. * @private
  2259. * @param {string} string The string to inspect.
  2260. * @returns {number} Returns the string size.
  2261. */
  2262. function stringSize(string) {
  2263. return hasUnicode(string)
  2264. ? unicodeSize(string)
  2265. : asciiSize(string);
  2266. }
  2267. /**
  2268. * Converts `string` to an array.
  2269. *
  2270. * @private
  2271. * @param {string} string The string to convert.
  2272. * @returns {Array} Returns the converted array.
  2273. */
  2274. function stringToArray(string) {
  2275. return hasUnicode(string)
  2276. ? unicodeToArray(string)
  2277. : asciiToArray(string);
  2278. }
  2279. /**
  2280. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2281. * character of `string`.
  2282. *
  2283. * @private
  2284. * @param {string} string The string to inspect.
  2285. * @returns {number} Returns the index of the last non-whitespace character.
  2286. */
  2287. function trimmedEndIndex(string) {
  2288. var index = string.length;
  2289. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2290. return index;
  2291. }
  2292. /**
  2293. * Used by `_.unescape` to convert HTML entities to characters.
  2294. *
  2295. * @private
  2296. * @param {string} chr The matched character to unescape.
  2297. * @returns {string} Returns the unescaped character.
  2298. */
  2299. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2300. /**
  2301. * Gets the size of a Unicode `string`.
  2302. *
  2303. * @private
  2304. * @param {string} string The string inspect.
  2305. * @returns {number} Returns the string size.
  2306. */
  2307. function unicodeSize(string) {
  2308. var result = reUnicode.lastIndex = 0;
  2309. while (reUnicode.test(string)) {
  2310. ++result;
  2311. }
  2312. return result;
  2313. }
  2314. /**
  2315. * Converts a Unicode `string` to an array.
  2316. *
  2317. * @private
  2318. * @param {string} string The string to convert.
  2319. * @returns {Array} Returns the converted array.
  2320. */
  2321. function unicodeToArray(string) {
  2322. return string.match(reUnicode) || [];
  2323. }
  2324. /**
  2325. * Splits a Unicode `string` into an array of its words.
  2326. *
  2327. * @private
  2328. * @param {string} The string to inspect.
  2329. * @returns {Array} Returns the words of `string`.
  2330. */
  2331. function unicodeWords(string) {
  2332. return string.match(reUnicodeWord) || [];
  2333. }
  2334. /*--------------------------------------------------------------------------*/
  2335. /**
  2336. * Create a new pristine `lodash` function using the `context` object.
  2337. *
  2338. * @static
  2339. * @memberOf _
  2340. * @since 1.1.0
  2341. * @category Util
  2342. * @param {Object} [context=root] The context object.
  2343. * @returns {Function} Returns a new `lodash` function.
  2344. * @example
  2345. *
  2346. * _.mixin({ 'foo': _.constant('foo') });
  2347. *
  2348. * var lodash = _.runInContext();
  2349. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2350. *
  2351. * _.isFunction(_.foo);
  2352. * // => true
  2353. * _.isFunction(_.bar);
  2354. * // => false
  2355. *
  2356. * lodash.isFunction(lodash.foo);
  2357. * // => false
  2358. * lodash.isFunction(lodash.bar);
  2359. * // => true
  2360. *
  2361. * // Create a suped-up `defer` in Node.js.
  2362. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2363. */
  2364. var runInContext = (function runInContext(context) {
  2365. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2366. /** Built-in constructor references. */
  2367. var Array = context.Array,
  2368. Date = context.Date,
  2369. Error = context.Error,
  2370. Function = context.Function,
  2371. Math = context.Math,
  2372. Object = context.Object,
  2373. RegExp = context.RegExp,
  2374. String = context.String,
  2375. TypeError = context.TypeError;
  2376. /** Used for built-in method references. */
  2377. var arrayProto = Array.prototype,
  2378. funcProto = Function.prototype,
  2379. objectProto = Object.prototype;
  2380. /** Used to detect overreaching core-js shims. */
  2381. var coreJsData = context['__core-js_shared__'];
  2382. /** Used to resolve the decompiled source of functions. */
  2383. var funcToString = funcProto.toString;
  2384. /** Used to check objects for own properties. */
  2385. var hasOwnProperty = objectProto.hasOwnProperty;
  2386. /** Used to generate unique IDs. */
  2387. var idCounter = 0;
  2388. /** Used to detect methods masquerading as native. */
  2389. var maskSrcKey = (function() {
  2390. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2391. return uid ? ('Symbol(src)_1.' + uid) : '';
  2392. }());
  2393. /**
  2394. * Used to resolve the
  2395. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2396. * of values.
  2397. */
  2398. var nativeObjectToString = objectProto.toString;
  2399. /** Used to infer the `Object` constructor. */
  2400. var objectCtorString = funcToString.call(Object);
  2401. /** Used to restore the original `_` reference in `_.noConflict`. */
  2402. var oldDash = root._;
  2403. /** Used to detect if a method is native. */
  2404. var reIsNative = RegExp('^' +
  2405. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2406. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2407. );
  2408. /** Built-in value references. */
  2409. var Buffer = moduleExports ? context.Buffer : undefined,
  2410. Symbol = context.Symbol,
  2411. Uint8Array = context.Uint8Array,
  2412. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2413. getPrototype = overArg(Object.getPrototypeOf, Object),
  2414. objectCreate = Object.create,
  2415. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2416. splice = arrayProto.splice,
  2417. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2418. symIterator = Symbol ? Symbol.iterator : undefined,
  2419. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2420. var defineProperty = (function() {
  2421. try {
  2422. var func = getNative(Object, 'defineProperty');
  2423. func({}, '', {});
  2424. return func;
  2425. } catch (e) {}
  2426. }());
  2427. /** Mocked built-ins. */
  2428. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2429. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2430. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2431. /* Built-in method references for those with the same name as other `lodash` methods. */
  2432. var nativeCeil = Math.ceil,
  2433. nativeFloor = Math.floor,
  2434. nativeGetSymbols = Object.getOwnPropertySymbols,
  2435. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2436. nativeIsFinite = context.isFinite,
  2437. nativeJoin = arrayProto.join,
  2438. nativeKeys = overArg(Object.keys, Object),
  2439. nativeMax = Math.max,
  2440. nativeMin = Math.min,
  2441. nativeNow = Date.now,
  2442. nativeParseInt = context.parseInt,
  2443. nativeRandom = Math.random,
  2444. nativeReverse = arrayProto.reverse;
  2445. /* Built-in method references that are verified to be native. */
  2446. var DataView = getNative(context, 'DataView'),
  2447. Map = getNative(context, 'Map'),
  2448. Promise = getNative(context, 'Promise'),
  2449. Set = getNative(context, 'Set'),
  2450. WeakMap = getNative(context, 'WeakMap'),
  2451. nativeCreate = getNative(Object, 'create');
  2452. /** Used to store function metadata. */
  2453. var metaMap = WeakMap && new WeakMap;
  2454. /** Used to lookup unminified function names. */
  2455. var realNames = {};
  2456. /** Used to detect maps, sets, and weakmaps. */
  2457. var dataViewCtorString = toSource(DataView),
  2458. mapCtorString = toSource(Map),
  2459. promiseCtorString = toSource(Promise),
  2460. setCtorString = toSource(Set),
  2461. weakMapCtorString = toSource(WeakMap);
  2462. /** Used to convert symbols to primitives and strings. */
  2463. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2464. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2465. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2466. /*------------------------------------------------------------------------*/
  2467. /**
  2468. * Creates a `lodash` object which wraps `value` to enable implicit method
  2469. * chain sequences. Methods that operate on and return arrays, collections,
  2470. * and functions can be chained together. Methods that retrieve a single value
  2471. * or may return a primitive value will automatically end the chain sequence
  2472. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2473. * with `_#value`.
  2474. *
  2475. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2476. * enabled using `_.chain`.
  2477. *
  2478. * The execution of chained methods is lazy, that is, it's deferred until
  2479. * `_#value` is implicitly or explicitly called.
  2480. *
  2481. * Lazy evaluation allows several methods to support shortcut fusion.
  2482. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2483. * the creation of intermediate arrays and can greatly reduce the number of
  2484. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2485. * fusion if the section is applied to an array and iteratees accept only
  2486. * one argument. The heuristic for whether a section qualifies for shortcut
  2487. * fusion is subject to change.
  2488. *
  2489. * Chaining is supported in custom builds as long as the `_#value` method is
  2490. * directly or indirectly included in the build.
  2491. *
  2492. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2493. *
  2494. * The wrapper `Array` methods are:
  2495. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2496. *
  2497. * The wrapper `String` methods are:
  2498. * `replace` and `split`
  2499. *
  2500. * The wrapper methods that support shortcut fusion are:
  2501. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2502. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2503. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2504. *
  2505. * The chainable wrapper methods are:
  2506. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2507. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2508. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2509. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2510. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2511. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2512. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2513. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2514. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2515. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2516. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2517. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2518. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2519. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2520. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2521. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2522. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2523. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2524. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2525. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2526. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2527. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2528. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2529. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2530. *
  2531. * The wrapper methods that are **not** chainable by default are:
  2532. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2533. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2534. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2535. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2536. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2537. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2538. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2539. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2540. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2541. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2542. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2543. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2544. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2545. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2546. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2547. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2548. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2549. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2550. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2551. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2552. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2553. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2554. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2555. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2556. * `upperFirst`, `value`, and `words`
  2557. *
  2558. * @name _
  2559. * @constructor
  2560. * @category Seq
  2561. * @param {*} value The value to wrap in a `lodash` instance.
  2562. * @returns {Object} Returns the new `lodash` wrapper instance.
  2563. * @example
  2564. *
  2565. * function square(n) {
  2566. * return n * n;
  2567. * }
  2568. *
  2569. * var wrapped = _([1, 2, 3]);
  2570. *
  2571. * // Returns an unwrapped value.
  2572. * wrapped.reduce(_.add);
  2573. * // => 6
  2574. *
  2575. * // Returns a wrapped value.
  2576. * var squares = wrapped.map(square);
  2577. *
  2578. * _.isArray(squares);
  2579. * // => false
  2580. *
  2581. * _.isArray(squares.value());
  2582. * // => true
  2583. */
  2584. function lodash(value) {
  2585. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2586. if (value instanceof LodashWrapper) {
  2587. return value;
  2588. }
  2589. if (hasOwnProperty.call(value, '__wrapped__')) {
  2590. return wrapperClone(value);
  2591. }
  2592. }
  2593. return new LodashWrapper(value);
  2594. }
  2595. /**
  2596. * The base implementation of `_.create` without support for assigning
  2597. * properties to the created object.
  2598. *
  2599. * @private
  2600. * @param {Object} proto The object to inherit from.
  2601. * @returns {Object} Returns the new object.
  2602. */
  2603. var baseCreate = (function() {
  2604. function object() {}
  2605. return function(proto) {
  2606. if (!isObject(proto)) {
  2607. return {};
  2608. }
  2609. if (objectCreate) {
  2610. return objectCreate(proto);
  2611. }
  2612. object.prototype = proto;
  2613. var result = new object;
  2614. object.prototype = undefined;
  2615. return result;
  2616. };
  2617. }());
  2618. /**
  2619. * The function whose prototype chain sequence wrappers inherit from.
  2620. *
  2621. * @private
  2622. */
  2623. function baseLodash() {
  2624. // No operation performed.
  2625. }
  2626. /**
  2627. * The base constructor for creating `lodash` wrapper objects.
  2628. *
  2629. * @private
  2630. * @param {*} value The value to wrap.
  2631. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2632. */
  2633. function LodashWrapper(value, chainAll) {
  2634. this.__wrapped__ = value;
  2635. this.__actions__ = [];
  2636. this.__chain__ = !!chainAll;
  2637. this.__index__ = 0;
  2638. this.__values__ = undefined;
  2639. }
  2640. /**
  2641. * By default, the template delimiters used by lodash are like those in
  2642. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2643. * following template settings to use alternative delimiters.
  2644. *
  2645. * @static
  2646. * @memberOf _
  2647. * @type {Object}
  2648. */
  2649. lodash.templateSettings = {
  2650. /**
  2651. * Used to detect `data` property values to be HTML-escaped.
  2652. *
  2653. * @memberOf _.templateSettings
  2654. * @type {RegExp}
  2655. */
  2656. 'escape': reEscape,
  2657. /**
  2658. * Used to detect code to be evaluated.
  2659. *
  2660. * @memberOf _.templateSettings
  2661. * @type {RegExp}
  2662. */
  2663. 'evaluate': reEvaluate,
  2664. /**
  2665. * Used to detect `data` property values to inject.
  2666. *
  2667. * @memberOf _.templateSettings
  2668. * @type {RegExp}
  2669. */
  2670. 'interpolate': reInterpolate,
  2671. /**
  2672. * Used to reference the data object in the template text.
  2673. *
  2674. * @memberOf _.templateSettings
  2675. * @type {string}
  2676. */
  2677. 'variable': '',
  2678. /**
  2679. * Used to import variables into the compiled template.
  2680. *
  2681. * @memberOf _.templateSettings
  2682. * @type {Object}
  2683. */
  2684. 'imports': {
  2685. /**
  2686. * A reference to the `lodash` function.
  2687. *
  2688. * @memberOf _.templateSettings.imports
  2689. * @type {Function}
  2690. */
  2691. '_': lodash
  2692. }
  2693. };
  2694. // Ensure wrappers are instances of `baseLodash`.
  2695. lodash.prototype = baseLodash.prototype;
  2696. lodash.prototype.constructor = lodash;
  2697. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2698. LodashWrapper.prototype.constructor = LodashWrapper;
  2699. /*------------------------------------------------------------------------*/
  2700. /**
  2701. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2702. *
  2703. * @private
  2704. * @constructor
  2705. * @param {*} value The value to wrap.
  2706. */
  2707. function LazyWrapper(value) {
  2708. this.__wrapped__ = value;
  2709. this.__actions__ = [];
  2710. this.__dir__ = 1;
  2711. this.__filtered__ = false;
  2712. this.__iteratees__ = [];
  2713. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2714. this.__views__ = [];
  2715. }
  2716. /**
  2717. * Creates a clone of the lazy wrapper object.
  2718. *
  2719. * @private
  2720. * @name clone
  2721. * @memberOf LazyWrapper
  2722. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2723. */
  2724. function lazyClone() {
  2725. var result = new LazyWrapper(this.__wrapped__);
  2726. result.__actions__ = copyArray(this.__actions__);
  2727. result.__dir__ = this.__dir__;
  2728. result.__filtered__ = this.__filtered__;
  2729. result.__iteratees__ = copyArray(this.__iteratees__);
  2730. result.__takeCount__ = this.__takeCount__;
  2731. result.__views__ = copyArray(this.__views__);
  2732. return result;
  2733. }
  2734. /**
  2735. * Reverses the direction of lazy iteration.
  2736. *
  2737. * @private
  2738. * @name reverse
  2739. * @memberOf LazyWrapper
  2740. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2741. */
  2742. function lazyReverse() {
  2743. if (this.__filtered__) {
  2744. var result = new LazyWrapper(this);
  2745. result.__dir__ = -1;
  2746. result.__filtered__ = true;
  2747. } else {
  2748. result = this.clone();
  2749. result.__dir__ *= -1;
  2750. }
  2751. return result;
  2752. }
  2753. /**
  2754. * Extracts the unwrapped value from its lazy wrapper.
  2755. *
  2756. * @private
  2757. * @name value
  2758. * @memberOf LazyWrapper
  2759. * @returns {*} Returns the unwrapped value.
  2760. */
  2761. function lazyValue() {
  2762. var array = this.__wrapped__.value(),
  2763. dir = this.__dir__,
  2764. isArr = isArray(array),
  2765. isRight = dir < 0,
  2766. arrLength = isArr ? array.length : 0,
  2767. view = getView(0, arrLength, this.__views__),
  2768. start = view.start,
  2769. end = view.end,
  2770. length = end - start,
  2771. index = isRight ? end : (start - 1),
  2772. iteratees = this.__iteratees__,
  2773. iterLength = iteratees.length,
  2774. resIndex = 0,
  2775. takeCount = nativeMin(length, this.__takeCount__);
  2776. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2777. return baseWrapperValue(array, this.__actions__);
  2778. }
  2779. var result = [];
  2780. outer:
  2781. while (length-- && resIndex < takeCount) {
  2782. index += dir;
  2783. var iterIndex = -1,
  2784. value = array[index];
  2785. while (++iterIndex < iterLength) {
  2786. var data = iteratees[iterIndex],
  2787. iteratee = data.iteratee,
  2788. type = data.type,
  2789. computed = iteratee(value);
  2790. if (type == LAZY_MAP_FLAG) {
  2791. value = computed;
  2792. } else if (!computed) {
  2793. if (type == LAZY_FILTER_FLAG) {
  2794. continue outer;
  2795. } else {
  2796. break outer;
  2797. }
  2798. }
  2799. }
  2800. result[resIndex++] = value;
  2801. }
  2802. return result;
  2803. }
  2804. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2805. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2806. LazyWrapper.prototype.constructor = LazyWrapper;
  2807. /*------------------------------------------------------------------------*/
  2808. /**
  2809. * Creates a hash object.
  2810. *
  2811. * @private
  2812. * @constructor
  2813. * @param {Array} [entries] The key-value pairs to cache.
  2814. */
  2815. function Hash(entries) {
  2816. var index = -1,
  2817. length = entries == null ? 0 : entries.length;
  2818. this.clear();
  2819. while (++index < length) {
  2820. var entry = entries[index];
  2821. this.set(entry[0], entry[1]);
  2822. }
  2823. }
  2824. /**
  2825. * Removes all key-value entries from the hash.
  2826. *
  2827. * @private
  2828. * @name clear
  2829. * @memberOf Hash
  2830. */
  2831. function hashClear() {
  2832. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2833. this.size = 0;
  2834. }
  2835. /**
  2836. * Removes `key` and its value from the hash.
  2837. *
  2838. * @private
  2839. * @name delete
  2840. * @memberOf Hash
  2841. * @param {Object} hash The hash to modify.
  2842. * @param {string} key The key of the value to remove.
  2843. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2844. */
  2845. function hashDelete(key) {
  2846. var result = this.has(key) && delete this.__data__[key];
  2847. this.size -= result ? 1 : 0;
  2848. return result;
  2849. }
  2850. /**
  2851. * Gets the hash value for `key`.
  2852. *
  2853. * @private
  2854. * @name get
  2855. * @memberOf Hash
  2856. * @param {string} key The key of the value to get.
  2857. * @returns {*} Returns the entry value.
  2858. */
  2859. function hashGet(key) {
  2860. var data = this.__data__;
  2861. if (nativeCreate) {
  2862. var result = data[key];
  2863. return result === HASH_UNDEFINED ? undefined : result;
  2864. }
  2865. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2866. }
  2867. /**
  2868. * Checks if a hash value for `key` exists.
  2869. *
  2870. * @private
  2871. * @name has
  2872. * @memberOf Hash
  2873. * @param {string} key The key of the entry to check.
  2874. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2875. */
  2876. function hashHas(key) {
  2877. var data = this.__data__;
  2878. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2879. }
  2880. /**
  2881. * Sets the hash `key` to `value`.
  2882. *
  2883. * @private
  2884. * @name set
  2885. * @memberOf Hash
  2886. * @param {string} key The key of the value to set.
  2887. * @param {*} value The value to set.
  2888. * @returns {Object} Returns the hash instance.
  2889. */
  2890. function hashSet(key, value) {
  2891. var data = this.__data__;
  2892. this.size += this.has(key) ? 0 : 1;
  2893. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2894. return this;
  2895. }
  2896. // Add methods to `Hash`.
  2897. Hash.prototype.clear = hashClear;
  2898. Hash.prototype['delete'] = hashDelete;
  2899. Hash.prototype.get = hashGet;
  2900. Hash.prototype.has = hashHas;
  2901. Hash.prototype.set = hashSet;
  2902. /*------------------------------------------------------------------------*/
  2903. /**
  2904. * Creates an list cache object.
  2905. *
  2906. * @private
  2907. * @constructor
  2908. * @param {Array} [entries] The key-value pairs to cache.
  2909. */
  2910. function ListCache(entries) {
  2911. var index = -1,
  2912. length = entries == null ? 0 : entries.length;
  2913. this.clear();
  2914. while (++index < length) {
  2915. var entry = entries[index];
  2916. this.set(entry[0], entry[1]);
  2917. }
  2918. }
  2919. /**
  2920. * Removes all key-value entries from the list cache.
  2921. *
  2922. * @private
  2923. * @name clear
  2924. * @memberOf ListCache
  2925. */
  2926. function listCacheClear() {
  2927. this.__data__ = [];
  2928. this.size = 0;
  2929. }
  2930. /**
  2931. * Removes `key` and its value from the list cache.
  2932. *
  2933. * @private
  2934. * @name delete
  2935. * @memberOf ListCache
  2936. * @param {string} key The key of the value to remove.
  2937. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2938. */
  2939. function listCacheDelete(key) {
  2940. var data = this.__data__,
  2941. index = assocIndexOf(data, key);
  2942. if (index < 0) {
  2943. return false;
  2944. }
  2945. var lastIndex = data.length - 1;
  2946. if (index == lastIndex) {
  2947. data.pop();
  2948. } else {
  2949. splice.call(data, index, 1);
  2950. }
  2951. --this.size;
  2952. return true;
  2953. }
  2954. /**
  2955. * Gets the list cache value for `key`.
  2956. *
  2957. * @private
  2958. * @name get
  2959. * @memberOf ListCache
  2960. * @param {string} key The key of the value to get.
  2961. * @returns {*} Returns the entry value.
  2962. */
  2963. function listCacheGet(key) {
  2964. var data = this.__data__,
  2965. index = assocIndexOf(data, key);
  2966. return index < 0 ? undefined : data[index][1];
  2967. }
  2968. /**
  2969. * Checks if a list cache value for `key` exists.
  2970. *
  2971. * @private
  2972. * @name has
  2973. * @memberOf ListCache
  2974. * @param {string} key The key of the entry to check.
  2975. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2976. */
  2977. function listCacheHas(key) {
  2978. return assocIndexOf(this.__data__, key) > -1;
  2979. }
  2980. /**
  2981. * Sets the list cache `key` to `value`.
  2982. *
  2983. * @private
  2984. * @name set
  2985. * @memberOf ListCache
  2986. * @param {string} key The key of the value to set.
  2987. * @param {*} value The value to set.
  2988. * @returns {Object} Returns the list cache instance.
  2989. */
  2990. function listCacheSet(key, value) {
  2991. var data = this.__data__,
  2992. index = assocIndexOf(data, key);
  2993. if (index < 0) {
  2994. ++this.size;
  2995. data.push([key, value]);
  2996. } else {
  2997. data[index][1] = value;
  2998. }
  2999. return this;
  3000. }
  3001. // Add methods to `ListCache`.
  3002. ListCache.prototype.clear = listCacheClear;
  3003. ListCache.prototype['delete'] = listCacheDelete;
  3004. ListCache.prototype.get = listCacheGet;
  3005. ListCache.prototype.has = listCacheHas;
  3006. ListCache.prototype.set = listCacheSet;
  3007. /*------------------------------------------------------------------------*/
  3008. /**
  3009. * Creates a map cache object to store key-value pairs.
  3010. *
  3011. * @private
  3012. * @constructor
  3013. * @param {Array} [entries] The key-value pairs to cache.
  3014. */
  3015. function MapCache(entries) {
  3016. var index = -1,
  3017. length = entries == null ? 0 : entries.length;
  3018. this.clear();
  3019. while (++index < length) {
  3020. var entry = entries[index];
  3021. this.set(entry[0], entry[1]);
  3022. }
  3023. }
  3024. /**
  3025. * Removes all key-value entries from the map.
  3026. *
  3027. * @private
  3028. * @name clear
  3029. * @memberOf MapCache
  3030. */
  3031. function mapCacheClear() {
  3032. this.size = 0;
  3033. this.__data__ = {
  3034. 'hash': new Hash,
  3035. 'map': new (Map || ListCache),
  3036. 'string': new Hash
  3037. };
  3038. }
  3039. /**
  3040. * Removes `key` and its value from the map.
  3041. *
  3042. * @private
  3043. * @name delete
  3044. * @memberOf MapCache
  3045. * @param {string} key The key of the value to remove.
  3046. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3047. */
  3048. function mapCacheDelete(key) {
  3049. var result = getMapData(this, key)['delete'](key);
  3050. this.size -= result ? 1 : 0;
  3051. return result;
  3052. }
  3053. /**
  3054. * Gets the map value for `key`.
  3055. *
  3056. * @private
  3057. * @name get
  3058. * @memberOf MapCache
  3059. * @param {string} key The key of the value to get.
  3060. * @returns {*} Returns the entry value.
  3061. */
  3062. function mapCacheGet(key) {
  3063. return getMapData(this, key).get(key);
  3064. }
  3065. /**
  3066. * Checks if a map value for `key` exists.
  3067. *
  3068. * @private
  3069. * @name has
  3070. * @memberOf MapCache
  3071. * @param {string} key The key of the entry to check.
  3072. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3073. */
  3074. function mapCacheHas(key) {
  3075. return getMapData(this, key).has(key);
  3076. }
  3077. /**
  3078. * Sets the map `key` to `value`.
  3079. *
  3080. * @private
  3081. * @name set
  3082. * @memberOf MapCache
  3083. * @param {string} key The key of the value to set.
  3084. * @param {*} value The value to set.
  3085. * @returns {Object} Returns the map cache instance.
  3086. */
  3087. function mapCacheSet(key, value) {
  3088. var data = getMapData(this, key),
  3089. size = data.size;
  3090. data.set(key, value);
  3091. this.size += data.size == size ? 0 : 1;
  3092. return this;
  3093. }
  3094. // Add methods to `MapCache`.
  3095. MapCache.prototype.clear = mapCacheClear;
  3096. MapCache.prototype['delete'] = mapCacheDelete;
  3097. MapCache.prototype.get = mapCacheGet;
  3098. MapCache.prototype.has = mapCacheHas;
  3099. MapCache.prototype.set = mapCacheSet;
  3100. /*------------------------------------------------------------------------*/
  3101. /**
  3102. *
  3103. * Creates an array cache object to store unique values.
  3104. *
  3105. * @private
  3106. * @constructor
  3107. * @param {Array} [values] The values to cache.
  3108. */
  3109. function SetCache(values) {
  3110. var index = -1,
  3111. length = values == null ? 0 : values.length;
  3112. this.__data__ = new MapCache;
  3113. while (++index < length) {
  3114. this.add(values[index]);
  3115. }
  3116. }
  3117. /**
  3118. * Adds `value` to the array cache.
  3119. *
  3120. * @private
  3121. * @name add
  3122. * @memberOf SetCache
  3123. * @alias push
  3124. * @param {*} value The value to cache.
  3125. * @returns {Object} Returns the cache instance.
  3126. */
  3127. function setCacheAdd(value) {
  3128. this.__data__.set(value, HASH_UNDEFINED);
  3129. return this;
  3130. }
  3131. /**
  3132. * Checks if `value` is in the array cache.
  3133. *
  3134. * @private
  3135. * @name has
  3136. * @memberOf SetCache
  3137. * @param {*} value The value to search for.
  3138. * @returns {number} Returns `true` if `value` is found, else `false`.
  3139. */
  3140. function setCacheHas(value) {
  3141. return this.__data__.has(value);
  3142. }
  3143. // Add methods to `SetCache`.
  3144. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3145. SetCache.prototype.has = setCacheHas;
  3146. /*------------------------------------------------------------------------*/
  3147. /**
  3148. * Creates a stack cache object to store key-value pairs.
  3149. *
  3150. * @private
  3151. * @constructor
  3152. * @param {Array} [entries] The key-value pairs to cache.
  3153. */
  3154. function Stack(entries) {
  3155. var data = this.__data__ = new ListCache(entries);
  3156. this.size = data.size;
  3157. }
  3158. /**
  3159. * Removes all key-value entries from the stack.
  3160. *
  3161. * @private
  3162. * @name clear
  3163. * @memberOf Stack
  3164. */
  3165. function stackClear() {
  3166. this.__data__ = new ListCache;
  3167. this.size = 0;
  3168. }
  3169. /**
  3170. * Removes `key` and its value from the stack.
  3171. *
  3172. * @private
  3173. * @name delete
  3174. * @memberOf Stack
  3175. * @param {string} key The key of the value to remove.
  3176. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3177. */
  3178. function stackDelete(key) {
  3179. var data = this.__data__,
  3180. result = data['delete'](key);
  3181. this.size = data.size;
  3182. return result;
  3183. }
  3184. /**
  3185. * Gets the stack value for `key`.
  3186. *
  3187. * @private
  3188. * @name get
  3189. * @memberOf Stack
  3190. * @param {string} key The key of the value to get.
  3191. * @returns {*} Returns the entry value.
  3192. */
  3193. function stackGet(key) {
  3194. return this.__data__.get(key);
  3195. }
  3196. /**
  3197. * Checks if a stack value for `key` exists.
  3198. *
  3199. * @private
  3200. * @name has
  3201. * @memberOf Stack
  3202. * @param {string} key The key of the entry to check.
  3203. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3204. */
  3205. function stackHas(key) {
  3206. return this.__data__.has(key);
  3207. }
  3208. /**
  3209. * Sets the stack `key` to `value`.
  3210. *
  3211. * @private
  3212. * @name set
  3213. * @memberOf Stack
  3214. * @param {string} key The key of the value to set.
  3215. * @param {*} value The value to set.
  3216. * @returns {Object} Returns the stack cache instance.
  3217. */
  3218. function stackSet(key, value) {
  3219. var data = this.__data__;
  3220. if (data instanceof ListCache) {
  3221. var pairs = data.__data__;
  3222. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3223. pairs.push([key, value]);
  3224. this.size = ++data.size;
  3225. return this;
  3226. }
  3227. data = this.__data__ = new MapCache(pairs);
  3228. }
  3229. data.set(key, value);
  3230. this.size = data.size;
  3231. return this;
  3232. }
  3233. // Add methods to `Stack`.
  3234. Stack.prototype.clear = stackClear;
  3235. Stack.prototype['delete'] = stackDelete;
  3236. Stack.prototype.get = stackGet;
  3237. Stack.prototype.has = stackHas;
  3238. Stack.prototype.set = stackSet;
  3239. /*------------------------------------------------------------------------*/
  3240. /**
  3241. * Creates an array of the enumerable property names of the array-like `value`.
  3242. *
  3243. * @private
  3244. * @param {*} value The value to query.
  3245. * @param {boolean} inherited Specify returning inherited property names.
  3246. * @returns {Array} Returns the array of property names.
  3247. */
  3248. function arrayLikeKeys(value, inherited) {
  3249. var isArr = isArray(value),
  3250. isArg = !isArr && isArguments(value),
  3251. isBuff = !isArr && !isArg && isBuffer(value),
  3252. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3253. skipIndexes = isArr || isArg || isBuff || isType,
  3254. result = skipIndexes ? baseTimes(value.length, String) : [],
  3255. length = result.length;
  3256. for (var key in value) {
  3257. if ((inherited || hasOwnProperty.call(value, key)) &&
  3258. !(skipIndexes && (
  3259. // Safari 9 has enumerable `arguments.length` in strict mode.
  3260. key == 'length' ||
  3261. // Node.js 0.10 has enumerable non-index properties on buffers.
  3262. (isBuff && (key == 'offset' || key == 'parent')) ||
  3263. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3264. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3265. // Skip index properties.
  3266. isIndex(key, length)
  3267. ))) {
  3268. result.push(key);
  3269. }
  3270. }
  3271. return result;
  3272. }
  3273. /**
  3274. * A specialized version of `_.sample` for arrays.
  3275. *
  3276. * @private
  3277. * @param {Array} array The array to sample.
  3278. * @returns {*} Returns the random element.
  3279. */
  3280. function arraySample(array) {
  3281. var length = array.length;
  3282. return length ? array[baseRandom(0, length - 1)] : undefined;
  3283. }
  3284. /**
  3285. * A specialized version of `_.sampleSize` for arrays.
  3286. *
  3287. * @private
  3288. * @param {Array} array The array to sample.
  3289. * @param {number} n The number of elements to sample.
  3290. * @returns {Array} Returns the random elements.
  3291. */
  3292. function arraySampleSize(array, n) {
  3293. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3294. }
  3295. /**
  3296. * A specialized version of `_.shuffle` for arrays.
  3297. *
  3298. * @private
  3299. * @param {Array} array The array to shuffle.
  3300. * @returns {Array} Returns the new shuffled array.
  3301. */
  3302. function arrayShuffle(array) {
  3303. return shuffleSelf(copyArray(array));
  3304. }
  3305. /**
  3306. * This function is like `assignValue` except that it doesn't assign
  3307. * `undefined` values.
  3308. *
  3309. * @private
  3310. * @param {Object} object The object to modify.
  3311. * @param {string} key The key of the property to assign.
  3312. * @param {*} value The value to assign.
  3313. */
  3314. function assignMergeValue(object, key, value) {
  3315. if ((value !== undefined && !eq(object[key], value)) ||
  3316. (value === undefined && !(key in object))) {
  3317. baseAssignValue(object, key, value);
  3318. }
  3319. }
  3320. /**
  3321. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3322. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3323. * for equality comparisons.
  3324. *
  3325. * @private
  3326. * @param {Object} object The object to modify.
  3327. * @param {string} key The key of the property to assign.
  3328. * @param {*} value The value to assign.
  3329. */
  3330. function assignValue(object, key, value) {
  3331. var objValue = object[key];
  3332. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3333. (value === undefined && !(key in object))) {
  3334. baseAssignValue(object, key, value);
  3335. }
  3336. }
  3337. /**
  3338. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3339. *
  3340. * @private
  3341. * @param {Array} array The array to inspect.
  3342. * @param {*} key The key to search for.
  3343. * @returns {number} Returns the index of the matched value, else `-1`.
  3344. */
  3345. function assocIndexOf(array, key) {
  3346. var length = array.length;
  3347. while (length--) {
  3348. if (eq(array[length][0], key)) {
  3349. return length;
  3350. }
  3351. }
  3352. return -1;
  3353. }
  3354. /**
  3355. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3356. * by `iteratee` and values set by `setter`.
  3357. *
  3358. * @private
  3359. * @param {Array|Object} collection The collection to iterate over.
  3360. * @param {Function} setter The function to set `accumulator` values.
  3361. * @param {Function} iteratee The iteratee to transform keys.
  3362. * @param {Object} accumulator The initial aggregated object.
  3363. * @returns {Function} Returns `accumulator`.
  3364. */
  3365. function baseAggregator(collection, setter, iteratee, accumulator) {
  3366. baseEach(collection, function(value, key, collection) {
  3367. setter(accumulator, value, iteratee(value), collection);
  3368. });
  3369. return accumulator;
  3370. }
  3371. /**
  3372. * The base implementation of `_.assign` without support for multiple sources
  3373. * or `customizer` functions.
  3374. *
  3375. * @private
  3376. * @param {Object} object The destination object.
  3377. * @param {Object} source The source object.
  3378. * @returns {Object} Returns `object`.
  3379. */
  3380. function baseAssign(object, source) {
  3381. return object && copyObject(source, keys(source), object);
  3382. }
  3383. /**
  3384. * The base implementation of `_.assignIn` without support for multiple sources
  3385. * or `customizer` functions.
  3386. *
  3387. * @private
  3388. * @param {Object} object The destination object.
  3389. * @param {Object} source The source object.
  3390. * @returns {Object} Returns `object`.
  3391. */
  3392. function baseAssignIn(object, source) {
  3393. return object && copyObject(source, keysIn(source), object);
  3394. }
  3395. /**
  3396. * The base implementation of `assignValue` and `assignMergeValue` without
  3397. * value checks.
  3398. *
  3399. * @private
  3400. * @param {Object} object The object to modify.
  3401. * @param {string} key The key of the property to assign.
  3402. * @param {*} value The value to assign.
  3403. */
  3404. function baseAssignValue(object, key, value) {
  3405. if (key == '__proto__' && defineProperty) {
  3406. defineProperty(object, key, {
  3407. 'configurable': true,
  3408. 'enumerable': true,
  3409. 'value': value,
  3410. 'writable': true
  3411. });
  3412. } else {
  3413. object[key] = value;
  3414. }
  3415. }
  3416. /**
  3417. * The base implementation of `_.at` without support for individual paths.
  3418. *
  3419. * @private
  3420. * @param {Object} object The object to iterate over.
  3421. * @param {string[]} paths The property paths to pick.
  3422. * @returns {Array} Returns the picked elements.
  3423. */
  3424. function baseAt(object, paths) {
  3425. var index = -1,
  3426. length = paths.length,
  3427. result = Array(length),
  3428. skip = object == null;
  3429. while (++index < length) {
  3430. result[index] = skip ? undefined : get(object, paths[index]);
  3431. }
  3432. return result;
  3433. }
  3434. /**
  3435. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3436. *
  3437. * @private
  3438. * @param {number} number The number to clamp.
  3439. * @param {number} [lower] The lower bound.
  3440. * @param {number} upper The upper bound.
  3441. * @returns {number} Returns the clamped number.
  3442. */
  3443. function baseClamp(number, lower, upper) {
  3444. if (number === number) {
  3445. if (upper !== undefined) {
  3446. number = number <= upper ? number : upper;
  3447. }
  3448. if (lower !== undefined) {
  3449. number = number >= lower ? number : lower;
  3450. }
  3451. }
  3452. return number;
  3453. }
  3454. /**
  3455. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3456. * traversed objects.
  3457. *
  3458. * @private
  3459. * @param {*} value The value to clone.
  3460. * @param {boolean} bitmask The bitmask flags.
  3461. * 1 - Deep clone
  3462. * 2 - Flatten inherited properties
  3463. * 4 - Clone symbols
  3464. * @param {Function} [customizer] The function to customize cloning.
  3465. * @param {string} [key] The key of `value`.
  3466. * @param {Object} [object] The parent object of `value`.
  3467. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3468. * @returns {*} Returns the cloned value.
  3469. */
  3470. function baseClone(value, bitmask, customizer, key, object, stack) {
  3471. var result,
  3472. isDeep = bitmask & CLONE_DEEP_FLAG,
  3473. isFlat = bitmask & CLONE_FLAT_FLAG,
  3474. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3475. if (customizer) {
  3476. result = object ? customizer(value, key, object, stack) : customizer(value);
  3477. }
  3478. if (result !== undefined) {
  3479. return result;
  3480. }
  3481. if (!isObject(value)) {
  3482. return value;
  3483. }
  3484. var isArr = isArray(value);
  3485. if (isArr) {
  3486. result = initCloneArray(value);
  3487. if (!isDeep) {
  3488. return copyArray(value, result);
  3489. }
  3490. } else {
  3491. var tag = getTag(value),
  3492. isFunc = tag == funcTag || tag == genTag;
  3493. if (isBuffer(value)) {
  3494. return cloneBuffer(value, isDeep);
  3495. }
  3496. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3497. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3498. if (!isDeep) {
  3499. return isFlat
  3500. ? copySymbolsIn(value, baseAssignIn(result, value))
  3501. : copySymbols(value, baseAssign(result, value));
  3502. }
  3503. } else {
  3504. if (!cloneableTags[tag]) {
  3505. return object ? value : {};
  3506. }
  3507. result = initCloneByTag(value, tag, isDeep);
  3508. }
  3509. }
  3510. // Check for circular references and return its corresponding clone.
  3511. stack || (stack = new Stack);
  3512. var stacked = stack.get(value);
  3513. if (stacked) {
  3514. return stacked;
  3515. }
  3516. stack.set(value, result);
  3517. if (isSet(value)) {
  3518. value.forEach(function(subValue) {
  3519. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3520. });
  3521. } else if (isMap(value)) {
  3522. value.forEach(function(subValue, key) {
  3523. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3524. });
  3525. }
  3526. var keysFunc = isFull
  3527. ? (isFlat ? getAllKeysIn : getAllKeys)
  3528. : (isFlat ? keysIn : keys);
  3529. var props = isArr ? undefined : keysFunc(value);
  3530. arrayEach(props || value, function(subValue, key) {
  3531. if (props) {
  3532. key = subValue;
  3533. subValue = value[key];
  3534. }
  3535. // Recursively populate clone (susceptible to call stack limits).
  3536. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3537. });
  3538. return result;
  3539. }
  3540. /**
  3541. * The base implementation of `_.conforms` which doesn't clone `source`.
  3542. *
  3543. * @private
  3544. * @param {Object} source The object of property predicates to conform to.
  3545. * @returns {Function} Returns the new spec function.
  3546. */
  3547. function baseConforms(source) {
  3548. var props = keys(source);
  3549. return function(object) {
  3550. return baseConformsTo(object, source, props);
  3551. };
  3552. }
  3553. /**
  3554. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3555. *
  3556. * @private
  3557. * @param {Object} object The object to inspect.
  3558. * @param {Object} source The object of property predicates to conform to.
  3559. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3560. */
  3561. function baseConformsTo(object, source, props) {
  3562. var length = props.length;
  3563. if (object == null) {
  3564. return !length;
  3565. }
  3566. object = Object(object);
  3567. while (length--) {
  3568. var key = props[length],
  3569. predicate = source[key],
  3570. value = object[key];
  3571. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3572. return false;
  3573. }
  3574. }
  3575. return true;
  3576. }
  3577. /**
  3578. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3579. * to provide to `func`.
  3580. *
  3581. * @private
  3582. * @param {Function} func The function to delay.
  3583. * @param {number} wait The number of milliseconds to delay invocation.
  3584. * @param {Array} args The arguments to provide to `func`.
  3585. * @returns {number|Object} Returns the timer id or timeout object.
  3586. */
  3587. function baseDelay(func, wait, args) {
  3588. if (typeof func != 'function') {
  3589. throw new TypeError(FUNC_ERROR_TEXT);
  3590. }
  3591. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3592. }
  3593. /**
  3594. * The base implementation of methods like `_.difference` without support
  3595. * for excluding multiple arrays or iteratee shorthands.
  3596. *
  3597. * @private
  3598. * @param {Array} array The array to inspect.
  3599. * @param {Array} values The values to exclude.
  3600. * @param {Function} [iteratee] The iteratee invoked per element.
  3601. * @param {Function} [comparator] The comparator invoked per element.
  3602. * @returns {Array} Returns the new array of filtered values.
  3603. */
  3604. function baseDifference(array, values, iteratee, comparator) {
  3605. var index = -1,
  3606. includes = arrayIncludes,
  3607. isCommon = true,
  3608. length = array.length,
  3609. result = [],
  3610. valuesLength = values.length;
  3611. if (!length) {
  3612. return result;
  3613. }
  3614. if (iteratee) {
  3615. values = arrayMap(values, baseUnary(iteratee));
  3616. }
  3617. if (comparator) {
  3618. includes = arrayIncludesWith;
  3619. isCommon = false;
  3620. }
  3621. else if (values.length >= LARGE_ARRAY_SIZE) {
  3622. includes = cacheHas;
  3623. isCommon = false;
  3624. values = new SetCache(values);
  3625. }
  3626. outer:
  3627. while (++index < length) {
  3628. var value = array[index],
  3629. computed = iteratee == null ? value : iteratee(value);
  3630. value = (comparator || value !== 0) ? value : 0;
  3631. if (isCommon && computed === computed) {
  3632. var valuesIndex = valuesLength;
  3633. while (valuesIndex--) {
  3634. if (values[valuesIndex] === computed) {
  3635. continue outer;
  3636. }
  3637. }
  3638. result.push(value);
  3639. }
  3640. else if (!includes(values, computed, comparator)) {
  3641. result.push(value);
  3642. }
  3643. }
  3644. return result;
  3645. }
  3646. /**
  3647. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3648. *
  3649. * @private
  3650. * @param {Array|Object} collection The collection to iterate over.
  3651. * @param {Function} iteratee The function invoked per iteration.
  3652. * @returns {Array|Object} Returns `collection`.
  3653. */
  3654. var baseEach = createBaseEach(baseForOwn);
  3655. /**
  3656. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3657. *
  3658. * @private
  3659. * @param {Array|Object} collection The collection to iterate over.
  3660. * @param {Function} iteratee The function invoked per iteration.
  3661. * @returns {Array|Object} Returns `collection`.
  3662. */
  3663. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3664. /**
  3665. * The base implementation of `_.every` without support for iteratee shorthands.
  3666. *
  3667. * @private
  3668. * @param {Array|Object} collection The collection to iterate over.
  3669. * @param {Function} predicate The function invoked per iteration.
  3670. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3671. * else `false`
  3672. */
  3673. function baseEvery(collection, predicate) {
  3674. var result = true;
  3675. baseEach(collection, function(value, index, collection) {
  3676. result = !!predicate(value, index, collection);
  3677. return result;
  3678. });
  3679. return result;
  3680. }
  3681. /**
  3682. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3683. * `comparator` to determine the extremum value.
  3684. *
  3685. * @private
  3686. * @param {Array} array The array to iterate over.
  3687. * @param {Function} iteratee The iteratee invoked per iteration.
  3688. * @param {Function} comparator The comparator used to compare values.
  3689. * @returns {*} Returns the extremum value.
  3690. */
  3691. function baseExtremum(array, iteratee, comparator) {
  3692. var index = -1,
  3693. length = array.length;
  3694. while (++index < length) {
  3695. var value = array[index],
  3696. current = iteratee(value);
  3697. if (current != null && (computed === undefined
  3698. ? (current === current && !isSymbol(current))
  3699. : comparator(current, computed)
  3700. )) {
  3701. var computed = current,
  3702. result = value;
  3703. }
  3704. }
  3705. return result;
  3706. }
  3707. /**
  3708. * The base implementation of `_.fill` without an iteratee call guard.
  3709. *
  3710. * @private
  3711. * @param {Array} array The array to fill.
  3712. * @param {*} value The value to fill `array` with.
  3713. * @param {number} [start=0] The start position.
  3714. * @param {number} [end=array.length] The end position.
  3715. * @returns {Array} Returns `array`.
  3716. */
  3717. function baseFill(array, value, start, end) {
  3718. var length = array.length;
  3719. start = toInteger(start);
  3720. if (start < 0) {
  3721. start = -start > length ? 0 : (length + start);
  3722. }
  3723. end = (end === undefined || end > length) ? length : toInteger(end);
  3724. if (end < 0) {
  3725. end += length;
  3726. }
  3727. end = start > end ? 0 : toLength(end);
  3728. while (start < end) {
  3729. array[start++] = value;
  3730. }
  3731. return array;
  3732. }
  3733. /**
  3734. * The base implementation of `_.filter` without support for iteratee shorthands.
  3735. *
  3736. * @private
  3737. * @param {Array|Object} collection The collection to iterate over.
  3738. * @param {Function} predicate The function invoked per iteration.
  3739. * @returns {Array} Returns the new filtered array.
  3740. */
  3741. function baseFilter(collection, predicate) {
  3742. var result = [];
  3743. baseEach(collection, function(value, index, collection) {
  3744. if (predicate(value, index, collection)) {
  3745. result.push(value);
  3746. }
  3747. });
  3748. return result;
  3749. }
  3750. /**
  3751. * The base implementation of `_.flatten` with support for restricting flattening.
  3752. *
  3753. * @private
  3754. * @param {Array} array The array to flatten.
  3755. * @param {number} depth The maximum recursion depth.
  3756. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3757. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3758. * @param {Array} [result=[]] The initial result value.
  3759. * @returns {Array} Returns the new flattened array.
  3760. */
  3761. function baseFlatten(array, depth, predicate, isStrict, result) {
  3762. var index = -1,
  3763. length = array.length;
  3764. predicate || (predicate = isFlattenable);
  3765. result || (result = []);
  3766. while (++index < length) {
  3767. var value = array[index];
  3768. if (depth > 0 && predicate(value)) {
  3769. if (depth > 1) {
  3770. // Recursively flatten arrays (susceptible to call stack limits).
  3771. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3772. } else {
  3773. arrayPush(result, value);
  3774. }
  3775. } else if (!isStrict) {
  3776. result[result.length] = value;
  3777. }
  3778. }
  3779. return result;
  3780. }
  3781. /**
  3782. * The base implementation of `baseForOwn` which iterates over `object`
  3783. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3784. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3785. *
  3786. * @private
  3787. * @param {Object} object The object to iterate over.
  3788. * @param {Function} iteratee The function invoked per iteration.
  3789. * @param {Function} keysFunc The function to get the keys of `object`.
  3790. * @returns {Object} Returns `object`.
  3791. */
  3792. var baseFor = createBaseFor();
  3793. /**
  3794. * This function is like `baseFor` except that it iterates over properties
  3795. * in the opposite order.
  3796. *
  3797. * @private
  3798. * @param {Object} object The object to iterate over.
  3799. * @param {Function} iteratee The function invoked per iteration.
  3800. * @param {Function} keysFunc The function to get the keys of `object`.
  3801. * @returns {Object} Returns `object`.
  3802. */
  3803. var baseForRight = createBaseFor(true);
  3804. /**
  3805. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3806. *
  3807. * @private
  3808. * @param {Object} object The object to iterate over.
  3809. * @param {Function} iteratee The function invoked per iteration.
  3810. * @returns {Object} Returns `object`.
  3811. */
  3812. function baseForOwn(object, iteratee) {
  3813. return object && baseFor(object, iteratee, keys);
  3814. }
  3815. /**
  3816. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3817. *
  3818. * @private
  3819. * @param {Object} object The object to iterate over.
  3820. * @param {Function} iteratee The function invoked per iteration.
  3821. * @returns {Object} Returns `object`.
  3822. */
  3823. function baseForOwnRight(object, iteratee) {
  3824. return object && baseForRight(object, iteratee, keys);
  3825. }
  3826. /**
  3827. * The base implementation of `_.functions` which creates an array of
  3828. * `object` function property names filtered from `props`.
  3829. *
  3830. * @private
  3831. * @param {Object} object The object to inspect.
  3832. * @param {Array} props The property names to filter.
  3833. * @returns {Array} Returns the function names.
  3834. */
  3835. function baseFunctions(object, props) {
  3836. return arrayFilter(props, function(key) {
  3837. return isFunction(object[key]);
  3838. });
  3839. }
  3840. /**
  3841. * The base implementation of `_.get` without support for default values.
  3842. *
  3843. * @private
  3844. * @param {Object} object The object to query.
  3845. * @param {Array|string} path The path of the property to get.
  3846. * @returns {*} Returns the resolved value.
  3847. */
  3848. function baseGet(object, path) {
  3849. path = castPath(path, object);
  3850. var index = 0,
  3851. length = path.length;
  3852. while (object != null && index < length) {
  3853. object = object[toKey(path[index++])];
  3854. }
  3855. return (index && index == length) ? object : undefined;
  3856. }
  3857. /**
  3858. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3859. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3860. * symbols of `object`.
  3861. *
  3862. * @private
  3863. * @param {Object} object The object to query.
  3864. * @param {Function} keysFunc The function to get the keys of `object`.
  3865. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3866. * @returns {Array} Returns the array of property names and symbols.
  3867. */
  3868. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3869. var result = keysFunc(object);
  3870. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3871. }
  3872. /**
  3873. * The base implementation of `getTag` without fallbacks for buggy environments.
  3874. *
  3875. * @private
  3876. * @param {*} value The value to query.
  3877. * @returns {string} Returns the `toStringTag`.
  3878. */
  3879. function baseGetTag(value) {
  3880. if (value == null) {
  3881. return value === undefined ? undefinedTag : nullTag;
  3882. }
  3883. return (symToStringTag && symToStringTag in Object(value))
  3884. ? getRawTag(value)
  3885. : objectToString(value);
  3886. }
  3887. /**
  3888. * The base implementation of `_.gt` which doesn't coerce arguments.
  3889. *
  3890. * @private
  3891. * @param {*} value The value to compare.
  3892. * @param {*} other The other value to compare.
  3893. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3894. * else `false`.
  3895. */
  3896. function baseGt(value, other) {
  3897. return value > other;
  3898. }
  3899. /**
  3900. * The base implementation of `_.has` without support for deep paths.
  3901. *
  3902. * @private
  3903. * @param {Object} [object] The object to query.
  3904. * @param {Array|string} key The key to check.
  3905. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3906. */
  3907. function baseHas(object, key) {
  3908. return object != null && hasOwnProperty.call(object, key);
  3909. }
  3910. /**
  3911. * The base implementation of `_.hasIn` without support for deep paths.
  3912. *
  3913. * @private
  3914. * @param {Object} [object] The object to query.
  3915. * @param {Array|string} key The key to check.
  3916. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3917. */
  3918. function baseHasIn(object, key) {
  3919. return object != null && key in Object(object);
  3920. }
  3921. /**
  3922. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3923. *
  3924. * @private
  3925. * @param {number} number The number to check.
  3926. * @param {number} start The start of the range.
  3927. * @param {number} end The end of the range.
  3928. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3929. */
  3930. function baseInRange(number, start, end) {
  3931. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3932. }
  3933. /**
  3934. * The base implementation of methods like `_.intersection`, without support
  3935. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3936. *
  3937. * @private
  3938. * @param {Array} arrays The arrays to inspect.
  3939. * @param {Function} [iteratee] The iteratee invoked per element.
  3940. * @param {Function} [comparator] The comparator invoked per element.
  3941. * @returns {Array} Returns the new array of shared values.
  3942. */
  3943. function baseIntersection(arrays, iteratee, comparator) {
  3944. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3945. length = arrays[0].length,
  3946. othLength = arrays.length,
  3947. othIndex = othLength,
  3948. caches = Array(othLength),
  3949. maxLength = Infinity,
  3950. result = [];
  3951. while (othIndex--) {
  3952. var array = arrays[othIndex];
  3953. if (othIndex && iteratee) {
  3954. array = arrayMap(array, baseUnary(iteratee));
  3955. }
  3956. maxLength = nativeMin(array.length, maxLength);
  3957. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  3958. ? new SetCache(othIndex && array)
  3959. : undefined;
  3960. }
  3961. array = arrays[0];
  3962. var index = -1,
  3963. seen = caches[0];
  3964. outer:
  3965. while (++index < length && result.length < maxLength) {
  3966. var value = array[index],
  3967. computed = iteratee ? iteratee(value) : value;
  3968. value = (comparator || value !== 0) ? value : 0;
  3969. if (!(seen
  3970. ? cacheHas(seen, computed)
  3971. : includes(result, computed, comparator)
  3972. )) {
  3973. othIndex = othLength;
  3974. while (--othIndex) {
  3975. var cache = caches[othIndex];
  3976. if (!(cache
  3977. ? cacheHas(cache, computed)
  3978. : includes(arrays[othIndex], computed, comparator))
  3979. ) {
  3980. continue outer;
  3981. }
  3982. }
  3983. if (seen) {
  3984. seen.push(computed);
  3985. }
  3986. result.push(value);
  3987. }
  3988. }
  3989. return result;
  3990. }
  3991. /**
  3992. * The base implementation of `_.invert` and `_.invertBy` which inverts
  3993. * `object` with values transformed by `iteratee` and set by `setter`.
  3994. *
  3995. * @private
  3996. * @param {Object} object The object to iterate over.
  3997. * @param {Function} setter The function to set `accumulator` values.
  3998. * @param {Function} iteratee The iteratee to transform values.
  3999. * @param {Object} accumulator The initial inverted object.
  4000. * @returns {Function} Returns `accumulator`.
  4001. */
  4002. function baseInverter(object, setter, iteratee, accumulator) {
  4003. baseForOwn(object, function(value, key, object) {
  4004. setter(accumulator, iteratee(value), key, object);
  4005. });
  4006. return accumulator;
  4007. }
  4008. /**
  4009. * The base implementation of `_.invoke` without support for individual
  4010. * method arguments.
  4011. *
  4012. * @private
  4013. * @param {Object} object The object to query.
  4014. * @param {Array|string} path The path of the method to invoke.
  4015. * @param {Array} args The arguments to invoke the method with.
  4016. * @returns {*} Returns the result of the invoked method.
  4017. */
  4018. function baseInvoke(object, path, args) {
  4019. path = castPath(path, object);
  4020. object = parent(object, path);
  4021. var func = object == null ? object : object[toKey(last(path))];
  4022. return func == null ? undefined : apply(func, object, args);
  4023. }
  4024. /**
  4025. * The base implementation of `_.isArguments`.
  4026. *
  4027. * @private
  4028. * @param {*} value The value to check.
  4029. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4030. */
  4031. function baseIsArguments(value) {
  4032. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4033. }
  4034. /**
  4035. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4036. *
  4037. * @private
  4038. * @param {*} value The value to check.
  4039. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4040. */
  4041. function baseIsArrayBuffer(value) {
  4042. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4043. }
  4044. /**
  4045. * The base implementation of `_.isDate` without Node.js optimizations.
  4046. *
  4047. * @private
  4048. * @param {*} value The value to check.
  4049. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4050. */
  4051. function baseIsDate(value) {
  4052. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4053. }
  4054. /**
  4055. * The base implementation of `_.isEqual` which supports partial comparisons
  4056. * and tracks traversed objects.
  4057. *
  4058. * @private
  4059. * @param {*} value The value to compare.
  4060. * @param {*} other The other value to compare.
  4061. * @param {boolean} bitmask The bitmask flags.
  4062. * 1 - Unordered comparison
  4063. * 2 - Partial comparison
  4064. * @param {Function} [customizer] The function to customize comparisons.
  4065. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4066. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4067. */
  4068. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4069. if (value === other) {
  4070. return true;
  4071. }
  4072. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4073. return value !== value && other !== other;
  4074. }
  4075. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4076. }
  4077. /**
  4078. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4079. * deep comparisons and tracks traversed objects enabling objects with circular
  4080. * references to be compared.
  4081. *
  4082. * @private
  4083. * @param {Object} object The object to compare.
  4084. * @param {Object} other The other object to compare.
  4085. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4086. * @param {Function} customizer The function to customize comparisons.
  4087. * @param {Function} equalFunc The function to determine equivalents of values.
  4088. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4089. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4090. */
  4091. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4092. var objIsArr = isArray(object),
  4093. othIsArr = isArray(other),
  4094. objTag = objIsArr ? arrayTag : getTag(object),
  4095. othTag = othIsArr ? arrayTag : getTag(other);
  4096. objTag = objTag == argsTag ? objectTag : objTag;
  4097. othTag = othTag == argsTag ? objectTag : othTag;
  4098. var objIsObj = objTag == objectTag,
  4099. othIsObj = othTag == objectTag,
  4100. isSameTag = objTag == othTag;
  4101. if (isSameTag && isBuffer(object)) {
  4102. if (!isBuffer(other)) {
  4103. return false;
  4104. }
  4105. objIsArr = true;
  4106. objIsObj = false;
  4107. }
  4108. if (isSameTag && !objIsObj) {
  4109. stack || (stack = new Stack);
  4110. return (objIsArr || isTypedArray(object))
  4111. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4112. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4113. }
  4114. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4115. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4116. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4117. if (objIsWrapped || othIsWrapped) {
  4118. var objUnwrapped = objIsWrapped ? object.value() : object,
  4119. othUnwrapped = othIsWrapped ? other.value() : other;
  4120. stack || (stack = new Stack);
  4121. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4122. }
  4123. }
  4124. if (!isSameTag) {
  4125. return false;
  4126. }
  4127. stack || (stack = new Stack);
  4128. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4129. }
  4130. /**
  4131. * The base implementation of `_.isMap` without Node.js optimizations.
  4132. *
  4133. * @private
  4134. * @param {*} value The value to check.
  4135. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4136. */
  4137. function baseIsMap(value) {
  4138. return isObjectLike(value) && getTag(value) == mapTag;
  4139. }
  4140. /**
  4141. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4142. *
  4143. * @private
  4144. * @param {Object} object The object to inspect.
  4145. * @param {Object} source The object of property values to match.
  4146. * @param {Array} matchData The property names, values, and compare flags to match.
  4147. * @param {Function} [customizer] The function to customize comparisons.
  4148. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4149. */
  4150. function baseIsMatch(object, source, matchData, customizer) {
  4151. var index = matchData.length,
  4152. length = index,
  4153. noCustomizer = !customizer;
  4154. if (object == null) {
  4155. return !length;
  4156. }
  4157. object = Object(object);
  4158. while (index--) {
  4159. var data = matchData[index];
  4160. if ((noCustomizer && data[2])
  4161. ? data[1] !== object[data[0]]
  4162. : !(data[0] in object)
  4163. ) {
  4164. return false;
  4165. }
  4166. }
  4167. while (++index < length) {
  4168. data = matchData[index];
  4169. var key = data[0],
  4170. objValue = object[key],
  4171. srcValue = data[1];
  4172. if (noCustomizer && data[2]) {
  4173. if (objValue === undefined && !(key in object)) {
  4174. return false;
  4175. }
  4176. } else {
  4177. var stack = new Stack;
  4178. if (customizer) {
  4179. var result = customizer(objValue, srcValue, key, object, source, stack);
  4180. }
  4181. if (!(result === undefined
  4182. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4183. : result
  4184. )) {
  4185. return false;
  4186. }
  4187. }
  4188. }
  4189. return true;
  4190. }
  4191. /**
  4192. * The base implementation of `_.isNative` without bad shim checks.
  4193. *
  4194. * @private
  4195. * @param {*} value The value to check.
  4196. * @returns {boolean} Returns `true` if `value` is a native function,
  4197. * else `false`.
  4198. */
  4199. function baseIsNative(value) {
  4200. if (!isObject(value) || isMasked(value)) {
  4201. return false;
  4202. }
  4203. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4204. return pattern.test(toSource(value));
  4205. }
  4206. /**
  4207. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4208. *
  4209. * @private
  4210. * @param {*} value The value to check.
  4211. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4212. */
  4213. function baseIsRegExp(value) {
  4214. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4215. }
  4216. /**
  4217. * The base implementation of `_.isSet` without Node.js optimizations.
  4218. *
  4219. * @private
  4220. * @param {*} value The value to check.
  4221. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4222. */
  4223. function baseIsSet(value) {
  4224. return isObjectLike(value) && getTag(value) == setTag;
  4225. }
  4226. /**
  4227. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4228. *
  4229. * @private
  4230. * @param {*} value The value to check.
  4231. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4232. */
  4233. function baseIsTypedArray(value) {
  4234. return isObjectLike(value) &&
  4235. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4236. }
  4237. /**
  4238. * The base implementation of `_.iteratee`.
  4239. *
  4240. * @private
  4241. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4242. * @returns {Function} Returns the iteratee.
  4243. */
  4244. function baseIteratee(value) {
  4245. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4246. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4247. if (typeof value == 'function') {
  4248. return value;
  4249. }
  4250. if (value == null) {
  4251. return identity;
  4252. }
  4253. if (typeof value == 'object') {
  4254. return isArray(value)
  4255. ? baseMatchesProperty(value[0], value[1])
  4256. : baseMatches(value);
  4257. }
  4258. return property(value);
  4259. }
  4260. /**
  4261. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4262. *
  4263. * @private
  4264. * @param {Object} object The object to query.
  4265. * @returns {Array} Returns the array of property names.
  4266. */
  4267. function baseKeys(object) {
  4268. if (!isPrototype(object)) {
  4269. return nativeKeys(object);
  4270. }
  4271. var result = [];
  4272. for (var key in Object(object)) {
  4273. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4274. result.push(key);
  4275. }
  4276. }
  4277. return result;
  4278. }
  4279. /**
  4280. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4281. *
  4282. * @private
  4283. * @param {Object} object The object to query.
  4284. * @returns {Array} Returns the array of property names.
  4285. */
  4286. function baseKeysIn(object) {
  4287. if (!isObject(object)) {
  4288. return nativeKeysIn(object);
  4289. }
  4290. var isProto = isPrototype(object),
  4291. result = [];
  4292. for (var key in object) {
  4293. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4294. result.push(key);
  4295. }
  4296. }
  4297. return result;
  4298. }
  4299. /**
  4300. * The base implementation of `_.lt` which doesn't coerce arguments.
  4301. *
  4302. * @private
  4303. * @param {*} value The value to compare.
  4304. * @param {*} other The other value to compare.
  4305. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4306. * else `false`.
  4307. */
  4308. function baseLt(value, other) {
  4309. return value < other;
  4310. }
  4311. /**
  4312. * The base implementation of `_.map` without support for iteratee shorthands.
  4313. *
  4314. * @private
  4315. * @param {Array|Object} collection The collection to iterate over.
  4316. * @param {Function} iteratee The function invoked per iteration.
  4317. * @returns {Array} Returns the new mapped array.
  4318. */
  4319. function baseMap(collection, iteratee) {
  4320. var index = -1,
  4321. result = isArrayLike(collection) ? Array(collection.length) : [];
  4322. baseEach(collection, function(value, key, collection) {
  4323. result[++index] = iteratee(value, key, collection);
  4324. });
  4325. return result;
  4326. }
  4327. /**
  4328. * The base implementation of `_.matches` which doesn't clone `source`.
  4329. *
  4330. * @private
  4331. * @param {Object} source The object of property values to match.
  4332. * @returns {Function} Returns the new spec function.
  4333. */
  4334. function baseMatches(source) {
  4335. var matchData = getMatchData(source);
  4336. if (matchData.length == 1 && matchData[0][2]) {
  4337. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4338. }
  4339. return function(object) {
  4340. return object === source || baseIsMatch(object, source, matchData);
  4341. };
  4342. }
  4343. /**
  4344. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4345. *
  4346. * @private
  4347. * @param {string} path The path of the property to get.
  4348. * @param {*} srcValue The value to match.
  4349. * @returns {Function} Returns the new spec function.
  4350. */
  4351. function baseMatchesProperty(path, srcValue) {
  4352. if (isKey(path) && isStrictComparable(srcValue)) {
  4353. return matchesStrictComparable(toKey(path), srcValue);
  4354. }
  4355. return function(object) {
  4356. var objValue = get(object, path);
  4357. return (objValue === undefined && objValue === srcValue)
  4358. ? hasIn(object, path)
  4359. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4360. };
  4361. }
  4362. /**
  4363. * The base implementation of `_.merge` without support for multiple sources.
  4364. *
  4365. * @private
  4366. * @param {Object} object The destination object.
  4367. * @param {Object} source The source object.
  4368. * @param {number} srcIndex The index of `source`.
  4369. * @param {Function} [customizer] The function to customize merged values.
  4370. * @param {Object} [stack] Tracks traversed source values and their merged
  4371. * counterparts.
  4372. */
  4373. function baseMerge(object, source, srcIndex, customizer, stack) {
  4374. if (object === source) {
  4375. return;
  4376. }
  4377. baseFor(source, function(srcValue, key) {
  4378. stack || (stack = new Stack);
  4379. if (isObject(srcValue)) {
  4380. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4381. }
  4382. else {
  4383. var newValue = customizer
  4384. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4385. : undefined;
  4386. if (newValue === undefined) {
  4387. newValue = srcValue;
  4388. }
  4389. assignMergeValue(object, key, newValue);
  4390. }
  4391. }, keysIn);
  4392. }
  4393. /**
  4394. * A specialized version of `baseMerge` for arrays and objects which performs
  4395. * deep merges and tracks traversed objects enabling objects with circular
  4396. * references to be merged.
  4397. *
  4398. * @private
  4399. * @param {Object} object The destination object.
  4400. * @param {Object} source The source object.
  4401. * @param {string} key The key of the value to merge.
  4402. * @param {number} srcIndex The index of `source`.
  4403. * @param {Function} mergeFunc The function to merge values.
  4404. * @param {Function} [customizer] The function to customize assigned values.
  4405. * @param {Object} [stack] Tracks traversed source values and their merged
  4406. * counterparts.
  4407. */
  4408. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4409. var objValue = safeGet(object, key),
  4410. srcValue = safeGet(source, key),
  4411. stacked = stack.get(srcValue);
  4412. if (stacked) {
  4413. assignMergeValue(object, key, stacked);
  4414. return;
  4415. }
  4416. var newValue = customizer
  4417. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4418. : undefined;
  4419. var isCommon = newValue === undefined;
  4420. if (isCommon) {
  4421. var isArr = isArray(srcValue),
  4422. isBuff = !isArr && isBuffer(srcValue),
  4423. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4424. newValue = srcValue;
  4425. if (isArr || isBuff || isTyped) {
  4426. if (isArray(objValue)) {
  4427. newValue = objValue;
  4428. }
  4429. else if (isArrayLikeObject(objValue)) {
  4430. newValue = copyArray(objValue);
  4431. }
  4432. else if (isBuff) {
  4433. isCommon = false;
  4434. newValue = cloneBuffer(srcValue, true);
  4435. }
  4436. else if (isTyped) {
  4437. isCommon = false;
  4438. newValue = cloneTypedArray(srcValue, true);
  4439. }
  4440. else {
  4441. newValue = [];
  4442. }
  4443. }
  4444. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4445. newValue = objValue;
  4446. if (isArguments(objValue)) {
  4447. newValue = toPlainObject(objValue);
  4448. }
  4449. else if (!isObject(objValue) || isFunction(objValue)) {
  4450. newValue = initCloneObject(srcValue);
  4451. }
  4452. }
  4453. else {
  4454. isCommon = false;
  4455. }
  4456. }
  4457. if (isCommon) {
  4458. // Recursively merge objects and arrays (susceptible to call stack limits).
  4459. stack.set(srcValue, newValue);
  4460. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4461. stack['delete'](srcValue);
  4462. }
  4463. assignMergeValue(object, key, newValue);
  4464. }
  4465. /**
  4466. * The base implementation of `_.nth` which doesn't coerce arguments.
  4467. *
  4468. * @private
  4469. * @param {Array} array The array to query.
  4470. * @param {number} n The index of the element to return.
  4471. * @returns {*} Returns the nth element of `array`.
  4472. */
  4473. function baseNth(array, n) {
  4474. var length = array.length;
  4475. if (!length) {
  4476. return;
  4477. }
  4478. n += n < 0 ? length : 0;
  4479. return isIndex(n, length) ? array[n] : undefined;
  4480. }
  4481. /**
  4482. * The base implementation of `_.orderBy` without param guards.
  4483. *
  4484. * @private
  4485. * @param {Array|Object} collection The collection to iterate over.
  4486. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4487. * @param {string[]} orders The sort orders of `iteratees`.
  4488. * @returns {Array} Returns the new sorted array.
  4489. */
  4490. function baseOrderBy(collection, iteratees, orders) {
  4491. if (iteratees.length) {
  4492. iteratees = arrayMap(iteratees, function(iteratee) {
  4493. if (isArray(iteratee)) {
  4494. return function(value) {
  4495. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4496. }
  4497. }
  4498. return iteratee;
  4499. });
  4500. } else {
  4501. iteratees = [identity];
  4502. }
  4503. var index = -1;
  4504. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4505. var result = baseMap(collection, function(value, key, collection) {
  4506. var criteria = arrayMap(iteratees, function(iteratee) {
  4507. return iteratee(value);
  4508. });
  4509. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4510. });
  4511. return baseSortBy(result, function(object, other) {
  4512. return compareMultiple(object, other, orders);
  4513. });
  4514. }
  4515. /**
  4516. * The base implementation of `_.pick` without support for individual
  4517. * property identifiers.
  4518. *
  4519. * @private
  4520. * @param {Object} object The source object.
  4521. * @param {string[]} paths The property paths to pick.
  4522. * @returns {Object} Returns the new object.
  4523. */
  4524. function basePick(object, paths) {
  4525. return basePickBy(object, paths, function(value, path) {
  4526. return hasIn(object, path);
  4527. });
  4528. }
  4529. /**
  4530. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4531. *
  4532. * @private
  4533. * @param {Object} object The source object.
  4534. * @param {string[]} paths The property paths to pick.
  4535. * @param {Function} predicate The function invoked per property.
  4536. * @returns {Object} Returns the new object.
  4537. */
  4538. function basePickBy(object, paths, predicate) {
  4539. var index = -1,
  4540. length = paths.length,
  4541. result = {};
  4542. while (++index < length) {
  4543. var path = paths[index],
  4544. value = baseGet(object, path);
  4545. if (predicate(value, path)) {
  4546. baseSet(result, castPath(path, object), value);
  4547. }
  4548. }
  4549. return result;
  4550. }
  4551. /**
  4552. * A specialized version of `baseProperty` which supports deep paths.
  4553. *
  4554. * @private
  4555. * @param {Array|string} path The path of the property to get.
  4556. * @returns {Function} Returns the new accessor function.
  4557. */
  4558. function basePropertyDeep(path) {
  4559. return function(object) {
  4560. return baseGet(object, path);
  4561. };
  4562. }
  4563. /**
  4564. * The base implementation of `_.pullAllBy` without support for iteratee
  4565. * shorthands.
  4566. *
  4567. * @private
  4568. * @param {Array} array The array to modify.
  4569. * @param {Array} values The values to remove.
  4570. * @param {Function} [iteratee] The iteratee invoked per element.
  4571. * @param {Function} [comparator] The comparator invoked per element.
  4572. * @returns {Array} Returns `array`.
  4573. */
  4574. function basePullAll(array, values, iteratee, comparator) {
  4575. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4576. index = -1,
  4577. length = values.length,
  4578. seen = array;
  4579. if (array === values) {
  4580. values = copyArray(values);
  4581. }
  4582. if (iteratee) {
  4583. seen = arrayMap(array, baseUnary(iteratee));
  4584. }
  4585. while (++index < length) {
  4586. var fromIndex = 0,
  4587. value = values[index],
  4588. computed = iteratee ? iteratee(value) : value;
  4589. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4590. if (seen !== array) {
  4591. splice.call(seen, fromIndex, 1);
  4592. }
  4593. splice.call(array, fromIndex, 1);
  4594. }
  4595. }
  4596. return array;
  4597. }
  4598. /**
  4599. * The base implementation of `_.pullAt` without support for individual
  4600. * indexes or capturing the removed elements.
  4601. *
  4602. * @private
  4603. * @param {Array} array The array to modify.
  4604. * @param {number[]} indexes The indexes of elements to remove.
  4605. * @returns {Array} Returns `array`.
  4606. */
  4607. function basePullAt(array, indexes) {
  4608. var length = array ? indexes.length : 0,
  4609. lastIndex = length - 1;
  4610. while (length--) {
  4611. var index = indexes[length];
  4612. if (length == lastIndex || index !== previous) {
  4613. var previous = index;
  4614. if (isIndex(index)) {
  4615. splice.call(array, index, 1);
  4616. } else {
  4617. baseUnset(array, index);
  4618. }
  4619. }
  4620. }
  4621. return array;
  4622. }
  4623. /**
  4624. * The base implementation of `_.random` without support for returning
  4625. * floating-point numbers.
  4626. *
  4627. * @private
  4628. * @param {number} lower The lower bound.
  4629. * @param {number} upper The upper bound.
  4630. * @returns {number} Returns the random number.
  4631. */
  4632. function baseRandom(lower, upper) {
  4633. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4634. }
  4635. /**
  4636. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4637. * coerce arguments.
  4638. *
  4639. * @private
  4640. * @param {number} start The start of the range.
  4641. * @param {number} end The end of the range.
  4642. * @param {number} step The value to increment or decrement by.
  4643. * @param {boolean} [fromRight] Specify iterating from right to left.
  4644. * @returns {Array} Returns the range of numbers.
  4645. */
  4646. function baseRange(start, end, step, fromRight) {
  4647. var index = -1,
  4648. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4649. result = Array(length);
  4650. while (length--) {
  4651. result[fromRight ? length : ++index] = start;
  4652. start += step;
  4653. }
  4654. return result;
  4655. }
  4656. /**
  4657. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4658. *
  4659. * @private
  4660. * @param {string} string The string to repeat.
  4661. * @param {number} n The number of times to repeat the string.
  4662. * @returns {string} Returns the repeated string.
  4663. */
  4664. function baseRepeat(string, n) {
  4665. var result = '';
  4666. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4667. return result;
  4668. }
  4669. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4670. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4671. do {
  4672. if (n % 2) {
  4673. result += string;
  4674. }
  4675. n = nativeFloor(n / 2);
  4676. if (n) {
  4677. string += string;
  4678. }
  4679. } while (n);
  4680. return result;
  4681. }
  4682. /**
  4683. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4684. *
  4685. * @private
  4686. * @param {Function} func The function to apply a rest parameter to.
  4687. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4688. * @returns {Function} Returns the new function.
  4689. */
  4690. function baseRest(func, start) {
  4691. return setToString(overRest(func, start, identity), func + '');
  4692. }
  4693. /**
  4694. * The base implementation of `_.sample`.
  4695. *
  4696. * @private
  4697. * @param {Array|Object} collection The collection to sample.
  4698. * @returns {*} Returns the random element.
  4699. */
  4700. function baseSample(collection) {
  4701. return arraySample(values(collection));
  4702. }
  4703. /**
  4704. * The base implementation of `_.sampleSize` without param guards.
  4705. *
  4706. * @private
  4707. * @param {Array|Object} collection The collection to sample.
  4708. * @param {number} n The number of elements to sample.
  4709. * @returns {Array} Returns the random elements.
  4710. */
  4711. function baseSampleSize(collection, n) {
  4712. var array = values(collection);
  4713. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4714. }
  4715. /**
  4716. * The base implementation of `_.set`.
  4717. *
  4718. * @private
  4719. * @param {Object} object The object to modify.
  4720. * @param {Array|string} path The path of the property to set.
  4721. * @param {*} value The value to set.
  4722. * @param {Function} [customizer] The function to customize path creation.
  4723. * @returns {Object} Returns `object`.
  4724. */
  4725. function baseSet(object, path, value, customizer) {
  4726. if (!isObject(object)) {
  4727. return object;
  4728. }
  4729. path = castPath(path, object);
  4730. var index = -1,
  4731. length = path.length,
  4732. lastIndex = length - 1,
  4733. nested = object;
  4734. while (nested != null && ++index < length) {
  4735. var key = toKey(path[index]),
  4736. newValue = value;
  4737. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4738. return object;
  4739. }
  4740. if (index != lastIndex) {
  4741. var objValue = nested[key];
  4742. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4743. if (newValue === undefined) {
  4744. newValue = isObject(objValue)
  4745. ? objValue
  4746. : (isIndex(path[index + 1]) ? [] : {});
  4747. }
  4748. }
  4749. assignValue(nested, key, newValue);
  4750. nested = nested[key];
  4751. }
  4752. return object;
  4753. }
  4754. /**
  4755. * The base implementation of `setData` without support for hot loop shorting.
  4756. *
  4757. * @private
  4758. * @param {Function} func The function to associate metadata with.
  4759. * @param {*} data The metadata.
  4760. * @returns {Function} Returns `func`.
  4761. */
  4762. var baseSetData = !metaMap ? identity : function(func, data) {
  4763. metaMap.set(func, data);
  4764. return func;
  4765. };
  4766. /**
  4767. * The base implementation of `setToString` without support for hot loop shorting.
  4768. *
  4769. * @private
  4770. * @param {Function} func The function to modify.
  4771. * @param {Function} string The `toString` result.
  4772. * @returns {Function} Returns `func`.
  4773. */
  4774. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4775. return defineProperty(func, 'toString', {
  4776. 'configurable': true,
  4777. 'enumerable': false,
  4778. 'value': constant(string),
  4779. 'writable': true
  4780. });
  4781. };
  4782. /**
  4783. * The base implementation of `_.shuffle`.
  4784. *
  4785. * @private
  4786. * @param {Array|Object} collection The collection to shuffle.
  4787. * @returns {Array} Returns the new shuffled array.
  4788. */
  4789. function baseShuffle(collection) {
  4790. return shuffleSelf(values(collection));
  4791. }
  4792. /**
  4793. * The base implementation of `_.slice` without an iteratee call guard.
  4794. *
  4795. * @private
  4796. * @param {Array} array The array to slice.
  4797. * @param {number} [start=0] The start position.
  4798. * @param {number} [end=array.length] The end position.
  4799. * @returns {Array} Returns the slice of `array`.
  4800. */
  4801. function baseSlice(array, start, end) {
  4802. var index = -1,
  4803. length = array.length;
  4804. if (start < 0) {
  4805. start = -start > length ? 0 : (length + start);
  4806. }
  4807. end = end > length ? length : end;
  4808. if (end < 0) {
  4809. end += length;
  4810. }
  4811. length = start > end ? 0 : ((end - start) >>> 0);
  4812. start >>>= 0;
  4813. var result = Array(length);
  4814. while (++index < length) {
  4815. result[index] = array[index + start];
  4816. }
  4817. return result;
  4818. }
  4819. /**
  4820. * The base implementation of `_.some` without support for iteratee shorthands.
  4821. *
  4822. * @private
  4823. * @param {Array|Object} collection The collection to iterate over.
  4824. * @param {Function} predicate The function invoked per iteration.
  4825. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4826. * else `false`.
  4827. */
  4828. function baseSome(collection, predicate) {
  4829. var result;
  4830. baseEach(collection, function(value, index, collection) {
  4831. result = predicate(value, index, collection);
  4832. return !result;
  4833. });
  4834. return !!result;
  4835. }
  4836. /**
  4837. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4838. * performs a binary search of `array` to determine the index at which `value`
  4839. * should be inserted into `array` in order to maintain its sort order.
  4840. *
  4841. * @private
  4842. * @param {Array} array The sorted array to inspect.
  4843. * @param {*} value The value to evaluate.
  4844. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4845. * @returns {number} Returns the index at which `value` should be inserted
  4846. * into `array`.
  4847. */
  4848. function baseSortedIndex(array, value, retHighest) {
  4849. var low = 0,
  4850. high = array == null ? low : array.length;
  4851. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4852. while (low < high) {
  4853. var mid = (low + high) >>> 1,
  4854. computed = array[mid];
  4855. if (computed !== null && !isSymbol(computed) &&
  4856. (retHighest ? (computed <= value) : (computed < value))) {
  4857. low = mid + 1;
  4858. } else {
  4859. high = mid;
  4860. }
  4861. }
  4862. return high;
  4863. }
  4864. return baseSortedIndexBy(array, value, identity, retHighest);
  4865. }
  4866. /**
  4867. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4868. * which invokes `iteratee` for `value` and each element of `array` to compute
  4869. * their sort ranking. The iteratee is invoked with one argument; (value).
  4870. *
  4871. * @private
  4872. * @param {Array} array The sorted array to inspect.
  4873. * @param {*} value The value to evaluate.
  4874. * @param {Function} iteratee The iteratee invoked per element.
  4875. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4876. * @returns {number} Returns the index at which `value` should be inserted
  4877. * into `array`.
  4878. */
  4879. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4880. var low = 0,
  4881. high = array == null ? 0 : array.length;
  4882. if (high === 0) {
  4883. return 0;
  4884. }
  4885. value = iteratee(value);
  4886. var valIsNaN = value !== value,
  4887. valIsNull = value === null,
  4888. valIsSymbol = isSymbol(value),
  4889. valIsUndefined = value === undefined;
  4890. while (low < high) {
  4891. var mid = nativeFloor((low + high) / 2),
  4892. computed = iteratee(array[mid]),
  4893. othIsDefined = computed !== undefined,
  4894. othIsNull = computed === null,
  4895. othIsReflexive = computed === computed,
  4896. othIsSymbol = isSymbol(computed);
  4897. if (valIsNaN) {
  4898. var setLow = retHighest || othIsReflexive;
  4899. } else if (valIsUndefined) {
  4900. setLow = othIsReflexive && (retHighest || othIsDefined);
  4901. } else if (valIsNull) {
  4902. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4903. } else if (valIsSymbol) {
  4904. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4905. } else if (othIsNull || othIsSymbol) {
  4906. setLow = false;
  4907. } else {
  4908. setLow = retHighest ? (computed <= value) : (computed < value);
  4909. }
  4910. if (setLow) {
  4911. low = mid + 1;
  4912. } else {
  4913. high = mid;
  4914. }
  4915. }
  4916. return nativeMin(high, MAX_ARRAY_INDEX);
  4917. }
  4918. /**
  4919. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4920. * support for iteratee shorthands.
  4921. *
  4922. * @private
  4923. * @param {Array} array The array to inspect.
  4924. * @param {Function} [iteratee] The iteratee invoked per element.
  4925. * @returns {Array} Returns the new duplicate free array.
  4926. */
  4927. function baseSortedUniq(array, iteratee) {
  4928. var index = -1,
  4929. length = array.length,
  4930. resIndex = 0,
  4931. result = [];
  4932. while (++index < length) {
  4933. var value = array[index],
  4934. computed = iteratee ? iteratee(value) : value;
  4935. if (!index || !eq(computed, seen)) {
  4936. var seen = computed;
  4937. result[resIndex++] = value === 0 ? 0 : value;
  4938. }
  4939. }
  4940. return result;
  4941. }
  4942. /**
  4943. * The base implementation of `_.toNumber` which doesn't ensure correct
  4944. * conversions of binary, hexadecimal, or octal string values.
  4945. *
  4946. * @private
  4947. * @param {*} value The value to process.
  4948. * @returns {number} Returns the number.
  4949. */
  4950. function baseToNumber(value) {
  4951. if (typeof value == 'number') {
  4952. return value;
  4953. }
  4954. if (isSymbol(value)) {
  4955. return NAN;
  4956. }
  4957. return +value;
  4958. }
  4959. /**
  4960. * The base implementation of `_.toString` which doesn't convert nullish
  4961. * values to empty strings.
  4962. *
  4963. * @private
  4964. * @param {*} value The value to process.
  4965. * @returns {string} Returns the string.
  4966. */
  4967. function baseToString(value) {
  4968. // Exit early for strings to avoid a performance hit in some environments.
  4969. if (typeof value == 'string') {
  4970. return value;
  4971. }
  4972. if (isArray(value)) {
  4973. // Recursively convert values (susceptible to call stack limits).
  4974. return arrayMap(value, baseToString) + '';
  4975. }
  4976. if (isSymbol(value)) {
  4977. return symbolToString ? symbolToString.call(value) : '';
  4978. }
  4979. var result = (value + '');
  4980. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  4981. }
  4982. /**
  4983. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  4984. *
  4985. * @private
  4986. * @param {Array} array The array to inspect.
  4987. * @param {Function} [iteratee] The iteratee invoked per element.
  4988. * @param {Function} [comparator] The comparator invoked per element.
  4989. * @returns {Array} Returns the new duplicate free array.
  4990. */
  4991. function baseUniq(array, iteratee, comparator) {
  4992. var index = -1,
  4993. includes = arrayIncludes,
  4994. length = array.length,
  4995. isCommon = true,
  4996. result = [],
  4997. seen = result;
  4998. if (comparator) {
  4999. isCommon = false;
  5000. includes = arrayIncludesWith;
  5001. }
  5002. else if (length >= LARGE_ARRAY_SIZE) {
  5003. var set = iteratee ? null : createSet(array);
  5004. if (set) {
  5005. return setToArray(set);
  5006. }
  5007. isCommon = false;
  5008. includes = cacheHas;
  5009. seen = new SetCache;
  5010. }
  5011. else {
  5012. seen = iteratee ? [] : result;
  5013. }
  5014. outer:
  5015. while (++index < length) {
  5016. var value = array[index],
  5017. computed = iteratee ? iteratee(value) : value;
  5018. value = (comparator || value !== 0) ? value : 0;
  5019. if (isCommon && computed === computed) {
  5020. var seenIndex = seen.length;
  5021. while (seenIndex--) {
  5022. if (seen[seenIndex] === computed) {
  5023. continue outer;
  5024. }
  5025. }
  5026. if (iteratee) {
  5027. seen.push(computed);
  5028. }
  5029. result.push(value);
  5030. }
  5031. else if (!includes(seen, computed, comparator)) {
  5032. if (seen !== result) {
  5033. seen.push(computed);
  5034. }
  5035. result.push(value);
  5036. }
  5037. }
  5038. return result;
  5039. }
  5040. /**
  5041. * The base implementation of `_.unset`.
  5042. *
  5043. * @private
  5044. * @param {Object} object The object to modify.
  5045. * @param {Array|string} path The property path to unset.
  5046. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5047. */
  5048. function baseUnset(object, path) {
  5049. path = castPath(path, object);
  5050. object = parent(object, path);
  5051. return object == null || delete object[toKey(last(path))];
  5052. }
  5053. /**
  5054. * The base implementation of `_.update`.
  5055. *
  5056. * @private
  5057. * @param {Object} object The object to modify.
  5058. * @param {Array|string} path The path of the property to update.
  5059. * @param {Function} updater The function to produce the updated value.
  5060. * @param {Function} [customizer] The function to customize path creation.
  5061. * @returns {Object} Returns `object`.
  5062. */
  5063. function baseUpdate(object, path, updater, customizer) {
  5064. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5065. }
  5066. /**
  5067. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5068. * without support for iteratee shorthands.
  5069. *
  5070. * @private
  5071. * @param {Array} array The array to query.
  5072. * @param {Function} predicate The function invoked per iteration.
  5073. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5074. * @param {boolean} [fromRight] Specify iterating from right to left.
  5075. * @returns {Array} Returns the slice of `array`.
  5076. */
  5077. function baseWhile(array, predicate, isDrop, fromRight) {
  5078. var length = array.length,
  5079. index = fromRight ? length : -1;
  5080. while ((fromRight ? index-- : ++index < length) &&
  5081. predicate(array[index], index, array)) {}
  5082. return isDrop
  5083. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5084. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5085. }
  5086. /**
  5087. * The base implementation of `wrapperValue` which returns the result of
  5088. * performing a sequence of actions on the unwrapped `value`, where each
  5089. * successive action is supplied the return value of the previous.
  5090. *
  5091. * @private
  5092. * @param {*} value The unwrapped value.
  5093. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5094. * @returns {*} Returns the resolved value.
  5095. */
  5096. function baseWrapperValue(value, actions) {
  5097. var result = value;
  5098. if (result instanceof LazyWrapper) {
  5099. result = result.value();
  5100. }
  5101. return arrayReduce(actions, function(result, action) {
  5102. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5103. }, result);
  5104. }
  5105. /**
  5106. * The base implementation of methods like `_.xor`, without support for
  5107. * iteratee shorthands, that accepts an array of arrays to inspect.
  5108. *
  5109. * @private
  5110. * @param {Array} arrays The arrays to inspect.
  5111. * @param {Function} [iteratee] The iteratee invoked per element.
  5112. * @param {Function} [comparator] The comparator invoked per element.
  5113. * @returns {Array} Returns the new array of values.
  5114. */
  5115. function baseXor(arrays, iteratee, comparator) {
  5116. var length = arrays.length;
  5117. if (length < 2) {
  5118. return length ? baseUniq(arrays[0]) : [];
  5119. }
  5120. var index = -1,
  5121. result = Array(length);
  5122. while (++index < length) {
  5123. var array = arrays[index],
  5124. othIndex = -1;
  5125. while (++othIndex < length) {
  5126. if (othIndex != index) {
  5127. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5128. }
  5129. }
  5130. }
  5131. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5132. }
  5133. /**
  5134. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5135. *
  5136. * @private
  5137. * @param {Array} props The property identifiers.
  5138. * @param {Array} values The property values.
  5139. * @param {Function} assignFunc The function to assign values.
  5140. * @returns {Object} Returns the new object.
  5141. */
  5142. function baseZipObject(props, values, assignFunc) {
  5143. var index = -1,
  5144. length = props.length,
  5145. valsLength = values.length,
  5146. result = {};
  5147. while (++index < length) {
  5148. var value = index < valsLength ? values[index] : undefined;
  5149. assignFunc(result, props[index], value);
  5150. }
  5151. return result;
  5152. }
  5153. /**
  5154. * Casts `value` to an empty array if it's not an array like object.
  5155. *
  5156. * @private
  5157. * @param {*} value The value to inspect.
  5158. * @returns {Array|Object} Returns the cast array-like object.
  5159. */
  5160. function castArrayLikeObject(value) {
  5161. return isArrayLikeObject(value) ? value : [];
  5162. }
  5163. /**
  5164. * Casts `value` to `identity` if it's not a function.
  5165. *
  5166. * @private
  5167. * @param {*} value The value to inspect.
  5168. * @returns {Function} Returns cast function.
  5169. */
  5170. function castFunction(value) {
  5171. return typeof value == 'function' ? value : identity;
  5172. }
  5173. /**
  5174. * Casts `value` to a path array if it's not one.
  5175. *
  5176. * @private
  5177. * @param {*} value The value to inspect.
  5178. * @param {Object} [object] The object to query keys on.
  5179. * @returns {Array} Returns the cast property path array.
  5180. */
  5181. function castPath(value, object) {
  5182. if (isArray(value)) {
  5183. return value;
  5184. }
  5185. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5186. }
  5187. /**
  5188. * A `baseRest` alias which can be replaced with `identity` by module
  5189. * replacement plugins.
  5190. *
  5191. * @private
  5192. * @type {Function}
  5193. * @param {Function} func The function to apply a rest parameter to.
  5194. * @returns {Function} Returns the new function.
  5195. */
  5196. var castRest = baseRest;
  5197. /**
  5198. * Casts `array` to a slice if it's needed.
  5199. *
  5200. * @private
  5201. * @param {Array} array The array to inspect.
  5202. * @param {number} start The start position.
  5203. * @param {number} [end=array.length] The end position.
  5204. * @returns {Array} Returns the cast slice.
  5205. */
  5206. function castSlice(array, start, end) {
  5207. var length = array.length;
  5208. end = end === undefined ? length : end;
  5209. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5210. }
  5211. /**
  5212. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5213. *
  5214. * @private
  5215. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5216. */
  5217. var clearTimeout = ctxClearTimeout || function(id) {
  5218. return root.clearTimeout(id);
  5219. };
  5220. /**
  5221. * Creates a clone of `buffer`.
  5222. *
  5223. * @private
  5224. * @param {Buffer} buffer The buffer to clone.
  5225. * @param {boolean} [isDeep] Specify a deep clone.
  5226. * @returns {Buffer} Returns the cloned buffer.
  5227. */
  5228. function cloneBuffer(buffer, isDeep) {
  5229. if (isDeep) {
  5230. return buffer.slice();
  5231. }
  5232. var length = buffer.length,
  5233. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5234. buffer.copy(result);
  5235. return result;
  5236. }
  5237. /**
  5238. * Creates a clone of `arrayBuffer`.
  5239. *
  5240. * @private
  5241. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5242. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5243. */
  5244. function cloneArrayBuffer(arrayBuffer) {
  5245. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5246. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5247. return result;
  5248. }
  5249. /**
  5250. * Creates a clone of `dataView`.
  5251. *
  5252. * @private
  5253. * @param {Object} dataView The data view to clone.
  5254. * @param {boolean} [isDeep] Specify a deep clone.
  5255. * @returns {Object} Returns the cloned data view.
  5256. */
  5257. function cloneDataView(dataView, isDeep) {
  5258. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5259. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5260. }
  5261. /**
  5262. * Creates a clone of `regexp`.
  5263. *
  5264. * @private
  5265. * @param {Object} regexp The regexp to clone.
  5266. * @returns {Object} Returns the cloned regexp.
  5267. */
  5268. function cloneRegExp(regexp) {
  5269. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5270. result.lastIndex = regexp.lastIndex;
  5271. return result;
  5272. }
  5273. /**
  5274. * Creates a clone of the `symbol` object.
  5275. *
  5276. * @private
  5277. * @param {Object} symbol The symbol object to clone.
  5278. * @returns {Object} Returns the cloned symbol object.
  5279. */
  5280. function cloneSymbol(symbol) {
  5281. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5282. }
  5283. /**
  5284. * Creates a clone of `typedArray`.
  5285. *
  5286. * @private
  5287. * @param {Object} typedArray The typed array to clone.
  5288. * @param {boolean} [isDeep] Specify a deep clone.
  5289. * @returns {Object} Returns the cloned typed array.
  5290. */
  5291. function cloneTypedArray(typedArray, isDeep) {
  5292. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5293. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5294. }
  5295. /**
  5296. * Compares values to sort them in ascending order.
  5297. *
  5298. * @private
  5299. * @param {*} value The value to compare.
  5300. * @param {*} other The other value to compare.
  5301. * @returns {number} Returns the sort order indicator for `value`.
  5302. */
  5303. function compareAscending(value, other) {
  5304. if (value !== other) {
  5305. var valIsDefined = value !== undefined,
  5306. valIsNull = value === null,
  5307. valIsReflexive = value === value,
  5308. valIsSymbol = isSymbol(value);
  5309. var othIsDefined = other !== undefined,
  5310. othIsNull = other === null,
  5311. othIsReflexive = other === other,
  5312. othIsSymbol = isSymbol(other);
  5313. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5314. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5315. (valIsNull && othIsDefined && othIsReflexive) ||
  5316. (!valIsDefined && othIsReflexive) ||
  5317. !valIsReflexive) {
  5318. return 1;
  5319. }
  5320. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5321. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5322. (othIsNull && valIsDefined && valIsReflexive) ||
  5323. (!othIsDefined && valIsReflexive) ||
  5324. !othIsReflexive) {
  5325. return -1;
  5326. }
  5327. }
  5328. return 0;
  5329. }
  5330. /**
  5331. * Used by `_.orderBy` to compare multiple properties of a value to another
  5332. * and stable sort them.
  5333. *
  5334. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5335. * specify an order of "desc" for descending or "asc" for ascending sort order
  5336. * of corresponding values.
  5337. *
  5338. * @private
  5339. * @param {Object} object The object to compare.
  5340. * @param {Object} other The other object to compare.
  5341. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5342. * @returns {number} Returns the sort order indicator for `object`.
  5343. */
  5344. function compareMultiple(object, other, orders) {
  5345. var index = -1,
  5346. objCriteria = object.criteria,
  5347. othCriteria = other.criteria,
  5348. length = objCriteria.length,
  5349. ordersLength = orders.length;
  5350. while (++index < length) {
  5351. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5352. if (result) {
  5353. if (index >= ordersLength) {
  5354. return result;
  5355. }
  5356. var order = orders[index];
  5357. return result * (order == 'desc' ? -1 : 1);
  5358. }
  5359. }
  5360. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5361. // that causes it, under certain circumstances, to provide the same value for
  5362. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5363. // for more details.
  5364. //
  5365. // This also ensures a stable sort in V8 and other engines.
  5366. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5367. return object.index - other.index;
  5368. }
  5369. /**
  5370. * Creates an array that is the composition of partially applied arguments,
  5371. * placeholders, and provided arguments into a single array of arguments.
  5372. *
  5373. * @private
  5374. * @param {Array} args The provided arguments.
  5375. * @param {Array} partials The arguments to prepend to those provided.
  5376. * @param {Array} holders The `partials` placeholder indexes.
  5377. * @params {boolean} [isCurried] Specify composing for a curried function.
  5378. * @returns {Array} Returns the new array of composed arguments.
  5379. */
  5380. function composeArgs(args, partials, holders, isCurried) {
  5381. var argsIndex = -1,
  5382. argsLength = args.length,
  5383. holdersLength = holders.length,
  5384. leftIndex = -1,
  5385. leftLength = partials.length,
  5386. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5387. result = Array(leftLength + rangeLength),
  5388. isUncurried = !isCurried;
  5389. while (++leftIndex < leftLength) {
  5390. result[leftIndex] = partials[leftIndex];
  5391. }
  5392. while (++argsIndex < holdersLength) {
  5393. if (isUncurried || argsIndex < argsLength) {
  5394. result[holders[argsIndex]] = args[argsIndex];
  5395. }
  5396. }
  5397. while (rangeLength--) {
  5398. result[leftIndex++] = args[argsIndex++];
  5399. }
  5400. return result;
  5401. }
  5402. /**
  5403. * This function is like `composeArgs` except that the arguments composition
  5404. * is tailored for `_.partialRight`.
  5405. *
  5406. * @private
  5407. * @param {Array} args The provided arguments.
  5408. * @param {Array} partials The arguments to append to those provided.
  5409. * @param {Array} holders The `partials` placeholder indexes.
  5410. * @params {boolean} [isCurried] Specify composing for a curried function.
  5411. * @returns {Array} Returns the new array of composed arguments.
  5412. */
  5413. function composeArgsRight(args, partials, holders, isCurried) {
  5414. var argsIndex = -1,
  5415. argsLength = args.length,
  5416. holdersIndex = -1,
  5417. holdersLength = holders.length,
  5418. rightIndex = -1,
  5419. rightLength = partials.length,
  5420. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5421. result = Array(rangeLength + rightLength),
  5422. isUncurried = !isCurried;
  5423. while (++argsIndex < rangeLength) {
  5424. result[argsIndex] = args[argsIndex];
  5425. }
  5426. var offset = argsIndex;
  5427. while (++rightIndex < rightLength) {
  5428. result[offset + rightIndex] = partials[rightIndex];
  5429. }
  5430. while (++holdersIndex < holdersLength) {
  5431. if (isUncurried || argsIndex < argsLength) {
  5432. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5433. }
  5434. }
  5435. return result;
  5436. }
  5437. /**
  5438. * Copies the values of `source` to `array`.
  5439. *
  5440. * @private
  5441. * @param {Array} source The array to copy values from.
  5442. * @param {Array} [array=[]] The array to copy values to.
  5443. * @returns {Array} Returns `array`.
  5444. */
  5445. function copyArray(source, array) {
  5446. var index = -1,
  5447. length = source.length;
  5448. array || (array = Array(length));
  5449. while (++index < length) {
  5450. array[index] = source[index];
  5451. }
  5452. return array;
  5453. }
  5454. /**
  5455. * Copies properties of `source` to `object`.
  5456. *
  5457. * @private
  5458. * @param {Object} source The object to copy properties from.
  5459. * @param {Array} props The property identifiers to copy.
  5460. * @param {Object} [object={}] The object to copy properties to.
  5461. * @param {Function} [customizer] The function to customize copied values.
  5462. * @returns {Object} Returns `object`.
  5463. */
  5464. function copyObject(source, props, object, customizer) {
  5465. var isNew = !object;
  5466. object || (object = {});
  5467. var index = -1,
  5468. length = props.length;
  5469. while (++index < length) {
  5470. var key = props[index];
  5471. var newValue = customizer
  5472. ? customizer(object[key], source[key], key, object, source)
  5473. : undefined;
  5474. if (newValue === undefined) {
  5475. newValue = source[key];
  5476. }
  5477. if (isNew) {
  5478. baseAssignValue(object, key, newValue);
  5479. } else {
  5480. assignValue(object, key, newValue);
  5481. }
  5482. }
  5483. return object;
  5484. }
  5485. /**
  5486. * Copies own symbols of `source` to `object`.
  5487. *
  5488. * @private
  5489. * @param {Object} source The object to copy symbols from.
  5490. * @param {Object} [object={}] The object to copy symbols to.
  5491. * @returns {Object} Returns `object`.
  5492. */
  5493. function copySymbols(source, object) {
  5494. return copyObject(source, getSymbols(source), object);
  5495. }
  5496. /**
  5497. * Copies own and inherited symbols of `source` to `object`.
  5498. *
  5499. * @private
  5500. * @param {Object} source The object to copy symbols from.
  5501. * @param {Object} [object={}] The object to copy symbols to.
  5502. * @returns {Object} Returns `object`.
  5503. */
  5504. function copySymbolsIn(source, object) {
  5505. return copyObject(source, getSymbolsIn(source), object);
  5506. }
  5507. /**
  5508. * Creates a function like `_.groupBy`.
  5509. *
  5510. * @private
  5511. * @param {Function} setter The function to set accumulator values.
  5512. * @param {Function} [initializer] The accumulator object initializer.
  5513. * @returns {Function} Returns the new aggregator function.
  5514. */
  5515. function createAggregator(setter, initializer) {
  5516. return function(collection, iteratee) {
  5517. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5518. accumulator = initializer ? initializer() : {};
  5519. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5520. };
  5521. }
  5522. /**
  5523. * Creates a function like `_.assign`.
  5524. *
  5525. * @private
  5526. * @param {Function} assigner The function to assign values.
  5527. * @returns {Function} Returns the new assigner function.
  5528. */
  5529. function createAssigner(assigner) {
  5530. return baseRest(function(object, sources) {
  5531. var index = -1,
  5532. length = sources.length,
  5533. customizer = length > 1 ? sources[length - 1] : undefined,
  5534. guard = length > 2 ? sources[2] : undefined;
  5535. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5536. ? (length--, customizer)
  5537. : undefined;
  5538. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5539. customizer = length < 3 ? undefined : customizer;
  5540. length = 1;
  5541. }
  5542. object = Object(object);
  5543. while (++index < length) {
  5544. var source = sources[index];
  5545. if (source) {
  5546. assigner(object, source, index, customizer);
  5547. }
  5548. }
  5549. return object;
  5550. });
  5551. }
  5552. /**
  5553. * Creates a `baseEach` or `baseEachRight` function.
  5554. *
  5555. * @private
  5556. * @param {Function} eachFunc The function to iterate over a collection.
  5557. * @param {boolean} [fromRight] Specify iterating from right to left.
  5558. * @returns {Function} Returns the new base function.
  5559. */
  5560. function createBaseEach(eachFunc, fromRight) {
  5561. return function(collection, iteratee) {
  5562. if (collection == null) {
  5563. return collection;
  5564. }
  5565. if (!isArrayLike(collection)) {
  5566. return eachFunc(collection, iteratee);
  5567. }
  5568. var length = collection.length,
  5569. index = fromRight ? length : -1,
  5570. iterable = Object(collection);
  5571. while ((fromRight ? index-- : ++index < length)) {
  5572. if (iteratee(iterable[index], index, iterable) === false) {
  5573. break;
  5574. }
  5575. }
  5576. return collection;
  5577. };
  5578. }
  5579. /**
  5580. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5581. *
  5582. * @private
  5583. * @param {boolean} [fromRight] Specify iterating from right to left.
  5584. * @returns {Function} Returns the new base function.
  5585. */
  5586. function createBaseFor(fromRight) {
  5587. return function(object, iteratee, keysFunc) {
  5588. var index = -1,
  5589. iterable = Object(object),
  5590. props = keysFunc(object),
  5591. length = props.length;
  5592. while (length--) {
  5593. var key = props[fromRight ? length : ++index];
  5594. if (iteratee(iterable[key], key, iterable) === false) {
  5595. break;
  5596. }
  5597. }
  5598. return object;
  5599. };
  5600. }
  5601. /**
  5602. * Creates a function that wraps `func` to invoke it with the optional `this`
  5603. * binding of `thisArg`.
  5604. *
  5605. * @private
  5606. * @param {Function} func The function to wrap.
  5607. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5608. * @param {*} [thisArg] The `this` binding of `func`.
  5609. * @returns {Function} Returns the new wrapped function.
  5610. */
  5611. function createBind(func, bitmask, thisArg) {
  5612. var isBind = bitmask & WRAP_BIND_FLAG,
  5613. Ctor = createCtor(func);
  5614. function wrapper() {
  5615. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5616. return fn.apply(isBind ? thisArg : this, arguments);
  5617. }
  5618. return wrapper;
  5619. }
  5620. /**
  5621. * Creates a function like `_.lowerFirst`.
  5622. *
  5623. * @private
  5624. * @param {string} methodName The name of the `String` case method to use.
  5625. * @returns {Function} Returns the new case function.
  5626. */
  5627. function createCaseFirst(methodName) {
  5628. return function(string) {
  5629. string = toString(string);
  5630. var strSymbols = hasUnicode(string)
  5631. ? stringToArray(string)
  5632. : undefined;
  5633. var chr = strSymbols
  5634. ? strSymbols[0]
  5635. : string.charAt(0);
  5636. var trailing = strSymbols
  5637. ? castSlice(strSymbols, 1).join('')
  5638. : string.slice(1);
  5639. return chr[methodName]() + trailing;
  5640. };
  5641. }
  5642. /**
  5643. * Creates a function like `_.camelCase`.
  5644. *
  5645. * @private
  5646. * @param {Function} callback The function to combine each word.
  5647. * @returns {Function} Returns the new compounder function.
  5648. */
  5649. function createCompounder(callback) {
  5650. return function(string) {
  5651. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5652. };
  5653. }
  5654. /**
  5655. * Creates a function that produces an instance of `Ctor` regardless of
  5656. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5657. *
  5658. * @private
  5659. * @param {Function} Ctor The constructor to wrap.
  5660. * @returns {Function} Returns the new wrapped function.
  5661. */
  5662. function createCtor(Ctor) {
  5663. return function() {
  5664. // Use a `switch` statement to work with class constructors. See
  5665. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5666. // for more details.
  5667. var args = arguments;
  5668. switch (args.length) {
  5669. case 0: return new Ctor;
  5670. case 1: return new Ctor(args[0]);
  5671. case 2: return new Ctor(args[0], args[1]);
  5672. case 3: return new Ctor(args[0], args[1], args[2]);
  5673. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5674. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5675. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5676. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5677. }
  5678. var thisBinding = baseCreate(Ctor.prototype),
  5679. result = Ctor.apply(thisBinding, args);
  5680. // Mimic the constructor's `return` behavior.
  5681. // See https://es5.github.io/#x13.2.2 for more details.
  5682. return isObject(result) ? result : thisBinding;
  5683. };
  5684. }
  5685. /**
  5686. * Creates a function that wraps `func` to enable currying.
  5687. *
  5688. * @private
  5689. * @param {Function} func The function to wrap.
  5690. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5691. * @param {number} arity The arity of `func`.
  5692. * @returns {Function} Returns the new wrapped function.
  5693. */
  5694. function createCurry(func, bitmask, arity) {
  5695. var Ctor = createCtor(func);
  5696. function wrapper() {
  5697. var length = arguments.length,
  5698. args = Array(length),
  5699. index = length,
  5700. placeholder = getHolder(wrapper);
  5701. while (index--) {
  5702. args[index] = arguments[index];
  5703. }
  5704. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5705. ? []
  5706. : replaceHolders(args, placeholder);
  5707. length -= holders.length;
  5708. if (length < arity) {
  5709. return createRecurry(
  5710. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5711. args, holders, undefined, undefined, arity - length);
  5712. }
  5713. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5714. return apply(fn, this, args);
  5715. }
  5716. return wrapper;
  5717. }
  5718. /**
  5719. * Creates a `_.find` or `_.findLast` function.
  5720. *
  5721. * @private
  5722. * @param {Function} findIndexFunc The function to find the collection index.
  5723. * @returns {Function} Returns the new find function.
  5724. */
  5725. function createFind(findIndexFunc) {
  5726. return function(collection, predicate, fromIndex) {
  5727. var iterable = Object(collection);
  5728. if (!isArrayLike(collection)) {
  5729. var iteratee = getIteratee(predicate, 3);
  5730. collection = keys(collection);
  5731. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5732. }
  5733. var index = findIndexFunc(collection, predicate, fromIndex);
  5734. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5735. };
  5736. }
  5737. /**
  5738. * Creates a `_.flow` or `_.flowRight` function.
  5739. *
  5740. * @private
  5741. * @param {boolean} [fromRight] Specify iterating from right to left.
  5742. * @returns {Function} Returns the new flow function.
  5743. */
  5744. function createFlow(fromRight) {
  5745. return flatRest(function(funcs) {
  5746. var length = funcs.length,
  5747. index = length,
  5748. prereq = LodashWrapper.prototype.thru;
  5749. if (fromRight) {
  5750. funcs.reverse();
  5751. }
  5752. while (index--) {
  5753. var func = funcs[index];
  5754. if (typeof func != 'function') {
  5755. throw new TypeError(FUNC_ERROR_TEXT);
  5756. }
  5757. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5758. var wrapper = new LodashWrapper([], true);
  5759. }
  5760. }
  5761. index = wrapper ? index : length;
  5762. while (++index < length) {
  5763. func = funcs[index];
  5764. var funcName = getFuncName(func),
  5765. data = funcName == 'wrapper' ? getData(func) : undefined;
  5766. if (data && isLaziable(data[0]) &&
  5767. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5768. !data[4].length && data[9] == 1
  5769. ) {
  5770. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5771. } else {
  5772. wrapper = (func.length == 1 && isLaziable(func))
  5773. ? wrapper[funcName]()
  5774. : wrapper.thru(func);
  5775. }
  5776. }
  5777. return function() {
  5778. var args = arguments,
  5779. value = args[0];
  5780. if (wrapper && args.length == 1 && isArray(value)) {
  5781. return wrapper.plant(value).value();
  5782. }
  5783. var index = 0,
  5784. result = length ? funcs[index].apply(this, args) : value;
  5785. while (++index < length) {
  5786. result = funcs[index].call(this, result);
  5787. }
  5788. return result;
  5789. };
  5790. });
  5791. }
  5792. /**
  5793. * Creates a function that wraps `func` to invoke it with optional `this`
  5794. * binding of `thisArg`, partial application, and currying.
  5795. *
  5796. * @private
  5797. * @param {Function|string} func The function or method name to wrap.
  5798. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5799. * @param {*} [thisArg] The `this` binding of `func`.
  5800. * @param {Array} [partials] The arguments to prepend to those provided to
  5801. * the new function.
  5802. * @param {Array} [holders] The `partials` placeholder indexes.
  5803. * @param {Array} [partialsRight] The arguments to append to those provided
  5804. * to the new function.
  5805. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5806. * @param {Array} [argPos] The argument positions of the new function.
  5807. * @param {number} [ary] The arity cap of `func`.
  5808. * @param {number} [arity] The arity of `func`.
  5809. * @returns {Function} Returns the new wrapped function.
  5810. */
  5811. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5812. var isAry = bitmask & WRAP_ARY_FLAG,
  5813. isBind = bitmask & WRAP_BIND_FLAG,
  5814. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5815. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5816. isFlip = bitmask & WRAP_FLIP_FLAG,
  5817. Ctor = isBindKey ? undefined : createCtor(func);
  5818. function wrapper() {
  5819. var length = arguments.length,
  5820. args = Array(length),
  5821. index = length;
  5822. while (index--) {
  5823. args[index] = arguments[index];
  5824. }
  5825. if (isCurried) {
  5826. var placeholder = getHolder(wrapper),
  5827. holdersCount = countHolders(args, placeholder);
  5828. }
  5829. if (partials) {
  5830. args = composeArgs(args, partials, holders, isCurried);
  5831. }
  5832. if (partialsRight) {
  5833. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5834. }
  5835. length -= holdersCount;
  5836. if (isCurried && length < arity) {
  5837. var newHolders = replaceHolders(args, placeholder);
  5838. return createRecurry(
  5839. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5840. args, newHolders, argPos, ary, arity - length
  5841. );
  5842. }
  5843. var thisBinding = isBind ? thisArg : this,
  5844. fn = isBindKey ? thisBinding[func] : func;
  5845. length = args.length;
  5846. if (argPos) {
  5847. args = reorder(args, argPos);
  5848. } else if (isFlip && length > 1) {
  5849. args.reverse();
  5850. }
  5851. if (isAry && ary < length) {
  5852. args.length = ary;
  5853. }
  5854. if (this && this !== root && this instanceof wrapper) {
  5855. fn = Ctor || createCtor(fn);
  5856. }
  5857. return fn.apply(thisBinding, args);
  5858. }
  5859. return wrapper;
  5860. }
  5861. /**
  5862. * Creates a function like `_.invertBy`.
  5863. *
  5864. * @private
  5865. * @param {Function} setter The function to set accumulator values.
  5866. * @param {Function} toIteratee The function to resolve iteratees.
  5867. * @returns {Function} Returns the new inverter function.
  5868. */
  5869. function createInverter(setter, toIteratee) {
  5870. return function(object, iteratee) {
  5871. return baseInverter(object, setter, toIteratee(iteratee), {});
  5872. };
  5873. }
  5874. /**
  5875. * Creates a function that performs a mathematical operation on two values.
  5876. *
  5877. * @private
  5878. * @param {Function} operator The function to perform the operation.
  5879. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5880. * @returns {Function} Returns the new mathematical operation function.
  5881. */
  5882. function createMathOperation(operator, defaultValue) {
  5883. return function(value, other) {
  5884. var result;
  5885. if (value === undefined && other === undefined) {
  5886. return defaultValue;
  5887. }
  5888. if (value !== undefined) {
  5889. result = value;
  5890. }
  5891. if (other !== undefined) {
  5892. if (result === undefined) {
  5893. return other;
  5894. }
  5895. if (typeof value == 'string' || typeof other == 'string') {
  5896. value = baseToString(value);
  5897. other = baseToString(other);
  5898. } else {
  5899. value = baseToNumber(value);
  5900. other = baseToNumber(other);
  5901. }
  5902. result = operator(value, other);
  5903. }
  5904. return result;
  5905. };
  5906. }
  5907. /**
  5908. * Creates a function like `_.over`.
  5909. *
  5910. * @private
  5911. * @param {Function} arrayFunc The function to iterate over iteratees.
  5912. * @returns {Function} Returns the new over function.
  5913. */
  5914. function createOver(arrayFunc) {
  5915. return flatRest(function(iteratees) {
  5916. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5917. return baseRest(function(args) {
  5918. var thisArg = this;
  5919. return arrayFunc(iteratees, function(iteratee) {
  5920. return apply(iteratee, thisArg, args);
  5921. });
  5922. });
  5923. });
  5924. }
  5925. /**
  5926. * Creates the padding for `string` based on `length`. The `chars` string
  5927. * is truncated if the number of characters exceeds `length`.
  5928. *
  5929. * @private
  5930. * @param {number} length The padding length.
  5931. * @param {string} [chars=' '] The string used as padding.
  5932. * @returns {string} Returns the padding for `string`.
  5933. */
  5934. function createPadding(length, chars) {
  5935. chars = chars === undefined ? ' ' : baseToString(chars);
  5936. var charsLength = chars.length;
  5937. if (charsLength < 2) {
  5938. return charsLength ? baseRepeat(chars, length) : chars;
  5939. }
  5940. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5941. return hasUnicode(chars)
  5942. ? castSlice(stringToArray(result), 0, length).join('')
  5943. : result.slice(0, length);
  5944. }
  5945. /**
  5946. * Creates a function that wraps `func` to invoke it with the `this` binding
  5947. * of `thisArg` and `partials` prepended to the arguments it receives.
  5948. *
  5949. * @private
  5950. * @param {Function} func The function to wrap.
  5951. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5952. * @param {*} thisArg The `this` binding of `func`.
  5953. * @param {Array} partials The arguments to prepend to those provided to
  5954. * the new function.
  5955. * @returns {Function} Returns the new wrapped function.
  5956. */
  5957. function createPartial(func, bitmask, thisArg, partials) {
  5958. var isBind = bitmask & WRAP_BIND_FLAG,
  5959. Ctor = createCtor(func);
  5960. function wrapper() {
  5961. var argsIndex = -1,
  5962. argsLength = arguments.length,
  5963. leftIndex = -1,
  5964. leftLength = partials.length,
  5965. args = Array(leftLength + argsLength),
  5966. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5967. while (++leftIndex < leftLength) {
  5968. args[leftIndex] = partials[leftIndex];
  5969. }
  5970. while (argsLength--) {
  5971. args[leftIndex++] = arguments[++argsIndex];
  5972. }
  5973. return apply(fn, isBind ? thisArg : this, args);
  5974. }
  5975. return wrapper;
  5976. }
  5977. /**
  5978. * Creates a `_.range` or `_.rangeRight` function.
  5979. *
  5980. * @private
  5981. * @param {boolean} [fromRight] Specify iterating from right to left.
  5982. * @returns {Function} Returns the new range function.
  5983. */
  5984. function createRange(fromRight) {
  5985. return function(start, end, step) {
  5986. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  5987. end = step = undefined;
  5988. }
  5989. // Ensure the sign of `-0` is preserved.
  5990. start = toFinite(start);
  5991. if (end === undefined) {
  5992. end = start;
  5993. start = 0;
  5994. } else {
  5995. end = toFinite(end);
  5996. }
  5997. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  5998. return baseRange(start, end, step, fromRight);
  5999. };
  6000. }
  6001. /**
  6002. * Creates a function that performs a relational operation on two values.
  6003. *
  6004. * @private
  6005. * @param {Function} operator The function to perform the operation.
  6006. * @returns {Function} Returns the new relational operation function.
  6007. */
  6008. function createRelationalOperation(operator) {
  6009. return function(value, other) {
  6010. if (!(typeof value == 'string' && typeof other == 'string')) {
  6011. value = toNumber(value);
  6012. other = toNumber(other);
  6013. }
  6014. return operator(value, other);
  6015. };
  6016. }
  6017. /**
  6018. * Creates a function that wraps `func` to continue currying.
  6019. *
  6020. * @private
  6021. * @param {Function} func The function to wrap.
  6022. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6023. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6024. * @param {*} placeholder The placeholder value.
  6025. * @param {*} [thisArg] The `this` binding of `func`.
  6026. * @param {Array} [partials] The arguments to prepend to those provided to
  6027. * the new function.
  6028. * @param {Array} [holders] The `partials` placeholder indexes.
  6029. * @param {Array} [argPos] The argument positions of the new function.
  6030. * @param {number} [ary] The arity cap of `func`.
  6031. * @param {number} [arity] The arity of `func`.
  6032. * @returns {Function} Returns the new wrapped function.
  6033. */
  6034. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6035. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6036. newHolders = isCurry ? holders : undefined,
  6037. newHoldersRight = isCurry ? undefined : holders,
  6038. newPartials = isCurry ? partials : undefined,
  6039. newPartialsRight = isCurry ? undefined : partials;
  6040. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6041. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6042. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6043. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6044. }
  6045. var newData = [
  6046. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6047. newHoldersRight, argPos, ary, arity
  6048. ];
  6049. var result = wrapFunc.apply(undefined, newData);
  6050. if (isLaziable(func)) {
  6051. setData(result, newData);
  6052. }
  6053. result.placeholder = placeholder;
  6054. return setWrapToString(result, func, bitmask);
  6055. }
  6056. /**
  6057. * Creates a function like `_.round`.
  6058. *
  6059. * @private
  6060. * @param {string} methodName The name of the `Math` method to use when rounding.
  6061. * @returns {Function} Returns the new round function.
  6062. */
  6063. function createRound(methodName) {
  6064. var func = Math[methodName];
  6065. return function(number, precision) {
  6066. number = toNumber(number);
  6067. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6068. if (precision && nativeIsFinite(number)) {
  6069. // Shift with exponential notation to avoid floating-point issues.
  6070. // See [MDN](https://mdn.io/round#Examples) for more details.
  6071. var pair = (toString(number) + 'e').split('e'),
  6072. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6073. pair = (toString(value) + 'e').split('e');
  6074. return +(pair[0] + 'e' + (+pair[1] - precision));
  6075. }
  6076. return func(number);
  6077. };
  6078. }
  6079. /**
  6080. * Creates a set object of `values`.
  6081. *
  6082. * @private
  6083. * @param {Array} values The values to add to the set.
  6084. * @returns {Object} Returns the new set.
  6085. */
  6086. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6087. return new Set(values);
  6088. };
  6089. /**
  6090. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6091. *
  6092. * @private
  6093. * @param {Function} keysFunc The function to get the keys of a given object.
  6094. * @returns {Function} Returns the new pairs function.
  6095. */
  6096. function createToPairs(keysFunc) {
  6097. return function(object) {
  6098. var tag = getTag(object);
  6099. if (tag == mapTag) {
  6100. return mapToArray(object);
  6101. }
  6102. if (tag == setTag) {
  6103. return setToPairs(object);
  6104. }
  6105. return baseToPairs(object, keysFunc(object));
  6106. };
  6107. }
  6108. /**
  6109. * Creates a function that either curries or invokes `func` with optional
  6110. * `this` binding and partially applied arguments.
  6111. *
  6112. * @private
  6113. * @param {Function|string} func The function or method name to wrap.
  6114. * @param {number} bitmask The bitmask flags.
  6115. * 1 - `_.bind`
  6116. * 2 - `_.bindKey`
  6117. * 4 - `_.curry` or `_.curryRight` of a bound function
  6118. * 8 - `_.curry`
  6119. * 16 - `_.curryRight`
  6120. * 32 - `_.partial`
  6121. * 64 - `_.partialRight`
  6122. * 128 - `_.rearg`
  6123. * 256 - `_.ary`
  6124. * 512 - `_.flip`
  6125. * @param {*} [thisArg] The `this` binding of `func`.
  6126. * @param {Array} [partials] The arguments to be partially applied.
  6127. * @param {Array} [holders] The `partials` placeholder indexes.
  6128. * @param {Array} [argPos] The argument positions of the new function.
  6129. * @param {number} [ary] The arity cap of `func`.
  6130. * @param {number} [arity] The arity of `func`.
  6131. * @returns {Function} Returns the new wrapped function.
  6132. */
  6133. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6134. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6135. if (!isBindKey && typeof func != 'function') {
  6136. throw new TypeError(FUNC_ERROR_TEXT);
  6137. }
  6138. var length = partials ? partials.length : 0;
  6139. if (!length) {
  6140. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6141. partials = holders = undefined;
  6142. }
  6143. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6144. arity = arity === undefined ? arity : toInteger(arity);
  6145. length -= holders ? holders.length : 0;
  6146. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6147. var partialsRight = partials,
  6148. holdersRight = holders;
  6149. partials = holders = undefined;
  6150. }
  6151. var data = isBindKey ? undefined : getData(func);
  6152. var newData = [
  6153. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6154. argPos, ary, arity
  6155. ];
  6156. if (data) {
  6157. mergeData(newData, data);
  6158. }
  6159. func = newData[0];
  6160. bitmask = newData[1];
  6161. thisArg = newData[2];
  6162. partials = newData[3];
  6163. holders = newData[4];
  6164. arity = newData[9] = newData[9] === undefined
  6165. ? (isBindKey ? 0 : func.length)
  6166. : nativeMax(newData[9] - length, 0);
  6167. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6168. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6169. }
  6170. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6171. var result = createBind(func, bitmask, thisArg);
  6172. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6173. result = createCurry(func, bitmask, arity);
  6174. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6175. result = createPartial(func, bitmask, thisArg, partials);
  6176. } else {
  6177. result = createHybrid.apply(undefined, newData);
  6178. }
  6179. var setter = data ? baseSetData : setData;
  6180. return setWrapToString(setter(result, newData), func, bitmask);
  6181. }
  6182. /**
  6183. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6184. * of source objects to the destination object for all destination properties
  6185. * that resolve to `undefined`.
  6186. *
  6187. * @private
  6188. * @param {*} objValue The destination value.
  6189. * @param {*} srcValue The source value.
  6190. * @param {string} key The key of the property to assign.
  6191. * @param {Object} object The parent object of `objValue`.
  6192. * @returns {*} Returns the value to assign.
  6193. */
  6194. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6195. if (objValue === undefined ||
  6196. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6197. return srcValue;
  6198. }
  6199. return objValue;
  6200. }
  6201. /**
  6202. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6203. * objects into destination objects that are passed thru.
  6204. *
  6205. * @private
  6206. * @param {*} objValue The destination value.
  6207. * @param {*} srcValue The source value.
  6208. * @param {string} key The key of the property to merge.
  6209. * @param {Object} object The parent object of `objValue`.
  6210. * @param {Object} source The parent object of `srcValue`.
  6211. * @param {Object} [stack] Tracks traversed source values and their merged
  6212. * counterparts.
  6213. * @returns {*} Returns the value to assign.
  6214. */
  6215. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6216. if (isObject(objValue) && isObject(srcValue)) {
  6217. // Recursively merge objects and arrays (susceptible to call stack limits).
  6218. stack.set(srcValue, objValue);
  6219. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6220. stack['delete'](srcValue);
  6221. }
  6222. return objValue;
  6223. }
  6224. /**
  6225. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6226. * objects.
  6227. *
  6228. * @private
  6229. * @param {*} value The value to inspect.
  6230. * @param {string} key The key of the property to inspect.
  6231. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6232. */
  6233. function customOmitClone(value) {
  6234. return isPlainObject(value) ? undefined : value;
  6235. }
  6236. /**
  6237. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6238. * partial deep comparisons.
  6239. *
  6240. * @private
  6241. * @param {Array} array The array to compare.
  6242. * @param {Array} other The other array to compare.
  6243. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6244. * @param {Function} customizer The function to customize comparisons.
  6245. * @param {Function} equalFunc The function to determine equivalents of values.
  6246. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6247. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6248. */
  6249. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6250. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6251. arrLength = array.length,
  6252. othLength = other.length;
  6253. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6254. return false;
  6255. }
  6256. // Check that cyclic values are equal.
  6257. var arrStacked = stack.get(array);
  6258. var othStacked = stack.get(other);
  6259. if (arrStacked && othStacked) {
  6260. return arrStacked == other && othStacked == array;
  6261. }
  6262. var index = -1,
  6263. result = true,
  6264. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6265. stack.set(array, other);
  6266. stack.set(other, array);
  6267. // Ignore non-index properties.
  6268. while (++index < arrLength) {
  6269. var arrValue = array[index],
  6270. othValue = other[index];
  6271. if (customizer) {
  6272. var compared = isPartial
  6273. ? customizer(othValue, arrValue, index, other, array, stack)
  6274. : customizer(arrValue, othValue, index, array, other, stack);
  6275. }
  6276. if (compared !== undefined) {
  6277. if (compared) {
  6278. continue;
  6279. }
  6280. result = false;
  6281. break;
  6282. }
  6283. // Recursively compare arrays (susceptible to call stack limits).
  6284. if (seen) {
  6285. if (!arraySome(other, function(othValue, othIndex) {
  6286. if (!cacheHas(seen, othIndex) &&
  6287. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6288. return seen.push(othIndex);
  6289. }
  6290. })) {
  6291. result = false;
  6292. break;
  6293. }
  6294. } else if (!(
  6295. arrValue === othValue ||
  6296. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6297. )) {
  6298. result = false;
  6299. break;
  6300. }
  6301. }
  6302. stack['delete'](array);
  6303. stack['delete'](other);
  6304. return result;
  6305. }
  6306. /**
  6307. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6308. * the same `toStringTag`.
  6309. *
  6310. * **Note:** This function only supports comparing values with tags of
  6311. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6312. *
  6313. * @private
  6314. * @param {Object} object The object to compare.
  6315. * @param {Object} other The other object to compare.
  6316. * @param {string} tag The `toStringTag` of the objects to compare.
  6317. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6318. * @param {Function} customizer The function to customize comparisons.
  6319. * @param {Function} equalFunc The function to determine equivalents of values.
  6320. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6321. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6322. */
  6323. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6324. switch (tag) {
  6325. case dataViewTag:
  6326. if ((object.byteLength != other.byteLength) ||
  6327. (object.byteOffset != other.byteOffset)) {
  6328. return false;
  6329. }
  6330. object = object.buffer;
  6331. other = other.buffer;
  6332. case arrayBufferTag:
  6333. if ((object.byteLength != other.byteLength) ||
  6334. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6335. return false;
  6336. }
  6337. return true;
  6338. case boolTag:
  6339. case dateTag:
  6340. case numberTag:
  6341. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6342. // Invalid dates are coerced to `NaN`.
  6343. return eq(+object, +other);
  6344. case errorTag:
  6345. return object.name == other.name && object.message == other.message;
  6346. case regexpTag:
  6347. case stringTag:
  6348. // Coerce regexes to strings and treat strings, primitives and objects,
  6349. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6350. // for more details.
  6351. return object == (other + '');
  6352. case mapTag:
  6353. var convert = mapToArray;
  6354. case setTag:
  6355. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6356. convert || (convert = setToArray);
  6357. if (object.size != other.size && !isPartial) {
  6358. return false;
  6359. }
  6360. // Assume cyclic values are equal.
  6361. var stacked = stack.get(object);
  6362. if (stacked) {
  6363. return stacked == other;
  6364. }
  6365. bitmask |= COMPARE_UNORDERED_FLAG;
  6366. // Recursively compare objects (susceptible to call stack limits).
  6367. stack.set(object, other);
  6368. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6369. stack['delete'](object);
  6370. return result;
  6371. case symbolTag:
  6372. if (symbolValueOf) {
  6373. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6374. }
  6375. }
  6376. return false;
  6377. }
  6378. /**
  6379. * A specialized version of `baseIsEqualDeep` for objects with support for
  6380. * partial deep comparisons.
  6381. *
  6382. * @private
  6383. * @param {Object} object The object to compare.
  6384. * @param {Object} other The other object to compare.
  6385. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6386. * @param {Function} customizer The function to customize comparisons.
  6387. * @param {Function} equalFunc The function to determine equivalents of values.
  6388. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6389. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6390. */
  6391. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6392. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6393. objProps = getAllKeys(object),
  6394. objLength = objProps.length,
  6395. othProps = getAllKeys(other),
  6396. othLength = othProps.length;
  6397. if (objLength != othLength && !isPartial) {
  6398. return false;
  6399. }
  6400. var index = objLength;
  6401. while (index--) {
  6402. var key = objProps[index];
  6403. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6404. return false;
  6405. }
  6406. }
  6407. // Check that cyclic values are equal.
  6408. var objStacked = stack.get(object);
  6409. var othStacked = stack.get(other);
  6410. if (objStacked && othStacked) {
  6411. return objStacked == other && othStacked == object;
  6412. }
  6413. var result = true;
  6414. stack.set(object, other);
  6415. stack.set(other, object);
  6416. var skipCtor = isPartial;
  6417. while (++index < objLength) {
  6418. key = objProps[index];
  6419. var objValue = object[key],
  6420. othValue = other[key];
  6421. if (customizer) {
  6422. var compared = isPartial
  6423. ? customizer(othValue, objValue, key, other, object, stack)
  6424. : customizer(objValue, othValue, key, object, other, stack);
  6425. }
  6426. // Recursively compare objects (susceptible to call stack limits).
  6427. if (!(compared === undefined
  6428. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6429. : compared
  6430. )) {
  6431. result = false;
  6432. break;
  6433. }
  6434. skipCtor || (skipCtor = key == 'constructor');
  6435. }
  6436. if (result && !skipCtor) {
  6437. var objCtor = object.constructor,
  6438. othCtor = other.constructor;
  6439. // Non `Object` object instances with different constructors are not equal.
  6440. if (objCtor != othCtor &&
  6441. ('constructor' in object && 'constructor' in other) &&
  6442. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6443. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6444. result = false;
  6445. }
  6446. }
  6447. stack['delete'](object);
  6448. stack['delete'](other);
  6449. return result;
  6450. }
  6451. /**
  6452. * A specialized version of `baseRest` which flattens the rest array.
  6453. *
  6454. * @private
  6455. * @param {Function} func The function to apply a rest parameter to.
  6456. * @returns {Function} Returns the new function.
  6457. */
  6458. function flatRest(func) {
  6459. return setToString(overRest(func, undefined, flatten), func + '');
  6460. }
  6461. /**
  6462. * Creates an array of own enumerable property names and symbols of `object`.
  6463. *
  6464. * @private
  6465. * @param {Object} object The object to query.
  6466. * @returns {Array} Returns the array of property names and symbols.
  6467. */
  6468. function getAllKeys(object) {
  6469. return baseGetAllKeys(object, keys, getSymbols);
  6470. }
  6471. /**
  6472. * Creates an array of own and inherited enumerable property names and
  6473. * symbols of `object`.
  6474. *
  6475. * @private
  6476. * @param {Object} object The object to query.
  6477. * @returns {Array} Returns the array of property names and symbols.
  6478. */
  6479. function getAllKeysIn(object) {
  6480. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6481. }
  6482. /**
  6483. * Gets metadata for `func`.
  6484. *
  6485. * @private
  6486. * @param {Function} func The function to query.
  6487. * @returns {*} Returns the metadata for `func`.
  6488. */
  6489. var getData = !metaMap ? noop : function(func) {
  6490. return metaMap.get(func);
  6491. };
  6492. /**
  6493. * Gets the name of `func`.
  6494. *
  6495. * @private
  6496. * @param {Function} func The function to query.
  6497. * @returns {string} Returns the function name.
  6498. */
  6499. function getFuncName(func) {
  6500. var result = (func.name + ''),
  6501. array = realNames[result],
  6502. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6503. while (length--) {
  6504. var data = array[length],
  6505. otherFunc = data.func;
  6506. if (otherFunc == null || otherFunc == func) {
  6507. return data.name;
  6508. }
  6509. }
  6510. return result;
  6511. }
  6512. /**
  6513. * Gets the argument placeholder value for `func`.
  6514. *
  6515. * @private
  6516. * @param {Function} func The function to inspect.
  6517. * @returns {*} Returns the placeholder value.
  6518. */
  6519. function getHolder(func) {
  6520. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6521. return object.placeholder;
  6522. }
  6523. /**
  6524. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6525. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6526. * If arguments are provided, the chosen function is invoked with them and
  6527. * its result is returned.
  6528. *
  6529. * @private
  6530. * @param {*} [value] The value to convert to an iteratee.
  6531. * @param {number} [arity] The arity of the created iteratee.
  6532. * @returns {Function} Returns the chosen function or its result.
  6533. */
  6534. function getIteratee() {
  6535. var result = lodash.iteratee || iteratee;
  6536. result = result === iteratee ? baseIteratee : result;
  6537. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6538. }
  6539. /**
  6540. * Gets the data for `map`.
  6541. *
  6542. * @private
  6543. * @param {Object} map The map to query.
  6544. * @param {string} key The reference key.
  6545. * @returns {*} Returns the map data.
  6546. */
  6547. function getMapData(map, key) {
  6548. var data = map.__data__;
  6549. return isKeyable(key)
  6550. ? data[typeof key == 'string' ? 'string' : 'hash']
  6551. : data.map;
  6552. }
  6553. /**
  6554. * Gets the property names, values, and compare flags of `object`.
  6555. *
  6556. * @private
  6557. * @param {Object} object The object to query.
  6558. * @returns {Array} Returns the match data of `object`.
  6559. */
  6560. function getMatchData(object) {
  6561. var result = keys(object),
  6562. length = result.length;
  6563. while (length--) {
  6564. var key = result[length],
  6565. value = object[key];
  6566. result[length] = [key, value, isStrictComparable(value)];
  6567. }
  6568. return result;
  6569. }
  6570. /**
  6571. * Gets the native function at `key` of `object`.
  6572. *
  6573. * @private
  6574. * @param {Object} object The object to query.
  6575. * @param {string} key The key of the method to get.
  6576. * @returns {*} Returns the function if it's native, else `undefined`.
  6577. */
  6578. function getNative(object, key) {
  6579. var value = getValue(object, key);
  6580. return baseIsNative(value) ? value : undefined;
  6581. }
  6582. /**
  6583. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6584. *
  6585. * @private
  6586. * @param {*} value The value to query.
  6587. * @returns {string} Returns the raw `toStringTag`.
  6588. */
  6589. function getRawTag(value) {
  6590. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6591. tag = value[symToStringTag];
  6592. try {
  6593. value[symToStringTag] = undefined;
  6594. var unmasked = true;
  6595. } catch (e) {}
  6596. var result = nativeObjectToString.call(value);
  6597. if (unmasked) {
  6598. if (isOwn) {
  6599. value[symToStringTag] = tag;
  6600. } else {
  6601. delete value[symToStringTag];
  6602. }
  6603. }
  6604. return result;
  6605. }
  6606. /**
  6607. * Creates an array of the own enumerable symbols of `object`.
  6608. *
  6609. * @private
  6610. * @param {Object} object The object to query.
  6611. * @returns {Array} Returns the array of symbols.
  6612. */
  6613. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6614. if (object == null) {
  6615. return [];
  6616. }
  6617. object = Object(object);
  6618. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6619. return propertyIsEnumerable.call(object, symbol);
  6620. });
  6621. };
  6622. /**
  6623. * Creates an array of the own and inherited enumerable symbols of `object`.
  6624. *
  6625. * @private
  6626. * @param {Object} object The object to query.
  6627. * @returns {Array} Returns the array of symbols.
  6628. */
  6629. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6630. var result = [];
  6631. while (object) {
  6632. arrayPush(result, getSymbols(object));
  6633. object = getPrototype(object);
  6634. }
  6635. return result;
  6636. };
  6637. /**
  6638. * Gets the `toStringTag` of `value`.
  6639. *
  6640. * @private
  6641. * @param {*} value The value to query.
  6642. * @returns {string} Returns the `toStringTag`.
  6643. */
  6644. var getTag = baseGetTag;
  6645. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6646. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6647. (Map && getTag(new Map) != mapTag) ||
  6648. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6649. (Set && getTag(new Set) != setTag) ||
  6650. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6651. getTag = function(value) {
  6652. var result = baseGetTag(value),
  6653. Ctor = result == objectTag ? value.constructor : undefined,
  6654. ctorString = Ctor ? toSource(Ctor) : '';
  6655. if (ctorString) {
  6656. switch (ctorString) {
  6657. case dataViewCtorString: return dataViewTag;
  6658. case mapCtorString: return mapTag;
  6659. case promiseCtorString: return promiseTag;
  6660. case setCtorString: return setTag;
  6661. case weakMapCtorString: return weakMapTag;
  6662. }
  6663. }
  6664. return result;
  6665. };
  6666. }
  6667. /**
  6668. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6669. *
  6670. * @private
  6671. * @param {number} start The start of the view.
  6672. * @param {number} end The end of the view.
  6673. * @param {Array} transforms The transformations to apply to the view.
  6674. * @returns {Object} Returns an object containing the `start` and `end`
  6675. * positions of the view.
  6676. */
  6677. function getView(start, end, transforms) {
  6678. var index = -1,
  6679. length = transforms.length;
  6680. while (++index < length) {
  6681. var data = transforms[index],
  6682. size = data.size;
  6683. switch (data.type) {
  6684. case 'drop': start += size; break;
  6685. case 'dropRight': end -= size; break;
  6686. case 'take': end = nativeMin(end, start + size); break;
  6687. case 'takeRight': start = nativeMax(start, end - size); break;
  6688. }
  6689. }
  6690. return { 'start': start, 'end': end };
  6691. }
  6692. /**
  6693. * Extracts wrapper details from the `source` body comment.
  6694. *
  6695. * @private
  6696. * @param {string} source The source to inspect.
  6697. * @returns {Array} Returns the wrapper details.
  6698. */
  6699. function getWrapDetails(source) {
  6700. var match = source.match(reWrapDetails);
  6701. return match ? match[1].split(reSplitDetails) : [];
  6702. }
  6703. /**
  6704. * Checks if `path` exists on `object`.
  6705. *
  6706. * @private
  6707. * @param {Object} object The object to query.
  6708. * @param {Array|string} path The path to check.
  6709. * @param {Function} hasFunc The function to check properties.
  6710. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6711. */
  6712. function hasPath(object, path, hasFunc) {
  6713. path = castPath(path, object);
  6714. var index = -1,
  6715. length = path.length,
  6716. result = false;
  6717. while (++index < length) {
  6718. var key = toKey(path[index]);
  6719. if (!(result = object != null && hasFunc(object, key))) {
  6720. break;
  6721. }
  6722. object = object[key];
  6723. }
  6724. if (result || ++index != length) {
  6725. return result;
  6726. }
  6727. length = object == null ? 0 : object.length;
  6728. return !!length && isLength(length) && isIndex(key, length) &&
  6729. (isArray(object) || isArguments(object));
  6730. }
  6731. /**
  6732. * Initializes an array clone.
  6733. *
  6734. * @private
  6735. * @param {Array} array The array to clone.
  6736. * @returns {Array} Returns the initialized clone.
  6737. */
  6738. function initCloneArray(array) {
  6739. var length = array.length,
  6740. result = new array.constructor(length);
  6741. // Add properties assigned by `RegExp#exec`.
  6742. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6743. result.index = array.index;
  6744. result.input = array.input;
  6745. }
  6746. return result;
  6747. }
  6748. /**
  6749. * Initializes an object clone.
  6750. *
  6751. * @private
  6752. * @param {Object} object The object to clone.
  6753. * @returns {Object} Returns the initialized clone.
  6754. */
  6755. function initCloneObject(object) {
  6756. return (typeof object.constructor == 'function' && !isPrototype(object))
  6757. ? baseCreate(getPrototype(object))
  6758. : {};
  6759. }
  6760. /**
  6761. * Initializes an object clone based on its `toStringTag`.
  6762. *
  6763. * **Note:** This function only supports cloning values with tags of
  6764. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6765. *
  6766. * @private
  6767. * @param {Object} object The object to clone.
  6768. * @param {string} tag The `toStringTag` of the object to clone.
  6769. * @param {boolean} [isDeep] Specify a deep clone.
  6770. * @returns {Object} Returns the initialized clone.
  6771. */
  6772. function initCloneByTag(object, tag, isDeep) {
  6773. var Ctor = object.constructor;
  6774. switch (tag) {
  6775. case arrayBufferTag:
  6776. return cloneArrayBuffer(object);
  6777. case boolTag:
  6778. case dateTag:
  6779. return new Ctor(+object);
  6780. case dataViewTag:
  6781. return cloneDataView(object, isDeep);
  6782. case float32Tag: case float64Tag:
  6783. case int8Tag: case int16Tag: case int32Tag:
  6784. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6785. return cloneTypedArray(object, isDeep);
  6786. case mapTag:
  6787. return new Ctor;
  6788. case numberTag:
  6789. case stringTag:
  6790. return new Ctor(object);
  6791. case regexpTag:
  6792. return cloneRegExp(object);
  6793. case setTag:
  6794. return new Ctor;
  6795. case symbolTag:
  6796. return cloneSymbol(object);
  6797. }
  6798. }
  6799. /**
  6800. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6801. *
  6802. * @private
  6803. * @param {string} source The source to modify.
  6804. * @returns {Array} details The details to insert.
  6805. * @returns {string} Returns the modified source.
  6806. */
  6807. function insertWrapDetails(source, details) {
  6808. var length = details.length;
  6809. if (!length) {
  6810. return source;
  6811. }
  6812. var lastIndex = length - 1;
  6813. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6814. details = details.join(length > 2 ? ', ' : ' ');
  6815. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6816. }
  6817. /**
  6818. * Checks if `value` is a flattenable `arguments` object or array.
  6819. *
  6820. * @private
  6821. * @param {*} value The value to check.
  6822. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6823. */
  6824. function isFlattenable(value) {
  6825. return isArray(value) || isArguments(value) ||
  6826. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6827. }
  6828. /**
  6829. * Checks if `value` is a valid array-like index.
  6830. *
  6831. * @private
  6832. * @param {*} value The value to check.
  6833. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6834. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6835. */
  6836. function isIndex(value, length) {
  6837. var type = typeof value;
  6838. length = length == null ? MAX_SAFE_INTEGER : length;
  6839. return !!length &&
  6840. (type == 'number' ||
  6841. (type != 'symbol' && reIsUint.test(value))) &&
  6842. (value > -1 && value % 1 == 0 && value < length);
  6843. }
  6844. /**
  6845. * Checks if the given arguments are from an iteratee call.
  6846. *
  6847. * @private
  6848. * @param {*} value The potential iteratee value argument.
  6849. * @param {*} index The potential iteratee index or key argument.
  6850. * @param {*} object The potential iteratee object argument.
  6851. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6852. * else `false`.
  6853. */
  6854. function isIterateeCall(value, index, object) {
  6855. if (!isObject(object)) {
  6856. return false;
  6857. }
  6858. var type = typeof index;
  6859. if (type == 'number'
  6860. ? (isArrayLike(object) && isIndex(index, object.length))
  6861. : (type == 'string' && index in object)
  6862. ) {
  6863. return eq(object[index], value);
  6864. }
  6865. return false;
  6866. }
  6867. /**
  6868. * Checks if `value` is a property name and not a property path.
  6869. *
  6870. * @private
  6871. * @param {*} value The value to check.
  6872. * @param {Object} [object] The object to query keys on.
  6873. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6874. */
  6875. function isKey(value, object) {
  6876. if (isArray(value)) {
  6877. return false;
  6878. }
  6879. var type = typeof value;
  6880. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6881. value == null || isSymbol(value)) {
  6882. return true;
  6883. }
  6884. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6885. (object != null && value in Object(object));
  6886. }
  6887. /**
  6888. * Checks if `value` is suitable for use as unique object key.
  6889. *
  6890. * @private
  6891. * @param {*} value The value to check.
  6892. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6893. */
  6894. function isKeyable(value) {
  6895. var type = typeof value;
  6896. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6897. ? (value !== '__proto__')
  6898. : (value === null);
  6899. }
  6900. /**
  6901. * Checks if `func` has a lazy counterpart.
  6902. *
  6903. * @private
  6904. * @param {Function} func The function to check.
  6905. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6906. * else `false`.
  6907. */
  6908. function isLaziable(func) {
  6909. var funcName = getFuncName(func),
  6910. other = lodash[funcName];
  6911. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6912. return false;
  6913. }
  6914. if (func === other) {
  6915. return true;
  6916. }
  6917. var data = getData(other);
  6918. return !!data && func === data[0];
  6919. }
  6920. /**
  6921. * Checks if `func` has its source masked.
  6922. *
  6923. * @private
  6924. * @param {Function} func The function to check.
  6925. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6926. */
  6927. function isMasked(func) {
  6928. return !!maskSrcKey && (maskSrcKey in func);
  6929. }
  6930. /**
  6931. * Checks if `func` is capable of being masked.
  6932. *
  6933. * @private
  6934. * @param {*} value The value to check.
  6935. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6936. */
  6937. var isMaskable = coreJsData ? isFunction : stubFalse;
  6938. /**
  6939. * Checks if `value` is likely a prototype object.
  6940. *
  6941. * @private
  6942. * @param {*} value The value to check.
  6943. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6944. */
  6945. function isPrototype(value) {
  6946. var Ctor = value && value.constructor,
  6947. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6948. return value === proto;
  6949. }
  6950. /**
  6951. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6952. *
  6953. * @private
  6954. * @param {*} value The value to check.
  6955. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6956. * equality comparisons, else `false`.
  6957. */
  6958. function isStrictComparable(value) {
  6959. return value === value && !isObject(value);
  6960. }
  6961. /**
  6962. * A specialized version of `matchesProperty` for source values suitable
  6963. * for strict equality comparisons, i.e. `===`.
  6964. *
  6965. * @private
  6966. * @param {string} key The key of the property to get.
  6967. * @param {*} srcValue The value to match.
  6968. * @returns {Function} Returns the new spec function.
  6969. */
  6970. function matchesStrictComparable(key, srcValue) {
  6971. return function(object) {
  6972. if (object == null) {
  6973. return false;
  6974. }
  6975. return object[key] === srcValue &&
  6976. (srcValue !== undefined || (key in Object(object)));
  6977. };
  6978. }
  6979. /**
  6980. * A specialized version of `_.memoize` which clears the memoized function's
  6981. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  6982. *
  6983. * @private
  6984. * @param {Function} func The function to have its output memoized.
  6985. * @returns {Function} Returns the new memoized function.
  6986. */
  6987. function memoizeCapped(func) {
  6988. var result = memoize(func, function(key) {
  6989. if (cache.size === MAX_MEMOIZE_SIZE) {
  6990. cache.clear();
  6991. }
  6992. return key;
  6993. });
  6994. var cache = result.cache;
  6995. return result;
  6996. }
  6997. /**
  6998. * Merges the function metadata of `source` into `data`.
  6999. *
  7000. * Merging metadata reduces the number of wrappers used to invoke a function.
  7001. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7002. * may be applied regardless of execution order. Methods like `_.ary` and
  7003. * `_.rearg` modify function arguments, making the order in which they are
  7004. * executed important, preventing the merging of metadata. However, we make
  7005. * an exception for a safe combined case where curried functions have `_.ary`
  7006. * and or `_.rearg` applied.
  7007. *
  7008. * @private
  7009. * @param {Array} data The destination metadata.
  7010. * @param {Array} source The source metadata.
  7011. * @returns {Array} Returns `data`.
  7012. */
  7013. function mergeData(data, source) {
  7014. var bitmask = data[1],
  7015. srcBitmask = source[1],
  7016. newBitmask = bitmask | srcBitmask,
  7017. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7018. var isCombo =
  7019. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7020. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7021. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7022. // Exit early if metadata can't be merged.
  7023. if (!(isCommon || isCombo)) {
  7024. return data;
  7025. }
  7026. // Use source `thisArg` if available.
  7027. if (srcBitmask & WRAP_BIND_FLAG) {
  7028. data[2] = source[2];
  7029. // Set when currying a bound function.
  7030. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7031. }
  7032. // Compose partial arguments.
  7033. var value = source[3];
  7034. if (value) {
  7035. var partials = data[3];
  7036. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7037. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7038. }
  7039. // Compose partial right arguments.
  7040. value = source[5];
  7041. if (value) {
  7042. partials = data[5];
  7043. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7044. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7045. }
  7046. // Use source `argPos` if available.
  7047. value = source[7];
  7048. if (value) {
  7049. data[7] = value;
  7050. }
  7051. // Use source `ary` if it's smaller.
  7052. if (srcBitmask & WRAP_ARY_FLAG) {
  7053. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7054. }
  7055. // Use source `arity` if one is not provided.
  7056. if (data[9] == null) {
  7057. data[9] = source[9];
  7058. }
  7059. // Use source `func` and merge bitmasks.
  7060. data[0] = source[0];
  7061. data[1] = newBitmask;
  7062. return data;
  7063. }
  7064. /**
  7065. * This function is like
  7066. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7067. * except that it includes inherited enumerable properties.
  7068. *
  7069. * @private
  7070. * @param {Object} object The object to query.
  7071. * @returns {Array} Returns the array of property names.
  7072. */
  7073. function nativeKeysIn(object) {
  7074. var result = [];
  7075. if (object != null) {
  7076. for (var key in Object(object)) {
  7077. result.push(key);
  7078. }
  7079. }
  7080. return result;
  7081. }
  7082. /**
  7083. * Converts `value` to a string using `Object.prototype.toString`.
  7084. *
  7085. * @private
  7086. * @param {*} value The value to convert.
  7087. * @returns {string} Returns the converted string.
  7088. */
  7089. function objectToString(value) {
  7090. return nativeObjectToString.call(value);
  7091. }
  7092. /**
  7093. * A specialized version of `baseRest` which transforms the rest array.
  7094. *
  7095. * @private
  7096. * @param {Function} func The function to apply a rest parameter to.
  7097. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7098. * @param {Function} transform The rest array transform.
  7099. * @returns {Function} Returns the new function.
  7100. */
  7101. function overRest(func, start, transform) {
  7102. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7103. return function() {
  7104. var args = arguments,
  7105. index = -1,
  7106. length = nativeMax(args.length - start, 0),
  7107. array = Array(length);
  7108. while (++index < length) {
  7109. array[index] = args[start + index];
  7110. }
  7111. index = -1;
  7112. var otherArgs = Array(start + 1);
  7113. while (++index < start) {
  7114. otherArgs[index] = args[index];
  7115. }
  7116. otherArgs[start] = transform(array);
  7117. return apply(func, this, otherArgs);
  7118. };
  7119. }
  7120. /**
  7121. * Gets the parent value at `path` of `object`.
  7122. *
  7123. * @private
  7124. * @param {Object} object The object to query.
  7125. * @param {Array} path The path to get the parent value of.
  7126. * @returns {*} Returns the parent value.
  7127. */
  7128. function parent(object, path) {
  7129. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7130. }
  7131. /**
  7132. * Reorder `array` according to the specified indexes where the element at
  7133. * the first index is assigned as the first element, the element at
  7134. * the second index is assigned as the second element, and so on.
  7135. *
  7136. * @private
  7137. * @param {Array} array The array to reorder.
  7138. * @param {Array} indexes The arranged array indexes.
  7139. * @returns {Array} Returns `array`.
  7140. */
  7141. function reorder(array, indexes) {
  7142. var arrLength = array.length,
  7143. length = nativeMin(indexes.length, arrLength),
  7144. oldArray = copyArray(array);
  7145. while (length--) {
  7146. var index = indexes[length];
  7147. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7148. }
  7149. return array;
  7150. }
  7151. /**
  7152. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7153. *
  7154. * @private
  7155. * @param {Object} object The object to query.
  7156. * @param {string} key The key of the property to get.
  7157. * @returns {*} Returns the property value.
  7158. */
  7159. function safeGet(object, key) {
  7160. if (key === 'constructor' && typeof object[key] === 'function') {
  7161. return;
  7162. }
  7163. if (key == '__proto__') {
  7164. return;
  7165. }
  7166. return object[key];
  7167. }
  7168. /**
  7169. * Sets metadata for `func`.
  7170. *
  7171. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7172. * period of time, it will trip its breaker and transition to an identity
  7173. * function to avoid garbage collection pauses in V8. See
  7174. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7175. * for more details.
  7176. *
  7177. * @private
  7178. * @param {Function} func The function to associate metadata with.
  7179. * @param {*} data The metadata.
  7180. * @returns {Function} Returns `func`.
  7181. */
  7182. var setData = shortOut(baseSetData);
  7183. /**
  7184. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7185. *
  7186. * @private
  7187. * @param {Function} func The function to delay.
  7188. * @param {number} wait The number of milliseconds to delay invocation.
  7189. * @returns {number|Object} Returns the timer id or timeout object.
  7190. */
  7191. var setTimeout = ctxSetTimeout || function(func, wait) {
  7192. return root.setTimeout(func, wait);
  7193. };
  7194. /**
  7195. * Sets the `toString` method of `func` to return `string`.
  7196. *
  7197. * @private
  7198. * @param {Function} func The function to modify.
  7199. * @param {Function} string The `toString` result.
  7200. * @returns {Function} Returns `func`.
  7201. */
  7202. var setToString = shortOut(baseSetToString);
  7203. /**
  7204. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7205. * with wrapper details in a comment at the top of the source body.
  7206. *
  7207. * @private
  7208. * @param {Function} wrapper The function to modify.
  7209. * @param {Function} reference The reference function.
  7210. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7211. * @returns {Function} Returns `wrapper`.
  7212. */
  7213. function setWrapToString(wrapper, reference, bitmask) {
  7214. var source = (reference + '');
  7215. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7216. }
  7217. /**
  7218. * Creates a function that'll short out and invoke `identity` instead
  7219. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7220. * milliseconds.
  7221. *
  7222. * @private
  7223. * @param {Function} func The function to restrict.
  7224. * @returns {Function} Returns the new shortable function.
  7225. */
  7226. function shortOut(func) {
  7227. var count = 0,
  7228. lastCalled = 0;
  7229. return function() {
  7230. var stamp = nativeNow(),
  7231. remaining = HOT_SPAN - (stamp - lastCalled);
  7232. lastCalled = stamp;
  7233. if (remaining > 0) {
  7234. if (++count >= HOT_COUNT) {
  7235. return arguments[0];
  7236. }
  7237. } else {
  7238. count = 0;
  7239. }
  7240. return func.apply(undefined, arguments);
  7241. };
  7242. }
  7243. /**
  7244. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7245. *
  7246. * @private
  7247. * @param {Array} array The array to shuffle.
  7248. * @param {number} [size=array.length] The size of `array`.
  7249. * @returns {Array} Returns `array`.
  7250. */
  7251. function shuffleSelf(array, size) {
  7252. var index = -1,
  7253. length = array.length,
  7254. lastIndex = length - 1;
  7255. size = size === undefined ? length : size;
  7256. while (++index < size) {
  7257. var rand = baseRandom(index, lastIndex),
  7258. value = array[rand];
  7259. array[rand] = array[index];
  7260. array[index] = value;
  7261. }
  7262. array.length = size;
  7263. return array;
  7264. }
  7265. /**
  7266. * Converts `string` to a property path array.
  7267. *
  7268. * @private
  7269. * @param {string} string The string to convert.
  7270. * @returns {Array} Returns the property path array.
  7271. */
  7272. var stringToPath = memoizeCapped(function(string) {
  7273. var result = [];
  7274. if (string.charCodeAt(0) === 46 /* . */) {
  7275. result.push('');
  7276. }
  7277. string.replace(rePropName, function(match, number, quote, subString) {
  7278. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7279. });
  7280. return result;
  7281. });
  7282. /**
  7283. * Converts `value` to a string key if it's not a string or symbol.
  7284. *
  7285. * @private
  7286. * @param {*} value The value to inspect.
  7287. * @returns {string|symbol} Returns the key.
  7288. */
  7289. function toKey(value) {
  7290. if (typeof value == 'string' || isSymbol(value)) {
  7291. return value;
  7292. }
  7293. var result = (value + '');
  7294. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7295. }
  7296. /**
  7297. * Converts `func` to its source code.
  7298. *
  7299. * @private
  7300. * @param {Function} func The function to convert.
  7301. * @returns {string} Returns the source code.
  7302. */
  7303. function toSource(func) {
  7304. if (func != null) {
  7305. try {
  7306. return funcToString.call(func);
  7307. } catch (e) {}
  7308. try {
  7309. return (func + '');
  7310. } catch (e) {}
  7311. }
  7312. return '';
  7313. }
  7314. /**
  7315. * Updates wrapper `details` based on `bitmask` flags.
  7316. *
  7317. * @private
  7318. * @returns {Array} details The details to modify.
  7319. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7320. * @returns {Array} Returns `details`.
  7321. */
  7322. function updateWrapDetails(details, bitmask) {
  7323. arrayEach(wrapFlags, function(pair) {
  7324. var value = '_.' + pair[0];
  7325. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7326. details.push(value);
  7327. }
  7328. });
  7329. return details.sort();
  7330. }
  7331. /**
  7332. * Creates a clone of `wrapper`.
  7333. *
  7334. * @private
  7335. * @param {Object} wrapper The wrapper to clone.
  7336. * @returns {Object} Returns the cloned wrapper.
  7337. */
  7338. function wrapperClone(wrapper) {
  7339. if (wrapper instanceof LazyWrapper) {
  7340. return wrapper.clone();
  7341. }
  7342. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7343. result.__actions__ = copyArray(wrapper.__actions__);
  7344. result.__index__ = wrapper.__index__;
  7345. result.__values__ = wrapper.__values__;
  7346. return result;
  7347. }
  7348. /*------------------------------------------------------------------------*/
  7349. /**
  7350. * Creates an array of elements split into groups the length of `size`.
  7351. * If `array` can't be split evenly, the final chunk will be the remaining
  7352. * elements.
  7353. *
  7354. * @static
  7355. * @memberOf _
  7356. * @since 3.0.0
  7357. * @category Array
  7358. * @param {Array} array The array to process.
  7359. * @param {number} [size=1] The length of each chunk
  7360. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7361. * @returns {Array} Returns the new array of chunks.
  7362. * @example
  7363. *
  7364. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7365. * // => [['a', 'b'], ['c', 'd']]
  7366. *
  7367. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7368. * // => [['a', 'b', 'c'], ['d']]
  7369. */
  7370. function chunk(array, size, guard) {
  7371. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7372. size = 1;
  7373. } else {
  7374. size = nativeMax(toInteger(size), 0);
  7375. }
  7376. var length = array == null ? 0 : array.length;
  7377. if (!length || size < 1) {
  7378. return [];
  7379. }
  7380. var index = 0,
  7381. resIndex = 0,
  7382. result = Array(nativeCeil(length / size));
  7383. while (index < length) {
  7384. result[resIndex++] = baseSlice(array, index, (index += size));
  7385. }
  7386. return result;
  7387. }
  7388. /**
  7389. * Creates an array with all falsey values removed. The values `false`, `null`,
  7390. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7391. *
  7392. * @static
  7393. * @memberOf _
  7394. * @since 0.1.0
  7395. * @category Array
  7396. * @param {Array} array The array to compact.
  7397. * @returns {Array} Returns the new array of filtered values.
  7398. * @example
  7399. *
  7400. * _.compact([0, 1, false, 2, '', 3]);
  7401. * // => [1, 2, 3]
  7402. */
  7403. function compact(array) {
  7404. var index = -1,
  7405. length = array == null ? 0 : array.length,
  7406. resIndex = 0,
  7407. result = [];
  7408. while (++index < length) {
  7409. var value = array[index];
  7410. if (value) {
  7411. result[resIndex++] = value;
  7412. }
  7413. }
  7414. return result;
  7415. }
  7416. /**
  7417. * Creates a new array concatenating `array` with any additional arrays
  7418. * and/or values.
  7419. *
  7420. * @static
  7421. * @memberOf _
  7422. * @since 4.0.0
  7423. * @category Array
  7424. * @param {Array} array The array to concatenate.
  7425. * @param {...*} [values] The values to concatenate.
  7426. * @returns {Array} Returns the new concatenated array.
  7427. * @example
  7428. *
  7429. * var array = [1];
  7430. * var other = _.concat(array, 2, [3], [[4]]);
  7431. *
  7432. * console.log(other);
  7433. * // => [1, 2, 3, [4]]
  7434. *
  7435. * console.log(array);
  7436. * // => [1]
  7437. */
  7438. function concat() {
  7439. var length = arguments.length;
  7440. if (!length) {
  7441. return [];
  7442. }
  7443. var args = Array(length - 1),
  7444. array = arguments[0],
  7445. index = length;
  7446. while (index--) {
  7447. args[index - 1] = arguments[index];
  7448. }
  7449. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7450. }
  7451. /**
  7452. * Creates an array of `array` values not included in the other given arrays
  7453. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7454. * for equality comparisons. The order and references of result values are
  7455. * determined by the first array.
  7456. *
  7457. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7458. *
  7459. * @static
  7460. * @memberOf _
  7461. * @since 0.1.0
  7462. * @category Array
  7463. * @param {Array} array The array to inspect.
  7464. * @param {...Array} [values] The values to exclude.
  7465. * @returns {Array} Returns the new array of filtered values.
  7466. * @see _.without, _.xor
  7467. * @example
  7468. *
  7469. * _.difference([2, 1], [2, 3]);
  7470. * // => [1]
  7471. */
  7472. var difference = baseRest(function(array, values) {
  7473. return isArrayLikeObject(array)
  7474. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7475. : [];
  7476. });
  7477. /**
  7478. * This method is like `_.difference` except that it accepts `iteratee` which
  7479. * is invoked for each element of `array` and `values` to generate the criterion
  7480. * by which they're compared. The order and references of result values are
  7481. * determined by the first array. The iteratee is invoked with one argument:
  7482. * (value).
  7483. *
  7484. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7485. *
  7486. * @static
  7487. * @memberOf _
  7488. * @since 4.0.0
  7489. * @category Array
  7490. * @param {Array} array The array to inspect.
  7491. * @param {...Array} [values] The values to exclude.
  7492. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7493. * @returns {Array} Returns the new array of filtered values.
  7494. * @example
  7495. *
  7496. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7497. * // => [1.2]
  7498. *
  7499. * // The `_.property` iteratee shorthand.
  7500. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7501. * // => [{ 'x': 2 }]
  7502. */
  7503. var differenceBy = baseRest(function(array, values) {
  7504. var iteratee = last(values);
  7505. if (isArrayLikeObject(iteratee)) {
  7506. iteratee = undefined;
  7507. }
  7508. return isArrayLikeObject(array)
  7509. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7510. : [];
  7511. });
  7512. /**
  7513. * This method is like `_.difference` except that it accepts `comparator`
  7514. * which is invoked to compare elements of `array` to `values`. The order and
  7515. * references of result values are determined by the first array. The comparator
  7516. * is invoked with two arguments: (arrVal, othVal).
  7517. *
  7518. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7519. *
  7520. * @static
  7521. * @memberOf _
  7522. * @since 4.0.0
  7523. * @category Array
  7524. * @param {Array} array The array to inspect.
  7525. * @param {...Array} [values] The values to exclude.
  7526. * @param {Function} [comparator] The comparator invoked per element.
  7527. * @returns {Array} Returns the new array of filtered values.
  7528. * @example
  7529. *
  7530. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7531. *
  7532. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7533. * // => [{ 'x': 2, 'y': 1 }]
  7534. */
  7535. var differenceWith = baseRest(function(array, values) {
  7536. var comparator = last(values);
  7537. if (isArrayLikeObject(comparator)) {
  7538. comparator = undefined;
  7539. }
  7540. return isArrayLikeObject(array)
  7541. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7542. : [];
  7543. });
  7544. /**
  7545. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7546. *
  7547. * @static
  7548. * @memberOf _
  7549. * @since 0.5.0
  7550. * @category Array
  7551. * @param {Array} array The array to query.
  7552. * @param {number} [n=1] The number of elements to drop.
  7553. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7554. * @returns {Array} Returns the slice of `array`.
  7555. * @example
  7556. *
  7557. * _.drop([1, 2, 3]);
  7558. * // => [2, 3]
  7559. *
  7560. * _.drop([1, 2, 3], 2);
  7561. * // => [3]
  7562. *
  7563. * _.drop([1, 2, 3], 5);
  7564. * // => []
  7565. *
  7566. * _.drop([1, 2, 3], 0);
  7567. * // => [1, 2, 3]
  7568. */
  7569. function drop(array, n, guard) {
  7570. var length = array == null ? 0 : array.length;
  7571. if (!length) {
  7572. return [];
  7573. }
  7574. n = (guard || n === undefined) ? 1 : toInteger(n);
  7575. return baseSlice(array, n < 0 ? 0 : n, length);
  7576. }
  7577. /**
  7578. * Creates a slice of `array` with `n` elements dropped from the end.
  7579. *
  7580. * @static
  7581. * @memberOf _
  7582. * @since 3.0.0
  7583. * @category Array
  7584. * @param {Array} array The array to query.
  7585. * @param {number} [n=1] The number of elements to drop.
  7586. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7587. * @returns {Array} Returns the slice of `array`.
  7588. * @example
  7589. *
  7590. * _.dropRight([1, 2, 3]);
  7591. * // => [1, 2]
  7592. *
  7593. * _.dropRight([1, 2, 3], 2);
  7594. * // => [1]
  7595. *
  7596. * _.dropRight([1, 2, 3], 5);
  7597. * // => []
  7598. *
  7599. * _.dropRight([1, 2, 3], 0);
  7600. * // => [1, 2, 3]
  7601. */
  7602. function dropRight(array, n, guard) {
  7603. var length = array == null ? 0 : array.length;
  7604. if (!length) {
  7605. return [];
  7606. }
  7607. n = (guard || n === undefined) ? 1 : toInteger(n);
  7608. n = length - n;
  7609. return baseSlice(array, 0, n < 0 ? 0 : n);
  7610. }
  7611. /**
  7612. * Creates a slice of `array` excluding elements dropped from the end.
  7613. * Elements are dropped until `predicate` returns falsey. The predicate is
  7614. * invoked with three arguments: (value, index, array).
  7615. *
  7616. * @static
  7617. * @memberOf _
  7618. * @since 3.0.0
  7619. * @category Array
  7620. * @param {Array} array The array to query.
  7621. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7622. * @returns {Array} Returns the slice of `array`.
  7623. * @example
  7624. *
  7625. * var users = [
  7626. * { 'user': 'barney', 'active': true },
  7627. * { 'user': 'fred', 'active': false },
  7628. * { 'user': 'pebbles', 'active': false }
  7629. * ];
  7630. *
  7631. * _.dropRightWhile(users, function(o) { return !o.active; });
  7632. * // => objects for ['barney']
  7633. *
  7634. * // The `_.matches` iteratee shorthand.
  7635. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7636. * // => objects for ['barney', 'fred']
  7637. *
  7638. * // The `_.matchesProperty` iteratee shorthand.
  7639. * _.dropRightWhile(users, ['active', false]);
  7640. * // => objects for ['barney']
  7641. *
  7642. * // The `_.property` iteratee shorthand.
  7643. * _.dropRightWhile(users, 'active');
  7644. * // => objects for ['barney', 'fred', 'pebbles']
  7645. */
  7646. function dropRightWhile(array, predicate) {
  7647. return (array && array.length)
  7648. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7649. : [];
  7650. }
  7651. /**
  7652. * Creates a slice of `array` excluding elements dropped from the beginning.
  7653. * Elements are dropped until `predicate` returns falsey. The predicate is
  7654. * invoked with three arguments: (value, index, array).
  7655. *
  7656. * @static
  7657. * @memberOf _
  7658. * @since 3.0.0
  7659. * @category Array
  7660. * @param {Array} array The array to query.
  7661. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7662. * @returns {Array} Returns the slice of `array`.
  7663. * @example
  7664. *
  7665. * var users = [
  7666. * { 'user': 'barney', 'active': false },
  7667. * { 'user': 'fred', 'active': false },
  7668. * { 'user': 'pebbles', 'active': true }
  7669. * ];
  7670. *
  7671. * _.dropWhile(users, function(o) { return !o.active; });
  7672. * // => objects for ['pebbles']
  7673. *
  7674. * // The `_.matches` iteratee shorthand.
  7675. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7676. * // => objects for ['fred', 'pebbles']
  7677. *
  7678. * // The `_.matchesProperty` iteratee shorthand.
  7679. * _.dropWhile(users, ['active', false]);
  7680. * // => objects for ['pebbles']
  7681. *
  7682. * // The `_.property` iteratee shorthand.
  7683. * _.dropWhile(users, 'active');
  7684. * // => objects for ['barney', 'fred', 'pebbles']
  7685. */
  7686. function dropWhile(array, predicate) {
  7687. return (array && array.length)
  7688. ? baseWhile(array, getIteratee(predicate, 3), true)
  7689. : [];
  7690. }
  7691. /**
  7692. * Fills elements of `array` with `value` from `start` up to, but not
  7693. * including, `end`.
  7694. *
  7695. * **Note:** This method mutates `array`.
  7696. *
  7697. * @static
  7698. * @memberOf _
  7699. * @since 3.2.0
  7700. * @category Array
  7701. * @param {Array} array The array to fill.
  7702. * @param {*} value The value to fill `array` with.
  7703. * @param {number} [start=0] The start position.
  7704. * @param {number} [end=array.length] The end position.
  7705. * @returns {Array} Returns `array`.
  7706. * @example
  7707. *
  7708. * var array = [1, 2, 3];
  7709. *
  7710. * _.fill(array, 'a');
  7711. * console.log(array);
  7712. * // => ['a', 'a', 'a']
  7713. *
  7714. * _.fill(Array(3), 2);
  7715. * // => [2, 2, 2]
  7716. *
  7717. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7718. * // => [4, '*', '*', 10]
  7719. */
  7720. function fill(array, value, start, end) {
  7721. var length = array == null ? 0 : array.length;
  7722. if (!length) {
  7723. return [];
  7724. }
  7725. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7726. start = 0;
  7727. end = length;
  7728. }
  7729. return baseFill(array, value, start, end);
  7730. }
  7731. /**
  7732. * This method is like `_.find` except that it returns the index of the first
  7733. * element `predicate` returns truthy for instead of the element itself.
  7734. *
  7735. * @static
  7736. * @memberOf _
  7737. * @since 1.1.0
  7738. * @category Array
  7739. * @param {Array} array The array to inspect.
  7740. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7741. * @param {number} [fromIndex=0] The index to search from.
  7742. * @returns {number} Returns the index of the found element, else `-1`.
  7743. * @example
  7744. *
  7745. * var users = [
  7746. * { 'user': 'barney', 'active': false },
  7747. * { 'user': 'fred', 'active': false },
  7748. * { 'user': 'pebbles', 'active': true }
  7749. * ];
  7750. *
  7751. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7752. * // => 0
  7753. *
  7754. * // The `_.matches` iteratee shorthand.
  7755. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7756. * // => 1
  7757. *
  7758. * // The `_.matchesProperty` iteratee shorthand.
  7759. * _.findIndex(users, ['active', false]);
  7760. * // => 0
  7761. *
  7762. * // The `_.property` iteratee shorthand.
  7763. * _.findIndex(users, 'active');
  7764. * // => 2
  7765. */
  7766. function findIndex(array, predicate, fromIndex) {
  7767. var length = array == null ? 0 : array.length;
  7768. if (!length) {
  7769. return -1;
  7770. }
  7771. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7772. if (index < 0) {
  7773. index = nativeMax(length + index, 0);
  7774. }
  7775. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7776. }
  7777. /**
  7778. * This method is like `_.findIndex` except that it iterates over elements
  7779. * of `collection` from right to left.
  7780. *
  7781. * @static
  7782. * @memberOf _
  7783. * @since 2.0.0
  7784. * @category Array
  7785. * @param {Array} array The array to inspect.
  7786. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7787. * @param {number} [fromIndex=array.length-1] The index to search from.
  7788. * @returns {number} Returns the index of the found element, else `-1`.
  7789. * @example
  7790. *
  7791. * var users = [
  7792. * { 'user': 'barney', 'active': true },
  7793. * { 'user': 'fred', 'active': false },
  7794. * { 'user': 'pebbles', 'active': false }
  7795. * ];
  7796. *
  7797. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7798. * // => 2
  7799. *
  7800. * // The `_.matches` iteratee shorthand.
  7801. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7802. * // => 0
  7803. *
  7804. * // The `_.matchesProperty` iteratee shorthand.
  7805. * _.findLastIndex(users, ['active', false]);
  7806. * // => 2
  7807. *
  7808. * // The `_.property` iteratee shorthand.
  7809. * _.findLastIndex(users, 'active');
  7810. * // => 0
  7811. */
  7812. function findLastIndex(array, predicate, fromIndex) {
  7813. var length = array == null ? 0 : array.length;
  7814. if (!length) {
  7815. return -1;
  7816. }
  7817. var index = length - 1;
  7818. if (fromIndex !== undefined) {
  7819. index = toInteger(fromIndex);
  7820. index = fromIndex < 0
  7821. ? nativeMax(length + index, 0)
  7822. : nativeMin(index, length - 1);
  7823. }
  7824. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7825. }
  7826. /**
  7827. * Flattens `array` a single level deep.
  7828. *
  7829. * @static
  7830. * @memberOf _
  7831. * @since 0.1.0
  7832. * @category Array
  7833. * @param {Array} array The array to flatten.
  7834. * @returns {Array} Returns the new flattened array.
  7835. * @example
  7836. *
  7837. * _.flatten([1, [2, [3, [4]], 5]]);
  7838. * // => [1, 2, [3, [4]], 5]
  7839. */
  7840. function flatten(array) {
  7841. var length = array == null ? 0 : array.length;
  7842. return length ? baseFlatten(array, 1) : [];
  7843. }
  7844. /**
  7845. * Recursively flattens `array`.
  7846. *
  7847. * @static
  7848. * @memberOf _
  7849. * @since 3.0.0
  7850. * @category Array
  7851. * @param {Array} array The array to flatten.
  7852. * @returns {Array} Returns the new flattened array.
  7853. * @example
  7854. *
  7855. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7856. * // => [1, 2, 3, 4, 5]
  7857. */
  7858. function flattenDeep(array) {
  7859. var length = array == null ? 0 : array.length;
  7860. return length ? baseFlatten(array, INFINITY) : [];
  7861. }
  7862. /**
  7863. * Recursively flatten `array` up to `depth` times.
  7864. *
  7865. * @static
  7866. * @memberOf _
  7867. * @since 4.4.0
  7868. * @category Array
  7869. * @param {Array} array The array to flatten.
  7870. * @param {number} [depth=1] The maximum recursion depth.
  7871. * @returns {Array} Returns the new flattened array.
  7872. * @example
  7873. *
  7874. * var array = [1, [2, [3, [4]], 5]];
  7875. *
  7876. * _.flattenDepth(array, 1);
  7877. * // => [1, 2, [3, [4]], 5]
  7878. *
  7879. * _.flattenDepth(array, 2);
  7880. * // => [1, 2, 3, [4], 5]
  7881. */
  7882. function flattenDepth(array, depth) {
  7883. var length = array == null ? 0 : array.length;
  7884. if (!length) {
  7885. return [];
  7886. }
  7887. depth = depth === undefined ? 1 : toInteger(depth);
  7888. return baseFlatten(array, depth);
  7889. }
  7890. /**
  7891. * The inverse of `_.toPairs`; this method returns an object composed
  7892. * from key-value `pairs`.
  7893. *
  7894. * @static
  7895. * @memberOf _
  7896. * @since 4.0.0
  7897. * @category Array
  7898. * @param {Array} pairs The key-value pairs.
  7899. * @returns {Object} Returns the new object.
  7900. * @example
  7901. *
  7902. * _.fromPairs([['a', 1], ['b', 2]]);
  7903. * // => { 'a': 1, 'b': 2 }
  7904. */
  7905. function fromPairs(pairs) {
  7906. var index = -1,
  7907. length = pairs == null ? 0 : pairs.length,
  7908. result = {};
  7909. while (++index < length) {
  7910. var pair = pairs[index];
  7911. result[pair[0]] = pair[1];
  7912. }
  7913. return result;
  7914. }
  7915. /**
  7916. * Gets the first element of `array`.
  7917. *
  7918. * @static
  7919. * @memberOf _
  7920. * @since 0.1.0
  7921. * @alias first
  7922. * @category Array
  7923. * @param {Array} array The array to query.
  7924. * @returns {*} Returns the first element of `array`.
  7925. * @example
  7926. *
  7927. * _.head([1, 2, 3]);
  7928. * // => 1
  7929. *
  7930. * _.head([]);
  7931. * // => undefined
  7932. */
  7933. function head(array) {
  7934. return (array && array.length) ? array[0] : undefined;
  7935. }
  7936. /**
  7937. * Gets the index at which the first occurrence of `value` is found in `array`
  7938. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7939. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7940. * offset from the end of `array`.
  7941. *
  7942. * @static
  7943. * @memberOf _
  7944. * @since 0.1.0
  7945. * @category Array
  7946. * @param {Array} array The array to inspect.
  7947. * @param {*} value The value to search for.
  7948. * @param {number} [fromIndex=0] The index to search from.
  7949. * @returns {number} Returns the index of the matched value, else `-1`.
  7950. * @example
  7951. *
  7952. * _.indexOf([1, 2, 1, 2], 2);
  7953. * // => 1
  7954. *
  7955. * // Search from the `fromIndex`.
  7956. * _.indexOf([1, 2, 1, 2], 2, 2);
  7957. * // => 3
  7958. */
  7959. function indexOf(array, value, fromIndex) {
  7960. var length = array == null ? 0 : array.length;
  7961. if (!length) {
  7962. return -1;
  7963. }
  7964. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7965. if (index < 0) {
  7966. index = nativeMax(length + index, 0);
  7967. }
  7968. return baseIndexOf(array, value, index);
  7969. }
  7970. /**
  7971. * Gets all but the last element of `array`.
  7972. *
  7973. * @static
  7974. * @memberOf _
  7975. * @since 0.1.0
  7976. * @category Array
  7977. * @param {Array} array The array to query.
  7978. * @returns {Array} Returns the slice of `array`.
  7979. * @example
  7980. *
  7981. * _.initial([1, 2, 3]);
  7982. * // => [1, 2]
  7983. */
  7984. function initial(array) {
  7985. var length = array == null ? 0 : array.length;
  7986. return length ? baseSlice(array, 0, -1) : [];
  7987. }
  7988. /**
  7989. * Creates an array of unique values that are included in all given arrays
  7990. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7991. * for equality comparisons. The order and references of result values are
  7992. * determined by the first array.
  7993. *
  7994. * @static
  7995. * @memberOf _
  7996. * @since 0.1.0
  7997. * @category Array
  7998. * @param {...Array} [arrays] The arrays to inspect.
  7999. * @returns {Array} Returns the new array of intersecting values.
  8000. * @example
  8001. *
  8002. * _.intersection([2, 1], [2, 3]);
  8003. * // => [2]
  8004. */
  8005. var intersection = baseRest(function(arrays) {
  8006. var mapped = arrayMap(arrays, castArrayLikeObject);
  8007. return (mapped.length && mapped[0] === arrays[0])
  8008. ? baseIntersection(mapped)
  8009. : [];
  8010. });
  8011. /**
  8012. * This method is like `_.intersection` except that it accepts `iteratee`
  8013. * which is invoked for each element of each `arrays` to generate the criterion
  8014. * by which they're compared. The order and references of result values are
  8015. * determined by the first array. The iteratee is invoked with one argument:
  8016. * (value).
  8017. *
  8018. * @static
  8019. * @memberOf _
  8020. * @since 4.0.0
  8021. * @category Array
  8022. * @param {...Array} [arrays] The arrays to inspect.
  8023. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8024. * @returns {Array} Returns the new array of intersecting values.
  8025. * @example
  8026. *
  8027. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8028. * // => [2.1]
  8029. *
  8030. * // The `_.property` iteratee shorthand.
  8031. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8032. * // => [{ 'x': 1 }]
  8033. */
  8034. var intersectionBy = baseRest(function(arrays) {
  8035. var iteratee = last(arrays),
  8036. mapped = arrayMap(arrays, castArrayLikeObject);
  8037. if (iteratee === last(mapped)) {
  8038. iteratee = undefined;
  8039. } else {
  8040. mapped.pop();
  8041. }
  8042. return (mapped.length && mapped[0] === arrays[0])
  8043. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8044. : [];
  8045. });
  8046. /**
  8047. * This method is like `_.intersection` except that it accepts `comparator`
  8048. * which is invoked to compare elements of `arrays`. The order and references
  8049. * of result values are determined by the first array. The comparator is
  8050. * invoked with two arguments: (arrVal, othVal).
  8051. *
  8052. * @static
  8053. * @memberOf _
  8054. * @since 4.0.0
  8055. * @category Array
  8056. * @param {...Array} [arrays] The arrays to inspect.
  8057. * @param {Function} [comparator] The comparator invoked per element.
  8058. * @returns {Array} Returns the new array of intersecting values.
  8059. * @example
  8060. *
  8061. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8062. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8063. *
  8064. * _.intersectionWith(objects, others, _.isEqual);
  8065. * // => [{ 'x': 1, 'y': 2 }]
  8066. */
  8067. var intersectionWith = baseRest(function(arrays) {
  8068. var comparator = last(arrays),
  8069. mapped = arrayMap(arrays, castArrayLikeObject);
  8070. comparator = typeof comparator == 'function' ? comparator : undefined;
  8071. if (comparator) {
  8072. mapped.pop();
  8073. }
  8074. return (mapped.length && mapped[0] === arrays[0])
  8075. ? baseIntersection(mapped, undefined, comparator)
  8076. : [];
  8077. });
  8078. /**
  8079. * Converts all elements in `array` into a string separated by `separator`.
  8080. *
  8081. * @static
  8082. * @memberOf _
  8083. * @since 4.0.0
  8084. * @category Array
  8085. * @param {Array} array The array to convert.
  8086. * @param {string} [separator=','] The element separator.
  8087. * @returns {string} Returns the joined string.
  8088. * @example
  8089. *
  8090. * _.join(['a', 'b', 'c'], '~');
  8091. * // => 'a~b~c'
  8092. */
  8093. function join(array, separator) {
  8094. return array == null ? '' : nativeJoin.call(array, separator);
  8095. }
  8096. /**
  8097. * Gets the last element of `array`.
  8098. *
  8099. * @static
  8100. * @memberOf _
  8101. * @since 0.1.0
  8102. * @category Array
  8103. * @param {Array} array The array to query.
  8104. * @returns {*} Returns the last element of `array`.
  8105. * @example
  8106. *
  8107. * _.last([1, 2, 3]);
  8108. * // => 3
  8109. */
  8110. function last(array) {
  8111. var length = array == null ? 0 : array.length;
  8112. return length ? array[length - 1] : undefined;
  8113. }
  8114. /**
  8115. * This method is like `_.indexOf` except that it iterates over elements of
  8116. * `array` from right to left.
  8117. *
  8118. * @static
  8119. * @memberOf _
  8120. * @since 0.1.0
  8121. * @category Array
  8122. * @param {Array} array The array to inspect.
  8123. * @param {*} value The value to search for.
  8124. * @param {number} [fromIndex=array.length-1] The index to search from.
  8125. * @returns {number} Returns the index of the matched value, else `-1`.
  8126. * @example
  8127. *
  8128. * _.lastIndexOf([1, 2, 1, 2], 2);
  8129. * // => 3
  8130. *
  8131. * // Search from the `fromIndex`.
  8132. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8133. * // => 1
  8134. */
  8135. function lastIndexOf(array, value, fromIndex) {
  8136. var length = array == null ? 0 : array.length;
  8137. if (!length) {
  8138. return -1;
  8139. }
  8140. var index = length;
  8141. if (fromIndex !== undefined) {
  8142. index = toInteger(fromIndex);
  8143. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8144. }
  8145. return value === value
  8146. ? strictLastIndexOf(array, value, index)
  8147. : baseFindIndex(array, baseIsNaN, index, true);
  8148. }
  8149. /**
  8150. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8151. * element from the end is returned.
  8152. *
  8153. * @static
  8154. * @memberOf _
  8155. * @since 4.11.0
  8156. * @category Array
  8157. * @param {Array} array The array to query.
  8158. * @param {number} [n=0] The index of the element to return.
  8159. * @returns {*} Returns the nth element of `array`.
  8160. * @example
  8161. *
  8162. * var array = ['a', 'b', 'c', 'd'];
  8163. *
  8164. * _.nth(array, 1);
  8165. * // => 'b'
  8166. *
  8167. * _.nth(array, -2);
  8168. * // => 'c';
  8169. */
  8170. function nth(array, n) {
  8171. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8172. }
  8173. /**
  8174. * Removes all given values from `array` using
  8175. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8176. * for equality comparisons.
  8177. *
  8178. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8179. * to remove elements from an array by predicate.
  8180. *
  8181. * @static
  8182. * @memberOf _
  8183. * @since 2.0.0
  8184. * @category Array
  8185. * @param {Array} array The array to modify.
  8186. * @param {...*} [values] The values to remove.
  8187. * @returns {Array} Returns `array`.
  8188. * @example
  8189. *
  8190. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8191. *
  8192. * _.pull(array, 'a', 'c');
  8193. * console.log(array);
  8194. * // => ['b', 'b']
  8195. */
  8196. var pull = baseRest(pullAll);
  8197. /**
  8198. * This method is like `_.pull` except that it accepts an array of values to remove.
  8199. *
  8200. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8201. *
  8202. * @static
  8203. * @memberOf _
  8204. * @since 4.0.0
  8205. * @category Array
  8206. * @param {Array} array The array to modify.
  8207. * @param {Array} values The values to remove.
  8208. * @returns {Array} Returns `array`.
  8209. * @example
  8210. *
  8211. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8212. *
  8213. * _.pullAll(array, ['a', 'c']);
  8214. * console.log(array);
  8215. * // => ['b', 'b']
  8216. */
  8217. function pullAll(array, values) {
  8218. return (array && array.length && values && values.length)
  8219. ? basePullAll(array, values)
  8220. : array;
  8221. }
  8222. /**
  8223. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8224. * invoked for each element of `array` and `values` to generate the criterion
  8225. * by which they're compared. The iteratee is invoked with one argument: (value).
  8226. *
  8227. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8228. *
  8229. * @static
  8230. * @memberOf _
  8231. * @since 4.0.0
  8232. * @category Array
  8233. * @param {Array} array The array to modify.
  8234. * @param {Array} values The values to remove.
  8235. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8236. * @returns {Array} Returns `array`.
  8237. * @example
  8238. *
  8239. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8240. *
  8241. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8242. * console.log(array);
  8243. * // => [{ 'x': 2 }]
  8244. */
  8245. function pullAllBy(array, values, iteratee) {
  8246. return (array && array.length && values && values.length)
  8247. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8248. : array;
  8249. }
  8250. /**
  8251. * This method is like `_.pullAll` except that it accepts `comparator` which
  8252. * is invoked to compare elements of `array` to `values`. The comparator is
  8253. * invoked with two arguments: (arrVal, othVal).
  8254. *
  8255. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8256. *
  8257. * @static
  8258. * @memberOf _
  8259. * @since 4.6.0
  8260. * @category Array
  8261. * @param {Array} array The array to modify.
  8262. * @param {Array} values The values to remove.
  8263. * @param {Function} [comparator] The comparator invoked per element.
  8264. * @returns {Array} Returns `array`.
  8265. * @example
  8266. *
  8267. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8268. *
  8269. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8270. * console.log(array);
  8271. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8272. */
  8273. function pullAllWith(array, values, comparator) {
  8274. return (array && array.length && values && values.length)
  8275. ? basePullAll(array, values, undefined, comparator)
  8276. : array;
  8277. }
  8278. /**
  8279. * Removes elements from `array` corresponding to `indexes` and returns an
  8280. * array of removed elements.
  8281. *
  8282. * **Note:** Unlike `_.at`, this method mutates `array`.
  8283. *
  8284. * @static
  8285. * @memberOf _
  8286. * @since 3.0.0
  8287. * @category Array
  8288. * @param {Array} array The array to modify.
  8289. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8290. * @returns {Array} Returns the new array of removed elements.
  8291. * @example
  8292. *
  8293. * var array = ['a', 'b', 'c', 'd'];
  8294. * var pulled = _.pullAt(array, [1, 3]);
  8295. *
  8296. * console.log(array);
  8297. * // => ['a', 'c']
  8298. *
  8299. * console.log(pulled);
  8300. * // => ['b', 'd']
  8301. */
  8302. var pullAt = flatRest(function(array, indexes) {
  8303. var length = array == null ? 0 : array.length,
  8304. result = baseAt(array, indexes);
  8305. basePullAt(array, arrayMap(indexes, function(index) {
  8306. return isIndex(index, length) ? +index : index;
  8307. }).sort(compareAscending));
  8308. return result;
  8309. });
  8310. /**
  8311. * Removes all elements from `array` that `predicate` returns truthy for
  8312. * and returns an array of the removed elements. The predicate is invoked
  8313. * with three arguments: (value, index, array).
  8314. *
  8315. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8316. * to pull elements from an array by value.
  8317. *
  8318. * @static
  8319. * @memberOf _
  8320. * @since 2.0.0
  8321. * @category Array
  8322. * @param {Array} array The array to modify.
  8323. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8324. * @returns {Array} Returns the new array of removed elements.
  8325. * @example
  8326. *
  8327. * var array = [1, 2, 3, 4];
  8328. * var evens = _.remove(array, function(n) {
  8329. * return n % 2 == 0;
  8330. * });
  8331. *
  8332. * console.log(array);
  8333. * // => [1, 3]
  8334. *
  8335. * console.log(evens);
  8336. * // => [2, 4]
  8337. */
  8338. function remove(array, predicate) {
  8339. var result = [];
  8340. if (!(array && array.length)) {
  8341. return result;
  8342. }
  8343. var index = -1,
  8344. indexes = [],
  8345. length = array.length;
  8346. predicate = getIteratee(predicate, 3);
  8347. while (++index < length) {
  8348. var value = array[index];
  8349. if (predicate(value, index, array)) {
  8350. result.push(value);
  8351. indexes.push(index);
  8352. }
  8353. }
  8354. basePullAt(array, indexes);
  8355. return result;
  8356. }
  8357. /**
  8358. * Reverses `array` so that the first element becomes the last, the second
  8359. * element becomes the second to last, and so on.
  8360. *
  8361. * **Note:** This method mutates `array` and is based on
  8362. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8363. *
  8364. * @static
  8365. * @memberOf _
  8366. * @since 4.0.0
  8367. * @category Array
  8368. * @param {Array} array The array to modify.
  8369. * @returns {Array} Returns `array`.
  8370. * @example
  8371. *
  8372. * var array = [1, 2, 3];
  8373. *
  8374. * _.reverse(array);
  8375. * // => [3, 2, 1]
  8376. *
  8377. * console.log(array);
  8378. * // => [3, 2, 1]
  8379. */
  8380. function reverse(array) {
  8381. return array == null ? array : nativeReverse.call(array);
  8382. }
  8383. /**
  8384. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8385. *
  8386. * **Note:** This method is used instead of
  8387. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8388. * returned.
  8389. *
  8390. * @static
  8391. * @memberOf _
  8392. * @since 3.0.0
  8393. * @category Array
  8394. * @param {Array} array The array to slice.
  8395. * @param {number} [start=0] The start position.
  8396. * @param {number} [end=array.length] The end position.
  8397. * @returns {Array} Returns the slice of `array`.
  8398. */
  8399. function slice(array, start, end) {
  8400. var length = array == null ? 0 : array.length;
  8401. if (!length) {
  8402. return [];
  8403. }
  8404. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8405. start = 0;
  8406. end = length;
  8407. }
  8408. else {
  8409. start = start == null ? 0 : toInteger(start);
  8410. end = end === undefined ? length : toInteger(end);
  8411. }
  8412. return baseSlice(array, start, end);
  8413. }
  8414. /**
  8415. * Uses a binary search to determine the lowest index at which `value`
  8416. * should be inserted into `array` in order to maintain its sort order.
  8417. *
  8418. * @static
  8419. * @memberOf _
  8420. * @since 0.1.0
  8421. * @category Array
  8422. * @param {Array} array The sorted array to inspect.
  8423. * @param {*} value The value to evaluate.
  8424. * @returns {number} Returns the index at which `value` should be inserted
  8425. * into `array`.
  8426. * @example
  8427. *
  8428. * _.sortedIndex([30, 50], 40);
  8429. * // => 1
  8430. */
  8431. function sortedIndex(array, value) {
  8432. return baseSortedIndex(array, value);
  8433. }
  8434. /**
  8435. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8436. * which is invoked for `value` and each element of `array` to compute their
  8437. * sort ranking. The iteratee is invoked with one argument: (value).
  8438. *
  8439. * @static
  8440. * @memberOf _
  8441. * @since 4.0.0
  8442. * @category Array
  8443. * @param {Array} array The sorted array to inspect.
  8444. * @param {*} value The value to evaluate.
  8445. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8446. * @returns {number} Returns the index at which `value` should be inserted
  8447. * into `array`.
  8448. * @example
  8449. *
  8450. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8451. *
  8452. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8453. * // => 0
  8454. *
  8455. * // The `_.property` iteratee shorthand.
  8456. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8457. * // => 0
  8458. */
  8459. function sortedIndexBy(array, value, iteratee) {
  8460. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8461. }
  8462. /**
  8463. * This method is like `_.indexOf` except that it performs a binary
  8464. * search on a sorted `array`.
  8465. *
  8466. * @static
  8467. * @memberOf _
  8468. * @since 4.0.0
  8469. * @category Array
  8470. * @param {Array} array The array to inspect.
  8471. * @param {*} value The value to search for.
  8472. * @returns {number} Returns the index of the matched value, else `-1`.
  8473. * @example
  8474. *
  8475. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8476. * // => 1
  8477. */
  8478. function sortedIndexOf(array, value) {
  8479. var length = array == null ? 0 : array.length;
  8480. if (length) {
  8481. var index = baseSortedIndex(array, value);
  8482. if (index < length && eq(array[index], value)) {
  8483. return index;
  8484. }
  8485. }
  8486. return -1;
  8487. }
  8488. /**
  8489. * This method is like `_.sortedIndex` except that it returns the highest
  8490. * index at which `value` should be inserted into `array` in order to
  8491. * maintain its sort order.
  8492. *
  8493. * @static
  8494. * @memberOf _
  8495. * @since 3.0.0
  8496. * @category Array
  8497. * @param {Array} array The sorted array to inspect.
  8498. * @param {*} value The value to evaluate.
  8499. * @returns {number} Returns the index at which `value` should be inserted
  8500. * into `array`.
  8501. * @example
  8502. *
  8503. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8504. * // => 4
  8505. */
  8506. function sortedLastIndex(array, value) {
  8507. return baseSortedIndex(array, value, true);
  8508. }
  8509. /**
  8510. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8511. * which is invoked for `value` and each element of `array` to compute their
  8512. * sort ranking. The iteratee is invoked with one argument: (value).
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.0.0
  8517. * @category Array
  8518. * @param {Array} array The sorted array to inspect.
  8519. * @param {*} value The value to evaluate.
  8520. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8521. * @returns {number} Returns the index at which `value` should be inserted
  8522. * into `array`.
  8523. * @example
  8524. *
  8525. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8526. *
  8527. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8528. * // => 1
  8529. *
  8530. * // The `_.property` iteratee shorthand.
  8531. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8532. * // => 1
  8533. */
  8534. function sortedLastIndexBy(array, value, iteratee) {
  8535. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8536. }
  8537. /**
  8538. * This method is like `_.lastIndexOf` except that it performs a binary
  8539. * search on a sorted `array`.
  8540. *
  8541. * @static
  8542. * @memberOf _
  8543. * @since 4.0.0
  8544. * @category Array
  8545. * @param {Array} array The array to inspect.
  8546. * @param {*} value The value to search for.
  8547. * @returns {number} Returns the index of the matched value, else `-1`.
  8548. * @example
  8549. *
  8550. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8551. * // => 3
  8552. */
  8553. function sortedLastIndexOf(array, value) {
  8554. var length = array == null ? 0 : array.length;
  8555. if (length) {
  8556. var index = baseSortedIndex(array, value, true) - 1;
  8557. if (eq(array[index], value)) {
  8558. return index;
  8559. }
  8560. }
  8561. return -1;
  8562. }
  8563. /**
  8564. * This method is like `_.uniq` except that it's designed and optimized
  8565. * for sorted arrays.
  8566. *
  8567. * @static
  8568. * @memberOf _
  8569. * @since 4.0.0
  8570. * @category Array
  8571. * @param {Array} array The array to inspect.
  8572. * @returns {Array} Returns the new duplicate free array.
  8573. * @example
  8574. *
  8575. * _.sortedUniq([1, 1, 2]);
  8576. * // => [1, 2]
  8577. */
  8578. function sortedUniq(array) {
  8579. return (array && array.length)
  8580. ? baseSortedUniq(array)
  8581. : [];
  8582. }
  8583. /**
  8584. * This method is like `_.uniqBy` except that it's designed and optimized
  8585. * for sorted arrays.
  8586. *
  8587. * @static
  8588. * @memberOf _
  8589. * @since 4.0.0
  8590. * @category Array
  8591. * @param {Array} array The array to inspect.
  8592. * @param {Function} [iteratee] The iteratee invoked per element.
  8593. * @returns {Array} Returns the new duplicate free array.
  8594. * @example
  8595. *
  8596. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8597. * // => [1.1, 2.3]
  8598. */
  8599. function sortedUniqBy(array, iteratee) {
  8600. return (array && array.length)
  8601. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8602. : [];
  8603. }
  8604. /**
  8605. * Gets all but the first element of `array`.
  8606. *
  8607. * @static
  8608. * @memberOf _
  8609. * @since 4.0.0
  8610. * @category Array
  8611. * @param {Array} array The array to query.
  8612. * @returns {Array} Returns the slice of `array`.
  8613. * @example
  8614. *
  8615. * _.tail([1, 2, 3]);
  8616. * // => [2, 3]
  8617. */
  8618. function tail(array) {
  8619. var length = array == null ? 0 : array.length;
  8620. return length ? baseSlice(array, 1, length) : [];
  8621. }
  8622. /**
  8623. * Creates a slice of `array` with `n` elements taken from the beginning.
  8624. *
  8625. * @static
  8626. * @memberOf _
  8627. * @since 0.1.0
  8628. * @category Array
  8629. * @param {Array} array The array to query.
  8630. * @param {number} [n=1] The number of elements to take.
  8631. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8632. * @returns {Array} Returns the slice of `array`.
  8633. * @example
  8634. *
  8635. * _.take([1, 2, 3]);
  8636. * // => [1]
  8637. *
  8638. * _.take([1, 2, 3], 2);
  8639. * // => [1, 2]
  8640. *
  8641. * _.take([1, 2, 3], 5);
  8642. * // => [1, 2, 3]
  8643. *
  8644. * _.take([1, 2, 3], 0);
  8645. * // => []
  8646. */
  8647. function take(array, n, guard) {
  8648. if (!(array && array.length)) {
  8649. return [];
  8650. }
  8651. n = (guard || n === undefined) ? 1 : toInteger(n);
  8652. return baseSlice(array, 0, n < 0 ? 0 : n);
  8653. }
  8654. /**
  8655. * Creates a slice of `array` with `n` elements taken from the end.
  8656. *
  8657. * @static
  8658. * @memberOf _
  8659. * @since 3.0.0
  8660. * @category Array
  8661. * @param {Array} array The array to query.
  8662. * @param {number} [n=1] The number of elements to take.
  8663. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8664. * @returns {Array} Returns the slice of `array`.
  8665. * @example
  8666. *
  8667. * _.takeRight([1, 2, 3]);
  8668. * // => [3]
  8669. *
  8670. * _.takeRight([1, 2, 3], 2);
  8671. * // => [2, 3]
  8672. *
  8673. * _.takeRight([1, 2, 3], 5);
  8674. * // => [1, 2, 3]
  8675. *
  8676. * _.takeRight([1, 2, 3], 0);
  8677. * // => []
  8678. */
  8679. function takeRight(array, n, guard) {
  8680. var length = array == null ? 0 : array.length;
  8681. if (!length) {
  8682. return [];
  8683. }
  8684. n = (guard || n === undefined) ? 1 : toInteger(n);
  8685. n = length - n;
  8686. return baseSlice(array, n < 0 ? 0 : n, length);
  8687. }
  8688. /**
  8689. * Creates a slice of `array` with elements taken from the end. Elements are
  8690. * taken until `predicate` returns falsey. The predicate is invoked with
  8691. * three arguments: (value, index, array).
  8692. *
  8693. * @static
  8694. * @memberOf _
  8695. * @since 3.0.0
  8696. * @category Array
  8697. * @param {Array} array The array to query.
  8698. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8699. * @returns {Array} Returns the slice of `array`.
  8700. * @example
  8701. *
  8702. * var users = [
  8703. * { 'user': 'barney', 'active': true },
  8704. * { 'user': 'fred', 'active': false },
  8705. * { 'user': 'pebbles', 'active': false }
  8706. * ];
  8707. *
  8708. * _.takeRightWhile(users, function(o) { return !o.active; });
  8709. * // => objects for ['fred', 'pebbles']
  8710. *
  8711. * // The `_.matches` iteratee shorthand.
  8712. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8713. * // => objects for ['pebbles']
  8714. *
  8715. * // The `_.matchesProperty` iteratee shorthand.
  8716. * _.takeRightWhile(users, ['active', false]);
  8717. * // => objects for ['fred', 'pebbles']
  8718. *
  8719. * // The `_.property` iteratee shorthand.
  8720. * _.takeRightWhile(users, 'active');
  8721. * // => []
  8722. */
  8723. function takeRightWhile(array, predicate) {
  8724. return (array && array.length)
  8725. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8726. : [];
  8727. }
  8728. /**
  8729. * Creates a slice of `array` with elements taken from the beginning. Elements
  8730. * are taken until `predicate` returns falsey. The predicate is invoked with
  8731. * three arguments: (value, index, array).
  8732. *
  8733. * @static
  8734. * @memberOf _
  8735. * @since 3.0.0
  8736. * @category Array
  8737. * @param {Array} array The array to query.
  8738. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8739. * @returns {Array} Returns the slice of `array`.
  8740. * @example
  8741. *
  8742. * var users = [
  8743. * { 'user': 'barney', 'active': false },
  8744. * { 'user': 'fred', 'active': false },
  8745. * { 'user': 'pebbles', 'active': true }
  8746. * ];
  8747. *
  8748. * _.takeWhile(users, function(o) { return !o.active; });
  8749. * // => objects for ['barney', 'fred']
  8750. *
  8751. * // The `_.matches` iteratee shorthand.
  8752. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8753. * // => objects for ['barney']
  8754. *
  8755. * // The `_.matchesProperty` iteratee shorthand.
  8756. * _.takeWhile(users, ['active', false]);
  8757. * // => objects for ['barney', 'fred']
  8758. *
  8759. * // The `_.property` iteratee shorthand.
  8760. * _.takeWhile(users, 'active');
  8761. * // => []
  8762. */
  8763. function takeWhile(array, predicate) {
  8764. return (array && array.length)
  8765. ? baseWhile(array, getIteratee(predicate, 3))
  8766. : [];
  8767. }
  8768. /**
  8769. * Creates an array of unique values, in order, from all given arrays using
  8770. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8771. * for equality comparisons.
  8772. *
  8773. * @static
  8774. * @memberOf _
  8775. * @since 0.1.0
  8776. * @category Array
  8777. * @param {...Array} [arrays] The arrays to inspect.
  8778. * @returns {Array} Returns the new array of combined values.
  8779. * @example
  8780. *
  8781. * _.union([2], [1, 2]);
  8782. * // => [2, 1]
  8783. */
  8784. var union = baseRest(function(arrays) {
  8785. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8786. });
  8787. /**
  8788. * This method is like `_.union` except that it accepts `iteratee` which is
  8789. * invoked for each element of each `arrays` to generate the criterion by
  8790. * which uniqueness is computed. Result values are chosen from the first
  8791. * array in which the value occurs. The iteratee is invoked with one argument:
  8792. * (value).
  8793. *
  8794. * @static
  8795. * @memberOf _
  8796. * @since 4.0.0
  8797. * @category Array
  8798. * @param {...Array} [arrays] The arrays to inspect.
  8799. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8800. * @returns {Array} Returns the new array of combined values.
  8801. * @example
  8802. *
  8803. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8804. * // => [2.1, 1.2]
  8805. *
  8806. * // The `_.property` iteratee shorthand.
  8807. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8808. * // => [{ 'x': 1 }, { 'x': 2 }]
  8809. */
  8810. var unionBy = baseRest(function(arrays) {
  8811. var iteratee = last(arrays);
  8812. if (isArrayLikeObject(iteratee)) {
  8813. iteratee = undefined;
  8814. }
  8815. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8816. });
  8817. /**
  8818. * This method is like `_.union` except that it accepts `comparator` which
  8819. * is invoked to compare elements of `arrays`. Result values are chosen from
  8820. * the first array in which the value occurs. The comparator is invoked
  8821. * with two arguments: (arrVal, othVal).
  8822. *
  8823. * @static
  8824. * @memberOf _
  8825. * @since 4.0.0
  8826. * @category Array
  8827. * @param {...Array} [arrays] The arrays to inspect.
  8828. * @param {Function} [comparator] The comparator invoked per element.
  8829. * @returns {Array} Returns the new array of combined values.
  8830. * @example
  8831. *
  8832. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8833. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8834. *
  8835. * _.unionWith(objects, others, _.isEqual);
  8836. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8837. */
  8838. var unionWith = baseRest(function(arrays) {
  8839. var comparator = last(arrays);
  8840. comparator = typeof comparator == 'function' ? comparator : undefined;
  8841. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8842. });
  8843. /**
  8844. * Creates a duplicate-free version of an array, using
  8845. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8846. * for equality comparisons, in which only the first occurrence of each element
  8847. * is kept. The order of result values is determined by the order they occur
  8848. * in the array.
  8849. *
  8850. * @static
  8851. * @memberOf _
  8852. * @since 0.1.0
  8853. * @category Array
  8854. * @param {Array} array The array to inspect.
  8855. * @returns {Array} Returns the new duplicate free array.
  8856. * @example
  8857. *
  8858. * _.uniq([2, 1, 2]);
  8859. * // => [2, 1]
  8860. */
  8861. function uniq(array) {
  8862. return (array && array.length) ? baseUniq(array) : [];
  8863. }
  8864. /**
  8865. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8866. * invoked for each element in `array` to generate the criterion by which
  8867. * uniqueness is computed. The order of result values is determined by the
  8868. * order they occur in the array. The iteratee is invoked with one argument:
  8869. * (value).
  8870. *
  8871. * @static
  8872. * @memberOf _
  8873. * @since 4.0.0
  8874. * @category Array
  8875. * @param {Array} array The array to inspect.
  8876. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8877. * @returns {Array} Returns the new duplicate free array.
  8878. * @example
  8879. *
  8880. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8881. * // => [2.1, 1.2]
  8882. *
  8883. * // The `_.property` iteratee shorthand.
  8884. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8885. * // => [{ 'x': 1 }, { 'x': 2 }]
  8886. */
  8887. function uniqBy(array, iteratee) {
  8888. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8889. }
  8890. /**
  8891. * This method is like `_.uniq` except that it accepts `comparator` which
  8892. * is invoked to compare elements of `array`. The order of result values is
  8893. * determined by the order they occur in the array.The comparator is invoked
  8894. * with two arguments: (arrVal, othVal).
  8895. *
  8896. * @static
  8897. * @memberOf _
  8898. * @since 4.0.0
  8899. * @category Array
  8900. * @param {Array} array The array to inspect.
  8901. * @param {Function} [comparator] The comparator invoked per element.
  8902. * @returns {Array} Returns the new duplicate free array.
  8903. * @example
  8904. *
  8905. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8906. *
  8907. * _.uniqWith(objects, _.isEqual);
  8908. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8909. */
  8910. function uniqWith(array, comparator) {
  8911. comparator = typeof comparator == 'function' ? comparator : undefined;
  8912. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8913. }
  8914. /**
  8915. * This method is like `_.zip` except that it accepts an array of grouped
  8916. * elements and creates an array regrouping the elements to their pre-zip
  8917. * configuration.
  8918. *
  8919. * @static
  8920. * @memberOf _
  8921. * @since 1.2.0
  8922. * @category Array
  8923. * @param {Array} array The array of grouped elements to process.
  8924. * @returns {Array} Returns the new array of regrouped elements.
  8925. * @example
  8926. *
  8927. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8928. * // => [['a', 1, true], ['b', 2, false]]
  8929. *
  8930. * _.unzip(zipped);
  8931. * // => [['a', 'b'], [1, 2], [true, false]]
  8932. */
  8933. function unzip(array) {
  8934. if (!(array && array.length)) {
  8935. return [];
  8936. }
  8937. var length = 0;
  8938. array = arrayFilter(array, function(group) {
  8939. if (isArrayLikeObject(group)) {
  8940. length = nativeMax(group.length, length);
  8941. return true;
  8942. }
  8943. });
  8944. return baseTimes(length, function(index) {
  8945. return arrayMap(array, baseProperty(index));
  8946. });
  8947. }
  8948. /**
  8949. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  8950. * how regrouped values should be combined. The iteratee is invoked with the
  8951. * elements of each group: (...group).
  8952. *
  8953. * @static
  8954. * @memberOf _
  8955. * @since 3.8.0
  8956. * @category Array
  8957. * @param {Array} array The array of grouped elements to process.
  8958. * @param {Function} [iteratee=_.identity] The function to combine
  8959. * regrouped values.
  8960. * @returns {Array} Returns the new array of regrouped elements.
  8961. * @example
  8962. *
  8963. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  8964. * // => [[1, 10, 100], [2, 20, 200]]
  8965. *
  8966. * _.unzipWith(zipped, _.add);
  8967. * // => [3, 30, 300]
  8968. */
  8969. function unzipWith(array, iteratee) {
  8970. if (!(array && array.length)) {
  8971. return [];
  8972. }
  8973. var result = unzip(array);
  8974. if (iteratee == null) {
  8975. return result;
  8976. }
  8977. return arrayMap(result, function(group) {
  8978. return apply(iteratee, undefined, group);
  8979. });
  8980. }
  8981. /**
  8982. * Creates an array excluding all given values using
  8983. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8984. * for equality comparisons.
  8985. *
  8986. * **Note:** Unlike `_.pull`, this method returns a new array.
  8987. *
  8988. * @static
  8989. * @memberOf _
  8990. * @since 0.1.0
  8991. * @category Array
  8992. * @param {Array} array The array to inspect.
  8993. * @param {...*} [values] The values to exclude.
  8994. * @returns {Array} Returns the new array of filtered values.
  8995. * @see _.difference, _.xor
  8996. * @example
  8997. *
  8998. * _.without([2, 1, 2, 3], 1, 2);
  8999. * // => [3]
  9000. */
  9001. var without = baseRest(function(array, values) {
  9002. return isArrayLikeObject(array)
  9003. ? baseDifference(array, values)
  9004. : [];
  9005. });
  9006. /**
  9007. * Creates an array of unique values that is the
  9008. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9009. * of the given arrays. The order of result values is determined by the order
  9010. * they occur in the arrays.
  9011. *
  9012. * @static
  9013. * @memberOf _
  9014. * @since 2.4.0
  9015. * @category Array
  9016. * @param {...Array} [arrays] The arrays to inspect.
  9017. * @returns {Array} Returns the new array of filtered values.
  9018. * @see _.difference, _.without
  9019. * @example
  9020. *
  9021. * _.xor([2, 1], [2, 3]);
  9022. * // => [1, 3]
  9023. */
  9024. var xor = baseRest(function(arrays) {
  9025. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9026. });
  9027. /**
  9028. * This method is like `_.xor` except that it accepts `iteratee` which is
  9029. * invoked for each element of each `arrays` to generate the criterion by
  9030. * which by which they're compared. The order of result values is determined
  9031. * by the order they occur in the arrays. The iteratee is invoked with one
  9032. * argument: (value).
  9033. *
  9034. * @static
  9035. * @memberOf _
  9036. * @since 4.0.0
  9037. * @category Array
  9038. * @param {...Array} [arrays] The arrays to inspect.
  9039. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9040. * @returns {Array} Returns the new array of filtered values.
  9041. * @example
  9042. *
  9043. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9044. * // => [1.2, 3.4]
  9045. *
  9046. * // The `_.property` iteratee shorthand.
  9047. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9048. * // => [{ 'x': 2 }]
  9049. */
  9050. var xorBy = baseRest(function(arrays) {
  9051. var iteratee = last(arrays);
  9052. if (isArrayLikeObject(iteratee)) {
  9053. iteratee = undefined;
  9054. }
  9055. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9056. });
  9057. /**
  9058. * This method is like `_.xor` except that it accepts `comparator` which is
  9059. * invoked to compare elements of `arrays`. The order of result values is
  9060. * determined by the order they occur in the arrays. The comparator is invoked
  9061. * with two arguments: (arrVal, othVal).
  9062. *
  9063. * @static
  9064. * @memberOf _
  9065. * @since 4.0.0
  9066. * @category Array
  9067. * @param {...Array} [arrays] The arrays to inspect.
  9068. * @param {Function} [comparator] The comparator invoked per element.
  9069. * @returns {Array} Returns the new array of filtered values.
  9070. * @example
  9071. *
  9072. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9073. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9074. *
  9075. * _.xorWith(objects, others, _.isEqual);
  9076. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9077. */
  9078. var xorWith = baseRest(function(arrays) {
  9079. var comparator = last(arrays);
  9080. comparator = typeof comparator == 'function' ? comparator : undefined;
  9081. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9082. });
  9083. /**
  9084. * Creates an array of grouped elements, the first of which contains the
  9085. * first elements of the given arrays, the second of which contains the
  9086. * second elements of the given arrays, and so on.
  9087. *
  9088. * @static
  9089. * @memberOf _
  9090. * @since 0.1.0
  9091. * @category Array
  9092. * @param {...Array} [arrays] The arrays to process.
  9093. * @returns {Array} Returns the new array of grouped elements.
  9094. * @example
  9095. *
  9096. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9097. * // => [['a', 1, true], ['b', 2, false]]
  9098. */
  9099. var zip = baseRest(unzip);
  9100. /**
  9101. * This method is like `_.fromPairs` except that it accepts two arrays,
  9102. * one of property identifiers and one of corresponding values.
  9103. *
  9104. * @static
  9105. * @memberOf _
  9106. * @since 0.4.0
  9107. * @category Array
  9108. * @param {Array} [props=[]] The property identifiers.
  9109. * @param {Array} [values=[]] The property values.
  9110. * @returns {Object} Returns the new object.
  9111. * @example
  9112. *
  9113. * _.zipObject(['a', 'b'], [1, 2]);
  9114. * // => { 'a': 1, 'b': 2 }
  9115. */
  9116. function zipObject(props, values) {
  9117. return baseZipObject(props || [], values || [], assignValue);
  9118. }
  9119. /**
  9120. * This method is like `_.zipObject` except that it supports property paths.
  9121. *
  9122. * @static
  9123. * @memberOf _
  9124. * @since 4.1.0
  9125. * @category Array
  9126. * @param {Array} [props=[]] The property identifiers.
  9127. * @param {Array} [values=[]] The property values.
  9128. * @returns {Object} Returns the new object.
  9129. * @example
  9130. *
  9131. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9132. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9133. */
  9134. function zipObjectDeep(props, values) {
  9135. return baseZipObject(props || [], values || [], baseSet);
  9136. }
  9137. /**
  9138. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9139. * how grouped values should be combined. The iteratee is invoked with the
  9140. * elements of each group: (...group).
  9141. *
  9142. * @static
  9143. * @memberOf _
  9144. * @since 3.8.0
  9145. * @category Array
  9146. * @param {...Array} [arrays] The arrays to process.
  9147. * @param {Function} [iteratee=_.identity] The function to combine
  9148. * grouped values.
  9149. * @returns {Array} Returns the new array of grouped elements.
  9150. * @example
  9151. *
  9152. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9153. * return a + b + c;
  9154. * });
  9155. * // => [111, 222]
  9156. */
  9157. var zipWith = baseRest(function(arrays) {
  9158. var length = arrays.length,
  9159. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9160. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9161. return unzipWith(arrays, iteratee);
  9162. });
  9163. /*------------------------------------------------------------------------*/
  9164. /**
  9165. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9166. * chain sequences enabled. The result of such sequences must be unwrapped
  9167. * with `_#value`.
  9168. *
  9169. * @static
  9170. * @memberOf _
  9171. * @since 1.3.0
  9172. * @category Seq
  9173. * @param {*} value The value to wrap.
  9174. * @returns {Object} Returns the new `lodash` wrapper instance.
  9175. * @example
  9176. *
  9177. * var users = [
  9178. * { 'user': 'barney', 'age': 36 },
  9179. * { 'user': 'fred', 'age': 40 },
  9180. * { 'user': 'pebbles', 'age': 1 }
  9181. * ];
  9182. *
  9183. * var youngest = _
  9184. * .chain(users)
  9185. * .sortBy('age')
  9186. * .map(function(o) {
  9187. * return o.user + ' is ' + o.age;
  9188. * })
  9189. * .head()
  9190. * .value();
  9191. * // => 'pebbles is 1'
  9192. */
  9193. function chain(value) {
  9194. var result = lodash(value);
  9195. result.__chain__ = true;
  9196. return result;
  9197. }
  9198. /**
  9199. * This method invokes `interceptor` and returns `value`. The interceptor
  9200. * is invoked with one argument; (value). The purpose of this method is to
  9201. * "tap into" a method chain sequence in order to modify intermediate results.
  9202. *
  9203. * @static
  9204. * @memberOf _
  9205. * @since 0.1.0
  9206. * @category Seq
  9207. * @param {*} value The value to provide to `interceptor`.
  9208. * @param {Function} interceptor The function to invoke.
  9209. * @returns {*} Returns `value`.
  9210. * @example
  9211. *
  9212. * _([1, 2, 3])
  9213. * .tap(function(array) {
  9214. * // Mutate input array.
  9215. * array.pop();
  9216. * })
  9217. * .reverse()
  9218. * .value();
  9219. * // => [2, 1]
  9220. */
  9221. function tap(value, interceptor) {
  9222. interceptor(value);
  9223. return value;
  9224. }
  9225. /**
  9226. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9227. * The purpose of this method is to "pass thru" values replacing intermediate
  9228. * results in a method chain sequence.
  9229. *
  9230. * @static
  9231. * @memberOf _
  9232. * @since 3.0.0
  9233. * @category Seq
  9234. * @param {*} value The value to provide to `interceptor`.
  9235. * @param {Function} interceptor The function to invoke.
  9236. * @returns {*} Returns the result of `interceptor`.
  9237. * @example
  9238. *
  9239. * _(' abc ')
  9240. * .chain()
  9241. * .trim()
  9242. * .thru(function(value) {
  9243. * return [value];
  9244. * })
  9245. * .value();
  9246. * // => ['abc']
  9247. */
  9248. function thru(value, interceptor) {
  9249. return interceptor(value);
  9250. }
  9251. /**
  9252. * This method is the wrapper version of `_.at`.
  9253. *
  9254. * @name at
  9255. * @memberOf _
  9256. * @since 1.0.0
  9257. * @category Seq
  9258. * @param {...(string|string[])} [paths] The property paths to pick.
  9259. * @returns {Object} Returns the new `lodash` wrapper instance.
  9260. * @example
  9261. *
  9262. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9263. *
  9264. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9265. * // => [3, 4]
  9266. */
  9267. var wrapperAt = flatRest(function(paths) {
  9268. var length = paths.length,
  9269. start = length ? paths[0] : 0,
  9270. value = this.__wrapped__,
  9271. interceptor = function(object) { return baseAt(object, paths); };
  9272. if (length > 1 || this.__actions__.length ||
  9273. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9274. return this.thru(interceptor);
  9275. }
  9276. value = value.slice(start, +start + (length ? 1 : 0));
  9277. value.__actions__.push({
  9278. 'func': thru,
  9279. 'args': [interceptor],
  9280. 'thisArg': undefined
  9281. });
  9282. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9283. if (length && !array.length) {
  9284. array.push(undefined);
  9285. }
  9286. return array;
  9287. });
  9288. });
  9289. /**
  9290. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9291. *
  9292. * @name chain
  9293. * @memberOf _
  9294. * @since 0.1.0
  9295. * @category Seq
  9296. * @returns {Object} Returns the new `lodash` wrapper instance.
  9297. * @example
  9298. *
  9299. * var users = [
  9300. * { 'user': 'barney', 'age': 36 },
  9301. * { 'user': 'fred', 'age': 40 }
  9302. * ];
  9303. *
  9304. * // A sequence without explicit chaining.
  9305. * _(users).head();
  9306. * // => { 'user': 'barney', 'age': 36 }
  9307. *
  9308. * // A sequence with explicit chaining.
  9309. * _(users)
  9310. * .chain()
  9311. * .head()
  9312. * .pick('user')
  9313. * .value();
  9314. * // => { 'user': 'barney' }
  9315. */
  9316. function wrapperChain() {
  9317. return chain(this);
  9318. }
  9319. /**
  9320. * Executes the chain sequence and returns the wrapped result.
  9321. *
  9322. * @name commit
  9323. * @memberOf _
  9324. * @since 3.2.0
  9325. * @category Seq
  9326. * @returns {Object} Returns the new `lodash` wrapper instance.
  9327. * @example
  9328. *
  9329. * var array = [1, 2];
  9330. * var wrapped = _(array).push(3);
  9331. *
  9332. * console.log(array);
  9333. * // => [1, 2]
  9334. *
  9335. * wrapped = wrapped.commit();
  9336. * console.log(array);
  9337. * // => [1, 2, 3]
  9338. *
  9339. * wrapped.last();
  9340. * // => 3
  9341. *
  9342. * console.log(array);
  9343. * // => [1, 2, 3]
  9344. */
  9345. function wrapperCommit() {
  9346. return new LodashWrapper(this.value(), this.__chain__);
  9347. }
  9348. /**
  9349. * Gets the next value on a wrapped object following the
  9350. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9351. *
  9352. * @name next
  9353. * @memberOf _
  9354. * @since 4.0.0
  9355. * @category Seq
  9356. * @returns {Object} Returns the next iterator value.
  9357. * @example
  9358. *
  9359. * var wrapped = _([1, 2]);
  9360. *
  9361. * wrapped.next();
  9362. * // => { 'done': false, 'value': 1 }
  9363. *
  9364. * wrapped.next();
  9365. * // => { 'done': false, 'value': 2 }
  9366. *
  9367. * wrapped.next();
  9368. * // => { 'done': true, 'value': undefined }
  9369. */
  9370. function wrapperNext() {
  9371. if (this.__values__ === undefined) {
  9372. this.__values__ = toArray(this.value());
  9373. }
  9374. var done = this.__index__ >= this.__values__.length,
  9375. value = done ? undefined : this.__values__[this.__index__++];
  9376. return { 'done': done, 'value': value };
  9377. }
  9378. /**
  9379. * Enables the wrapper to be iterable.
  9380. *
  9381. * @name Symbol.iterator
  9382. * @memberOf _
  9383. * @since 4.0.0
  9384. * @category Seq
  9385. * @returns {Object} Returns the wrapper object.
  9386. * @example
  9387. *
  9388. * var wrapped = _([1, 2]);
  9389. *
  9390. * wrapped[Symbol.iterator]() === wrapped;
  9391. * // => true
  9392. *
  9393. * Array.from(wrapped);
  9394. * // => [1, 2]
  9395. */
  9396. function wrapperToIterator() {
  9397. return this;
  9398. }
  9399. /**
  9400. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9401. *
  9402. * @name plant
  9403. * @memberOf _
  9404. * @since 3.2.0
  9405. * @category Seq
  9406. * @param {*} value The value to plant.
  9407. * @returns {Object} Returns the new `lodash` wrapper instance.
  9408. * @example
  9409. *
  9410. * function square(n) {
  9411. * return n * n;
  9412. * }
  9413. *
  9414. * var wrapped = _([1, 2]).map(square);
  9415. * var other = wrapped.plant([3, 4]);
  9416. *
  9417. * other.value();
  9418. * // => [9, 16]
  9419. *
  9420. * wrapped.value();
  9421. * // => [1, 4]
  9422. */
  9423. function wrapperPlant(value) {
  9424. var result,
  9425. parent = this;
  9426. while (parent instanceof baseLodash) {
  9427. var clone = wrapperClone(parent);
  9428. clone.__index__ = 0;
  9429. clone.__values__ = undefined;
  9430. if (result) {
  9431. previous.__wrapped__ = clone;
  9432. } else {
  9433. result = clone;
  9434. }
  9435. var previous = clone;
  9436. parent = parent.__wrapped__;
  9437. }
  9438. previous.__wrapped__ = value;
  9439. return result;
  9440. }
  9441. /**
  9442. * This method is the wrapper version of `_.reverse`.
  9443. *
  9444. * **Note:** This method mutates the wrapped array.
  9445. *
  9446. * @name reverse
  9447. * @memberOf _
  9448. * @since 0.1.0
  9449. * @category Seq
  9450. * @returns {Object} Returns the new `lodash` wrapper instance.
  9451. * @example
  9452. *
  9453. * var array = [1, 2, 3];
  9454. *
  9455. * _(array).reverse().value()
  9456. * // => [3, 2, 1]
  9457. *
  9458. * console.log(array);
  9459. * // => [3, 2, 1]
  9460. */
  9461. function wrapperReverse() {
  9462. var value = this.__wrapped__;
  9463. if (value instanceof LazyWrapper) {
  9464. var wrapped = value;
  9465. if (this.__actions__.length) {
  9466. wrapped = new LazyWrapper(this);
  9467. }
  9468. wrapped = wrapped.reverse();
  9469. wrapped.__actions__.push({
  9470. 'func': thru,
  9471. 'args': [reverse],
  9472. 'thisArg': undefined
  9473. });
  9474. return new LodashWrapper(wrapped, this.__chain__);
  9475. }
  9476. return this.thru(reverse);
  9477. }
  9478. /**
  9479. * Executes the chain sequence to resolve the unwrapped value.
  9480. *
  9481. * @name value
  9482. * @memberOf _
  9483. * @since 0.1.0
  9484. * @alias toJSON, valueOf
  9485. * @category Seq
  9486. * @returns {*} Returns the resolved unwrapped value.
  9487. * @example
  9488. *
  9489. * _([1, 2, 3]).value();
  9490. * // => [1, 2, 3]
  9491. */
  9492. function wrapperValue() {
  9493. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9494. }
  9495. /*------------------------------------------------------------------------*/
  9496. /**
  9497. * Creates an object composed of keys generated from the results of running
  9498. * each element of `collection` thru `iteratee`. The corresponding value of
  9499. * each key is the number of times the key was returned by `iteratee`. The
  9500. * iteratee is invoked with one argument: (value).
  9501. *
  9502. * @static
  9503. * @memberOf _
  9504. * @since 0.5.0
  9505. * @category Collection
  9506. * @param {Array|Object} collection The collection to iterate over.
  9507. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9508. * @returns {Object} Returns the composed aggregate object.
  9509. * @example
  9510. *
  9511. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9512. * // => { '4': 1, '6': 2 }
  9513. *
  9514. * // The `_.property` iteratee shorthand.
  9515. * _.countBy(['one', 'two', 'three'], 'length');
  9516. * // => { '3': 2, '5': 1 }
  9517. */
  9518. var countBy = createAggregator(function(result, value, key) {
  9519. if (hasOwnProperty.call(result, key)) {
  9520. ++result[key];
  9521. } else {
  9522. baseAssignValue(result, key, 1);
  9523. }
  9524. });
  9525. /**
  9526. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9527. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9528. * invoked with three arguments: (value, index|key, collection).
  9529. *
  9530. * **Note:** This method returns `true` for
  9531. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9532. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9533. * elements of empty collections.
  9534. *
  9535. * @static
  9536. * @memberOf _
  9537. * @since 0.1.0
  9538. * @category Collection
  9539. * @param {Array|Object} collection The collection to iterate over.
  9540. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9541. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9542. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9543. * else `false`.
  9544. * @example
  9545. *
  9546. * _.every([true, 1, null, 'yes'], Boolean);
  9547. * // => false
  9548. *
  9549. * var users = [
  9550. * { 'user': 'barney', 'age': 36, 'active': false },
  9551. * { 'user': 'fred', 'age': 40, 'active': false }
  9552. * ];
  9553. *
  9554. * // The `_.matches` iteratee shorthand.
  9555. * _.every(users, { 'user': 'barney', 'active': false });
  9556. * // => false
  9557. *
  9558. * // The `_.matchesProperty` iteratee shorthand.
  9559. * _.every(users, ['active', false]);
  9560. * // => true
  9561. *
  9562. * // The `_.property` iteratee shorthand.
  9563. * _.every(users, 'active');
  9564. * // => false
  9565. */
  9566. function every(collection, predicate, guard) {
  9567. var func = isArray(collection) ? arrayEvery : baseEvery;
  9568. if (guard && isIterateeCall(collection, predicate, guard)) {
  9569. predicate = undefined;
  9570. }
  9571. return func(collection, getIteratee(predicate, 3));
  9572. }
  9573. /**
  9574. * Iterates over elements of `collection`, returning an array of all elements
  9575. * `predicate` returns truthy for. The predicate is invoked with three
  9576. * arguments: (value, index|key, collection).
  9577. *
  9578. * **Note:** Unlike `_.remove`, this method returns a new array.
  9579. *
  9580. * @static
  9581. * @memberOf _
  9582. * @since 0.1.0
  9583. * @category Collection
  9584. * @param {Array|Object} collection The collection to iterate over.
  9585. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9586. * @returns {Array} Returns the new filtered array.
  9587. * @see _.reject
  9588. * @example
  9589. *
  9590. * var users = [
  9591. * { 'user': 'barney', 'age': 36, 'active': true },
  9592. * { 'user': 'fred', 'age': 40, 'active': false }
  9593. * ];
  9594. *
  9595. * _.filter(users, function(o) { return !o.active; });
  9596. * // => objects for ['fred']
  9597. *
  9598. * // The `_.matches` iteratee shorthand.
  9599. * _.filter(users, { 'age': 36, 'active': true });
  9600. * // => objects for ['barney']
  9601. *
  9602. * // The `_.matchesProperty` iteratee shorthand.
  9603. * _.filter(users, ['active', false]);
  9604. * // => objects for ['fred']
  9605. *
  9606. * // The `_.property` iteratee shorthand.
  9607. * _.filter(users, 'active');
  9608. * // => objects for ['barney']
  9609. *
  9610. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9611. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9612. * // => objects for ['fred', 'barney']
  9613. */
  9614. function filter(collection, predicate) {
  9615. var func = isArray(collection) ? arrayFilter : baseFilter;
  9616. return func(collection, getIteratee(predicate, 3));
  9617. }
  9618. /**
  9619. * Iterates over elements of `collection`, returning the first element
  9620. * `predicate` returns truthy for. The predicate is invoked with three
  9621. * arguments: (value, index|key, collection).
  9622. *
  9623. * @static
  9624. * @memberOf _
  9625. * @since 0.1.0
  9626. * @category Collection
  9627. * @param {Array|Object} collection The collection to inspect.
  9628. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9629. * @param {number} [fromIndex=0] The index to search from.
  9630. * @returns {*} Returns the matched element, else `undefined`.
  9631. * @example
  9632. *
  9633. * var users = [
  9634. * { 'user': 'barney', 'age': 36, 'active': true },
  9635. * { 'user': 'fred', 'age': 40, 'active': false },
  9636. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9637. * ];
  9638. *
  9639. * _.find(users, function(o) { return o.age < 40; });
  9640. * // => object for 'barney'
  9641. *
  9642. * // The `_.matches` iteratee shorthand.
  9643. * _.find(users, { 'age': 1, 'active': true });
  9644. * // => object for 'pebbles'
  9645. *
  9646. * // The `_.matchesProperty` iteratee shorthand.
  9647. * _.find(users, ['active', false]);
  9648. * // => object for 'fred'
  9649. *
  9650. * // The `_.property` iteratee shorthand.
  9651. * _.find(users, 'active');
  9652. * // => object for 'barney'
  9653. */
  9654. var find = createFind(findIndex);
  9655. /**
  9656. * This method is like `_.find` except that it iterates over elements of
  9657. * `collection` from right to left.
  9658. *
  9659. * @static
  9660. * @memberOf _
  9661. * @since 2.0.0
  9662. * @category Collection
  9663. * @param {Array|Object} collection The collection to inspect.
  9664. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9665. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9666. * @returns {*} Returns the matched element, else `undefined`.
  9667. * @example
  9668. *
  9669. * _.findLast([1, 2, 3, 4], function(n) {
  9670. * return n % 2 == 1;
  9671. * });
  9672. * // => 3
  9673. */
  9674. var findLast = createFind(findLastIndex);
  9675. /**
  9676. * Creates a flattened array of values by running each element in `collection`
  9677. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9678. * with three arguments: (value, index|key, collection).
  9679. *
  9680. * @static
  9681. * @memberOf _
  9682. * @since 4.0.0
  9683. * @category Collection
  9684. * @param {Array|Object} collection The collection to iterate over.
  9685. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9686. * @returns {Array} Returns the new flattened array.
  9687. * @example
  9688. *
  9689. * function duplicate(n) {
  9690. * return [n, n];
  9691. * }
  9692. *
  9693. * _.flatMap([1, 2], duplicate);
  9694. * // => [1, 1, 2, 2]
  9695. */
  9696. function flatMap(collection, iteratee) {
  9697. return baseFlatten(map(collection, iteratee), 1);
  9698. }
  9699. /**
  9700. * This method is like `_.flatMap` except that it recursively flattens the
  9701. * mapped results.
  9702. *
  9703. * @static
  9704. * @memberOf _
  9705. * @since 4.7.0
  9706. * @category Collection
  9707. * @param {Array|Object} collection The collection to iterate over.
  9708. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9709. * @returns {Array} Returns the new flattened array.
  9710. * @example
  9711. *
  9712. * function duplicate(n) {
  9713. * return [[[n, n]]];
  9714. * }
  9715. *
  9716. * _.flatMapDeep([1, 2], duplicate);
  9717. * // => [1, 1, 2, 2]
  9718. */
  9719. function flatMapDeep(collection, iteratee) {
  9720. return baseFlatten(map(collection, iteratee), INFINITY);
  9721. }
  9722. /**
  9723. * This method is like `_.flatMap` except that it recursively flattens the
  9724. * mapped results up to `depth` times.
  9725. *
  9726. * @static
  9727. * @memberOf _
  9728. * @since 4.7.0
  9729. * @category Collection
  9730. * @param {Array|Object} collection The collection to iterate over.
  9731. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9732. * @param {number} [depth=1] The maximum recursion depth.
  9733. * @returns {Array} Returns the new flattened array.
  9734. * @example
  9735. *
  9736. * function duplicate(n) {
  9737. * return [[[n, n]]];
  9738. * }
  9739. *
  9740. * _.flatMapDepth([1, 2], duplicate, 2);
  9741. * // => [[1, 1], [2, 2]]
  9742. */
  9743. function flatMapDepth(collection, iteratee, depth) {
  9744. depth = depth === undefined ? 1 : toInteger(depth);
  9745. return baseFlatten(map(collection, iteratee), depth);
  9746. }
  9747. /**
  9748. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9749. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9750. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9751. *
  9752. * **Note:** As with other "Collections" methods, objects with a "length"
  9753. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9754. * or `_.forOwn` for object iteration.
  9755. *
  9756. * @static
  9757. * @memberOf _
  9758. * @since 0.1.0
  9759. * @alias each
  9760. * @category Collection
  9761. * @param {Array|Object} collection The collection to iterate over.
  9762. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9763. * @returns {Array|Object} Returns `collection`.
  9764. * @see _.forEachRight
  9765. * @example
  9766. *
  9767. * _.forEach([1, 2], function(value) {
  9768. * console.log(value);
  9769. * });
  9770. * // => Logs `1` then `2`.
  9771. *
  9772. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9773. * console.log(key);
  9774. * });
  9775. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9776. */
  9777. function forEach(collection, iteratee) {
  9778. var func = isArray(collection) ? arrayEach : baseEach;
  9779. return func(collection, getIteratee(iteratee, 3));
  9780. }
  9781. /**
  9782. * This method is like `_.forEach` except that it iterates over elements of
  9783. * `collection` from right to left.
  9784. *
  9785. * @static
  9786. * @memberOf _
  9787. * @since 2.0.0
  9788. * @alias eachRight
  9789. * @category Collection
  9790. * @param {Array|Object} collection The collection to iterate over.
  9791. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9792. * @returns {Array|Object} Returns `collection`.
  9793. * @see _.forEach
  9794. * @example
  9795. *
  9796. * _.forEachRight([1, 2], function(value) {
  9797. * console.log(value);
  9798. * });
  9799. * // => Logs `2` then `1`.
  9800. */
  9801. function forEachRight(collection, iteratee) {
  9802. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9803. return func(collection, getIteratee(iteratee, 3));
  9804. }
  9805. /**
  9806. * Creates an object composed of keys generated from the results of running
  9807. * each element of `collection` thru `iteratee`. The order of grouped values
  9808. * is determined by the order they occur in `collection`. The corresponding
  9809. * value of each key is an array of elements responsible for generating the
  9810. * key. The iteratee is invoked with one argument: (value).
  9811. *
  9812. * @static
  9813. * @memberOf _
  9814. * @since 0.1.0
  9815. * @category Collection
  9816. * @param {Array|Object} collection The collection to iterate over.
  9817. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9818. * @returns {Object} Returns the composed aggregate object.
  9819. * @example
  9820. *
  9821. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9822. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9823. *
  9824. * // The `_.property` iteratee shorthand.
  9825. * _.groupBy(['one', 'two', 'three'], 'length');
  9826. * // => { '3': ['one', 'two'], '5': ['three'] }
  9827. */
  9828. var groupBy = createAggregator(function(result, value, key) {
  9829. if (hasOwnProperty.call(result, key)) {
  9830. result[key].push(value);
  9831. } else {
  9832. baseAssignValue(result, key, [value]);
  9833. }
  9834. });
  9835. /**
  9836. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9837. * checked for a substring of `value`, otherwise
  9838. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9839. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9840. * the offset from the end of `collection`.
  9841. *
  9842. * @static
  9843. * @memberOf _
  9844. * @since 0.1.0
  9845. * @category Collection
  9846. * @param {Array|Object|string} collection The collection to inspect.
  9847. * @param {*} value The value to search for.
  9848. * @param {number} [fromIndex=0] The index to search from.
  9849. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9850. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9851. * @example
  9852. *
  9853. * _.includes([1, 2, 3], 1);
  9854. * // => true
  9855. *
  9856. * _.includes([1, 2, 3], 1, 2);
  9857. * // => false
  9858. *
  9859. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9860. * // => true
  9861. *
  9862. * _.includes('abcd', 'bc');
  9863. * // => true
  9864. */
  9865. function includes(collection, value, fromIndex, guard) {
  9866. collection = isArrayLike(collection) ? collection : values(collection);
  9867. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9868. var length = collection.length;
  9869. if (fromIndex < 0) {
  9870. fromIndex = nativeMax(length + fromIndex, 0);
  9871. }
  9872. return isString(collection)
  9873. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9874. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9875. }
  9876. /**
  9877. * Invokes the method at `path` of each element in `collection`, returning
  9878. * an array of the results of each invoked method. Any additional arguments
  9879. * are provided to each invoked method. If `path` is a function, it's invoked
  9880. * for, and `this` bound to, each element in `collection`.
  9881. *
  9882. * @static
  9883. * @memberOf _
  9884. * @since 4.0.0
  9885. * @category Collection
  9886. * @param {Array|Object} collection The collection to iterate over.
  9887. * @param {Array|Function|string} path The path of the method to invoke or
  9888. * the function invoked per iteration.
  9889. * @param {...*} [args] The arguments to invoke each method with.
  9890. * @returns {Array} Returns the array of results.
  9891. * @example
  9892. *
  9893. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9894. * // => [[1, 5, 7], [1, 2, 3]]
  9895. *
  9896. * _.invokeMap([123, 456], String.prototype.split, '');
  9897. * // => [['1', '2', '3'], ['4', '5', '6']]
  9898. */
  9899. var invokeMap = baseRest(function(collection, path, args) {
  9900. var index = -1,
  9901. isFunc = typeof path == 'function',
  9902. result = isArrayLike(collection) ? Array(collection.length) : [];
  9903. baseEach(collection, function(value) {
  9904. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9905. });
  9906. return result;
  9907. });
  9908. /**
  9909. * Creates an object composed of keys generated from the results of running
  9910. * each element of `collection` thru `iteratee`. The corresponding value of
  9911. * each key is the last element responsible for generating the key. The
  9912. * iteratee is invoked with one argument: (value).
  9913. *
  9914. * @static
  9915. * @memberOf _
  9916. * @since 4.0.0
  9917. * @category Collection
  9918. * @param {Array|Object} collection The collection to iterate over.
  9919. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9920. * @returns {Object} Returns the composed aggregate object.
  9921. * @example
  9922. *
  9923. * var array = [
  9924. * { 'dir': 'left', 'code': 97 },
  9925. * { 'dir': 'right', 'code': 100 }
  9926. * ];
  9927. *
  9928. * _.keyBy(array, function(o) {
  9929. * return String.fromCharCode(o.code);
  9930. * });
  9931. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9932. *
  9933. * _.keyBy(array, 'dir');
  9934. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9935. */
  9936. var keyBy = createAggregator(function(result, value, key) {
  9937. baseAssignValue(result, key, value);
  9938. });
  9939. /**
  9940. * Creates an array of values by running each element in `collection` thru
  9941. * `iteratee`. The iteratee is invoked with three arguments:
  9942. * (value, index|key, collection).
  9943. *
  9944. * Many lodash methods are guarded to work as iteratees for methods like
  9945. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  9946. *
  9947. * The guarded methods are:
  9948. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  9949. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  9950. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  9951. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  9952. *
  9953. * @static
  9954. * @memberOf _
  9955. * @since 0.1.0
  9956. * @category Collection
  9957. * @param {Array|Object} collection The collection to iterate over.
  9958. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9959. * @returns {Array} Returns the new mapped array.
  9960. * @example
  9961. *
  9962. * function square(n) {
  9963. * return n * n;
  9964. * }
  9965. *
  9966. * _.map([4, 8], square);
  9967. * // => [16, 64]
  9968. *
  9969. * _.map({ 'a': 4, 'b': 8 }, square);
  9970. * // => [16, 64] (iteration order is not guaranteed)
  9971. *
  9972. * var users = [
  9973. * { 'user': 'barney' },
  9974. * { 'user': 'fred' }
  9975. * ];
  9976. *
  9977. * // The `_.property` iteratee shorthand.
  9978. * _.map(users, 'user');
  9979. * // => ['barney', 'fred']
  9980. */
  9981. function map(collection, iteratee) {
  9982. var func = isArray(collection) ? arrayMap : baseMap;
  9983. return func(collection, getIteratee(iteratee, 3));
  9984. }
  9985. /**
  9986. * This method is like `_.sortBy` except that it allows specifying the sort
  9987. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  9988. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  9989. * descending or "asc" for ascending sort order of corresponding values.
  9990. *
  9991. * @static
  9992. * @memberOf _
  9993. * @since 4.0.0
  9994. * @category Collection
  9995. * @param {Array|Object} collection The collection to iterate over.
  9996. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  9997. * The iteratees to sort by.
  9998. * @param {string[]} [orders] The sort orders of `iteratees`.
  9999. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10000. * @returns {Array} Returns the new sorted array.
  10001. * @example
  10002. *
  10003. * var users = [
  10004. * { 'user': 'fred', 'age': 48 },
  10005. * { 'user': 'barney', 'age': 34 },
  10006. * { 'user': 'fred', 'age': 40 },
  10007. * { 'user': 'barney', 'age': 36 }
  10008. * ];
  10009. *
  10010. * // Sort by `user` in ascending order and by `age` in descending order.
  10011. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10012. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10013. */
  10014. function orderBy(collection, iteratees, orders, guard) {
  10015. if (collection == null) {
  10016. return [];
  10017. }
  10018. if (!isArray(iteratees)) {
  10019. iteratees = iteratees == null ? [] : [iteratees];
  10020. }
  10021. orders = guard ? undefined : orders;
  10022. if (!isArray(orders)) {
  10023. orders = orders == null ? [] : [orders];
  10024. }
  10025. return baseOrderBy(collection, iteratees, orders);
  10026. }
  10027. /**
  10028. * Creates an array of elements split into two groups, the first of which
  10029. * contains elements `predicate` returns truthy for, the second of which
  10030. * contains elements `predicate` returns falsey for. The predicate is
  10031. * invoked with one argument: (value).
  10032. *
  10033. * @static
  10034. * @memberOf _
  10035. * @since 3.0.0
  10036. * @category Collection
  10037. * @param {Array|Object} collection The collection to iterate over.
  10038. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10039. * @returns {Array} Returns the array of grouped elements.
  10040. * @example
  10041. *
  10042. * var users = [
  10043. * { 'user': 'barney', 'age': 36, 'active': false },
  10044. * { 'user': 'fred', 'age': 40, 'active': true },
  10045. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10046. * ];
  10047. *
  10048. * _.partition(users, function(o) { return o.active; });
  10049. * // => objects for [['fred'], ['barney', 'pebbles']]
  10050. *
  10051. * // The `_.matches` iteratee shorthand.
  10052. * _.partition(users, { 'age': 1, 'active': false });
  10053. * // => objects for [['pebbles'], ['barney', 'fred']]
  10054. *
  10055. * // The `_.matchesProperty` iteratee shorthand.
  10056. * _.partition(users, ['active', false]);
  10057. * // => objects for [['barney', 'pebbles'], ['fred']]
  10058. *
  10059. * // The `_.property` iteratee shorthand.
  10060. * _.partition(users, 'active');
  10061. * // => objects for [['fred'], ['barney', 'pebbles']]
  10062. */
  10063. var partition = createAggregator(function(result, value, key) {
  10064. result[key ? 0 : 1].push(value);
  10065. }, function() { return [[], []]; });
  10066. /**
  10067. * Reduces `collection` to a value which is the accumulated result of running
  10068. * each element in `collection` thru `iteratee`, where each successive
  10069. * invocation is supplied the return value of the previous. If `accumulator`
  10070. * is not given, the first element of `collection` is used as the initial
  10071. * value. The iteratee is invoked with four arguments:
  10072. * (accumulator, value, index|key, collection).
  10073. *
  10074. * Many lodash methods are guarded to work as iteratees for methods like
  10075. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10076. *
  10077. * The guarded methods are:
  10078. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10079. * and `sortBy`
  10080. *
  10081. * @static
  10082. * @memberOf _
  10083. * @since 0.1.0
  10084. * @category Collection
  10085. * @param {Array|Object} collection The collection to iterate over.
  10086. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10087. * @param {*} [accumulator] The initial value.
  10088. * @returns {*} Returns the accumulated value.
  10089. * @see _.reduceRight
  10090. * @example
  10091. *
  10092. * _.reduce([1, 2], function(sum, n) {
  10093. * return sum + n;
  10094. * }, 0);
  10095. * // => 3
  10096. *
  10097. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10098. * (result[value] || (result[value] = [])).push(key);
  10099. * return result;
  10100. * }, {});
  10101. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10102. */
  10103. function reduce(collection, iteratee, accumulator) {
  10104. var func = isArray(collection) ? arrayReduce : baseReduce,
  10105. initAccum = arguments.length < 3;
  10106. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10107. }
  10108. /**
  10109. * This method is like `_.reduce` except that it iterates over elements of
  10110. * `collection` from right to left.
  10111. *
  10112. * @static
  10113. * @memberOf _
  10114. * @since 0.1.0
  10115. * @category Collection
  10116. * @param {Array|Object} collection The collection to iterate over.
  10117. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10118. * @param {*} [accumulator] The initial value.
  10119. * @returns {*} Returns the accumulated value.
  10120. * @see _.reduce
  10121. * @example
  10122. *
  10123. * var array = [[0, 1], [2, 3], [4, 5]];
  10124. *
  10125. * _.reduceRight(array, function(flattened, other) {
  10126. * return flattened.concat(other);
  10127. * }, []);
  10128. * // => [4, 5, 2, 3, 0, 1]
  10129. */
  10130. function reduceRight(collection, iteratee, accumulator) {
  10131. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10132. initAccum = arguments.length < 3;
  10133. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10134. }
  10135. /**
  10136. * The opposite of `_.filter`; this method returns the elements of `collection`
  10137. * that `predicate` does **not** return truthy for.
  10138. *
  10139. * @static
  10140. * @memberOf _
  10141. * @since 0.1.0
  10142. * @category Collection
  10143. * @param {Array|Object} collection The collection to iterate over.
  10144. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10145. * @returns {Array} Returns the new filtered array.
  10146. * @see _.filter
  10147. * @example
  10148. *
  10149. * var users = [
  10150. * { 'user': 'barney', 'age': 36, 'active': false },
  10151. * { 'user': 'fred', 'age': 40, 'active': true }
  10152. * ];
  10153. *
  10154. * _.reject(users, function(o) { return !o.active; });
  10155. * // => objects for ['fred']
  10156. *
  10157. * // The `_.matches` iteratee shorthand.
  10158. * _.reject(users, { 'age': 40, 'active': true });
  10159. * // => objects for ['barney']
  10160. *
  10161. * // The `_.matchesProperty` iteratee shorthand.
  10162. * _.reject(users, ['active', false]);
  10163. * // => objects for ['fred']
  10164. *
  10165. * // The `_.property` iteratee shorthand.
  10166. * _.reject(users, 'active');
  10167. * // => objects for ['barney']
  10168. */
  10169. function reject(collection, predicate) {
  10170. var func = isArray(collection) ? arrayFilter : baseFilter;
  10171. return func(collection, negate(getIteratee(predicate, 3)));
  10172. }
  10173. /**
  10174. * Gets a random element from `collection`.
  10175. *
  10176. * @static
  10177. * @memberOf _
  10178. * @since 2.0.0
  10179. * @category Collection
  10180. * @param {Array|Object} collection The collection to sample.
  10181. * @returns {*} Returns the random element.
  10182. * @example
  10183. *
  10184. * _.sample([1, 2, 3, 4]);
  10185. * // => 2
  10186. */
  10187. function sample(collection) {
  10188. var func = isArray(collection) ? arraySample : baseSample;
  10189. return func(collection);
  10190. }
  10191. /**
  10192. * Gets `n` random elements at unique keys from `collection` up to the
  10193. * size of `collection`.
  10194. *
  10195. * @static
  10196. * @memberOf _
  10197. * @since 4.0.0
  10198. * @category Collection
  10199. * @param {Array|Object} collection The collection to sample.
  10200. * @param {number} [n=1] The number of elements to sample.
  10201. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10202. * @returns {Array} Returns the random elements.
  10203. * @example
  10204. *
  10205. * _.sampleSize([1, 2, 3], 2);
  10206. * // => [3, 1]
  10207. *
  10208. * _.sampleSize([1, 2, 3], 4);
  10209. * // => [2, 3, 1]
  10210. */
  10211. function sampleSize(collection, n, guard) {
  10212. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10213. n = 1;
  10214. } else {
  10215. n = toInteger(n);
  10216. }
  10217. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10218. return func(collection, n);
  10219. }
  10220. /**
  10221. * Creates an array of shuffled values, using a version of the
  10222. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10223. *
  10224. * @static
  10225. * @memberOf _
  10226. * @since 0.1.0
  10227. * @category Collection
  10228. * @param {Array|Object} collection The collection to shuffle.
  10229. * @returns {Array} Returns the new shuffled array.
  10230. * @example
  10231. *
  10232. * _.shuffle([1, 2, 3, 4]);
  10233. * // => [4, 1, 3, 2]
  10234. */
  10235. function shuffle(collection) {
  10236. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10237. return func(collection);
  10238. }
  10239. /**
  10240. * Gets the size of `collection` by returning its length for array-like
  10241. * values or the number of own enumerable string keyed properties for objects.
  10242. *
  10243. * @static
  10244. * @memberOf _
  10245. * @since 0.1.0
  10246. * @category Collection
  10247. * @param {Array|Object|string} collection The collection to inspect.
  10248. * @returns {number} Returns the collection size.
  10249. * @example
  10250. *
  10251. * _.size([1, 2, 3]);
  10252. * // => 3
  10253. *
  10254. * _.size({ 'a': 1, 'b': 2 });
  10255. * // => 2
  10256. *
  10257. * _.size('pebbles');
  10258. * // => 7
  10259. */
  10260. function size(collection) {
  10261. if (collection == null) {
  10262. return 0;
  10263. }
  10264. if (isArrayLike(collection)) {
  10265. return isString(collection) ? stringSize(collection) : collection.length;
  10266. }
  10267. var tag = getTag(collection);
  10268. if (tag == mapTag || tag == setTag) {
  10269. return collection.size;
  10270. }
  10271. return baseKeys(collection).length;
  10272. }
  10273. /**
  10274. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10275. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10276. * invoked with three arguments: (value, index|key, collection).
  10277. *
  10278. * @static
  10279. * @memberOf _
  10280. * @since 0.1.0
  10281. * @category Collection
  10282. * @param {Array|Object} collection The collection to iterate over.
  10283. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10284. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10285. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10286. * else `false`.
  10287. * @example
  10288. *
  10289. * _.some([null, 0, 'yes', false], Boolean);
  10290. * // => true
  10291. *
  10292. * var users = [
  10293. * { 'user': 'barney', 'active': true },
  10294. * { 'user': 'fred', 'active': false }
  10295. * ];
  10296. *
  10297. * // The `_.matches` iteratee shorthand.
  10298. * _.some(users, { 'user': 'barney', 'active': false });
  10299. * // => false
  10300. *
  10301. * // The `_.matchesProperty` iteratee shorthand.
  10302. * _.some(users, ['active', false]);
  10303. * // => true
  10304. *
  10305. * // The `_.property` iteratee shorthand.
  10306. * _.some(users, 'active');
  10307. * // => true
  10308. */
  10309. function some(collection, predicate, guard) {
  10310. var func = isArray(collection) ? arraySome : baseSome;
  10311. if (guard && isIterateeCall(collection, predicate, guard)) {
  10312. predicate = undefined;
  10313. }
  10314. return func(collection, getIteratee(predicate, 3));
  10315. }
  10316. /**
  10317. * Creates an array of elements, sorted in ascending order by the results of
  10318. * running each element in a collection thru each iteratee. This method
  10319. * performs a stable sort, that is, it preserves the original sort order of
  10320. * equal elements. The iteratees are invoked with one argument: (value).
  10321. *
  10322. * @static
  10323. * @memberOf _
  10324. * @since 0.1.0
  10325. * @category Collection
  10326. * @param {Array|Object} collection The collection to iterate over.
  10327. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10328. * The iteratees to sort by.
  10329. * @returns {Array} Returns the new sorted array.
  10330. * @example
  10331. *
  10332. * var users = [
  10333. * { 'user': 'fred', 'age': 48 },
  10334. * { 'user': 'barney', 'age': 36 },
  10335. * { 'user': 'fred', 'age': 30 },
  10336. * { 'user': 'barney', 'age': 34 }
  10337. * ];
  10338. *
  10339. * _.sortBy(users, [function(o) { return o.user; }]);
  10340. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10341. *
  10342. * _.sortBy(users, ['user', 'age']);
  10343. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10344. */
  10345. var sortBy = baseRest(function(collection, iteratees) {
  10346. if (collection == null) {
  10347. return [];
  10348. }
  10349. var length = iteratees.length;
  10350. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10351. iteratees = [];
  10352. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10353. iteratees = [iteratees[0]];
  10354. }
  10355. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10356. });
  10357. /*------------------------------------------------------------------------*/
  10358. /**
  10359. * Gets the timestamp of the number of milliseconds that have elapsed since
  10360. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10361. *
  10362. * @static
  10363. * @memberOf _
  10364. * @since 2.4.0
  10365. * @category Date
  10366. * @returns {number} Returns the timestamp.
  10367. * @example
  10368. *
  10369. * _.defer(function(stamp) {
  10370. * console.log(_.now() - stamp);
  10371. * }, _.now());
  10372. * // => Logs the number of milliseconds it took for the deferred invocation.
  10373. */
  10374. var now = ctxNow || function() {
  10375. return root.Date.now();
  10376. };
  10377. /*------------------------------------------------------------------------*/
  10378. /**
  10379. * The opposite of `_.before`; this method creates a function that invokes
  10380. * `func` once it's called `n` or more times.
  10381. *
  10382. * @static
  10383. * @memberOf _
  10384. * @since 0.1.0
  10385. * @category Function
  10386. * @param {number} n The number of calls before `func` is invoked.
  10387. * @param {Function} func The function to restrict.
  10388. * @returns {Function} Returns the new restricted function.
  10389. * @example
  10390. *
  10391. * var saves = ['profile', 'settings'];
  10392. *
  10393. * var done = _.after(saves.length, function() {
  10394. * console.log('done saving!');
  10395. * });
  10396. *
  10397. * _.forEach(saves, function(type) {
  10398. * asyncSave({ 'type': type, 'complete': done });
  10399. * });
  10400. * // => Logs 'done saving!' after the two async saves have completed.
  10401. */
  10402. function after(n, func) {
  10403. if (typeof func != 'function') {
  10404. throw new TypeError(FUNC_ERROR_TEXT);
  10405. }
  10406. n = toInteger(n);
  10407. return function() {
  10408. if (--n < 1) {
  10409. return func.apply(this, arguments);
  10410. }
  10411. };
  10412. }
  10413. /**
  10414. * Creates a function that invokes `func`, with up to `n` arguments,
  10415. * ignoring any additional arguments.
  10416. *
  10417. * @static
  10418. * @memberOf _
  10419. * @since 3.0.0
  10420. * @category Function
  10421. * @param {Function} func The function to cap arguments for.
  10422. * @param {number} [n=func.length] The arity cap.
  10423. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10424. * @returns {Function} Returns the new capped function.
  10425. * @example
  10426. *
  10427. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10428. * // => [6, 8, 10]
  10429. */
  10430. function ary(func, n, guard) {
  10431. n = guard ? undefined : n;
  10432. n = (func && n == null) ? func.length : n;
  10433. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10434. }
  10435. /**
  10436. * Creates a function that invokes `func`, with the `this` binding and arguments
  10437. * of the created function, while it's called less than `n` times. Subsequent
  10438. * calls to the created function return the result of the last `func` invocation.
  10439. *
  10440. * @static
  10441. * @memberOf _
  10442. * @since 3.0.0
  10443. * @category Function
  10444. * @param {number} n The number of calls at which `func` is no longer invoked.
  10445. * @param {Function} func The function to restrict.
  10446. * @returns {Function} Returns the new restricted function.
  10447. * @example
  10448. *
  10449. * jQuery(element).on('click', _.before(5, addContactToList));
  10450. * // => Allows adding up to 4 contacts to the list.
  10451. */
  10452. function before(n, func) {
  10453. var result;
  10454. if (typeof func != 'function') {
  10455. throw new TypeError(FUNC_ERROR_TEXT);
  10456. }
  10457. n = toInteger(n);
  10458. return function() {
  10459. if (--n > 0) {
  10460. result = func.apply(this, arguments);
  10461. }
  10462. if (n <= 1) {
  10463. func = undefined;
  10464. }
  10465. return result;
  10466. };
  10467. }
  10468. /**
  10469. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10470. * and `partials` prepended to the arguments it receives.
  10471. *
  10472. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10473. * may be used as a placeholder for partially applied arguments.
  10474. *
  10475. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10476. * property of bound functions.
  10477. *
  10478. * @static
  10479. * @memberOf _
  10480. * @since 0.1.0
  10481. * @category Function
  10482. * @param {Function} func The function to bind.
  10483. * @param {*} thisArg The `this` binding of `func`.
  10484. * @param {...*} [partials] The arguments to be partially applied.
  10485. * @returns {Function} Returns the new bound function.
  10486. * @example
  10487. *
  10488. * function greet(greeting, punctuation) {
  10489. * return greeting + ' ' + this.user + punctuation;
  10490. * }
  10491. *
  10492. * var object = { 'user': 'fred' };
  10493. *
  10494. * var bound = _.bind(greet, object, 'hi');
  10495. * bound('!');
  10496. * // => 'hi fred!'
  10497. *
  10498. * // Bound with placeholders.
  10499. * var bound = _.bind(greet, object, _, '!');
  10500. * bound('hi');
  10501. * // => 'hi fred!'
  10502. */
  10503. var bind = baseRest(function(func, thisArg, partials) {
  10504. var bitmask = WRAP_BIND_FLAG;
  10505. if (partials.length) {
  10506. var holders = replaceHolders(partials, getHolder(bind));
  10507. bitmask |= WRAP_PARTIAL_FLAG;
  10508. }
  10509. return createWrap(func, bitmask, thisArg, partials, holders);
  10510. });
  10511. /**
  10512. * Creates a function that invokes the method at `object[key]` with `partials`
  10513. * prepended to the arguments it receives.
  10514. *
  10515. * This method differs from `_.bind` by allowing bound functions to reference
  10516. * methods that may be redefined or don't yet exist. See
  10517. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10518. * for more details.
  10519. *
  10520. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10521. * builds, may be used as a placeholder for partially applied arguments.
  10522. *
  10523. * @static
  10524. * @memberOf _
  10525. * @since 0.10.0
  10526. * @category Function
  10527. * @param {Object} object The object to invoke the method on.
  10528. * @param {string} key The key of the method.
  10529. * @param {...*} [partials] The arguments to be partially applied.
  10530. * @returns {Function} Returns the new bound function.
  10531. * @example
  10532. *
  10533. * var object = {
  10534. * 'user': 'fred',
  10535. * 'greet': function(greeting, punctuation) {
  10536. * return greeting + ' ' + this.user + punctuation;
  10537. * }
  10538. * };
  10539. *
  10540. * var bound = _.bindKey(object, 'greet', 'hi');
  10541. * bound('!');
  10542. * // => 'hi fred!'
  10543. *
  10544. * object.greet = function(greeting, punctuation) {
  10545. * return greeting + 'ya ' + this.user + punctuation;
  10546. * };
  10547. *
  10548. * bound('!');
  10549. * // => 'hiya fred!'
  10550. *
  10551. * // Bound with placeholders.
  10552. * var bound = _.bindKey(object, 'greet', _, '!');
  10553. * bound('hi');
  10554. * // => 'hiya fred!'
  10555. */
  10556. var bindKey = baseRest(function(object, key, partials) {
  10557. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10558. if (partials.length) {
  10559. var holders = replaceHolders(partials, getHolder(bindKey));
  10560. bitmask |= WRAP_PARTIAL_FLAG;
  10561. }
  10562. return createWrap(key, bitmask, object, partials, holders);
  10563. });
  10564. /**
  10565. * Creates a function that accepts arguments of `func` and either invokes
  10566. * `func` returning its result, if at least `arity` number of arguments have
  10567. * been provided, or returns a function that accepts the remaining `func`
  10568. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10569. * is not sufficient.
  10570. *
  10571. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10572. * may be used as a placeholder for provided arguments.
  10573. *
  10574. * **Note:** This method doesn't set the "length" property of curried functions.
  10575. *
  10576. * @static
  10577. * @memberOf _
  10578. * @since 2.0.0
  10579. * @category Function
  10580. * @param {Function} func The function to curry.
  10581. * @param {number} [arity=func.length] The arity of `func`.
  10582. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10583. * @returns {Function} Returns the new curried function.
  10584. * @example
  10585. *
  10586. * var abc = function(a, b, c) {
  10587. * return [a, b, c];
  10588. * };
  10589. *
  10590. * var curried = _.curry(abc);
  10591. *
  10592. * curried(1)(2)(3);
  10593. * // => [1, 2, 3]
  10594. *
  10595. * curried(1, 2)(3);
  10596. * // => [1, 2, 3]
  10597. *
  10598. * curried(1, 2, 3);
  10599. * // => [1, 2, 3]
  10600. *
  10601. * // Curried with placeholders.
  10602. * curried(1)(_, 3)(2);
  10603. * // => [1, 2, 3]
  10604. */
  10605. function curry(func, arity, guard) {
  10606. arity = guard ? undefined : arity;
  10607. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10608. result.placeholder = curry.placeholder;
  10609. return result;
  10610. }
  10611. /**
  10612. * This method is like `_.curry` except that arguments are applied to `func`
  10613. * in the manner of `_.partialRight` instead of `_.partial`.
  10614. *
  10615. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10616. * builds, may be used as a placeholder for provided arguments.
  10617. *
  10618. * **Note:** This method doesn't set the "length" property of curried functions.
  10619. *
  10620. * @static
  10621. * @memberOf _
  10622. * @since 3.0.0
  10623. * @category Function
  10624. * @param {Function} func The function to curry.
  10625. * @param {number} [arity=func.length] The arity of `func`.
  10626. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10627. * @returns {Function} Returns the new curried function.
  10628. * @example
  10629. *
  10630. * var abc = function(a, b, c) {
  10631. * return [a, b, c];
  10632. * };
  10633. *
  10634. * var curried = _.curryRight(abc);
  10635. *
  10636. * curried(3)(2)(1);
  10637. * // => [1, 2, 3]
  10638. *
  10639. * curried(2, 3)(1);
  10640. * // => [1, 2, 3]
  10641. *
  10642. * curried(1, 2, 3);
  10643. * // => [1, 2, 3]
  10644. *
  10645. * // Curried with placeholders.
  10646. * curried(3)(1, _)(2);
  10647. * // => [1, 2, 3]
  10648. */
  10649. function curryRight(func, arity, guard) {
  10650. arity = guard ? undefined : arity;
  10651. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10652. result.placeholder = curryRight.placeholder;
  10653. return result;
  10654. }
  10655. /**
  10656. * Creates a debounced function that delays invoking `func` until after `wait`
  10657. * milliseconds have elapsed since the last time the debounced function was
  10658. * invoked. The debounced function comes with a `cancel` method to cancel
  10659. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10660. * Provide `options` to indicate whether `func` should be invoked on the
  10661. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10662. * with the last arguments provided to the debounced function. Subsequent
  10663. * calls to the debounced function return the result of the last `func`
  10664. * invocation.
  10665. *
  10666. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10667. * invoked on the trailing edge of the timeout only if the debounced function
  10668. * is invoked more than once during the `wait` timeout.
  10669. *
  10670. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10671. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10672. *
  10673. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10674. * for details over the differences between `_.debounce` and `_.throttle`.
  10675. *
  10676. * @static
  10677. * @memberOf _
  10678. * @since 0.1.0
  10679. * @category Function
  10680. * @param {Function} func The function to debounce.
  10681. * @param {number} [wait=0] The number of milliseconds to delay.
  10682. * @param {Object} [options={}] The options object.
  10683. * @param {boolean} [options.leading=false]
  10684. * Specify invoking on the leading edge of the timeout.
  10685. * @param {number} [options.maxWait]
  10686. * The maximum time `func` is allowed to be delayed before it's invoked.
  10687. * @param {boolean} [options.trailing=true]
  10688. * Specify invoking on the trailing edge of the timeout.
  10689. * @returns {Function} Returns the new debounced function.
  10690. * @example
  10691. *
  10692. * // Avoid costly calculations while the window size is in flux.
  10693. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10694. *
  10695. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10696. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10697. * 'leading': true,
  10698. * 'trailing': false
  10699. * }));
  10700. *
  10701. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10702. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10703. * var source = new EventSource('/stream');
  10704. * jQuery(source).on('message', debounced);
  10705. *
  10706. * // Cancel the trailing debounced invocation.
  10707. * jQuery(window).on('popstate', debounced.cancel);
  10708. */
  10709. function debounce(func, wait, options) {
  10710. var lastArgs,
  10711. lastThis,
  10712. maxWait,
  10713. result,
  10714. timerId,
  10715. lastCallTime,
  10716. lastInvokeTime = 0,
  10717. leading = false,
  10718. maxing = false,
  10719. trailing = true;
  10720. if (typeof func != 'function') {
  10721. throw new TypeError(FUNC_ERROR_TEXT);
  10722. }
  10723. wait = toNumber(wait) || 0;
  10724. if (isObject(options)) {
  10725. leading = !!options.leading;
  10726. maxing = 'maxWait' in options;
  10727. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10728. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10729. }
  10730. function invokeFunc(time) {
  10731. var args = lastArgs,
  10732. thisArg = lastThis;
  10733. lastArgs = lastThis = undefined;
  10734. lastInvokeTime = time;
  10735. result = func.apply(thisArg, args);
  10736. return result;
  10737. }
  10738. function leadingEdge(time) {
  10739. // Reset any `maxWait` timer.
  10740. lastInvokeTime = time;
  10741. // Start the timer for the trailing edge.
  10742. timerId = setTimeout(timerExpired, wait);
  10743. // Invoke the leading edge.
  10744. return leading ? invokeFunc(time) : result;
  10745. }
  10746. function remainingWait(time) {
  10747. var timeSinceLastCall = time - lastCallTime,
  10748. timeSinceLastInvoke = time - lastInvokeTime,
  10749. timeWaiting = wait - timeSinceLastCall;
  10750. return maxing
  10751. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10752. : timeWaiting;
  10753. }
  10754. function shouldInvoke(time) {
  10755. var timeSinceLastCall = time - lastCallTime,
  10756. timeSinceLastInvoke = time - lastInvokeTime;
  10757. // Either this is the first call, activity has stopped and we're at the
  10758. // trailing edge, the system time has gone backwards and we're treating
  10759. // it as the trailing edge, or we've hit the `maxWait` limit.
  10760. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10761. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10762. }
  10763. function timerExpired() {
  10764. var time = now();
  10765. if (shouldInvoke(time)) {
  10766. return trailingEdge(time);
  10767. }
  10768. // Restart the timer.
  10769. timerId = setTimeout(timerExpired, remainingWait(time));
  10770. }
  10771. function trailingEdge(time) {
  10772. timerId = undefined;
  10773. // Only invoke if we have `lastArgs` which means `func` has been
  10774. // debounced at least once.
  10775. if (trailing && lastArgs) {
  10776. return invokeFunc(time);
  10777. }
  10778. lastArgs = lastThis = undefined;
  10779. return result;
  10780. }
  10781. function cancel() {
  10782. if (timerId !== undefined) {
  10783. clearTimeout(timerId);
  10784. }
  10785. lastInvokeTime = 0;
  10786. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10787. }
  10788. function flush() {
  10789. return timerId === undefined ? result : trailingEdge(now());
  10790. }
  10791. function debounced() {
  10792. var time = now(),
  10793. isInvoking = shouldInvoke(time);
  10794. lastArgs = arguments;
  10795. lastThis = this;
  10796. lastCallTime = time;
  10797. if (isInvoking) {
  10798. if (timerId === undefined) {
  10799. return leadingEdge(lastCallTime);
  10800. }
  10801. if (maxing) {
  10802. // Handle invocations in a tight loop.
  10803. clearTimeout(timerId);
  10804. timerId = setTimeout(timerExpired, wait);
  10805. return invokeFunc(lastCallTime);
  10806. }
  10807. }
  10808. if (timerId === undefined) {
  10809. timerId = setTimeout(timerExpired, wait);
  10810. }
  10811. return result;
  10812. }
  10813. debounced.cancel = cancel;
  10814. debounced.flush = flush;
  10815. return debounced;
  10816. }
  10817. /**
  10818. * Defers invoking the `func` until the current call stack has cleared. Any
  10819. * additional arguments are provided to `func` when it's invoked.
  10820. *
  10821. * @static
  10822. * @memberOf _
  10823. * @since 0.1.0
  10824. * @category Function
  10825. * @param {Function} func The function to defer.
  10826. * @param {...*} [args] The arguments to invoke `func` with.
  10827. * @returns {number} Returns the timer id.
  10828. * @example
  10829. *
  10830. * _.defer(function(text) {
  10831. * console.log(text);
  10832. * }, 'deferred');
  10833. * // => Logs 'deferred' after one millisecond.
  10834. */
  10835. var defer = baseRest(function(func, args) {
  10836. return baseDelay(func, 1, args);
  10837. });
  10838. /**
  10839. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10840. * provided to `func` when it's invoked.
  10841. *
  10842. * @static
  10843. * @memberOf _
  10844. * @since 0.1.0
  10845. * @category Function
  10846. * @param {Function} func The function to delay.
  10847. * @param {number} wait The number of milliseconds to delay invocation.
  10848. * @param {...*} [args] The arguments to invoke `func` with.
  10849. * @returns {number} Returns the timer id.
  10850. * @example
  10851. *
  10852. * _.delay(function(text) {
  10853. * console.log(text);
  10854. * }, 1000, 'later');
  10855. * // => Logs 'later' after one second.
  10856. */
  10857. var delay = baseRest(function(func, wait, args) {
  10858. return baseDelay(func, toNumber(wait) || 0, args);
  10859. });
  10860. /**
  10861. * Creates a function that invokes `func` with arguments reversed.
  10862. *
  10863. * @static
  10864. * @memberOf _
  10865. * @since 4.0.0
  10866. * @category Function
  10867. * @param {Function} func The function to flip arguments for.
  10868. * @returns {Function} Returns the new flipped function.
  10869. * @example
  10870. *
  10871. * var flipped = _.flip(function() {
  10872. * return _.toArray(arguments);
  10873. * });
  10874. *
  10875. * flipped('a', 'b', 'c', 'd');
  10876. * // => ['d', 'c', 'b', 'a']
  10877. */
  10878. function flip(func) {
  10879. return createWrap(func, WRAP_FLIP_FLAG);
  10880. }
  10881. /**
  10882. * Creates a function that memoizes the result of `func`. If `resolver` is
  10883. * provided, it determines the cache key for storing the result based on the
  10884. * arguments provided to the memoized function. By default, the first argument
  10885. * provided to the memoized function is used as the map cache key. The `func`
  10886. * is invoked with the `this` binding of the memoized function.
  10887. *
  10888. * **Note:** The cache is exposed as the `cache` property on the memoized
  10889. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10890. * constructor with one whose instances implement the
  10891. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10892. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10893. *
  10894. * @static
  10895. * @memberOf _
  10896. * @since 0.1.0
  10897. * @category Function
  10898. * @param {Function} func The function to have its output memoized.
  10899. * @param {Function} [resolver] The function to resolve the cache key.
  10900. * @returns {Function} Returns the new memoized function.
  10901. * @example
  10902. *
  10903. * var object = { 'a': 1, 'b': 2 };
  10904. * var other = { 'c': 3, 'd': 4 };
  10905. *
  10906. * var values = _.memoize(_.values);
  10907. * values(object);
  10908. * // => [1, 2]
  10909. *
  10910. * values(other);
  10911. * // => [3, 4]
  10912. *
  10913. * object.a = 2;
  10914. * values(object);
  10915. * // => [1, 2]
  10916. *
  10917. * // Modify the result cache.
  10918. * values.cache.set(object, ['a', 'b']);
  10919. * values(object);
  10920. * // => ['a', 'b']
  10921. *
  10922. * // Replace `_.memoize.Cache`.
  10923. * _.memoize.Cache = WeakMap;
  10924. */
  10925. function memoize(func, resolver) {
  10926. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10927. throw new TypeError(FUNC_ERROR_TEXT);
  10928. }
  10929. var memoized = function() {
  10930. var args = arguments,
  10931. key = resolver ? resolver.apply(this, args) : args[0],
  10932. cache = memoized.cache;
  10933. if (cache.has(key)) {
  10934. return cache.get(key);
  10935. }
  10936. var result = func.apply(this, args);
  10937. memoized.cache = cache.set(key, result) || cache;
  10938. return result;
  10939. };
  10940. memoized.cache = new (memoize.Cache || MapCache);
  10941. return memoized;
  10942. }
  10943. // Expose `MapCache`.
  10944. memoize.Cache = MapCache;
  10945. /**
  10946. * Creates a function that negates the result of the predicate `func`. The
  10947. * `func` predicate is invoked with the `this` binding and arguments of the
  10948. * created function.
  10949. *
  10950. * @static
  10951. * @memberOf _
  10952. * @since 3.0.0
  10953. * @category Function
  10954. * @param {Function} predicate The predicate to negate.
  10955. * @returns {Function} Returns the new negated function.
  10956. * @example
  10957. *
  10958. * function isEven(n) {
  10959. * return n % 2 == 0;
  10960. * }
  10961. *
  10962. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  10963. * // => [1, 3, 5]
  10964. */
  10965. function negate(predicate) {
  10966. if (typeof predicate != 'function') {
  10967. throw new TypeError(FUNC_ERROR_TEXT);
  10968. }
  10969. return function() {
  10970. var args = arguments;
  10971. switch (args.length) {
  10972. case 0: return !predicate.call(this);
  10973. case 1: return !predicate.call(this, args[0]);
  10974. case 2: return !predicate.call(this, args[0], args[1]);
  10975. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  10976. }
  10977. return !predicate.apply(this, args);
  10978. };
  10979. }
  10980. /**
  10981. * Creates a function that is restricted to invoking `func` once. Repeat calls
  10982. * to the function return the value of the first invocation. The `func` is
  10983. * invoked with the `this` binding and arguments of the created function.
  10984. *
  10985. * @static
  10986. * @memberOf _
  10987. * @since 0.1.0
  10988. * @category Function
  10989. * @param {Function} func The function to restrict.
  10990. * @returns {Function} Returns the new restricted function.
  10991. * @example
  10992. *
  10993. * var initialize = _.once(createApplication);
  10994. * initialize();
  10995. * initialize();
  10996. * // => `createApplication` is invoked once
  10997. */
  10998. function once(func) {
  10999. return before(2, func);
  11000. }
  11001. /**
  11002. * Creates a function that invokes `func` with its arguments transformed.
  11003. *
  11004. * @static
  11005. * @since 4.0.0
  11006. * @memberOf _
  11007. * @category Function
  11008. * @param {Function} func The function to wrap.
  11009. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11010. * The argument transforms.
  11011. * @returns {Function} Returns the new function.
  11012. * @example
  11013. *
  11014. * function doubled(n) {
  11015. * return n * 2;
  11016. * }
  11017. *
  11018. * function square(n) {
  11019. * return n * n;
  11020. * }
  11021. *
  11022. * var func = _.overArgs(function(x, y) {
  11023. * return [x, y];
  11024. * }, [square, doubled]);
  11025. *
  11026. * func(9, 3);
  11027. * // => [81, 6]
  11028. *
  11029. * func(10, 5);
  11030. * // => [100, 10]
  11031. */
  11032. var overArgs = castRest(function(func, transforms) {
  11033. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11034. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11035. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11036. var funcsLength = transforms.length;
  11037. return baseRest(function(args) {
  11038. var index = -1,
  11039. length = nativeMin(args.length, funcsLength);
  11040. while (++index < length) {
  11041. args[index] = transforms[index].call(this, args[index]);
  11042. }
  11043. return apply(func, this, args);
  11044. });
  11045. });
  11046. /**
  11047. * Creates a function that invokes `func` with `partials` prepended to the
  11048. * arguments it receives. This method is like `_.bind` except it does **not**
  11049. * alter the `this` binding.
  11050. *
  11051. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11052. * builds, may be used as a placeholder for partially applied arguments.
  11053. *
  11054. * **Note:** This method doesn't set the "length" property of partially
  11055. * applied functions.
  11056. *
  11057. * @static
  11058. * @memberOf _
  11059. * @since 0.2.0
  11060. * @category Function
  11061. * @param {Function} func The function to partially apply arguments to.
  11062. * @param {...*} [partials] The arguments to be partially applied.
  11063. * @returns {Function} Returns the new partially applied function.
  11064. * @example
  11065. *
  11066. * function greet(greeting, name) {
  11067. * return greeting + ' ' + name;
  11068. * }
  11069. *
  11070. * var sayHelloTo = _.partial(greet, 'hello');
  11071. * sayHelloTo('fred');
  11072. * // => 'hello fred'
  11073. *
  11074. * // Partially applied with placeholders.
  11075. * var greetFred = _.partial(greet, _, 'fred');
  11076. * greetFred('hi');
  11077. * // => 'hi fred'
  11078. */
  11079. var partial = baseRest(function(func, partials) {
  11080. var holders = replaceHolders(partials, getHolder(partial));
  11081. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11082. });
  11083. /**
  11084. * This method is like `_.partial` except that partially applied arguments
  11085. * are appended to the arguments it receives.
  11086. *
  11087. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11088. * builds, may be used as a placeholder for partially applied arguments.
  11089. *
  11090. * **Note:** This method doesn't set the "length" property of partially
  11091. * applied functions.
  11092. *
  11093. * @static
  11094. * @memberOf _
  11095. * @since 1.0.0
  11096. * @category Function
  11097. * @param {Function} func The function to partially apply arguments to.
  11098. * @param {...*} [partials] The arguments to be partially applied.
  11099. * @returns {Function} Returns the new partially applied function.
  11100. * @example
  11101. *
  11102. * function greet(greeting, name) {
  11103. * return greeting + ' ' + name;
  11104. * }
  11105. *
  11106. * var greetFred = _.partialRight(greet, 'fred');
  11107. * greetFred('hi');
  11108. * // => 'hi fred'
  11109. *
  11110. * // Partially applied with placeholders.
  11111. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11112. * sayHelloTo('fred');
  11113. * // => 'hello fred'
  11114. */
  11115. var partialRight = baseRest(function(func, partials) {
  11116. var holders = replaceHolders(partials, getHolder(partialRight));
  11117. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11118. });
  11119. /**
  11120. * Creates a function that invokes `func` with arguments arranged according
  11121. * to the specified `indexes` where the argument value at the first index is
  11122. * provided as the first argument, the argument value at the second index is
  11123. * provided as the second argument, and so on.
  11124. *
  11125. * @static
  11126. * @memberOf _
  11127. * @since 3.0.0
  11128. * @category Function
  11129. * @param {Function} func The function to rearrange arguments for.
  11130. * @param {...(number|number[])} indexes The arranged argument indexes.
  11131. * @returns {Function} Returns the new function.
  11132. * @example
  11133. *
  11134. * var rearged = _.rearg(function(a, b, c) {
  11135. * return [a, b, c];
  11136. * }, [2, 0, 1]);
  11137. *
  11138. * rearged('b', 'c', 'a')
  11139. * // => ['a', 'b', 'c']
  11140. */
  11141. var rearg = flatRest(function(func, indexes) {
  11142. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11143. });
  11144. /**
  11145. * Creates a function that invokes `func` with the `this` binding of the
  11146. * created function and arguments from `start` and beyond provided as
  11147. * an array.
  11148. *
  11149. * **Note:** This method is based on the
  11150. * [rest parameter](https://mdn.io/rest_parameters).
  11151. *
  11152. * @static
  11153. * @memberOf _
  11154. * @since 4.0.0
  11155. * @category Function
  11156. * @param {Function} func The function to apply a rest parameter to.
  11157. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11158. * @returns {Function} Returns the new function.
  11159. * @example
  11160. *
  11161. * var say = _.rest(function(what, names) {
  11162. * return what + ' ' + _.initial(names).join(', ') +
  11163. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11164. * });
  11165. *
  11166. * say('hello', 'fred', 'barney', 'pebbles');
  11167. * // => 'hello fred, barney, & pebbles'
  11168. */
  11169. function rest(func, start) {
  11170. if (typeof func != 'function') {
  11171. throw new TypeError(FUNC_ERROR_TEXT);
  11172. }
  11173. start = start === undefined ? start : toInteger(start);
  11174. return baseRest(func, start);
  11175. }
  11176. /**
  11177. * Creates a function that invokes `func` with the `this` binding of the
  11178. * create function and an array of arguments much like
  11179. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11180. *
  11181. * **Note:** This method is based on the
  11182. * [spread operator](https://mdn.io/spread_operator).
  11183. *
  11184. * @static
  11185. * @memberOf _
  11186. * @since 3.2.0
  11187. * @category Function
  11188. * @param {Function} func The function to spread arguments over.
  11189. * @param {number} [start=0] The start position of the spread.
  11190. * @returns {Function} Returns the new function.
  11191. * @example
  11192. *
  11193. * var say = _.spread(function(who, what) {
  11194. * return who + ' says ' + what;
  11195. * });
  11196. *
  11197. * say(['fred', 'hello']);
  11198. * // => 'fred says hello'
  11199. *
  11200. * var numbers = Promise.all([
  11201. * Promise.resolve(40),
  11202. * Promise.resolve(36)
  11203. * ]);
  11204. *
  11205. * numbers.then(_.spread(function(x, y) {
  11206. * return x + y;
  11207. * }));
  11208. * // => a Promise of 76
  11209. */
  11210. function spread(func, start) {
  11211. if (typeof func != 'function') {
  11212. throw new TypeError(FUNC_ERROR_TEXT);
  11213. }
  11214. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11215. return baseRest(function(args) {
  11216. var array = args[start],
  11217. otherArgs = castSlice(args, 0, start);
  11218. if (array) {
  11219. arrayPush(otherArgs, array);
  11220. }
  11221. return apply(func, this, otherArgs);
  11222. });
  11223. }
  11224. /**
  11225. * Creates a throttled function that only invokes `func` at most once per
  11226. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11227. * method to cancel delayed `func` invocations and a `flush` method to
  11228. * immediately invoke them. Provide `options` to indicate whether `func`
  11229. * should be invoked on the leading and/or trailing edge of the `wait`
  11230. * timeout. The `func` is invoked with the last arguments provided to the
  11231. * throttled function. Subsequent calls to the throttled function return the
  11232. * result of the last `func` invocation.
  11233. *
  11234. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11235. * invoked on the trailing edge of the timeout only if the throttled function
  11236. * is invoked more than once during the `wait` timeout.
  11237. *
  11238. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11239. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11240. *
  11241. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11242. * for details over the differences between `_.throttle` and `_.debounce`.
  11243. *
  11244. * @static
  11245. * @memberOf _
  11246. * @since 0.1.0
  11247. * @category Function
  11248. * @param {Function} func The function to throttle.
  11249. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11250. * @param {Object} [options={}] The options object.
  11251. * @param {boolean} [options.leading=true]
  11252. * Specify invoking on the leading edge of the timeout.
  11253. * @param {boolean} [options.trailing=true]
  11254. * Specify invoking on the trailing edge of the timeout.
  11255. * @returns {Function} Returns the new throttled function.
  11256. * @example
  11257. *
  11258. * // Avoid excessively updating the position while scrolling.
  11259. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11260. *
  11261. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11262. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11263. * jQuery(element).on('click', throttled);
  11264. *
  11265. * // Cancel the trailing throttled invocation.
  11266. * jQuery(window).on('popstate', throttled.cancel);
  11267. */
  11268. function throttle(func, wait, options) {
  11269. var leading = true,
  11270. trailing = true;
  11271. if (typeof func != 'function') {
  11272. throw new TypeError(FUNC_ERROR_TEXT);
  11273. }
  11274. if (isObject(options)) {
  11275. leading = 'leading' in options ? !!options.leading : leading;
  11276. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11277. }
  11278. return debounce(func, wait, {
  11279. 'leading': leading,
  11280. 'maxWait': wait,
  11281. 'trailing': trailing
  11282. });
  11283. }
  11284. /**
  11285. * Creates a function that accepts up to one argument, ignoring any
  11286. * additional arguments.
  11287. *
  11288. * @static
  11289. * @memberOf _
  11290. * @since 4.0.0
  11291. * @category Function
  11292. * @param {Function} func The function to cap arguments for.
  11293. * @returns {Function} Returns the new capped function.
  11294. * @example
  11295. *
  11296. * _.map(['6', '8', '10'], _.unary(parseInt));
  11297. * // => [6, 8, 10]
  11298. */
  11299. function unary(func) {
  11300. return ary(func, 1);
  11301. }
  11302. /**
  11303. * Creates a function that provides `value` to `wrapper` as its first
  11304. * argument. Any additional arguments provided to the function are appended
  11305. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11306. * binding of the created function.
  11307. *
  11308. * @static
  11309. * @memberOf _
  11310. * @since 0.1.0
  11311. * @category Function
  11312. * @param {*} value The value to wrap.
  11313. * @param {Function} [wrapper=identity] The wrapper function.
  11314. * @returns {Function} Returns the new function.
  11315. * @example
  11316. *
  11317. * var p = _.wrap(_.escape, function(func, text) {
  11318. * return '<p>' + func(text) + '</p>';
  11319. * });
  11320. *
  11321. * p('fred, barney, & pebbles');
  11322. * // => '<p>fred, barney, &amp; pebbles</p>'
  11323. */
  11324. function wrap(value, wrapper) {
  11325. return partial(castFunction(wrapper), value);
  11326. }
  11327. /*------------------------------------------------------------------------*/
  11328. /**
  11329. * Casts `value` as an array if it's not one.
  11330. *
  11331. * @static
  11332. * @memberOf _
  11333. * @since 4.4.0
  11334. * @category Lang
  11335. * @param {*} value The value to inspect.
  11336. * @returns {Array} Returns the cast array.
  11337. * @example
  11338. *
  11339. * _.castArray(1);
  11340. * // => [1]
  11341. *
  11342. * _.castArray({ 'a': 1 });
  11343. * // => [{ 'a': 1 }]
  11344. *
  11345. * _.castArray('abc');
  11346. * // => ['abc']
  11347. *
  11348. * _.castArray(null);
  11349. * // => [null]
  11350. *
  11351. * _.castArray(undefined);
  11352. * // => [undefined]
  11353. *
  11354. * _.castArray();
  11355. * // => []
  11356. *
  11357. * var array = [1, 2, 3];
  11358. * console.log(_.castArray(array) === array);
  11359. * // => true
  11360. */
  11361. function castArray() {
  11362. if (!arguments.length) {
  11363. return [];
  11364. }
  11365. var value = arguments[0];
  11366. return isArray(value) ? value : [value];
  11367. }
  11368. /**
  11369. * Creates a shallow clone of `value`.
  11370. *
  11371. * **Note:** This method is loosely based on the
  11372. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11373. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11374. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11375. * arrays. The own enumerable properties of `arguments` objects are cloned
  11376. * as plain objects. An empty object is returned for uncloneable values such
  11377. * as error objects, functions, DOM nodes, and WeakMaps.
  11378. *
  11379. * @static
  11380. * @memberOf _
  11381. * @since 0.1.0
  11382. * @category Lang
  11383. * @param {*} value The value to clone.
  11384. * @returns {*} Returns the cloned value.
  11385. * @see _.cloneDeep
  11386. * @example
  11387. *
  11388. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11389. *
  11390. * var shallow = _.clone(objects);
  11391. * console.log(shallow[0] === objects[0]);
  11392. * // => true
  11393. */
  11394. function clone(value) {
  11395. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11396. }
  11397. /**
  11398. * This method is like `_.clone` except that it accepts `customizer` which
  11399. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11400. * cloning is handled by the method instead. The `customizer` is invoked with
  11401. * up to four arguments; (value [, index|key, object, stack]).
  11402. *
  11403. * @static
  11404. * @memberOf _
  11405. * @since 4.0.0
  11406. * @category Lang
  11407. * @param {*} value The value to clone.
  11408. * @param {Function} [customizer] The function to customize cloning.
  11409. * @returns {*} Returns the cloned value.
  11410. * @see _.cloneDeepWith
  11411. * @example
  11412. *
  11413. * function customizer(value) {
  11414. * if (_.isElement(value)) {
  11415. * return value.cloneNode(false);
  11416. * }
  11417. * }
  11418. *
  11419. * var el = _.cloneWith(document.body, customizer);
  11420. *
  11421. * console.log(el === document.body);
  11422. * // => false
  11423. * console.log(el.nodeName);
  11424. * // => 'BODY'
  11425. * console.log(el.childNodes.length);
  11426. * // => 0
  11427. */
  11428. function cloneWith(value, customizer) {
  11429. customizer = typeof customizer == 'function' ? customizer : undefined;
  11430. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11431. }
  11432. /**
  11433. * This method is like `_.clone` except that it recursively clones `value`.
  11434. *
  11435. * @static
  11436. * @memberOf _
  11437. * @since 1.0.0
  11438. * @category Lang
  11439. * @param {*} value The value to recursively clone.
  11440. * @returns {*} Returns the deep cloned value.
  11441. * @see _.clone
  11442. * @example
  11443. *
  11444. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11445. *
  11446. * var deep = _.cloneDeep(objects);
  11447. * console.log(deep[0] === objects[0]);
  11448. * // => false
  11449. */
  11450. function cloneDeep(value) {
  11451. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11452. }
  11453. /**
  11454. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11455. *
  11456. * @static
  11457. * @memberOf _
  11458. * @since 4.0.0
  11459. * @category Lang
  11460. * @param {*} value The value to recursively clone.
  11461. * @param {Function} [customizer] The function to customize cloning.
  11462. * @returns {*} Returns the deep cloned value.
  11463. * @see _.cloneWith
  11464. * @example
  11465. *
  11466. * function customizer(value) {
  11467. * if (_.isElement(value)) {
  11468. * return value.cloneNode(true);
  11469. * }
  11470. * }
  11471. *
  11472. * var el = _.cloneDeepWith(document.body, customizer);
  11473. *
  11474. * console.log(el === document.body);
  11475. * // => false
  11476. * console.log(el.nodeName);
  11477. * // => 'BODY'
  11478. * console.log(el.childNodes.length);
  11479. * // => 20
  11480. */
  11481. function cloneDeepWith(value, customizer) {
  11482. customizer = typeof customizer == 'function' ? customizer : undefined;
  11483. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11484. }
  11485. /**
  11486. * Checks if `object` conforms to `source` by invoking the predicate
  11487. * properties of `source` with the corresponding property values of `object`.
  11488. *
  11489. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11490. * partially applied.
  11491. *
  11492. * @static
  11493. * @memberOf _
  11494. * @since 4.14.0
  11495. * @category Lang
  11496. * @param {Object} object The object to inspect.
  11497. * @param {Object} source The object of property predicates to conform to.
  11498. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11499. * @example
  11500. *
  11501. * var object = { 'a': 1, 'b': 2 };
  11502. *
  11503. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11504. * // => true
  11505. *
  11506. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11507. * // => false
  11508. */
  11509. function conformsTo(object, source) {
  11510. return source == null || baseConformsTo(object, source, keys(source));
  11511. }
  11512. /**
  11513. * Performs a
  11514. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11515. * comparison between two values to determine if they are equivalent.
  11516. *
  11517. * @static
  11518. * @memberOf _
  11519. * @since 4.0.0
  11520. * @category Lang
  11521. * @param {*} value The value to compare.
  11522. * @param {*} other The other value to compare.
  11523. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11524. * @example
  11525. *
  11526. * var object = { 'a': 1 };
  11527. * var other = { 'a': 1 };
  11528. *
  11529. * _.eq(object, object);
  11530. * // => true
  11531. *
  11532. * _.eq(object, other);
  11533. * // => false
  11534. *
  11535. * _.eq('a', 'a');
  11536. * // => true
  11537. *
  11538. * _.eq('a', Object('a'));
  11539. * // => false
  11540. *
  11541. * _.eq(NaN, NaN);
  11542. * // => true
  11543. */
  11544. function eq(value, other) {
  11545. return value === other || (value !== value && other !== other);
  11546. }
  11547. /**
  11548. * Checks if `value` is greater than `other`.
  11549. *
  11550. * @static
  11551. * @memberOf _
  11552. * @since 3.9.0
  11553. * @category Lang
  11554. * @param {*} value The value to compare.
  11555. * @param {*} other The other value to compare.
  11556. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11557. * else `false`.
  11558. * @see _.lt
  11559. * @example
  11560. *
  11561. * _.gt(3, 1);
  11562. * // => true
  11563. *
  11564. * _.gt(3, 3);
  11565. * // => false
  11566. *
  11567. * _.gt(1, 3);
  11568. * // => false
  11569. */
  11570. var gt = createRelationalOperation(baseGt);
  11571. /**
  11572. * Checks if `value` is greater than or equal to `other`.
  11573. *
  11574. * @static
  11575. * @memberOf _
  11576. * @since 3.9.0
  11577. * @category Lang
  11578. * @param {*} value The value to compare.
  11579. * @param {*} other The other value to compare.
  11580. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11581. * `other`, else `false`.
  11582. * @see _.lte
  11583. * @example
  11584. *
  11585. * _.gte(3, 1);
  11586. * // => true
  11587. *
  11588. * _.gte(3, 3);
  11589. * // => true
  11590. *
  11591. * _.gte(1, 3);
  11592. * // => false
  11593. */
  11594. var gte = createRelationalOperation(function(value, other) {
  11595. return value >= other;
  11596. });
  11597. /**
  11598. * Checks if `value` is likely an `arguments` object.
  11599. *
  11600. * @static
  11601. * @memberOf _
  11602. * @since 0.1.0
  11603. * @category Lang
  11604. * @param {*} value The value to check.
  11605. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11606. * else `false`.
  11607. * @example
  11608. *
  11609. * _.isArguments(function() { return arguments; }());
  11610. * // => true
  11611. *
  11612. * _.isArguments([1, 2, 3]);
  11613. * // => false
  11614. */
  11615. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11616. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11617. !propertyIsEnumerable.call(value, 'callee');
  11618. };
  11619. /**
  11620. * Checks if `value` is classified as an `Array` object.
  11621. *
  11622. * @static
  11623. * @memberOf _
  11624. * @since 0.1.0
  11625. * @category Lang
  11626. * @param {*} value The value to check.
  11627. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11628. * @example
  11629. *
  11630. * _.isArray([1, 2, 3]);
  11631. * // => true
  11632. *
  11633. * _.isArray(document.body.children);
  11634. * // => false
  11635. *
  11636. * _.isArray('abc');
  11637. * // => false
  11638. *
  11639. * _.isArray(_.noop);
  11640. * // => false
  11641. */
  11642. var isArray = Array.isArray;
  11643. /**
  11644. * Checks if `value` is classified as an `ArrayBuffer` object.
  11645. *
  11646. * @static
  11647. * @memberOf _
  11648. * @since 4.3.0
  11649. * @category Lang
  11650. * @param {*} value The value to check.
  11651. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11652. * @example
  11653. *
  11654. * _.isArrayBuffer(new ArrayBuffer(2));
  11655. * // => true
  11656. *
  11657. * _.isArrayBuffer(new Array(2));
  11658. * // => false
  11659. */
  11660. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11661. /**
  11662. * Checks if `value` is array-like. A value is considered array-like if it's
  11663. * not a function and has a `value.length` that's an integer greater than or
  11664. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 4.0.0
  11669. * @category Lang
  11670. * @param {*} value The value to check.
  11671. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11672. * @example
  11673. *
  11674. * _.isArrayLike([1, 2, 3]);
  11675. * // => true
  11676. *
  11677. * _.isArrayLike(document.body.children);
  11678. * // => true
  11679. *
  11680. * _.isArrayLike('abc');
  11681. * // => true
  11682. *
  11683. * _.isArrayLike(_.noop);
  11684. * // => false
  11685. */
  11686. function isArrayLike(value) {
  11687. return value != null && isLength(value.length) && !isFunction(value);
  11688. }
  11689. /**
  11690. * This method is like `_.isArrayLike` except that it also checks if `value`
  11691. * is an object.
  11692. *
  11693. * @static
  11694. * @memberOf _
  11695. * @since 4.0.0
  11696. * @category Lang
  11697. * @param {*} value The value to check.
  11698. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11699. * else `false`.
  11700. * @example
  11701. *
  11702. * _.isArrayLikeObject([1, 2, 3]);
  11703. * // => true
  11704. *
  11705. * _.isArrayLikeObject(document.body.children);
  11706. * // => true
  11707. *
  11708. * _.isArrayLikeObject('abc');
  11709. * // => false
  11710. *
  11711. * _.isArrayLikeObject(_.noop);
  11712. * // => false
  11713. */
  11714. function isArrayLikeObject(value) {
  11715. return isObjectLike(value) && isArrayLike(value);
  11716. }
  11717. /**
  11718. * Checks if `value` is classified as a boolean primitive or object.
  11719. *
  11720. * @static
  11721. * @memberOf _
  11722. * @since 0.1.0
  11723. * @category Lang
  11724. * @param {*} value The value to check.
  11725. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11726. * @example
  11727. *
  11728. * _.isBoolean(false);
  11729. * // => true
  11730. *
  11731. * _.isBoolean(null);
  11732. * // => false
  11733. */
  11734. function isBoolean(value) {
  11735. return value === true || value === false ||
  11736. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11737. }
  11738. /**
  11739. * Checks if `value` is a buffer.
  11740. *
  11741. * @static
  11742. * @memberOf _
  11743. * @since 4.3.0
  11744. * @category Lang
  11745. * @param {*} value The value to check.
  11746. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11747. * @example
  11748. *
  11749. * _.isBuffer(new Buffer(2));
  11750. * // => true
  11751. *
  11752. * _.isBuffer(new Uint8Array(2));
  11753. * // => false
  11754. */
  11755. var isBuffer = nativeIsBuffer || stubFalse;
  11756. /**
  11757. * Checks if `value` is classified as a `Date` object.
  11758. *
  11759. * @static
  11760. * @memberOf _
  11761. * @since 0.1.0
  11762. * @category Lang
  11763. * @param {*} value The value to check.
  11764. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11765. * @example
  11766. *
  11767. * _.isDate(new Date);
  11768. * // => true
  11769. *
  11770. * _.isDate('Mon April 23 2012');
  11771. * // => false
  11772. */
  11773. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11774. /**
  11775. * Checks if `value` is likely a DOM element.
  11776. *
  11777. * @static
  11778. * @memberOf _
  11779. * @since 0.1.0
  11780. * @category Lang
  11781. * @param {*} value The value to check.
  11782. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11783. * @example
  11784. *
  11785. * _.isElement(document.body);
  11786. * // => true
  11787. *
  11788. * _.isElement('<body>');
  11789. * // => false
  11790. */
  11791. function isElement(value) {
  11792. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11793. }
  11794. /**
  11795. * Checks if `value` is an empty object, collection, map, or set.
  11796. *
  11797. * Objects are considered empty if they have no own enumerable string keyed
  11798. * properties.
  11799. *
  11800. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11801. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11802. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11803. *
  11804. * @static
  11805. * @memberOf _
  11806. * @since 0.1.0
  11807. * @category Lang
  11808. * @param {*} value The value to check.
  11809. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11810. * @example
  11811. *
  11812. * _.isEmpty(null);
  11813. * // => true
  11814. *
  11815. * _.isEmpty(true);
  11816. * // => true
  11817. *
  11818. * _.isEmpty(1);
  11819. * // => true
  11820. *
  11821. * _.isEmpty([1, 2, 3]);
  11822. * // => false
  11823. *
  11824. * _.isEmpty({ 'a': 1 });
  11825. * // => false
  11826. */
  11827. function isEmpty(value) {
  11828. if (value == null) {
  11829. return true;
  11830. }
  11831. if (isArrayLike(value) &&
  11832. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11833. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11834. return !value.length;
  11835. }
  11836. var tag = getTag(value);
  11837. if (tag == mapTag || tag == setTag) {
  11838. return !value.size;
  11839. }
  11840. if (isPrototype(value)) {
  11841. return !baseKeys(value).length;
  11842. }
  11843. for (var key in value) {
  11844. if (hasOwnProperty.call(value, key)) {
  11845. return false;
  11846. }
  11847. }
  11848. return true;
  11849. }
  11850. /**
  11851. * Performs a deep comparison between two values to determine if they are
  11852. * equivalent.
  11853. *
  11854. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11855. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11856. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11857. * by their own, not inherited, enumerable properties. Functions and DOM
  11858. * nodes are compared by strict equality, i.e. `===`.
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 0.1.0
  11863. * @category Lang
  11864. * @param {*} value The value to compare.
  11865. * @param {*} other The other value to compare.
  11866. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11867. * @example
  11868. *
  11869. * var object = { 'a': 1 };
  11870. * var other = { 'a': 1 };
  11871. *
  11872. * _.isEqual(object, other);
  11873. * // => true
  11874. *
  11875. * object === other;
  11876. * // => false
  11877. */
  11878. function isEqual(value, other) {
  11879. return baseIsEqual(value, other);
  11880. }
  11881. /**
  11882. * This method is like `_.isEqual` except that it accepts `customizer` which
  11883. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11884. * are handled by the method instead. The `customizer` is invoked with up to
  11885. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11886. *
  11887. * @static
  11888. * @memberOf _
  11889. * @since 4.0.0
  11890. * @category Lang
  11891. * @param {*} value The value to compare.
  11892. * @param {*} other The other value to compare.
  11893. * @param {Function} [customizer] The function to customize comparisons.
  11894. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11895. * @example
  11896. *
  11897. * function isGreeting(value) {
  11898. * return /^h(?:i|ello)$/.test(value);
  11899. * }
  11900. *
  11901. * function customizer(objValue, othValue) {
  11902. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11903. * return true;
  11904. * }
  11905. * }
  11906. *
  11907. * var array = ['hello', 'goodbye'];
  11908. * var other = ['hi', 'goodbye'];
  11909. *
  11910. * _.isEqualWith(array, other, customizer);
  11911. * // => true
  11912. */
  11913. function isEqualWith(value, other, customizer) {
  11914. customizer = typeof customizer == 'function' ? customizer : undefined;
  11915. var result = customizer ? customizer(value, other) : undefined;
  11916. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11917. }
  11918. /**
  11919. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11920. * `SyntaxError`, `TypeError`, or `URIError` object.
  11921. *
  11922. * @static
  11923. * @memberOf _
  11924. * @since 3.0.0
  11925. * @category Lang
  11926. * @param {*} value The value to check.
  11927. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11928. * @example
  11929. *
  11930. * _.isError(new Error);
  11931. * // => true
  11932. *
  11933. * _.isError(Error);
  11934. * // => false
  11935. */
  11936. function isError(value) {
  11937. if (!isObjectLike(value)) {
  11938. return false;
  11939. }
  11940. var tag = baseGetTag(value);
  11941. return tag == errorTag || tag == domExcTag ||
  11942. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11943. }
  11944. /**
  11945. * Checks if `value` is a finite primitive number.
  11946. *
  11947. * **Note:** This method is based on
  11948. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  11949. *
  11950. * @static
  11951. * @memberOf _
  11952. * @since 0.1.0
  11953. * @category Lang
  11954. * @param {*} value The value to check.
  11955. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  11956. * @example
  11957. *
  11958. * _.isFinite(3);
  11959. * // => true
  11960. *
  11961. * _.isFinite(Number.MIN_VALUE);
  11962. * // => true
  11963. *
  11964. * _.isFinite(Infinity);
  11965. * // => false
  11966. *
  11967. * _.isFinite('3');
  11968. * // => false
  11969. */
  11970. function isFinite(value) {
  11971. return typeof value == 'number' && nativeIsFinite(value);
  11972. }
  11973. /**
  11974. * Checks if `value` is classified as a `Function` object.
  11975. *
  11976. * @static
  11977. * @memberOf _
  11978. * @since 0.1.0
  11979. * @category Lang
  11980. * @param {*} value The value to check.
  11981. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11982. * @example
  11983. *
  11984. * _.isFunction(_);
  11985. * // => true
  11986. *
  11987. * _.isFunction(/abc/);
  11988. * // => false
  11989. */
  11990. function isFunction(value) {
  11991. if (!isObject(value)) {
  11992. return false;
  11993. }
  11994. // The use of `Object#toString` avoids issues with the `typeof` operator
  11995. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  11996. var tag = baseGetTag(value);
  11997. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  11998. }
  11999. /**
  12000. * Checks if `value` is an integer.
  12001. *
  12002. * **Note:** This method is based on
  12003. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12004. *
  12005. * @static
  12006. * @memberOf _
  12007. * @since 4.0.0
  12008. * @category Lang
  12009. * @param {*} value The value to check.
  12010. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12011. * @example
  12012. *
  12013. * _.isInteger(3);
  12014. * // => true
  12015. *
  12016. * _.isInteger(Number.MIN_VALUE);
  12017. * // => false
  12018. *
  12019. * _.isInteger(Infinity);
  12020. * // => false
  12021. *
  12022. * _.isInteger('3');
  12023. * // => false
  12024. */
  12025. function isInteger(value) {
  12026. return typeof value == 'number' && value == toInteger(value);
  12027. }
  12028. /**
  12029. * Checks if `value` is a valid array-like length.
  12030. *
  12031. * **Note:** This method is loosely based on
  12032. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12033. *
  12034. * @static
  12035. * @memberOf _
  12036. * @since 4.0.0
  12037. * @category Lang
  12038. * @param {*} value The value to check.
  12039. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12040. * @example
  12041. *
  12042. * _.isLength(3);
  12043. * // => true
  12044. *
  12045. * _.isLength(Number.MIN_VALUE);
  12046. * // => false
  12047. *
  12048. * _.isLength(Infinity);
  12049. * // => false
  12050. *
  12051. * _.isLength('3');
  12052. * // => false
  12053. */
  12054. function isLength(value) {
  12055. return typeof value == 'number' &&
  12056. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12057. }
  12058. /**
  12059. * Checks if `value` is the
  12060. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12061. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12062. *
  12063. * @static
  12064. * @memberOf _
  12065. * @since 0.1.0
  12066. * @category Lang
  12067. * @param {*} value The value to check.
  12068. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12069. * @example
  12070. *
  12071. * _.isObject({});
  12072. * // => true
  12073. *
  12074. * _.isObject([1, 2, 3]);
  12075. * // => true
  12076. *
  12077. * _.isObject(_.noop);
  12078. * // => true
  12079. *
  12080. * _.isObject(null);
  12081. * // => false
  12082. */
  12083. function isObject(value) {
  12084. var type = typeof value;
  12085. return value != null && (type == 'object' || type == 'function');
  12086. }
  12087. /**
  12088. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12089. * and has a `typeof` result of "object".
  12090. *
  12091. * @static
  12092. * @memberOf _
  12093. * @since 4.0.0
  12094. * @category Lang
  12095. * @param {*} value The value to check.
  12096. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12097. * @example
  12098. *
  12099. * _.isObjectLike({});
  12100. * // => true
  12101. *
  12102. * _.isObjectLike([1, 2, 3]);
  12103. * // => true
  12104. *
  12105. * _.isObjectLike(_.noop);
  12106. * // => false
  12107. *
  12108. * _.isObjectLike(null);
  12109. * // => false
  12110. */
  12111. function isObjectLike(value) {
  12112. return value != null && typeof value == 'object';
  12113. }
  12114. /**
  12115. * Checks if `value` is classified as a `Map` object.
  12116. *
  12117. * @static
  12118. * @memberOf _
  12119. * @since 4.3.0
  12120. * @category Lang
  12121. * @param {*} value The value to check.
  12122. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12123. * @example
  12124. *
  12125. * _.isMap(new Map);
  12126. * // => true
  12127. *
  12128. * _.isMap(new WeakMap);
  12129. * // => false
  12130. */
  12131. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12132. /**
  12133. * Performs a partial deep comparison between `object` and `source` to
  12134. * determine if `object` contains equivalent property values.
  12135. *
  12136. * **Note:** This method is equivalent to `_.matches` when `source` is
  12137. * partially applied.
  12138. *
  12139. * Partial comparisons will match empty array and empty object `source`
  12140. * values against any array or object value, respectively. See `_.isEqual`
  12141. * for a list of supported value comparisons.
  12142. *
  12143. * @static
  12144. * @memberOf _
  12145. * @since 3.0.0
  12146. * @category Lang
  12147. * @param {Object} object The object to inspect.
  12148. * @param {Object} source The object of property values to match.
  12149. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12150. * @example
  12151. *
  12152. * var object = { 'a': 1, 'b': 2 };
  12153. *
  12154. * _.isMatch(object, { 'b': 2 });
  12155. * // => true
  12156. *
  12157. * _.isMatch(object, { 'b': 1 });
  12158. * // => false
  12159. */
  12160. function isMatch(object, source) {
  12161. return object === source || baseIsMatch(object, source, getMatchData(source));
  12162. }
  12163. /**
  12164. * This method is like `_.isMatch` except that it accepts `customizer` which
  12165. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12166. * are handled by the method instead. The `customizer` is invoked with five
  12167. * arguments: (objValue, srcValue, index|key, object, source).
  12168. *
  12169. * @static
  12170. * @memberOf _
  12171. * @since 4.0.0
  12172. * @category Lang
  12173. * @param {Object} object The object to inspect.
  12174. * @param {Object} source The object of property values to match.
  12175. * @param {Function} [customizer] The function to customize comparisons.
  12176. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12177. * @example
  12178. *
  12179. * function isGreeting(value) {
  12180. * return /^h(?:i|ello)$/.test(value);
  12181. * }
  12182. *
  12183. * function customizer(objValue, srcValue) {
  12184. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12185. * return true;
  12186. * }
  12187. * }
  12188. *
  12189. * var object = { 'greeting': 'hello' };
  12190. * var source = { 'greeting': 'hi' };
  12191. *
  12192. * _.isMatchWith(object, source, customizer);
  12193. * // => true
  12194. */
  12195. function isMatchWith(object, source, customizer) {
  12196. customizer = typeof customizer == 'function' ? customizer : undefined;
  12197. return baseIsMatch(object, source, getMatchData(source), customizer);
  12198. }
  12199. /**
  12200. * Checks if `value` is `NaN`.
  12201. *
  12202. * **Note:** This method is based on
  12203. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12204. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12205. * `undefined` and other non-number values.
  12206. *
  12207. * @static
  12208. * @memberOf _
  12209. * @since 0.1.0
  12210. * @category Lang
  12211. * @param {*} value The value to check.
  12212. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12213. * @example
  12214. *
  12215. * _.isNaN(NaN);
  12216. * // => true
  12217. *
  12218. * _.isNaN(new Number(NaN));
  12219. * // => true
  12220. *
  12221. * isNaN(undefined);
  12222. * // => true
  12223. *
  12224. * _.isNaN(undefined);
  12225. * // => false
  12226. */
  12227. function isNaN(value) {
  12228. // An `NaN` primitive is the only value that is not equal to itself.
  12229. // Perform the `toStringTag` check first to avoid errors with some
  12230. // ActiveX objects in IE.
  12231. return isNumber(value) && value != +value;
  12232. }
  12233. /**
  12234. * Checks if `value` is a pristine native function.
  12235. *
  12236. * **Note:** This method can't reliably detect native functions in the presence
  12237. * of the core-js package because core-js circumvents this kind of detection.
  12238. * Despite multiple requests, the core-js maintainer has made it clear: any
  12239. * attempt to fix the detection will be obstructed. As a result, we're left
  12240. * with little choice but to throw an error. Unfortunately, this also affects
  12241. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12242. * which rely on core-js.
  12243. *
  12244. * @static
  12245. * @memberOf _
  12246. * @since 3.0.0
  12247. * @category Lang
  12248. * @param {*} value The value to check.
  12249. * @returns {boolean} Returns `true` if `value` is a native function,
  12250. * else `false`.
  12251. * @example
  12252. *
  12253. * _.isNative(Array.prototype.push);
  12254. * // => true
  12255. *
  12256. * _.isNative(_);
  12257. * // => false
  12258. */
  12259. function isNative(value) {
  12260. if (isMaskable(value)) {
  12261. throw new Error(CORE_ERROR_TEXT);
  12262. }
  12263. return baseIsNative(value);
  12264. }
  12265. /**
  12266. * Checks if `value` is `null`.
  12267. *
  12268. * @static
  12269. * @memberOf _
  12270. * @since 0.1.0
  12271. * @category Lang
  12272. * @param {*} value The value to check.
  12273. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12274. * @example
  12275. *
  12276. * _.isNull(null);
  12277. * // => true
  12278. *
  12279. * _.isNull(void 0);
  12280. * // => false
  12281. */
  12282. function isNull(value) {
  12283. return value === null;
  12284. }
  12285. /**
  12286. * Checks if `value` is `null` or `undefined`.
  12287. *
  12288. * @static
  12289. * @memberOf _
  12290. * @since 4.0.0
  12291. * @category Lang
  12292. * @param {*} value The value to check.
  12293. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12294. * @example
  12295. *
  12296. * _.isNil(null);
  12297. * // => true
  12298. *
  12299. * _.isNil(void 0);
  12300. * // => true
  12301. *
  12302. * _.isNil(NaN);
  12303. * // => false
  12304. */
  12305. function isNil(value) {
  12306. return value == null;
  12307. }
  12308. /**
  12309. * Checks if `value` is classified as a `Number` primitive or object.
  12310. *
  12311. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12312. * classified as numbers, use the `_.isFinite` method.
  12313. *
  12314. * @static
  12315. * @memberOf _
  12316. * @since 0.1.0
  12317. * @category Lang
  12318. * @param {*} value The value to check.
  12319. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12320. * @example
  12321. *
  12322. * _.isNumber(3);
  12323. * // => true
  12324. *
  12325. * _.isNumber(Number.MIN_VALUE);
  12326. * // => true
  12327. *
  12328. * _.isNumber(Infinity);
  12329. * // => true
  12330. *
  12331. * _.isNumber('3');
  12332. * // => false
  12333. */
  12334. function isNumber(value) {
  12335. return typeof value == 'number' ||
  12336. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12337. }
  12338. /**
  12339. * Checks if `value` is a plain object, that is, an object created by the
  12340. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12341. *
  12342. * @static
  12343. * @memberOf _
  12344. * @since 0.8.0
  12345. * @category Lang
  12346. * @param {*} value The value to check.
  12347. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12348. * @example
  12349. *
  12350. * function Foo() {
  12351. * this.a = 1;
  12352. * }
  12353. *
  12354. * _.isPlainObject(new Foo);
  12355. * // => false
  12356. *
  12357. * _.isPlainObject([1, 2, 3]);
  12358. * // => false
  12359. *
  12360. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12361. * // => true
  12362. *
  12363. * _.isPlainObject(Object.create(null));
  12364. * // => true
  12365. */
  12366. function isPlainObject(value) {
  12367. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12368. return false;
  12369. }
  12370. var proto = getPrototype(value);
  12371. if (proto === null) {
  12372. return true;
  12373. }
  12374. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12375. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12376. funcToString.call(Ctor) == objectCtorString;
  12377. }
  12378. /**
  12379. * Checks if `value` is classified as a `RegExp` object.
  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 a regexp, else `false`.
  12387. * @example
  12388. *
  12389. * _.isRegExp(/abc/);
  12390. * // => true
  12391. *
  12392. * _.isRegExp('/abc/');
  12393. * // => false
  12394. */
  12395. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12396. /**
  12397. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12398. * double precision number which isn't the result of a rounded unsafe integer.
  12399. *
  12400. * **Note:** This method is based on
  12401. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12402. *
  12403. * @static
  12404. * @memberOf _
  12405. * @since 4.0.0
  12406. * @category Lang
  12407. * @param {*} value The value to check.
  12408. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12409. * @example
  12410. *
  12411. * _.isSafeInteger(3);
  12412. * // => true
  12413. *
  12414. * _.isSafeInteger(Number.MIN_VALUE);
  12415. * // => false
  12416. *
  12417. * _.isSafeInteger(Infinity);
  12418. * // => false
  12419. *
  12420. * _.isSafeInteger('3');
  12421. * // => false
  12422. */
  12423. function isSafeInteger(value) {
  12424. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12425. }
  12426. /**
  12427. * Checks if `value` is classified as a `Set` object.
  12428. *
  12429. * @static
  12430. * @memberOf _
  12431. * @since 4.3.0
  12432. * @category Lang
  12433. * @param {*} value The value to check.
  12434. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12435. * @example
  12436. *
  12437. * _.isSet(new Set);
  12438. * // => true
  12439. *
  12440. * _.isSet(new WeakSet);
  12441. * // => false
  12442. */
  12443. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12444. /**
  12445. * Checks if `value` is classified as a `String` primitive or object.
  12446. *
  12447. * @static
  12448. * @since 0.1.0
  12449. * @memberOf _
  12450. * @category Lang
  12451. * @param {*} value The value to check.
  12452. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12453. * @example
  12454. *
  12455. * _.isString('abc');
  12456. * // => true
  12457. *
  12458. * _.isString(1);
  12459. * // => false
  12460. */
  12461. function isString(value) {
  12462. return typeof value == 'string' ||
  12463. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12464. }
  12465. /**
  12466. * Checks if `value` is classified as a `Symbol` primitive or object.
  12467. *
  12468. * @static
  12469. * @memberOf _
  12470. * @since 4.0.0
  12471. * @category Lang
  12472. * @param {*} value The value to check.
  12473. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12474. * @example
  12475. *
  12476. * _.isSymbol(Symbol.iterator);
  12477. * // => true
  12478. *
  12479. * _.isSymbol('abc');
  12480. * // => false
  12481. */
  12482. function isSymbol(value) {
  12483. return typeof value == 'symbol' ||
  12484. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12485. }
  12486. /**
  12487. * Checks if `value` is classified as a typed array.
  12488. *
  12489. * @static
  12490. * @memberOf _
  12491. * @since 3.0.0
  12492. * @category Lang
  12493. * @param {*} value The value to check.
  12494. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12495. * @example
  12496. *
  12497. * _.isTypedArray(new Uint8Array);
  12498. * // => true
  12499. *
  12500. * _.isTypedArray([]);
  12501. * // => false
  12502. */
  12503. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12504. /**
  12505. * Checks if `value` is `undefined`.
  12506. *
  12507. * @static
  12508. * @since 0.1.0
  12509. * @memberOf _
  12510. * @category Lang
  12511. * @param {*} value The value to check.
  12512. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12513. * @example
  12514. *
  12515. * _.isUndefined(void 0);
  12516. * // => true
  12517. *
  12518. * _.isUndefined(null);
  12519. * // => false
  12520. */
  12521. function isUndefined(value) {
  12522. return value === undefined;
  12523. }
  12524. /**
  12525. * Checks if `value` is classified as a `WeakMap` object.
  12526. *
  12527. * @static
  12528. * @memberOf _
  12529. * @since 4.3.0
  12530. * @category Lang
  12531. * @param {*} value The value to check.
  12532. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12533. * @example
  12534. *
  12535. * _.isWeakMap(new WeakMap);
  12536. * // => true
  12537. *
  12538. * _.isWeakMap(new Map);
  12539. * // => false
  12540. */
  12541. function isWeakMap(value) {
  12542. return isObjectLike(value) && getTag(value) == weakMapTag;
  12543. }
  12544. /**
  12545. * Checks if `value` is classified as a `WeakSet` object.
  12546. *
  12547. * @static
  12548. * @memberOf _
  12549. * @since 4.3.0
  12550. * @category Lang
  12551. * @param {*} value The value to check.
  12552. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12553. * @example
  12554. *
  12555. * _.isWeakSet(new WeakSet);
  12556. * // => true
  12557. *
  12558. * _.isWeakSet(new Set);
  12559. * // => false
  12560. */
  12561. function isWeakSet(value) {
  12562. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12563. }
  12564. /**
  12565. * Checks if `value` is less than `other`.
  12566. *
  12567. * @static
  12568. * @memberOf _
  12569. * @since 3.9.0
  12570. * @category Lang
  12571. * @param {*} value The value to compare.
  12572. * @param {*} other The other value to compare.
  12573. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12574. * else `false`.
  12575. * @see _.gt
  12576. * @example
  12577. *
  12578. * _.lt(1, 3);
  12579. * // => true
  12580. *
  12581. * _.lt(3, 3);
  12582. * // => false
  12583. *
  12584. * _.lt(3, 1);
  12585. * // => false
  12586. */
  12587. var lt = createRelationalOperation(baseLt);
  12588. /**
  12589. * Checks if `value` is less than or equal to `other`.
  12590. *
  12591. * @static
  12592. * @memberOf _
  12593. * @since 3.9.0
  12594. * @category Lang
  12595. * @param {*} value The value to compare.
  12596. * @param {*} other The other value to compare.
  12597. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12598. * `other`, else `false`.
  12599. * @see _.gte
  12600. * @example
  12601. *
  12602. * _.lte(1, 3);
  12603. * // => true
  12604. *
  12605. * _.lte(3, 3);
  12606. * // => true
  12607. *
  12608. * _.lte(3, 1);
  12609. * // => false
  12610. */
  12611. var lte = createRelationalOperation(function(value, other) {
  12612. return value <= other;
  12613. });
  12614. /**
  12615. * Converts `value` to an array.
  12616. *
  12617. * @static
  12618. * @since 0.1.0
  12619. * @memberOf _
  12620. * @category Lang
  12621. * @param {*} value The value to convert.
  12622. * @returns {Array} Returns the converted array.
  12623. * @example
  12624. *
  12625. * _.toArray({ 'a': 1, 'b': 2 });
  12626. * // => [1, 2]
  12627. *
  12628. * _.toArray('abc');
  12629. * // => ['a', 'b', 'c']
  12630. *
  12631. * _.toArray(1);
  12632. * // => []
  12633. *
  12634. * _.toArray(null);
  12635. * // => []
  12636. */
  12637. function toArray(value) {
  12638. if (!value) {
  12639. return [];
  12640. }
  12641. if (isArrayLike(value)) {
  12642. return isString(value) ? stringToArray(value) : copyArray(value);
  12643. }
  12644. if (symIterator && value[symIterator]) {
  12645. return iteratorToArray(value[symIterator]());
  12646. }
  12647. var tag = getTag(value),
  12648. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12649. return func(value);
  12650. }
  12651. /**
  12652. * Converts `value` to a finite number.
  12653. *
  12654. * @static
  12655. * @memberOf _
  12656. * @since 4.12.0
  12657. * @category Lang
  12658. * @param {*} value The value to convert.
  12659. * @returns {number} Returns the converted number.
  12660. * @example
  12661. *
  12662. * _.toFinite(3.2);
  12663. * // => 3.2
  12664. *
  12665. * _.toFinite(Number.MIN_VALUE);
  12666. * // => 5e-324
  12667. *
  12668. * _.toFinite(Infinity);
  12669. * // => 1.7976931348623157e+308
  12670. *
  12671. * _.toFinite('3.2');
  12672. * // => 3.2
  12673. */
  12674. function toFinite(value) {
  12675. if (!value) {
  12676. return value === 0 ? value : 0;
  12677. }
  12678. value = toNumber(value);
  12679. if (value === INFINITY || value === -INFINITY) {
  12680. var sign = (value < 0 ? -1 : 1);
  12681. return sign * MAX_INTEGER;
  12682. }
  12683. return value === value ? value : 0;
  12684. }
  12685. /**
  12686. * Converts `value` to an integer.
  12687. *
  12688. * **Note:** This method is loosely based on
  12689. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12690. *
  12691. * @static
  12692. * @memberOf _
  12693. * @since 4.0.0
  12694. * @category Lang
  12695. * @param {*} value The value to convert.
  12696. * @returns {number} Returns the converted integer.
  12697. * @example
  12698. *
  12699. * _.toInteger(3.2);
  12700. * // => 3
  12701. *
  12702. * _.toInteger(Number.MIN_VALUE);
  12703. * // => 0
  12704. *
  12705. * _.toInteger(Infinity);
  12706. * // => 1.7976931348623157e+308
  12707. *
  12708. * _.toInteger('3.2');
  12709. * // => 3
  12710. */
  12711. function toInteger(value) {
  12712. var result = toFinite(value),
  12713. remainder = result % 1;
  12714. return result === result ? (remainder ? result - remainder : result) : 0;
  12715. }
  12716. /**
  12717. * Converts `value` to an integer suitable for use as the length of an
  12718. * array-like object.
  12719. *
  12720. * **Note:** This method is based on
  12721. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12722. *
  12723. * @static
  12724. * @memberOf _
  12725. * @since 4.0.0
  12726. * @category Lang
  12727. * @param {*} value The value to convert.
  12728. * @returns {number} Returns the converted integer.
  12729. * @example
  12730. *
  12731. * _.toLength(3.2);
  12732. * // => 3
  12733. *
  12734. * _.toLength(Number.MIN_VALUE);
  12735. * // => 0
  12736. *
  12737. * _.toLength(Infinity);
  12738. * // => 4294967295
  12739. *
  12740. * _.toLength('3.2');
  12741. * // => 3
  12742. */
  12743. function toLength(value) {
  12744. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12745. }
  12746. /**
  12747. * Converts `value` to a number.
  12748. *
  12749. * @static
  12750. * @memberOf _
  12751. * @since 4.0.0
  12752. * @category Lang
  12753. * @param {*} value The value to process.
  12754. * @returns {number} Returns the number.
  12755. * @example
  12756. *
  12757. * _.toNumber(3.2);
  12758. * // => 3.2
  12759. *
  12760. * _.toNumber(Number.MIN_VALUE);
  12761. * // => 5e-324
  12762. *
  12763. * _.toNumber(Infinity);
  12764. * // => Infinity
  12765. *
  12766. * _.toNumber('3.2');
  12767. * // => 3.2
  12768. */
  12769. function toNumber(value) {
  12770. if (typeof value == 'number') {
  12771. return value;
  12772. }
  12773. if (isSymbol(value)) {
  12774. return NAN;
  12775. }
  12776. if (isObject(value)) {
  12777. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12778. value = isObject(other) ? (other + '') : other;
  12779. }
  12780. if (typeof value != 'string') {
  12781. return value === 0 ? value : +value;
  12782. }
  12783. value = baseTrim(value);
  12784. var isBinary = reIsBinary.test(value);
  12785. return (isBinary || reIsOctal.test(value))
  12786. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12787. : (reIsBadHex.test(value) ? NAN : +value);
  12788. }
  12789. /**
  12790. * Converts `value` to a plain object flattening inherited enumerable string
  12791. * keyed properties of `value` to own properties of the plain object.
  12792. *
  12793. * @static
  12794. * @memberOf _
  12795. * @since 3.0.0
  12796. * @category Lang
  12797. * @param {*} value The value to convert.
  12798. * @returns {Object} Returns the converted plain object.
  12799. * @example
  12800. *
  12801. * function Foo() {
  12802. * this.b = 2;
  12803. * }
  12804. *
  12805. * Foo.prototype.c = 3;
  12806. *
  12807. * _.assign({ 'a': 1 }, new Foo);
  12808. * // => { 'a': 1, 'b': 2 }
  12809. *
  12810. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12811. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12812. */
  12813. function toPlainObject(value) {
  12814. return copyObject(value, keysIn(value));
  12815. }
  12816. /**
  12817. * Converts `value` to a safe integer. A safe integer can be compared and
  12818. * represented correctly.
  12819. *
  12820. * @static
  12821. * @memberOf _
  12822. * @since 4.0.0
  12823. * @category Lang
  12824. * @param {*} value The value to convert.
  12825. * @returns {number} Returns the converted integer.
  12826. * @example
  12827. *
  12828. * _.toSafeInteger(3.2);
  12829. * // => 3
  12830. *
  12831. * _.toSafeInteger(Number.MIN_VALUE);
  12832. * // => 0
  12833. *
  12834. * _.toSafeInteger(Infinity);
  12835. * // => 9007199254740991
  12836. *
  12837. * _.toSafeInteger('3.2');
  12838. * // => 3
  12839. */
  12840. function toSafeInteger(value) {
  12841. return value
  12842. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12843. : (value === 0 ? value : 0);
  12844. }
  12845. /**
  12846. * Converts `value` to a string. An empty string is returned for `null`
  12847. * and `undefined` values. The sign of `-0` is preserved.
  12848. *
  12849. * @static
  12850. * @memberOf _
  12851. * @since 4.0.0
  12852. * @category Lang
  12853. * @param {*} value The value to convert.
  12854. * @returns {string} Returns the converted string.
  12855. * @example
  12856. *
  12857. * _.toString(null);
  12858. * // => ''
  12859. *
  12860. * _.toString(-0);
  12861. * // => '-0'
  12862. *
  12863. * _.toString([1, 2, 3]);
  12864. * // => '1,2,3'
  12865. */
  12866. function toString(value) {
  12867. return value == null ? '' : baseToString(value);
  12868. }
  12869. /*------------------------------------------------------------------------*/
  12870. /**
  12871. * Assigns own enumerable string keyed properties of source objects to the
  12872. * destination object. Source objects are applied from left to right.
  12873. * Subsequent sources overwrite property assignments of previous sources.
  12874. *
  12875. * **Note:** This method mutates `object` and is loosely based on
  12876. * [`Object.assign`](https://mdn.io/Object/assign).
  12877. *
  12878. * @static
  12879. * @memberOf _
  12880. * @since 0.10.0
  12881. * @category Object
  12882. * @param {Object} object The destination object.
  12883. * @param {...Object} [sources] The source objects.
  12884. * @returns {Object} Returns `object`.
  12885. * @see _.assignIn
  12886. * @example
  12887. *
  12888. * function Foo() {
  12889. * this.a = 1;
  12890. * }
  12891. *
  12892. * function Bar() {
  12893. * this.c = 3;
  12894. * }
  12895. *
  12896. * Foo.prototype.b = 2;
  12897. * Bar.prototype.d = 4;
  12898. *
  12899. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12900. * // => { 'a': 1, 'c': 3 }
  12901. */
  12902. var assign = createAssigner(function(object, source) {
  12903. if (isPrototype(source) || isArrayLike(source)) {
  12904. copyObject(source, keys(source), object);
  12905. return;
  12906. }
  12907. for (var key in source) {
  12908. if (hasOwnProperty.call(source, key)) {
  12909. assignValue(object, key, source[key]);
  12910. }
  12911. }
  12912. });
  12913. /**
  12914. * This method is like `_.assign` except that it iterates over own and
  12915. * inherited source properties.
  12916. *
  12917. * **Note:** This method mutates `object`.
  12918. *
  12919. * @static
  12920. * @memberOf _
  12921. * @since 4.0.0
  12922. * @alias extend
  12923. * @category Object
  12924. * @param {Object} object The destination object.
  12925. * @param {...Object} [sources] The source objects.
  12926. * @returns {Object} Returns `object`.
  12927. * @see _.assign
  12928. * @example
  12929. *
  12930. * function Foo() {
  12931. * this.a = 1;
  12932. * }
  12933. *
  12934. * function Bar() {
  12935. * this.c = 3;
  12936. * }
  12937. *
  12938. * Foo.prototype.b = 2;
  12939. * Bar.prototype.d = 4;
  12940. *
  12941. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12942. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12943. */
  12944. var assignIn = createAssigner(function(object, source) {
  12945. copyObject(source, keysIn(source), object);
  12946. });
  12947. /**
  12948. * This method is like `_.assignIn` except that it accepts `customizer`
  12949. * which is invoked to produce the assigned values. If `customizer` returns
  12950. * `undefined`, assignment is handled by the method instead. The `customizer`
  12951. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12952. *
  12953. * **Note:** This method mutates `object`.
  12954. *
  12955. * @static
  12956. * @memberOf _
  12957. * @since 4.0.0
  12958. * @alias extendWith
  12959. * @category Object
  12960. * @param {Object} object The destination object.
  12961. * @param {...Object} sources The source objects.
  12962. * @param {Function} [customizer] The function to customize assigned values.
  12963. * @returns {Object} Returns `object`.
  12964. * @see _.assignWith
  12965. * @example
  12966. *
  12967. * function customizer(objValue, srcValue) {
  12968. * return _.isUndefined(objValue) ? srcValue : objValue;
  12969. * }
  12970. *
  12971. * var defaults = _.partialRight(_.assignInWith, customizer);
  12972. *
  12973. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12974. * // => { 'a': 1, 'b': 2 }
  12975. */
  12976. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  12977. copyObject(source, keysIn(source), object, customizer);
  12978. });
  12979. /**
  12980. * This method is like `_.assign` except that it accepts `customizer`
  12981. * which is invoked to produce the assigned values. If `customizer` returns
  12982. * `undefined`, assignment is handled by the method instead. The `customizer`
  12983. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12984. *
  12985. * **Note:** This method mutates `object`.
  12986. *
  12987. * @static
  12988. * @memberOf _
  12989. * @since 4.0.0
  12990. * @category Object
  12991. * @param {Object} object The destination object.
  12992. * @param {...Object} sources The source objects.
  12993. * @param {Function} [customizer] The function to customize assigned values.
  12994. * @returns {Object} Returns `object`.
  12995. * @see _.assignInWith
  12996. * @example
  12997. *
  12998. * function customizer(objValue, srcValue) {
  12999. * return _.isUndefined(objValue) ? srcValue : objValue;
  13000. * }
  13001. *
  13002. * var defaults = _.partialRight(_.assignWith, customizer);
  13003. *
  13004. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13005. * // => { 'a': 1, 'b': 2 }
  13006. */
  13007. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13008. copyObject(source, keys(source), object, customizer);
  13009. });
  13010. /**
  13011. * Creates an array of values corresponding to `paths` of `object`.
  13012. *
  13013. * @static
  13014. * @memberOf _
  13015. * @since 1.0.0
  13016. * @category Object
  13017. * @param {Object} object The object to iterate over.
  13018. * @param {...(string|string[])} [paths] The property paths to pick.
  13019. * @returns {Array} Returns the picked values.
  13020. * @example
  13021. *
  13022. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13023. *
  13024. * _.at(object, ['a[0].b.c', 'a[1]']);
  13025. * // => [3, 4]
  13026. */
  13027. var at = flatRest(baseAt);
  13028. /**
  13029. * Creates an object that inherits from the `prototype` object. If a
  13030. * `properties` object is given, its own enumerable string keyed properties
  13031. * are assigned to the created object.
  13032. *
  13033. * @static
  13034. * @memberOf _
  13035. * @since 2.3.0
  13036. * @category Object
  13037. * @param {Object} prototype The object to inherit from.
  13038. * @param {Object} [properties] The properties to assign to the object.
  13039. * @returns {Object} Returns the new object.
  13040. * @example
  13041. *
  13042. * function Shape() {
  13043. * this.x = 0;
  13044. * this.y = 0;
  13045. * }
  13046. *
  13047. * function Circle() {
  13048. * Shape.call(this);
  13049. * }
  13050. *
  13051. * Circle.prototype = _.create(Shape.prototype, {
  13052. * 'constructor': Circle
  13053. * });
  13054. *
  13055. * var circle = new Circle;
  13056. * circle instanceof Circle;
  13057. * // => true
  13058. *
  13059. * circle instanceof Shape;
  13060. * // => true
  13061. */
  13062. function create(prototype, properties) {
  13063. var result = baseCreate(prototype);
  13064. return properties == null ? result : baseAssign(result, properties);
  13065. }
  13066. /**
  13067. * Assigns own and inherited enumerable string keyed properties of source
  13068. * objects to the destination object for all destination properties that
  13069. * resolve to `undefined`. Source objects are applied from left to right.
  13070. * Once a property is set, additional values of the same property are ignored.
  13071. *
  13072. * **Note:** This method mutates `object`.
  13073. *
  13074. * @static
  13075. * @since 0.1.0
  13076. * @memberOf _
  13077. * @category Object
  13078. * @param {Object} object The destination object.
  13079. * @param {...Object} [sources] The source objects.
  13080. * @returns {Object} Returns `object`.
  13081. * @see _.defaultsDeep
  13082. * @example
  13083. *
  13084. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13085. * // => { 'a': 1, 'b': 2 }
  13086. */
  13087. var defaults = baseRest(function(object, sources) {
  13088. object = Object(object);
  13089. var index = -1;
  13090. var length = sources.length;
  13091. var guard = length > 2 ? sources[2] : undefined;
  13092. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13093. length = 1;
  13094. }
  13095. while (++index < length) {
  13096. var source = sources[index];
  13097. var props = keysIn(source);
  13098. var propsIndex = -1;
  13099. var propsLength = props.length;
  13100. while (++propsIndex < propsLength) {
  13101. var key = props[propsIndex];
  13102. var value = object[key];
  13103. if (value === undefined ||
  13104. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13105. object[key] = source[key];
  13106. }
  13107. }
  13108. }
  13109. return object;
  13110. });
  13111. /**
  13112. * This method is like `_.defaults` except that it recursively assigns
  13113. * default properties.
  13114. *
  13115. * **Note:** This method mutates `object`.
  13116. *
  13117. * @static
  13118. * @memberOf _
  13119. * @since 3.10.0
  13120. * @category Object
  13121. * @param {Object} object The destination object.
  13122. * @param {...Object} [sources] The source objects.
  13123. * @returns {Object} Returns `object`.
  13124. * @see _.defaults
  13125. * @example
  13126. *
  13127. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13128. * // => { 'a': { 'b': 2, 'c': 3 } }
  13129. */
  13130. var defaultsDeep = baseRest(function(args) {
  13131. args.push(undefined, customDefaultsMerge);
  13132. return apply(mergeWith, undefined, args);
  13133. });
  13134. /**
  13135. * This method is like `_.find` except that it returns the key of the first
  13136. * element `predicate` returns truthy for instead of the element itself.
  13137. *
  13138. * @static
  13139. * @memberOf _
  13140. * @since 1.1.0
  13141. * @category Object
  13142. * @param {Object} object The object to inspect.
  13143. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13144. * @returns {string|undefined} Returns the key of the matched element,
  13145. * else `undefined`.
  13146. * @example
  13147. *
  13148. * var users = {
  13149. * 'barney': { 'age': 36, 'active': true },
  13150. * 'fred': { 'age': 40, 'active': false },
  13151. * 'pebbles': { 'age': 1, 'active': true }
  13152. * };
  13153. *
  13154. * _.findKey(users, function(o) { return o.age < 40; });
  13155. * // => 'barney' (iteration order is not guaranteed)
  13156. *
  13157. * // The `_.matches` iteratee shorthand.
  13158. * _.findKey(users, { 'age': 1, 'active': true });
  13159. * // => 'pebbles'
  13160. *
  13161. * // The `_.matchesProperty` iteratee shorthand.
  13162. * _.findKey(users, ['active', false]);
  13163. * // => 'fred'
  13164. *
  13165. * // The `_.property` iteratee shorthand.
  13166. * _.findKey(users, 'active');
  13167. * // => 'barney'
  13168. */
  13169. function findKey(object, predicate) {
  13170. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13171. }
  13172. /**
  13173. * This method is like `_.findKey` except that it iterates over elements of
  13174. * a collection in the opposite order.
  13175. *
  13176. * @static
  13177. * @memberOf _
  13178. * @since 2.0.0
  13179. * @category Object
  13180. * @param {Object} object The object to inspect.
  13181. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13182. * @returns {string|undefined} Returns the key of the matched element,
  13183. * else `undefined`.
  13184. * @example
  13185. *
  13186. * var users = {
  13187. * 'barney': { 'age': 36, 'active': true },
  13188. * 'fred': { 'age': 40, 'active': false },
  13189. * 'pebbles': { 'age': 1, 'active': true }
  13190. * };
  13191. *
  13192. * _.findLastKey(users, function(o) { return o.age < 40; });
  13193. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13194. *
  13195. * // The `_.matches` iteratee shorthand.
  13196. * _.findLastKey(users, { 'age': 36, 'active': true });
  13197. * // => 'barney'
  13198. *
  13199. * // The `_.matchesProperty` iteratee shorthand.
  13200. * _.findLastKey(users, ['active', false]);
  13201. * // => 'fred'
  13202. *
  13203. * // The `_.property` iteratee shorthand.
  13204. * _.findLastKey(users, 'active');
  13205. * // => 'pebbles'
  13206. */
  13207. function findLastKey(object, predicate) {
  13208. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13209. }
  13210. /**
  13211. * Iterates over own and inherited enumerable string keyed properties of an
  13212. * object and invokes `iteratee` for each property. The iteratee is invoked
  13213. * with three arguments: (value, key, object). Iteratee functions may exit
  13214. * iteration early by explicitly returning `false`.
  13215. *
  13216. * @static
  13217. * @memberOf _
  13218. * @since 0.3.0
  13219. * @category Object
  13220. * @param {Object} object The object to iterate over.
  13221. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13222. * @returns {Object} Returns `object`.
  13223. * @see _.forInRight
  13224. * @example
  13225. *
  13226. * function Foo() {
  13227. * this.a = 1;
  13228. * this.b = 2;
  13229. * }
  13230. *
  13231. * Foo.prototype.c = 3;
  13232. *
  13233. * _.forIn(new Foo, function(value, key) {
  13234. * console.log(key);
  13235. * });
  13236. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13237. */
  13238. function forIn(object, iteratee) {
  13239. return object == null
  13240. ? object
  13241. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13242. }
  13243. /**
  13244. * This method is like `_.forIn` except that it iterates over properties of
  13245. * `object` in the opposite order.
  13246. *
  13247. * @static
  13248. * @memberOf _
  13249. * @since 2.0.0
  13250. * @category Object
  13251. * @param {Object} object The object to iterate over.
  13252. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13253. * @returns {Object} Returns `object`.
  13254. * @see _.forIn
  13255. * @example
  13256. *
  13257. * function Foo() {
  13258. * this.a = 1;
  13259. * this.b = 2;
  13260. * }
  13261. *
  13262. * Foo.prototype.c = 3;
  13263. *
  13264. * _.forInRight(new Foo, function(value, key) {
  13265. * console.log(key);
  13266. * });
  13267. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13268. */
  13269. function forInRight(object, iteratee) {
  13270. return object == null
  13271. ? object
  13272. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13273. }
  13274. /**
  13275. * Iterates over own enumerable string keyed properties of an object and
  13276. * invokes `iteratee` for each property. The iteratee is invoked with three
  13277. * arguments: (value, key, object). Iteratee functions may exit iteration
  13278. * early by explicitly returning `false`.
  13279. *
  13280. * @static
  13281. * @memberOf _
  13282. * @since 0.3.0
  13283. * @category Object
  13284. * @param {Object} object The object to iterate over.
  13285. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13286. * @returns {Object} Returns `object`.
  13287. * @see _.forOwnRight
  13288. * @example
  13289. *
  13290. * function Foo() {
  13291. * this.a = 1;
  13292. * this.b = 2;
  13293. * }
  13294. *
  13295. * Foo.prototype.c = 3;
  13296. *
  13297. * _.forOwn(new Foo, function(value, key) {
  13298. * console.log(key);
  13299. * });
  13300. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13301. */
  13302. function forOwn(object, iteratee) {
  13303. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13304. }
  13305. /**
  13306. * This method is like `_.forOwn` except that it iterates over properties of
  13307. * `object` in the opposite order.
  13308. *
  13309. * @static
  13310. * @memberOf _
  13311. * @since 2.0.0
  13312. * @category Object
  13313. * @param {Object} object The object to iterate over.
  13314. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13315. * @returns {Object} Returns `object`.
  13316. * @see _.forOwn
  13317. * @example
  13318. *
  13319. * function Foo() {
  13320. * this.a = 1;
  13321. * this.b = 2;
  13322. * }
  13323. *
  13324. * Foo.prototype.c = 3;
  13325. *
  13326. * _.forOwnRight(new Foo, function(value, key) {
  13327. * console.log(key);
  13328. * });
  13329. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13330. */
  13331. function forOwnRight(object, iteratee) {
  13332. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13333. }
  13334. /**
  13335. * Creates an array of function property names from own enumerable properties
  13336. * of `object`.
  13337. *
  13338. * @static
  13339. * @since 0.1.0
  13340. * @memberOf _
  13341. * @category Object
  13342. * @param {Object} object The object to inspect.
  13343. * @returns {Array} Returns the function names.
  13344. * @see _.functionsIn
  13345. * @example
  13346. *
  13347. * function Foo() {
  13348. * this.a = _.constant('a');
  13349. * this.b = _.constant('b');
  13350. * }
  13351. *
  13352. * Foo.prototype.c = _.constant('c');
  13353. *
  13354. * _.functions(new Foo);
  13355. * // => ['a', 'b']
  13356. */
  13357. function functions(object) {
  13358. return object == null ? [] : baseFunctions(object, keys(object));
  13359. }
  13360. /**
  13361. * Creates an array of function property names from own and inherited
  13362. * enumerable properties of `object`.
  13363. *
  13364. * @static
  13365. * @memberOf _
  13366. * @since 4.0.0
  13367. * @category Object
  13368. * @param {Object} object The object to inspect.
  13369. * @returns {Array} Returns the function names.
  13370. * @see _.functions
  13371. * @example
  13372. *
  13373. * function Foo() {
  13374. * this.a = _.constant('a');
  13375. * this.b = _.constant('b');
  13376. * }
  13377. *
  13378. * Foo.prototype.c = _.constant('c');
  13379. *
  13380. * _.functionsIn(new Foo);
  13381. * // => ['a', 'b', 'c']
  13382. */
  13383. function functionsIn(object) {
  13384. return object == null ? [] : baseFunctions(object, keysIn(object));
  13385. }
  13386. /**
  13387. * Gets the value at `path` of `object`. If the resolved value is
  13388. * `undefined`, the `defaultValue` is returned in its place.
  13389. *
  13390. * @static
  13391. * @memberOf _
  13392. * @since 3.7.0
  13393. * @category Object
  13394. * @param {Object} object The object to query.
  13395. * @param {Array|string} path The path of the property to get.
  13396. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13397. * @returns {*} Returns the resolved value.
  13398. * @example
  13399. *
  13400. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13401. *
  13402. * _.get(object, 'a[0].b.c');
  13403. * // => 3
  13404. *
  13405. * _.get(object, ['a', '0', 'b', 'c']);
  13406. * // => 3
  13407. *
  13408. * _.get(object, 'a.b.c', 'default');
  13409. * // => 'default'
  13410. */
  13411. function get(object, path, defaultValue) {
  13412. var result = object == null ? undefined : baseGet(object, path);
  13413. return result === undefined ? defaultValue : result;
  13414. }
  13415. /**
  13416. * Checks if `path` is a direct property of `object`.
  13417. *
  13418. * @static
  13419. * @since 0.1.0
  13420. * @memberOf _
  13421. * @category Object
  13422. * @param {Object} object The object to query.
  13423. * @param {Array|string} path The path to check.
  13424. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13425. * @example
  13426. *
  13427. * var object = { 'a': { 'b': 2 } };
  13428. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13429. *
  13430. * _.has(object, 'a');
  13431. * // => true
  13432. *
  13433. * _.has(object, 'a.b');
  13434. * // => true
  13435. *
  13436. * _.has(object, ['a', 'b']);
  13437. * // => true
  13438. *
  13439. * _.has(other, 'a');
  13440. * // => false
  13441. */
  13442. function has(object, path) {
  13443. return object != null && hasPath(object, path, baseHas);
  13444. }
  13445. /**
  13446. * Checks if `path` is a direct or inherited property of `object`.
  13447. *
  13448. * @static
  13449. * @memberOf _
  13450. * @since 4.0.0
  13451. * @category Object
  13452. * @param {Object} object The object to query.
  13453. * @param {Array|string} path The path to check.
  13454. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13455. * @example
  13456. *
  13457. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13458. *
  13459. * _.hasIn(object, 'a');
  13460. * // => true
  13461. *
  13462. * _.hasIn(object, 'a.b');
  13463. * // => true
  13464. *
  13465. * _.hasIn(object, ['a', 'b']);
  13466. * // => true
  13467. *
  13468. * _.hasIn(object, 'b');
  13469. * // => false
  13470. */
  13471. function hasIn(object, path) {
  13472. return object != null && hasPath(object, path, baseHasIn);
  13473. }
  13474. /**
  13475. * Creates an object composed of the inverted keys and values of `object`.
  13476. * If `object` contains duplicate values, subsequent values overwrite
  13477. * property assignments of previous values.
  13478. *
  13479. * @static
  13480. * @memberOf _
  13481. * @since 0.7.0
  13482. * @category Object
  13483. * @param {Object} object The object to invert.
  13484. * @returns {Object} Returns the new inverted object.
  13485. * @example
  13486. *
  13487. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13488. *
  13489. * _.invert(object);
  13490. * // => { '1': 'c', '2': 'b' }
  13491. */
  13492. var invert = createInverter(function(result, value, key) {
  13493. if (value != null &&
  13494. typeof value.toString != 'function') {
  13495. value = nativeObjectToString.call(value);
  13496. }
  13497. result[value] = key;
  13498. }, constant(identity));
  13499. /**
  13500. * This method is like `_.invert` except that the inverted object is generated
  13501. * from the results of running each element of `object` thru `iteratee`. The
  13502. * corresponding inverted value of each inverted key is an array of keys
  13503. * responsible for generating the inverted value. The iteratee is invoked
  13504. * with one argument: (value).
  13505. *
  13506. * @static
  13507. * @memberOf _
  13508. * @since 4.1.0
  13509. * @category Object
  13510. * @param {Object} object The object to invert.
  13511. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13512. * @returns {Object} Returns the new inverted object.
  13513. * @example
  13514. *
  13515. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13516. *
  13517. * _.invertBy(object);
  13518. * // => { '1': ['a', 'c'], '2': ['b'] }
  13519. *
  13520. * _.invertBy(object, function(value) {
  13521. * return 'group' + value;
  13522. * });
  13523. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13524. */
  13525. var invertBy = createInverter(function(result, value, key) {
  13526. if (value != null &&
  13527. typeof value.toString != 'function') {
  13528. value = nativeObjectToString.call(value);
  13529. }
  13530. if (hasOwnProperty.call(result, value)) {
  13531. result[value].push(key);
  13532. } else {
  13533. result[value] = [key];
  13534. }
  13535. }, getIteratee);
  13536. /**
  13537. * Invokes the method at `path` of `object`.
  13538. *
  13539. * @static
  13540. * @memberOf _
  13541. * @since 4.0.0
  13542. * @category Object
  13543. * @param {Object} object The object to query.
  13544. * @param {Array|string} path The path of the method to invoke.
  13545. * @param {...*} [args] The arguments to invoke the method with.
  13546. * @returns {*} Returns the result of the invoked method.
  13547. * @example
  13548. *
  13549. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13550. *
  13551. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13552. * // => [2, 3]
  13553. */
  13554. var invoke = baseRest(baseInvoke);
  13555. /**
  13556. * Creates an array of the own enumerable property names of `object`.
  13557. *
  13558. * **Note:** Non-object values are coerced to objects. See the
  13559. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13560. * for more details.
  13561. *
  13562. * @static
  13563. * @since 0.1.0
  13564. * @memberOf _
  13565. * @category Object
  13566. * @param {Object} object The object to query.
  13567. * @returns {Array} Returns the array of property names.
  13568. * @example
  13569. *
  13570. * function Foo() {
  13571. * this.a = 1;
  13572. * this.b = 2;
  13573. * }
  13574. *
  13575. * Foo.prototype.c = 3;
  13576. *
  13577. * _.keys(new Foo);
  13578. * // => ['a', 'b'] (iteration order is not guaranteed)
  13579. *
  13580. * _.keys('hi');
  13581. * // => ['0', '1']
  13582. */
  13583. function keys(object) {
  13584. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13585. }
  13586. /**
  13587. * Creates an array of the own and inherited enumerable property names of `object`.
  13588. *
  13589. * **Note:** Non-object values are coerced to objects.
  13590. *
  13591. * @static
  13592. * @memberOf _
  13593. * @since 3.0.0
  13594. * @category Object
  13595. * @param {Object} object The object to query.
  13596. * @returns {Array} Returns the array of property names.
  13597. * @example
  13598. *
  13599. * function Foo() {
  13600. * this.a = 1;
  13601. * this.b = 2;
  13602. * }
  13603. *
  13604. * Foo.prototype.c = 3;
  13605. *
  13606. * _.keysIn(new Foo);
  13607. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13608. */
  13609. function keysIn(object) {
  13610. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13611. }
  13612. /**
  13613. * The opposite of `_.mapValues`; this method creates an object with the
  13614. * same values as `object` and keys generated by running each own enumerable
  13615. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13616. * with three arguments: (value, key, object).
  13617. *
  13618. * @static
  13619. * @memberOf _
  13620. * @since 3.8.0
  13621. * @category Object
  13622. * @param {Object} object The object to iterate over.
  13623. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13624. * @returns {Object} Returns the new mapped object.
  13625. * @see _.mapValues
  13626. * @example
  13627. *
  13628. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13629. * return key + value;
  13630. * });
  13631. * // => { 'a1': 1, 'b2': 2 }
  13632. */
  13633. function mapKeys(object, iteratee) {
  13634. var result = {};
  13635. iteratee = getIteratee(iteratee, 3);
  13636. baseForOwn(object, function(value, key, object) {
  13637. baseAssignValue(result, iteratee(value, key, object), value);
  13638. });
  13639. return result;
  13640. }
  13641. /**
  13642. * Creates an object with the same keys as `object` and values generated
  13643. * by running each own enumerable string keyed property of `object` thru
  13644. * `iteratee`. The iteratee is invoked with three arguments:
  13645. * (value, key, object).
  13646. *
  13647. * @static
  13648. * @memberOf _
  13649. * @since 2.4.0
  13650. * @category Object
  13651. * @param {Object} object The object to iterate over.
  13652. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13653. * @returns {Object} Returns the new mapped object.
  13654. * @see _.mapKeys
  13655. * @example
  13656. *
  13657. * var users = {
  13658. * 'fred': { 'user': 'fred', 'age': 40 },
  13659. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13660. * };
  13661. *
  13662. * _.mapValues(users, function(o) { return o.age; });
  13663. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13664. *
  13665. * // The `_.property` iteratee shorthand.
  13666. * _.mapValues(users, 'age');
  13667. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13668. */
  13669. function mapValues(object, iteratee) {
  13670. var result = {};
  13671. iteratee = getIteratee(iteratee, 3);
  13672. baseForOwn(object, function(value, key, object) {
  13673. baseAssignValue(result, key, iteratee(value, key, object));
  13674. });
  13675. return result;
  13676. }
  13677. /**
  13678. * This method is like `_.assign` except that it recursively merges own and
  13679. * inherited enumerable string keyed properties of source objects into the
  13680. * destination object. Source properties that resolve to `undefined` are
  13681. * skipped if a destination value exists. Array and plain object properties
  13682. * are merged recursively. Other objects and value types are overridden by
  13683. * assignment. Source objects are applied from left to right. Subsequent
  13684. * sources overwrite property assignments of previous sources.
  13685. *
  13686. * **Note:** This method mutates `object`.
  13687. *
  13688. * @static
  13689. * @memberOf _
  13690. * @since 0.5.0
  13691. * @category Object
  13692. * @param {Object} object The destination object.
  13693. * @param {...Object} [sources] The source objects.
  13694. * @returns {Object} Returns `object`.
  13695. * @example
  13696. *
  13697. * var object = {
  13698. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13699. * };
  13700. *
  13701. * var other = {
  13702. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13703. * };
  13704. *
  13705. * _.merge(object, other);
  13706. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13707. */
  13708. var merge = createAssigner(function(object, source, srcIndex) {
  13709. baseMerge(object, source, srcIndex);
  13710. });
  13711. /**
  13712. * This method is like `_.merge` except that it accepts `customizer` which
  13713. * is invoked to produce the merged values of the destination and source
  13714. * properties. If `customizer` returns `undefined`, merging is handled by the
  13715. * method instead. The `customizer` is invoked with six arguments:
  13716. * (objValue, srcValue, key, object, source, stack).
  13717. *
  13718. * **Note:** This method mutates `object`.
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 4.0.0
  13723. * @category Object
  13724. * @param {Object} object The destination object.
  13725. * @param {...Object} sources The source objects.
  13726. * @param {Function} customizer The function to customize assigned values.
  13727. * @returns {Object} Returns `object`.
  13728. * @example
  13729. *
  13730. * function customizer(objValue, srcValue) {
  13731. * if (_.isArray(objValue)) {
  13732. * return objValue.concat(srcValue);
  13733. * }
  13734. * }
  13735. *
  13736. * var object = { 'a': [1], 'b': [2] };
  13737. * var other = { 'a': [3], 'b': [4] };
  13738. *
  13739. * _.mergeWith(object, other, customizer);
  13740. * // => { 'a': [1, 3], 'b': [2, 4] }
  13741. */
  13742. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13743. baseMerge(object, source, srcIndex, customizer);
  13744. });
  13745. /**
  13746. * The opposite of `_.pick`; this method creates an object composed of the
  13747. * own and inherited enumerable property paths of `object` that are not omitted.
  13748. *
  13749. * **Note:** This method is considerably slower than `_.pick`.
  13750. *
  13751. * @static
  13752. * @since 0.1.0
  13753. * @memberOf _
  13754. * @category Object
  13755. * @param {Object} object The source object.
  13756. * @param {...(string|string[])} [paths] The property paths to omit.
  13757. * @returns {Object} Returns the new object.
  13758. * @example
  13759. *
  13760. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13761. *
  13762. * _.omit(object, ['a', 'c']);
  13763. * // => { 'b': '2' }
  13764. */
  13765. var omit = flatRest(function(object, paths) {
  13766. var result = {};
  13767. if (object == null) {
  13768. return result;
  13769. }
  13770. var isDeep = false;
  13771. paths = arrayMap(paths, function(path) {
  13772. path = castPath(path, object);
  13773. isDeep || (isDeep = path.length > 1);
  13774. return path;
  13775. });
  13776. copyObject(object, getAllKeysIn(object), result);
  13777. if (isDeep) {
  13778. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13779. }
  13780. var length = paths.length;
  13781. while (length--) {
  13782. baseUnset(result, paths[length]);
  13783. }
  13784. return result;
  13785. });
  13786. /**
  13787. * The opposite of `_.pickBy`; this method creates an object composed of
  13788. * the own and inherited enumerable string keyed properties of `object` that
  13789. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13790. * arguments: (value, key).
  13791. *
  13792. * @static
  13793. * @memberOf _
  13794. * @since 4.0.0
  13795. * @category Object
  13796. * @param {Object} object The source object.
  13797. * @param {Function} [predicate=_.identity] The function invoked per property.
  13798. * @returns {Object} Returns the new object.
  13799. * @example
  13800. *
  13801. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13802. *
  13803. * _.omitBy(object, _.isNumber);
  13804. * // => { 'b': '2' }
  13805. */
  13806. function omitBy(object, predicate) {
  13807. return pickBy(object, negate(getIteratee(predicate)));
  13808. }
  13809. /**
  13810. * Creates an object composed of the picked `object` properties.
  13811. *
  13812. * @static
  13813. * @since 0.1.0
  13814. * @memberOf _
  13815. * @category Object
  13816. * @param {Object} object The source object.
  13817. * @param {...(string|string[])} [paths] The property paths to pick.
  13818. * @returns {Object} Returns the new object.
  13819. * @example
  13820. *
  13821. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13822. *
  13823. * _.pick(object, ['a', 'c']);
  13824. * // => { 'a': 1, 'c': 3 }
  13825. */
  13826. var pick = flatRest(function(object, paths) {
  13827. return object == null ? {} : basePick(object, paths);
  13828. });
  13829. /**
  13830. * Creates an object composed of the `object` properties `predicate` returns
  13831. * truthy for. The predicate is invoked with two arguments: (value, key).
  13832. *
  13833. * @static
  13834. * @memberOf _
  13835. * @since 4.0.0
  13836. * @category Object
  13837. * @param {Object} object The source object.
  13838. * @param {Function} [predicate=_.identity] The function invoked per property.
  13839. * @returns {Object} Returns the new object.
  13840. * @example
  13841. *
  13842. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13843. *
  13844. * _.pickBy(object, _.isNumber);
  13845. * // => { 'a': 1, 'c': 3 }
  13846. */
  13847. function pickBy(object, predicate) {
  13848. if (object == null) {
  13849. return {};
  13850. }
  13851. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13852. return [prop];
  13853. });
  13854. predicate = getIteratee(predicate);
  13855. return basePickBy(object, props, function(value, path) {
  13856. return predicate(value, path[0]);
  13857. });
  13858. }
  13859. /**
  13860. * This method is like `_.get` except that if the resolved value is a
  13861. * function it's invoked with the `this` binding of its parent object and
  13862. * its result is returned.
  13863. *
  13864. * @static
  13865. * @since 0.1.0
  13866. * @memberOf _
  13867. * @category Object
  13868. * @param {Object} object The object to query.
  13869. * @param {Array|string} path The path of the property to resolve.
  13870. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13871. * @returns {*} Returns the resolved value.
  13872. * @example
  13873. *
  13874. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13875. *
  13876. * _.result(object, 'a[0].b.c1');
  13877. * // => 3
  13878. *
  13879. * _.result(object, 'a[0].b.c2');
  13880. * // => 4
  13881. *
  13882. * _.result(object, 'a[0].b.c3', 'default');
  13883. * // => 'default'
  13884. *
  13885. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13886. * // => 'default'
  13887. */
  13888. function result(object, path, defaultValue) {
  13889. path = castPath(path, object);
  13890. var index = -1,
  13891. length = path.length;
  13892. // Ensure the loop is entered when path is empty.
  13893. if (!length) {
  13894. length = 1;
  13895. object = undefined;
  13896. }
  13897. while (++index < length) {
  13898. var value = object == null ? undefined : object[toKey(path[index])];
  13899. if (value === undefined) {
  13900. index = length;
  13901. value = defaultValue;
  13902. }
  13903. object = isFunction(value) ? value.call(object) : value;
  13904. }
  13905. return object;
  13906. }
  13907. /**
  13908. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13909. * it's created. Arrays are created for missing index properties while objects
  13910. * are created for all other missing properties. Use `_.setWith` to customize
  13911. * `path` creation.
  13912. *
  13913. * **Note:** This method mutates `object`.
  13914. *
  13915. * @static
  13916. * @memberOf _
  13917. * @since 3.7.0
  13918. * @category Object
  13919. * @param {Object} object The object to modify.
  13920. * @param {Array|string} path The path of the property to set.
  13921. * @param {*} value The value to set.
  13922. * @returns {Object} Returns `object`.
  13923. * @example
  13924. *
  13925. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13926. *
  13927. * _.set(object, 'a[0].b.c', 4);
  13928. * console.log(object.a[0].b.c);
  13929. * // => 4
  13930. *
  13931. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13932. * console.log(object.x[0].y.z);
  13933. * // => 5
  13934. */
  13935. function set(object, path, value) {
  13936. return object == null ? object : baseSet(object, path, value);
  13937. }
  13938. /**
  13939. * This method is like `_.set` except that it accepts `customizer` which is
  13940. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13941. * path creation is handled by the method instead. The `customizer` is invoked
  13942. * with three arguments: (nsValue, key, nsObject).
  13943. *
  13944. * **Note:** This method mutates `object`.
  13945. *
  13946. * @static
  13947. * @memberOf _
  13948. * @since 4.0.0
  13949. * @category Object
  13950. * @param {Object} object The object to modify.
  13951. * @param {Array|string} path The path of the property to set.
  13952. * @param {*} value The value to set.
  13953. * @param {Function} [customizer] The function to customize assigned values.
  13954. * @returns {Object} Returns `object`.
  13955. * @example
  13956. *
  13957. * var object = {};
  13958. *
  13959. * _.setWith(object, '[0][1]', 'a', Object);
  13960. * // => { '0': { '1': 'a' } }
  13961. */
  13962. function setWith(object, path, value, customizer) {
  13963. customizer = typeof customizer == 'function' ? customizer : undefined;
  13964. return object == null ? object : baseSet(object, path, value, customizer);
  13965. }
  13966. /**
  13967. * Creates an array of own enumerable string keyed-value pairs for `object`
  13968. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  13969. * entries are returned.
  13970. *
  13971. * @static
  13972. * @memberOf _
  13973. * @since 4.0.0
  13974. * @alias entries
  13975. * @category Object
  13976. * @param {Object} object The object to query.
  13977. * @returns {Array} Returns the key-value pairs.
  13978. * @example
  13979. *
  13980. * function Foo() {
  13981. * this.a = 1;
  13982. * this.b = 2;
  13983. * }
  13984. *
  13985. * Foo.prototype.c = 3;
  13986. *
  13987. * _.toPairs(new Foo);
  13988. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  13989. */
  13990. var toPairs = createToPairs(keys);
  13991. /**
  13992. * Creates an array of own and inherited enumerable string keyed-value pairs
  13993. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  13994. * or set, its entries are returned.
  13995. *
  13996. * @static
  13997. * @memberOf _
  13998. * @since 4.0.0
  13999. * @alias entriesIn
  14000. * @category Object
  14001. * @param {Object} object The object to query.
  14002. * @returns {Array} Returns the key-value pairs.
  14003. * @example
  14004. *
  14005. * function Foo() {
  14006. * this.a = 1;
  14007. * this.b = 2;
  14008. * }
  14009. *
  14010. * Foo.prototype.c = 3;
  14011. *
  14012. * _.toPairsIn(new Foo);
  14013. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14014. */
  14015. var toPairsIn = createToPairs(keysIn);
  14016. /**
  14017. * An alternative to `_.reduce`; this method transforms `object` to a new
  14018. * `accumulator` object which is the result of running each of its own
  14019. * enumerable string keyed properties thru `iteratee`, with each invocation
  14020. * potentially mutating the `accumulator` object. If `accumulator` is not
  14021. * provided, a new object with the same `[[Prototype]]` will be used. The
  14022. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14023. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14024. *
  14025. * @static
  14026. * @memberOf _
  14027. * @since 1.3.0
  14028. * @category Object
  14029. * @param {Object} object The object to iterate over.
  14030. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14031. * @param {*} [accumulator] The custom accumulator value.
  14032. * @returns {*} Returns the accumulated value.
  14033. * @example
  14034. *
  14035. * _.transform([2, 3, 4], function(result, n) {
  14036. * result.push(n *= n);
  14037. * return n % 2 == 0;
  14038. * }, []);
  14039. * // => [4, 9]
  14040. *
  14041. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14042. * (result[value] || (result[value] = [])).push(key);
  14043. * }, {});
  14044. * // => { '1': ['a', 'c'], '2': ['b'] }
  14045. */
  14046. function transform(object, iteratee, accumulator) {
  14047. var isArr = isArray(object),
  14048. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14049. iteratee = getIteratee(iteratee, 4);
  14050. if (accumulator == null) {
  14051. var Ctor = object && object.constructor;
  14052. if (isArrLike) {
  14053. accumulator = isArr ? new Ctor : [];
  14054. }
  14055. else if (isObject(object)) {
  14056. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14057. }
  14058. else {
  14059. accumulator = {};
  14060. }
  14061. }
  14062. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14063. return iteratee(accumulator, value, index, object);
  14064. });
  14065. return accumulator;
  14066. }
  14067. /**
  14068. * Removes the property at `path` of `object`.
  14069. *
  14070. * **Note:** This method mutates `object`.
  14071. *
  14072. * @static
  14073. * @memberOf _
  14074. * @since 4.0.0
  14075. * @category Object
  14076. * @param {Object} object The object to modify.
  14077. * @param {Array|string} path The path of the property to unset.
  14078. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14079. * @example
  14080. *
  14081. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14082. * _.unset(object, 'a[0].b.c');
  14083. * // => true
  14084. *
  14085. * console.log(object);
  14086. * // => { 'a': [{ 'b': {} }] };
  14087. *
  14088. * _.unset(object, ['a', '0', 'b', 'c']);
  14089. * // => true
  14090. *
  14091. * console.log(object);
  14092. * // => { 'a': [{ 'b': {} }] };
  14093. */
  14094. function unset(object, path) {
  14095. return object == null ? true : baseUnset(object, path);
  14096. }
  14097. /**
  14098. * This method is like `_.set` except that accepts `updater` to produce the
  14099. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14100. * is invoked with one argument: (value).
  14101. *
  14102. * **Note:** This method mutates `object`.
  14103. *
  14104. * @static
  14105. * @memberOf _
  14106. * @since 4.6.0
  14107. * @category Object
  14108. * @param {Object} object The object to modify.
  14109. * @param {Array|string} path The path of the property to set.
  14110. * @param {Function} updater The function to produce the updated value.
  14111. * @returns {Object} Returns `object`.
  14112. * @example
  14113. *
  14114. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14115. *
  14116. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14117. * console.log(object.a[0].b.c);
  14118. * // => 9
  14119. *
  14120. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14121. * console.log(object.x[0].y.z);
  14122. * // => 0
  14123. */
  14124. function update(object, path, updater) {
  14125. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14126. }
  14127. /**
  14128. * This method is like `_.update` except that it accepts `customizer` which is
  14129. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14130. * path creation is handled by the method instead. The `customizer` is invoked
  14131. * with three arguments: (nsValue, key, nsObject).
  14132. *
  14133. * **Note:** This method mutates `object`.
  14134. *
  14135. * @static
  14136. * @memberOf _
  14137. * @since 4.6.0
  14138. * @category Object
  14139. * @param {Object} object The object to modify.
  14140. * @param {Array|string} path The path of the property to set.
  14141. * @param {Function} updater The function to produce the updated value.
  14142. * @param {Function} [customizer] The function to customize assigned values.
  14143. * @returns {Object} Returns `object`.
  14144. * @example
  14145. *
  14146. * var object = {};
  14147. *
  14148. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14149. * // => { '0': { '1': 'a' } }
  14150. */
  14151. function updateWith(object, path, updater, customizer) {
  14152. customizer = typeof customizer == 'function' ? customizer : undefined;
  14153. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14154. }
  14155. /**
  14156. * Creates an array of the own enumerable string keyed property values of `object`.
  14157. *
  14158. * **Note:** Non-object values are coerced to objects.
  14159. *
  14160. * @static
  14161. * @since 0.1.0
  14162. * @memberOf _
  14163. * @category Object
  14164. * @param {Object} object The object to query.
  14165. * @returns {Array} Returns the array of property values.
  14166. * @example
  14167. *
  14168. * function Foo() {
  14169. * this.a = 1;
  14170. * this.b = 2;
  14171. * }
  14172. *
  14173. * Foo.prototype.c = 3;
  14174. *
  14175. * _.values(new Foo);
  14176. * // => [1, 2] (iteration order is not guaranteed)
  14177. *
  14178. * _.values('hi');
  14179. * // => ['h', 'i']
  14180. */
  14181. function values(object) {
  14182. return object == null ? [] : baseValues(object, keys(object));
  14183. }
  14184. /**
  14185. * Creates an array of the own and inherited enumerable string keyed property
  14186. * values of `object`.
  14187. *
  14188. * **Note:** Non-object values are coerced to objects.
  14189. *
  14190. * @static
  14191. * @memberOf _
  14192. * @since 3.0.0
  14193. * @category Object
  14194. * @param {Object} object The object to query.
  14195. * @returns {Array} Returns the array of property values.
  14196. * @example
  14197. *
  14198. * function Foo() {
  14199. * this.a = 1;
  14200. * this.b = 2;
  14201. * }
  14202. *
  14203. * Foo.prototype.c = 3;
  14204. *
  14205. * _.valuesIn(new Foo);
  14206. * // => [1, 2, 3] (iteration order is not guaranteed)
  14207. */
  14208. function valuesIn(object) {
  14209. return object == null ? [] : baseValues(object, keysIn(object));
  14210. }
  14211. /*------------------------------------------------------------------------*/
  14212. /**
  14213. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14214. *
  14215. * @static
  14216. * @memberOf _
  14217. * @since 4.0.0
  14218. * @category Number
  14219. * @param {number} number The number to clamp.
  14220. * @param {number} [lower] The lower bound.
  14221. * @param {number} upper The upper bound.
  14222. * @returns {number} Returns the clamped number.
  14223. * @example
  14224. *
  14225. * _.clamp(-10, -5, 5);
  14226. * // => -5
  14227. *
  14228. * _.clamp(10, -5, 5);
  14229. * // => 5
  14230. */
  14231. function clamp(number, lower, upper) {
  14232. if (upper === undefined) {
  14233. upper = lower;
  14234. lower = undefined;
  14235. }
  14236. if (upper !== undefined) {
  14237. upper = toNumber(upper);
  14238. upper = upper === upper ? upper : 0;
  14239. }
  14240. if (lower !== undefined) {
  14241. lower = toNumber(lower);
  14242. lower = lower === lower ? lower : 0;
  14243. }
  14244. return baseClamp(toNumber(number), lower, upper);
  14245. }
  14246. /**
  14247. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14248. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14249. * If `start` is greater than `end` the params are swapped to support
  14250. * negative ranges.
  14251. *
  14252. * @static
  14253. * @memberOf _
  14254. * @since 3.3.0
  14255. * @category Number
  14256. * @param {number} number The number to check.
  14257. * @param {number} [start=0] The start of the range.
  14258. * @param {number} end The end of the range.
  14259. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14260. * @see _.range, _.rangeRight
  14261. * @example
  14262. *
  14263. * _.inRange(3, 2, 4);
  14264. * // => true
  14265. *
  14266. * _.inRange(4, 8);
  14267. * // => true
  14268. *
  14269. * _.inRange(4, 2);
  14270. * // => false
  14271. *
  14272. * _.inRange(2, 2);
  14273. * // => false
  14274. *
  14275. * _.inRange(1.2, 2);
  14276. * // => true
  14277. *
  14278. * _.inRange(5.2, 4);
  14279. * // => false
  14280. *
  14281. * _.inRange(-3, -2, -6);
  14282. * // => true
  14283. */
  14284. function inRange(number, start, end) {
  14285. start = toFinite(start);
  14286. if (end === undefined) {
  14287. end = start;
  14288. start = 0;
  14289. } else {
  14290. end = toFinite(end);
  14291. }
  14292. number = toNumber(number);
  14293. return baseInRange(number, start, end);
  14294. }
  14295. /**
  14296. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14297. * If only one argument is provided a number between `0` and the given number
  14298. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14299. * floats, a floating-point number is returned instead of an integer.
  14300. *
  14301. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14302. * floating-point values which can produce unexpected results.
  14303. *
  14304. * @static
  14305. * @memberOf _
  14306. * @since 0.7.0
  14307. * @category Number
  14308. * @param {number} [lower=0] The lower bound.
  14309. * @param {number} [upper=1] The upper bound.
  14310. * @param {boolean} [floating] Specify returning a floating-point number.
  14311. * @returns {number} Returns the random number.
  14312. * @example
  14313. *
  14314. * _.random(0, 5);
  14315. * // => an integer between 0 and 5
  14316. *
  14317. * _.random(5);
  14318. * // => also an integer between 0 and 5
  14319. *
  14320. * _.random(5, true);
  14321. * // => a floating-point number between 0 and 5
  14322. *
  14323. * _.random(1.2, 5.2);
  14324. * // => a floating-point number between 1.2 and 5.2
  14325. */
  14326. function random(lower, upper, floating) {
  14327. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14328. upper = floating = undefined;
  14329. }
  14330. if (floating === undefined) {
  14331. if (typeof upper == 'boolean') {
  14332. floating = upper;
  14333. upper = undefined;
  14334. }
  14335. else if (typeof lower == 'boolean') {
  14336. floating = lower;
  14337. lower = undefined;
  14338. }
  14339. }
  14340. if (lower === undefined && upper === undefined) {
  14341. lower = 0;
  14342. upper = 1;
  14343. }
  14344. else {
  14345. lower = toFinite(lower);
  14346. if (upper === undefined) {
  14347. upper = lower;
  14348. lower = 0;
  14349. } else {
  14350. upper = toFinite(upper);
  14351. }
  14352. }
  14353. if (lower > upper) {
  14354. var temp = lower;
  14355. lower = upper;
  14356. upper = temp;
  14357. }
  14358. if (floating || lower % 1 || upper % 1) {
  14359. var rand = nativeRandom();
  14360. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14361. }
  14362. return baseRandom(lower, upper);
  14363. }
  14364. /*------------------------------------------------------------------------*/
  14365. /**
  14366. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14367. *
  14368. * @static
  14369. * @memberOf _
  14370. * @since 3.0.0
  14371. * @category String
  14372. * @param {string} [string=''] The string to convert.
  14373. * @returns {string} Returns the camel cased string.
  14374. * @example
  14375. *
  14376. * _.camelCase('Foo Bar');
  14377. * // => 'fooBar'
  14378. *
  14379. * _.camelCase('--foo-bar--');
  14380. * // => 'fooBar'
  14381. *
  14382. * _.camelCase('__FOO_BAR__');
  14383. * // => 'fooBar'
  14384. */
  14385. var camelCase = createCompounder(function(result, word, index) {
  14386. word = word.toLowerCase();
  14387. return result + (index ? capitalize(word) : word);
  14388. });
  14389. /**
  14390. * Converts the first character of `string` to upper case and the remaining
  14391. * to lower case.
  14392. *
  14393. * @static
  14394. * @memberOf _
  14395. * @since 3.0.0
  14396. * @category String
  14397. * @param {string} [string=''] The string to capitalize.
  14398. * @returns {string} Returns the capitalized string.
  14399. * @example
  14400. *
  14401. * _.capitalize('FRED');
  14402. * // => 'Fred'
  14403. */
  14404. function capitalize(string) {
  14405. return upperFirst(toString(string).toLowerCase());
  14406. }
  14407. /**
  14408. * Deburrs `string` by converting
  14409. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14410. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14411. * letters to basic Latin letters and removing
  14412. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14413. *
  14414. * @static
  14415. * @memberOf _
  14416. * @since 3.0.0
  14417. * @category String
  14418. * @param {string} [string=''] The string to deburr.
  14419. * @returns {string} Returns the deburred string.
  14420. * @example
  14421. *
  14422. * _.deburr('déjà vu');
  14423. * // => 'deja vu'
  14424. */
  14425. function deburr(string) {
  14426. string = toString(string);
  14427. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14428. }
  14429. /**
  14430. * Checks if `string` ends with the given target string.
  14431. *
  14432. * @static
  14433. * @memberOf _
  14434. * @since 3.0.0
  14435. * @category String
  14436. * @param {string} [string=''] The string to inspect.
  14437. * @param {string} [target] The string to search for.
  14438. * @param {number} [position=string.length] The position to search up to.
  14439. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14440. * else `false`.
  14441. * @example
  14442. *
  14443. * _.endsWith('abc', 'c');
  14444. * // => true
  14445. *
  14446. * _.endsWith('abc', 'b');
  14447. * // => false
  14448. *
  14449. * _.endsWith('abc', 'b', 2);
  14450. * // => true
  14451. */
  14452. function endsWith(string, target, position) {
  14453. string = toString(string);
  14454. target = baseToString(target);
  14455. var length = string.length;
  14456. position = position === undefined
  14457. ? length
  14458. : baseClamp(toInteger(position), 0, length);
  14459. var end = position;
  14460. position -= target.length;
  14461. return position >= 0 && string.slice(position, end) == target;
  14462. }
  14463. /**
  14464. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14465. * corresponding HTML entities.
  14466. *
  14467. * **Note:** No other characters are escaped. To escape additional
  14468. * characters use a third-party library like [_he_](https://mths.be/he).
  14469. *
  14470. * Though the ">" character is escaped for symmetry, characters like
  14471. * ">" and "/" don't need escaping in HTML and have no special meaning
  14472. * unless they're part of a tag or unquoted attribute value. See
  14473. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14474. * (under "semi-related fun fact") for more details.
  14475. *
  14476. * When working with HTML you should always
  14477. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14478. * XSS vectors.
  14479. *
  14480. * @static
  14481. * @since 0.1.0
  14482. * @memberOf _
  14483. * @category String
  14484. * @param {string} [string=''] The string to escape.
  14485. * @returns {string} Returns the escaped string.
  14486. * @example
  14487. *
  14488. * _.escape('fred, barney, & pebbles');
  14489. * // => 'fred, barney, &amp; pebbles'
  14490. */
  14491. function escape(string) {
  14492. string = toString(string);
  14493. return (string && reHasUnescapedHtml.test(string))
  14494. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14495. : string;
  14496. }
  14497. /**
  14498. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14499. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14500. *
  14501. * @static
  14502. * @memberOf _
  14503. * @since 3.0.0
  14504. * @category String
  14505. * @param {string} [string=''] The string to escape.
  14506. * @returns {string} Returns the escaped string.
  14507. * @example
  14508. *
  14509. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14510. * // => '\[lodash\]\(https://lodash\.com/\)'
  14511. */
  14512. function escapeRegExp(string) {
  14513. string = toString(string);
  14514. return (string && reHasRegExpChar.test(string))
  14515. ? string.replace(reRegExpChar, '\\$&')
  14516. : string;
  14517. }
  14518. /**
  14519. * Converts `string` to
  14520. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14521. *
  14522. * @static
  14523. * @memberOf _
  14524. * @since 3.0.0
  14525. * @category String
  14526. * @param {string} [string=''] The string to convert.
  14527. * @returns {string} Returns the kebab cased string.
  14528. * @example
  14529. *
  14530. * _.kebabCase('Foo Bar');
  14531. * // => 'foo-bar'
  14532. *
  14533. * _.kebabCase('fooBar');
  14534. * // => 'foo-bar'
  14535. *
  14536. * _.kebabCase('__FOO_BAR__');
  14537. * // => 'foo-bar'
  14538. */
  14539. var kebabCase = createCompounder(function(result, word, index) {
  14540. return result + (index ? '-' : '') + word.toLowerCase();
  14541. });
  14542. /**
  14543. * Converts `string`, as space separated words, to lower case.
  14544. *
  14545. * @static
  14546. * @memberOf _
  14547. * @since 4.0.0
  14548. * @category String
  14549. * @param {string} [string=''] The string to convert.
  14550. * @returns {string} Returns the lower cased string.
  14551. * @example
  14552. *
  14553. * _.lowerCase('--Foo-Bar--');
  14554. * // => 'foo bar'
  14555. *
  14556. * _.lowerCase('fooBar');
  14557. * // => 'foo bar'
  14558. *
  14559. * _.lowerCase('__FOO_BAR__');
  14560. * // => 'foo bar'
  14561. */
  14562. var lowerCase = createCompounder(function(result, word, index) {
  14563. return result + (index ? ' ' : '') + word.toLowerCase();
  14564. });
  14565. /**
  14566. * Converts the first character of `string` to lower case.
  14567. *
  14568. * @static
  14569. * @memberOf _
  14570. * @since 4.0.0
  14571. * @category String
  14572. * @param {string} [string=''] The string to convert.
  14573. * @returns {string} Returns the converted string.
  14574. * @example
  14575. *
  14576. * _.lowerFirst('Fred');
  14577. * // => 'fred'
  14578. *
  14579. * _.lowerFirst('FRED');
  14580. * // => 'fRED'
  14581. */
  14582. var lowerFirst = createCaseFirst('toLowerCase');
  14583. /**
  14584. * Pads `string` on the left and right sides if it's shorter than `length`.
  14585. * Padding characters are truncated if they can't be evenly divided by `length`.
  14586. *
  14587. * @static
  14588. * @memberOf _
  14589. * @since 3.0.0
  14590. * @category String
  14591. * @param {string} [string=''] The string to pad.
  14592. * @param {number} [length=0] The padding length.
  14593. * @param {string} [chars=' '] The string used as padding.
  14594. * @returns {string} Returns the padded string.
  14595. * @example
  14596. *
  14597. * _.pad('abc', 8);
  14598. * // => ' abc '
  14599. *
  14600. * _.pad('abc', 8, '_-');
  14601. * // => '_-abc_-_'
  14602. *
  14603. * _.pad('abc', 3);
  14604. * // => 'abc'
  14605. */
  14606. function pad(string, length, chars) {
  14607. string = toString(string);
  14608. length = toInteger(length);
  14609. var strLength = length ? stringSize(string) : 0;
  14610. if (!length || strLength >= length) {
  14611. return string;
  14612. }
  14613. var mid = (length - strLength) / 2;
  14614. return (
  14615. createPadding(nativeFloor(mid), chars) +
  14616. string +
  14617. createPadding(nativeCeil(mid), chars)
  14618. );
  14619. }
  14620. /**
  14621. * Pads `string` on the right side if it's shorter than `length`. Padding
  14622. * characters are truncated if they exceed `length`.
  14623. *
  14624. * @static
  14625. * @memberOf _
  14626. * @since 4.0.0
  14627. * @category String
  14628. * @param {string} [string=''] The string to pad.
  14629. * @param {number} [length=0] The padding length.
  14630. * @param {string} [chars=' '] The string used as padding.
  14631. * @returns {string} Returns the padded string.
  14632. * @example
  14633. *
  14634. * _.padEnd('abc', 6);
  14635. * // => 'abc '
  14636. *
  14637. * _.padEnd('abc', 6, '_-');
  14638. * // => 'abc_-_'
  14639. *
  14640. * _.padEnd('abc', 3);
  14641. * // => 'abc'
  14642. */
  14643. function padEnd(string, length, chars) {
  14644. string = toString(string);
  14645. length = toInteger(length);
  14646. var strLength = length ? stringSize(string) : 0;
  14647. return (length && strLength < length)
  14648. ? (string + createPadding(length - strLength, chars))
  14649. : string;
  14650. }
  14651. /**
  14652. * Pads `string` on the left side if it's shorter than `length`. Padding
  14653. * characters are truncated if they exceed `length`.
  14654. *
  14655. * @static
  14656. * @memberOf _
  14657. * @since 4.0.0
  14658. * @category String
  14659. * @param {string} [string=''] The string to pad.
  14660. * @param {number} [length=0] The padding length.
  14661. * @param {string} [chars=' '] The string used as padding.
  14662. * @returns {string} Returns the padded string.
  14663. * @example
  14664. *
  14665. * _.padStart('abc', 6);
  14666. * // => ' abc'
  14667. *
  14668. * _.padStart('abc', 6, '_-');
  14669. * // => '_-_abc'
  14670. *
  14671. * _.padStart('abc', 3);
  14672. * // => 'abc'
  14673. */
  14674. function padStart(string, length, chars) {
  14675. string = toString(string);
  14676. length = toInteger(length);
  14677. var strLength = length ? stringSize(string) : 0;
  14678. return (length && strLength < length)
  14679. ? (createPadding(length - strLength, chars) + string)
  14680. : string;
  14681. }
  14682. /**
  14683. * Converts `string` to an integer of the specified radix. If `radix` is
  14684. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14685. * hexadecimal, in which case a `radix` of `16` is used.
  14686. *
  14687. * **Note:** This method aligns with the
  14688. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14689. *
  14690. * @static
  14691. * @memberOf _
  14692. * @since 1.1.0
  14693. * @category String
  14694. * @param {string} string The string to convert.
  14695. * @param {number} [radix=10] The radix to interpret `value` by.
  14696. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14697. * @returns {number} Returns the converted integer.
  14698. * @example
  14699. *
  14700. * _.parseInt('08');
  14701. * // => 8
  14702. *
  14703. * _.map(['6', '08', '10'], _.parseInt);
  14704. * // => [6, 8, 10]
  14705. */
  14706. function parseInt(string, radix, guard) {
  14707. if (guard || radix == null) {
  14708. radix = 0;
  14709. } else if (radix) {
  14710. radix = +radix;
  14711. }
  14712. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14713. }
  14714. /**
  14715. * Repeats the given string `n` times.
  14716. *
  14717. * @static
  14718. * @memberOf _
  14719. * @since 3.0.0
  14720. * @category String
  14721. * @param {string} [string=''] The string to repeat.
  14722. * @param {number} [n=1] The number of times to repeat the string.
  14723. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14724. * @returns {string} Returns the repeated string.
  14725. * @example
  14726. *
  14727. * _.repeat('*', 3);
  14728. * // => '***'
  14729. *
  14730. * _.repeat('abc', 2);
  14731. * // => 'abcabc'
  14732. *
  14733. * _.repeat('abc', 0);
  14734. * // => ''
  14735. */
  14736. function repeat(string, n, guard) {
  14737. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14738. n = 1;
  14739. } else {
  14740. n = toInteger(n);
  14741. }
  14742. return baseRepeat(toString(string), n);
  14743. }
  14744. /**
  14745. * Replaces matches for `pattern` in `string` with `replacement`.
  14746. *
  14747. * **Note:** This method is based on
  14748. * [`String#replace`](https://mdn.io/String/replace).
  14749. *
  14750. * @static
  14751. * @memberOf _
  14752. * @since 4.0.0
  14753. * @category String
  14754. * @param {string} [string=''] The string to modify.
  14755. * @param {RegExp|string} pattern The pattern to replace.
  14756. * @param {Function|string} replacement The match replacement.
  14757. * @returns {string} Returns the modified string.
  14758. * @example
  14759. *
  14760. * _.replace('Hi Fred', 'Fred', 'Barney');
  14761. * // => 'Hi Barney'
  14762. */
  14763. function replace() {
  14764. var args = arguments,
  14765. string = toString(args[0]);
  14766. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14767. }
  14768. /**
  14769. * Converts `string` to
  14770. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14771. *
  14772. * @static
  14773. * @memberOf _
  14774. * @since 3.0.0
  14775. * @category String
  14776. * @param {string} [string=''] The string to convert.
  14777. * @returns {string} Returns the snake cased string.
  14778. * @example
  14779. *
  14780. * _.snakeCase('Foo Bar');
  14781. * // => 'foo_bar'
  14782. *
  14783. * _.snakeCase('fooBar');
  14784. * // => 'foo_bar'
  14785. *
  14786. * _.snakeCase('--FOO-BAR--');
  14787. * // => 'foo_bar'
  14788. */
  14789. var snakeCase = createCompounder(function(result, word, index) {
  14790. return result + (index ? '_' : '') + word.toLowerCase();
  14791. });
  14792. /**
  14793. * Splits `string` by `separator`.
  14794. *
  14795. * **Note:** This method is based on
  14796. * [`String#split`](https://mdn.io/String/split).
  14797. *
  14798. * @static
  14799. * @memberOf _
  14800. * @since 4.0.0
  14801. * @category String
  14802. * @param {string} [string=''] The string to split.
  14803. * @param {RegExp|string} separator The separator pattern to split by.
  14804. * @param {number} [limit] The length to truncate results to.
  14805. * @returns {Array} Returns the string segments.
  14806. * @example
  14807. *
  14808. * _.split('a-b-c', '-', 2);
  14809. * // => ['a', 'b']
  14810. */
  14811. function split(string, separator, limit) {
  14812. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14813. separator = limit = undefined;
  14814. }
  14815. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14816. if (!limit) {
  14817. return [];
  14818. }
  14819. string = toString(string);
  14820. if (string && (
  14821. typeof separator == 'string' ||
  14822. (separator != null && !isRegExp(separator))
  14823. )) {
  14824. separator = baseToString(separator);
  14825. if (!separator && hasUnicode(string)) {
  14826. return castSlice(stringToArray(string), 0, limit);
  14827. }
  14828. }
  14829. return string.split(separator, limit);
  14830. }
  14831. /**
  14832. * Converts `string` to
  14833. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14834. *
  14835. * @static
  14836. * @memberOf _
  14837. * @since 3.1.0
  14838. * @category String
  14839. * @param {string} [string=''] The string to convert.
  14840. * @returns {string} Returns the start cased string.
  14841. * @example
  14842. *
  14843. * _.startCase('--foo-bar--');
  14844. * // => 'Foo Bar'
  14845. *
  14846. * _.startCase('fooBar');
  14847. * // => 'Foo Bar'
  14848. *
  14849. * _.startCase('__FOO_BAR__');
  14850. * // => 'FOO BAR'
  14851. */
  14852. var startCase = createCompounder(function(result, word, index) {
  14853. return result + (index ? ' ' : '') + upperFirst(word);
  14854. });
  14855. /**
  14856. * Checks if `string` starts with the given target string.
  14857. *
  14858. * @static
  14859. * @memberOf _
  14860. * @since 3.0.0
  14861. * @category String
  14862. * @param {string} [string=''] The string to inspect.
  14863. * @param {string} [target] The string to search for.
  14864. * @param {number} [position=0] The position to search from.
  14865. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14866. * else `false`.
  14867. * @example
  14868. *
  14869. * _.startsWith('abc', 'a');
  14870. * // => true
  14871. *
  14872. * _.startsWith('abc', 'b');
  14873. * // => false
  14874. *
  14875. * _.startsWith('abc', 'b', 1);
  14876. * // => true
  14877. */
  14878. function startsWith(string, target, position) {
  14879. string = toString(string);
  14880. position = position == null
  14881. ? 0
  14882. : baseClamp(toInteger(position), 0, string.length);
  14883. target = baseToString(target);
  14884. return string.slice(position, position + target.length) == target;
  14885. }
  14886. /**
  14887. * Creates a compiled template function that can interpolate data properties
  14888. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14889. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14890. * properties may be accessed as free variables in the template. If a setting
  14891. * object is given, it takes precedence over `_.templateSettings` values.
  14892. *
  14893. * **Note:** In the development build `_.template` utilizes
  14894. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14895. * for easier debugging.
  14896. *
  14897. * For more information on precompiling templates see
  14898. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14899. *
  14900. * For more information on Chrome extension sandboxes see
  14901. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14902. *
  14903. * @static
  14904. * @since 0.1.0
  14905. * @memberOf _
  14906. * @category String
  14907. * @param {string} [string=''] The template string.
  14908. * @param {Object} [options={}] The options object.
  14909. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14910. * The HTML "escape" delimiter.
  14911. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14912. * The "evaluate" delimiter.
  14913. * @param {Object} [options.imports=_.templateSettings.imports]
  14914. * An object to import into the template as free variables.
  14915. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14916. * The "interpolate" delimiter.
  14917. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14918. * The sourceURL of the compiled template.
  14919. * @param {string} [options.variable='obj']
  14920. * The data object variable name.
  14921. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14922. * @returns {Function} Returns the compiled template function.
  14923. * @example
  14924. *
  14925. * // Use the "interpolate" delimiter to create a compiled template.
  14926. * var compiled = _.template('hello <%= user %>!');
  14927. * compiled({ 'user': 'fred' });
  14928. * // => 'hello fred!'
  14929. *
  14930. * // Use the HTML "escape" delimiter to escape data property values.
  14931. * var compiled = _.template('<b><%- value %></b>');
  14932. * compiled({ 'value': '<script>' });
  14933. * // => '<b>&lt;script&gt;</b>'
  14934. *
  14935. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14936. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14937. * compiled({ 'users': ['fred', 'barney'] });
  14938. * // => '<li>fred</li><li>barney</li>'
  14939. *
  14940. * // Use the internal `print` function in "evaluate" delimiters.
  14941. * var compiled = _.template('<% print("hello " + user); %>!');
  14942. * compiled({ 'user': 'barney' });
  14943. * // => 'hello barney!'
  14944. *
  14945. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  14946. * // Disable support by replacing the "interpolate" delimiter.
  14947. * var compiled = _.template('hello ${ user }!');
  14948. * compiled({ 'user': 'pebbles' });
  14949. * // => 'hello pebbles!'
  14950. *
  14951. * // Use backslashes to treat delimiters as plain text.
  14952. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  14953. * compiled({ 'value': 'ignored' });
  14954. * // => '<%- value %>'
  14955. *
  14956. * // Use the `imports` option to import `jQuery` as `jq`.
  14957. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  14958. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  14959. * compiled({ 'users': ['fred', 'barney'] });
  14960. * // => '<li>fred</li><li>barney</li>'
  14961. *
  14962. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  14963. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  14964. * compiled(data);
  14965. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  14966. *
  14967. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  14968. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  14969. * compiled.source;
  14970. * // => function(data) {
  14971. * // var __t, __p = '';
  14972. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  14973. * // return __p;
  14974. * // }
  14975. *
  14976. * // Use custom template delimiters.
  14977. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  14978. * var compiled = _.template('hello {{ user }}!');
  14979. * compiled({ 'user': 'mustache' });
  14980. * // => 'hello mustache!'
  14981. *
  14982. * // Use the `source` property to inline compiled templates for meaningful
  14983. * // line numbers in error messages and stack traces.
  14984. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  14985. * var JST = {\
  14986. * "main": ' + _.template(mainText).source + '\
  14987. * };\
  14988. * ');
  14989. */
  14990. function template(string, options, guard) {
  14991. // Based on John Resig's `tmpl` implementation
  14992. // (http://ejohn.org/blog/javascript-micro-templating/)
  14993. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  14994. var settings = lodash.templateSettings;
  14995. if (guard && isIterateeCall(string, options, guard)) {
  14996. options = undefined;
  14997. }
  14998. string = toString(string);
  14999. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15000. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15001. importsKeys = keys(imports),
  15002. importsValues = baseValues(imports, importsKeys);
  15003. var isEscaping,
  15004. isEvaluating,
  15005. index = 0,
  15006. interpolate = options.interpolate || reNoMatch,
  15007. source = "__p += '";
  15008. // Compile the regexp to match each delimiter.
  15009. var reDelimiters = RegExp(
  15010. (options.escape || reNoMatch).source + '|' +
  15011. interpolate.source + '|' +
  15012. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15013. (options.evaluate || reNoMatch).source + '|$'
  15014. , 'g');
  15015. // Use a sourceURL for easier debugging.
  15016. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15017. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15018. // and escape the comment, thus injecting code that gets evaled.
  15019. var sourceURL = '//# sourceURL=' +
  15020. (hasOwnProperty.call(options, 'sourceURL')
  15021. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15022. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15023. ) + '\n';
  15024. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15025. interpolateValue || (interpolateValue = esTemplateValue);
  15026. // Escape characters that can't be included in string literals.
  15027. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15028. // Replace delimiters with snippets.
  15029. if (escapeValue) {
  15030. isEscaping = true;
  15031. source += "' +\n__e(" + escapeValue + ") +\n'";
  15032. }
  15033. if (evaluateValue) {
  15034. isEvaluating = true;
  15035. source += "';\n" + evaluateValue + ";\n__p += '";
  15036. }
  15037. if (interpolateValue) {
  15038. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15039. }
  15040. index = offset + match.length;
  15041. // The JS engine embedded in Adobe products needs `match` returned in
  15042. // order to produce the correct `offset` value.
  15043. return match;
  15044. });
  15045. source += "';\n";
  15046. // If `variable` is not specified wrap a with-statement around the generated
  15047. // code to add the data object to the top of the scope chain.
  15048. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15049. if (!variable) {
  15050. source = 'with (obj) {\n' + source + '\n}\n';
  15051. }
  15052. // Throw an error if a forbidden character was found in `variable`, to prevent
  15053. // potential command injection attacks.
  15054. else if (reForbiddenIdentifierChars.test(variable)) {
  15055. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15056. }
  15057. // Cleanup code by stripping empty strings.
  15058. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15059. .replace(reEmptyStringMiddle, '$1')
  15060. .replace(reEmptyStringTrailing, '$1;');
  15061. // Frame code as the function body.
  15062. source = 'function(' + (variable || 'obj') + ') {\n' +
  15063. (variable
  15064. ? ''
  15065. : 'obj || (obj = {});\n'
  15066. ) +
  15067. "var __t, __p = ''" +
  15068. (isEscaping
  15069. ? ', __e = _.escape'
  15070. : ''
  15071. ) +
  15072. (isEvaluating
  15073. ? ', __j = Array.prototype.join;\n' +
  15074. "function print() { __p += __j.call(arguments, '') }\n"
  15075. : ';\n'
  15076. ) +
  15077. source +
  15078. 'return __p\n}';
  15079. var result = attempt(function() {
  15080. return Function(importsKeys, sourceURL + 'return ' + source)
  15081. .apply(undefined, importsValues);
  15082. });
  15083. // Provide the compiled function's source by its `toString` method or
  15084. // the `source` property as a convenience for inlining compiled templates.
  15085. result.source = source;
  15086. if (isError(result)) {
  15087. throw result;
  15088. }
  15089. return result;
  15090. }
  15091. /**
  15092. * Converts `string`, as a whole, to lower case just like
  15093. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15094. *
  15095. * @static
  15096. * @memberOf _
  15097. * @since 4.0.0
  15098. * @category String
  15099. * @param {string} [string=''] The string to convert.
  15100. * @returns {string} Returns the lower cased string.
  15101. * @example
  15102. *
  15103. * _.toLower('--Foo-Bar--');
  15104. * // => '--foo-bar--'
  15105. *
  15106. * _.toLower('fooBar');
  15107. * // => 'foobar'
  15108. *
  15109. * _.toLower('__FOO_BAR__');
  15110. * // => '__foo_bar__'
  15111. */
  15112. function toLower(value) {
  15113. return toString(value).toLowerCase();
  15114. }
  15115. /**
  15116. * Converts `string`, as a whole, to upper case just like
  15117. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15118. *
  15119. * @static
  15120. * @memberOf _
  15121. * @since 4.0.0
  15122. * @category String
  15123. * @param {string} [string=''] The string to convert.
  15124. * @returns {string} Returns the upper cased string.
  15125. * @example
  15126. *
  15127. * _.toUpper('--foo-bar--');
  15128. * // => '--FOO-BAR--'
  15129. *
  15130. * _.toUpper('fooBar');
  15131. * // => 'FOOBAR'
  15132. *
  15133. * _.toUpper('__foo_bar__');
  15134. * // => '__FOO_BAR__'
  15135. */
  15136. function toUpper(value) {
  15137. return toString(value).toUpperCase();
  15138. }
  15139. /**
  15140. * Removes leading and trailing whitespace or specified characters from `string`.
  15141. *
  15142. * @static
  15143. * @memberOf _
  15144. * @since 3.0.0
  15145. * @category String
  15146. * @param {string} [string=''] The string to trim.
  15147. * @param {string} [chars=whitespace] The characters to trim.
  15148. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15149. * @returns {string} Returns the trimmed string.
  15150. * @example
  15151. *
  15152. * _.trim(' abc ');
  15153. * // => 'abc'
  15154. *
  15155. * _.trim('-_-abc-_-', '_-');
  15156. * // => 'abc'
  15157. *
  15158. * _.map([' foo ', ' bar '], _.trim);
  15159. * // => ['foo', 'bar']
  15160. */
  15161. function trim(string, chars, guard) {
  15162. string = toString(string);
  15163. if (string && (guard || chars === undefined)) {
  15164. return baseTrim(string);
  15165. }
  15166. if (!string || !(chars = baseToString(chars))) {
  15167. return string;
  15168. }
  15169. var strSymbols = stringToArray(string),
  15170. chrSymbols = stringToArray(chars),
  15171. start = charsStartIndex(strSymbols, chrSymbols),
  15172. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15173. return castSlice(strSymbols, start, end).join('');
  15174. }
  15175. /**
  15176. * Removes trailing whitespace or specified characters from `string`.
  15177. *
  15178. * @static
  15179. * @memberOf _
  15180. * @since 4.0.0
  15181. * @category String
  15182. * @param {string} [string=''] The string to trim.
  15183. * @param {string} [chars=whitespace] The characters to trim.
  15184. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15185. * @returns {string} Returns the trimmed string.
  15186. * @example
  15187. *
  15188. * _.trimEnd(' abc ');
  15189. * // => ' abc'
  15190. *
  15191. * _.trimEnd('-_-abc-_-', '_-');
  15192. * // => '-_-abc'
  15193. */
  15194. function trimEnd(string, chars, guard) {
  15195. string = toString(string);
  15196. if (string && (guard || chars === undefined)) {
  15197. return string.slice(0, trimmedEndIndex(string) + 1);
  15198. }
  15199. if (!string || !(chars = baseToString(chars))) {
  15200. return string;
  15201. }
  15202. var strSymbols = stringToArray(string),
  15203. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15204. return castSlice(strSymbols, 0, end).join('');
  15205. }
  15206. /**
  15207. * Removes leading whitespace or specified characters from `string`.
  15208. *
  15209. * @static
  15210. * @memberOf _
  15211. * @since 4.0.0
  15212. * @category String
  15213. * @param {string} [string=''] The string to trim.
  15214. * @param {string} [chars=whitespace] The characters to trim.
  15215. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15216. * @returns {string} Returns the trimmed string.
  15217. * @example
  15218. *
  15219. * _.trimStart(' abc ');
  15220. * // => 'abc '
  15221. *
  15222. * _.trimStart('-_-abc-_-', '_-');
  15223. * // => 'abc-_-'
  15224. */
  15225. function trimStart(string, chars, guard) {
  15226. string = toString(string);
  15227. if (string && (guard || chars === undefined)) {
  15228. return string.replace(reTrimStart, '');
  15229. }
  15230. if (!string || !(chars = baseToString(chars))) {
  15231. return string;
  15232. }
  15233. var strSymbols = stringToArray(string),
  15234. start = charsStartIndex(strSymbols, stringToArray(chars));
  15235. return castSlice(strSymbols, start).join('');
  15236. }
  15237. /**
  15238. * Truncates `string` if it's longer than the given maximum string length.
  15239. * The last characters of the truncated string are replaced with the omission
  15240. * string which defaults to "...".
  15241. *
  15242. * @static
  15243. * @memberOf _
  15244. * @since 4.0.0
  15245. * @category String
  15246. * @param {string} [string=''] The string to truncate.
  15247. * @param {Object} [options={}] The options object.
  15248. * @param {number} [options.length=30] The maximum string length.
  15249. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15250. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15251. * @returns {string} Returns the truncated string.
  15252. * @example
  15253. *
  15254. * _.truncate('hi-diddly-ho there, neighborino');
  15255. * // => 'hi-diddly-ho there, neighbo...'
  15256. *
  15257. * _.truncate('hi-diddly-ho there, neighborino', {
  15258. * 'length': 24,
  15259. * 'separator': ' '
  15260. * });
  15261. * // => 'hi-diddly-ho there,...'
  15262. *
  15263. * _.truncate('hi-diddly-ho there, neighborino', {
  15264. * 'length': 24,
  15265. * 'separator': /,? +/
  15266. * });
  15267. * // => 'hi-diddly-ho there...'
  15268. *
  15269. * _.truncate('hi-diddly-ho there, neighborino', {
  15270. * 'omission': ' [...]'
  15271. * });
  15272. * // => 'hi-diddly-ho there, neig [...]'
  15273. */
  15274. function truncate(string, options) {
  15275. var length = DEFAULT_TRUNC_LENGTH,
  15276. omission = DEFAULT_TRUNC_OMISSION;
  15277. if (isObject(options)) {
  15278. var separator = 'separator' in options ? options.separator : separator;
  15279. length = 'length' in options ? toInteger(options.length) : length;
  15280. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15281. }
  15282. string = toString(string);
  15283. var strLength = string.length;
  15284. if (hasUnicode(string)) {
  15285. var strSymbols = stringToArray(string);
  15286. strLength = strSymbols.length;
  15287. }
  15288. if (length >= strLength) {
  15289. return string;
  15290. }
  15291. var end = length - stringSize(omission);
  15292. if (end < 1) {
  15293. return omission;
  15294. }
  15295. var result = strSymbols
  15296. ? castSlice(strSymbols, 0, end).join('')
  15297. : string.slice(0, end);
  15298. if (separator === undefined) {
  15299. return result + omission;
  15300. }
  15301. if (strSymbols) {
  15302. end += (result.length - end);
  15303. }
  15304. if (isRegExp(separator)) {
  15305. if (string.slice(end).search(separator)) {
  15306. var match,
  15307. substring = result;
  15308. if (!separator.global) {
  15309. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15310. }
  15311. separator.lastIndex = 0;
  15312. while ((match = separator.exec(substring))) {
  15313. var newEnd = match.index;
  15314. }
  15315. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15316. }
  15317. } else if (string.indexOf(baseToString(separator), end) != end) {
  15318. var index = result.lastIndexOf(separator);
  15319. if (index > -1) {
  15320. result = result.slice(0, index);
  15321. }
  15322. }
  15323. return result + omission;
  15324. }
  15325. /**
  15326. * The inverse of `_.escape`; this method converts the HTML entities
  15327. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15328. * their corresponding characters.
  15329. *
  15330. * **Note:** No other HTML entities are unescaped. To unescape additional
  15331. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15332. *
  15333. * @static
  15334. * @memberOf _
  15335. * @since 0.6.0
  15336. * @category String
  15337. * @param {string} [string=''] The string to unescape.
  15338. * @returns {string} Returns the unescaped string.
  15339. * @example
  15340. *
  15341. * _.unescape('fred, barney, &amp; pebbles');
  15342. * // => 'fred, barney, & pebbles'
  15343. */
  15344. function unescape(string) {
  15345. string = toString(string);
  15346. return (string && reHasEscapedHtml.test(string))
  15347. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15348. : string;
  15349. }
  15350. /**
  15351. * Converts `string`, as space separated words, to upper case.
  15352. *
  15353. * @static
  15354. * @memberOf _
  15355. * @since 4.0.0
  15356. * @category String
  15357. * @param {string} [string=''] The string to convert.
  15358. * @returns {string} Returns the upper cased string.
  15359. * @example
  15360. *
  15361. * _.upperCase('--foo-bar');
  15362. * // => 'FOO BAR'
  15363. *
  15364. * _.upperCase('fooBar');
  15365. * // => 'FOO BAR'
  15366. *
  15367. * _.upperCase('__foo_bar__');
  15368. * // => 'FOO BAR'
  15369. */
  15370. var upperCase = createCompounder(function(result, word, index) {
  15371. return result + (index ? ' ' : '') + word.toUpperCase();
  15372. });
  15373. /**
  15374. * Converts the first character of `string` to upper case.
  15375. *
  15376. * @static
  15377. * @memberOf _
  15378. * @since 4.0.0
  15379. * @category String
  15380. * @param {string} [string=''] The string to convert.
  15381. * @returns {string} Returns the converted string.
  15382. * @example
  15383. *
  15384. * _.upperFirst('fred');
  15385. * // => 'Fred'
  15386. *
  15387. * _.upperFirst('FRED');
  15388. * // => 'FRED'
  15389. */
  15390. var upperFirst = createCaseFirst('toUpperCase');
  15391. /**
  15392. * Splits `string` into an array of its words.
  15393. *
  15394. * @static
  15395. * @memberOf _
  15396. * @since 3.0.0
  15397. * @category String
  15398. * @param {string} [string=''] The string to inspect.
  15399. * @param {RegExp|string} [pattern] The pattern to match words.
  15400. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15401. * @returns {Array} Returns the words of `string`.
  15402. * @example
  15403. *
  15404. * _.words('fred, barney, & pebbles');
  15405. * // => ['fred', 'barney', 'pebbles']
  15406. *
  15407. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15408. * // => ['fred', 'barney', '&', 'pebbles']
  15409. */
  15410. function words(string, pattern, guard) {
  15411. string = toString(string);
  15412. pattern = guard ? undefined : pattern;
  15413. if (pattern === undefined) {
  15414. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15415. }
  15416. return string.match(pattern) || [];
  15417. }
  15418. /*------------------------------------------------------------------------*/
  15419. /**
  15420. * Attempts to invoke `func`, returning either the result or the caught error
  15421. * object. Any additional arguments are provided to `func` when it's invoked.
  15422. *
  15423. * @static
  15424. * @memberOf _
  15425. * @since 3.0.0
  15426. * @category Util
  15427. * @param {Function} func The function to attempt.
  15428. * @param {...*} [args] The arguments to invoke `func` with.
  15429. * @returns {*} Returns the `func` result or error object.
  15430. * @example
  15431. *
  15432. * // Avoid throwing errors for invalid selectors.
  15433. * var elements = _.attempt(function(selector) {
  15434. * return document.querySelectorAll(selector);
  15435. * }, '>_>');
  15436. *
  15437. * if (_.isError(elements)) {
  15438. * elements = [];
  15439. * }
  15440. */
  15441. var attempt = baseRest(function(func, args) {
  15442. try {
  15443. return apply(func, undefined, args);
  15444. } catch (e) {
  15445. return isError(e) ? e : new Error(e);
  15446. }
  15447. });
  15448. /**
  15449. * Binds methods of an object to the object itself, overwriting the existing
  15450. * method.
  15451. *
  15452. * **Note:** This method doesn't set the "length" property of bound functions.
  15453. *
  15454. * @static
  15455. * @since 0.1.0
  15456. * @memberOf _
  15457. * @category Util
  15458. * @param {Object} object The object to bind and assign the bound methods to.
  15459. * @param {...(string|string[])} methodNames The object method names to bind.
  15460. * @returns {Object} Returns `object`.
  15461. * @example
  15462. *
  15463. * var view = {
  15464. * 'label': 'docs',
  15465. * 'click': function() {
  15466. * console.log('clicked ' + this.label);
  15467. * }
  15468. * };
  15469. *
  15470. * _.bindAll(view, ['click']);
  15471. * jQuery(element).on('click', view.click);
  15472. * // => Logs 'clicked docs' when clicked.
  15473. */
  15474. var bindAll = flatRest(function(object, methodNames) {
  15475. arrayEach(methodNames, function(key) {
  15476. key = toKey(key);
  15477. baseAssignValue(object, key, bind(object[key], object));
  15478. });
  15479. return object;
  15480. });
  15481. /**
  15482. * Creates a function that iterates over `pairs` and invokes the corresponding
  15483. * function of the first predicate to return truthy. The predicate-function
  15484. * pairs are invoked with the `this` binding and arguments of the created
  15485. * function.
  15486. *
  15487. * @static
  15488. * @memberOf _
  15489. * @since 4.0.0
  15490. * @category Util
  15491. * @param {Array} pairs The predicate-function pairs.
  15492. * @returns {Function} Returns the new composite function.
  15493. * @example
  15494. *
  15495. * var func = _.cond([
  15496. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15497. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15498. * [_.stubTrue, _.constant('no match')]
  15499. * ]);
  15500. *
  15501. * func({ 'a': 1, 'b': 2 });
  15502. * // => 'matches A'
  15503. *
  15504. * func({ 'a': 0, 'b': 1 });
  15505. * // => 'matches B'
  15506. *
  15507. * func({ 'a': '1', 'b': '2' });
  15508. * // => 'no match'
  15509. */
  15510. function cond(pairs) {
  15511. var length = pairs == null ? 0 : pairs.length,
  15512. toIteratee = getIteratee();
  15513. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15514. if (typeof pair[1] != 'function') {
  15515. throw new TypeError(FUNC_ERROR_TEXT);
  15516. }
  15517. return [toIteratee(pair[0]), pair[1]];
  15518. });
  15519. return baseRest(function(args) {
  15520. var index = -1;
  15521. while (++index < length) {
  15522. var pair = pairs[index];
  15523. if (apply(pair[0], this, args)) {
  15524. return apply(pair[1], this, args);
  15525. }
  15526. }
  15527. });
  15528. }
  15529. /**
  15530. * Creates a function that invokes the predicate properties of `source` with
  15531. * the corresponding property values of a given object, returning `true` if
  15532. * all predicates return truthy, else `false`.
  15533. *
  15534. * **Note:** The created function is equivalent to `_.conformsTo` with
  15535. * `source` partially applied.
  15536. *
  15537. * @static
  15538. * @memberOf _
  15539. * @since 4.0.0
  15540. * @category Util
  15541. * @param {Object} source The object of property predicates to conform to.
  15542. * @returns {Function} Returns the new spec function.
  15543. * @example
  15544. *
  15545. * var objects = [
  15546. * { 'a': 2, 'b': 1 },
  15547. * { 'a': 1, 'b': 2 }
  15548. * ];
  15549. *
  15550. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15551. * // => [{ 'a': 1, 'b': 2 }]
  15552. */
  15553. function conforms(source) {
  15554. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15555. }
  15556. /**
  15557. * Creates a function that returns `value`.
  15558. *
  15559. * @static
  15560. * @memberOf _
  15561. * @since 2.4.0
  15562. * @category Util
  15563. * @param {*} value The value to return from the new function.
  15564. * @returns {Function} Returns the new constant function.
  15565. * @example
  15566. *
  15567. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15568. *
  15569. * console.log(objects);
  15570. * // => [{ 'a': 1 }, { 'a': 1 }]
  15571. *
  15572. * console.log(objects[0] === objects[1]);
  15573. * // => true
  15574. */
  15575. function constant(value) {
  15576. return function() {
  15577. return value;
  15578. };
  15579. }
  15580. /**
  15581. * Checks `value` to determine whether a default value should be returned in
  15582. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15583. * or `undefined`.
  15584. *
  15585. * @static
  15586. * @memberOf _
  15587. * @since 4.14.0
  15588. * @category Util
  15589. * @param {*} value The value to check.
  15590. * @param {*} defaultValue The default value.
  15591. * @returns {*} Returns the resolved value.
  15592. * @example
  15593. *
  15594. * _.defaultTo(1, 10);
  15595. * // => 1
  15596. *
  15597. * _.defaultTo(undefined, 10);
  15598. * // => 10
  15599. */
  15600. function defaultTo(value, defaultValue) {
  15601. return (value == null || value !== value) ? defaultValue : value;
  15602. }
  15603. /**
  15604. * Creates a function that returns the result of invoking the given functions
  15605. * with the `this` binding of the created function, where each successive
  15606. * invocation is supplied the return value of the previous.
  15607. *
  15608. * @static
  15609. * @memberOf _
  15610. * @since 3.0.0
  15611. * @category Util
  15612. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15613. * @returns {Function} Returns the new composite function.
  15614. * @see _.flowRight
  15615. * @example
  15616. *
  15617. * function square(n) {
  15618. * return n * n;
  15619. * }
  15620. *
  15621. * var addSquare = _.flow([_.add, square]);
  15622. * addSquare(1, 2);
  15623. * // => 9
  15624. */
  15625. var flow = createFlow();
  15626. /**
  15627. * This method is like `_.flow` except that it creates a function that
  15628. * invokes the given functions from right to left.
  15629. *
  15630. * @static
  15631. * @since 3.0.0
  15632. * @memberOf _
  15633. * @category Util
  15634. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15635. * @returns {Function} Returns the new composite function.
  15636. * @see _.flow
  15637. * @example
  15638. *
  15639. * function square(n) {
  15640. * return n * n;
  15641. * }
  15642. *
  15643. * var addSquare = _.flowRight([square, _.add]);
  15644. * addSquare(1, 2);
  15645. * // => 9
  15646. */
  15647. var flowRight = createFlow(true);
  15648. /**
  15649. * This method returns the first argument it receives.
  15650. *
  15651. * @static
  15652. * @since 0.1.0
  15653. * @memberOf _
  15654. * @category Util
  15655. * @param {*} value Any value.
  15656. * @returns {*} Returns `value`.
  15657. * @example
  15658. *
  15659. * var object = { 'a': 1 };
  15660. *
  15661. * console.log(_.identity(object) === object);
  15662. * // => true
  15663. */
  15664. function identity(value) {
  15665. return value;
  15666. }
  15667. /**
  15668. * Creates a function that invokes `func` with the arguments of the created
  15669. * function. If `func` is a property name, the created function returns the
  15670. * property value for a given element. If `func` is an array or object, the
  15671. * created function returns `true` for elements that contain the equivalent
  15672. * source properties, otherwise it returns `false`.
  15673. *
  15674. * @static
  15675. * @since 4.0.0
  15676. * @memberOf _
  15677. * @category Util
  15678. * @param {*} [func=_.identity] The value to convert to a callback.
  15679. * @returns {Function} Returns the callback.
  15680. * @example
  15681. *
  15682. * var users = [
  15683. * { 'user': 'barney', 'age': 36, 'active': true },
  15684. * { 'user': 'fred', 'age': 40, 'active': false }
  15685. * ];
  15686. *
  15687. * // The `_.matches` iteratee shorthand.
  15688. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15689. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15690. *
  15691. * // The `_.matchesProperty` iteratee shorthand.
  15692. * _.filter(users, _.iteratee(['user', 'fred']));
  15693. * // => [{ 'user': 'fred', 'age': 40 }]
  15694. *
  15695. * // The `_.property` iteratee shorthand.
  15696. * _.map(users, _.iteratee('user'));
  15697. * // => ['barney', 'fred']
  15698. *
  15699. * // Create custom iteratee shorthands.
  15700. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15701. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15702. * return func.test(string);
  15703. * };
  15704. * });
  15705. *
  15706. * _.filter(['abc', 'def'], /ef/);
  15707. * // => ['def']
  15708. */
  15709. function iteratee(func) {
  15710. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15711. }
  15712. /**
  15713. * Creates a function that performs a partial deep comparison between a given
  15714. * object and `source`, returning `true` if the given object has equivalent
  15715. * property values, else `false`.
  15716. *
  15717. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15718. * partially applied.
  15719. *
  15720. * Partial comparisons will match empty array and empty object `source`
  15721. * values against any array or object value, respectively. See `_.isEqual`
  15722. * for a list of supported value comparisons.
  15723. *
  15724. * **Note:** Multiple values can be checked by combining several matchers
  15725. * using `_.overSome`
  15726. *
  15727. * @static
  15728. * @memberOf _
  15729. * @since 3.0.0
  15730. * @category Util
  15731. * @param {Object} source The object of property values to match.
  15732. * @returns {Function} Returns the new spec function.
  15733. * @example
  15734. *
  15735. * var objects = [
  15736. * { 'a': 1, 'b': 2, 'c': 3 },
  15737. * { 'a': 4, 'b': 5, 'c': 6 }
  15738. * ];
  15739. *
  15740. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15741. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15742. *
  15743. * // Checking for several possible values
  15744. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15745. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15746. */
  15747. function matches(source) {
  15748. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15749. }
  15750. /**
  15751. * Creates a function that performs a partial deep comparison between the
  15752. * value at `path` of a given object to `srcValue`, returning `true` if the
  15753. * object value is equivalent, else `false`.
  15754. *
  15755. * **Note:** Partial comparisons will match empty array and empty object
  15756. * `srcValue` values against any array or object value, respectively. See
  15757. * `_.isEqual` for a list of supported value comparisons.
  15758. *
  15759. * **Note:** Multiple values can be checked by combining several matchers
  15760. * using `_.overSome`
  15761. *
  15762. * @static
  15763. * @memberOf _
  15764. * @since 3.2.0
  15765. * @category Util
  15766. * @param {Array|string} path The path of the property to get.
  15767. * @param {*} srcValue The value to match.
  15768. * @returns {Function} Returns the new spec function.
  15769. * @example
  15770. *
  15771. * var objects = [
  15772. * { 'a': 1, 'b': 2, 'c': 3 },
  15773. * { 'a': 4, 'b': 5, 'c': 6 }
  15774. * ];
  15775. *
  15776. * _.find(objects, _.matchesProperty('a', 4));
  15777. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15778. *
  15779. * // Checking for several possible values
  15780. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15781. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15782. */
  15783. function matchesProperty(path, srcValue) {
  15784. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15785. }
  15786. /**
  15787. * Creates a function that invokes the method at `path` of a given object.
  15788. * Any additional arguments are provided to the invoked method.
  15789. *
  15790. * @static
  15791. * @memberOf _
  15792. * @since 3.7.0
  15793. * @category Util
  15794. * @param {Array|string} path The path of the method to invoke.
  15795. * @param {...*} [args] The arguments to invoke the method with.
  15796. * @returns {Function} Returns the new invoker function.
  15797. * @example
  15798. *
  15799. * var objects = [
  15800. * { 'a': { 'b': _.constant(2) } },
  15801. * { 'a': { 'b': _.constant(1) } }
  15802. * ];
  15803. *
  15804. * _.map(objects, _.method('a.b'));
  15805. * // => [2, 1]
  15806. *
  15807. * _.map(objects, _.method(['a', 'b']));
  15808. * // => [2, 1]
  15809. */
  15810. var method = baseRest(function(path, args) {
  15811. return function(object) {
  15812. return baseInvoke(object, path, args);
  15813. };
  15814. });
  15815. /**
  15816. * The opposite of `_.method`; this method creates a function that invokes
  15817. * the method at a given path of `object`. Any additional arguments are
  15818. * provided to the invoked method.
  15819. *
  15820. * @static
  15821. * @memberOf _
  15822. * @since 3.7.0
  15823. * @category Util
  15824. * @param {Object} object The object to query.
  15825. * @param {...*} [args] The arguments to invoke the method with.
  15826. * @returns {Function} Returns the new invoker function.
  15827. * @example
  15828. *
  15829. * var array = _.times(3, _.constant),
  15830. * object = { 'a': array, 'b': array, 'c': array };
  15831. *
  15832. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15833. * // => [2, 0]
  15834. *
  15835. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15836. * // => [2, 0]
  15837. */
  15838. var methodOf = baseRest(function(object, args) {
  15839. return function(path) {
  15840. return baseInvoke(object, path, args);
  15841. };
  15842. });
  15843. /**
  15844. * Adds all own enumerable string keyed function properties of a source
  15845. * object to the destination object. If `object` is a function, then methods
  15846. * are added to its prototype as well.
  15847. *
  15848. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15849. * avoid conflicts caused by modifying the original.
  15850. *
  15851. * @static
  15852. * @since 0.1.0
  15853. * @memberOf _
  15854. * @category Util
  15855. * @param {Function|Object} [object=lodash] The destination object.
  15856. * @param {Object} source The object of functions to add.
  15857. * @param {Object} [options={}] The options object.
  15858. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15859. * @returns {Function|Object} Returns `object`.
  15860. * @example
  15861. *
  15862. * function vowels(string) {
  15863. * return _.filter(string, function(v) {
  15864. * return /[aeiou]/i.test(v);
  15865. * });
  15866. * }
  15867. *
  15868. * _.mixin({ 'vowels': vowels });
  15869. * _.vowels('fred');
  15870. * // => ['e']
  15871. *
  15872. * _('fred').vowels().value();
  15873. * // => ['e']
  15874. *
  15875. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15876. * _('fred').vowels();
  15877. * // => ['e']
  15878. */
  15879. function mixin(object, source, options) {
  15880. var props = keys(source),
  15881. methodNames = baseFunctions(source, props);
  15882. if (options == null &&
  15883. !(isObject(source) && (methodNames.length || !props.length))) {
  15884. options = source;
  15885. source = object;
  15886. object = this;
  15887. methodNames = baseFunctions(source, keys(source));
  15888. }
  15889. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15890. isFunc = isFunction(object);
  15891. arrayEach(methodNames, function(methodName) {
  15892. var func = source[methodName];
  15893. object[methodName] = func;
  15894. if (isFunc) {
  15895. object.prototype[methodName] = function() {
  15896. var chainAll = this.__chain__;
  15897. if (chain || chainAll) {
  15898. var result = object(this.__wrapped__),
  15899. actions = result.__actions__ = copyArray(this.__actions__);
  15900. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15901. result.__chain__ = chainAll;
  15902. return result;
  15903. }
  15904. return func.apply(object, arrayPush([this.value()], arguments));
  15905. };
  15906. }
  15907. });
  15908. return object;
  15909. }
  15910. /**
  15911. * Reverts the `_` variable to its previous value and returns a reference to
  15912. * the `lodash` function.
  15913. *
  15914. * @static
  15915. * @since 0.1.0
  15916. * @memberOf _
  15917. * @category Util
  15918. * @returns {Function} Returns the `lodash` function.
  15919. * @example
  15920. *
  15921. * var lodash = _.noConflict();
  15922. */
  15923. function noConflict() {
  15924. if (root._ === this) {
  15925. root._ = oldDash;
  15926. }
  15927. return this;
  15928. }
  15929. /**
  15930. * This method returns `undefined`.
  15931. *
  15932. * @static
  15933. * @memberOf _
  15934. * @since 2.3.0
  15935. * @category Util
  15936. * @example
  15937. *
  15938. * _.times(2, _.noop);
  15939. * // => [undefined, undefined]
  15940. */
  15941. function noop() {
  15942. // No operation performed.
  15943. }
  15944. /**
  15945. * Creates a function that gets the argument at index `n`. If `n` is negative,
  15946. * the nth argument from the end is returned.
  15947. *
  15948. * @static
  15949. * @memberOf _
  15950. * @since 4.0.0
  15951. * @category Util
  15952. * @param {number} [n=0] The index of the argument to return.
  15953. * @returns {Function} Returns the new pass-thru function.
  15954. * @example
  15955. *
  15956. * var func = _.nthArg(1);
  15957. * func('a', 'b', 'c', 'd');
  15958. * // => 'b'
  15959. *
  15960. * var func = _.nthArg(-2);
  15961. * func('a', 'b', 'c', 'd');
  15962. * // => 'c'
  15963. */
  15964. function nthArg(n) {
  15965. n = toInteger(n);
  15966. return baseRest(function(args) {
  15967. return baseNth(args, n);
  15968. });
  15969. }
  15970. /**
  15971. * Creates a function that invokes `iteratees` with the arguments it receives
  15972. * and returns their results.
  15973. *
  15974. * @static
  15975. * @memberOf _
  15976. * @since 4.0.0
  15977. * @category Util
  15978. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  15979. * The iteratees to invoke.
  15980. * @returns {Function} Returns the new function.
  15981. * @example
  15982. *
  15983. * var func = _.over([Math.max, Math.min]);
  15984. *
  15985. * func(1, 2, 3, 4);
  15986. * // => [4, 1]
  15987. */
  15988. var over = createOver(arrayMap);
  15989. /**
  15990. * Creates a function that checks if **all** of the `predicates` return
  15991. * truthy when invoked with the arguments it receives.
  15992. *
  15993. * Following shorthands are possible for providing predicates.
  15994. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  15995. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  15996. *
  15997. * @static
  15998. * @memberOf _
  15999. * @since 4.0.0
  16000. * @category Util
  16001. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16002. * The predicates to check.
  16003. * @returns {Function} Returns the new function.
  16004. * @example
  16005. *
  16006. * var func = _.overEvery([Boolean, isFinite]);
  16007. *
  16008. * func('1');
  16009. * // => true
  16010. *
  16011. * func(null);
  16012. * // => false
  16013. *
  16014. * func(NaN);
  16015. * // => false
  16016. */
  16017. var overEvery = createOver(arrayEvery);
  16018. /**
  16019. * Creates a function that checks if **any** of the `predicates` return
  16020. * truthy when invoked with the arguments it receives.
  16021. *
  16022. * Following shorthands are possible for providing predicates.
  16023. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16024. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16025. *
  16026. * @static
  16027. * @memberOf _
  16028. * @since 4.0.0
  16029. * @category Util
  16030. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16031. * The predicates to check.
  16032. * @returns {Function} Returns the new function.
  16033. * @example
  16034. *
  16035. * var func = _.overSome([Boolean, isFinite]);
  16036. *
  16037. * func('1');
  16038. * // => true
  16039. *
  16040. * func(null);
  16041. * // => true
  16042. *
  16043. * func(NaN);
  16044. * // => false
  16045. *
  16046. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16047. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16048. */
  16049. var overSome = createOver(arraySome);
  16050. /**
  16051. * Creates a function that returns the value at `path` of a given object.
  16052. *
  16053. * @static
  16054. * @memberOf _
  16055. * @since 2.4.0
  16056. * @category Util
  16057. * @param {Array|string} path The path of the property to get.
  16058. * @returns {Function} Returns the new accessor function.
  16059. * @example
  16060. *
  16061. * var objects = [
  16062. * { 'a': { 'b': 2 } },
  16063. * { 'a': { 'b': 1 } }
  16064. * ];
  16065. *
  16066. * _.map(objects, _.property('a.b'));
  16067. * // => [2, 1]
  16068. *
  16069. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16070. * // => [1, 2]
  16071. */
  16072. function property(path) {
  16073. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16074. }
  16075. /**
  16076. * The opposite of `_.property`; this method creates a function that returns
  16077. * the value at a given path of `object`.
  16078. *
  16079. * @static
  16080. * @memberOf _
  16081. * @since 3.0.0
  16082. * @category Util
  16083. * @param {Object} object The object to query.
  16084. * @returns {Function} Returns the new accessor function.
  16085. * @example
  16086. *
  16087. * var array = [0, 1, 2],
  16088. * object = { 'a': array, 'b': array, 'c': array };
  16089. *
  16090. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16091. * // => [2, 0]
  16092. *
  16093. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16094. * // => [2, 0]
  16095. */
  16096. function propertyOf(object) {
  16097. return function(path) {
  16098. return object == null ? undefined : baseGet(object, path);
  16099. };
  16100. }
  16101. /**
  16102. * Creates an array of numbers (positive and/or negative) progressing from
  16103. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16104. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16105. * it's set to `start` with `start` then set to `0`.
  16106. *
  16107. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16108. * floating-point values which can produce unexpected results.
  16109. *
  16110. * @static
  16111. * @since 0.1.0
  16112. * @memberOf _
  16113. * @category Util
  16114. * @param {number} [start=0] The start of the range.
  16115. * @param {number} end The end of the range.
  16116. * @param {number} [step=1] The value to increment or decrement by.
  16117. * @returns {Array} Returns the range of numbers.
  16118. * @see _.inRange, _.rangeRight
  16119. * @example
  16120. *
  16121. * _.range(4);
  16122. * // => [0, 1, 2, 3]
  16123. *
  16124. * _.range(-4);
  16125. * // => [0, -1, -2, -3]
  16126. *
  16127. * _.range(1, 5);
  16128. * // => [1, 2, 3, 4]
  16129. *
  16130. * _.range(0, 20, 5);
  16131. * // => [0, 5, 10, 15]
  16132. *
  16133. * _.range(0, -4, -1);
  16134. * // => [0, -1, -2, -3]
  16135. *
  16136. * _.range(1, 4, 0);
  16137. * // => [1, 1, 1]
  16138. *
  16139. * _.range(0);
  16140. * // => []
  16141. */
  16142. var range = createRange();
  16143. /**
  16144. * This method is like `_.range` except that it populates values in
  16145. * descending order.
  16146. *
  16147. * @static
  16148. * @memberOf _
  16149. * @since 4.0.0
  16150. * @category Util
  16151. * @param {number} [start=0] The start of the range.
  16152. * @param {number} end The end of the range.
  16153. * @param {number} [step=1] The value to increment or decrement by.
  16154. * @returns {Array} Returns the range of numbers.
  16155. * @see _.inRange, _.range
  16156. * @example
  16157. *
  16158. * _.rangeRight(4);
  16159. * // => [3, 2, 1, 0]
  16160. *
  16161. * _.rangeRight(-4);
  16162. * // => [-3, -2, -1, 0]
  16163. *
  16164. * _.rangeRight(1, 5);
  16165. * // => [4, 3, 2, 1]
  16166. *
  16167. * _.rangeRight(0, 20, 5);
  16168. * // => [15, 10, 5, 0]
  16169. *
  16170. * _.rangeRight(0, -4, -1);
  16171. * // => [-3, -2, -1, 0]
  16172. *
  16173. * _.rangeRight(1, 4, 0);
  16174. * // => [1, 1, 1]
  16175. *
  16176. * _.rangeRight(0);
  16177. * // => []
  16178. */
  16179. var rangeRight = createRange(true);
  16180. /**
  16181. * This method returns a new empty array.
  16182. *
  16183. * @static
  16184. * @memberOf _
  16185. * @since 4.13.0
  16186. * @category Util
  16187. * @returns {Array} Returns the new empty array.
  16188. * @example
  16189. *
  16190. * var arrays = _.times(2, _.stubArray);
  16191. *
  16192. * console.log(arrays);
  16193. * // => [[], []]
  16194. *
  16195. * console.log(arrays[0] === arrays[1]);
  16196. * // => false
  16197. */
  16198. function stubArray() {
  16199. return [];
  16200. }
  16201. /**
  16202. * This method returns `false`.
  16203. *
  16204. * @static
  16205. * @memberOf _
  16206. * @since 4.13.0
  16207. * @category Util
  16208. * @returns {boolean} Returns `false`.
  16209. * @example
  16210. *
  16211. * _.times(2, _.stubFalse);
  16212. * // => [false, false]
  16213. */
  16214. function stubFalse() {
  16215. return false;
  16216. }
  16217. /**
  16218. * This method returns a new empty object.
  16219. *
  16220. * @static
  16221. * @memberOf _
  16222. * @since 4.13.0
  16223. * @category Util
  16224. * @returns {Object} Returns the new empty object.
  16225. * @example
  16226. *
  16227. * var objects = _.times(2, _.stubObject);
  16228. *
  16229. * console.log(objects);
  16230. * // => [{}, {}]
  16231. *
  16232. * console.log(objects[0] === objects[1]);
  16233. * // => false
  16234. */
  16235. function stubObject() {
  16236. return {};
  16237. }
  16238. /**
  16239. * This method returns an empty string.
  16240. *
  16241. * @static
  16242. * @memberOf _
  16243. * @since 4.13.0
  16244. * @category Util
  16245. * @returns {string} Returns the empty string.
  16246. * @example
  16247. *
  16248. * _.times(2, _.stubString);
  16249. * // => ['', '']
  16250. */
  16251. function stubString() {
  16252. return '';
  16253. }
  16254. /**
  16255. * This method returns `true`.
  16256. *
  16257. * @static
  16258. * @memberOf _
  16259. * @since 4.13.0
  16260. * @category Util
  16261. * @returns {boolean} Returns `true`.
  16262. * @example
  16263. *
  16264. * _.times(2, _.stubTrue);
  16265. * // => [true, true]
  16266. */
  16267. function stubTrue() {
  16268. return true;
  16269. }
  16270. /**
  16271. * Invokes the iteratee `n` times, returning an array of the results of
  16272. * each invocation. The iteratee is invoked with one argument; (index).
  16273. *
  16274. * @static
  16275. * @since 0.1.0
  16276. * @memberOf _
  16277. * @category Util
  16278. * @param {number} n The number of times to invoke `iteratee`.
  16279. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16280. * @returns {Array} Returns the array of results.
  16281. * @example
  16282. *
  16283. * _.times(3, String);
  16284. * // => ['0', '1', '2']
  16285. *
  16286. * _.times(4, _.constant(0));
  16287. * // => [0, 0, 0, 0]
  16288. */
  16289. function times(n, iteratee) {
  16290. n = toInteger(n);
  16291. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16292. return [];
  16293. }
  16294. var index = MAX_ARRAY_LENGTH,
  16295. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16296. iteratee = getIteratee(iteratee);
  16297. n -= MAX_ARRAY_LENGTH;
  16298. var result = baseTimes(length, iteratee);
  16299. while (++index < n) {
  16300. iteratee(index);
  16301. }
  16302. return result;
  16303. }
  16304. /**
  16305. * Converts `value` to a property path array.
  16306. *
  16307. * @static
  16308. * @memberOf _
  16309. * @since 4.0.0
  16310. * @category Util
  16311. * @param {*} value The value to convert.
  16312. * @returns {Array} Returns the new property path array.
  16313. * @example
  16314. *
  16315. * _.toPath('a.b.c');
  16316. * // => ['a', 'b', 'c']
  16317. *
  16318. * _.toPath('a[0].b.c');
  16319. * // => ['a', '0', 'b', 'c']
  16320. */
  16321. function toPath(value) {
  16322. if (isArray(value)) {
  16323. return arrayMap(value, toKey);
  16324. }
  16325. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16326. }
  16327. /**
  16328. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16329. *
  16330. * @static
  16331. * @since 0.1.0
  16332. * @memberOf _
  16333. * @category Util
  16334. * @param {string} [prefix=''] The value to prefix the ID with.
  16335. * @returns {string} Returns the unique ID.
  16336. * @example
  16337. *
  16338. * _.uniqueId('contact_');
  16339. * // => 'contact_104'
  16340. *
  16341. * _.uniqueId();
  16342. * // => '105'
  16343. */
  16344. function uniqueId(prefix) {
  16345. var id = ++idCounter;
  16346. return toString(prefix) + id;
  16347. }
  16348. /*------------------------------------------------------------------------*/
  16349. /**
  16350. * Adds two numbers.
  16351. *
  16352. * @static
  16353. * @memberOf _
  16354. * @since 3.4.0
  16355. * @category Math
  16356. * @param {number} augend The first number in an addition.
  16357. * @param {number} addend The second number in an addition.
  16358. * @returns {number} Returns the total.
  16359. * @example
  16360. *
  16361. * _.add(6, 4);
  16362. * // => 10
  16363. */
  16364. var add = createMathOperation(function(augend, addend) {
  16365. return augend + addend;
  16366. }, 0);
  16367. /**
  16368. * Computes `number` rounded up to `precision`.
  16369. *
  16370. * @static
  16371. * @memberOf _
  16372. * @since 3.10.0
  16373. * @category Math
  16374. * @param {number} number The number to round up.
  16375. * @param {number} [precision=0] The precision to round up to.
  16376. * @returns {number} Returns the rounded up number.
  16377. * @example
  16378. *
  16379. * _.ceil(4.006);
  16380. * // => 5
  16381. *
  16382. * _.ceil(6.004, 2);
  16383. * // => 6.01
  16384. *
  16385. * _.ceil(6040, -2);
  16386. * // => 6100
  16387. */
  16388. var ceil = createRound('ceil');
  16389. /**
  16390. * Divide two numbers.
  16391. *
  16392. * @static
  16393. * @memberOf _
  16394. * @since 4.7.0
  16395. * @category Math
  16396. * @param {number} dividend The first number in a division.
  16397. * @param {number} divisor The second number in a division.
  16398. * @returns {number} Returns the quotient.
  16399. * @example
  16400. *
  16401. * _.divide(6, 4);
  16402. * // => 1.5
  16403. */
  16404. var divide = createMathOperation(function(dividend, divisor) {
  16405. return dividend / divisor;
  16406. }, 1);
  16407. /**
  16408. * Computes `number` rounded down to `precision`.
  16409. *
  16410. * @static
  16411. * @memberOf _
  16412. * @since 3.10.0
  16413. * @category Math
  16414. * @param {number} number The number to round down.
  16415. * @param {number} [precision=0] The precision to round down to.
  16416. * @returns {number} Returns the rounded down number.
  16417. * @example
  16418. *
  16419. * _.floor(4.006);
  16420. * // => 4
  16421. *
  16422. * _.floor(0.046, 2);
  16423. * // => 0.04
  16424. *
  16425. * _.floor(4060, -2);
  16426. * // => 4000
  16427. */
  16428. var floor = createRound('floor');
  16429. /**
  16430. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16431. * `undefined` is returned.
  16432. *
  16433. * @static
  16434. * @since 0.1.0
  16435. * @memberOf _
  16436. * @category Math
  16437. * @param {Array} array The array to iterate over.
  16438. * @returns {*} Returns the maximum value.
  16439. * @example
  16440. *
  16441. * _.max([4, 2, 8, 6]);
  16442. * // => 8
  16443. *
  16444. * _.max([]);
  16445. * // => undefined
  16446. */
  16447. function max(array) {
  16448. return (array && array.length)
  16449. ? baseExtremum(array, identity, baseGt)
  16450. : undefined;
  16451. }
  16452. /**
  16453. * This method is like `_.max` except that it accepts `iteratee` which is
  16454. * invoked for each element in `array` to generate the criterion by which
  16455. * the value is ranked. The iteratee is invoked with one argument: (value).
  16456. *
  16457. * @static
  16458. * @memberOf _
  16459. * @since 4.0.0
  16460. * @category Math
  16461. * @param {Array} array The array to iterate over.
  16462. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16463. * @returns {*} Returns the maximum value.
  16464. * @example
  16465. *
  16466. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16467. *
  16468. * _.maxBy(objects, function(o) { return o.n; });
  16469. * // => { 'n': 2 }
  16470. *
  16471. * // The `_.property` iteratee shorthand.
  16472. * _.maxBy(objects, 'n');
  16473. * // => { 'n': 2 }
  16474. */
  16475. function maxBy(array, iteratee) {
  16476. return (array && array.length)
  16477. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16478. : undefined;
  16479. }
  16480. /**
  16481. * Computes the mean of the values in `array`.
  16482. *
  16483. * @static
  16484. * @memberOf _
  16485. * @since 4.0.0
  16486. * @category Math
  16487. * @param {Array} array The array to iterate over.
  16488. * @returns {number} Returns the mean.
  16489. * @example
  16490. *
  16491. * _.mean([4, 2, 8, 6]);
  16492. * // => 5
  16493. */
  16494. function mean(array) {
  16495. return baseMean(array, identity);
  16496. }
  16497. /**
  16498. * This method is like `_.mean` except that it accepts `iteratee` which is
  16499. * invoked for each element in `array` to generate the value to be averaged.
  16500. * The iteratee is invoked with one argument: (value).
  16501. *
  16502. * @static
  16503. * @memberOf _
  16504. * @since 4.7.0
  16505. * @category Math
  16506. * @param {Array} array The array to iterate over.
  16507. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16508. * @returns {number} Returns the mean.
  16509. * @example
  16510. *
  16511. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16512. *
  16513. * _.meanBy(objects, function(o) { return o.n; });
  16514. * // => 5
  16515. *
  16516. * // The `_.property` iteratee shorthand.
  16517. * _.meanBy(objects, 'n');
  16518. * // => 5
  16519. */
  16520. function meanBy(array, iteratee) {
  16521. return baseMean(array, getIteratee(iteratee, 2));
  16522. }
  16523. /**
  16524. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16525. * `undefined` is returned.
  16526. *
  16527. * @static
  16528. * @since 0.1.0
  16529. * @memberOf _
  16530. * @category Math
  16531. * @param {Array} array The array to iterate over.
  16532. * @returns {*} Returns the minimum value.
  16533. * @example
  16534. *
  16535. * _.min([4, 2, 8, 6]);
  16536. * // => 2
  16537. *
  16538. * _.min([]);
  16539. * // => undefined
  16540. */
  16541. function min(array) {
  16542. return (array && array.length)
  16543. ? baseExtremum(array, identity, baseLt)
  16544. : undefined;
  16545. }
  16546. /**
  16547. * This method is like `_.min` except that it accepts `iteratee` which is
  16548. * invoked for each element in `array` to generate the criterion by which
  16549. * the value is ranked. The iteratee is invoked with one argument: (value).
  16550. *
  16551. * @static
  16552. * @memberOf _
  16553. * @since 4.0.0
  16554. * @category Math
  16555. * @param {Array} array The array to iterate over.
  16556. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16557. * @returns {*} Returns the minimum value.
  16558. * @example
  16559. *
  16560. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16561. *
  16562. * _.minBy(objects, function(o) { return o.n; });
  16563. * // => { 'n': 1 }
  16564. *
  16565. * // The `_.property` iteratee shorthand.
  16566. * _.minBy(objects, 'n');
  16567. * // => { 'n': 1 }
  16568. */
  16569. function minBy(array, iteratee) {
  16570. return (array && array.length)
  16571. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16572. : undefined;
  16573. }
  16574. /**
  16575. * Multiply two numbers.
  16576. *
  16577. * @static
  16578. * @memberOf _
  16579. * @since 4.7.0
  16580. * @category Math
  16581. * @param {number} multiplier The first number in a multiplication.
  16582. * @param {number} multiplicand The second number in a multiplication.
  16583. * @returns {number} Returns the product.
  16584. * @example
  16585. *
  16586. * _.multiply(6, 4);
  16587. * // => 24
  16588. */
  16589. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16590. return multiplier * multiplicand;
  16591. }, 1);
  16592. /**
  16593. * Computes `number` rounded to `precision`.
  16594. *
  16595. * @static
  16596. * @memberOf _
  16597. * @since 3.10.0
  16598. * @category Math
  16599. * @param {number} number The number to round.
  16600. * @param {number} [precision=0] The precision to round to.
  16601. * @returns {number} Returns the rounded number.
  16602. * @example
  16603. *
  16604. * _.round(4.006);
  16605. * // => 4
  16606. *
  16607. * _.round(4.006, 2);
  16608. * // => 4.01
  16609. *
  16610. * _.round(4060, -2);
  16611. * // => 4100
  16612. */
  16613. var round = createRound('round');
  16614. /**
  16615. * Subtract two numbers.
  16616. *
  16617. * @static
  16618. * @memberOf _
  16619. * @since 4.0.0
  16620. * @category Math
  16621. * @param {number} minuend The first number in a subtraction.
  16622. * @param {number} subtrahend The second number in a subtraction.
  16623. * @returns {number} Returns the difference.
  16624. * @example
  16625. *
  16626. * _.subtract(6, 4);
  16627. * // => 2
  16628. */
  16629. var subtract = createMathOperation(function(minuend, subtrahend) {
  16630. return minuend - subtrahend;
  16631. }, 0);
  16632. /**
  16633. * Computes the sum of the values in `array`.
  16634. *
  16635. * @static
  16636. * @memberOf _
  16637. * @since 3.4.0
  16638. * @category Math
  16639. * @param {Array} array The array to iterate over.
  16640. * @returns {number} Returns the sum.
  16641. * @example
  16642. *
  16643. * _.sum([4, 2, 8, 6]);
  16644. * // => 20
  16645. */
  16646. function sum(array) {
  16647. return (array && array.length)
  16648. ? baseSum(array, identity)
  16649. : 0;
  16650. }
  16651. /**
  16652. * This method is like `_.sum` except that it accepts `iteratee` which is
  16653. * invoked for each element in `array` to generate the value to be summed.
  16654. * The iteratee is invoked with one argument: (value).
  16655. *
  16656. * @static
  16657. * @memberOf _
  16658. * @since 4.0.0
  16659. * @category Math
  16660. * @param {Array} array The array to iterate over.
  16661. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16662. * @returns {number} Returns the sum.
  16663. * @example
  16664. *
  16665. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16666. *
  16667. * _.sumBy(objects, function(o) { return o.n; });
  16668. * // => 20
  16669. *
  16670. * // The `_.property` iteratee shorthand.
  16671. * _.sumBy(objects, 'n');
  16672. * // => 20
  16673. */
  16674. function sumBy(array, iteratee) {
  16675. return (array && array.length)
  16676. ? baseSum(array, getIteratee(iteratee, 2))
  16677. : 0;
  16678. }
  16679. /*------------------------------------------------------------------------*/
  16680. // Add methods that return wrapped values in chain sequences.
  16681. lodash.after = after;
  16682. lodash.ary = ary;
  16683. lodash.assign = assign;
  16684. lodash.assignIn = assignIn;
  16685. lodash.assignInWith = assignInWith;
  16686. lodash.assignWith = assignWith;
  16687. lodash.at = at;
  16688. lodash.before = before;
  16689. lodash.bind = bind;
  16690. lodash.bindAll = bindAll;
  16691. lodash.bindKey = bindKey;
  16692. lodash.castArray = castArray;
  16693. lodash.chain = chain;
  16694. lodash.chunk = chunk;
  16695. lodash.compact = compact;
  16696. lodash.concat = concat;
  16697. lodash.cond = cond;
  16698. lodash.conforms = conforms;
  16699. lodash.constant = constant;
  16700. lodash.countBy = countBy;
  16701. lodash.create = create;
  16702. lodash.curry = curry;
  16703. lodash.curryRight = curryRight;
  16704. lodash.debounce = debounce;
  16705. lodash.defaults = defaults;
  16706. lodash.defaultsDeep = defaultsDeep;
  16707. lodash.defer = defer;
  16708. lodash.delay = delay;
  16709. lodash.difference = difference;
  16710. lodash.differenceBy = differenceBy;
  16711. lodash.differenceWith = differenceWith;
  16712. lodash.drop = drop;
  16713. lodash.dropRight = dropRight;
  16714. lodash.dropRightWhile = dropRightWhile;
  16715. lodash.dropWhile = dropWhile;
  16716. lodash.fill = fill;
  16717. lodash.filter = filter;
  16718. lodash.flatMap = flatMap;
  16719. lodash.flatMapDeep = flatMapDeep;
  16720. lodash.flatMapDepth = flatMapDepth;
  16721. lodash.flatten = flatten;
  16722. lodash.flattenDeep = flattenDeep;
  16723. lodash.flattenDepth = flattenDepth;
  16724. lodash.flip = flip;
  16725. lodash.flow = flow;
  16726. lodash.flowRight = flowRight;
  16727. lodash.fromPairs = fromPairs;
  16728. lodash.functions = functions;
  16729. lodash.functionsIn = functionsIn;
  16730. lodash.groupBy = groupBy;
  16731. lodash.initial = initial;
  16732. lodash.intersection = intersection;
  16733. lodash.intersectionBy = intersectionBy;
  16734. lodash.intersectionWith = intersectionWith;
  16735. lodash.invert = invert;
  16736. lodash.invertBy = invertBy;
  16737. lodash.invokeMap = invokeMap;
  16738. lodash.iteratee = iteratee;
  16739. lodash.keyBy = keyBy;
  16740. lodash.keys = keys;
  16741. lodash.keysIn = keysIn;
  16742. lodash.map = map;
  16743. lodash.mapKeys = mapKeys;
  16744. lodash.mapValues = mapValues;
  16745. lodash.matches = matches;
  16746. lodash.matchesProperty = matchesProperty;
  16747. lodash.memoize = memoize;
  16748. lodash.merge = merge;
  16749. lodash.mergeWith = mergeWith;
  16750. lodash.method = method;
  16751. lodash.methodOf = methodOf;
  16752. lodash.mixin = mixin;
  16753. lodash.negate = negate;
  16754. lodash.nthArg = nthArg;
  16755. lodash.omit = omit;
  16756. lodash.omitBy = omitBy;
  16757. lodash.once = once;
  16758. lodash.orderBy = orderBy;
  16759. lodash.over = over;
  16760. lodash.overArgs = overArgs;
  16761. lodash.overEvery = overEvery;
  16762. lodash.overSome = overSome;
  16763. lodash.partial = partial;
  16764. lodash.partialRight = partialRight;
  16765. lodash.partition = partition;
  16766. lodash.pick = pick;
  16767. lodash.pickBy = pickBy;
  16768. lodash.property = property;
  16769. lodash.propertyOf = propertyOf;
  16770. lodash.pull = pull;
  16771. lodash.pullAll = pullAll;
  16772. lodash.pullAllBy = pullAllBy;
  16773. lodash.pullAllWith = pullAllWith;
  16774. lodash.pullAt = pullAt;
  16775. lodash.range = range;
  16776. lodash.rangeRight = rangeRight;
  16777. lodash.rearg = rearg;
  16778. lodash.reject = reject;
  16779. lodash.remove = remove;
  16780. lodash.rest = rest;
  16781. lodash.reverse = reverse;
  16782. lodash.sampleSize = sampleSize;
  16783. lodash.set = set;
  16784. lodash.setWith = setWith;
  16785. lodash.shuffle = shuffle;
  16786. lodash.slice = slice;
  16787. lodash.sortBy = sortBy;
  16788. lodash.sortedUniq = sortedUniq;
  16789. lodash.sortedUniqBy = sortedUniqBy;
  16790. lodash.split = split;
  16791. lodash.spread = spread;
  16792. lodash.tail = tail;
  16793. lodash.take = take;
  16794. lodash.takeRight = takeRight;
  16795. lodash.takeRightWhile = takeRightWhile;
  16796. lodash.takeWhile = takeWhile;
  16797. lodash.tap = tap;
  16798. lodash.throttle = throttle;
  16799. lodash.thru = thru;
  16800. lodash.toArray = toArray;
  16801. lodash.toPairs = toPairs;
  16802. lodash.toPairsIn = toPairsIn;
  16803. lodash.toPath = toPath;
  16804. lodash.toPlainObject = toPlainObject;
  16805. lodash.transform = transform;
  16806. lodash.unary = unary;
  16807. lodash.union = union;
  16808. lodash.unionBy = unionBy;
  16809. lodash.unionWith = unionWith;
  16810. lodash.uniq = uniq;
  16811. lodash.uniqBy = uniqBy;
  16812. lodash.uniqWith = uniqWith;
  16813. lodash.unset = unset;
  16814. lodash.unzip = unzip;
  16815. lodash.unzipWith = unzipWith;
  16816. lodash.update = update;
  16817. lodash.updateWith = updateWith;
  16818. lodash.values = values;
  16819. lodash.valuesIn = valuesIn;
  16820. lodash.without = without;
  16821. lodash.words = words;
  16822. lodash.wrap = wrap;
  16823. lodash.xor = xor;
  16824. lodash.xorBy = xorBy;
  16825. lodash.xorWith = xorWith;
  16826. lodash.zip = zip;
  16827. lodash.zipObject = zipObject;
  16828. lodash.zipObjectDeep = zipObjectDeep;
  16829. lodash.zipWith = zipWith;
  16830. // Add aliases.
  16831. lodash.entries = toPairs;
  16832. lodash.entriesIn = toPairsIn;
  16833. lodash.extend = assignIn;
  16834. lodash.extendWith = assignInWith;
  16835. // Add methods to `lodash.prototype`.
  16836. mixin(lodash, lodash);
  16837. /*------------------------------------------------------------------------*/
  16838. // Add methods that return unwrapped values in chain sequences.
  16839. lodash.add = add;
  16840. lodash.attempt = attempt;
  16841. lodash.camelCase = camelCase;
  16842. lodash.capitalize = capitalize;
  16843. lodash.ceil = ceil;
  16844. lodash.clamp = clamp;
  16845. lodash.clone = clone;
  16846. lodash.cloneDeep = cloneDeep;
  16847. lodash.cloneDeepWith = cloneDeepWith;
  16848. lodash.cloneWith = cloneWith;
  16849. lodash.conformsTo = conformsTo;
  16850. lodash.deburr = deburr;
  16851. lodash.defaultTo = defaultTo;
  16852. lodash.divide = divide;
  16853. lodash.endsWith = endsWith;
  16854. lodash.eq = eq;
  16855. lodash.escape = escape;
  16856. lodash.escapeRegExp = escapeRegExp;
  16857. lodash.every = every;
  16858. lodash.find = find;
  16859. lodash.findIndex = findIndex;
  16860. lodash.findKey = findKey;
  16861. lodash.findLast = findLast;
  16862. lodash.findLastIndex = findLastIndex;
  16863. lodash.findLastKey = findLastKey;
  16864. lodash.floor = floor;
  16865. lodash.forEach = forEach;
  16866. lodash.forEachRight = forEachRight;
  16867. lodash.forIn = forIn;
  16868. lodash.forInRight = forInRight;
  16869. lodash.forOwn = forOwn;
  16870. lodash.forOwnRight = forOwnRight;
  16871. lodash.get = get;
  16872. lodash.gt = gt;
  16873. lodash.gte = gte;
  16874. lodash.has = has;
  16875. lodash.hasIn = hasIn;
  16876. lodash.head = head;
  16877. lodash.identity = identity;
  16878. lodash.includes = includes;
  16879. lodash.indexOf = indexOf;
  16880. lodash.inRange = inRange;
  16881. lodash.invoke = invoke;
  16882. lodash.isArguments = isArguments;
  16883. lodash.isArray = isArray;
  16884. lodash.isArrayBuffer = isArrayBuffer;
  16885. lodash.isArrayLike = isArrayLike;
  16886. lodash.isArrayLikeObject = isArrayLikeObject;
  16887. lodash.isBoolean = isBoolean;
  16888. lodash.isBuffer = isBuffer;
  16889. lodash.isDate = isDate;
  16890. lodash.isElement = isElement;
  16891. lodash.isEmpty = isEmpty;
  16892. lodash.isEqual = isEqual;
  16893. lodash.isEqualWith = isEqualWith;
  16894. lodash.isError = isError;
  16895. lodash.isFinite = isFinite;
  16896. lodash.isFunction = isFunction;
  16897. lodash.isInteger = isInteger;
  16898. lodash.isLength = isLength;
  16899. lodash.isMap = isMap;
  16900. lodash.isMatch = isMatch;
  16901. lodash.isMatchWith = isMatchWith;
  16902. lodash.isNaN = isNaN;
  16903. lodash.isNative = isNative;
  16904. lodash.isNil = isNil;
  16905. lodash.isNull = isNull;
  16906. lodash.isNumber = isNumber;
  16907. lodash.isObject = isObject;
  16908. lodash.isObjectLike = isObjectLike;
  16909. lodash.isPlainObject = isPlainObject;
  16910. lodash.isRegExp = isRegExp;
  16911. lodash.isSafeInteger = isSafeInteger;
  16912. lodash.isSet = isSet;
  16913. lodash.isString = isString;
  16914. lodash.isSymbol = isSymbol;
  16915. lodash.isTypedArray = isTypedArray;
  16916. lodash.isUndefined = isUndefined;
  16917. lodash.isWeakMap = isWeakMap;
  16918. lodash.isWeakSet = isWeakSet;
  16919. lodash.join = join;
  16920. lodash.kebabCase = kebabCase;
  16921. lodash.last = last;
  16922. lodash.lastIndexOf = lastIndexOf;
  16923. lodash.lowerCase = lowerCase;
  16924. lodash.lowerFirst = lowerFirst;
  16925. lodash.lt = lt;
  16926. lodash.lte = lte;
  16927. lodash.max = max;
  16928. lodash.maxBy = maxBy;
  16929. lodash.mean = mean;
  16930. lodash.meanBy = meanBy;
  16931. lodash.min = min;
  16932. lodash.minBy = minBy;
  16933. lodash.stubArray = stubArray;
  16934. lodash.stubFalse = stubFalse;
  16935. lodash.stubObject = stubObject;
  16936. lodash.stubString = stubString;
  16937. lodash.stubTrue = stubTrue;
  16938. lodash.multiply = multiply;
  16939. lodash.nth = nth;
  16940. lodash.noConflict = noConflict;
  16941. lodash.noop = noop;
  16942. lodash.now = now;
  16943. lodash.pad = pad;
  16944. lodash.padEnd = padEnd;
  16945. lodash.padStart = padStart;
  16946. lodash.parseInt = parseInt;
  16947. lodash.random = random;
  16948. lodash.reduce = reduce;
  16949. lodash.reduceRight = reduceRight;
  16950. lodash.repeat = repeat;
  16951. lodash.replace = replace;
  16952. lodash.result = result;
  16953. lodash.round = round;
  16954. lodash.runInContext = runInContext;
  16955. lodash.sample = sample;
  16956. lodash.size = size;
  16957. lodash.snakeCase = snakeCase;
  16958. lodash.some = some;
  16959. lodash.sortedIndex = sortedIndex;
  16960. lodash.sortedIndexBy = sortedIndexBy;
  16961. lodash.sortedIndexOf = sortedIndexOf;
  16962. lodash.sortedLastIndex = sortedLastIndex;
  16963. lodash.sortedLastIndexBy = sortedLastIndexBy;
  16964. lodash.sortedLastIndexOf = sortedLastIndexOf;
  16965. lodash.startCase = startCase;
  16966. lodash.startsWith = startsWith;
  16967. lodash.subtract = subtract;
  16968. lodash.sum = sum;
  16969. lodash.sumBy = sumBy;
  16970. lodash.template = template;
  16971. lodash.times = times;
  16972. lodash.toFinite = toFinite;
  16973. lodash.toInteger = toInteger;
  16974. lodash.toLength = toLength;
  16975. lodash.toLower = toLower;
  16976. lodash.toNumber = toNumber;
  16977. lodash.toSafeInteger = toSafeInteger;
  16978. lodash.toString = toString;
  16979. lodash.toUpper = toUpper;
  16980. lodash.trim = trim;
  16981. lodash.trimEnd = trimEnd;
  16982. lodash.trimStart = trimStart;
  16983. lodash.truncate = truncate;
  16984. lodash.unescape = unescape;
  16985. lodash.uniqueId = uniqueId;
  16986. lodash.upperCase = upperCase;
  16987. lodash.upperFirst = upperFirst;
  16988. // Add aliases.
  16989. lodash.each = forEach;
  16990. lodash.eachRight = forEachRight;
  16991. lodash.first = head;
  16992. mixin(lodash, (function() {
  16993. var source = {};
  16994. baseForOwn(lodash, function(func, methodName) {
  16995. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  16996. source[methodName] = func;
  16997. }
  16998. });
  16999. return source;
  17000. }()), { 'chain': false });
  17001. /*------------------------------------------------------------------------*/
  17002. /**
  17003. * The semantic version number.
  17004. *
  17005. * @static
  17006. * @memberOf _
  17007. * @type {string}
  17008. */
  17009. lodash.VERSION = VERSION;
  17010. // Assign default placeholders.
  17011. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17012. lodash[methodName].placeholder = lodash;
  17013. });
  17014. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17015. arrayEach(['drop', 'take'], function(methodName, index) {
  17016. LazyWrapper.prototype[methodName] = function(n) {
  17017. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17018. var result = (this.__filtered__ && !index)
  17019. ? new LazyWrapper(this)
  17020. : this.clone();
  17021. if (result.__filtered__) {
  17022. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17023. } else {
  17024. result.__views__.push({
  17025. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17026. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17027. });
  17028. }
  17029. return result;
  17030. };
  17031. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17032. return this.reverse()[methodName](n).reverse();
  17033. };
  17034. });
  17035. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17036. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17037. var type = index + 1,
  17038. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17039. LazyWrapper.prototype[methodName] = function(iteratee) {
  17040. var result = this.clone();
  17041. result.__iteratees__.push({
  17042. 'iteratee': getIteratee(iteratee, 3),
  17043. 'type': type
  17044. });
  17045. result.__filtered__ = result.__filtered__ || isFilter;
  17046. return result;
  17047. };
  17048. });
  17049. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17050. arrayEach(['head', 'last'], function(methodName, index) {
  17051. var takeName = 'take' + (index ? 'Right' : '');
  17052. LazyWrapper.prototype[methodName] = function() {
  17053. return this[takeName](1).value()[0];
  17054. };
  17055. });
  17056. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17057. arrayEach(['initial', 'tail'], function(methodName, index) {
  17058. var dropName = 'drop' + (index ? '' : 'Right');
  17059. LazyWrapper.prototype[methodName] = function() {
  17060. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17061. };
  17062. });
  17063. LazyWrapper.prototype.compact = function() {
  17064. return this.filter(identity);
  17065. };
  17066. LazyWrapper.prototype.find = function(predicate) {
  17067. return this.filter(predicate).head();
  17068. };
  17069. LazyWrapper.prototype.findLast = function(predicate) {
  17070. return this.reverse().find(predicate);
  17071. };
  17072. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17073. if (typeof path == 'function') {
  17074. return new LazyWrapper(this);
  17075. }
  17076. return this.map(function(value) {
  17077. return baseInvoke(value, path, args);
  17078. });
  17079. });
  17080. LazyWrapper.prototype.reject = function(predicate) {
  17081. return this.filter(negate(getIteratee(predicate)));
  17082. };
  17083. LazyWrapper.prototype.slice = function(start, end) {
  17084. start = toInteger(start);
  17085. var result = this;
  17086. if (result.__filtered__ && (start > 0 || end < 0)) {
  17087. return new LazyWrapper(result);
  17088. }
  17089. if (start < 0) {
  17090. result = result.takeRight(-start);
  17091. } else if (start) {
  17092. result = result.drop(start);
  17093. }
  17094. if (end !== undefined) {
  17095. end = toInteger(end);
  17096. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17097. }
  17098. return result;
  17099. };
  17100. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17101. return this.reverse().takeWhile(predicate).reverse();
  17102. };
  17103. LazyWrapper.prototype.toArray = function() {
  17104. return this.take(MAX_ARRAY_LENGTH);
  17105. };
  17106. // Add `LazyWrapper` methods to `lodash.prototype`.
  17107. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17108. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17109. isTaker = /^(?:head|last)$/.test(methodName),
  17110. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17111. retUnwrapped = isTaker || /^find/.test(methodName);
  17112. if (!lodashFunc) {
  17113. return;
  17114. }
  17115. lodash.prototype[methodName] = function() {
  17116. var value = this.__wrapped__,
  17117. args = isTaker ? [1] : arguments,
  17118. isLazy = value instanceof LazyWrapper,
  17119. iteratee = args[0],
  17120. useLazy = isLazy || isArray(value);
  17121. var interceptor = function(value) {
  17122. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17123. return (isTaker && chainAll) ? result[0] : result;
  17124. };
  17125. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17126. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17127. isLazy = useLazy = false;
  17128. }
  17129. var chainAll = this.__chain__,
  17130. isHybrid = !!this.__actions__.length,
  17131. isUnwrapped = retUnwrapped && !chainAll,
  17132. onlyLazy = isLazy && !isHybrid;
  17133. if (!retUnwrapped && useLazy) {
  17134. value = onlyLazy ? value : new LazyWrapper(this);
  17135. var result = func.apply(value, args);
  17136. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17137. return new LodashWrapper(result, chainAll);
  17138. }
  17139. if (isUnwrapped && onlyLazy) {
  17140. return func.apply(this, args);
  17141. }
  17142. result = this.thru(interceptor);
  17143. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17144. };
  17145. });
  17146. // Add `Array` methods to `lodash.prototype`.
  17147. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17148. var func = arrayProto[methodName],
  17149. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17150. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17151. lodash.prototype[methodName] = function() {
  17152. var args = arguments;
  17153. if (retUnwrapped && !this.__chain__) {
  17154. var value = this.value();
  17155. return func.apply(isArray(value) ? value : [], args);
  17156. }
  17157. return this[chainName](function(value) {
  17158. return func.apply(isArray(value) ? value : [], args);
  17159. });
  17160. };
  17161. });
  17162. // Map minified method names to their real names.
  17163. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17164. var lodashFunc = lodash[methodName];
  17165. if (lodashFunc) {
  17166. var key = lodashFunc.name + '';
  17167. if (!hasOwnProperty.call(realNames, key)) {
  17168. realNames[key] = [];
  17169. }
  17170. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17171. }
  17172. });
  17173. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17174. 'name': 'wrapper',
  17175. 'func': undefined
  17176. }];
  17177. // Add methods to `LazyWrapper`.
  17178. LazyWrapper.prototype.clone = lazyClone;
  17179. LazyWrapper.prototype.reverse = lazyReverse;
  17180. LazyWrapper.prototype.value = lazyValue;
  17181. // Add chain sequence methods to the `lodash` wrapper.
  17182. lodash.prototype.at = wrapperAt;
  17183. lodash.prototype.chain = wrapperChain;
  17184. lodash.prototype.commit = wrapperCommit;
  17185. lodash.prototype.next = wrapperNext;
  17186. lodash.prototype.plant = wrapperPlant;
  17187. lodash.prototype.reverse = wrapperReverse;
  17188. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17189. // Add lazy aliases.
  17190. lodash.prototype.first = lodash.prototype.head;
  17191. if (symIterator) {
  17192. lodash.prototype[symIterator] = wrapperToIterator;
  17193. }
  17194. return lodash;
  17195. });
  17196. /*--------------------------------------------------------------------------*/
  17197. // Export lodash.
  17198. var _ = runInContext();
  17199. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17200. if (true) {
  17201. // Expose Lodash on the global object to prevent errors when Lodash is
  17202. // loaded by a script tag in the presence of an AMD loader.
  17203. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17204. // Use `_.noConflict` to remove Lodash from the global object.
  17205. root._ = _;
  17206. // Define as an anonymous module so, through path mapping, it can be
  17207. // referenced as the "underscore" module.
  17208. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17209. return _;
  17210. }).call(exports, __webpack_require__, exports, module),
  17211. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17212. }
  17213. // Check for `exports` after `define` in case a build optimizer adds it.
  17214. else {}
  17215. }.call(this));
  17216. /***/ }),
  17217. /***/ "./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":
  17218. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17219. !*** ./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 ***!
  17220. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17221. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17222. "use strict";
  17223. __webpack_require__.r(__webpack_exports__);
  17224. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17225. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17226. /* harmony export */ });
  17227. /* 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");
  17228. /* 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__);
  17229. /* 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");
  17230. var options = {};
  17231. options.insert = "head";
  17232. options.singleton = false;
  17233. 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);
  17234. /* 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 || {});
  17235. /***/ }),
  17236. /***/ "./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":
  17237. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17238. !*** ./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 ***!
  17239. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17240. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17241. "use strict";
  17242. __webpack_require__.r(__webpack_exports__);
  17243. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17244. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17245. /* harmony export */ });
  17246. /* 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");
  17247. /* 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__);
  17248. /* 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");
  17249. var options = {};
  17250. options.insert = "head";
  17251. options.singleton = false;
  17252. 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);
  17253. /* 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 || {});
  17254. /***/ }),
  17255. /***/ "./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":
  17256. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17257. !*** ./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 ***!
  17258. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17259. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17260. "use strict";
  17261. __webpack_require__.r(__webpack_exports__);
  17262. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17263. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17264. /* harmony export */ });
  17265. /* 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");
  17266. /* 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__);
  17267. /* 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");
  17268. var options = {};
  17269. options.insert = "head";
  17270. options.singleton = false;
  17271. 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);
  17272. /* 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 || {});
  17273. /***/ }),
  17274. /***/ "./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":
  17275. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17276. !*** ./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 ***!
  17277. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17278. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17279. "use strict";
  17280. __webpack_require__.r(__webpack_exports__);
  17281. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17282. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17283. /* harmony export */ });
  17284. /* 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");
  17285. /* 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__);
  17286. /* 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");
  17287. var options = {};
  17288. options.insert = "head";
  17289. options.singleton = false;
  17290. 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);
  17291. /* 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 || {});
  17292. /***/ }),
  17293. /***/ "./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":
  17294. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17295. !*** ./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 ***!
  17296. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17297. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17298. "use strict";
  17299. __webpack_require__.r(__webpack_exports__);
  17300. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17301. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17302. /* harmony export */ });
  17303. /* 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");
  17304. /* 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__);
  17305. /* 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");
  17306. var options = {};
  17307. options.insert = "head";
  17308. options.singleton = false;
  17309. 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);
  17310. /* 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 || {});
  17311. /***/ }),
  17312. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17313. /*!******************************************************!*\
  17314. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17315. \******************************************************/
  17316. /***/ ((__unused_webpack_module, exports) => {
  17317. "use strict";
  17318. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17319. // runtime helper for setting properties on components
  17320. // in a tree-shakable way
  17321. exports["default"] = (sfc, props) => {
  17322. const target = sfc.__vccOpts || sfc;
  17323. for (const [key, val] of props) {
  17324. target[key] = val;
  17325. }
  17326. return target;
  17327. };
  17328. /***/ }),
  17329. /***/ "./resources/js/components/AppFooter.vue":
  17330. /*!***********************************************!*\
  17331. !*** ./resources/js/components/AppFooter.vue ***!
  17332. \***********************************************/
  17333. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17334. "use strict";
  17335. __webpack_require__.r(__webpack_exports__);
  17336. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17337. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17338. /* harmony export */ });
  17339. /* 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");
  17340. /* 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");
  17341. /* 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");
  17342. const script = {}
  17343. ;
  17344. 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"]])
  17345. /* hot reload */
  17346. if (false) {}
  17347. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17348. /***/ }),
  17349. /***/ "./resources/js/components/AppMessage.vue":
  17350. /*!************************************************!*\
  17351. !*** ./resources/js/components/AppMessage.vue ***!
  17352. \************************************************/
  17353. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17354. "use strict";
  17355. __webpack_require__.r(__webpack_exports__);
  17356. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17357. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17358. /* harmony export */ });
  17359. /* 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");
  17360. /* 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");
  17361. /* 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");
  17362. ;
  17363. 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"]])
  17364. /* hot reload */
  17365. if (false) {}
  17366. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17367. /***/ }),
  17368. /***/ "./resources/js/components/AppSidebar.vue":
  17369. /*!************************************************!*\
  17370. !*** ./resources/js/components/AppSidebar.vue ***!
  17371. \************************************************/
  17372. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17373. "use strict";
  17374. __webpack_require__.r(__webpack_exports__);
  17375. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17376. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17377. /* harmony export */ });
  17378. /* 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");
  17379. /* 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");
  17380. /* 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");
  17381. /* 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");
  17382. ;
  17383. 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"]])
  17384. /* hot reload */
  17385. if (false) {}
  17386. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17387. /***/ }),
  17388. /***/ "./resources/js/components/AppSubSidebar.vue":
  17389. /*!***************************************************!*\
  17390. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17391. \***************************************************/
  17392. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17393. "use strict";
  17394. __webpack_require__.r(__webpack_exports__);
  17395. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17396. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17397. /* harmony export */ });
  17398. /* 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");
  17399. /* 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");
  17400. /* 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");
  17401. /* 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");
  17402. ;
  17403. 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"]])
  17404. /* hot reload */
  17405. if (false) {}
  17406. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17407. /***/ }),
  17408. /***/ "./resources/js/components/AppTopBar.vue":
  17409. /*!***********************************************!*\
  17410. !*** ./resources/js/components/AppTopBar.vue ***!
  17411. \***********************************************/
  17412. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17413. "use strict";
  17414. __webpack_require__.r(__webpack_exports__);
  17415. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17416. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17417. /* harmony export */ });
  17418. /* 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");
  17419. /* 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");
  17420. /* 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");
  17421. /* 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");
  17422. ;
  17423. 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"]])
  17424. /* hot reload */
  17425. if (false) {}
  17426. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17427. /***/ }),
  17428. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17429. /*!**************************************************!*\
  17430. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17431. \**************************************************/
  17432. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17433. "use strict";
  17434. __webpack_require__.r(__webpack_exports__);
  17435. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17436. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17437. /* harmony export */ });
  17438. /* 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");
  17439. /* 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");
  17440. /* 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");
  17441. /* 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");
  17442. ;
  17443. 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"]])
  17444. /* hot reload */
  17445. if (false) {}
  17446. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17447. /***/ }),
  17448. /***/ "./resources/js/pages/home/Index.vue":
  17449. /*!*******************************************!*\
  17450. !*** ./resources/js/pages/home/Index.vue ***!
  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 _Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=9329f6aa */ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa");
  17459. /* 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/home/Index.vue?vue&type=script&setup=true&lang=js");
  17460. /* 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");
  17461. ;
  17462. 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_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/home/Index.vue"]])
  17463. /* hot reload */
  17464. if (false) {}
  17465. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17466. /***/ }),
  17467. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17468. /*!***********************************************************************************!*\
  17469. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  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": () => (/* 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"])
  17476. /* harmony export */ });
  17477. /* 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");
  17478. /***/ }),
  17479. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17480. /*!***********************************************************************************!*\
  17481. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17482. \***********************************************************************************/
  17483. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17484. "use strict";
  17485. __webpack_require__.r(__webpack_exports__);
  17486. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17487. /* 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"])
  17488. /* harmony export */ });
  17489. /* 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");
  17490. /***/ }),
  17491. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17492. /*!**************************************************************************************!*\
  17493. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17494. \**************************************************************************************/
  17495. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17496. "use strict";
  17497. __webpack_require__.r(__webpack_exports__);
  17498. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17499. /* 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"])
  17500. /* harmony export */ });
  17501. /* 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");
  17502. /***/ }),
  17503. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17504. /*!**********************************************************************************!*\
  17505. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  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": () => (/* 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"])
  17512. /* harmony export */ });
  17513. /* 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");
  17514. /***/ }),
  17515. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17516. /*!*************************************************************************************!*\
  17517. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17518. \*************************************************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* 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"])
  17524. /* harmony export */ });
  17525. /* 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");
  17526. /***/ }),
  17527. /***/ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  17528. /*!******************************************************************************!*\
  17529. !*** ./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  17530. \******************************************************************************/
  17531. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17532. "use strict";
  17533. __webpack_require__.r(__webpack_exports__);
  17534. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17535. /* 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"])
  17536. /* harmony export */ });
  17537. /* 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/home/Index.vue?vue&type=script&setup=true&lang=js");
  17538. /***/ }),
  17539. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17540. /*!*****************************************************************************************!*\
  17541. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17542. \*****************************************************************************************/
  17543. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17544. "use strict";
  17545. __webpack_require__.r(__webpack_exports__);
  17546. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17547. /* 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)
  17548. /* harmony export */ });
  17549. /* 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");
  17550. /***/ }),
  17551. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17552. /*!******************************************************************************!*\
  17553. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17554. \******************************************************************************/
  17555. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17556. "use strict";
  17557. __webpack_require__.r(__webpack_exports__);
  17558. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17559. /* 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)
  17560. /* harmony export */ });
  17561. /* 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");
  17562. /***/ }),
  17563. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17564. /*!******************************************************************************************!*\
  17565. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17566. \******************************************************************************************/
  17567. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17568. "use strict";
  17569. __webpack_require__.r(__webpack_exports__);
  17570. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17571. /* 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)
  17572. /* harmony export */ });
  17573. /* 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");
  17574. /***/ }),
  17575. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17576. /*!*********************************************************************************************!*\
  17577. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17578. \*********************************************************************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* 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)
  17584. /* harmony export */ });
  17585. /* 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");
  17586. /***/ }),
  17587. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17588. /*!*****************************************************************************************!*\
  17589. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17590. \*****************************************************************************************/
  17591. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17592. "use strict";
  17593. __webpack_require__.r(__webpack_exports__);
  17594. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17595. /* 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)
  17596. /* harmony export */ });
  17597. /* 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");
  17598. /***/ }),
  17599. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17600. /*!********************************************************************************************!*\
  17601. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17602. \********************************************************************************************/
  17603. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17604. "use strict";
  17605. __webpack_require__.r(__webpack_exports__);
  17606. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17607. /* 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)
  17608. /* harmony export */ });
  17609. /* 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");
  17610. /***/ }),
  17611. /***/ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  17612. /*!*************************************************************************!*\
  17613. !*** ./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  17614. \*************************************************************************/
  17615. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17616. "use strict";
  17617. __webpack_require__.r(__webpack_exports__);
  17618. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17619. /* 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_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render)
  17620. /* harmony export */ });
  17621. /* 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_9329f6aa__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=9329f6aa */ "./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/home/Index.vue?vue&type=template&id=9329f6aa");
  17622. /***/ }),
  17623. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17624. /*!********************************************************************************************************!*\
  17625. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17626. \********************************************************************************************************/
  17627. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17628. "use strict";
  17629. __webpack_require__.r(__webpack_exports__);
  17630. /* 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");
  17631. /***/ }),
  17632. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17633. /*!*********************************************************************************************************!*\
  17634. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17635. \*********************************************************************************************************/
  17636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17637. "use strict";
  17638. __webpack_require__.r(__webpack_exports__);
  17639. /* 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");
  17640. /***/ }),
  17641. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17642. /*!************************************************************************************************************!*\
  17643. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17644. \************************************************************************************************************/
  17645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17646. "use strict";
  17647. __webpack_require__.r(__webpack_exports__);
  17648. /* 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");
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17651. /*!********************************************************************************************************!*\
  17652. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17653. \********************************************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* 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");
  17658. /***/ }),
  17659. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17660. /*!***********************************************************************************************************!*\
  17661. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17662. \***********************************************************************************************************/
  17663. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17664. "use strict";
  17665. __webpack_require__.r(__webpack_exports__);
  17666. /* 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");
  17667. /***/ })
  17668. }]);